summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2016-05-27 18:49:47 +0200
committerGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2016-05-27 18:49:47 +0200
commit66cf70ac29f954ae0c47367e86b3d93aadabafb8 (patch)
treec7c20912b4b1931ccd5459326f8791896c43c1e3
parentc59746f038e7fc92435b81e1604b0e3f9fe508c6 (diff)
some more gen_latch.cpp (nw)
-rw-r--r--src/mame/audio/irem.cpp18
-rw-r--r--src/mame/audio/irem.h2
-rw-r--r--src/mame/audio/m72.cpp7
-rw-r--r--src/mame/audio/m72.h2
-rw-r--r--src/mame/audio/redalert.cpp18
-rw-r--r--src/mame/drivers/aeroboto.cpp16
-rw-r--r--src/mame/drivers/aquarium.cpp7
-rw-r--r--src/mame/drivers/argus.cpp17
-rw-r--r--src/mame/drivers/blueprnt.cpp6
-rw-r--r--src/mame/drivers/capbowl.cpp6
-rw-r--r--src/mame/drivers/cischeat.cpp15
-rw-r--r--src/mame/drivers/citycon.cpp12
-rw-r--r--src/mame/drivers/crospang.cpp6
-rw-r--r--src/mame/drivers/ddayjlc.cpp20
-rw-r--r--src/mame/drivers/ddenlovr.cpp13
-rw-r--r--src/mame/drivers/diverboy.cpp26
-rw-r--r--src/mame/drivers/dooyong.cpp35
-rw-r--r--src/mame/drivers/exerion.cpp9
-rw-r--r--src/mame/drivers/fantland.cpp19
-rw-r--r--src/mame/drivers/fcombat.cpp7
-rw-r--r--src/mame/drivers/fuukifg2.cpp7
-rw-r--r--src/mame/drivers/gaelco.cpp6
-rw-r--r--src/mame/drivers/gameplan.cpp8
-rw-r--r--src/mame/drivers/ghosteo.cpp21
-rw-r--r--src/mame/drivers/ginganin.cpp4
-rw-r--r--src/mame/drivers/lordgun.cpp20
-rw-r--r--src/mame/drivers/m107.cpp8
-rw-r--r--src/mame/drivers/m63.cpp34
-rw-r--r--src/mame/drivers/m72.cpp10
-rw-r--r--src/mame/drivers/m90.cpp10
-rw-r--r--src/mame/drivers/m92.cpp8
-rw-r--r--src/mame/drivers/momoko.cpp7
-rw-r--r--src/mame/drivers/ms32.cpp12
-rw-r--r--src/mame/drivers/mugsmash.cpp6
-rw-r--r--src/mame/drivers/olibochu.cpp19
-rw-r--r--src/mame/drivers/pgm.cpp25
-rw-r--r--src/mame/drivers/pokechmp.cpp8
-rw-r--r--src/mame/drivers/ppmast93.cpp7
-rw-r--r--src/mame/drivers/psychic5.cpp13
-rw-r--r--src/mame/drivers/pturn.cpp11
-rw-r--r--src/mame/drivers/redalert.cpp2
-rw-r--r--src/mame/drivers/royalmah.cpp12
-rw-r--r--src/mame/drivers/shisen.cpp4
-rw-r--r--src/mame/drivers/silvmil.cpp9
-rw-r--r--src/mame/drivers/skyfox.cpp6
-rw-r--r--src/mame/drivers/spartanxtec.cpp18
-rw-r--r--src/mame/drivers/splash.cpp18
-rw-r--r--src/mame/drivers/spyhuntertec.cpp11
-rw-r--r--src/mame/drivers/tetrisp2.cpp8
-rw-r--r--src/mame/drivers/vegaeo.cpp12
-rw-r--r--src/mame/drivers/vigilant.cpp10
-rw-r--r--src/mame/includes/aquarium.h22
-rw-r--r--src/mame/includes/blueprnt.h18
-rw-r--r--src/mame/includes/capbowl.h3
-rw-r--r--src/mame/includes/cischeat.h7
-rw-r--r--src/mame/includes/crospang.h14
-rw-r--r--src/mame/includes/fantland.h27
-rw-r--r--src/mame/includes/fuukifg2.h4
-rw-r--r--src/mame/includes/gaelco.h4
-rw-r--r--src/mame/includes/gameplan.h7
-rw-r--r--src/mame/includes/ginganin.h15
-rw-r--r--src/mame/includes/lordgun.h5
-rw-r--r--src/mame/includes/m107.h7
-rw-r--r--src/mame/includes/m90.h4
-rw-r--r--src/mame/includes/m92.h5
-rw-r--r--src/mame/includes/ms32.h7
-rw-r--r--src/mame/includes/mugsmash.h6
-rw-r--r--src/mame/includes/pgm.h8
-rw-r--r--src/mame/includes/pokechmp.h7
-rw-r--r--src/mame/includes/redalert.h7
-rw-r--r--src/mame/includes/skyfox.h4
-rw-r--r--src/mame/includes/splash.h4
-rw-r--r--src/mame/includes/tetrisp2.h7
-rw-r--r--src/mame/video/cischeat.cpp16
-rw-r--r--src/mame/video/ginganin.cpp2
75 files changed, 551 insertions, 274 deletions
diff --git a/src/mame/audio/irem.cpp b/src/mame/audio/irem.cpp
index 99f88d2e45b..57c28493622 100644
--- a/src/mame/audio/irem.cpp
+++ b/src/mame/audio/irem.cpp
@@ -19,7 +19,8 @@ const device_type IREM_M52_LARGE_AUDIO = &device_creator<m52_large_audio_device>
irem_audio_device::irem_audio_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
m_port1(0),
- m_port2(0)
+ m_port2(0),
+ m_soundlatch(*this, "soundlatch")
//m_ay_45L(*this, "ay_45l"),
//m_ay_45M(*this, "ay_45m")
{
@@ -83,9 +84,8 @@ void irem_audio_device::device_start()
WRITE8_MEMBER( irem_audio_device::cmd_w )
{
- driver_device *drvstate = space.machine().driver_data<driver_device>();
if ((data & 0x80) == 0)
- drvstate->soundlatch_byte_w(space, 0, data & 0x7f);
+ m_soundlatch->write(space, 0, data & 0x7f);
else
subdevice("iremsound")->execute().set_input_line(0, ASSERT_LINE);
}
@@ -421,10 +421,12 @@ static MACHINE_CONFIG_FRAGMENT( irem_audio_base )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay_45m", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT)
MCFG_AY8910_RES_LOADS(2000.0, 2000.0, 2000.0)
- MCFG_AY8910_PORT_A_READ_CB(DEVREAD8(":", driver_device, soundlatch_byte_r))
+ MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(irem_audio_device, ay8910_45M_portb_w))
MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0)
MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1)
@@ -490,10 +492,12 @@ MACHINE_CONFIG_FRAGMENT( m52_sound_c_audio )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay_45m", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT)
MCFG_AY8910_RES_LOADS(470, 0, 0)
- MCFG_AY8910_PORT_A_READ_CB(DEVREAD8(":", driver_device, soundlatch_byte_r))
+ MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(irem_audio_device, ay8910_45M_portb_w))
MCFG_SOUND_ROUTE_EX(0, "filtermix", 1.0, 0)
@@ -524,10 +528,12 @@ MACHINE_CONFIG_FRAGMENT( m52_large_audio) /* 10 yard fight */
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay_45m", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT)
MCFG_AY8910_RES_LOADS(470, 0, 0)
- MCFG_AY8910_PORT_A_READ_CB(DEVREAD8(":", driver_device, soundlatch_byte_r))
+ MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(irem_audio_device, ay8910_45M_portb_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/audio/irem.h b/src/mame/audio/irem.h
index 7a4f000540b..7e378e88b14 100644
--- a/src/mame/audio/irem.h
+++ b/src/mame/audio/irem.h
@@ -2,6 +2,7 @@
// copyright-holders:Couriersud
#include "sound/ay8910.h"
#include "sound/msm5205.h"
+#include "machine/gen_latch.h"
#include "machine/netlist.h"
#include "audio/nl_kidniki.h"
@@ -36,6 +37,7 @@ private:
UINT8 m_port1;
UINT8 m_port2;
+ required_device<generic_latch_8_device> m_soundlatch;
/* FIXME: using required / optional device would be better */
// required_device<ay8910_device> m_ay_45L;
// required_device<ay8910_device> m_ay_45M;
diff --git a/src/mame/audio/m72.cpp b/src/mame/audio/m72.cpp
index 2440b42ade5..9c539ad59cc 100644
--- a/src/mame/audio/m72.cpp
+++ b/src/mame/audio/m72.cpp
@@ -55,6 +55,7 @@ m72_audio_device::m72_audio_device(const machine_config &mconfig, const char *ta
, m_sample_addr(0)
, m_samples(*this, "^samples")
, m_samples_size(0)
+ , m_soundlatch(*this, "^soundlatch")
{
}
@@ -137,16 +138,14 @@ WRITE16_MEMBER( m72_audio_device::sound_command_w )
{
if (ACCESSING_BITS_0_7)
{
- driver_device *drvstate = space.machine().driver_data<driver_device>();
- drvstate->soundlatch_byte_w(*m_space, offset, data);
+ m_soundlatch->write(*m_space, offset, data);
space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(m72_audio_device::setvector_callback), this), Z80_ASSERT);
}
}
WRITE8_MEMBER( m72_audio_device::sound_command_byte_w )
{
- driver_device *drvstate = space.machine().driver_data<driver_device>();
- drvstate->soundlatch_byte_w(*m_space, offset, data);
+ m_soundlatch->write(*m_space, offset, data);
space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(m72_audio_device::setvector_callback), this), Z80_ASSERT);
}
diff --git a/src/mame/audio/m72.h b/src/mame/audio/m72.h
index 4b8e96d4d52..3ac86396e3a 100644
--- a/src/mame/audio/m72.h
+++ b/src/mame/audio/m72.h
@@ -7,6 +7,7 @@
****************************************************************************/
#include "emu.h"
+#include "machine/gen_latch.h"
#include "sound/dac.h"
class m72_audio_device : public device_t,
@@ -55,6 +56,7 @@ private:
UINT32 m_samples_size;
address_space *m_space;
dac_device *m_dac;
+ required_device<generic_latch_8_device> m_soundlatch;
TIMER_CALLBACK_MEMBER( setvector_callback );
};
diff --git a/src/mame/audio/redalert.cpp b/src/mame/audio/redalert.cpp
index b00aa6deb0d..f57641a7cc8 100644
--- a/src/mame/audio/redalert.cpp
+++ b/src/mame/audio/redalert.cpp
@@ -66,7 +66,7 @@ WRITE8_MEMBER(redalert_state::redalert_analog_w)
WRITE8_MEMBER(redalert_state::redalert_audio_command_w)
{
/* the byte is connected to port A of the AY8910 */
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
/* D7 is also connected to the NMI input of the CPU -
the NMI is actually toggled by a 74121 */
@@ -142,7 +142,7 @@ SOUND_START_MEMBER(redalert_state,redalert)
WRITE8_MEMBER(redalert_state::redalert_voice_command_w)
{
- soundlatch2_byte_w(space, 0, (data & 0x78) >> 3);
+ m_soundlatch2->write(space, 0, (data & 0x78) >> 3);
machine().device("voice")->execute().set_input_line(I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -163,7 +163,7 @@ static ADDRESS_MAP_START( redalert_voice_map, AS_PROGRAM, 8, redalert_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x7fff) AM_NOP
AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x3c00) AM_RAM
- AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x3fff) AM_READ(soundlatch2_byte_r) AM_WRITENOP
+ AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x3fff) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) AM_WRITENOP
ADDRESS_MAP_END
@@ -180,8 +180,10 @@ static MACHINE_CONFIG_FRAGMENT( redalert_audio_m37b )
MCFG_CPU_PROGRAM_MAP(redalert_audio_map)
MCFG_CPU_PERIODIC_INT_DRIVER(redalert_state, irq0_line_hold, REDALERT_AUDIO_CPU_IRQ_FREQ)
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, REDALERT_AY8910_CLOCK)
- MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
+ MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(redalert_state, redalert_analog_w))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
MCFG_SOUND_ROUTE(1, "mono", 0.50)
@@ -202,6 +204,8 @@ static MACHINE_CONFIG_FRAGMENT( redalert_audio_voice )
MCFG_I8085A_SID(READLINE(redalert_state,sid_callback))
MCFG_I8085A_SOD(WRITELINE(redalert_state,sod_callback))
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("cvsd", HC55516, REDALERT_HC55516_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
@@ -249,7 +253,7 @@ MACHINE_CONFIG_END
WRITE8_MEMBER(redalert_state::demoneye_audio_command_w)
{
/* the byte is connected to port A of the AY8910 */
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -350,10 +354,12 @@ MACHINE_CONFIG_FRAGMENT( demoneye_audio )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, DEMONEYE_AY8910_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_SOUND_ADD("ay2", AY8910, DEMONEYE_AY8910_CLOCK)
- MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
+ MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/aeroboto.cpp b/src/mame/drivers/aeroboto.cpp
index 39f96ae7375..6dd3b35dbdc 100644
--- a/src/mame/drivers/aeroboto.cpp
+++ b/src/mame/drivers/aeroboto.cpp
@@ -26,6 +26,7 @@ Revisions:
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
#include "includes/aeroboto.h"
@@ -81,8 +82,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, aeroboto_state )
AM_RANGE(0x2900, 0x2fff) AM_WRITENOP // cleared along with sprite RAM
AM_RANGE(0x2973, 0x2973) AM_READ(aeroboto_2973_r) // protection read
AM_RANGE(0x3000, 0x3000) AM_READWRITE(aeroboto_in0_r, aeroboto_3000_w)
- AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE(soundlatch_byte_w)
- AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE(soundlatch2_byte_w)
+ AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
+ AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
AM_RANGE(0x3003, 0x3003) AM_WRITEONLY AM_SHARE("vscroll")
AM_RANGE(0x3004, 0x3004) AM_READ(aeroboto_201_r) AM_WRITEONLY AM_SHARE("starx")
AM_RANGE(0x3005, 0x3005) AM_WRITEONLY AM_SHARE("stary") // usable but probably wrong
@@ -259,9 +260,12 @@ static MACHINE_CONFIG_START( formatz, aeroboto_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("ay1", AY8910, XTAL_10MHz/8) /* verified on pcb */
- MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
- MCFG_AY8910_PORT_B_READ_CB(READ8(driver_device, soundlatch2_byte_r))
+ MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
+ MCFG_AY8910_PORT_B_READ_CB(DEVREAD8("soundlatch2", generic_latch_8_device, read))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_10MHz/16) /* verified on pcb */
@@ -330,5 +334,5 @@ ROM_END
-GAME( 1984, formatz, 0, formatz, formatz, driver_device, 0, ROT0, "Jaleco", "Formation Z", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1984, aeroboto, formatz, formatz, formatz, driver_device, 0, ROT0, "Jaleco (Williams license)", "Aeroboto", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1984, formatz, 0, formatz, formatz, driver_device, 0, ROT0, "Jaleco", "Formation Z", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
+GAME( 1984, aeroboto, formatz, formatz, formatz, driver_device, 0, ROT0, "Jaleco (Williams license)", "Aeroboto", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/aquarium.cpp b/src/mame/drivers/aquarium.cpp
index c8f0d7fb4b1..07d4dc17321 100644
--- a/src/mame/drivers/aquarium.cpp
+++ b/src/mame/drivers/aquarium.cpp
@@ -37,7 +37,6 @@ Notes:
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "sound/2151intf.h"
-#include "sound/okim6295.h"
#include "includes/aquarium.h"
@@ -60,7 +59,7 @@ WRITE16_MEMBER(aquarium_state::aquarium_sound_w)
{
// popmessage("sound write %04x",data);
- soundlatch_byte_w(space, 1, data & 0xff);
+ m_soundlatch->write(space, 1, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
}
@@ -137,7 +136,7 @@ static ADDRESS_MAP_START( snd_portmap, AS_IO, 8, aquarium_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x02, 0x02) AM_READWRITE(aquarium_oki_r, aquarium_oki_w)
- AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x06, 0x06) AM_WRITE(aquarium_snd_ack_w)
AM_RANGE(0x08, 0x08) AM_WRITE(aquarium_z80_bank_w)
ADDRESS_MAP_END
@@ -334,6 +333,8 @@ static MACHINE_CONFIG_START( aquarium, aquarium_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4) // clock not verified on pcb
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
diff --git a/src/mame/drivers/argus.cpp b/src/mame/drivers/argus.cpp
index b6c6cf16e95..36e9d6606ce 100644
--- a/src/mame/drivers/argus.cpp
+++ b/src/mame/drivers/argus.cpp
@@ -121,6 +121,7 @@ Known issues :
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/2203intf.h"
#include "includes/argus.h"
@@ -185,7 +186,7 @@ static ADDRESS_MAP_START( argus_map, AS_PROGRAM, 8, argus_state )
AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2")
AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1")
AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
- AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xc200, 0xc200) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xc201, 0xc201) AM_WRITE(flipscreen_w)
AM_RANGE(0xc202, 0xc202) AM_WRITE(bankselect_w)
AM_RANGE(0xc300, 0xc301) AM_RAM AM_SHARE("bg0_scrollx")
@@ -209,7 +210,7 @@ static ADDRESS_MAP_START( valtric_map, AS_PROGRAM, 8, argus_state )
AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2")
AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1")
AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
- AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xc200, 0xc200) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xc201, 0xc201) AM_WRITE(flipscreen_w)
AM_RANGE(0xc202, 0xc202) AM_WRITE(bankselect_w)
AM_RANGE(0xc300, 0xc300) AM_WRITE(valtric_unknown_w)
@@ -234,7 +235,7 @@ static ADDRESS_MAP_START( butasan_map, AS_PROGRAM, 8, argus_state )
AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1")
AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
AM_RANGE(0xc100, 0xc100) AM_WRITE(butasan_unknown_w)
- AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xc200, 0xc200) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xc201, 0xc201) AM_WRITE(flipscreen_w)
AM_RANGE(0xc202, 0xc202) AM_WRITE(bankselect_w)
AM_RANGE(0xc203, 0xc203) AM_WRITE(butasan_pageselect_w)
@@ -255,13 +256,13 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map_a, AS_PROGRAM, 8, argus_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map_b, AS_PROGRAM, 8, argus_state )
AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM
- AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
#if 0
@@ -559,6 +560,8 @@ static MACHINE_CONFIG_START( argus, argus_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, 6000000 / 4)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.15)
@@ -605,6 +608,8 @@ static MACHINE_CONFIG_START( valtric, argus_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, 6000000 / 4)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.15)
@@ -651,6 +656,8 @@ static MACHINE_CONFIG_START( butasan, argus_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, 6000000 / 4)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.30)
diff --git a/src/mame/drivers/blueprnt.cpp b/src/mame/drivers/blueprnt.cpp
index f318bcf649a..6de7c1437a4 100644
--- a/src/mame/drivers/blueprnt.cpp
+++ b/src/mame/drivers/blueprnt.cpp
@@ -80,7 +80,7 @@ READ8_MEMBER(blueprnt_state::grasspin_sh_dipsw_r)
WRITE8_MEMBER(blueprnt_state::blueprnt_sound_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -371,8 +371,10 @@ static MACHINE_CONFIG_START( blueprnt, blueprnt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 10000000/2/2/2)
- MCFG_AY8910_PORT_B_READ_CB(READ8(driver_device, soundlatch_byte_r))
+ MCFG_AY8910_PORT_B_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(blueprnt_state, dipsw_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp
index 1512534c7c4..52f37d5266e 100644
--- a/src/mame/drivers/capbowl.cpp
+++ b/src/mame/drivers/capbowl.cpp
@@ -195,7 +195,7 @@ WRITE8_MEMBER(capbowl_state::track_reset_w)
WRITE8_MEMBER(capbowl_state::sndcmd_w)
{
m_audiocpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE);
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
}
@@ -244,7 +244,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, capbowl_state )
AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
AM_RANGE(0x2000, 0x2000) AM_WRITENOP /* watchdog */
AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
- AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x7000, 0x7000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -343,6 +343,8 @@ static MACHINE_CONFIG_START( capbowl, capbowl_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, MASTER_CLOCK/2)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("ticket", ticket_dispenser_device, read))
diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp
index e0489d75491..e36cde2e1b8 100644
--- a/src/mame/drivers/cischeat.cpp
+++ b/src/mame/drivers/cischeat.cpp
@@ -765,8 +765,8 @@ WRITE16_MEMBER(cischeat_state::bigrun_soundbank_w)
static ADDRESS_MAP_START( bigrun_sound_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM
- AM_RANGE(0x040000, 0x040001) AM_READ(soundlatch_word_r) AM_WRITE(bigrun_soundbank_w) // From Main CPU
- AM_RANGE(0x060000, 0x060001) AM_WRITE(soundlatch2_word_w) // To Main CPU
+ AM_RANGE(0x040000, 0x040001) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_WRITE(bigrun_soundbank_w) // From Main CPU
+ AM_RANGE(0x060000, 0x060001) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // To Main CPU
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
@@ -791,8 +791,8 @@ static ADDRESS_MAP_START( cischeat_sound_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM
AM_RANGE(0x040002, 0x040003) AM_WRITE(cischeat_soundbank_1_w) // Sample Banking
AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking
- AM_RANGE(0x060002, 0x060003) AM_WRITE(soundlatch2_word_w) // To Main CPU
- AM_RANGE(0x060004, 0x060005) AM_READ(soundlatch_word_r) // From Main CPU
+ AM_RANGE(0x060002, 0x060003) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // To Main CPU
+ AM_RANGE(0x060004, 0x060005) AM_DEVREAD("soundlatch", generic_latch_16_device, read) // From Main CPU
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
@@ -808,7 +808,7 @@ static ADDRESS_MAP_START( f1gpstar_sound_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM
AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_1_w) // Sample Banking (cischeat: 40002)
AM_RANGE(0x040008, 0x040009) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking (cischeat: 40004)
- AM_RANGE(0x060000, 0x060001) AM_READWRITE(soundlatch_word_r, soundlatch2_word_w) // From Main CPU (cischeat: 60004)
+ AM_RANGE(0x060000, 0x060001) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_DEVWRITE("soundlatch2", generic_latch_16_device, write) // From Main CPU (cischeat: 60004)
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
@@ -825,7 +825,7 @@ static ADDRESS_MAP_START( f1gpstr2_sound_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_1_w) // Sample Banking
AM_RANGE(0x040008, 0x040009) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking
AM_RANGE(0x04000e, 0x04000f) AM_WRITENOP // ? 0 (f1gpstar: no)
- AM_RANGE(0x060004, 0x060005) AM_READWRITE(soundlatch_word_r, soundlatch2_word_w) // From Main CPU (f1gpstar: 60000)
+ AM_RANGE(0x060004, 0x060005) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_DEVWRITE("soundlatch2", generic_latch_16_device, write) // From Main CPU (f1gpstar: 60000)
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
@@ -1761,6 +1761,9 @@ static MACHINE_CONFIG_START( bigrun, cischeat_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_16_ADD("soundlatch2")
+
MCFG_YM2151_ADD("ymsnd", STD_FM_CLOCK)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
diff --git a/src/mame/drivers/citycon.cpp b/src/mame/drivers/citycon.cpp
index cd908b3acb5..8deef5b4e23 100644
--- a/src/mame/drivers/citycon.cpp
+++ b/src/mame/drivers/citycon.cpp
@@ -11,6 +11,7 @@ Dip locations added from dip listing at crazykong.com
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
#include "sound/2203intf.h"
#include "includes/citycon.h"
@@ -35,8 +36,8 @@ static ADDRESS_MAP_START( citycon_map, AS_PROGRAM, 8, citycon_state )
AM_RANGE(0x2800, 0x28ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x2800, 0x2fff) AM_NOP //0x2900-0x2fff cleared at post but unused
AM_RANGE(0x3000, 0x3000) AM_READ(citycon_in_r) AM_WRITE(citycon_background_w) /* player 1 & 2 inputs multiplexed */
- AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE(soundlatch_byte_w)
- AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE(soundlatch2_byte_w)
+ AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
+ AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
AM_RANGE(0x3004, 0x3005) AM_READNOP AM_WRITEONLY AM_SHARE("scroll")
AM_RANGE(0x3007, 0x3007) AM_READ(citycon_irq_ack_r)
AM_RANGE(0x3800, 0x3cff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
@@ -210,12 +211,15 @@ static MACHINE_CONFIG_START( citycon, citycon_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("aysnd", AY8910, 1250000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
MCFG_SOUND_ADD("ymsnd", YM2203, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
- MCFG_AY8910_PORT_B_READ_CB(READ8(driver_device, soundlatch2_byte_r))
+ MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
+ MCFG_AY8910_PORT_B_READ_CB(DEVREAD8("soundlatch2", generic_latch_8_device, read))
MCFG_SOUND_ROUTE(0, "mono", 0.40)
MCFG_SOUND_ROUTE(1, "mono", 0.40)
MCFG_SOUND_ROUTE(2, "mono", 0.40)
diff --git a/src/mame/drivers/crospang.cpp b/src/mame/drivers/crospang.cpp
index 472abdbd0e2..e75a6ff015b 100644
--- a/src/mame/drivers/crospang.cpp
+++ b/src/mame/drivers/crospang.cpp
@@ -44,7 +44,7 @@ WRITE16_MEMBER(crospang_state::crospang_soundlatch_w)
{
if(ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
}
}
@@ -114,7 +114,7 @@ static ADDRESS_MAP_START( crospang_sound_io_map, AS_IO, 8, crospang_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write)
AM_RANGE(0x02, 0x02) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x06, 0x06) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -377,6 +377,8 @@ static MACHINE_CONFIG_START( crospang, crospang_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, 14318180/4)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/ddayjlc.cpp b/src/mame/drivers/ddayjlc.cpp
index bb1c5b88c83..d2530b8d090 100644
--- a/src/mame/drivers/ddayjlc.cpp
+++ b/src/mame/drivers/ddayjlc.cpp
@@ -55,6 +55,7 @@ $842f = lives
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
@@ -67,10 +68,11 @@ public:
m_spriteram(*this, "spriteram"),
m_videoram(*this, "videoram"),
m_bgram(*this, "bgram"),
- m_audiocpu(*this, "audiocpu"),
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_mainram;
@@ -91,7 +93,12 @@ public:
UINT8 m_prot_addr;
/* devices */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE8_MEMBER(prot_w);
DECLARE_WRITE8_MEMBER(char_bank_w);
DECLARE_WRITE8_MEMBER(ddayjlc_bgram_w);
@@ -114,9 +121,6 @@ public:
UINT32 screen_update_ddayjlc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(ddayjlc_interrupt);
INTERRUPT_GEN_MEMBER(ddayjlc_snd_interrupt);
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
@@ -224,7 +228,7 @@ WRITE8_MEMBER(ddayjlc_state::bg2_w)
WRITE8_MEMBER(ddayjlc_state::sound_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
}
@@ -533,8 +537,10 @@ static MACHINE_CONFIG_START( ddayjlc, ddayjlc_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 12000000/6)
- MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
+ MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("ay2", AY8910, 12000000/6)
diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp
index 08cf58cde18..725411052d8 100644
--- a/src/mame/drivers/ddenlovr.cpp
+++ b/src/mame/drivers/ddenlovr.cpp
@@ -116,6 +116,7 @@ Notes:
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
+#include "machine/gen_latch.h"
#include "machine/msm6242.h"
#include "machine/nvram.h"
#include "includes/dynax.h"
@@ -160,13 +161,15 @@ public:
: dynax_state(mconfig, type, tag),
m_dsw_sel16(*this, "dsw_sel16"),
m_protection1(*this, "protection1"),
- m_protection2(*this, "protection2") { }
+ m_protection2(*this, "protection2"),
+ m_soundlatch(*this, "soundlatch") { }
optional_shared_ptr<UINT16> m_dsw_sel16;
optional_shared_ptr<UINT16> m_protection1;
optional_shared_ptr<UINT16> m_protection2;
+ optional_device<generic_latch_8_device> m_soundlatch;
std::unique_ptr<UINT8[]> m_ddenlovr_pixmap[8];
@@ -2415,7 +2418,7 @@ WRITE8_MEMBER(ddenlovr_state::mmpanic_rombank_w)
WRITE8_MEMBER(ddenlovr_state::mmpanic_soundlatch_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -2524,7 +2527,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mmpanic_sound_portmap, AS_IO, 8, ddenlovr_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x02, 0x02) AM_READNOP // read just before port 00
AM_RANGE(0x04, 0x04) AM_NOP // read only once at the start
AM_RANGE(0x06, 0x06) AM_WRITENOP // almost always 1, sometimes 0
@@ -2657,7 +2660,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( funkyfig_sound_portmap, AS_IO, 8, ddenlovr_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x04, 0x04) AM_READNOP // read only once at the start
ADDRESS_MAP_END
@@ -9953,6 +9956,8 @@ static MACHINE_CONFIG_START( mmpanic, ddenlovr_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym2413", YM2413, 3579545)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/drivers/diverboy.cpp b/src/mame/drivers/diverboy.cpp
index b4146901107..61af792522a 100644
--- a/src/mame/drivers/diverboy.cpp
+++ b/src/mame/drivers/diverboy.cpp
@@ -19,7 +19,7 @@
About the game:
- The worst game i have :) Enjoy it so much as me :D
+ The worst game I have :) Enjoy it so much as me :D
----
@@ -51,6 +51,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
@@ -61,29 +62,32 @@ public:
diverboy_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_spriteram(*this, "spriteram"),
- m_audiocpu(*this, "audiocpu"),
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_spriteram;
/* devices */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<okim6295_device> m_oki;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE16_MEMBER(soundcmd_w);
DECLARE_WRITE8_MEMBER(okibank_w);
virtual void machine_start() override;
virtual void video_start() override;
UINT32 screen_update_diverboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- required_device<cpu_device> m_maincpu;
- required_device<okim6295_device> m_oki;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
};
@@ -138,7 +142,7 @@ WRITE16_MEMBER(diverboy_state::soundcmd_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
}
@@ -174,7 +178,7 @@ static ADDRESS_MAP_START( snd_map, AS_PROGRAM, 8, diverboy_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_WRITE(okibank_w)
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -285,6 +289,8 @@ static MACHINE_CONFIG_START( diverboy, diverboy_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_OKIM6295_ADD("oki", 1320000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/dooyong.cpp b/src/mame/drivers/dooyong.cpp
index 9e439ded0a1..50ab7f5e64f 100644
--- a/src/mame/drivers/dooyong.cpp
+++ b/src/mame/drivers/dooyong.cpp
@@ -55,7 +55,7 @@ Interrupts are generated by both YM chips. Sound CPU checks interrupt source
Due to bad timing/incorrect int line handling - interrupt is skipped if
fires when another one is being processed and int line is still asserted
(and not cleared). This situation results in missing or incomplete audio,
-becasue one of interrupt sources is _dead_ (timer never restarts).
+because one of interrupt sources is _dead_ (timer never restarts).
Music tempo and audio pitch depends on (unknown) YM clocks.
Sound cpu runs currently at 8 MHz to avoid jerky music when there's (too)
@@ -76,6 +76,7 @@ are almost identical, except for much darker BG layer colors).
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/gen_latch.h"
#include "sound/2203intf.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
@@ -120,7 +121,7 @@ static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
AM_RANGE(0xc011, 0xc011) AM_READ_PORT("P1")
AM_RANGE(0xc011, 0xc011) AM_WRITE(bankswitch_w)
AM_RANGE(0xc012, 0xc012) AM_READ_PORT("P2")
- AM_RANGE(0xc012, 0xc012) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xc012, 0xc012) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xc013, 0xc013) AM_READ_PORT("DSWA")
AM_RANGE(0xc014, 0xc014) AM_READ_PORT("DSWB")
AM_RANGE(0xc800, 0xcfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
@@ -141,7 +142,7 @@ static ADDRESS_MAP_START( pollux_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P2")
AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM")
AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */
- AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xf010, 0xf010) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w)
AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w)
AM_RANGE(0xf800, 0xffff) AM_READWRITE(paletteram_flytiger_r, paletteram_flytiger_w)
@@ -160,7 +161,7 @@ static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state
AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P1")
AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM")
AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */
- AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xf010, 0xf010) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w)
AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w)
AM_RANGE(0xf800, 0xffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
@@ -176,7 +177,7 @@ static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_z80_state )
AM_RANGE(0xc003, 0xc003) AM_READ_PORT("P2")
AM_RANGE(0xc004, 0xc004) AM_READ_PORT("SYSTEM")
AM_RANGE(0xc008, 0xc008) AM_WRITE(bankswitch_w)
- AM_RANGE(0xc010, 0xc010) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xc010, 0xc010) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xc018, 0xc01f) AM_WRITE(fg2scroll_w)
AM_RANGE(0xc040, 0xc047) AM_WRITE(bgscroll_w)
AM_RANGE(0xc048, 0xc04f) AM_WRITE(fgscroll_w)
@@ -198,7 +199,7 @@ static ADDRESS_MAP_START( flytiger_map, AS_PROGRAM, 8, dooyong_z80_state )
AM_RANGE(0xe006, 0xe006) AM_READ_PORT("DSWA")
AM_RANGE(0xe008, 0xe008) AM_READ_PORT("DSWB")
AM_RANGE(0xe010, 0xe010) AM_WRITE(flytiger_ctrl_w) /* coin counter, flip screen */
- AM_RANGE(0xe020, 0xe020) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xe020, 0xe020) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xe030, 0xe037) AM_WRITE(bgscroll_w)
AM_RANGE(0xe040, 0xe047) AM_WRITE(fgscroll_w)
AM_RANGE(0xe800, 0xefff) AM_READWRITE(paletteram_flytiger_r, paletteram_flytiger_w)
@@ -215,7 +216,7 @@ static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_z80_state )
AM_RANGE(0xf800, 0xf800) AM_READ_PORT("DSWA")
AM_RANGE(0xf800, 0xf800) AM_WRITE(primella_ctrl_w) /* bank switch, flip screen etc */
AM_RANGE(0xf810, 0xf810) AM_READ_PORT("DSWB")
- AM_RANGE(0xf810, 0xf810) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xf810, 0xf810) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xf820, 0xf820) AM_READ_PORT("P1")
AM_RANGE(0xf830, 0xf830) AM_READ_PORT("P2")
AM_RANGE(0xf840, 0xf840) AM_READ_PORT("SYSTEM")
@@ -235,7 +236,7 @@ static ADDRESS_MAP_START( rshark_map, AS_PROGRAM, 16, dooyong_68k_state )
AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff)
AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE8(bg2scroll_w, 0x00ff)
AM_RANGE(0x0c8000, 0x0c8fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x0c0012, 0x0c0013) AM_WRITE(soundlatch_word_w)
+ AM_RANGE(0x0c0012, 0x0c0013) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w) /* flip screen + unknown stuff */
AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE8(fgscroll_w, 0x00ff)
AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE8(fg2scroll_w, 0x00ff)
@@ -253,7 +254,7 @@ static ADDRESS_MAP_START( superx_map, AS_PROGRAM, 16, dooyong_68k_state )
AM_RANGE(0x084000, 0x08400f) AM_WRITE8(bgscroll_w, 0x00ff)
AM_RANGE(0x084010, 0x08401f) AM_WRITE8(bg2scroll_w, 0x00ff)
AM_RANGE(0x088000, 0x088fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x080012, 0x080013) AM_WRITE(soundlatch_word_w)
+ AM_RANGE(0x080012, 0x080013) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x080014, 0x080015) AM_WRITE(ctrl_w) /* flip screen + unknown stuff */
AM_RANGE(0x08c000, 0x08c00f) AM_WRITE8(fgscroll_w, 0x00ff)
AM_RANGE(0x08c010, 0x08c01f) AM_WRITE8(fg2scroll_w, 0x00ff)
@@ -268,7 +269,7 @@ static ADDRESS_MAP_START( popbingo_map, AS_PROGRAM, 16, dooyong_68k_state )
AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW")
AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("P1_P2")
AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x0c0012, 0x0c0013) AM_WRITE(soundlatch_word_w)
+ AM_RANGE(0x0c0012, 0x0c0013) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w)
AM_RANGE(0x0c0018, 0x0c001b) AM_WRITENOP // ?
AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff)
@@ -282,7 +283,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( lastday_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM
- AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xc800, 0xc800) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ym1", ym2203_device, read, write)
AM_RANGE(0xf002, 0xf003) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
ADDRESS_MAP_END
@@ -290,7 +291,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pollux_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
AM_RANGE(0xf000, 0xf7ff) AM_RAM
- AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xf800, 0xf800) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xf802, 0xf803) AM_DEVREADWRITE("ym1", ym2203_device, read, write)
AM_RANGE(0xf804, 0xf805) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
ADDRESS_MAP_END
@@ -298,7 +299,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( bluehawk_sound_map, AS_PROGRAM, 8, dooyong_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
AM_RANGE(0xf000, 0xf7ff) AM_RAM
- AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xf800, 0xf800) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xf808, 0xf809) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xf80a, 0xf80a) AM_DEVREADWRITE("oki", okim6295_device, read, write)
ADDRESS_MAP_END
@@ -799,6 +800,8 @@ WRITE_LINE_MEMBER(dooyong_z80_ym2203_state::irqhandler_2203_2)
static MACHINE_CONFIG_FRAGMENT( sound_2203 )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, 1500000)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_1))
MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r))
@@ -813,6 +816,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( sound_2151 )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz )
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
@@ -825,6 +830,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( sound_2151_4mhz )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_16MHz/4) /* 4MHz (16MHz/4 for most, 8Mhz/2 for Super-X) */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
@@ -869,6 +876,8 @@ static MACHINE_CONFIG_START( lastday, dooyong_z80_ym2203_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, XTAL_16MHz/4) /* 4MHz verified for Last Day / D-day */
MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_1))
MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r))
diff --git a/src/mame/drivers/exerion.cpp b/src/mame/drivers/exerion.cpp
index 925a3558d40..fb8bf40a063 100644
--- a/src/mame/drivers/exerion.cpp
+++ b/src/mame/drivers/exerion.cpp
@@ -6,7 +6,7 @@
****************************************************************************
- Exerion is a unique driver in that it has idiosyncracies that are straight
+ Exerion is a unique driver in that it has idiosyncrasies that are straight
out of Bizarro World. I submit for your approval:
* The mystery reads from $d802 - timer-based protection?
@@ -122,6 +122,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "includes/exerion.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
@@ -199,7 +200,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, exerion_state )
AM_RANGE(0xa800, 0xa800) AM_READ_PORT("DSW0")
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW1")
AM_RANGE(0xc000, 0xc000) AM_WRITE(exerion_videoreg_w)
- AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xc800, 0xc800) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
AM_RANGE(0xd800, 0xd801) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
AM_RANGE(0xd802, 0xd802) AM_DEVREAD("ay2", ay8910_device, data_r)
@@ -216,7 +217,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, exerion_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM
- AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x6000, 0x6000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x8000, 0x800c) AM_WRITE(exerion_video_latch_w)
AM_RANGE(0xa000, 0xa000) AM_READ(exerion_video_timing_r)
ADDRESS_MAP_END
@@ -390,6 +391,8 @@ static MACHINE_CONFIG_START( exerion, exerion_state )
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, EXERION_AY8910_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
diff --git a/src/mame/drivers/fantland.cpp b/src/mame/drivers/fantland.cpp
index af10ddd4bd1..dd1ebe141d7 100644
--- a/src/mame/drivers/fantland.cpp
+++ b/src/mame/drivers/fantland.cpp
@@ -52,7 +52,6 @@ Year + Game Main CPU Sound CPU Sound Video
#include "sound/2151intf.h"
#include "sound/3526intf.h"
#include "sound/dac.h"
-#include "sound/msm5205.h"
#include "includes/fantland.h"
/***************************************************************************
@@ -77,7 +76,7 @@ WRITE16_MEMBER(fantland_state::fantland_nmi_enable_16_w)
WRITE8_MEMBER(fantland_state::fantland_soundlatch_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -294,13 +293,13 @@ static ADDRESS_MAP_START( fantland_sound_map, AS_PROGRAM, 8, fantland_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( fantland_sound_iomap, AS_IO, 8, fantland_state )
- AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_byte_r )
+ AM_RANGE( 0x0080, 0x0080 ) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE( 0x0180, 0x0180 ) AM_DEVWRITE("dac", dac_device, write_unsigned8 )
ADDRESS_MAP_END
static ADDRESS_MAP_START( galaxygn_sound_iomap, AS_IO, 8, fantland_state )
- AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_byte_r )
+ AM_RANGE( 0x0080, 0x0080 ) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
ADDRESS_MAP_END
@@ -399,7 +398,7 @@ WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_3) { borntofi_adpcm_int(m_m
static ADDRESS_MAP_START( borntofi_sound_map, AS_PROGRAM, 8, fantland_state )
AM_RANGE( 0x00000, 0x003ff ) AM_RAM
- AM_RANGE( 0x04000, 0x04000 ) AM_READ(soundlatch_byte_r)
+ AM_RANGE( 0x04000, 0x04000 ) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE( 0x04000, 0x0401f ) AM_WRITE(borntofi_msm5205_w)
AM_RANGE( 0x08000, 0x0ffff ) AM_ROM
AM_RANGE( 0xf8000, 0xfffff ) AM_ROM
@@ -418,7 +417,7 @@ static ADDRESS_MAP_START( wheelrun_sound_map, AS_PROGRAM, 8, fantland_state )
AM_RANGE(0xb000, 0xb000) AM_WRITENOP // on a car crash / hit
AM_RANGE(0xc000, 0xc000) AM_WRITENOP // ""
- AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r ) // during NMI
+ AM_RANGE(0xd000, 0xd000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) // during NMI
ADDRESS_MAP_END
@@ -870,6 +869,8 @@ static MACHINE_CONFIG_START( fantland, fantland_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", 3000000)
MCFG_SOUND_ROUTE(0, "mono", 0.35)
MCFG_SOUND_ROUTE(1, "mono", 0.35)
@@ -915,6 +916,8 @@ static MACHINE_CONFIG_START( galaxygn, fantland_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", 3000000)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(fantland_state, galaxygn_sound_irq))
MCFG_SOUND_ROUTE(0, "mono", 1.0)
@@ -993,6 +996,8 @@ static MACHINE_CONFIG_START( borntofi, fantland_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
// OKI M5205 running at 384kHz [18.432/48]. Sample rate = 384000 / 48
MCFG_SOUND_ADD("msm1", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(fantland_state, borntofi_adpcm_int_0)) /* IRQ handler */
@@ -1046,6 +1051,8 @@ static MACHINE_CONFIG_START( wheelrun, fantland_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3526, XTAL_14MHz/4)
MCFG_YM3526_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_IRQ0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/fcombat.cpp b/src/mame/drivers/fcombat.cpp
index cd1f0c1a03c..304f33b1e7c 100644
--- a/src/mame/drivers/fcombat.cpp
+++ b/src/mame/drivers/fcombat.cpp
@@ -33,6 +33,7 @@ inputs + notes by stephh
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
#include "includes/fcombat.h"
@@ -126,14 +127,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, fcombat_state )
AM_RANGE(0xec00, 0xec00) AM_WRITE(ec00_w)
AM_RANGE(0xed00, 0xed00) AM_WRITE(ed00_w)
AM_RANGE(0xee00, 0xee00) AM_WRITE(ee00_w) // related to protection ? - doesn't seem to have any effect
- AM_RANGE(0xef00, 0xef00) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xef00, 0xef00) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
ADDRESS_MAP_END
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, fcombat_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM
- AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x6000, 0x6000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x8001, 0x8001) AM_DEVREAD("ay1", ay8910_device, data_r)
AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
AM_RANGE(0xa001, 0xa001) AM_DEVREAD("ay2", ay8910_device, data_r)
@@ -306,6 +307,8 @@ static MACHINE_CONFIG_START( fcombat, fcombat_state )
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 1500000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
diff --git a/src/mame/drivers/fuukifg2.cpp b/src/mame/drivers/fuukifg2.cpp
index e4796dc5f0c..35f90b55867 100644
--- a/src/mame/drivers/fuukifg2.cpp
+++ b/src/mame/drivers/fuukifg2.cpp
@@ -50,7 +50,6 @@ To Do:
#include "cpu/m68000/m68000.h"
#include "sound/2203intf.h"
#include "sound/3812intf.h"
-#include "sound/okim6295.h"
#include "includes/fuukifg2.h"
@@ -78,7 +77,7 @@ WRITE16_MEMBER(fuuki16_state::sound_command_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space,0,data & 0xff);
+ m_soundlatch->write(space,0,data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
// space.device().execute().spin_until_time(attotime::from_usec(50)); // Allow the other CPU to reply
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); // Fixes glitching in rasters
@@ -139,7 +138,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( fuuki16_sound_io_map, AS_IO, 8, fuuki16_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(sound_rombank_w) // ROM Bank
- AM_RANGE(0x11, 0x11) AM_READ(soundlatch_byte_r) AM_WRITENOP // From Main CPU / ? To Main CPU ?
+ AM_RANGE(0x11, 0x11) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITENOP // From Main CPU / ? To Main CPU ?
AM_RANGE(0x20, 0x20) AM_WRITE(oki_banking_w) // Oki Banking
AM_RANGE(0x30, 0x30) AM_WRITENOP // ? In the NMI routine
AM_RANGE(0x40, 0x41) AM_DEVWRITE("ym1", ym2203_device, write)
@@ -469,6 +468,8 @@ static MACHINE_CONFIG_START( fuuki16, fuuki16_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, XTAL_28_64MHz / 8) /* 3.58 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.15)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.15)
diff --git a/src/mame/drivers/gaelco.cpp b/src/mame/drivers/gaelco.cpp
index 5b301f59ddc..f054f669d4d 100644
--- a/src/mame/drivers/gaelco.cpp
+++ b/src/mame/drivers/gaelco.cpp
@@ -37,7 +37,7 @@ WRITE16_MEMBER(gaelco_state::bigkarnk_sound_command_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
}
}
@@ -134,7 +134,7 @@ static ADDRESS_MAP_START( bigkarnk_snd_map, AS_PROGRAM, 8, gaelco_state )
AM_RANGE(0x0800, 0x0801) AM_DEVREADWRITE("oki", okim6295_device, read, write) /* OKI6295 */
// AM_RANGE(0x0900, 0x0900) AM_WRITENOP /* enable sound output? */
AM_RANGE(0x0a00, 0x0a01) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) /* YM3812 */
- AM_RANGE(0x0b00, 0x0b00) AM_READ(soundlatch_byte_r) /* Sound latch */
+ AM_RANGE(0x0b00, 0x0b00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) /* Sound latch */
AM_RANGE(0x0c00, 0xffff) AM_ROM /* ROM */
ADDRESS_MAP_END
@@ -533,6 +533,8 @@ static MACHINE_CONFIG_START( bigkarnk, gaelco_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, 3580000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/gameplan.cpp b/src/mame/drivers/gameplan.cpp
index 497d8b3e74a..a59919edc7c 100644
--- a/src/mame/drivers/gameplan.cpp
+++ b/src/mame/drivers/gameplan.cpp
@@ -78,8 +78,6 @@ TODO:
#include "emu.h"
#include "cpu/m6502/m6502.h"
-#include "machine/6532riot.h"
-#include "machine/6522via.h"
#include "sound/ay8910.h"
#include "includes/gameplan.h"
@@ -168,7 +166,7 @@ WRITE_LINE_MEMBER(gameplan_state::r6532_irq)
WRITE8_MEMBER(gameplan_state::r6532_soundlatch_w)
{
address_space &progspace = m_maincpu->space(AS_PROGRAM);
- soundlatch_byte_w(progspace, 0, data);
+ m_soundlatch->write(progspace, 0, data);
}
@@ -978,6 +976,8 @@ static MACHINE_CONFIG_START( gameplan, gameplan_state )
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, GAMEPLAN_AY8910_CLOCK)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3"))
@@ -996,7 +996,7 @@ static MACHINE_CONFIG_START( gameplan, gameplan_state )
MCFG_VIA6522_CB2_HANDLER(WRITELINE(gameplan_state, coin_w))
MCFG_DEVICE_ADD("via6522_2", VIA6522, 0)
- MCFG_VIA6522_READPB_HANDLER(READ8(driver_device, soundlatch_byte_r))
+ MCFG_VIA6522_READPB_HANDLER(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(gameplan_state, audio_cmd_w))
MCFG_VIA6522_CA2_HANDLER(WRITELINE(gameplan_state, audio_trigger_w))
MCFG_VIA6522_CB2_HANDLER(WRITELINE(gameplan_state, audio_reset_w))
diff --git a/src/mame/drivers/ghosteo.cpp b/src/mame/drivers/ghosteo.cpp
index 2a6a1fa071b..67ad8f62cd9 100644
--- a/src/mame/drivers/ghosteo.cpp
+++ b/src/mame/drivers/ghosteo.cpp
@@ -59,6 +59,7 @@ ToDo: verify QS1000 hook-up
#include "emu.h"
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
+#include "machine/gen_latch.h"
#include "machine/s3c2410.h"
//#include "machine/smartmed.h"
#include "machine/i2cmem.h"
@@ -86,14 +87,18 @@ class ghosteo_state : public driver_device
public:
ghosteo_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu") ,
+ m_maincpu(*this, "maincpu"),
+ m_qs1000(*this, "qs1000"),
m_i2cmem(*this, "i2cmem"),
m_s3c2410(*this, "s3c2410"),
+ m_soundlatch(*this, "soundlatch"),
m_system_memory(*this, "systememory") { }
required_device<cpu_device> m_maincpu;
+ required_device<qs1000_device> m_qs1000;
required_device<i2cmem_device> m_i2cmem;
required_device<s3c2410_device> m_s3c2410;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT32> m_system_memory;
int m_security_count;
@@ -154,7 +159,7 @@ NAND Flash Controller (4KB internal buffer)
READ8_MEMBER( ghosteo_state::qs1000_p1_r )
{
- return soundlatch_byte_r(space, 0);
+ return m_soundlatch->read(space, 0);
}
WRITE8_MEMBER( ghosteo_state::qs1000_p1_w )
@@ -171,12 +176,10 @@ WRITE8_MEMBER( ghosteo_state::qs1000_p3_w )
// ...x .... - ?
// ..x. .... - /IRQ clear
- qs1000_device *qs1000 = machine().device<qs1000_device>("qs1000");
-
membank("qs1000:bank")->set_entry(data & 0x07);
if (!BIT(data, 5))
- qs1000->set_irq(CLEAR_LINE);
+ m_qs1000->set_irq(CLEAR_LINE);
}
@@ -586,10 +589,8 @@ READ32_MEMBER(ghosteo_state::bballoon_speedup_r)
WRITE32_MEMBER(ghosteo_state::soundlatch_w)
{
- qs1000_device *qs1000 = space.machine().device<qs1000_device>("qs1000");
-
- soundlatch_byte_w(space, 0, data);
- qs1000->set_irq(ASSERT_LINE);
+ m_soundlatch->write(space, 0, data);
+ m_qs1000->set_irq(ASSERT_LINE);
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
@@ -645,6 +646,8 @@ static MACHINE_CONFIG_START( ghosteo, ghosteo_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("qs1000", QS1000, XTAL_24MHz)
MCFG_QS1000_EXTERNAL_ROM(true)
MCFG_QS1000_IN_P1_CB(READ8(ghosteo_state, qs1000_p1_r))
diff --git a/src/mame/drivers/ginganin.cpp b/src/mame/drivers/ginganin.cpp
index cd8dffb1f8e..620870e93ac 100644
--- a/src/mame/drivers/ginganin.cpp
+++ b/src/mame/drivers/ginganin.cpp
@@ -95,7 +95,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ginganin_state )
AM_RANGE(0x0000, 0x07ff) AM_RAM
AM_RANGE(0x0800, 0x0807) AM_DEVREADWRITE("6840ptm", ptm6840_device, read, write)
- AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x1800, 0x1800) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ymsnd", y8950_device, write)
AM_RANGE(0x2800, 0x2801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
AM_RANGE(0x4000, 0xffff) AM_ROM
@@ -271,6 +271,8 @@ static MACHINE_CONFIG_START( ginganin, ginganin_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, SOUND_CLOCK / 2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
diff --git a/src/mame/drivers/lordgun.cpp b/src/mame/drivers/lordgun.cpp
index 15b66477bf1..6a61bdfa80d 100644
--- a/src/mame/drivers/lordgun.cpp
+++ b/src/mame/drivers/lordgun.cpp
@@ -43,9 +43,7 @@ Notes:
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
-#include "machine/eepromser.h"
#include "sound/3812intf.h"
-#include "sound/okim6295.h"
#include "sound/ymf278b.h"
#include "includes/lordgun.h"
@@ -272,8 +270,8 @@ READ16_MEMBER(lordgun_state::lordgun_gun_1_y_r)
WRITE16_MEMBER(lordgun_state::lordgun_soundlatch_w)
{
- if (ACCESSING_BITS_0_7) soundlatch_byte_w (space, 0, (data >> 0) & 0xff);
- if (ACCESSING_BITS_8_15) soundlatch2_byte_w(space, 0, (data >> 8) & 0xff);
+ if (ACCESSING_BITS_0_7) m_soundlatch->write(space, 0, (data >> 0) & 0xff);
+ if (ACCESSING_BITS_8_15) m_soundlatch2->write(space, 0, (data >> 8) & 0xff);
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -362,16 +360,16 @@ WRITE8_MEMBER(lordgun_state::lordgun_okibank_w)
static ADDRESS_MAP_START( lordgun_soundio_map, AS_IO, 8, lordgun_state )
AM_RANGE(0x1000, 0x1001) AM_DEVWRITE("ymsnd", ym3812_device, write)
AM_RANGE(0x2000, 0x2000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch2_byte_r )
- AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r )
+ AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch2", generic_latch_8_device, read)
+ AM_RANGE(0x4000, 0x4000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x5000, 0x5000) AM_READNOP
AM_RANGE(0x6000, 0x6000) AM_WRITE(lordgun_okibank_w )
ADDRESS_MAP_END
static ADDRESS_MAP_START( aliencha_soundio_map, AS_IO, 8, lordgun_state )
- AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch2_byte_r )
- AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r )
+ AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch2", generic_latch_8_device, read)
+ AM_RANGE(0x4000, 0x4000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x5000, 0x5000) AM_WRITENOP // writes 03 then 07 at end of NMI
AM_RANGE(0x7000, 0x7000) AM_DEVREAD("ymf", ymf278b_device, read)
AM_RANGE(0x7000, 0x7005) AM_DEVWRITE("ymf", ymf278b_device, write)
@@ -672,6 +670,9 @@ static MACHINE_CONFIG_START( lordgun, lordgun_state )
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_3_579545MHz)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -721,6 +722,9 @@ static MACHINE_CONFIG_START( aliencha, lordgun_state )
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("ymf", YMF278B, 26000000) // ? 26MHz matches video (decrease for faster music tempo)
MCFG_DEVICE_ADDRESS_MAP(AS_0, ymf278_map)
MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/m107.cpp b/src/mame/drivers/m107.cpp
index 9a92d8ad326..e2a057b39b7 100644
--- a/src/mame/drivers/m107.cpp
+++ b/src/mame/drivers/m107.cpp
@@ -126,8 +126,8 @@ WRITE16_MEMBER(m107_state::bankswitch_w)
WRITE16_MEMBER(m107_state::soundlatch_w)
{
m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, ASSERT_LINE);
- soundlatch_byte_w(space, 0, data & 0xff);
-// logerror("soundlatch_byte_w %02x\n",data);
+ m_soundlatch->write(space, 0, data & 0xff);
+// logerror("m_soundlatch->write %02x\n",data);
}
READ16_MEMBER(m107_state::sound_status_r)
@@ -138,7 +138,7 @@ READ16_MEMBER(m107_state::sound_status_r)
READ16_MEMBER(m107_state::soundlatch_r)
{
m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, CLEAR_LINE);
- return soundlatch_byte_r(space, offset) | 0xff00;
+ return m_soundlatch->read(space, offset) | 0xff00;
}
WRITE16_MEMBER(m107_state::sound_irq_ack_w)
@@ -824,6 +824,8 @@ static MACHINE_CONFIG_START( firebarr, m107_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", 14318180/4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.40)
diff --git a/src/mame/drivers/m63.cpp b/src/mame/drivers/m63.cpp
index 1a0f04752eb..2e70f38c2a7 100644
--- a/src/mame/drivers/m63.cpp
+++ b/src/mame/drivers/m63.cpp
@@ -96,7 +96,7 @@ Notes:
The NMI handler just handles the "Stop Mode" dip switch.
TS 2008.06.14:
-- Addedd sound emulation - atomboy and fghtbskt req different interrupt (T1)
+- Added sound emulation - atomboy and fghtbskt req different interrupt (T1)
timing than wilytowr, otherwise music/fx tempo is too fast.
Music tempo and pitch verified on real pcb.
- Extra space in atomboy 2764 eproms is filled with garbage z80 code
@@ -120,6 +120,7 @@ Dip locations verified for:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/mcs48/mcs48.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
#include "sound/samples.h"
@@ -133,13 +134,14 @@ public:
m_videoram2(*this, "videoram2"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
- m_soundcpu(*this, "soundcpu"),
- m_samples(*this, "samples"),
m_maincpu(*this, "maincpu"),
m_ay1(*this, "ay1"),
m_ay2(*this, "ay2"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_soundcpu(*this, "soundcpu"),
+ m_samples(*this, "samples"),
+ m_soundlatch(*this, "soundlatch")
{
}
@@ -165,9 +167,16 @@ public:
int m_p2;
std::unique_ptr<INT16[]> m_samplebuf;
- /* sound devices */
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<ay8910_device> m_ay1;
+ optional_device<ay8910_device> m_ay2;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
required_device<cpu_device> m_soundcpu;
optional_device<samples_device> m_samples;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE8_MEMBER(m63_videoram_w);
DECLARE_WRITE8_MEMBER(m63_colorram_w);
DECLARE_WRITE8_MEMBER(m63_videoram2_w);
@@ -197,11 +206,6 @@ public:
INTERRUPT_GEN_MEMBER(snd_irq);
INTERRUPT_GEN_MEMBER(vblank_irq);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- required_device<cpu_device> m_maincpu;
- required_device<ay8910_device> m_ay1;
- optional_device<ay8910_device> m_ay2;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
@@ -440,7 +444,7 @@ READ8_MEMBER(m63_state::snddata_r)
{
switch (m_p2 & 0xf0)
{
- case 0x60: return soundlatch_byte_r(space, 0); ;
+ case 0x60: return m_soundlatch->read(space, 0); ;
case 0x70: return memregion("user1")->base()[((m_p1 & 0x1f) << 8) | offset];
}
return 0xff;
@@ -471,7 +475,7 @@ static ADDRESS_MAP_START( m63_map, AS_PROGRAM, 8, m63_state )
AM_RANGE(0xf002, 0xf002) AM_WRITE(m63_flipscreen_w)
AM_RANGE(0xf003, 0xf003) AM_WRITE(m63_palbank_w)
AM_RANGE(0xf006, 0xf007) AM_WRITE(coin_w)
- AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1") AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xf801, 0xf801) AM_READ_PORT("P2") AM_WRITENOP /* continues game when in stop mode (cleared by NMI handler) */
AM_RANGE(0xf802, 0xf802) AM_READ_PORT("DSW1")
AM_RANGE(0xf803, 0xf803) AM_WRITE(snd_irq_w)
@@ -494,7 +498,7 @@ static ADDRESS_MAP_START( fghtbskt_map, AS_PROGRAM, 8, m63_state )
AM_RANGE(0xf003, 0xf003) AM_READ_PORT("DSW")
AM_RANGE(0xf000, 0xf000) AM_WRITE(snd_irq_w)
AM_RANGE(0xf001, 0xf001) AM_WRITENOP
- AM_RANGE(0xf002, 0xf002) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xf002, 0xf002) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xf800, 0xf800) AM_WRITENOP
AM_RANGE(0xf801, 0xf801) AM_WRITE(nmi_mask_w)
AM_RANGE(0xf802, 0xf802) AM_WRITE(fghtbskt_flipscreen_w)
@@ -779,6 +783,8 @@ static MACHINE_CONFIG_START( m63, m63_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono") /* ????? */
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, XTAL_12MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
@@ -822,6 +828,8 @@ static MACHINE_CONFIG_START( fghtbskt, m63_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, XTAL_12MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp
index 37fe8921b2a..acab1dcb3e6 100644
--- a/src/mame/drivers/m72.cpp
+++ b/src/mame/drivers/m72.cpp
@@ -1106,7 +1106,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( rtype_sound_portmap, AS_IO, 8, m72_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x06, 0x06) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w)
AM_RANGE(0x84, 0x84) AM_DEVREAD("m72", m72_audio_device, sample_r)
ADDRESS_MAP_END
@@ -1114,7 +1114,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, m72_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x06, 0x06) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w)
AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w)
AM_RANGE(0x84, 0x84) AM_DEVREAD("m72", m72_audio_device, sample_r)
@@ -1123,7 +1123,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( rtype2_sound_portmap, AS_IO, 8, m72_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x80, 0x81) AM_DEVWRITE("m72", m72_audio_device, rtype2_sample_addr_w)
AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w)
AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w)
@@ -1135,7 +1135,7 @@ static ADDRESS_MAP_START( poundfor_sound_portmap, AS_IO, 8, m72_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x10, 0x13) AM_DEVWRITE("m72", m72_audio_device, poundfor_sample_addr_w)
AM_RANGE(0x40, 0x41) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0x42, 0x42) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x42, 0x42) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x42, 0x42) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w)
ADDRESS_MAP_END
@@ -1871,6 +1871,8 @@ static MACHINE_CONFIG_FRAGMENT( m72_audio_chips )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("m72", M72, 0);
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
diff --git a/src/mame/drivers/m90.cpp b/src/mame/drivers/m90.cpp
index 66097bbacf6..9bc262da880 100644
--- a/src/mame/drivers/m90.cpp
+++ b/src/mame/drivers/m90.cpp
@@ -58,7 +58,7 @@ WRITE16_MEMBER(m90_state::dynablsb_sound_command_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -131,7 +131,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( m90_sound_cpu_io_map, AS_IO, 8, m90_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x80, 0x81) AM_DEVWRITE("m72", m72_audio_device, rtype2_sample_addr_w)
AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w)
AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w)
@@ -141,7 +141,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( dynablsb_sound_cpu_io_map, AS_IO, 8, m90_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x82, 0x82) AM_DEVWRITE("dac", dac_device, write_signed8)
ADDRESS_MAP_END
@@ -149,7 +149,7 @@ static ADDRESS_MAP_START( m99_sound_cpu_io_map, AS_IO, 8, m90_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, poundfor_sample_addr_w)
AM_RANGE(0x40, 0x41) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0x42, 0x42) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x42, 0x42) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x42, 0x42) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w)
ADDRESS_MAP_END
@@ -744,6 +744,8 @@ static MACHINE_CONFIG_START( m90, m90_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("m72", M72, 0)
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
diff --git a/src/mame/drivers/m92.cpp b/src/mame/drivers/m92.cpp
index c7b8dd95e97..2b17ab8bce0 100644
--- a/src/mame/drivers/m92.cpp
+++ b/src/mame/drivers/m92.cpp
@@ -208,7 +208,6 @@ psoldier dip locations still need verification.
#include "machine/irem_cpu.h"
#include "sound/2151intf.h"
#include "sound/iremga20.h"
-#include "sound/okim6295.h"
// I haven't managed to find a way to keep nbbatman happy when using the proper upd71059c device
@@ -338,7 +337,7 @@ WRITE16_MEMBER(m92_state::m92_soundlatch_w)
if (m_soundcpu)
m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, ASSERT_LINE);
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
}
READ16_MEMBER(m92_state::m92_sound_status_r)
@@ -352,7 +351,7 @@ READ16_MEMBER(m92_state::m92_soundlatch_r)
if (m_soundcpu)
m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, CLEAR_LINE);
- return soundlatch_byte_r(space, offset) | 0xff00;
+ return m_soundlatch->read(space, offset) | 0xff00;
}
WRITE16_MEMBER(m92_state::m92_sound_irq_ack_w)
@@ -1004,6 +1003,8 @@ static MACHINE_CONFIG_START( m92, m92_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP0))
MCFG_SOUND_ROUTE(0, "mono", 0.40)
@@ -1056,6 +1057,7 @@ static MACHINE_CONFIG_DERIVED( ppan, m92 )
MCFG_CPU_IO_MAP(ppan_portmap)
MCFG_DEVICE_REMOVE("soundcpu")
+ MCFG_DEVICE_REMOVE("soundlatch")
MCFG_DEVICE_REMOVE("ymsnd")
MCFG_DEVICE_REMOVE("irem")
diff --git a/src/mame/drivers/momoko.cpp b/src/mame/drivers/momoko.cpp
index b4b23ec7aa9..3702f925599 100644
--- a/src/mame/drivers/momoko.cpp
+++ b/src/mame/drivers/momoko.cpp
@@ -47,6 +47,7 @@ Stephh's notes (based on the game Z80 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
#include "sound/2203intf.h"
#include "includes/momoko.h"
@@ -66,7 +67,7 @@ static ADDRESS_MAP_START( momoko_map, AS_PROGRAM, 8, momoko_state )
AM_RANGE(0xd400, 0xd400) AM_READ_PORT("IN0") AM_WRITENOP /* interrupt ack? */
AM_RANGE(0xd402, 0xd402) AM_READ_PORT("IN1") AM_WRITE(momoko_flipscreen_w)
AM_RANGE(0xd404, 0xd404) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0xd406, 0xd406) AM_READ_PORT("DSW0") AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xd406, 0xd406) AM_READ_PORT("DSW0") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xd407, 0xd407) AM_READ_PORT("DSW1")
AM_RANGE(0xd800, 0xdbff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xdc00, 0xdc00) AM_WRITE(momoko_fg_scrolly_w)
@@ -278,6 +279,8 @@ static MACHINE_CONFIG_START( momoko, momoko_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, 1250000)
MCFG_SOUND_ROUTE(0, "mono", 0.15)
MCFG_SOUND_ROUTE(1, "mono", 0.15)
@@ -285,7 +288,7 @@ static MACHINE_CONFIG_START( momoko, momoko_state )
MCFG_SOUND_ROUTE(3, "mono", 0.40)
MCFG_SOUND_ADD("ym2", YM2203, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
+ MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_SOUND_ROUTE(0, "mono", 0.15)
MCFG_SOUND_ROUTE(1, "mono", 0.15)
MCFG_SOUND_ROUTE(2, "mono", 0.15)
diff --git a/src/mame/drivers/ms32.cpp b/src/mame/drivers/ms32.cpp
index 32293c02c73..8fd5e12aa70 100644
--- a/src/mame/drivers/ms32.cpp
+++ b/src/mame/drivers/ms32.cpp
@@ -82,7 +82,7 @@ Priorities (code in tetrisp2.c doesn't use all of the priority ram.. and doesn't
- some games require completely reversed list processing!
Dip switches/inputs in t2m32 and f1superb
-some games (hayaosi2) don't seeem to have service mode even if it's listed among the dips
+some games (hayaosi2) don't seem to have service mode even if it's listed among the dips
service mode is still accessible through F1 though
Fix Anything Else (Palette etc.)
@@ -105,7 +105,7 @@ horizontal position of tx and bg tilemaps is off by 1 pixel in some games
bbbxing: some sprite/roz/bg alignment issues
gratia: at the beginning of a level it shows the level name in the bottom right corner, scrolling it up
- and making the score display scroll out of the screen. Is this correct ar should there be a raster
+ and making the score display scroll out of the screen. Is this correct or should there be a raster
effect keeping the score on screen? And why didn't they just use sprites to do that?
gratia: the 3d sky shown at the beginning of the game has a black gap near the end. It would not be visible
@@ -117,7 +117,7 @@ gratia: the 3d sky seems to be the only place needed the "wrap" parameter to dra
gratia: at the beginning of the game, before the sky appears, the city background appears for
an instant. Missing layer enable register?
-background color: pen 0 is correct for gametngk, but wrong for f1superb. Maybe it dpeends on the layer
+background color: pen 0 is correct for gametngk, but wrong for f1superb. Maybe it depends on the layer
priority order?
roz layer wrapping: currently it's always ON, breaking places where it gets very small so it gets
@@ -221,7 +221,7 @@ READ32_MEMBER(ms32_state::ms32_read_inputs3)
WRITE32_MEMBER(ms32_state::ms32_sound_w)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
// give the Z80 time to respond
@@ -1343,7 +1343,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ms32_state::ms32_interrupt)
READ8_MEMBER(ms32_state::latch_r)
{
m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
- return soundlatch_byte_r(space,0)^0xff;
+ return m_soundlatch->read(space,0)^0xff;
}
WRITE8_MEMBER(ms32_state::ms32_snd_bank_w)
@@ -1414,6 +1414,8 @@ static MACHINE_CONFIG_START( ms32, ms32_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymf", YMF271, 16934400)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/mugsmash.cpp b/src/mame/drivers/mugsmash.cpp
index 77e5c55efe5..0cee7ed9153 100644
--- a/src/mame/drivers/mugsmash.cpp
+++ b/src/mame/drivers/mugsmash.cpp
@@ -56,7 +56,7 @@ WRITE16_MEMBER(mugsmash_state::mugsmash_reg2_w)
switch (offset)
{
case 1:
- soundlatch_byte_w(space, 1, data & 0xff);
+ m_soundlatch->write(space, 1, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
break;
@@ -197,7 +197,7 @@ static ADDRESS_MAP_START( mugsmash_sound_map, AS_PROGRAM, 8, mugsmash_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -419,6 +419,8 @@ static MACHINE_CONFIG_START( mugsmash, mugsmash_state )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", 3579545)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 1.00) /* music */
diff --git a/src/mame/drivers/olibochu.cpp b/src/mame/drivers/olibochu.cpp
index 8e997d897fb..5f76ddabc3d 100644
--- a/src/mame/drivers/olibochu.cpp
+++ b/src/mame/drivers/olibochu.cpp
@@ -55,6 +55,7 @@ $7004 writes, related to $7000 reads
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
class olibochu_state : public driver_device
@@ -68,7 +69,8 @@ public:
m_spriteram2(*this, "spriteram2"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -76,6 +78,12 @@ public:
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_spriteram2;
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+
/* video-related */
tilemap_t *m_bg_tilemap;
@@ -93,9 +101,6 @@ public:
UINT32 screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(olibochu_scanline);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
@@ -255,7 +260,7 @@ WRITE8_MEMBER(olibochu_state::sound_command_w)
for (c = 15; c >= 0; c--)
if (m_cmd & (1 << c)) break;
- if (c >= 0) soundlatch_byte_w(space, 0, 15 - c);
+ if (c >= 0) m_soundlatch->write(space, 0, 15 - c);
}
@@ -281,7 +286,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( olibochu_sound_map, AS_PROGRAM, 8, olibochu_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x6000, 0x63ff) AM_RAM
- AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) /* likely ay8910 input port, not direct */
+ AM_RANGE(0x7000, 0x7000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) /* likely ay8910 input port, not direct */
AM_RANGE(0x7000, 0x7001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
AM_RANGE(0x7004, 0x7004) AM_WRITENOP //sound filter?
AM_RANGE(0x7006, 0x7006) AM_WRITENOP //irq ack?
@@ -479,6 +484,8 @@ static MACHINE_CONFIG_START( olibochu, olibochu_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, 2000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/pgm.cpp b/src/mame/drivers/pgm.cpp
index d26b8392863..41868a2de66 100644
--- a/src/mame/drivers/pgm.cpp
+++ b/src/mame/drivers/pgm.cpp
@@ -52,7 +52,7 @@ Known Games on this Platform
ToDo:
- IRQ4 generation - Puzzli 2 doens't like this, many other games require it for coins / inputs to work.
+ IRQ4 generation - Puzzli 2 doesn't like this, many other games require it for coins / inputs to work.
Protection Devices / Co-processors
@@ -173,7 +173,7 @@ Notes:
-----
3.6V_BATT - 3.6V NICad battery, connected to the V3021 RTC
IDC34 - IDC34 way flat cable plug, PGM can support 4 players max in two cabs,
- this is jamma connecter for another cab and the P3&P4
+ this is jamma connector for another cab and the P3&P4
PAL - Atmel ATF16V8B PAL (DIP20)
SW1 - Push button switch to enter Test Mode
SW2 - 8 position DIP Switch (for configuration of PCB/game options)
@@ -277,7 +277,7 @@ WRITE16_MEMBER(pgm_state::m68k_l1_w)
{
if (PGMLOGERROR)
logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, space.device().safe_pc());
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
}
}
@@ -286,7 +286,7 @@ WRITE8_MEMBER(pgm_state::z80_l3_w)
{
if (PGMLOGERROR)
logerror("SL 3 z80.w %02x (%04x)\n", data, space.device().safe_pc());
- soundlatch3_byte_w(space, 0, data);
+ m_soundlatch3->write(space, 0, data);
}
WRITE_LINE_MEMBER(pgm_state::pgm_sound_irq)
@@ -304,9 +304,9 @@ ADDRESS_MAP_END
ADDRESS_MAP_START( pgm_z80_io, AS_IO, 8, pgm_state )
AM_RANGE(0x8000, 0x8003) AM_DEVREADWRITE("ics", ics2115_device, read, write)
- AM_RANGE(0x8100, 0x81ff) AM_READ(soundlatch3_byte_r) AM_WRITE(z80_l3_w)
- AM_RANGE(0x8200, 0x82ff) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w)
- AM_RANGE(0x8400, 0x84ff) AM_READWRITE(soundlatch2_byte_r, soundlatch2_byte_w)
+ AM_RANGE(0x8100, 0x81ff) AM_DEVREAD("soundlatch3", generic_latch_8_device, read) AM_WRITE(z80_l3_w)
+ AM_RANGE(0x8200, 0x82ff) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write)
+ AM_RANGE(0x8400, 0x84ff) AM_DEVREADWRITE("soundlatch2", generic_latch_8_device, read, write)
ADDRESS_MAP_END
/*** 68000 (main CPU) + variants for protection devices **********************/
@@ -320,12 +320,12 @@ ADDRESS_MAP_START( pgm_base_mem, AS_PROGRAM, 16, pgm_state )
AM_RANGE(0xa00000, 0xa011ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_SHARE("videoregs") /* Video Regs inc. Zoom Table */
- AM_RANGE(0xc00002, 0xc00003) AM_READ(soundlatch_word_r) AM_WRITE(m68k_l1_w)
- AM_RANGE(0xc00004, 0xc00005) AM_READWRITE(soundlatch2_word_r, soundlatch2_word_w)
+ AM_RANGE(0xc00002, 0xc00003) AM_DEVREAD8("soundlatch", generic_latch_8_device, read, 0x00ff) AM_WRITE(m68k_l1_w)
+ AM_RANGE(0xc00004, 0xc00005) AM_DEVREADWRITE8("soundlatch2", generic_latch_8_device, read, write, 0x00ff)
AM_RANGE(0xc00006, 0xc00007) AM_DEVREADWRITE8("rtc", v3021_device, read, write, 0x00ff)
AM_RANGE(0xc00008, 0xc00009) AM_WRITE(z80_reset_w)
AM_RANGE(0xc0000a, 0xc0000b) AM_WRITE(z80_ctrl_w)
- AM_RANGE(0xc0000c, 0xc0000d) AM_READWRITE(soundlatch3_word_r, soundlatch3_word_w)
+ AM_RANGE(0xc0000c, 0xc0000d) AM_DEVREADWRITE8("soundlatch3", generic_latch_8_device, read, write, 0x00ff)
AM_RANGE(0xc08000, 0xc08001) AM_READ_PORT("P1P2")
AM_RANGE(0xc08002, 0xc08003) AM_READ_PORT("P3P4")
@@ -538,6 +538,11 @@ MACHINE_CONFIG_FRAGMENT( pgmbase )
/*sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch3")
+
MCFG_ICS2115_ADD("ics", 0)
MCFG_ICS2115_IRQ_CB(WRITELINE(pgm_state, pgm_sound_irq))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 5.0)
diff --git a/src/mame/drivers/pokechmp.cpp b/src/mame/drivers/pokechmp.cpp
index 6394aea67fe..a02d4ba615e 100644
--- a/src/mame/drivers/pokechmp.cpp
+++ b/src/mame/drivers/pokechmp.cpp
@@ -33,7 +33,7 @@ ROM 11 = Main CPU code?
-Sound = Yamaha YM2203C + Y3014B
-Also, there are some GALs on the board (not dumped) a
- 8-dips bank and two oscilators (4 MHz and 24 MHz, both near
+ 8-dips bank and two oscillators (4 MHz and 24 MHz, both near
the sound parts).
ClawGrip, Jul 2006
@@ -69,7 +69,7 @@ WRITE8_MEMBER(pokechmp_state::pokechmp_sound_bank_w)
WRITE8_MEMBER(pokechmp_state::pokechmp_sound_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -107,7 +107,7 @@ static ADDRESS_MAP_START( pokechmp_sound_map, AS_PROGRAM, 8, pokechmp_state )
AM_RANGE(0x1800, 0x1800) AM_WRITENOP /* MSM5205 chip on Pocket Gal, not connected here? */
AM_RANGE(0x2000, 0x2000) AM_WRITE(pokechmp_sound_bank_w) /* sound rom bank seems to be replaced with OKI bank */
AM_RANGE(0x2800, 0x2800) AM_DEVREADWRITE("oki", okim6295_device, read, write) // extra
- AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
// AM_RANGE(0x3400, 0x3400) AM_READ(pokechmp_adpcm_reset_r) /* not on here */
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank3")
AM_RANGE(0x8000, 0xffff) AM_ROM
@@ -238,6 +238,8 @@ static MACHINE_CONFIG_START( pokechmp, pokechmp_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, XTAL_4MHz/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
diff --git a/src/mame/drivers/ppmast93.cpp b/src/mame/drivers/ppmast93.cpp
index b3d2bc556fb..e2e8cb8539c 100644
--- a/src/mame/drivers/ppmast93.cpp
+++ b/src/mame/drivers/ppmast93.cpp
@@ -133,6 +133,7 @@ Dip locations added based on the notes above.
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/2413intf.h"
#include "sound/dac.h"
@@ -211,7 +212,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( ppmast93_cpu1_io, AS_IO, 8, ppmast93_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0x02, 0x02) AM_READ_PORT("P2")
AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM") AM_WRITE(port4_w)
AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW1")
@@ -220,7 +221,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( ppmast93_cpu2_map, AS_PROGRAM, 8, ppmast93_state )
AM_RANGE(0x0000, 0xfbff) AM_ROM AM_REGION("sub", 0x10000)
- AM_RANGE(0xfc00, 0xfc00) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xfc00, 0xfc00) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xfd00, 0xffff) AM_RAM
ADDRESS_MAP_END
@@ -399,6 +400,8 @@ static MACHINE_CONFIG_START( ppmast93, ppmast93_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2413, 5000000/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
diff --git a/src/mame/drivers/psychic5.cpp b/src/mame/drivers/psychic5.cpp
index 3f079ba10b9..0333e04e0a3 100644
--- a/src/mame/drivers/psychic5.cpp
+++ b/src/mame/drivers/psychic5.cpp
@@ -331,6 +331,7 @@ Notes (23-Jan-2016 AS):
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/2203intf.h"
#include "includes/psychic5.h"
@@ -436,7 +437,7 @@ static ADDRESS_MAP_START( psychic5_main_map, AS_PROGRAM, 8, psychic5_state )
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("mainbank")
AM_RANGE(0xc000, 0xdfff) AM_DEVICE("vrambank", address_map_bank_device, amap8)
AM_RANGE(0xe000, 0xefff) AM_RAM
- AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xf000, 0xf000) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xf001, 0xf001) AM_READNOP AM_WRITE(psychic5_coin_counter_w)
AM_RANGE(0xf002, 0xf002) AM_READWRITE(bankselect_r, psychic5_bankselect_w)
AM_RANGE(0xf003, 0xf003) AM_READWRITE(vram_page_select_r, vram_page_select_w)
@@ -472,7 +473,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( psychic5_sound_map, AS_PROGRAM, 8, psychic5_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM
- AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( psychic5_soundport_map, AS_IO, 8, psychic5_state )
@@ -488,7 +489,7 @@ static ADDRESS_MAP_START( bombsa_main_map, AS_PROGRAM, 8, psychic5_state )
AM_RANGE(0xc000, 0xcfff) AM_RAM
/* ports look like the other games */
- AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch_byte_w) // confirmed
+ AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) // confirmed
AM_RANGE(0xd001, 0xd001) AM_WRITE(bombsa_flipscreen_w)
AM_RANGE(0xd002, 0xd002) AM_READWRITE(bankselect_r, bombsa_bankselect_w)
AM_RANGE(0xd003, 0xd003) AM_READWRITE(vram_page_select_r, vram_page_select_w)
@@ -504,7 +505,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( bombsa_sound_map, AS_PROGRAM, 8, psychic5_state )
AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM
- AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xf000, 0xf000) AM_WRITEONLY // Is this a confirm of some sort?
ADDRESS_MAP_END
@@ -746,6 +747,8 @@ static MACHINE_CONFIG_START( psychic5, psychic5_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, XTAL_12MHz/8)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.15)
@@ -796,6 +799,8 @@ static MACHINE_CONFIG_START( bombsa, psychic5_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, XTAL_12MHz/8)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.30)
diff --git a/src/mame/drivers/pturn.cpp b/src/mame/drivers/pturn.cpp
index 82d6fd2d033..0655195bcce 100644
--- a/src/mame/drivers/pturn.cpp
+++ b/src/mame/drivers/pturn.cpp
@@ -78,6 +78,7 @@ ROMS: All ROM labels say only "PROM" and a number.
*/
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
@@ -89,12 +90,14 @@ public:
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram") { }
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_spriteram;
@@ -325,7 +328,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, pturn_state )
AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0xe400, 0xe400) AM_WRITE(fgpalette_w)
- AM_RANGE(0xe800, 0xe800) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xe800, 0xe800) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE("spriteram")
@@ -353,7 +356,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, pturn_state )
AM_RANGE(0x0000, 0x0fff) AM_ROM
AM_RANGE(0x2000, 0x23ff) AM_RAM
- AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(nmi_sub_enable_w)
+ AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(nmi_sub_enable_w)
AM_RANGE(0x4000, 0x4000) AM_RAM
AM_RANGE(0x5000, 0x5001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
@@ -490,7 +493,7 @@ void pturn_state::machine_start()
void pturn_state::machine_reset()
{
address_space &space = m_maincpu->space(AS_PROGRAM);
- soundlatch_clear_byte_w(space,0,0);
+ m_soundlatch->clear_w(space,0,0);
}
static MACHINE_CONFIG_START( pturn, pturn_state )
@@ -518,6 +521,8 @@ static MACHINE_CONFIG_START( pturn, pturn_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 2000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/redalert.cpp b/src/mame/drivers/redalert.cpp
index 469e3253fc0..cff4ab900da 100644
--- a/src/mame/drivers/redalert.cpp
+++ b/src/mame/drivers/redalert.cpp
@@ -81,7 +81,7 @@
the MAME soundrom (red alert) it is marked exactly the same "w3s1"(IC5).
The Bprom matched the Red Alert set also... marked "W3" i think?
it's hard to see because the sticker has been damaged.
- The other eproms exept one did not match anything in MAME,
+ The other eproms except one did not match anything in MAME,
and only one of those had the eprom type markings on it... I read all
like that type.
diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp
index 5a37bae7207..a5706997c33 100644
--- a/src/mame/drivers/royalmah.cpp
+++ b/src/mame/drivers/royalmah.cpp
@@ -95,6 +95,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/tlcs90/tlcs90.h"
+#include "machine/gen_latch.h"
#include "machine/msm6242.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
@@ -109,12 +110,15 @@ public:
m_maincpu(*this,"maincpu"),
m_videoram(*this, "videoram"),
m_audiocpu(*this, "audiocpu"),
- m_rtc(*this, "rtc") { }
+ m_rtc(*this, "rtc"),
+ m_soundlatch(*this, "soundlatch") { }
required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_videoram;
optional_device<cpu_device> m_audiocpu;
optional_device<msm6242_device> m_rtc;
+ optional_device<generic_latch_8_device> m_soundlatch;
+
UINT8 m_input_port_select;
UINT8 m_dsw_select;
UINT8 m_rombank;
@@ -808,7 +812,7 @@ READ8_MEMBER(royalmah_state::jansou_6405_r)
WRITE8_MEMBER(royalmah_state::jansou_sound_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -837,7 +841,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( jansou_sub_iomap, AS_IO, 8, royalmah_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) AM_DEVWRITE("dac", dac_device, write_unsigned8 )
+ AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("dac", dac_device, write_unsigned8 )
ADDRESS_MAP_END
@@ -3353,6 +3357,8 @@ static MACHINE_CONFIG_DERIVED( jansou, royalmah )
MCFG_CPU_IO_MAP(jansou_sub_iomap)
MCFG_CPU_PERIODIC_INT_DRIVER(royalmah_state, irq0_line_hold, 4000000/512)
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_DAC_ADD("dac")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/shisen.cpp b/src/mame/drivers/shisen.cpp
index 8b1c1347c66..1ad20d759f1 100644
--- a/src/mame/drivers/shisen.cpp
+++ b/src/mame/drivers/shisen.cpp
@@ -68,7 +68,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( shisen_sound_io_map, AS_IO, 8, shisen_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x80, 0x81) AM_DEVWRITE("m72", m72_audio_device, shisen_sample_addr_w)
AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w)
AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w)
@@ -232,6 +232,8 @@ static MACHINE_CONFIG_START( shisen, shisen_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("m72", M72, 0)
MCFG_YM2151_ADD("ymsnd", 3579545)
diff --git a/src/mame/drivers/silvmil.cpp b/src/mame/drivers/silvmil.cpp
index fed4f7976be..72948726546 100644
--- a/src/mame/drivers/silvmil.cpp
+++ b/src/mame/drivers/silvmil.cpp
@@ -26,6 +26,7 @@ Very likely to be 'whatever crystals we had on hand which were close enough for
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "video/decospr.h"
#include "sound/2151intf.h"
@@ -39,6 +40,7 @@ public:
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_sprgen(*this, "spritegen"),
+ m_soundlatch(*this, "soundlatch"),
m_bg_videoram(*this, "bg_videoram"),
m_fg_videoram(*this, "fg_videoram"),
m_spriteram(*this, "spriteram") { }
@@ -48,6 +50,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<decospr_device> m_sprgen;
+ required_device<generic_latch_8_device> m_soundlatch;
/* memory pointers */
required_shared_ptr<UINT16> m_bg_videoram;
@@ -111,7 +114,7 @@ public:
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
}
@@ -385,7 +388,7 @@ static ADDRESS_MAP_START( silvmil_sound_map, AS_PROGRAM, 8, silvmil_state )
AM_RANGE(0xd000, 0xd7ff) AM_RAM
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xc002, 0xc002) AM_DEVREADWRITE("oki", okim6295_device, read, write) AM_MIRROR(1)
- AM_RANGE(0xc006, 0xc006) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xc006, 0xc006) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xc00f, 0xc00f) AM_WRITENOP // ??
ADDRESS_MAP_END
@@ -423,6 +426,8 @@ static MACHINE_CONFIG_START( silvmil, silvmil_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4) /* Verified */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/skyfox.cpp b/src/mame/drivers/skyfox.cpp
index e0040ed1457..199025b4768 100644
--- a/src/mame/drivers/skyfox.cpp
+++ b/src/mame/drivers/skyfox.cpp
@@ -40,7 +40,7 @@ WRITE8_MEMBER(skyfox_state::skyfox_vregs_w)
break;
case 1:
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
break;
default:
@@ -74,7 +74,7 @@ static ADDRESS_MAP_START( skyfox_sound_map, AS_PROGRAM, 8, skyfox_state )
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ym1", ym2203_device, read, write)
// AM_RANGE(0xb000, 0xb001) AM_WRITENOP // ??
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
- AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xb000, 0xb000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -244,6 +244,8 @@ static MACHINE_CONFIG_START( skyfox, skyfox_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, XTAL_14_31818MHz/8) /* Verified at 1.789772MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/drivers/spartanxtec.cpp b/src/mame/drivers/spartanxtec.cpp
index 3d267d47276..7cd0a9f9b8a 100644
--- a/src/mame/drivers/spartanxtec.cpp
+++ b/src/mame/drivers/spartanxtec.cpp
@@ -22,6 +22,7 @@ probably an original bug?
#include "emu.h"
#include "cpu/z80/z80.h"
#include "includes/iremipt.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
class spartanxtec_state : public driver_device
@@ -36,7 +37,8 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_palette(*this, "palette"),
- m_gfxdecode(*this, "gfxdecode")
+ m_gfxdecode(*this, "gfxdecode"),
+ m_soundlatch(*this, "soundlatch")
{ }
required_shared_ptr<UINT8> m_m62_tileram;
@@ -45,6 +47,9 @@ public:
required_shared_ptr<UINT8> m_scroll_hi;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<palette_device> m_palette;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<generic_latch_8_device> m_soundlatch;
virtual void machine_start() override;
virtual void machine_reset() override;
@@ -60,11 +65,6 @@ public:
DECLARE_WRITE8_MEMBER(a801_w);
DECLARE_WRITE8_MEMBER(sound_irq_ack);
DECLARE_WRITE8_MEMBER(irq_ack);
-
- required_device<palette_device> m_palette;
- required_device<gfxdecode_device> m_gfxdecode;
-
-
};
@@ -161,7 +161,7 @@ UINT32 spartanxtec_state::screen_update_spartanxtec(screen_device &screen, bitma
WRITE8_MEMBER(spartanxtec_state::spartanxtec_soundlatch_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -213,7 +213,7 @@ static ADDRESS_MAP_START( spartanxtec_sound_map, AS_PROGRAM, 8, spartanxtec_stat
AM_RANGE(0x0000, 0x0fff) AM_ROM
AM_RANGE(0x8000, 0x83ff) AM_RAM
- AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( spartanxtec_sound_io, AS_IO, 8, spartanxtec_state )
@@ -383,6 +383,8 @@ static MACHINE_CONFIG_START( spartanxtec, spartanxtec_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 1000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, 1000000)
diff --git a/src/mame/drivers/splash.cpp b/src/mame/drivers/splash.cpp
index 5b32c10d8c0..a31da94b4b3 100644
--- a/src/mame/drivers/splash.cpp
+++ b/src/mame/drivers/splash.cpp
@@ -54,7 +54,7 @@ WRITE16_MEMBER(splash_state::splash_sh_irqtrigger_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
}
@@ -63,7 +63,7 @@ WRITE16_MEMBER(splash_state::roldf_sh_irqtrigger_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -121,7 +121,7 @@ static ADDRESS_MAP_START( splash_sound_map, AS_PROGRAM, 8, splash_state )
AM_RANGE(0x0000, 0xd7ff) AM_ROM /* ROM */
AM_RANGE(0xd800, 0xd800) AM_WRITE(splash_adpcm_data_w) /* ADPCM data for the MSM5205 chip */
// AM_RANGE(0xe000, 0xe000) AM_WRITENOP /* ??? */
- AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r) /* Sound latch */
+ AM_RANGE(0xe800, 0xe800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) /* Sound latch */
AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) /* YM3812 */
AM_RANGE(0xf800, 0xffff) AM_RAM /* RAM */
ADDRESS_MAP_END
@@ -199,7 +199,7 @@ static ADDRESS_MAP_START( roldfrog_sound_io_map, AS_IO, 8, splash_state )
AM_RANGE(0x40, 0x40) AM_NOP
AM_RANGE(0x31, 0x31) AM_WRITE(sound_bank_w)
AM_RANGE(0x37, 0x37) AM_WRITE(roldfrog_vblank_ack_w )
- AM_RANGE(0x70, 0x70) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x70, 0x70) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x0, 0xff) AM_READ(roldfrog_unk_r)
ADDRESS_MAP_END
@@ -217,7 +217,7 @@ WRITE16_MEMBER(splash_state::spr_write)
WRITE16_MEMBER(splash_state::funystrp_sh_irqtrigger_w)
{
- soundlatch_byte_w(space, 0, data>>8);
+ m_soundlatch->write(space, 0, data>>8);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -280,7 +280,7 @@ static ADDRESS_MAP_START( funystrp_sound_io_map, AS_IO, 8, splash_state )
AM_RANGE(0x00, 0x00) AM_WRITE(msm1_data_w)
AM_RANGE(0x01, 0x01) AM_WRITE(msm2_data_w)
AM_RANGE(0x02, 0x02) AM_WRITE(sound_bank_w)
- AM_RANGE(0x03, 0x03) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x03, 0x03) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x04, 0x04) AM_READ(int_source_r)
AM_RANGE(0x06, 0x06) AM_WRITE(msm1_interrupt_w)
AM_RANGE(0x07, 0x07) AM_WRITE(msm2_interrupt_w)
@@ -514,6 +514,8 @@ static MACHINE_CONFIG_START( splash, splash_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_30MHz/8) /* 3.75MHz (30/8) */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
@@ -568,6 +570,8 @@ static MACHINE_CONFIG_START( roldfrog, splash_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_24MHz / 8)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(splash_state, ym_irq))
MCFG_SOUND_ROUTE(0, "mono", 0.20)
@@ -651,6 +655,8 @@ static MACHINE_CONFIG_START( funystrp, splash_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("msm1", MSM5205, XTAL_400kHz)
MCFG_MSM5205_VCLK_CB(WRITELINE(splash_state, adpcm_int1)) /* interrupt function */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 1 / 48 */ /* Sample rate = 400kHz/64 */
diff --git a/src/mame/drivers/spyhuntertec.cpp b/src/mame/drivers/spyhuntertec.cpp
index 464ae6e3b0d..d8c51804c36 100644
--- a/src/mame/drivers/spyhuntertec.cpp
+++ b/src/mame/drivers/spyhuntertec.cpp
@@ -19,6 +19,7 @@ sound system appears to be the same as 'spartanxtec.cpp'
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
#include "spyhunttec.lh"
@@ -38,7 +39,8 @@ public:
m_spyhunt_alpharam(*this, "spyhunt_alpha"),
m_palette(*this, "palette"),
m_gfxdecode(*this, "gfxdecode"),
- m_screen(*this, "screen")
+ m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch")
{ }
@@ -54,6 +56,7 @@ public:
required_device<palette_device> m_palette;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
+ required_device<generic_latch_8_device> m_soundlatch;
virtual void machine_start() override;
virtual void machine_reset() override;
@@ -334,7 +337,7 @@ UINT32 spyhuntertec_state::screen_update_spyhuntertec(screen_device &screen, bit
WRITE8_MEMBER(spyhuntertec_state::spyhuntertec_fd00_w)
{
// printf("%04x spyhuntertec_fd00_w %02x\n", space.device().safe_pc(), data);
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -468,7 +471,7 @@ static ADDRESS_MAP_START( spyhuntertec_sound_map, AS_PROGRAM, 8, spyhuntertec_st
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x8000, 0x83ff) AM_RAM
- AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -694,6 +697,8 @@ static MACHINE_CONFIG_START( spyhuntertec, spyhuntertec_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8912, 3000000/2) // AY-3-8912
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_AY8910_PORT_A_READ_CB(READ8(spyhuntertec_state, ay1_porta_r))
diff --git a/src/mame/drivers/tetrisp2.cpp b/src/mame/drivers/tetrisp2.cpp
index b7e7f1beb70..5e8726e5e5e 100644
--- a/src/mame/drivers/tetrisp2.cpp
+++ b/src/mame/drivers/tetrisp2.cpp
@@ -563,7 +563,7 @@ READ16_MEMBER(stepstag_state::unk_a42000_r)
WRITE16_MEMBER(stepstag_state::stepstag_soundlatch_word_w)
{
- soundlatch_word_w(space, offset, data, mem_mask);
+ m_soundlatch->write(space, offset, data, mem_mask);
m_subcpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
@@ -617,7 +617,7 @@ static ADDRESS_MAP_START( stepstag_map, AS_PROGRAM, 16, stepstag_state )
AM_RANGE(0xa44000, 0xa44001) AM_READNOP // watchdog
// AM_RANGE(0xa48000, 0xa48001) AM_WRITENOP // PC?
// AM_RANGE(0xa4c000, 0xa4c001) AM_WRITENOP // PC?
- AM_RANGE(0xa50000, 0xa50001) AM_READWRITE( soundlatch_word_r, stepstag_soundlatch_word_w )
+ AM_RANGE(0xa50000, 0xa50001) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_WRITE(stepstag_soundlatch_word_w)
AM_RANGE(0xa60000, 0xa60003) AM_DEVWRITE8("ymz", ymz280b_device, write, 0x00ff) // Sound
AM_RANGE(0xb00000, 0xb00001) AM_WRITENOP // Coin Counter plus other things
@@ -673,7 +673,7 @@ static ADDRESS_MAP_START( stepstag_sub_map, AS_PROGRAM, 16, stepstag_state )
AM_RANGE(0xa80000, 0xa80001) AM_WRITENOP // cleared after writing this sprite list
// AM_RANGE(0xac0000, 0xac0001) AM_WRITENOP // cleared at boot
- AM_RANGE(0xb00000, 0xb00001) AM_READWRITE( soundlatch_word_r, soundlatch_word_w )
+ AM_RANGE(0xb00000, 0xb00001) AM_DEVREADWRITE("soundlatch", generic_latch_16_device, read, write)
AM_RANGE(0xc00000, 0xc00001) AM_READ(unknown_read_0xc00000) AM_WRITENOP //??
AM_RANGE(0xd00000, 0xd00001) AM_READNOP // watchdog
@@ -1552,6 +1552,8 @@ static MACHINE_CONFIG_START( stepstag, stepstag_state )
// sound hardware
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymz", YMZ280B, 16934400)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp
index 9ea3f95100f..20f671825ce 100644
--- a/src/mame/drivers/vegaeo.cpp
+++ b/src/mame/drivers/vegaeo.cpp
@@ -16,6 +16,7 @@
#include "emu.h"
#include "cpu/e132xs/e132xs.h"
#include "machine/at28c16.h"
+#include "machine/gen_latch.h"
#include "sound/qs1000.h"
#include "includes/eolith.h"
@@ -24,7 +25,10 @@ class vegaeo_state : public eolith_state
{
public:
vegaeo_state(const machine_config &mconfig, device_type type, const char *tag)
- : eolith_state(mconfig, type, tag) { }
+ : eolith_state(mconfig, type, tag),
+ m_soundlatch(*this, "soundlatch") { }
+
+ required_device<generic_latch_8_device> m_soundlatch;
std::unique_ptr<UINT32[]> m_vega_vram;
UINT8 m_vega_vbuffer;
@@ -47,7 +51,7 @@ public:
READ8_MEMBER( vegaeo_state::qs1000_p1_r )
{
- return soundlatch_byte_r(space, 0);
+ return m_soundlatch->read(space, 0);
}
WRITE8_MEMBER( vegaeo_state::qs1000_p1_w )
@@ -121,7 +125,7 @@ READ32_MEMBER(vegaeo_state::vegaeo_custom_read)
WRITE32_MEMBER(vegaeo_state::soundlatch_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_qs1000->set_irq(ASSERT_LINE);
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
@@ -236,6 +240,8 @@ static MACHINE_CONFIG_START( vega, vegaeo_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("qs1000", QS1000, XTAL_24MHz)
MCFG_QS1000_EXTERNAL_ROM(true)
MCFG_QS1000_IN_P1_CB(READ8(vegaeo_state, qs1000_p1_r))
diff --git a/src/mame/drivers/vigilant.cpp b/src/mame/drivers/vigilant.cpp
index 35053e8f5e2..4b615dd94e6 100644
--- a/src/mame/drivers/vigilant.cpp
+++ b/src/mame/drivers/vigilant.cpp
@@ -117,7 +117,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, vigilant_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0x80, 0x81) AM_READ(soundlatch_byte_r) AM_DEVWRITE("m72", m72_audio_device, vigilant_sample_addr_w) /* STL / STH */
+ AM_RANGE(0x80, 0x81) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("m72", m72_audio_device, vigilant_sample_addr_w) /* STL / STH */
AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w) /* COUNT UP */
AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) /* IRQ clear */
AM_RANGE(0x84, 0x84) AM_DEVREAD("m72", m72_audio_device, sample_r) /* S ROM C */
@@ -127,7 +127,7 @@ static ADDRESS_MAP_START( buccanrs_sound_io_map, AS_IO, 8, vigilant_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ym1", ym2203_device, read, write)
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
- AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) /* SDRE */
+ AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read) /* SDRE */
AM_RANGE(0x80, 0x81) AM_DEVWRITE("m72", m72_audio_device, vigilant_sample_addr_w) /* STL / STH */
AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w) /* COUNT UP */
AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) /* IRQ clear */
@@ -496,6 +496,8 @@ static MACHINE_CONFIG_START( vigilant, vigilant_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("m72", M72, 0)
MCFG_YM2151_ADD("ymsnd", 3579645)
@@ -537,6 +539,8 @@ static MACHINE_CONFIG_START( buccanrs, vigilant_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("m72", M72, 0)
MCFG_SOUND_ADD("ym1", YM2203, 18432000/6)
@@ -594,6 +598,8 @@ static MACHINE_CONFIG_START( kikcubic, vigilant_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("m72", M72, 0)
MCFG_YM2151_ADD("ymsnd", 3579645)
diff --git a/src/mame/includes/aquarium.h b/src/mame/includes/aquarium.h
index 2741a17be17..257a5721097 100644
--- a/src/mame/includes/aquarium.h
+++ b/src/mame/includes/aquarium.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "video/excellent_spr.h"
@@ -12,13 +14,14 @@ public:
m_bak_videoram(*this, "bak_videoram"),
m_txt_videoram(*this, "txt_videoram"),
m_scroll(*this, "scroll"),
- m_audiocpu(*this, "audiocpu"),
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
- m_screen(*this, "screen")
+ m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch")
{ }
/* memory pointers */
@@ -36,7 +39,15 @@ public:
int m_aquarium_snd_ack;
/* devices */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<okim6295_device> m_oki;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<excellent_spr_device> m_sprgen;
+ required_device<screen_device> m_screen;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_READ16_MEMBER(aquarium_coins_r);
DECLARE_WRITE8_MEMBER(aquarium_snd_ack_w);
DECLARE_WRITE16_MEMBER(aquarium_sound_w);
@@ -55,13 +66,6 @@ public:
virtual void video_start() override;
UINT32 screen_update_aquarium(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT8 aquarium_snd_bitswap( UINT8 scrambled_data );
- required_device<cpu_device> m_maincpu;
- required_device<okim6295_device> m_oki;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
- required_device<excellent_spr_device> m_sprgen;
- required_device<screen_device> m_screen;
-
void mix_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_mask, int priority_value);
bitmap_ind16 m_temp_sprite_bitmap;
};
diff --git a/src/mame/includes/blueprnt.h b/src/mame/includes/blueprnt.h
index f515e0c6ed1..656e0ee6b08 100644
--- a/src/mame/includes/blueprnt.h
+++ b/src/mame/includes/blueprnt.h
@@ -6,22 +6,29 @@
***************************************************************************/
+#include "machine/gen_latch.h"
+
class blueprnt_state : public driver_device
{
public:
blueprnt_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_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_videoram(*this, "videoram"),
m_scrollram(*this, "scrollram"),
m_spriteram(*this, "spriteram"),
- m_colorram(*this, "colorram"),
- m_maincpu(*this, "maincpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_colorram(*this, "colorram") { }
/* device/memory pointers */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_scrollram;
required_shared_ptr<UINT8> m_spriteram;
@@ -49,7 +56,4 @@ public:
DECLARE_PALETTE_INIT(blueprnt);
UINT32 screen_update_blueprnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/capbowl.h b/src/mame/includes/capbowl.h
index 43db2bcfbe5..25c645ef0e6 100644
--- a/src/mame/includes/capbowl.h
+++ b/src/mame/includes/capbowl.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
#include "video/tms34061.h"
@@ -25,6 +26,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_tms34061(*this, "tms34061"),
m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch"),
m_rowaddress(*this, "rowaddress") { }
/* devices */
@@ -33,6 +35,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<tms34061_device> m_tms34061;
required_device<screen_device> m_screen;
+ required_device<generic_latch_8_device> m_soundlatch;
/* memory pointers */
required_shared_ptr<UINT8> m_rowaddress;
diff --git a/src/mame/includes/cischeat.h b/src/mame/includes/cischeat.h
index 7a74b9e4f82..9a2a4e8c3e5 100644
--- a/src/mame/includes/cischeat.h
+++ b/src/mame/includes/cischeat.h
@@ -1,7 +1,10 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
+
/* TODO: some variables are per-game specifics */
+
#include "sound/okim6295.h"
+#include "machine/gen_latch.h"
#include "machine/ticket.h"
#include "machine/watchdog.h"
@@ -26,6 +29,8 @@ public:
m_oki2(*this, "oki2"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
+ m_soundlatch2(*this, "soundlatch2"),
m_captflag_hopper(*this, "hopper"),
m_captflag_motor_left(*this, "motor_left"),
m_captflag_motor_right(*this, "motor_right"),
@@ -128,6 +133,8 @@ public:
required_device<okim6295_device> m_oki2;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_16_device> m_soundlatch;
+ optional_device<generic_latch_16_device> m_soundlatch2;
// captflag
optional_device<ticket_dispenser_device> m_captflag_hopper;
diff --git a/src/mame/includes/crospang.h b/src/mame/includes/crospang.h
index a5aecdada51..4a5058731e4 100644
--- a/src/mame/includes/crospang.h
+++ b/src/mame/includes/crospang.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "video/decospr.h"
class crospang_state : public driver_device
@@ -16,15 +17,15 @@ public:
m_fg_videoram(*this, "fg_videoram"),
m_bg_videoram(*this, "bg_videoram"),
m_spriteram(*this, "spriteram"),
- m_sprgen(*this, "spritegen"),
m_maincpu(*this, "maincpu"),
- m_gfxdecode(*this, "gfxdecode") { }
+ m_sprgen(*this, "spritegen"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_fg_videoram;
required_shared_ptr<UINT16> m_bg_videoram;
required_shared_ptr<UINT16> m_spriteram;
- optional_device<decospr_device> m_sprgen;
/* video-related */
tilemap_t *m_bg_layer;
@@ -32,6 +33,11 @@ public:
int m_bestri_tilebank;
/* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<decospr_device> m_sprgen;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE16_MEMBER(crospang_soundlatch_w);
DECLARE_WRITE16_MEMBER(bestri_tilebank_w);
DECLARE_WRITE16_MEMBER(bestri_bg_scrolly_w);
@@ -52,6 +58,4 @@ public:
virtual void video_start() override;
UINT32 screen_update_crospang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void tumblepb_gfx1_rearrange();
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
};
diff --git a/src/mame/includes/fantland.h b/src/mame/includes/fantland.h
index bce1ffa5140..c2ae4f464c8 100644
--- a/src/mame/includes/fantland.h
+++ b/src/mame/includes/fantland.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class fantland_state : public driver_device
@@ -7,17 +9,18 @@ class fantland_state : public driver_device
public:
fantland_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_gfxdecode(*this, "gfxdecode"),
+ m_screen(*this, "screen"),
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_msm1(*this, "msm1"),
m_msm2(*this, "msm2"),
m_msm3(*this, "msm3"),
m_msm4(*this, "msm4"),
m_spriteram(*this, "spriteram", 0),
- m_spriteram2(*this, "spriteram2", 0),
- m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_spriteram2(*this, "spriteram2", 0) { }
/* memory pointers */
// UINT8 * m_spriteram; // currently directly used in a 16bit map...
@@ -34,10 +37,17 @@ public:
int m_adpcm_nibble[4];
/* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
optional_device<msm5205_device> m_msm1;
optional_device<msm5205_device> m_msm2;
optional_device<msm5205_device> m_msm3;
optional_device<msm5205_device> m_msm4;
+
optional_shared_ptr<UINT8> m_spriteram;
optional_shared_ptr<UINT8> m_spriteram2;
DECLARE_WRITE_LINE_MEMBER(galaxygn_sound_irq);
@@ -68,9 +78,4 @@ public:
void borntofi_adpcm_start( msm5205_device *device, int voice );
void borntofi_adpcm_stop( msm5205_device *device, int voice );
void borntofi_adpcm_int( msm5205_device *device, int voice );
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/fuukifg2.h b/src/mame/includes/fuukifg2.h
index ba0c6eeaa33..cd051d90c28 100644
--- a/src/mame/includes/fuukifg2.h
+++ b/src/mame/includes/fuukifg2.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia,Paul Priest
+
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "video/fuukifg.h"
@@ -22,6 +24,7 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_fuukivid(*this, "fuukivid"),
+ m_soundlatch(*this, "soundlatch"),
m_vram(*this, "vram"),
m_vregs(*this, "vregs"),
m_unknown(*this, "unknown"),
@@ -36,6 +39,7 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<fuukivid_device> m_fuukivid;
+ required_device<generic_latch_8_device> m_soundlatch;
/* memory pointers */
required_shared_ptr_array<UINT16,4> m_vram;
diff --git a/src/mame/includes/gaelco.h b/src/mame/includes/gaelco.h
index 57c1478304b..2bfd7d4829f 100644
--- a/src/mame/includes/gaelco.h
+++ b/src/mame/includes/gaelco.h
@@ -6,6 +6,8 @@
***************************************************************************/
+#include "machine/gen_latch.h"
+
class gaelco_state : public driver_device
{
public:
@@ -15,6 +17,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_audiocpu(*this, "audiocpu"),
+ m_soundlatch(*this, "soundlatch"),
m_videoram(*this, "videoram"),
m_vregs(*this, "vregs"),
m_spriteram(*this, "spriteram"),
@@ -25,6 +28,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
optional_device<cpu_device> m_audiocpu;
+ optional_device<generic_latch_8_device> m_soundlatch;
/* memory pointers */
required_shared_ptr<UINT16> m_videoram;
diff --git a/src/mame/includes/gameplan.h b/src/mame/includes/gameplan.h
index d01d6d969a9..f668b23d338 100644
--- a/src/mame/includes/gameplan.h
+++ b/src/mame/includes/gameplan.h
@@ -10,6 +10,7 @@ driver by Chris Moore
#include "machine/6522via.h"
#include "machine/6532riot.h"
+#include "machine/gen_latch.h"
#define GAMEPLAN_MAIN_MASTER_CLOCK (XTAL_3_579545MHz)
#define GAMEPLAN_AUDIO_MASTER_CLOCK (XTAL_3_579545MHz)
@@ -43,7 +44,8 @@ public:
m_via_0(*this, "via6522_0"),
m_via_1(*this, "via6522_1"),
m_via_2(*this, "via6522_2"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch") { }
/* machine state */
UINT8 m_current_port;
@@ -66,6 +68,9 @@ public:
required_device<via6522_device> m_via_1;
required_device<via6522_device> m_via_2;
required_device<screen_device> m_screen;
+ optional_device<generic_latch_8_device> m_soundlatch;
+
+
DECLARE_WRITE8_MEMBER(io_select_w);
DECLARE_READ8_MEMBER(io_port_r);
DECLARE_WRITE_LINE_MEMBER(coin_w);
diff --git a/src/mame/includes/ginganin.h b/src/mame/includes/ginganin.h
index 33d09944529..ae39a9e207f 100644
--- a/src/mame/includes/ginganin.h
+++ b/src/mame/includes/ginganin.h
@@ -6,6 +6,8 @@
*************************************************************************/
+#include "machine/gen_latch.h"
+
class ginganin_state : public driver_device
{
public:
@@ -15,10 +17,11 @@ public:
m_spriteram(*this, "spriteram"),
m_vregs(*this, "vregs"),
m_fgram(*this, "fgram"),
- m_audiocpu(*this, "audiocpu"),
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_txtram;
@@ -38,7 +41,12 @@ public:
#endif
/* devices */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE16_MEMBER(ginganin_fgram16_w);
DECLARE_WRITE16_MEMBER(ginganin_txtram16_w);
DECLARE_WRITE16_MEMBER(ginganin_vregs16_w);
@@ -52,7 +60,4 @@ public:
virtual void video_start() override;
UINT32 screen_update_ginganin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect );
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/lordgun.h b/src/mame/includes/lordgun.h
index fbc1b57227e..e54834a5f21 100644
--- a/src/mame/includes/lordgun.h
+++ b/src/mame/includes/lordgun.h
@@ -7,6 +7,7 @@
*************************************************************************/
#include "sound/okim6295.h"
#include "machine/eepromser.h"
+#include "machine/gen_latch.h"
struct lordgun_gun_data
{
@@ -26,6 +27,8 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
+ m_soundlatch2(*this, "soundlatch2"),
m_generic_paletteram_16(*this, "paletteram"),
m_priority_ram(*this, "priority_ram"),
m_scrollram(*this, "scrollram"),
@@ -41,6 +44,8 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+ required_device<generic_latch_8_device> m_soundlatch2;
required_shared_ptr<UINT16> m_generic_paletteram_16;
required_shared_ptr<UINT16> m_priority_ram;
diff --git a/src/mame/includes/m107.h b/src/mame/includes/m107.h
index ffdbd28f911..0749d8c56cc 100644
--- a/src/mame/includes/m107.h
+++ b/src/mame/includes/m107.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "machine/pic8259.h"
struct pf_layer_info
@@ -24,9 +25,10 @@ public:
, m_gfxdecode(*this, "gfxdecode")
, m_screen(*this, "screen")
, m_palette(*this, "palette")
+ , m_upd71059c(*this, "upd71059c")
+ , m_soundlatch(*this, "soundlatch")
, m_spriteram(*this, "spriteram")
, m_vram_data(*this, "vram_data")
- , m_upd71059c(*this, "upd71059c")
, m_user1_ptr(*this, "user1")
{
}
@@ -36,10 +38,11 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_device<pic8259_device> m_upd71059c;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_vram_data;
- required_device<pic8259_device> m_upd71059c;
optional_region_ptr<UINT8> m_user1_ptr;
// driver init
diff --git a/src/mame/includes/m90.h b/src/mame/includes/m90.h
index 20412db5fe2..b91715030db 100644
--- a/src/mame/includes/m90.h
+++ b/src/mame/includes/m90.h
@@ -13,7 +13,8 @@ public:
m_soundcpu(*this, "soundcpu"),
m_audio(*this, "m72"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
required_shared_ptr<UINT16> m_video_data;
optional_shared_ptr<UINT16> m_spriteram;
@@ -23,6 +24,7 @@ public:
optional_device<m72_audio_device> m_audio;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
UINT16 m_video_control_data[8];
tilemap_t *m_pf1_layer;
diff --git a/src/mame/includes/m92.h b/src/mame/includes/m92.h
index ceff8595f12..14ace95757f 100644
--- a/src/mame/includes/m92.h
+++ b/src/mame/includes/m92.h
@@ -8,6 +8,7 @@
#include "video/bufsprite.h"
#include "sound/okim6295.h"
+#include "machine/gen_latch.h"
#include "machine/pic8259.h"
struct M92_pf_layer_info
@@ -37,7 +38,8 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
- m_upd71059c(*this, "upd71059c")
+ m_upd71059c(*this, "upd71059c"),
+ m_soundlatch(*this, "soundlatch")
{ }
required_device<buffered_spriteram16_device> m_spriteram;
@@ -50,6 +52,7 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<pic8259_device> m_upd71059c;
+ optional_device<generic_latch_8_device> m_soundlatch;
UINT16 m_sound_status;
UINT32 m_raster_irq_position;
diff --git a/src/mame/includes/ms32.h b/src/mame/includes/ms32.h
index 87fe602a7de..dc8e4f4ff7f 100644
--- a/src/mame/includes/ms32.h
+++ b/src/mame/includes/ms32.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood,Paul Priest
+
+#include "machine/gen_latch.h"
+
class ms32_state : public driver_device
{
public:
@@ -22,7 +25,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
optional_shared_ptr<UINT32> m_mainram;
optional_shared_ptr<UINT32> m_roz_ctrl;
@@ -116,4 +120,5 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
optional_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch; //not for bnstars.cpp
};
diff --git a/src/mame/includes/mugsmash.h b/src/mame/includes/mugsmash.h
index e670686d9c4..93cc654fc81 100644
--- a/src/mame/includes/mugsmash.h
+++ b/src/mame/includes/mugsmash.h
@@ -1,6 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+#include "machine/gen_latch.h"
+
class mugsmash_state : public driver_device
{
public:
@@ -14,7 +16,8 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"){ }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
required_shared_ptr<UINT16> m_videoram1;
required_shared_ptr<UINT16> m_videoram2;
@@ -29,6 +32,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE16_MEMBER(mugsmash_reg2_w);
DECLARE_WRITE16_MEMBER(mugsmash_videoram1_w);
diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h
index f4cb1634e85..039e7a4c904 100644
--- a/src/mame/includes/pgm.h
+++ b/src/mame/includes/pgm.h
@@ -9,7 +9,7 @@
#include "cpu/arm7/arm7core.h"
#include "machine/nvram.h"
#include "machine/pgmcrypt.h"
-
+#include "machine/gen_latch.h"
#include "machine/igs025.h"
#include "machine/igs022.h"
#include "machine/igs028.h"
@@ -28,7 +28,9 @@ public:
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
+ m_soundlatch3(*this, "soundlatch3")
{
m_irq4_disabled = 0;
}
@@ -56,6 +58,8 @@ public:
required_device<cpu_device> m_soundcpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+ required_device<generic_latch_8_device> m_soundlatch3;
device_t *m_ics;
/* used by rendering */
diff --git a/src/mame/includes/pokechmp.h b/src/mame/includes/pokechmp.h
index a4cf94fd34f..1dca3ae166a 100644
--- a/src/mame/includes/pokechmp.h
+++ b/src/mame/includes/pokechmp.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+
+#include "machine/gen_latch.h"
+
class pokechmp_state : public driver_device
{
public:
@@ -10,7 +13,8 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
required_shared_ptr<UINT8> m_videoram;
tilemap_t *m_bg_tilemap;
@@ -29,4 +33,5 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
};
diff --git a/src/mame/includes/redalert.h b/src/mame/includes/redalert.h
index c3aeb7be441..1d3bb0df315 100644
--- a/src/mame/includes/redalert.h
+++ b/src/mame/includes/redalert.h
@@ -9,6 +9,7 @@
****************************************************************************/
+#include "machine/gen_latch.h"
#include "sound/hc55516.h"
class redalert_state : public driver_device
@@ -23,7 +24,9 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_cvsd(*this, "cvsd"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch"),
+ m_soundlatch2(*this, "soundlatch2") { }
UINT8 m_ay8910_latch_1;
UINT8 m_ay8910_latch_2;
@@ -37,6 +40,8 @@ public:
required_device<cpu_device> m_audiocpu;
optional_device<hc55516_device> m_cvsd;
required_device<screen_device> m_screen;
+ required_device<generic_latch_8_device> m_soundlatch;
+ optional_device<generic_latch_8_device> m_soundlatch2;
std::unique_ptr<UINT8[]> m_bitmap_colorram;
UINT8 m_control_xor;
diff --git a/src/mame/includes/skyfox.h b/src/mame/includes/skyfox.h
index c45be86567e..8df505646f6 100644
--- a/src/mame/includes/skyfox.h
+++ b/src/mame/includes/skyfox.h
@@ -6,6 +6,8 @@
*************************************************************************/
+#include "machine/gen_latch.h"
+
class skyfox_state : public driver_device
{
public:
@@ -16,6 +18,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_spriteram(*this, "spriteram")
{ }
@@ -25,6 +28,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_spriteram;
int m_bg_pos;
diff --git a/src/mame/includes/splash.h b/src/mame/includes/splash.h
index 872d52643a6..60da6faa8a8 100644
--- a/src/mame/includes/splash.h
+++ b/src/mame/includes/splash.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Manuel Abadia, David Haywood
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class splash_state : public driver_device
@@ -14,6 +16,7 @@ public:
m_msm2(*this, "msm2"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_pixelram(*this, "pixelram"),
m_videoram(*this, "videoram"),
m_vregs(*this, "vregs"),
@@ -33,6 +36,7 @@ public:
optional_device<msm5205_device> m_msm2;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT16> m_pixelram;
required_shared_ptr<UINT16> m_videoram;
diff --git a/src/mame/includes/tetrisp2.h b/src/mame/includes/tetrisp2.h
index 9f65ee2fa19..8bf7d2b03c4 100644
--- a/src/mame/includes/tetrisp2.h
+++ b/src/mame/includes/tetrisp2.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
+
+#include "machine/gen_latch.h"
+
class tetrisp2_state : public driver_device
{
public:
@@ -140,9 +143,11 @@ class stepstag_state : public tetrisp2_state
public:
stepstag_state(const machine_config &mconfig, device_type type, const char *tag)
: tetrisp2_state(mconfig, type, tag),
- m_spriteram3(*this, "spriteram3") { }
+ m_spriteram3(*this, "spriteram3"),
+ m_soundlatch(*this, "soundlatch") { }
required_shared_ptr<UINT16> m_spriteram3;
+ required_device<generic_latch_16_device> m_soundlatch;
DECLARE_READ16_MEMBER(stepstag_coins_r);
DECLARE_READ16_MEMBER(unknown_read_0xc00000);
DECLARE_READ16_MEMBER(unknown_read_0xffff00);
diff --git a/src/mame/video/cischeat.cpp b/src/mame/video/cischeat.cpp
index 4e95a5a8fdd..6f7d149f38c 100644
--- a/src/mame/video/cischeat.cpp
+++ b/src/mame/video/cischeat.cpp
@@ -42,7 +42,7 @@ Note: if MAME_DEBUG is defined, pressing Z or X with:
Each of the 256 (not all visible) lines of the screen
can display any of the lines of gfx in ROM, which are
- larger than the sceen and can therefore be scrolled
+ larger than the screen and can therefore be scrolled
Cisco Heat F1 GP Star
Line Width 1024 1024
@@ -299,7 +299,7 @@ READ16_MEMBER(cischeat_state::bigrun_vregs_r)
case 0x0004/2 : return ioport("IN3")->read(); // Motor Limit Switches
case 0x0006/2 : return ioport("IN4")->read(); // DSW 1 & 2
- case 0x0008/2 : return soundlatch2_word_r(space,0,0xffff); // From sound cpu
+ case 0x0008/2 : return m_soundlatch2->read(space,0,0xffff); // From sound cpu
case 0x0010/2 :
switch (m_ip_select & 0x3)
@@ -348,7 +348,7 @@ WRITE16_MEMBER(cischeat_state::bigrun_vregs_w)
break;
case 0x000a/2 : // to sound cpu
- soundlatch_word_w(space,0,new_data,0xffff);
+ m_soundlatch->write(space,0,new_data,0xffff);
break;
case 0x000c/2 : break; // ??
@@ -405,7 +405,7 @@ READ16_MEMBER(cischeat_state::cischeat_vregs_r)
}
case 0x2200/2 : return ioport("IN5")->read(); // DSW 3 (4 bits)
- case 0x2300/2 : return soundlatch2_byte_r(space,0); // From sound cpu
+ case 0x2300/2 : return m_soundlatch2->read(space,0,0xffff); // From sound cpu
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return m_vregs[offset];
@@ -459,7 +459,7 @@ WRITE16_MEMBER(cischeat_state::cischeat_vregs_w)
case 0x2208/2 : break; // watchdog reset
case 0x2300/2 : /* Sound CPU: reads latch during int 4, and stores command */
- soundlatch_word_w(space, 0, new_data, 0xffff);
+ m_soundlatch->write(space, 0, new_data, 0xffff);
m_soundcpu->set_input_line(4, HOLD_LINE);
break;
@@ -491,7 +491,7 @@ READ16_MEMBER(cischeat_state::f1gpstar_vregs_r)
case 0x0006/2 : return ioport("IN3")->read(); // ? Read at boot only
- case 0x0008/2 : return soundlatch2_byte_r(space,0); // From sound cpu
+ case 0x0008/2 : return m_soundlatch2->read(space,0,0xffff); // From sound cpu
case 0x000c/2 : return ioport("IN4")->read(); // DSW 3
@@ -533,7 +533,7 @@ READ16_MEMBER(cischeat_state::wildplt_vregs_r)
case 0x0004/2 : return ioport("IN1")->read(); // Buttons
- case 0x0008/2 : return soundlatch2_byte_r(space,0); // From sound cpu
+ case 0x0008/2 : return m_soundlatch2->read(space,0,0xffff); // From sound cpu
case 0x0010/2 : // X, Y
return ioport("IN2")->read() | (ioport("IN3")->read()<<8);
@@ -574,7 +574,7 @@ CPU #0 PC 00235C : Warning, vreg 0006 <- 0000
case 0x0014/2 : break;
/* Usually written in sequence, but not always */
- case 0x0008/2 : soundlatch_word_w(space, 0, new_data, 0xffff); break;
+ case 0x0008/2 : m_soundlatch->write(space, 0, new_data, 0xffff); break;
case 0x0018/2 : m_soundcpu->set_input_line(4, HOLD_LINE); break;
case 0x0010/2 : break;
diff --git a/src/mame/video/ginganin.cpp b/src/mame/video/ginganin.cpp
index 86b56f58177..b511b5ea65c 100644
--- a/src/mame/video/ginganin.cpp
+++ b/src/mame/video/ginganin.cpp
@@ -172,7 +172,7 @@ WRITE16_MEMBER(ginganin_state::ginganin_vregs16_w)
machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
break;
case 7:
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
break;
default: