From ac4481dc35f66643a4432bbce761b4a47be758e3 Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 17 Feb 2018 01:39:49 -0500 Subject: yunsung8.cpp: Soundlatch modernization (nw) --- src/mame/drivers/yunsung8.cpp | 17 +++-------------- src/mame/includes/yunsung8.h | 7 +------ 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/mame/drivers/yunsung8.cpp b/src/mame/drivers/yunsung8.cpp index c58d149762b..7539d32ace9 100644 --- a/src/mame/drivers/yunsung8.cpp +++ b/src/mame/drivers/yunsung8.cpp @@ -56,18 +56,6 @@ WRITE8_MEMBER(yunsung8_state::bankswitch_w) logerror("CPU #0 - PC %04X: Bank %02X\n", m_maincpu->pc(), data); } -READ8_MEMBER(yunsung8_state::sound_command_r) -{ - m_audiocpu->set_input_line(0, CLEAR_LINE); - return m_soundlatch->read(space, 0); -} - -WRITE8_MEMBER(yunsung8_state::sound_command_w) -{ - m_soundlatch->write(space, 0, data); - m_audiocpu->set_input_line(0, ASSERT_LINE); -} - WRITE8_MEMBER(yunsung8_state::main_irq_ack_w) { m_maincpu->set_input_line(0, CLEAR_LINE); @@ -95,7 +83,7 @@ ADDRESS_MAP_START(yunsung8_state::port_map) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_READ_PORT("SYSTEM") AM_WRITE(videobank_w) // video RAM bank AM_RANGE(0x01, 0x01) AM_READ_PORT("P1") AM_WRITE(bankswitch_w) // ROM Bank + Layers Enable - AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") AM_WRITE(sound_command_w) // To Sound CPU + AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") AM_DEVWRITE("soundlatch", generic_latch_8_device, write) // To Sound CPU AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW2") AM_RANGE(0x06, 0x06) AM_WRITE(flipscreen_w) // Flip Screen @@ -131,7 +119,7 @@ ADDRESS_MAP_START(yunsung8_state::sound_map) AM_RANGE(0xe400, 0xe400) AM_DEVWRITE("adpcm_select", ls157_device, ba_w) AM_RANGE(0xec00, 0xec01) AM_DEVWRITE("ymsnd", ym3812_device, write) AM_RANGE(0xf000, 0xf7ff) AM_RAM - AM_RANGE(0xf800, 0xf800) AM_READ(sound_command_r) // From Main CPU + AM_RANGE(0xf800, 0xf800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) // From Main CPU ADDRESS_MAP_END @@ -375,6 +363,7 @@ MACHINE_CONFIG_START(yunsung8_state::yunsung8) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ADD("ymsnd", YM3812, XTAL(16'000'000)/4) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) diff --git a/src/mame/includes/yunsung8.h b/src/mame/includes/yunsung8.h index 0dae4cb52de..5fc3b830df0 100644 --- a/src/mame/includes/yunsung8.h +++ b/src/mame/includes/yunsung8.h @@ -6,7 +6,6 @@ *************************************************************************/ -#include "machine/gen_latch.h" #include "machine/74157.h" #include "sound/msm5205.h" @@ -20,8 +19,7 @@ public: m_msm(*this, "msm"), m_adpcm_select(*this, "adpcm_select"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch") + m_palette(*this, "palette") { } @@ -43,14 +41,11 @@ public: required_device m_adpcm_select; required_device m_gfxdecode; required_device m_palette; - required_device m_soundlatch; /* memory */ uint8_t m_videoram[0x4000]; DECLARE_WRITE8_MEMBER(bankswitch_w); - DECLARE_READ8_MEMBER(sound_command_r); - DECLARE_WRITE8_MEMBER(sound_command_w); DECLARE_WRITE8_MEMBER(main_irq_ack_w); DECLARE_WRITE8_MEMBER(videobank_w); DECLARE_READ8_MEMBER(videoram_r); -- cgit v1.2.3