summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-07-24 20:07:55 -0400
committer Vas Crabb <cuavas@users.noreply.github.com>2017-07-25 11:21:43 +1000
commit68e2b5074604fc3d1daf4d70f7d9eb4717476bba (patch)
tree80171922acd59b41ec91c2cbad5301aa7afaf4f3
parent8ddfe6c80a6467152301eba17e02fb4a764c2d0b (diff)
YM2151 reset line handler added, though not implemented properly yet (nw)
-rw-r--r--src/devices/sound/ym2151.cpp13
-rw-r--r--src/devices/sound/ym2151.h12
-rw-r--r--src/mame/audio/atarijsa.cpp6
-rw-r--r--src/mame/audio/cyberbal.cpp3
-rw-r--r--src/mame/audio/s11c_bg.cpp8
-rw-r--r--src/mame/audio/s11c_bg.h1
-rw-r--r--src/mame/drivers/atarisy1.cpp11
-rw-r--r--src/mame/drivers/cyberbal.cpp1
-rw-r--r--src/mame/drivers/gauntlet.cpp8
-rw-r--r--src/mame/drivers/s11b.cpp8
-rw-r--r--src/mame/drivers/segas24.cpp12
-rw-r--r--src/mame/includes/atarisy1.h3
-rw-r--r--src/mame/includes/cyberbal.h3
-rw-r--r--src/mame/includes/gauntlet.h1
-rw-r--r--src/mame/includes/s11b.h1
-rw-r--r--src/mame/includes/segas24.h2
16 files changed, 33 insertions, 60 deletions
diff --git a/src/devices/sound/ym2151.cpp b/src/devices/sound/ym2151.cpp
index 3e5df2b1914..682fef59024 100644
--- a/src/devices/sound/ym2151.cpp
+++ b/src/devices/sound/ym2151.cpp
@@ -1773,6 +1773,19 @@ void ym2151_device::device_reset()
//-------------------------------------------------
+// reset_w - handle writes to the reset lines of
+// the YM2151 and its associated DAC
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER(ym2151_device::reset_w)
+{
+ // FIXME: not accurate behavior
+ if (!state)
+ reset();
+}
+
+
+//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
diff --git a/src/devices/sound/ym2151.h b/src/devices/sound/ym2151.h
index 9ca2f41f4e4..7c0f4ee6428 100644
--- a/src/devices/sound/ym2151.h
+++ b/src/devices/sound/ym2151.h
@@ -68,12 +68,14 @@ public:
template <class Object> static devcb_base &set_port_write_handler(device_t &device, Object &&cb) { return downcast<ym2151_device &>(device).m_portwritehandler.set_callback(std::forward<Object>(cb)); }
// read/write
- DECLARE_READ8_MEMBER( read );
- DECLARE_WRITE8_MEMBER( write );
+ DECLARE_READ8_MEMBER(read);
+ DECLARE_WRITE8_MEMBER(write);
- DECLARE_READ8_MEMBER( status_r );
- DECLARE_WRITE8_MEMBER( register_w );
- DECLARE_WRITE8_MEMBER( data_w );
+ DECLARE_READ8_MEMBER(status_r);
+ DECLARE_WRITE8_MEMBER(register_w);
+ DECLARE_WRITE8_MEMBER(data_w);
+
+ DECLARE_WRITE_LINE_MEMBER(reset_w);
protected:
// device-level overrides
diff --git a/src/mame/audio/atarijsa.cpp b/src/mame/audio/atarijsa.cpp
index 9b6f54ebe3b..77248c18140 100644
--- a/src/mame/audio/atarijsa.cpp
+++ b/src/mame/audio/atarijsa.cpp
@@ -432,8 +432,7 @@ WRITE8_MEMBER( atari_jsa_oki_base_device::wrio_w )
m_oki1_banklo->set_entry((m_oki1_banklo->entry() & 2) | ((data >> 1) & 1));
// reset the YM2151 if needed
- if ((data & 1) == 0)
- m_ym2151->reset();
+ m_ym2151->reset_w(BIT(data, 0));
}
@@ -625,8 +624,7 @@ WRITE8_MEMBER( atari_jsa_i_device::wrio_w )
}
// reset the YM2151 if needed
- if ((data & 1) == 0)
- m_ym2151->reset();
+ m_ym2151->reset_w(BIT(data, 0));
}
diff --git a/src/mame/audio/cyberbal.cpp b/src/mame/audio/cyberbal.cpp
index 07ec31523e4..a2cdf1ddc69 100644
--- a/src/mame/audio/cyberbal.cpp
+++ b/src/mame/audio/cyberbal.cpp
@@ -7,7 +7,6 @@
****************************************************************************/
#include "emu.h"
-#include "sound/ym2151.h"
#include "machine/atarigen.h"
#include "includes/cyberbal.h"
@@ -54,7 +53,7 @@ WRITE8_MEMBER(cyberbal_state::sound_bank_select_w)
machine().bookkeeping().coin_counter_w(1, (data >> 5) & 1);
machine().bookkeeping().coin_counter_w(0, (data >> 4) & 1);
m_daccpu->set_input_line(INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
- if (!(data & 0x01)) machine().device("ymsnd")->reset();
+ m_ymsnd->reset_w(BIT(data, 0));
}
diff --git a/src/mame/audio/s11c_bg.cpp b/src/mame/audio/s11c_bg.cpp
index c75a1b25dea..a8003f74537 100644
--- a/src/mame/audio/s11c_bg.cpp
+++ b/src/mame/audio/s11c_bg.cpp
@@ -46,12 +46,6 @@ WRITE8_MEMBER( s11c_bg_device::pia40_pb_w )
// m_pia34->portb_w(data);
}
-WRITE_LINE_MEMBER( s11c_bg_device::pia40_ca2_w)
-{
- if(state == ASSERT_LINE)
- m_ym2151->reset();
-}
-
void s11c_bg_device::ctrl_w(uint8_t data)
{
m_pia40->cb1_w(data);
@@ -81,7 +75,7 @@ MACHINE_CONFIG_MEMBER( s11c_bg_device::device_add_mconfig )
MCFG_DEVICE_ADD("pia40", PIA6821, 0)
MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11c_bg_device, pia40_pb_w))
- MCFG_PIA_CA2_HANDLER(WRITELINE(s11c_bg_device, pia40_ca2_w))
+ MCFG_PIA_CA2_HANDLER(DEVWRITELINE("ymsnd", ym2151_device, reset_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(s11c_bg_device, pia40_cb2_w))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("bgcpu", M6809_FIRQ_LINE))
MCFG_PIA_IRQB_HANDLER(INPUTLINE("bgcpu", INPUT_LINE_NMI))
diff --git a/src/mame/audio/s11c_bg.h b/src/mame/audio/s11c_bg.h
index c607eb04b5f..b333049e153 100644
--- a/src/mame/audio/s11c_bg.h
+++ b/src/mame/audio/s11c_bg.h
@@ -55,7 +55,6 @@ private:
DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w);
DECLARE_WRITE8_MEMBER(pia40_pb_w);
- DECLARE_WRITE_LINE_MEMBER(pia40_ca2_w);
DECLARE_WRITE_LINE_MEMBER(pia40_cb2_w);
};
diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp
index 675c0cdd6c7..f100079edad 100644
--- a/src/mame/drivers/atarisy1.cpp
+++ b/src/mame/drivers/atarisy1.cpp
@@ -198,6 +198,7 @@ RoadBlasters (aka Future Vette):005*
#include "machine/6522via.h"
#include "machine/watchdog.h"
#include "sound/pokey.h"
+#include "sound/ym2151.h"
#include "video/atarimo.h"
#include "speaker.h"
@@ -239,14 +240,6 @@ MACHINE_RESET_MEMBER(atarisy1_state,atarisy1)
}
-WRITE_LINE_MEMBER(atarisy1_state::music_reset_w)
-{
- // reset the YM2151 and YM3012
- if (!state)
- m_ymsnd->reset();
-}
-
-
/*************************************
*
* Joystick I/O
@@ -748,7 +741,7 @@ static MACHINE_CONFIG_START( atarisy1 )
MCFG_ATARI_EEPROM_2804_ADD("eeprom")
MCFG_DEVICE_ADD("outlatch", LS259, 0) // 15H (TTL) or 14F (LSI)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(atarisy1_state, music_reset_w))
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(DEVWRITELINE("ymsnd", ym2151_device, reset_w))
MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(atarisy1_state, led_1_w))
MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(atarisy1_state, led_2_w))
MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(atarisy1_state, coin_counter_right_w))
diff --git a/src/mame/drivers/cyberbal.cpp b/src/mame/drivers/cyberbal.cpp
index 99e897389c8..3145013d72b 100644
--- a/src/mame/drivers/cyberbal.cpp
+++ b/src/mame/drivers/cyberbal.cpp
@@ -25,7 +25,6 @@
#include "includes/cyberbal.h"
#include "machine/watchdog.h"
-#include "sound/ym2151.h"
#include "sound/volt_reg.h"
#include "speaker.h"
diff --git a/src/mame/drivers/gauntlet.cpp b/src/mame/drivers/gauntlet.cpp
index 2c87c17f7c4..781e50ce6ee 100644
--- a/src/mame/drivers/gauntlet.cpp
+++ b/src/mame/drivers/gauntlet.cpp
@@ -229,12 +229,6 @@ READ8_MEMBER(gauntlet_state::switch_6502_r)
*
*************************************/
-WRITE_LINE_MEMBER(gauntlet_state::ym2151_reset_w)
-{
- if (state == 0)
- m_ym2151->reset();
-}
-
WRITE_LINE_MEMBER(gauntlet_state::speech_squeak_w)
{
uint8_t data = 5 | (state ? 2 : 0);
@@ -546,7 +540,7 @@ static MACHINE_CONFIG_START( gauntlet_base )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
MCFG_DEVICE_ADD("soundctl", LS259, 0) // 16T/U
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(gauntlet_state, ym2151_reset_w)) // music reset, low reset
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(DEVWRITELINE("ymsnd", ym2151_device, reset_w)) // music reset, low reset
MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(DEVWRITELINE("tms", tms5220_device, wsq_w)) // speech write, active low
MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(DEVWRITELINE("tms", tms5220_device, rsq_w)) // speech reset, active low
MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(gauntlet_state, speech_squeak_w)) // speech squeak, low = 650 Hz
diff --git a/src/mame/drivers/s11b.cpp b/src/mame/drivers/s11b.cpp
index a1c3b33f7c0..48c72b91b2e 100644
--- a/src/mame/drivers/s11b.cpp
+++ b/src/mame/drivers/s11b.cpp
@@ -233,12 +233,6 @@ WRITE8_MEMBER( s11b_state::pia34_pa_w )
set_segment2(seg);
}
-WRITE_LINE_MEMBER( s11b_state::pia40_ca2_w)
-{
- if(state == ASSERT_LINE)
- m_ym->reset();
-}
-
DRIVER_INIT_MEMBER( s11b_state, s11b )
{
s11a_state::init_s11a();
@@ -352,7 +346,7 @@ static MACHINE_CONFIG_START( s11b )
MCFG_DEVICE_ADD("pia40", PIA6821, 0)
MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac1", dac_byte_interface, write))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, pia40_pb_w))
- MCFG_PIA_CA2_HANDLER(WRITELINE(s11b_state, pia40_ca2_w))
+ MCFG_PIA_CA2_HANDLER(DEVWRITELINE("ymsnd", ym2151_device, reset_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(s11_state, pia40_cb2_w))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("bgcpu", M6809_FIRQ_LINE))
MCFG_PIA_IRQB_HANDLER(INPUTLINE("bgcpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/segas24.cpp b/src/mame/drivers/segas24.cpp
index 418daeee6b5..9700e1fcc00 100644
--- a/src/mame/drivers/segas24.cpp
+++ b/src/mame/drivers/segas24.cpp
@@ -676,14 +676,6 @@ WRITE_LINE_MEMBER(segas24_state::cnt1)
m_cnt1 = bool(state);
}
-WRITE_LINE_MEMBER(segas24_state::cnt2)
-{
- if (bool(state) != m_cnt2)
- machine().device("ymsnd")->reset();
-
- m_cnt2 = bool(state);
-}
-
// Rom board bank access
@@ -1212,7 +1204,7 @@ void segas24_state::machine_start()
void segas24_state::machine_reset()
{
m_subcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
- m_cnt1 = m_cnt2 = true;
+ m_cnt1 = true;
fdc_init();
curbank = 0;
reset_bank();
@@ -1897,7 +1889,7 @@ static MACHINE_CONFIG_START( system24 )
MCFG_315_5296_IN_PORTG_CB(IOPORT("DSW"))
MCFG_315_5296_OUT_PORTH_CB(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_315_5296_OUT_CNT1_CB(WRITELINE(segas24_state, cnt1))
- MCFG_315_5296_OUT_CNT2_CB(WRITELINE(segas24_state, cnt2))
+ MCFG_315_5296_OUT_CNT2_CB(DEVWRITELINE("ymsnd", ym2151_device, reset_w))
MCFG_TIMER_DRIVER_ADD("irq_timer", segas24_state, irq_timer_cb)
MCFG_TIMER_DRIVER_ADD("irq_timer_clear", segas24_state, irq_timer_clear_cb)
diff --git a/src/mame/includes/atarisy1.h b/src/mame/includes/atarisy1.h
index 6c684e63454..e0edaf05735 100644
--- a/src/mame/includes/atarisy1.h
+++ b/src/mame/includes/atarisy1.h
@@ -28,7 +28,6 @@ public:
m_scanline_timer(*this, "scan_timer"),
m_int3off_timer(*this, "int3off_timer"),
m_tms(*this, "tms"),
- m_ymsnd(*this, "ymsnd"),
m_outlatch(*this, "outlatch") { }
required_device<cpu_device> m_audiocpu;
@@ -61,7 +60,6 @@ public:
/* speech */
required_device<tms5220_device> m_tms;
- required_device<ym2151_device> m_ymsnd;
required_device<ls259_device> m_outlatch;
/* graphics bank tracking */
@@ -74,7 +72,6 @@ public:
DECLARE_WRITE16_MEMBER(joystick_w);
DECLARE_READ16_MEMBER(trakball_r);
DECLARE_READ8_MEMBER(switch_6502_r);
- DECLARE_WRITE_LINE_MEMBER(music_reset_w);
DECLARE_WRITE_LINE_MEMBER(led_1_w);
DECLARE_WRITE_LINE_MEMBER(led_2_w);
DECLARE_WRITE_LINE_MEMBER(coin_counter_right_w);
diff --git a/src/mame/includes/cyberbal.h b/src/mame/includes/cyberbal.h
index 1659118305a..af85f7cfcda 100644
--- a/src/mame/includes/cyberbal.h
+++ b/src/mame/includes/cyberbal.h
@@ -12,6 +12,7 @@
#include "cpu/m68000/m68000.h"
#include "cpu/m6502/m6502.h"
#include "sound/dac.h"
+#include "sound/ym2151.h"
#include "screen.h"
class cyberbal_state : public atarigen_state
@@ -26,6 +27,7 @@ public:
m_rdac(*this, "rdac"),
m_ldac(*this, "ldac"),
m_soundcomm(*this, "soundcomm"),
+ m_ymsnd(*this, "ymsnd"),
m_jsa(*this, "jsa"),
m_playfield_tilemap(*this, "playfield"),
m_alpha_tilemap(*this, "alpha"),
@@ -43,6 +45,7 @@ public:
optional_device<dac_word_interface> m_rdac;
optional_device<dac_word_interface> m_ldac;
optional_device<atari_sound_comm_device> m_soundcomm;
+ optional_device<ym2151_device> m_ymsnd;
optional_device<atari_jsa_ii_device> m_jsa;
required_device<tilemap_device> m_playfield_tilemap;
required_device<tilemap_device> m_alpha_tilemap;
diff --git a/src/mame/includes/gauntlet.h b/src/mame/includes/gauntlet.h
index 1ac87752b93..7e19e6e39e6 100644
--- a/src/mame/includes/gauntlet.h
+++ b/src/mame/includes/gauntlet.h
@@ -47,7 +47,6 @@ public:
virtual void scanline_update(screen_device &screen, int scanline) override;
DECLARE_WRITE16_MEMBER(sound_reset_w);
DECLARE_READ8_MEMBER(switch_6502_r);
- DECLARE_WRITE_LINE_MEMBER(ym2151_reset_w);
DECLARE_WRITE_LINE_MEMBER(speech_squeak_w);
DECLARE_WRITE_LINE_MEMBER(coin_counter_left_w);
DECLARE_WRITE_LINE_MEMBER(coin_counter_right_w);
diff --git a/src/mame/includes/s11b.h b/src/mame/includes/s11b.h
index 330bc58c2cd..e5eab564f68 100644
--- a/src/mame/includes/s11b.h
+++ b/src/mame/includes/s11b.h
@@ -24,7 +24,6 @@ public:
DECLARE_WRITE8_MEMBER(pia2c_pa_w);
DECLARE_WRITE8_MEMBER(pia2c_pb_w);
DECLARE_WRITE8_MEMBER(pia34_pa_w);
- DECLARE_WRITE_LINE_MEMBER(pia40_ca2_w);
DECLARE_WRITE8_MEMBER(bg_speech_clock_w);
DECLARE_WRITE8_MEMBER(bg_speech_digit_w);
diff --git a/src/mame/includes/segas24.h b/src/mame/includes/segas24.h
index b55370912b6..fab37ab63bd 100644
--- a/src/mame/includes/segas24.h
+++ b/src/mame/includes/segas24.h
@@ -78,7 +78,6 @@ public:
uint8_t frc_mode;
bool m_cnt1;
- bool m_cnt2;
uint16_t *shared_ram;
@@ -122,7 +121,6 @@ public:
void irq_timer_sync();
void irq_timer_start(int old_tmode);
WRITE_LINE_MEMBER(cnt1);
- WRITE_LINE_MEMBER(cnt2);
DECLARE_DRIVER_INIT(crkdown);
DECLARE_DRIVER_INIT(quizmeku);
DECLARE_DRIVER_INIT(qrouka);