From 641db345a012d841641f69a87a9fac62cd93c5da Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 8 May 2019 20:40:35 -0400 Subject: [PATCH] retofinv: Soundlatch modernization (nw) --- src/mame/drivers/retofinv.cpp | 14 +++++--------- src/mame/includes/retofinv.h | 4 ---- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/mame/drivers/retofinv.cpp b/src/mame/drivers/retofinv.cpp index b951cce01fc..ae43a4d88f9 100644 --- a/src/mame/drivers/retofinv.cpp +++ b/src/mame/drivers/retofinv.cpp @@ -107,6 +107,7 @@ Notes: #include "includes/retofinv.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "machine/watchdog.h" #include "sound/sn76496.h" #include "screen.h" @@ -130,12 +131,6 @@ READ8_MEMBER(retofinv_state::cpu0_mf800_r) return m_cpu2_m6000; } -WRITE8_MEMBER(retofinv_state::soundcommand_w) -{ - m_soundlatch->write(data); - m_audiocpu->set_input_line(0, HOLD_LINE); -} - WRITE_LINE_MEMBER(retofinv_state::irq0_ack_w) { m_main_irq_mask = state; @@ -193,7 +188,7 @@ void retofinv_state::bootleg_map(address_map &map) map(0xc007, 0xc007).portr("DSW3"); map(0xc800, 0xc807).w("mainlatch", FUNC(ls259_device::write_d0)); map(0xd000, 0xd000).w("watchdog", FUNC(watchdog_timer_device::reset_w)); - map(0xd800, 0xd800).w(FUNC(retofinv_state::soundcommand_w)); + map(0xd800, 0xd800).w("soundlatch", FUNC(generic_latch_8_device::write)); map(0xf800, 0xf800).r(FUNC(retofinv_state::cpu0_mf800_r)); } @@ -218,7 +213,7 @@ void retofinv_state::sound_map(address_map &map) { map(0x0000, 0x1fff).rom(); map(0x2000, 0x27ff).ram(); /* 6116 sram at IC28 */ - map(0x4000, 0x4000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0x4000, 0x4000).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0x6000, 0x6000).w(FUNC(retofinv_state::cpu2_m6000_w)); map(0x8000, 0x8000).w("sn1", FUNC(sn76489a_device::write)); map(0xa000, 0xa000).w("sn2", FUNC(sn76489a_device::write)); @@ -456,7 +451,8 @@ void retofinv_state::retofinv(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - GENERIC_LATCH_8(config, m_soundlatch); + generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch")); + soundlatch.data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); SN76489A(config, "sn1", XTAL(18'432'000)/6).add_route(ALL_OUTPUTS, "mono", 0.80); /* @IC5?; XTAL, chip type, and divider verified, 3.072 MHz */ diff --git a/src/mame/includes/retofinv.h b/src/mame/includes/retofinv.h index 14b326e2c39..3d535ba906f 100644 --- a/src/mame/includes/retofinv.h +++ b/src/mame/includes/retofinv.h @@ -6,7 +6,6 @@ #pragma once #include "machine/74259.h" -#include "machine/gen_latch.h" #include "machine/taito68705interface.h" #include "emupal.h" @@ -22,7 +21,6 @@ public: , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") , m_mainlatch(*this, "mainlatch") - , m_soundlatch(*this, "soundlatch") , m_fg_videoram(*this, "fg_videoram") , m_sharedram(*this, "sharedram") , m_bg_videoram(*this, "bg_videoram") @@ -41,7 +39,6 @@ protected: private: DECLARE_WRITE8_MEMBER(cpu2_m6000_w); DECLARE_READ8_MEMBER(cpu0_mf800_r); - DECLARE_WRITE8_MEMBER(soundcommand_w); DECLARE_WRITE_LINE_MEMBER(irq0_ack_w); DECLARE_WRITE_LINE_MEMBER(irq1_ack_w); DECLARE_WRITE8_MEMBER(coincounter_w); @@ -77,7 +74,6 @@ private: required_device m_gfxdecode; required_device m_palette; required_device m_mainlatch; - required_device m_soundlatch; required_shared_ptr m_fg_videoram; required_shared_ptr m_sharedram;