diff --git a/src/mame/drivers/ashnojoe.cpp b/src/mame/drivers/ashnojoe.cpp index d658cff8c6c..3bab957d1fc 100644 --- a/src/mame/drivers/ashnojoe.cpp +++ b/src/mame/drivers/ashnojoe.cpp @@ -287,14 +287,12 @@ WRITE_LINE_MEMBER(ashnojoe_state::ashnojoe_vclk_cb) void ashnojoe_state::machine_start() { save_item(NAME(m_adpcm_byte)); - save_item(NAME(m_soundlatch_status)); save_item(NAME(m_msm5205_vclk_toggle)); } void ashnojoe_state::machine_reset() { m_adpcm_byte = 0; - m_soundlatch_status = 0; m_msm5205_vclk_toggle = 0; } diff --git a/src/mame/drivers/crospang.cpp b/src/mame/drivers/crospang.cpp index eb9a7f9d1bd..b2702b871ca 100644 --- a/src/mame/drivers/crospang.cpp +++ b/src/mame/drivers/crospang.cpp @@ -40,14 +40,6 @@ #include "includes/crospang.h" -WRITE16_MEMBER(crospang_state::crospang_soundlatch_w) -{ - if(ACCESSING_BITS_0_7) - { - m_soundlatch->write(space, 0, data & 0xff); - } -} - /* main cpu */ static ADDRESS_MAP_START( crospang_base_map, AS_PROGRAM, 16, crospang_state ) @@ -57,7 +49,7 @@ static ADDRESS_MAP_START( crospang_base_map, AS_PROGRAM, 16, crospang_state ) AM_RANGE(0x122000, 0x1227ff) AM_RAM_WRITE(crospang_bg_videoram_w) AM_SHARE("bg_videoram") AM_RANGE(0x200000, 0x2005ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_RANGE(0x210000, 0x2107ff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0x270000, 0x270001) AM_WRITE(crospang_soundlatch_w) + AM_RANGE(0x270000, 0x270001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff) AM_RANGE(0x270004, 0x270007) AM_WRITENOP // ?? AM_RANGE(0x280000, 0x280001) AM_READ_PORT("P1_P2") AM_RANGE(0x280002, 0x280003) AM_READ_PORT("COIN") diff --git a/src/mame/drivers/crshrace.cpp b/src/mame/drivers/crshrace.cpp index f56cc5643f2..b4ad32f78c0 100644 --- a/src/mame/drivers/crshrace.cpp +++ b/src/mame/drivers/crshrace.cpp @@ -143,14 +143,11 @@ WRITE8_MEMBER(crshrace_state::crshrace_sh_bankswitch_w) m_z80bank->set_entry(data & 0x03); } -WRITE16_MEMBER(crshrace_state::sound_command_w) +WRITE8_MEMBER(crshrace_state::sound_command_w) { - if (ACCESSING_BITS_0_7) - { - m_pending_command = 1; - m_soundlatch->write(space, offset, data & 0xff); - m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); - } + m_pending_command = 1; + m_soundlatch->write(space, offset, data & 0xff); + m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } CUSTOM_INPUT_MEMBER(crshrace_state::country_sndpending_r) @@ -164,7 +161,6 @@ WRITE8_MEMBER(crshrace_state::pending_command_clear_w) } - static ADDRESS_MAP_START( crshrace_map, AS_PROGRAM, 16, crshrace_state ) AM_RANGE(0x000000, 0x07ffff) AM_ROM AM_RANGE(0x300000, 0x3fffff) AM_ROM AM_REGION("user1", 0) @@ -180,7 +176,7 @@ static ADDRESS_MAP_START( crshrace_map, AS_PROGRAM, 16, crshrace_state ) AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("P2") AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW0") AM_RANGE(0xfff006, 0xfff007) AM_READ_PORT("DSW2") - AM_RANGE(0xfff008, 0xfff009) AM_WRITE(sound_command_w) + AM_RANGE(0xfff008, 0xfff009) AM_WRITE8(sound_command_w, 0x00ff) AM_RANGE(0xfff00a, 0xfff00b) AM_READ_PORT("DSW1") AM_RANGE(0xfff00e, 0xfff00f) AM_READ_PORT("P3") AM_RANGE(0xfff020, 0xfff03f) AM_DEVWRITE("k053936", k053936_device, ctrl_w) diff --git a/src/mame/drivers/dcheese.cpp b/src/mame/drivers/dcheese.cpp index 2aad3a511de..59d07364a06 100644 --- a/src/mame/drivers/dcheese.cpp +++ b/src/mame/drivers/dcheese.cpp @@ -92,7 +92,6 @@ INTERRUPT_GEN_MEMBER(dcheese_state::dcheese_vblank) void dcheese_state::machine_start() { save_item(NAME(m_irq_state)); - save_item(NAME(m_soundlatch_full)); save_item(NAME(m_sound_control)); save_item(NAME(m_sound_msb_latch)); } @@ -107,7 +106,7 @@ void dcheese_state::machine_start() CUSTOM_INPUT_MEMBER(dcheese_state::sound_latch_state_r) { - return m_soundlatch_full; + return m_soundlatch->pending_r(); } @@ -123,18 +122,6 @@ WRITE16_MEMBER(dcheese_state::eeprom_control_w) } -WRITE16_MEMBER(dcheese_state::sound_command_w) -{ - if (ACCESSING_BITS_0_7) - { - /* write the latch and set the IRQ */ - m_soundlatch_full = 1; - m_audiocpu->set_input_line(0, ASSERT_LINE); - m_soundlatch->write(space, 0, data & 0xff); - } -} - - /************************************* * @@ -142,15 +129,6 @@ WRITE16_MEMBER(dcheese_state::sound_command_w) * *************************************/ -READ8_MEMBER(dcheese_state::sound_command_r) -{ - /* read the latch and clear the IRQ */ - m_soundlatch_full = 0; - m_audiocpu->set_input_line(0, CLEAR_LINE); - return m_soundlatch->read(space, 0); -} - - READ8_MEMBER(dcheese_state::sound_status_r) { /* seems to be ready signal on BSMT or latching hardware */ @@ -202,7 +180,7 @@ static ADDRESS_MAP_START( main_cpu_map, AS_PROGRAM, 16, dcheese_state ) AM_RANGE(0x260000, 0x26001f) AM_WRITE(madmax_blitter_xparam_w) AM_RANGE(0x280000, 0x28001f) AM_WRITE(madmax_blitter_yparam_w) AM_RANGE(0x2a0000, 0x2a003f) AM_READWRITE(madmax_blitter_vidparam_r, madmax_blitter_vidparam_w) - AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(sound_command_w) + AM_RANGE(0x2e0000, 0x2e0001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff) AM_RANGE(0x300000, 0x300001) AM_WRITE(madmax_blitter_unknown_w) ADDRESS_MAP_END @@ -217,7 +195,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sound_cpu_map, AS_PROGRAM, 8, dcheese_state ) ADDRESS_MAP_UNMAP_HIGH AM_RANGE(0x0000, 0x07ff) AM_READWRITE(sound_status_r, sound_control_w) - AM_RANGE(0x0800, 0x0fff) AM_READ(sound_command_r) + AM_RANGE(0x0800, 0x0fff) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x1000, 0x10ff) AM_MIRROR(0x0700) AM_WRITE(bsmt_data_w) AM_RANGE(0x1800, 0x1fff) AM_RAM AM_RANGE(0x2000, 0xffff) AM_ROM @@ -421,6 +399,7 @@ static MACHINE_CONFIG_START( dcheese, dcheese_state ) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0)) MCFG_BSMT2000_ADD("bsmt", SOUND_OSC) MCFG_SOUND_ROUTE(0, "lspeaker", 1.2) diff --git a/src/mame/includes/ashnojoe.h b/src/mame/includes/ashnojoe.h index 40ddf976d03..4735df63f43 100644 --- a/src/mame/includes/ashnojoe.h +++ b/src/mame/includes/ashnojoe.h @@ -51,7 +51,6 @@ public: /* sound-related */ uint8_t m_adpcm_byte; - int m_soundlatch_status; int m_msm5205_vclk_toggle; /* devices */ diff --git a/src/mame/includes/crospang.h b/src/mame/includes/crospang.h index 2a7b80e0059..0049f726a56 100644 --- a/src/mame/includes/crospang.h +++ b/src/mame/includes/crospang.h @@ -38,7 +38,6 @@ public: required_device m_gfxdecode; required_device m_soundlatch; - DECLARE_WRITE16_MEMBER(crospang_soundlatch_w); DECLARE_WRITE16_MEMBER(bestri_tilebank_w); DECLARE_WRITE16_MEMBER(bestri_bg_scrolly_w); DECLARE_WRITE16_MEMBER(bestri_fg_scrolly_w); diff --git a/src/mame/includes/crshrace.h b/src/mame/includes/crshrace.h index 36ef377e777..9d1621000d8 100644 --- a/src/mame/includes/crshrace.h +++ b/src/mame/includes/crshrace.h @@ -54,7 +54,7 @@ public: /* devices */ DECLARE_WRITE8_MEMBER(crshrace_sh_bankswitch_w); - DECLARE_WRITE16_MEMBER(sound_command_w); + DECLARE_WRITE8_MEMBER(sound_command_w); DECLARE_WRITE8_MEMBER(pending_command_clear_w); DECLARE_WRITE16_MEMBER(crshrace_videoram1_w); DECLARE_WRITE16_MEMBER(crshrace_videoram2_w); diff --git a/src/mame/includes/dcheese.h b/src/mame/includes/dcheese.h index 396cd2fc0db..853a3b46a83 100644 --- a/src/mame/includes/dcheese.h +++ b/src/mame/includes/dcheese.h @@ -38,7 +38,6 @@ public: /* misc */ uint8_t m_irq_state[5]; - uint8_t m_soundlatch_full; uint8_t m_sound_control; uint8_t m_sound_msb_latch; @@ -50,8 +49,6 @@ public: required_device m_soundlatch; DECLARE_WRITE16_MEMBER(eeprom_control_w); - DECLARE_WRITE16_MEMBER(sound_command_w); - DECLARE_READ8_MEMBER(sound_command_r); DECLARE_READ8_MEMBER(sound_status_r); DECLARE_WRITE8_MEMBER(sound_control_w); DECLARE_WRITE8_MEMBER(bsmt_data_w);