From 942a42d0f98926aab5b5f383a90eca7f4fc0d686 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Thu, 1 Dec 2011 02:04:22 +0000 Subject: [PATCH] Added proper sound to yieartf set [Angelo Salese] --- src/mame/drivers/trackfld.c | 27 ++++++++++++++++++++++++--- src/mame/drivers/yiear.c | 4 ++-- src/mame/includes/trackfld.h | 1 + src/mame/includes/yiear.h | 3 +++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c index ae4a2ebf572..1299f769344 100644 --- a/src/mame/drivers/trackfld.c +++ b/src/mame/drivers/trackfld.c @@ -191,6 +191,7 @@ MAIN BOARD: #include "includes/trackfld.h" #include "includes/konamipt.h" #include "machine/nvram.h" +#include "includes/yiear.h" #define MASTER_CLOCK XTAL_18_432MHz #define SOUND_CLOCK XTAL_14_31818MHz @@ -251,12 +252,23 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 ) AM_RANGE(0x6000, 0xffff) AM_ROM ADDRESS_MAP_END +static WRITE8_HANDLER( yieartf_nmi_mask_w ) +{ + trackfld_state *state = space->machine().driver_data(); + + state->m_yieartf_nmi_mask = data & 1; +} + static ADDRESS_MAP_START( yieartf_map, AS_PROGRAM, 8 ) + AM_RANGE(0x0000, 0x0000) AM_DEVREAD("vlm", yiear_speech_r) AM_WRITE(konami_SN76496_latch_w) + AM_RANGE(0x0001, 0x0001) AM_DEVWRITE("snsnd", konami_SN76496_w) + AM_RANGE(0x0002, 0x0002) AM_DEVWRITE("vlm", yiear_VLM5030_control_w) + AM_RANGE(0x0003, 0x0003) AM_DEVWRITE("vlm", vlm5030_data_w) AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x007f) AM_WRITE(watchdog_reset_w) /* AFE */ AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x0078) AM_WRITE(trackfld_flipscreen_w) /* FLIP */ AM_RANGE(0x1081, 0x1081) AM_MIRROR(0x0078) AM_WRITE(konami_sh_irqtrigger_w) /* 26 */ /* cause interrupt on audio CPU */ - AM_RANGE(0x1082, 0x1082) AM_MIRROR(0x0078) AM_WRITENOP /* 25 */ + AM_RANGE(0x1082, 0x1082) AM_MIRROR(0x0078) AM_WRITE(yieartf_nmi_mask_w) /* 25 */ AM_RANGE(0x1083, 0x1084) AM_MIRROR(0x0078) AM_WRITE(coin_w) /* 24, 23 */ AM_RANGE(0x1085, 0x1085) AM_MIRROR(0x0078) AM_WRITENOP /* CN3.2 */ AM_RANGE(0x1086, 0x1086) AM_MIRROR(0x0078) AM_WRITENOP /* CN3.4 */ @@ -945,12 +957,21 @@ static MACHINE_CONFIG_START( trackfld, trackfld_state ) MACHINE_CONFIG_END +static INTERRUPT_GEN( yieartf_timer_irq ) +{ + trackfld_state *state = device->machine().driver_data(); + + if (state->m_yieartf_nmi_mask) + device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); +} + static MACHINE_CONFIG_START( yieartf, trackfld_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/6/2) /* a guess for now */ MCFG_CPU_PROGRAM_MAP(yieartf_map) MCFG_CPU_VBLANK_INT("screen", vblank_irq) + MCFG_CPU_PERIODIC_INT(yieartf_timer_irq,480) // z80 isn't used // MCFG_CPU_ADD("audiocpu", Z80, SOUND_CLOCK/4) @@ -1503,9 +1524,9 @@ GAME( 1983, trackfldc, trackfld, trackfld, trackfld, trackfld, ROT0, "Konami (C GAME( 1983, hyprolym, trackfld, trackfld, trackfld, trackfld, ROT0, "Konami", "Hyper Olympic", GAME_SUPPORTS_SAVE ) GAME( 1983, hyprolymb, trackfld, hyprolyb, trackfld, trackfld, ROT0, "bootleg", "Hyper Olympic (bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) GAME( 1996, atlantol, trackfld, atlantol, atlantol, atlantol, ROT0, "bootleg", "Atlant Olimpic", GAME_SUPPORTS_SAVE ) -GAME( 1988, mastkin, 0, mastkin, mastkin, mastkin, ROT0, "Du Tech", "The Masters of Kin", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) GAME( 1982, trackfldnz,trackfld, trackfld, trackfld, trackfld, ROT0, "bootleg? (Goldberg Enterprizes Inc.)", "Track & Field (NZ bootleg?)", GAME_NOT_WORKING) +GAME( 1988, mastkin, 0, mastkin, mastkin, mastkin, ROT0, "Du Tech", "The Masters of Kin", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) GAME( 1985, wizzquiz, 0, wizzquiz, wizzquiz, wizzquiz, ROT0, "Zilec-Zenitone (Konami license)", "Wizz Quiz (Konami version)", GAME_SUPPORTS_SAVE ) GAME( 1985, wizzquiza, wizzquiz, wizzquiz, wizzquiz, wizzquiz, ROT0, "Zilec-Zenitone", "Wizz Quiz (version 4)", GAME_SUPPORTS_SAVE ) GAME( 1987, reaktor, 0, reaktor, reaktor, 0, ROT90, "Zilec", "Reaktor (Track & Field conversion)", GAME_SUPPORTS_SAVE ) -GAME( 1985, yieartf, yiear, yieartf, yieartf, 0, ROT0, "Konami", "Yie Ar Kung-Fu (GX361 conversion)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // the conversion looks of bootleg quality, but the code is clearly a very different revision to either original hardware set... +GAME( 1985, yieartf, yiear, yieartf, yieartf, 0, ROT0, "Konami", "Yie Ar Kung-Fu (GX361 conversion)", GAME_SUPPORTS_SAVE ) // the conversion looks of bootleg quality, but the code is clearly a very different revision to either original hardware set... diff --git a/src/mame/drivers/yiear.c b/src/mame/drivers/yiear.c index 0014d5755ae..0ecf808df55 100644 --- a/src/mame/drivers/yiear.c +++ b/src/mame/drivers/yiear.c @@ -94,7 +94,7 @@ _________________________|___________________________ #include "includes/yiear.h" -static READ8_DEVICE_HANDLER( yiear_speech_r ) +READ8_DEVICE_HANDLER( yiear_speech_r ) { if (vlm5030_bsy(device)) return 1; @@ -102,7 +102,7 @@ static READ8_DEVICE_HANDLER( yiear_speech_r ) return 0; } -static WRITE8_DEVICE_HANDLER( yiear_VLM5030_control_w ) +WRITE8_DEVICE_HANDLER( yiear_VLM5030_control_w ) { /* bit 0 is latch direction */ vlm5030_st(device, (data >> 1) & 1); diff --git a/src/mame/includes/trackfld.h b/src/mame/includes/trackfld.h index 67cc44f4c22..e68ae951d2d 100644 --- a/src/mame/includes/trackfld.h +++ b/src/mame/includes/trackfld.h @@ -29,6 +29,7 @@ public: int m_sprites_gfx_banked; UINT8 m_irq_mask; + UINT8 m_yieartf_nmi_mask; }; diff --git a/src/mame/includes/yiear.h b/src/mame/includes/yiear.h index 3a078004768..3e2cd8a8d85 100644 --- a/src/mame/includes/yiear.h +++ b/src/mame/includes/yiear.h @@ -26,3 +26,6 @@ WRITE8_HANDLER( yiear_control_w ); PALETTE_INIT( yiear ); VIDEO_START( yiear ); SCREEN_UPDATE( yiear ); + +READ8_DEVICE_HANDLER( yiear_speech_r ); +WRITE8_DEVICE_HANDLER( yiear_VLM5030_control_w );