From 76064c9198abc5dd574bd890dd67d544fab6fc4e Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 16 Dec 2018 13:19:41 +0100 Subject: hh_hmcs40: put audiocpu in subclass (nw) --- src/devices/cpu/e0c6200/e0c6s46.cpp | 5 +---- src/mame/drivers/hh_hmcs40.cpp | 33 ++++++++++++++++++--------------- src/mame/drivers/hh_sm510.cpp | 6 ++++++ src/mame/drivers/k28.cpp | 6 +++--- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/devices/cpu/e0c6200/e0c6s46.cpp b/src/devices/cpu/e0c6200/e0c6s46.cpp index 1cd3217f6ee..4a40dff3d70 100644 --- a/src/devices/cpu/e0c6200/e0c6s46.cpp +++ b/src/devices/cpu/e0c6200/e0c6s46.cpp @@ -354,10 +354,7 @@ u8 e0c6s46_device::read_p(u8 port) if (m_p_dir >> port & 1) return m_port_p[port]; - if (port < 4) - return m_read_p[port](port, 0xff); - - return 0; + return m_read_p[port](port, 0xff); } diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp index 294cd054d54..1f71702df8e 100644 --- a/src/mame/drivers/hh_hmcs40.cpp +++ b/src/mame/drivers/hh_hmcs40.cpp @@ -111,7 +111,6 @@ public: hh_hmcs40_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), m_soundlatch(*this, "soundlatch"), m_soundlatch2(*this, "soundlatch2"), m_inp_matrix(*this, "IN.%u", 0), @@ -126,7 +125,6 @@ public: // devices required_device m_maincpu; - optional_device m_audiocpu; optional_device m_soundlatch; optional_device m_soundlatch2; optional_ioport_array<7> m_inp_matrix; // max 7 @@ -1743,9 +1741,12 @@ class pairmtch_state : public hh_hmcs40_state { public: pairmtch_state(const machine_config &mconfig, device_type type, const char *tag) - : hh_hmcs40_state(mconfig, type, tag) + : hh_hmcs40_state(mconfig, type, tag), + m_audiocpu(*this, "audiocpu") { } + required_device m_audiocpu; + DECLARE_WRITE8_MEMBER(plate_w); DECLARE_WRITE16_MEMBER(grid_w); DECLARE_READ8_MEMBER(input_r); @@ -1856,10 +1857,10 @@ void pairmtch_state::pairmtch(machine_config &config) m_maincpu->write_d().set(FUNC(pairmtch_state::grid_w)); m_maincpu->read_d().set_ioport("IN.2"); - hmcs40_cpu_device &audiocpu(HD38820(config, m_audiocpu, 400000)); // approximation - audiocpu.write_r<2>().set(FUNC(pairmtch_state::sound2_w)); - audiocpu.read_r<2>().set(m_soundlatch, FUNC(generic_latch_8_device::read)); - audiocpu.write_d().set(FUNC(pairmtch_state::speaker_w)); + HD38820(config, m_audiocpu, 400000); // approximation + m_audiocpu->write_r<2>().set(FUNC(pairmtch_state::sound2_w)); + m_audiocpu->read_r<2>().set(m_soundlatch, FUNC(generic_latch_8_device::read)); + m_audiocpu->write_d().set(FUNC(pairmtch_state::speaker_w)); config.m_perfect_cpu_quantum = subtag("maincpu"); @@ -1868,11 +1869,10 @@ void pairmtch_state::pairmtch(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - - SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -2829,9 +2829,12 @@ class eturtles_state : public hh_hmcs40_state public: eturtles_state(const machine_config &mconfig, device_type type, const char *tag) : hh_hmcs40_state(mconfig, type, tag), + m_audiocpu(*this, "audiocpu"), m_cop_irq(0) { } + required_device m_audiocpu; + virtual void prepare_display(); DECLARE_WRITE8_MEMBER(plate_w); DECLARE_WRITE16_MEMBER(grid_w); @@ -2980,12 +2983,12 @@ void eturtles_state::eturtles(machine_config &config) m_maincpu->write_r<6>().set(FUNC(eturtles_state::plate_w)); m_maincpu->write_d().set(FUNC(eturtles_state::grid_w)); - cop411_cpu_device &audiocpu(COP411(config, m_audiocpu, 215000)); // approximation - audiocpu.set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed - audiocpu.write_sk().set(FUNC(eturtles_state::speaker_w)); - audiocpu.write_d().set(FUNC(eturtles_state::cop_irq_w)); - audiocpu.read_l().set(FUNC(eturtles_state::cop_latch_r)); - audiocpu.read_g().set(FUNC(eturtles_state::cop_ack_r)); + COP411(config, m_audiocpu, 215000); // approximation + m_audiocpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_audiocpu->write_sk().set(FUNC(eturtles_state::speaker_w)); + m_audiocpu->write_d().set(FUNC(eturtles_state::cop_irq_w)); + m_audiocpu->read_l().set(FUNC(eturtles_state::cop_latch_r)); + m_audiocpu->read_g().set(FUNC(eturtles_state::cop_ack_r)); config.m_perfect_cpu_quantum = subtag("maincpu"); diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index 4c792655089..8138b6ba233 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -1685,6 +1685,11 @@ static INPUT_PORTS_START( gnw_squish ) PORT_START("ACL") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, acl_button, nullptr) PORT_NAME("ACL") + PORT_START("BA") // MCU BA(alpha) pin pulled to GND + PORT_CONFNAME( 0x01, 0x01, "Bonus Life (Cheat)") + PORT_CONFSETTING( 0x01, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x00, DEF_STR( On ) ) + PORT_START("B") // MCU B(beta) pin pulled to GND PORT_CONFNAME( 0x01, 0x01, "Infinite Lives (Cheat)") PORT_CONFSETTING( 0x01, DEF_STR( Off ) ) @@ -1700,6 +1705,7 @@ MACHINE_CONFIG_START(gnw_squish_state::gnw_squish) m_maincpu->read_k().set(FUNC(hh_sm510_state::input_r)); m_maincpu->write_s().set(FUNC(hh_sm510_state::input_w)); m_maincpu->write_r().set(FUNC(hh_sm510_state::piezo_r1_w)); + m_maincpu->read_ba().set_ioport("BA"); m_maincpu->read_b().set_ioport("B"); /* video hardware */ diff --git a/src/mame/drivers/k28.cpp b/src/mame/drivers/k28.cpp index 3f4836059a5..4f55bb65983 100644 --- a/src/mame/drivers/k28.cpp +++ b/src/mame/drivers/k28.cpp @@ -16,6 +16,7 @@ TODO: - external module support (no dumps yet) + - make MM5445N a device ***************************************************************************/ @@ -461,9 +462,8 @@ void k28_state::k28(machine_config &config) TMS6100(config, m_tms6100, 3.579545_MHz_XTAL); // CLK tied to 8021 ALE pin - TIMER(config, "on_button", 0).configure_generic(timer_device::expired_delegate()); - TIMER(config, "display_decay", 0).configure_periodic(timer_device::expired_delegate(FUNC(k28_state::display_decay_tick), this), attotime::from_msec(1)); - + TIMER(config, "on_button").configure_generic(timer_device::expired_delegate()); + TIMER(config, "display_decay").configure_periodic(FUNC(k28_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_k28); /* sound hardware */ -- cgit v1.2.3