diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2017-06-14 11:43:11 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2017-06-14 11:43:11 -0400 |
commit | 2c63f0e4fe4969ce041f52d07a77cc0e4d8c7f90 (patch) | |
tree | 27cede73dcf011f251d85cc050190ec80b160a4a /src/mame/drivers/f1gp.cpp | |
parent | 81d192fee649239b30ec0618ed4482450678ce12 (diff) |
f1gp.cpp: Soundlatch modernization (nw)
Diffstat (limited to 'src/mame/drivers/f1gp.cpp')
-rw-r--r-- | src/mame/drivers/f1gp.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/mame/drivers/f1gp.cpp b/src/mame/drivers/f1gp.cpp index 857299a4e14..8fe048c30ad 100644 --- a/src/mame/drivers/f1gp.cpp +++ b/src/mame/drivers/f1gp.cpp @@ -45,21 +45,9 @@ WRITE8_MEMBER(f1gp_state::f1gp_sh_bankswitch_w) } -WRITE8_MEMBER(f1gp_state::sound_command_w) -{ - m_pending_command = 1; - m_soundlatch->write(space, offset, data & 0xff); - m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); -} - READ8_MEMBER(f1gp_state::command_pending_r) { - return (m_pending_command ? 0xff : 0); -} - -WRITE8_MEMBER(f1gp_state::pending_command_clear_w) -{ - m_pending_command = 0; + return (m_soundlatch->pending_r() ? 0xff : 0); } @@ -86,7 +74,7 @@ static ADDRESS_MAP_START( f1gp_cpu1_map, AS_PROGRAM, 16, f1gp_state ) AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW1") AM_RANGE(0xfff002, 0xfff005) AM_WRITE(f1gp_fgscroll_w) AM_RANGE(0xfff006, 0xfff007) AM_READ_PORT("DSW2") - AM_RANGE(0xfff008, 0xfff009) AM_READWRITE8(command_pending_r, sound_command_w, 0x00ff) + AM_RANGE(0xfff008, 0xfff009) AM_READ8(command_pending_r, 0x00ff) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff) AM_RANGE(0xfff020, 0xfff023) AM_DEVWRITE8("gga", vsystem_gga_device, write, 0x00ff) AM_RANGE(0xfff040, 0xfff05f) AM_DEVWRITE("k053936", k053936_device, ctrl_w) AM_RANGE(0xfff050, 0xfff051) AM_READ_PORT("DSW3") @@ -106,7 +94,7 @@ static ADDRESS_MAP_START( f1gp2_cpu1_map, AS_PROGRAM, 16, f1gp_state ) // AM_RANGE(0xfff002, 0xfff003) analog wheel? AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW1") AM_RANGE(0xfff006, 0xfff007) AM_READ_PORT("DSW2") - AM_RANGE(0xfff008, 0xfff009) AM_READWRITE8(command_pending_r, sound_command_w, 0x00ff) + AM_RANGE(0xfff008, 0xfff009) AM_READ8(command_pending_r, 0x00ff) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff) AM_RANGE(0xfff00a, 0xfff00b) AM_READ_PORT("DSW3") AM_RANGE(0xfff020, 0xfff03f) AM_DEVWRITE("k053936", k053936_device, ctrl_w) AM_RANGE(0xfff044, 0xfff047) AM_WRITE(f1gp_fgscroll_w) @@ -128,7 +116,7 @@ static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, f1gp_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_WRITE(f1gp_sh_bankswitch_w) // f1gp AM_RANGE(0x0c, 0x0c) AM_WRITE(f1gp_sh_bankswitch_w) // f1gp2 - AM_RANGE(0x14, 0x14) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(pending_command_clear_w) + AM_RANGE(0x14, 0x14) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, acknowledge_w) AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write) ADDRESS_MAP_END @@ -368,7 +356,6 @@ GFXDECODE_END MACHINE_START_MEMBER(f1gp_state,f1gpb) { - save_item(NAME(m_pending_command)); save_item(NAME(m_roz_bank)); save_item(NAME(m_flipscreen)); save_item(NAME(m_gfxctrl)); @@ -384,7 +371,6 @@ MACHINE_START_MEMBER(f1gp_state,f1gp) MACHINE_RESET_MEMBER(f1gp_state,f1gp) { - m_pending_command = 0; m_roz_bank = 0; m_flipscreen = 0; m_gfxctrl = 0; @@ -448,6 +434,8 @@ static MACHINE_CONFIG_START( f1gp ) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI)) + MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true) MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz) MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) |