summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2016-06-12 12:05:15 +0200
committer Ivan Vangelista <mesgnet@yahoo.it>2016-06-12 12:05:15 +0200
commit2fd969b16a8028ae50a4598c5f3a2362d61026e5 (patch)
tree94bc656644c5c0ee0a29c2361ec144385732a85b /src/mame
parent7893ce3aeab23c2a31c5d84d74db06eec5810d87 (diff)
updated remaining drivers to use gen_latch.cpp (nw)
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/audio/aztarac.cpp4
-rw-r--r--src/mame/drivers/40love.cpp10
-rw-r--r--src/mame/drivers/aerofgt.cpp34
-rw-r--r--src/mame/drivers/amspdwy.cpp6
-rw-r--r--src/mame/drivers/ashnojoe.cpp9
-rw-r--r--src/mame/drivers/aztarac.cpp2
-rw-r--r--src/mame/drivers/bking.cpp6
-rw-r--r--src/mame/drivers/blockout.cpp6
-rw-r--r--src/mame/drivers/bublbobl.cpp8
-rw-r--r--src/mame/drivers/buggychl.cpp6
-rw-r--r--src/mame/drivers/cave.cpp19
-rw-r--r--src/mame/drivers/chinagat.cpp17
-rw-r--r--src/mame/drivers/corona.cpp24
-rw-r--r--src/mame/drivers/crshrace.cpp8
-rw-r--r--src/mame/drivers/cybertnk.cpp11
-rw-r--r--src/mame/drivers/cyclemb.cpp13
-rw-r--r--src/mame/drivers/dcheese.cpp18
-rw-r--r--src/mame/drivers/ddragon.cpp11
-rw-r--r--src/mame/drivers/ddragon3.cpp15
-rw-r--r--src/mame/drivers/discoboy.cpp25
-rw-r--r--src/mame/drivers/dynadice.cpp9
-rw-r--r--src/mame/drivers/esd16.cpp11
-rw-r--r--src/mame/drivers/f1gp.cpp6
-rw-r--r--src/mame/drivers/flstory.cpp12
-rw-r--r--src/mame/drivers/fromanc2.cpp18
-rw-r--r--src/mame/drivers/gaiden.cpp20
-rw-r--r--src/mame/drivers/galaxian.cpp8
-rw-r--r--src/mame/drivers/gladiatr.cpp8
-rw-r--r--src/mame/drivers/gotcha.cpp9
-rw-r--r--src/mame/drivers/grchamp.cpp6
-rw-r--r--src/mame/drivers/gstriker.cpp6
-rw-r--r--src/mame/drivers/gsword.cpp7
-rw-r--r--src/mame/drivers/halleys.cpp13
-rw-r--r--src/mame/drivers/hh_hmcs40.cpp17
-rw-r--r--src/mame/drivers/himesiki.cpp7
-rw-r--r--src/mame/drivers/homedata.cpp11
-rw-r--r--src/mame/drivers/inufuku.cpp6
-rw-r--r--src/mame/drivers/kas89.cpp12
-rw-r--r--src/mame/drivers/kickgoal.cpp12
-rw-r--r--src/mame/drivers/kingdrby.cpp2
-rw-r--r--src/mame/drivers/kingpin.cpp12
-rw-r--r--src/mame/drivers/ksayakyu.cpp8
-rw-r--r--src/mame/drivers/kurukuru.cpp29
-rw-r--r--src/mame/drivers/ladyfrog.cpp6
-rw-r--r--src/mame/drivers/limenko.cpp15
-rw-r--r--src/mame/drivers/lkage.cpp8
-rw-r--r--src/mame/drivers/looping.cpp11
-rw-r--r--src/mame/drivers/matmania.cpp12
-rw-r--r--src/mame/drivers/mcatadv.cpp11
-rw-r--r--src/mame/drivers/mirax.cpp10
-rw-r--r--src/mame/drivers/missb2.cpp4
-rw-r--r--src/mame/drivers/msisaac.cpp8
-rw-r--r--src/mame/drivers/neoprint.cpp11
-rw-r--r--src/mame/drivers/ninjakd2.cpp15
-rw-r--r--src/mame/drivers/nmg5.cpp17
-rw-r--r--src/mame/drivers/nycaptor.cpp16
-rw-r--r--src/mame/drivers/oneshot.cpp11
-rw-r--r--src/mame/drivers/onetwo.cpp13
-rw-r--r--src/mame/drivers/othello.cpp15
-rw-r--r--src/mame/drivers/pass.cpp11
-rw-r--r--src/mame/drivers/pbaction.cpp10
-rw-r--r--src/mame/drivers/pitnrun.cpp17
-rw-r--r--src/mame/drivers/quizpun2.cpp13
-rw-r--r--src/mame/drivers/renegade.cpp6
-rw-r--r--src/mame/drivers/retofinv.cpp6
-rw-r--r--src/mame/drivers/rollrace.cpp7
-rw-r--r--src/mame/drivers/roul.cpp12
-rw-r--r--src/mame/drivers/sauro.cpp14
-rw-r--r--src/mame/drivers/shadfrce.cpp6
-rw-r--r--src/mame/drivers/sliver.cpp17
-rw-r--r--src/mame/drivers/snowbros.cpp25
-rw-r--r--src/mame/drivers/solomon.cpp6
-rw-r--r--src/mame/drivers/sothello.cpp8
-rw-r--r--src/mame/drivers/spbactn.cpp23
-rw-r--r--src/mame/drivers/spcforce.cpp7
-rw-r--r--src/mame/drivers/spdodgeb.cpp6
-rw-r--r--src/mame/drivers/speedspn.cpp7
-rw-r--r--src/mame/drivers/ssozumo.cpp6
-rw-r--r--src/mame/drivers/stuntair.cpp11
-rw-r--r--src/mame/drivers/suprslam.cpp6
-rw-r--r--src/mame/drivers/tagteam.cpp6
-rw-r--r--src/mame/drivers/tail2nos.cpp6
-rw-r--r--src/mame/drivers/taitosj.cpp9
-rw-r--r--src/mame/drivers/taotaido.cpp6
-rw-r--r--src/mame/drivers/tatsumi.cpp10
-rw-r--r--src/mame/drivers/tbowl.cpp9
-rw-r--r--src/mame/drivers/tecmo.cpp10
-rw-r--r--src/mame/drivers/tecmo16.cpp6
-rw-r--r--src/mame/drivers/tecmosys.cpp14
-rw-r--r--src/mame/drivers/tehkanwc.cpp11
-rw-r--r--src/mame/drivers/thedeep.cpp6
-rw-r--r--src/mame/drivers/timelimt.cpp11
-rw-r--r--src/mame/drivers/tnzs.cpp6
-rw-r--r--src/mame/drivers/toaplan2.cpp44
-rw-r--r--src/mame/drivers/tsamurai.cpp6
-rw-r--r--src/mame/drivers/vball.cpp8
-rw-r--r--src/mame/drivers/wc90.cpp6
-rw-r--r--src/mame/drivers/wc90b.cpp13
-rw-r--r--src/mame/drivers/welltris.cpp16
-rw-r--r--src/mame/drivers/wwfsstar.cpp8
-rw-r--r--src/mame/drivers/wyvernf0.cpp13
-rw-r--r--src/mame/drivers/xain.cpp6
-rw-r--r--src/mame/drivers/yunsun16.cpp8
-rw-r--r--src/mame/drivers/yunsung8.cpp12
-rw-r--r--src/mame/includes/40love.h6
-rw-r--r--src/mame/includes/aerofgt.h26
-rw-r--r--src/mame/includes/amspdwy.h5
-rw-r--r--src/mame/includes/ashnojoe.h16
-rw-r--r--src/mame/includes/aztarac.h3
-rw-r--r--src/mame/includes/bking.h6
-rw-r--r--src/mame/includes/blockout.h7
-rw-r--r--src/mame/includes/bublbobl.h6
-rw-r--r--src/mame/includes/buggychl.h6
-rw-r--r--src/mame/includes/cave.h8
-rw-r--r--src/mame/includes/crshrace.h18
-rw-r--r--src/mame/includes/dcheese.h11
-rw-r--r--src/mame/includes/ddragon.h6
-rw-r--r--src/mame/includes/ddragon3.h8
-rw-r--r--src/mame/includes/esd16.h5
-rw-r--r--src/mame/includes/f1gp.h17
-rw-r--r--src/mame/includes/flstory.h6
-rw-r--r--src/mame/includes/fromanc2.h9
-rw-r--r--src/mame/includes/gaiden.h21
-rw-r--r--src/mame/includes/gladiatr.h4
-rw-r--r--src/mame/includes/grchamp.h3
-rw-r--r--src/mame/includes/gstriker.h4
-rw-r--r--src/mame/includes/gsword.h4
-rw-r--r--src/mame/includes/himesiki.h16
-rw-r--r--src/mame/includes/homedata.h10
-rw-r--r--src/mame/includes/inufuku.h19
-rw-r--r--src/mame/includes/ksayakyu.h7
-rw-r--r--src/mame/includes/ladyfrog.h16
-rw-r--r--src/mame/includes/lkage.h6
-rw-r--r--src/mame/includes/matmania.h6
-rw-r--r--src/mame/includes/mcatadv.h5
-rw-r--r--src/mame/includes/msisaac.h7
-rw-r--r--src/mame/includes/nycaptor.h6
-rw-r--r--src/mame/includes/pbaction.h4
-rw-r--r--src/mame/includes/renegade.h4
-rw-r--r--src/mame/includes/retofinv.h5
-rw-r--r--src/mame/includes/sauro.h3
-rw-r--r--src/mame/includes/shadfrce.h4
-rw-r--r--src/mame/includes/snowbros.h5
-rw-r--r--src/mame/includes/solomon.h7
-rw-r--r--src/mame/includes/spbactn.h3
-rw-r--r--src/mame/includes/spdodgeb.h3
-rw-r--r--src/mame/includes/speedspn.h4
-rw-r--r--src/mame/includes/ssozumo.h5
-rw-r--r--src/mame/includes/suprslam.h18
-rw-r--r--src/mame/includes/tagteam.h5
-rw-r--r--src/mame/includes/tail2nos.h5
-rw-r--r--src/mame/includes/taitosj.h6
-rw-r--r--src/mame/includes/taotaido.h5
-rw-r--r--src/mame/includes/tatsumi.h4
-rw-r--r--src/mame/includes/tbowl.h4
-rw-r--r--src/mame/includes/tecmo.h4
-rw-r--r--src/mame/includes/tecmo16.h4
-rw-r--r--src/mame/includes/tecmosys.h6
-rw-r--r--src/mame/includes/tehkanwc.h6
-rw-r--r--src/mame/includes/thedeep.h10
-rw-r--r--src/mame/includes/timelimt.h1
-rw-r--r--src/mame/includes/tnzs.h4
-rw-r--r--src/mame/includes/toaplan2.h8
-rw-r--r--src/mame/includes/tsamurai.h5
-rw-r--r--src/mame/includes/vball.h5
-rw-r--r--src/mame/includes/wc90.h4
-rw-r--r--src/mame/includes/wc90b.h4
-rw-r--r--src/mame/includes/welltris.h4
-rw-r--r--src/mame/includes/wwfsstar.h5
-rw-r--r--src/mame/includes/xain.h5
-rw-r--r--src/mame/includes/yunsun16.h5
-rw-r--r--src/mame/includes/yunsung8.h1
-rw-r--r--src/mame/machine/bublbobl.cpp4
173 files changed, 1150 insertions, 490 deletions
diff --git a/src/mame/audio/aztarac.cpp b/src/mame/audio/aztarac.cpp
index f30484842c5..74a1b32bcdc 100644
--- a/src/mame/audio/aztarac.cpp
+++ b/src/mame/audio/aztarac.cpp
@@ -21,7 +21,7 @@ WRITE16_MEMBER(aztarac_state::sound_w)
if (ACCESSING_BITS_0_7)
{
data &= 0xff;
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_sound_status ^= 0x21;
if (m_sound_status & 0x20)
m_audiocpu->set_input_line(0, HOLD_LINE);
@@ -32,7 +32,7 @@ READ8_MEMBER(aztarac_state::snd_command_r)
{
m_sound_status |= 0x01;
m_sound_status &= ~0x20;
- return soundlatch_byte_r(space,offset);
+ return m_soundlatch->read(space,offset);
}
READ8_MEMBER(aztarac_state::snd_status_r)
diff --git a/src/mame/drivers/40love.cpp b/src/mame/drivers/40love.cpp
index fe81b18233a..d209e7c3c44 100644
--- a/src/mame/drivers/40love.cpp
+++ b/src/mame/drivers/40love.cpp
@@ -201,7 +201,7 @@ M4300049A (relabeled J1100004A/K1100010A)
1x m5m5517
z80c
-a17_14 protection processor. 28 Pin Motorolla 15-00011-01 DA68235 (Labeled 8909)
+a17_14 protection processor. 28 Pin Motorola 15-00011-01 DA68235 (Labeled 8909)
Next to MB14241
Rom Daughterboard
@@ -245,7 +245,7 @@ void fortyl_state::device_timer(emu_timer &timer, device_timer_id id, int param,
WRITE8_MEMBER(fortyl_state::sound_command_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
synchronize(TIMER_NMI_CALLBACK, data);
}
@@ -747,7 +747,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, fortyl_state )
AM_RANGE(0xca00, 0xca0d) AM_DEVWRITE("msm", msm5232_device, write)
AM_RANGE(0xcc00, 0xcc00) AM_WRITE(sound_control_0_w)
AM_RANGE(0xce00, 0xce00) AM_WRITE(sound_control_1_w)
- AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r) AM_WRITE(to_main_w)
+ AM_RANGE(0xd800, 0xd800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(to_main_w)
AM_RANGE(0xda00, 0xda00) AM_READNOP AM_WRITE(nmi_enable_w) /* unknown read */
AM_RANGE(0xdc00, 0xdc00) AM_WRITE(nmi_disable_w)
AM_RANGE(0xde00, 0xde00) AM_READNOP AM_DEVWRITE("dac", dac_device, write_signed8) /* signed 8-bit DAC - unknown read */
@@ -1069,6 +1069,8 @@ static MACHINE_CONFIG_START( 40love, fortyl_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, 2000000)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(fortyl_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(fortyl_state, sound_control_3_w))
@@ -1126,6 +1128,8 @@ static MACHINE_CONFIG_START( undoukai, fortyl_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, 2000000)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(fortyl_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(fortyl_state, sound_control_3_w))
diff --git a/src/mame/drivers/aerofgt.cpp b/src/mame/drivers/aerofgt.cpp
index d61597ad1ec..540a6524a2a 100644
--- a/src/mame/drivers/aerofgt.cpp
+++ b/src/mame/drivers/aerofgt.cpp
@@ -65,7 +65,6 @@ Verification still needed for the other PCBs.
#include "cpu/z80/z80.h"
#include "sound/2610intf.h"
#include "sound/3812intf.h"
-#include "sound/okim6295.h"
#include "includes/aerofgt.h"
WRITE16_MEMBER(aerofgt_state::sound_command_w)
@@ -73,7 +72,7 @@ WRITE16_MEMBER(aerofgt_state::sound_command_w)
if (ACCESSING_BITS_0_7)
{
m_pending_command = 1;
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -83,7 +82,7 @@ WRITE16_MEMBER(aerofgt_state::turbofrc_sound_command_w)
if (ACCESSING_BITS_8_15)
{
m_pending_command = 1;
- soundlatch_byte_w(space, offset, (data >> 8) & 0xff);
+ m_soundlatch->write(space, offset, (data >> 8) & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -92,7 +91,7 @@ WRITE16_MEMBER(aerofgt_state::aerfboot_soundlatch_w)
{
if(ACCESSING_BITS_8_15)
{
- soundlatch_byte_w(space, 0, (data >> 8) & 0xff);
+ m_soundlatch->write(space, 0, (data >> 8) & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -385,7 +384,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( turbofrc_sound_portmap, AS_IO, 8, aerofgt_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(aerofgt_sh_bankswitch_w)
- AM_RANGE(0x14, 0x14) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
+ AM_RANGE(0x14, 0x14) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(pending_command_clear_w)
AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
ADDRESS_MAP_END
@@ -394,7 +393,7 @@ static ADDRESS_MAP_START( aerofgt_sound_portmap, AS_IO, 8, aerofgt_state )
AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
AM_RANGE(0x04, 0x04) AM_WRITE(aerofgt_sh_bankswitch_w)
AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w)
- AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x0c, 0x0c) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( aerfboot_sound_map, AS_PROGRAM, 8, aerofgt_state )
@@ -402,7 +401,7 @@ static ADDRESS_MAP_START( aerfboot_sound_map, AS_PROGRAM, 8, aerofgt_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_WRITE(aerfboot_okim6295_banking_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
static ADDRESS_MAP_START( wbbc97_sound_map, AS_PROGRAM, 8, aerofgt_state )
@@ -411,7 +410,7 @@ static ADDRESS_MAP_START( wbbc97_sound_map, AS_PROGRAM, 8, aerofgt_state )
AM_RANGE(0xf800, 0xf800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
AM_RANGE(0xf810, 0xf811) AM_DEVWRITE("ymsnd", ym3812_device, write)
AM_RANGE(0xfc00, 0xfc00) AM_NOP
- AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xfc20, 0xfc20) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( karatblzbl_sound_map, AS_PROGRAM, 8, aerofgt_state )
@@ -1349,6 +1348,8 @@ static MACHINE_CONFIG_START( pspikes, aerofgt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
@@ -1505,6 +1506,8 @@ static MACHINE_CONFIG_START( karatblz, aerofgt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz ) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
@@ -1550,8 +1553,11 @@ static MACHINE_CONFIG_START( karatblzbl, aerofgt_state )
MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode")
MCFG_VIDEO_START_OVERRIDE(aerofgt_state,karatblz)
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
/* sound hardware */
+
//MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") // breaks savestate
// NEC D7759c + YM????
@@ -1601,6 +1607,8 @@ static MACHINE_CONFIG_START( spinlbrk, aerofgt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
@@ -1652,6 +1660,8 @@ static MACHINE_CONFIG_START( turbofrc, aerofgt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
@@ -1704,6 +1714,8 @@ static MACHINE_CONFIG_START( aerofgtb, aerofgt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
@@ -1751,6 +1763,8 @@ static MACHINE_CONFIG_START( aerofgt, aerofgt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
@@ -1791,6 +1805,8 @@ static MACHINE_CONFIG_START( aerfboot, aerofgt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_OKIM6295_ADD("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -1864,6 +1880,8 @@ static MACHINE_CONFIG_START( wbbc97, aerofgt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, 3579545)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/amspdwy.cpp b/src/mame/drivers/amspdwy.cpp
index 9a846b1dc95..5609c40ad8a 100644
--- a/src/mame/drivers/amspdwy.cpp
+++ b/src/mame/drivers/amspdwy.cpp
@@ -71,7 +71,7 @@ READ8_MEMBER(amspdwy_state::amspdwy_sound_r)
WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -109,7 +109,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( amspdwy_sound_map, AS_PROGRAM, 8, amspdwy_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
// AM_RANGE(0x8000, 0x8000) AM_WRITENOP // ? writes 0 at start
- AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x9000, 0x9000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xc000, 0xdfff) AM_RAM
AM_RANGE(0xffff, 0xffff) AM_READNOP // ??? IY = FFFF at the start ?
@@ -277,6 +277,8 @@ static MACHINE_CONFIG_START( amspdwy, amspdwy_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", 3000000)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/ashnojoe.cpp b/src/mame/drivers/ashnojoe.cpp
index 18b4496d6fb..99608fd446c 100644
--- a/src/mame/drivers/ashnojoe.cpp
+++ b/src/mame/drivers/ashnojoe.cpp
@@ -69,7 +69,7 @@ Dips:
Easy (A) -> Difficult (D)
-Game is controled with 4-direction lever and two buttons
+Game is controlled with 4-direction lever and two buttons
Coin B is not used
*************************************************************************/
@@ -78,7 +78,6 @@ Coin B is not used
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "sound/2203intf.h"
-#include "sound/msm5205.h"
#include "includes/ashnojoe.h"
READ16_MEMBER(ashnojoe_state::fake_4a00a_r)
@@ -93,7 +92,7 @@ WRITE16_MEMBER(ashnojoe_state::ashnojoe_soundlatch_w)
if (ACCESSING_BITS_0_7)
{
m_soundlatch_status = 1;
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
}
}
@@ -128,7 +127,7 @@ WRITE8_MEMBER(ashnojoe_state::adpcm_w)
READ8_MEMBER(ashnojoe_state::sound_latch_r)
{
m_soundlatch_status = 0;
- return soundlatch_byte_r(space, 0);
+ return m_soundlatch->read(space, 0);
}
READ8_MEMBER(ashnojoe_state::sound_latch_status_r)
@@ -349,6 +348,8 @@ static MACHINE_CONFIG_START( ashnojoe, ashnojoe_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, 4000000)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(ashnojoe_state, ym2203_irq_handler))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(ashnojoe_state, ym2203_write_a))
diff --git a/src/mame/drivers/aztarac.cpp b/src/mame/drivers/aztarac.cpp
index ba879e5f052..dcdda3ae0cf 100644
--- a/src/mame/drivers/aztarac.cpp
+++ b/src/mame/drivers/aztarac.cpp
@@ -173,6 +173,8 @@ static MACHINE_CONFIG_START( aztarac, aztarac_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.15)
diff --git a/src/mame/drivers/bking.cpp b/src/mame/drivers/bking.cpp
index e6085af308e..b85088542c8 100644
--- a/src/mame/drivers/bking.cpp
+++ b/src/mame/drivers/bking.cpp
@@ -45,7 +45,7 @@ WRITE8_MEMBER(bking_state::bking_soundlatch_w)
if (data & (1 << i))
code |= 0x80 >> i;
- soundlatch_byte_w(space, offset, code);
+ m_soundlatch->write(space, offset, code);
if (m_sound_nmi_enable)
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -134,7 +134,7 @@ static ADDRESS_MAP_START( bking_audio_map, AS_PROGRAM, 8, bking_state )
AM_RANGE(0x4401, 0x4401) AM_DEVREAD("ay1", ay8910_device, data_r)
AM_RANGE(0x4402, 0x4403) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
AM_RANGE(0x4403, 0x4403) AM_DEVREAD("ay2", ay8910_device, data_r)
- AM_RANGE(0x4800, 0x4800) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x4800, 0x4800) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x4802, 0x4802) AM_READWRITE(bking_sndnmi_disable_r, bking_sndnmi_enable_w)
AM_RANGE(0xe000, 0xefff) AM_ROM /* Space for diagnostic ROM */
ADDRESS_MAP_END
@@ -483,6 +483,8 @@ static MACHINE_CONFIG_START( bking, bking_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, XTAL_6MHz/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/blockout.cpp b/src/mame/drivers/blockout.cpp
index 2aef99913e0..bb8b9d370d6 100644
--- a/src/mame/drivers/blockout.cpp
+++ b/src/mame/drivers/blockout.cpp
@@ -80,7 +80,7 @@ WRITE16_MEMBER(blockout_state::blockout_sound_command_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -146,7 +146,7 @@ static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, blockout_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
@@ -318,6 +318,8 @@ static MACHINE_CONFIG_START( blockout, blockout_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", AUDIO_CLOCK)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(blockout_state,irq_handler))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
diff --git a/src/mame/drivers/bublbobl.cpp b/src/mame/drivers/bublbobl.cpp
index 0f5f57528e6..8d076220974 100644
--- a/src/mame/drivers/bublbobl.cpp
+++ b/src/mame/drivers/bublbobl.cpp
@@ -316,7 +316,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, bublbobl_state )
AM_RANGE(0x8000, 0x8fff) AM_RAM
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ym1", ym2203_device, read, write)
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ym2", ym3526_device, read, write)
- AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r) AM_WRITE(bublbobl_sound_status_w)
+ AM_RANGE(0xb000, 0xb000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(bublbobl_sound_status_w)
AM_RANGE(0xb001, 0xb001) AM_WRITE(bublbobl_sh_nmi_enable_w) AM_READNOP
AM_RANGE(0xb002, 0xb002) AM_WRITE(bublbobl_sh_nmi_disable_w)
AM_RANGE(0xe000, 0xffff) AM_ROM // space for diagnostic ROM?
@@ -400,7 +400,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( tokio_sound_map, AS_PROGRAM, 8, bublbobl_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x8fff) AM_RAM
- AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_byte_r) AM_WRITE(bublbobl_sound_status_w)
+ AM_RANGE(0x9000, 0x9000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(bublbobl_sound_status_w)
AM_RANGE(0x9800, 0x9800) AM_READNOP // ???
AM_RANGE(0xa000, 0xa000) AM_WRITE(bublbobl_sh_nmi_disable_w)
AM_RANGE(0xa800, 0xa800) AM_WRITE(bublbobl_sh_nmi_enable_w)
@@ -802,6 +802,8 @@ static MACHINE_CONFIG_START( tokio, bublbobl_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, MAIN_XTAL/8)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(bublbobl_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.08)
@@ -886,6 +888,8 @@ static MACHINE_CONFIG_START( bublbobl, bublbobl_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, MAIN_XTAL/8)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(bublbobl_state, irqhandler))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/buggychl.cpp b/src/mame/drivers/buggychl.cpp
index 3563b156be8..ebd6a873176 100644
--- a/src/mame/drivers/buggychl.cpp
+++ b/src/mame/drivers/buggychl.cpp
@@ -102,7 +102,7 @@ TIMER_CALLBACK_MEMBER(buggychl_state::nmi_callback)
WRITE8_MEMBER(buggychl_state::sound_command_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(buggychl_state::nmi_callback),this), data);
}
@@ -168,7 +168,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0x4810, 0x481d) AM_DEVWRITE("msm", msm5232_device, write)
AM_RANGE(0x4820, 0x4820) AM_RAM /* VOL/BAL for the 7630 on the MSM5232 output */
AM_RANGE(0x4830, 0x4830) AM_RAM /* TRBL/BASS for the 7630 on the MSM5232 output */
- AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x5000, 0x5000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
// AM_RANGE(0x5001, 0x5001) AM_READNOP /* is command pending? */
AM_RANGE(0x5001, 0x5001) AM_WRITE(nmi_enable_w)
AM_RANGE(0x5002, 0x5002) AM_WRITE(nmi_disable_w)
@@ -394,6 +394,8 @@ static MACHINE_CONFIG_START( buggychl, buggychl_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(buggychl_state, port_a_0_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(buggychl_state, port_b_0_w))
diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp
index 05d37048af7..5ed7017237a 100644
--- a/src/mame/drivers/cave.cpp
+++ b/src/mame/drivers/cave.cpp
@@ -76,14 +76,12 @@ Versions known to exist but not dumped:
#include "emu.h"
#include "cpu/m68000/m68000.h"
-#include "machine/eepromser.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
#include "cpu/z80/z80.h"
#include "includes/cave.h"
#include "sound/2203intf.h"
#include "sound/2151intf.h"
-#include "sound/okim6295.h"
#include "sound/ymz280b.h"
#include "ppsatan.lh"
@@ -235,7 +233,7 @@ WRITE16_MEMBER(cave_state::sound_cmd_w)
{
// m_sound_flag1 = 1;
// m_sound_flag2 = 1;
- soundlatch_word_w(space, offset, data, mem_mask);
+ m_soundlatch->write(space, offset, data, mem_mask);
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
}
@@ -244,14 +242,14 @@ WRITE16_MEMBER(cave_state::sound_cmd_w)
READ8_MEMBER(cave_state::soundlatch_lo_r)
{
// m_sound_flag1 = 0;
- return soundlatch_word_r(space, offset, 0x00ff) & 0xff;
+ return m_soundlatch->read(space, offset, 0x00ff) & 0xff;
}
/* Sound CPU: read the high 8 bits of the 16 bit sound latch */
READ8_MEMBER(cave_state::soundlatch_hi_r)
{
// m_sound_flag2 = 0;
- return soundlatch_word_r(space, offset, 0xff00) >> 8;
+ return m_soundlatch->read(space, offset, 0xff00) >> 8;
}
/* Main CPU: read the latch written by the sound CPU (acknowledge) */
@@ -2249,6 +2247,8 @@ static MACHINE_CONFIG_START( hotdogst, cave_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_32MHz/8)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(cave_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.20)
@@ -2350,6 +2350,8 @@ static MACHINE_CONFIG_START( mazinger, cave_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_4MHz)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(cave_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.20)
@@ -2404,6 +2406,8 @@ static MACHINE_CONFIG_START( metmqstr, cave_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_16MHz / 4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6)
@@ -2576,6 +2580,8 @@ static MACHINE_CONFIG_START( pwrinst2, cave_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_16MHz / 4)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(cave_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.40)
@@ -2634,6 +2640,9 @@ static MACHINE_CONFIG_START( sailormn, cave_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_16MHz/4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
diff --git a/src/mame/drivers/chinagat.cpp b/src/mame/drivers/chinagat.cpp
index 946d5020f38..7d6944b04b7 100644
--- a/src/mame/drivers/chinagat.cpp
+++ b/src/mame/drivers/chinagat.cpp
@@ -41,7 +41,7 @@ ADPCM in the bootlegs is not quite right.... Misusing the data?
the microcode dump's the same). This in conjunction with the different
ADPCM chip (msm5205) are used to 'fake' a M6295.
- Bootleg 1 ADPCM is now wired up, but still not working :-(
- Definantly sync problems between the i8049 and the m5205 which need
+ Definitely sync problems between the i8049 and the m5205 which need
further looking at.
@@ -79,7 +79,6 @@ Dip locations and factory settings verified with China Gate US manual.
#include "sound/2151intf.h"
#include "sound/2203intf.h"
#include "sound/okim6295.h"
-#include "sound/msm5205.h"
#include "includes/ddragon.h"
#define MAIN_CLOCK XTAL_12MHz
@@ -166,7 +165,7 @@ WRITE8_MEMBER(chinagat_state::chinagat_interrupt_w )
switch (offset)
{
case 0: /* 3e00 - SND irq */
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_soundcpu->set_input_line(m_sound_irq, (m_sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE );
break;
@@ -356,7 +355,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, chinagat_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
static ADDRESS_MAP_START( ym2203c_sound_map, AS_PROGRAM, 8, chinagat_state )
@@ -374,7 +373,7 @@ static ADDRESS_MAP_START( ym2203c_sound_map, AS_PROGRAM, 8, chinagat_state )
// 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
static ADDRESS_MAP_START( saiyugoub1_sound_map, AS_PROGRAM, 8, chinagat_state )
@@ -382,7 +381,7 @@ static ADDRESS_MAP_START( saiyugoub1_sound_map, AS_PROGRAM, 8, chinagat_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x9800, 0x9800) AM_WRITE(saiyugoub1_mcu_command_w)
- AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xA000, 0xA000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( i8748_map, AS_PROGRAM, 8, chinagat_state )
@@ -583,6 +582,8 @@ static MACHINE_CONFIG_START( chinagat, chinagat_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", 3579545)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.80)
@@ -629,6 +630,8 @@ static MACHINE_CONFIG_START( saiyugoub1, chinagat_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", 3579545)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.80)
@@ -673,6 +676,8 @@ static MACHINE_CONFIG_START( saiyugoub2, chinagat_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, 3579545)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(chinagat_state, chinagat_irq_handler))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
diff --git a/src/mame/drivers/corona.cpp b/src/mame/drivers/corona.cpp
index b4037863bf3..d30c13251b0 100644
--- a/src/mame/drivers/corona.cpp
+++ b/src/mame/drivers/corona.cpp
@@ -312,6 +312,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
+#include "machine/gen_latch.h"
#include "machine/nvram.h"
#include "re800.lh"
#include "luckyrlt.lh"
@@ -324,7 +325,8 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch") { }
UINT8 m_blitter_x_reg;
UINT8 m_blitter_y_reg;
@@ -354,6 +356,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
required_device<screen_device> m_screen;
+ required_device<generic_latch_8_device> m_soundlatch;
};
@@ -494,14 +497,14 @@ UINT32 corona_state::screen_update_luckyrlt(screen_device &screen, bitmap_ind16
WRITE8_MEMBER(corona_state::sound_latch_w)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_soundcpu->set_input_line(0, ASSERT_LINE);
}
READ8_MEMBER(corona_state::sound_latch_r)
{
m_soundcpu->set_input_line(0, CLEAR_LINE);
- return soundlatch_byte_r(space, 0);
+ return m_soundlatch->read(space, 0);
}
@@ -1364,6 +1367,9 @@ static MACHINE_CONFIG_START( winner81, corona_state )
MCFG_PALETTE_INIT_OWNER(corona_state, corona)
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8912, AY_CLK1) /* measured */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1395,6 +1401,9 @@ static MACHINE_CONFIG_START( winner82, corona_state )
MCFG_PALETTE_INIT_OWNER(corona_state, corona)
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, AY_CLK2) /* measured */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1427,6 +1436,9 @@ static MACHINE_CONFIG_START( re800, corona_state )
MCFG_PALETTE_INIT_OWNER(corona_state, corona)
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8912, AY_CLK2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1458,6 +1470,9 @@ static MACHINE_CONFIG_START( rcirulet, corona_state )
MCFG_PALETTE_INIT_OWNER(corona_state, corona)
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8912, AY_CLK2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1490,6 +1505,9 @@ static MACHINE_CONFIG_START( luckyrlt, corona_state )
MCFG_PALETTE_INIT_OWNER(corona_state, corona)
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8912, AY_CLK1)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/crshrace.cpp b/src/mame/drivers/crshrace.cpp
index 7b562e5e570..09e1dc672dd 100644
--- a/src/mame/drivers/crshrace.cpp
+++ b/src/mame/drivers/crshrace.cpp
@@ -15,7 +15,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
0) all games
- - There seems to be preliminary support for 3 simulataneous players, but the
+ - There seems to be preliminary support for 3 simultaneous players, but the
game resets before the race starts if the 3 players don't play against each
other ! I can't tell however if it's an ingame or an emulation bug.
To test this, change CRSHRACE_3P_HACK to 1, set the "Reset on P.O.S.T. Error"
@@ -148,7 +148,7 @@ WRITE16_MEMBER(crshrace_state::sound_command_w)
if (ACCESSING_BITS_0_7)
{
m_pending_command = 1;
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -196,7 +196,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, crshrace_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(crshrace_sh_bankswitch_w)
- AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
+ AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(pending_command_clear_w)
AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
ADDRESS_MAP_END
@@ -466,6 +466,8 @@ static MACHINE_CONFIG_START( crshrace, crshrace_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(crshrace_state, irqhandler))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
diff --git a/src/mame/drivers/cybertnk.cpp b/src/mame/drivers/cybertnk.cpp
index f38b11a5096..d09f908df49 100644
--- a/src/mame/drivers/cybertnk.cpp
+++ b/src/mame/drivers/cybertnk.cpp
@@ -6,7 +6,7 @@ Cyber Tank HW (c) 1987/1988 Coreland Technology
preliminary driver by Angelo Salese & David Haywood
-Maybe it has some correlation with WEC Le Mans HW? (supposely that was originally done by Coreland too)
+Maybe it has some correlation with WEC Le Mans HW? (supposedly that was originally done by Coreland too)
TODO:
- improve sprite zooming
@@ -172,6 +172,7 @@ lev 7 : 0x7c : 0000 07e0 - input device clear?
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/gen_latch.h"
#include "sound/8950intf.h"
#include "rendlay.h"
@@ -185,6 +186,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_spr_ram(*this, "spr_ram"),
m_tilemap0_vram(*this, "tilemap0_vram"),
m_tilemap1_vram(*this, "tilemap1_vram"),
@@ -198,6 +200,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;
required_shared_ptr<UINT16> m_spr_ram;
required_shared_ptr<UINT16> m_tilemap0_vram;
@@ -536,7 +539,7 @@ WRITE8_MEMBER( cybertnk_state::cybertnk_sound_cmd_w )
}
else if (offset == 1)
{
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
}
@@ -637,7 +640,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_mem, AS_PROGRAM, 8, cybertnk_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x9fff) AM_RAM
- AM_RANGE(0xa001, 0xa001) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xa001, 0xa001) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xa005, 0xa006) AM_NOP
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ym1", y8950_device, read, write)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ym2", y8950_device, read, write)
@@ -866,6 +869,8 @@ static MACHINE_CONFIG_START( cybertnk, cybertnk_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", Y8950, XTAL_3_579545MHz)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
diff --git a/src/mame/drivers/cyclemb.cpp b/src/mame/drivers/cyclemb.cpp
index 0de60e76cac..1772a3caa57 100644
--- a/src/mame/drivers/cyclemb.cpp
+++ b/src/mame/drivers/cyclemb.cpp
@@ -73,6 +73,7 @@ Dumped by Chack'n
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/2203intf.h"
#include "machine/tait8741.h"
@@ -86,6 +87,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_vram(*this, "vram"),
m_cram(*this, "cram"),
m_obj1_ram(*this, "obj1_ram"),
@@ -97,6 +99,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;
required_shared_ptr<UINT8> m_vram;
required_shared_ptr<UINT8> m_cram;
@@ -382,7 +385,7 @@ WRITE8_MEMBER(cyclemb_state::cyclemb_bankswitch_w)
#if 0
WRITE8_MEMBER(cyclemb_state::sound_cmd_w)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
#endif
@@ -396,7 +399,7 @@ READ8_MEMBER(cyclemb_state::mcu_status_r)
WRITE8_MEMBER(cyclemb_state::sound_cmd_w)//actually ciom
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
#endif
@@ -589,7 +592,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( cyclemb_sound_io, AS_IO, 8, cyclemb_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
- AM_RANGE(0x40, 0x40) AM_READ(soundlatch_byte_r) AM_WRITE(soundlatch2_byte_w)
+ AM_RANGE(0x40, 0x40) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
ADDRESS_MAP_END
@@ -938,6 +941,10 @@ static MACHINE_CONFIG_START( cyclemb, cyclemb_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_18MHz/12)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/dcheese.cpp b/src/mame/drivers/dcheese.cpp
index 3ef3b044404..f970b280065 100644
--- a/src/mame/drivers/dcheese.cpp
+++ b/src/mame/drivers/dcheese.cpp
@@ -36,7 +36,6 @@
#include "machine/eepromser.h"
#include "machine/ticket.h"
#include "machine/watchdog.h"
-#include "sound/bsmt2000.h"
#include "includes/dcheese.h"
@@ -92,8 +91,6 @@ INTERRUPT_GEN_MEMBER(dcheese_state::dcheese_vblank)
void dcheese_state::machine_start()
{
- m_bsmt = machine().device("bsmt");
-
save_item(NAME(m_irq_state));
save_item(NAME(m_soundlatch_full));
save_item(NAME(m_sound_control));
@@ -133,7 +130,7 @@ WRITE16_MEMBER(dcheese_state::sound_command_w)
/* write the latch and set the IRQ */
m_soundlatch_full = 1;
m_audiocpu->set_input_line(0, ASSERT_LINE);
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
}
}
@@ -150,15 +147,14 @@ READ8_MEMBER(dcheese_state::sound_command_r)
/* read the latch and clear the IRQ */
m_soundlatch_full = 0;
m_audiocpu->set_input_line(0, CLEAR_LINE);
- return soundlatch_byte_r(space, 0);
+ return m_soundlatch->read(space, 0);
}
READ8_MEMBER(dcheese_state::sound_status_r)
{
/* seems to be ready signal on BSMT or latching hardware */
- bsmt2000_device *bsmt = machine().device<bsmt2000_device>("bsmt");
- return bsmt->read_status() << 7;
+ return m_bsmt->read_status() << 7;
}
@@ -178,16 +174,14 @@ WRITE8_MEMBER(dcheese_state::sound_control_w)
WRITE8_MEMBER(dcheese_state::bsmt_data_w)
{
- bsmt2000_device *bsmt = machine().device<bsmt2000_device>("bsmt");
-
/* writes come in pairs; even bytes latch, odd bytes write */
if (offset % 2 == 0)
{
- bsmt->write_reg(offset / 2);
+ m_bsmt->write_reg(offset / 2);
m_sound_msb_latch = data;
}
else
- bsmt->write_data((m_sound_msb_latch << 8) | data);
+ m_bsmt->write_data((m_sound_msb_latch << 8) | data);
}
@@ -426,6 +420,8 @@ static MACHINE_CONFIG_START( dcheese, dcheese_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_BSMT2000_ADD("bsmt", SOUND_OSC)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.2)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.2)
diff --git a/src/mame/drivers/ddragon.cpp b/src/mame/drivers/ddragon.cpp
index e139b685942..23916839c75 100644
--- a/src/mame/drivers/ddragon.cpp
+++ b/src/mame/drivers/ddragon.cpp
@@ -60,7 +60,6 @@ Dip locations verified with manual for ddragon & ddragon2
#include "cpu/z80/z80.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
-#include "sound/msm5205.h"
#include "includes/ddragon.h"
@@ -281,7 +280,7 @@ void ddragon_state::ddragon_interrupt_ack(address_space &space, offs_t offset, U
break;
case 3: /* 380e - SND IRQ and latch */
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_soundcpu->set_input_line(m_sound_irq, ASSERT_LINE);
break;
@@ -327,7 +326,7 @@ WRITE_LINE_MEMBER(ddragon_state::irq_handler)
READ8_MEMBER(ddragon_state::soundlatch_ack_r)
{
m_soundcpu->set_input_line(m_sound_irq, CLEAR_LINE);
- return soundlatch_byte_r(space, 0);
+ return m_soundlatch->read(space, 0);
}
@@ -977,6 +976,8 @@ static MACHINE_CONFIG_START( ddragon, ddragon_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("fmsnd", SOUND_CLOCK)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(ddragon_state, irq_handler))
MCFG_SOUND_ROUTE(0, "mono", 0.60)
@@ -1044,6 +1045,8 @@ static MACHINE_CONFIG_START( ddragon6809, ddragon_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("fmsnd", SOUND_CLOCK)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(ddragon_state,irq_handler))
MCFG_SOUND_ROUTE(0, "mono", 0.60)
@@ -1094,6 +1097,8 @@ static MACHINE_CONFIG_START( ddragon2, ddragon_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("fmsnd", SOUND_CLOCK)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(ddragon_state,irq_handler))
MCFG_SOUND_ROUTE(0, "mono", 0.60)
diff --git a/src/mame/drivers/ddragon3.cpp b/src/mame/drivers/ddragon3.cpp
index 6a29b3b9e62..4fe00e232b0 100644
--- a/src/mame/drivers/ddragon3.cpp
+++ b/src/mame/drivers/ddragon3.cpp
@@ -186,7 +186,6 @@ ROMs (All ROMs are 27C010 EPROM. - means not populated)
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "sound/2151intf.h"
-#include "sound/okim6295.h"
#include "includes/ddragon3.h"
@@ -203,7 +202,7 @@ WRITE8_MEMBER(ddragon3_state::oki_bankswitch_w)
WRITE16_MEMBER(wwfwfest_state::wwfwfest_soundwrite)
{
- soundlatch_byte_w(space,1,data & 0xff);
+ m_soundlatch->write(space,1,data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
}
@@ -218,8 +217,8 @@ WRITE16_MEMBER(ddragon3_state::ddragon3_io_w)
m_vreg = m_io_reg[0];
break;
- case 1: /* soundlatch_byte_w */
- soundlatch_byte_w(space, 1, m_io_reg[1] & 0xff);
+ case 1: /* soundlatch write */
+ m_soundlatch->write(space, 1, m_io_reg[1] & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
break;
@@ -379,7 +378,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ddragon3_state )
AM_RANGE(0xc000, 0xc7ff) AM_RAM
AM_RANGE(0xc800, 0xc801) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
AM_RANGE(0xd800, 0xd800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xe800, 0xe800) AM_WRITE(oki_bankswitch_w)
ADDRESS_MAP_END
@@ -389,7 +388,7 @@ static ADDRESS_MAP_START( ctribe_sound_map, AS_PROGRAM, 8, ddragon3_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ym2151", ym2151_device, status_r, 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
/*************************************
@@ -852,6 +851,8 @@ static MACHINE_CONFIG_START( ddragon3, ddragon3_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ym2151", XTAL_3_579545MHz)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
@@ -920,6 +921,8 @@ static MACHINE_CONFIG_START( wwfwfest, wwfwfest_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ym2151", XTAL_3_579545MHz)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.45)
diff --git a/src/mame/drivers/discoboy.cpp b/src/mame/drivers/discoboy.cpp
index f127c4554e2..f76665044c8 100644
--- a/src/mame/drivers/discoboy.cpp
+++ b/src/mame/drivers/discoboy.cpp
@@ -3,10 +3,10 @@
/*
Disco Boy
-Similar to mitchell.c / egghunt.c .. clearly derived from that hardware
+Similar to mitchell.cpp / egghunt.cpp .. clearly derived from that hardware
TODO:
-- move sound HW into proper file (it's 99% IDENTICAL to yunsung8.c)
+- move sound HW into proper file (it's 99% IDENTICAL to yunsung8.cpp)
- ADPCM has sound volume issues, it's either too loud or too quiet;
PCB Layout
@@ -43,6 +43,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
#include "sound/3812intf.h"
@@ -53,11 +54,12 @@ class discoboy_state : public driver_device
public:
discoboy_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_audiocpu(*this, "audiocpu") ,
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* video-related */
UINT8 m_ram_bank;
@@ -67,7 +69,12 @@ public:
UINT8 m_toggle;
/* devices */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<msm5205_device> m_msm;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
/* memory */
UINT8 m_ram_1[0x800];
@@ -96,10 +103,6 @@ public:
UINT32 screen_update_discoboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
DECLARE_WRITE_LINE_MEMBER(yunsung8_adpcm_int);
- required_device<cpu_device> m_maincpu;
- required_device<msm5205_device> m_msm;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
@@ -248,7 +251,7 @@ WRITE8_MEMBER(discoboy_state::discoboy_port_03_w)// sfx? (to sound cpu)
{
// printf("unk discoboy_port_03_w %02x\n", data);
// m_audiocpu->set_input_line(INPUT_LINE_NMI, HOLD_LINE);
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
@@ -360,7 +363,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, discoboy_state )
AM_RANGE(0xe400, 0xe400) AM_WRITE(yunsung8_adpcm_w)
AM_RANGE(0xec00, 0xec01) AM_DEVWRITE("ymsnd", ym3812_device, write)
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)
ADDRESS_MAP_END
@@ -514,6 +517,8 @@ static MACHINE_CONFIG_START( discoboy, discoboy_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_10MHz/4) /* 2.5 MHz? */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.6)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.6)
diff --git a/src/mame/drivers/dynadice.cpp b/src/mame/drivers/dynadice.cpp
index c2604827b94..66e73d06d2e 100644
--- a/src/mame/drivers/dynadice.cpp
+++ b/src/mame/drivers/dynadice.cpp
@@ -37,6 +37,7 @@ dy_6.bin (near Z80)
#include "cpu/z80/z80.h"
#include "cpu/i8085/i8085.h"
#include "sound/ay8910.h"
+#include "machine/gen_latch.h"
#include "machine/nvram.h"
@@ -116,7 +117,7 @@ static ADDRESS_MAP_START( dynadice_io_map, AS_IO, 8, dynadice_state )
AM_RANGE(0x51, 0x51) AM_READ_PORT("IN1")
AM_RANGE(0x52, 0x52) AM_READ_PORT("DSW")
AM_RANGE(0x62, 0x62) AM_WRITENOP
- AM_RANGE(0x63, 0x63) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0x63, 0x63) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0x70, 0x77) AM_WRITENOP
ADDRESS_MAP_END
@@ -127,8 +128,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( dynadice_sound_io_map, AS_IO, 8, dynadice_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r)
- AM_RANGE(0x01, 0x01) AM_WRITE(soundlatch_clear_byte_w)
+ AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0x02, 0x02) AM_WRITE(sound_data_w)
AM_RANGE(0x03, 0x03) AM_WRITE(sound_control_w)
ADDRESS_MAP_END
@@ -263,6 +264,8 @@ static MACHINE_CONFIG_START( dynadice, dynadice_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, 2000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/esd16.cpp b/src/mame/drivers/esd16.cpp
index 912e811ac4e..10ded704940 100644
--- a/src/mame/drivers/esd16.cpp
+++ b/src/mame/drivers/esd16.cpp
@@ -35,7 +35,7 @@ Other ESD games:
3 Cushion Billiards (c) 2000 - Undumped
Tang Tang (c) 2000 - Undumped ESD 05-28-99 version
-Fire Hawk (c) 2001 - see nmk16.c driver
+Fire Hawk (c) 2001 - see nmk16.cpp driver
Head Panic
- Nude / Bikini pics don't show in-game, even when set in test mode?
@@ -69,7 +69,6 @@ ToDo:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
-#include "machine/eepromser.h"
#include "sound/okim6295.h"
#include "sound/3812intf.h"
#include "includes/esd16.h"
@@ -87,7 +86,7 @@ WRITE16_MEMBER(esd16_state::esd16_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(0, ASSERT_LINE); // Generate an IRQ
space.device().execute().spin_until_time(attotime::from_usec(50)); // Allow the other CPU to reply
}
@@ -250,7 +249,7 @@ READ8_MEMBER(esd16_state::esd16_sound_command_r)
{
/* Clear IRQ only after reading the command, or some get lost */
m_audiocpu->set_input_line(0, CLEAR_LINE);
- return soundlatch_byte_r(space, 0);
+ return m_soundlatch->read(space, 0);
}
static ADDRESS_MAP_START( multchmp_sound_io_map, AS_IO, 8, esd16_state )
@@ -641,6 +640,8 @@ static MACHINE_CONFIG_START( esd16, esd16_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_16MHz/4) /* 4MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
@@ -736,7 +737,7 @@ ESD 11-09-98
(C) ESD 1998, 1999
PCB No. ESD 11-09-98
CPU: MC68HC000FN16 (68000, 68 pin PLCC socketed)
-SND: Z80 (Z0840006PSC), YM3812/YM3014 & OKI M6295 (rebaged as U6612/U6614 & AD-65)
+SND: Z80 (Z0840006PSC), YM3812/YM3014 & OKI M6295 (rebadged as U6612/U6614 & AD-65)
OSC: 16.000MHz, 14.000MHz
RAM: 4 x 62256, 9 x 6116
DIPS: 2 x 8 position
diff --git a/src/mame/drivers/f1gp.cpp b/src/mame/drivers/f1gp.cpp
index f60b0ca1633..a0e402e2df1 100644
--- a/src/mame/drivers/f1gp.cpp
+++ b/src/mame/drivers/f1gp.cpp
@@ -44,7 +44,7 @@ WRITE16_MEMBER(f1gp_state::sound_command_w)
if (ACCESSING_BITS_0_7)
{
m_pending_command = 1;
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -125,7 +125,7 @@ static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, f1gp_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(f1gp_sh_bankswitch_w) // f1gp
AM_RANGE(0x0c, 0x0c) AM_WRITE(f1gp_sh_bankswitch_w) // f1gp2
- AM_RANGE(0x14, 0x14) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
+ AM_RANGE(0x14, 0x14) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(pending_command_clear_w)
AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
ADDRESS_MAP_END
@@ -448,6 +448,8 @@ static MACHINE_CONFIG_START( f1gp, f1gp_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(f1gp_state, irqhandler))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp
index 237ac48c0f6..1afa2a7ac5e 100644
--- a/src/mame/drivers/flstory.cpp
+++ b/src/mame/drivers/flstory.cpp
@@ -45,7 +45,7 @@ TIMER_CALLBACK_MEMBER(flstory_state::nmi_callback)
WRITE8_MEMBER(flstory_state::sound_command_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(flstory_state::nmi_callback),this), data);
}
@@ -433,7 +433,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, flstory_state )
AM_RANGE(0xca00, 0xca0d) AM_DEVWRITE("msm", msm5232_device, write)
AM_RANGE(0xcc00, 0xcc00) AM_WRITE(sound_control_0_w)
AM_RANGE(0xce00, 0xce00) AM_WRITE(sound_control_1_w)
- AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r) AM_WRITE(to_main_w)
+ AM_RANGE(0xd800, 0xd800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(to_main_w)
AM_RANGE(0xda00, 0xda00) AM_READNOP AM_WRITE(nmi_enable_w) /* unknown read*/
AM_RANGE(0xdc00, 0xdc00) AM_WRITE(nmi_disable_w)
AM_RANGE(0xde00, 0xde00) AM_READNOP AM_DEVWRITE("dac", dac_device, write_unsigned8) /* signed 8-bit DAC & unknown read */
@@ -1078,6 +1078,8 @@ static MACHINE_CONFIG_START( flstory, flstory_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_8MHz/4) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(flstory_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(flstory_state, sound_control_3_w))
@@ -1138,6 +1140,8 @@ static MACHINE_CONFIG_START( onna34ro, flstory_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(flstory_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(flstory_state, sound_control_3_w))
@@ -1198,6 +1202,8 @@ static MACHINE_CONFIG_START( victnine, flstory_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(flstory_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(flstory_state, sound_control_3_w))
@@ -1264,6 +1270,8 @@ static MACHINE_CONFIG_START( rumba, flstory_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_8MHz/4) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(flstory_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(flstory_state, sound_control_3_w))
diff --git a/src/mame/drivers/fromanc2.cpp b/src/mame/drivers/fromanc2.cpp
index d098319d184..9d86ec601bd 100644
--- a/src/mame/drivers/fromanc2.cpp
+++ b/src/mame/drivers/fromanc2.cpp
@@ -21,7 +21,6 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
-#include "machine/eepromser.h"
#include "sound/2610intf.h"
#include "includes/fromanc2.h"
#include "rendlay.h"
@@ -41,8 +40,8 @@ INTERRUPT_GEN_MEMBER(fromanc2_state::fromanc2_interrupt)
WRITE16_MEMBER(fromanc2_state::fromanc2_sndcmd_w)
{
- soundlatch_byte_w(space, offset, (data >> 8) & 0xff); // 1P (LEFT)
- soundlatch2_byte_w(space, offset, data & 0xff); // 2P (RIGHT)
+ m_soundlatch->write(space, offset, (data >> 8) & 0xff); // 1P (LEFT)
+ m_soundlatch2->write(space, offset, data & 0xff); // 2P (RIGHT)
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
m_sndcpu_nmi_flag = 0;
@@ -283,8 +282,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( fromanc2_sound_io_map, AS_IO, 8, fromanc2_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) AM_WRITENOP // snd cmd (1P) / ?
- AM_RANGE(0x04, 0x04) AM_READ(soundlatch2_byte_r) // snd cmd (2P)
+ AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITENOP // snd cmd (1P) / ?
+ AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) // snd cmd (2P)
AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
AM_RANGE(0x0c, 0x0c) AM_READ(fromanc2_sndcpu_nmi_clr)
ADDRESS_MAP_END
@@ -561,6 +560,9 @@ static MACHINE_CONFIG_START( fromanc2, fromanc2_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(fromanc2_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
@@ -618,6 +620,9 @@ static MACHINE_CONFIG_START( fromancr, fromanc2_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(fromanc2_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
@@ -671,6 +676,9 @@ static MACHINE_CONFIG_START( fromanc4, fromanc2_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(fromanc2_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
diff --git a/src/mame/drivers/gaiden.cpp b/src/mame/drivers/gaiden.cpp
index ac47862d22a..48192b2c36f 100644
--- a/src/mame/drivers/gaiden.cpp
+++ b/src/mame/drivers/gaiden.cpp
@@ -142,9 +142,9 @@ Notes:
WRITE16_MEMBER(gaiden_state::gaiden_sound_command_w)
{
if (ACCESSING_BITS_0_7)
- soundlatch_byte_w(space, 0, data & 0xff); /* Ninja Gaiden */
+ m_soundlatch->write(space, 0, data & 0xff); /* Ninja Gaiden */
if (ACCESSING_BITS_8_15)
- soundlatch_byte_w(space, 0, data >> 8); /* Tecmo Knight */
+ m_soundlatch->write(space, 0, data >> 8); /* Tecmo Knight */
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -152,7 +152,7 @@ WRITE16_MEMBER(gaiden_state::drgnbowl_sound_command_w)
{
if (ACCESSING_BITS_8_15)
{
- soundlatch_byte_w(space, 0, data >> 8);
+ m_soundlatch->write(space, 0, data >> 8);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
}
@@ -434,7 +434,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gaiden_state )
AM_RANGE(0xf810, 0xf811) AM_DEVWRITE("ym1", ym2203_device, write)
AM_RANGE(0xf820, 0xf821) AM_DEVWRITE("ym2", ym2203_device, write)
AM_RANGE(0xfc00, 0xfc00) AM_NOP /* ?? */
- AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xfc20, 0xfc20) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( drgnbowl_sound_map, AS_PROGRAM, 8, gaiden_state )
@@ -446,7 +446,7 @@ static ADDRESS_MAP_START( drgnbowl_sound_port_map, AS_IO, 8, gaiden_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xc0, 0xc0) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static INPUT_PORTS_START( common )
@@ -788,6 +788,8 @@ static MACHINE_CONFIG_START( shadoww, gaiden_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, 4000000)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(gaiden_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.15)
@@ -848,6 +850,8 @@ static MACHINE_CONFIG_START( drgnbowl, gaiden_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", 4000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
@@ -907,7 +911,7 @@ static ADDRESS_MAP_START( mastninj_sound_map, AS_PROGRAM, 8, gaiden_state )
AM_RANGE(0xc400, 0xc401) AM_DEVWRITE("ym1", ym2203_device, write)
AM_RANGE(0xc800, 0xc801) AM_DEVWRITE("ym2", ym2203_device, write)
// AM_RANGE(0xfc00, 0xfc00) AM_NOP /* ?? */
-// AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r)
+// AM_RANGE(0xfc20, 0xfc20) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mastninj_map, AS_PROGRAM, 16, gaiden_state )
@@ -963,13 +967,15 @@ static MACHINE_CONFIG_START( mastninj, gaiden_state )
MCFG_PALETTE_ADD("palette", 4096)
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
- /* NOT using Tecmo Sprite device - signifcant changes, maybe a clone of something else */
+ /* NOT using Tecmo Sprite device - significant changes, maybe a clone of something else */
MCFG_VIDEO_START_OVERRIDE(gaiden_state,drgnbowl)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, 4000000) /* ?? MHz */
MCFG_YM2203_IRQ_HANDLER(WRITELINE(gaiden_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.15)
diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp
index e45015528fd..3cd76b73ef7 100644
--- a/src/mame/drivers/galaxian.cpp
+++ b/src/mame/drivers/galaxian.cpp
@@ -5905,9 +5905,13 @@ static MACHINE_CONFIG_DERIVED( explorer, galaxian_base )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( takeoff, explorer ) // takeoff shares the same main map as explorer, but uses only an AY8912 for sound.
-
+
+ MCFG_SOUND_MODIFY("maincpu")
+ MCFG_DEVICE_CLOCK(XTAL_12MHz / 8) // XTAL verified, divider not verified
+
/* 2nd CPU to drive sound */
MCFG_SOUND_MODIFY("audiocpu")
+ MCFG_DEVICE_CLOCK(XTAL_12MHz / 8)
MCFG_CPU_PROGRAM_MAP(takeoff_sound_map)
MCFG_CPU_IO_MAP(takeoff_sound_portmap)
@@ -5915,7 +5919,7 @@ static MACHINE_CONFIG_DERIVED( takeoff, explorer ) // takeoff shares the same ma
MCFG_DEVICE_REMOVE("8910.0")
MCFG_DEVICE_REMOVE("8910.1")
- MCFG_SOUND_ADD("8912", AY8912, KONAMI_SOUND_CLOCK/8)
+ MCFG_SOUND_ADD("8912", AY8912, XTAL_12MHz / 8)
MCFG_AY8910_PORT_A_READ_CB(READ8(galaxian_state, explorer_sound_latch_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gladiatr.cpp b/src/mame/drivers/gladiatr.cpp
index 029352ff5bb..2c82af4487a 100644
--- a/src/mame/drivers/gladiatr.cpp
+++ b/src/mame/drivers/gladiatr.cpp
@@ -279,14 +279,14 @@ WRITE8_MEMBER(gladiatr_state::gladiator_adpcm_w)
WRITE8_MEMBER(gladiatr_state::gladiator_cpu_sound_command_w)
{
- soundlatch_byte_w(space,0,data);
+ m_soundlatch->write(space,0,data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
READ8_MEMBER(gladiatr_state::gladiator_cpu_sound_command_r)
{
m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
- return soundlatch_byte_r(space,0);
+ return m_soundlatch->read(space,0);
}
WRITE8_MEMBER(gladiatr_state::gladiatr_flipscreen_w)
@@ -651,6 +651,8 @@ static MACHINE_CONFIG_START( ppking, gladiatr_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/8) /* verified on pcb */
MCFG_AY8910_PORT_A_READ_CB(READ8(gladiatr_state, ppking_f1_r))
MCFG_AY8910_PORT_B_READ_CB(READ8(gladiatr_state, ppking_f1_r))
@@ -706,6 +708,8 @@ static MACHINE_CONFIG_START( gladiatr, gladiatr_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/8) /* verified on pcb */
MCFG_YM2203_IRQ_HANDLER(WRITELINE(gladiatr_state, gladiator_ym_irq))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3")) /* port B read */
diff --git a/src/mame/drivers/gotcha.cpp b/src/mame/drivers/gotcha.cpp
index afb5540c576..d571a608f2d 100644
--- a/src/mame/drivers/gotcha.cpp
+++ b/src/mame/drivers/gotcha.cpp
@@ -14,7 +14,7 @@ TODO:
gfx related but since everything seems fine I've no idea what it might do.
- Unknown sound writes at C00F; also, there's an NMI handler that would
read from C00F.
-- Sound samples were getting chopped; I fixed this by changing sound/adpcm.c to
+- Sound samples were getting chopped; I fixed this by changing sound/adpcm.cpp to
disregard requests to play new samples until the previous one is finished*.
Gotcha pcb: 97,7,29 PARA VER 3.0 but it is the same as ppchamp
@@ -62,6 +62,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/gen_latch.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
#include "includes/gotcha.h"
@@ -97,7 +98,7 @@ WRITE16_MEMBER(gotcha_state::gotcha_oki_bank_w)
static ADDRESS_MAP_START( gotcha_map, AS_PROGRAM, 16, gotcha_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
- AM_RANGE(0x100000, 0x100001) AM_WRITE(soundlatch_word_w)
+ AM_RANGE(0x100000, 0x100001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x100002, 0x100003) AM_WRITE(gotcha_lamps_w)
AM_RANGE(0x100004, 0x100005) AM_WRITE(gotcha_oki_bank_w)
AM_RANGE(0x120000, 0x12ffff) AM_RAM
@@ -119,7 +120,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gotcha_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
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(0xd000, 0xd7ff) AM_RAM
ADDRESS_MAP_END
@@ -291,6 +292,8 @@ static MACHINE_CONFIG_START( gotcha, gotcha_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", 14318180/4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.80)
diff --git a/src/mame/drivers/grchamp.cpp b/src/mame/drivers/grchamp.cpp
index 15b52ed0bdb..6f03cd9ac1f 100644
--- a/src/mame/drivers/grchamp.cpp
+++ b/src/mame/drivers/grchamp.cpp
@@ -200,7 +200,7 @@ WRITE8_MEMBER(grchamp_state::cpu0_outputs_w)
case 0x0e: /* OUT14 */
/* O-21 connector */
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
break;
}
@@ -543,7 +543,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, grchamp_state )
AM_RANGE(0x4803, 0x4803) AM_MIRROR(0x07f8) AM_DEVREAD("ay2", ay8910_device, data_r)
AM_RANGE(0x4804, 0x4805) AM_MIRROR(0x07fa) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
AM_RANGE(0x4805, 0x4805) AM_MIRROR(0x07fa) AM_DEVREAD("ay3", ay8910_device, data_r)
- AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x5000, 0x5000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -680,6 +680,8 @@ static MACHINE_CONFIG_START( grchamp, grchamp_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, SOUND_CLOCK/4) /* 3B */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, portA_0_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(grchamp_state, portB_0_w))
diff --git a/src/mame/drivers/gstriker.cpp b/src/mame/drivers/gstriker.cpp
index ca2ad772f7f..a56b4ae3cd3 100644
--- a/src/mame/drivers/gstriker.cpp
+++ b/src/mame/drivers/gstriker.cpp
@@ -202,7 +202,7 @@ WRITE16_MEMBER(gstriker_state::sound_command_w)
if (ACCESSING_BITS_0_7)
{
m_pending_command = 1;
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -299,7 +299,7 @@ static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, gstriker_state )
AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
AM_RANGE(0x04, 0x04) AM_WRITE(sh_bankswitch_w)
AM_RANGE(0x08, 0x08) AM_WRITE(sh_pending_command_clear_w)
- AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x0c, 0x0c) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -549,6 +549,8 @@ static MACHINE_CONFIG_START( gstriker, gstriker_state )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
diff --git a/src/mame/drivers/gsword.cpp b/src/mame/drivers/gsword.cpp
index b7a694cb30e..8d05a02050f 100644
--- a/src/mame/drivers/gsword.cpp
+++ b/src/mame/drivers/gsword.cpp
@@ -146,7 +146,6 @@ reg: 0->1 (main->2nd) / : (1->0) 2nd->main :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/tait8741.h"
-#include "sound/msm5205.h"
#include "includes/gsword.h"
@@ -308,7 +307,7 @@ WRITE8_MEMBER(gsword_state::gsword_adpcm_data_w)
WRITE8_MEMBER(gsword_state::adpcm_soundcommand_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -364,7 +363,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( cpu3_map, AS_PROGRAM, 8, gsword_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x8000) AM_WRITE(gsword_adpcm_data_w)
- AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -669,6 +668,8 @@ static MACHINE_CONFIG_START( gsword, gsword_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18MHz/12) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
diff --git a/src/mame/drivers/halleys.cpp b/src/mame/drivers/halleys.cpp
index 8a8737dc516..f384dbb37c6 100644
--- a/src/mame/drivers/halleys.cpp
+++ b/src/mame/drivers/halleys.cpp
@@ -164,6 +164,7 @@ Video sync 6 F Video sync Post 6 F Post
#include "emu.h"
#include "cpu/z80/z80.h"
#include "includes/taitoipt.h"
+#include "machine/gen_latch.h"
#include "cpu/m6809/m6809.h"
#include "sound/ay8910.h"
@@ -217,7 +218,8 @@ public:
m_io_ram(*this, "io_ram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
UINT16 *m_render_layer[MAX_LAYERS];
UINT8 m_sound_fifo[MAX_SOUNDS];
@@ -285,6 +287,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
};
@@ -887,7 +890,7 @@ COMMAND_MODE:
second pass at the same location with zeroes. In addition the
X and Y values passed to the blitter do not reflect the tiles true
locations. For example, tiles near the top or bottom of the screen
- are positioned resonably close but those in the middle are oddly
+ are positioned reasonably close but those in the middle are oddly
shifted toward either side. The tiles also resemble predefined
patterns but I don't know if there are supposed to be lookup tables
in ROM or hard-wired to the blitter chips.
@@ -1643,7 +1646,7 @@ WRITE8_MEMBER(halleys_state::sndnmi_msk_w)
WRITE8_MEMBER(halleys_state::soundcommand_w)
{
m_io_ram[0x8a] = data;
- soundlatch_byte_w(space,offset,data);
+ m_soundlatch->write(space,offset,data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -1711,7 +1714,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, halleys_state )
AM_RANGE(0x4803, 0x4803) AM_DEVREAD("ay3", ay8910_device, data_r)
AM_RANGE(0x4804, 0x4805) AM_DEVWRITE("ay4", ay8910_device, address_data_w)
AM_RANGE(0x4805, 0x4805) AM_DEVREAD("ay4", ay8910_device, data_r)
- AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x5000, 0x5000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xe000, 0xefff) AM_ROM // space for diagnostic ROM
ADDRESS_MAP_END
@@ -1993,6 +1996,8 @@ static MACHINE_CONFIG_START( halleys, halleys_state )
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, XTAL_6MHz/4) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp
index a1daca3724d..45e3f433897 100644
--- a/src/mame/drivers/hh_hmcs40.cpp
+++ b/src/mame/drivers/hh_hmcs40.cpp
@@ -87,6 +87,7 @@
#include "rendlay.h"
#include "cpu/hmcs40/hmcs40.h"
#include "cpu/cop400/cop400.h"
+#include "machine/gen_latch.h"
#include "sound/speaker.h"
// internal artwork
@@ -102,6 +103,8 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
+ m_soundlatch(*this, "soundlatch"),
+ m_soundlatch2(*this, "soundlatch2"),
m_inp_matrix(*this, "IN"),
m_speaker(*this, "speaker"),
m_display_wait(33),
@@ -112,6 +115,8 @@ public:
// devices
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
+ optional_device<generic_latch_8_device> m_soundlatch;
+ optional_device<generic_latch_8_device> m_soundlatch2;
optional_ioport_array<7> m_inp_matrix; // max 7
optional_device<speaker_sound_device> m_speaker;
@@ -1798,7 +1803,7 @@ READ8_MEMBER(pairmtch_state::input_r)
WRITE8_MEMBER(pairmtch_state::sound_w)
{
// R5x: soundlatch (to audiocpu R2x)
- soundlatch_byte_w(space, 0, BITSWAP8(data,7,6,5,4,0,1,2,3));
+ m_soundlatch->write(space, 0, BITSWAP8(data,7,6,5,4,0,1,2,3));
}
@@ -1807,7 +1812,7 @@ WRITE8_MEMBER(pairmtch_state::sound_w)
WRITE8_MEMBER(pairmtch_state::sound2_w)
{
// R2x: soundlatch (to maincpu R5x)
- soundlatch2_byte_w(space, 0, BITSWAP8(data,7,6,5,4,0,1,2,3));
+ m_soundlatch2->write(space, 0, BITSWAP8(data,7,6,5,4,0,1,2,3));
}
WRITE16_MEMBER(pairmtch_state::speaker_w)
@@ -1859,14 +1864,14 @@ static MACHINE_CONFIG_START( pairmtch, pairmtch_state )
MCFG_HMCS40_WRITE_R_CB(3, WRITE8(pairmtch_state, plate_w))
MCFG_HMCS40_READ_R_CB(4, READ8(pairmtch_state, input_r))
MCFG_HMCS40_WRITE_R_CB(5, WRITE8(pairmtch_state, sound_w))
- MCFG_HMCS40_READ_R_CB(5, READ8(driver_device, soundlatch2_byte_r))
+ MCFG_HMCS40_READ_R_CB(5, DEVREAD8("soundlatch2", generic_latch_8_device, read))
MCFG_HMCS40_WRITE_R_CB(6, WRITE8(pairmtch_state, plate_w))
MCFG_HMCS40_WRITE_D_CB(WRITE16(pairmtch_state, grid_w))
MCFG_HMCS40_READ_D_CB(IOPORT("IN.2"))
MCFG_CPU_ADD("audiocpu", HD38820, 400000) // approximation
MCFG_HMCS40_WRITE_R_CB(2, WRITE8(pairmtch_state, sound2_w))
- MCFG_HMCS40_READ_R_CB(2, READ8(driver_device, soundlatch_byte_r))
+ MCFG_HMCS40_READ_R_CB(2, DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_HMCS40_WRITE_D_CB(WRITE16(pairmtch_state, speaker_w))
MCFG_QUANTUM_PERFECT_CPU("maincpu")
@@ -1876,6 +1881,10 @@ static MACHINE_CONFIG_START( pairmtch, pairmtch_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/himesiki.cpp b/src/mame/drivers/himesiki.cpp
index 99e254dde48..c61d2939a01 100644
--- a/src/mame/drivers/himesiki.cpp
+++ b/src/mame/drivers/himesiki.cpp
@@ -113,7 +113,7 @@ WRITE8_MEMBER(himesiki_state::himesiki_rombank_w)
WRITE8_MEMBER(himesiki_state::himesiki_sound_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -149,7 +149,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( himesiki_iom1, AS_IO, 8, himesiki_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ym2203", ym2203_device, read, write)
- AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
/****************************************************************************/
@@ -456,6 +456,9 @@ static MACHINE_CONFIG_START( himesiki, himesiki_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym2203", YM2203, CLK2/4) // ??
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("sub", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.10)
diff --git a/src/mame/drivers/homedata.cpp b/src/mame/drivers/homedata.cpp
index ce48e62fc65..fdd5ee0029e 100644
--- a/src/mame/drivers/homedata.cpp
+++ b/src/mame/drivers/homedata.cpp
@@ -222,8 +222,7 @@ Custom: GX61A01
#include "cpu/m6809/m6809.h"
#include "cpu/upd7810/upd7810.h"
#include "includes/homedata.h"
-#include "sound/dac.h"
-#include "sound/2203intf.h"
+
INTERRUPT_GEN_MEMBER(homedata_state::homedata_irq)
{
@@ -289,7 +288,7 @@ WRITE8_MEMBER(homedata_state::mrokumei_keyboard_select_w)
READ8_MEMBER(homedata_state::mrokumei_sound_io_r)
{
if (m_sndbank & 4)
- return(soundlatch_byte_r(space, 0));
+ return(m_soundlatch->read(space, 0));
else
return memregion("audiocpu")->base()[0x10000 + offset + (m_sndbank & 1) * 0x10000];
}
@@ -317,7 +316,7 @@ WRITE8_MEMBER(homedata_state::mrokumei_sound_io_w)
WRITE8_MEMBER(homedata_state::mrokumei_sound_cmd_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
@@ -1159,8 +1158,6 @@ GFXDECODE_END
MACHINE_START_MEMBER(homedata_state,homedata)
{
- m_sn = machine().device<sn76489a_device>("snsnd");
-
save_item(NAME(m_visible_page));
save_item(NAME(m_flipscreen));
save_item(NAME(m_blitter_bank));
@@ -1286,6 +1283,8 @@ static MACHINE_CONFIG_START( mrokumei, homedata_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("snsnd", SN76489A, 16000000/4) // SN76489AN actually
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
diff --git a/src/mame/drivers/inufuku.cpp b/src/mame/drivers/inufuku.cpp
index ab422b0a2dc..9fd03c96daa 100644
--- a/src/mame/drivers/inufuku.cpp
+++ b/src/mame/drivers/inufuku.cpp
@@ -96,7 +96,7 @@ WRITE16_MEMBER(inufuku_state::inufuku_soundcommand_w)
return;
m_pending_command = 1;
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -177,7 +177,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( inufuku_sound_io_map, AS_IO, 8, inufuku_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(inufuku_soundrombank_w)
- AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
+ AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(pending_command_clear_w)
AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
ADDRESS_MAP_END
@@ -403,6 +403,8 @@ static MACHINE_CONFIG_START( inufuku, inufuku_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 32000000/4)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(inufuku_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
diff --git a/src/mame/drivers/kas89.cpp b/src/mame/drivers/kas89.cpp
index cf7cd47487f..3876b2f2da5 100644
--- a/src/mame/drivers/kas89.cpp
+++ b/src/mame/drivers/kas89.cpp
@@ -34,7 +34,7 @@
1x Z80 (audio) @ 3.578 MHz.
AY-3-8910 @ 1789 kHz.
- 1x Unknown metallick brick (Yamaha MSX2 VDP inside).
+ 1x Unknown metallic brick (Yamaha MSX2 VDP inside).
1x 8 DIP switches bank.
@@ -197,6 +197,7 @@
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "video/v9938.h"
+#include "machine/gen_latch.h"
#include "machine/nvram.h"
#include "kas89.lh"
@@ -209,6 +210,7 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_v9938(*this, "v9938"),
+ m_soundlatch(*this, "soundlatch"),
m_pl1(*this, "PL1"),
m_pl2(*this, "PL2"),
m_pl3(*this, "PL3"),
@@ -230,6 +232,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<v9938_device> m_v9938;
+ required_device<generic_latch_8_device> m_soundlatch;
required_ioport m_pl1;
required_ioport m_pl2;
required_ioport m_pl3;
@@ -384,7 +387,7 @@ WRITE8_MEMBER(kas89_state::sound_comm_w)
else
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(0, ASSERT_LINE );
}
}
@@ -583,7 +586,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( audio_io, AS_IO, 8, kas89_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(int_ack_w) // comm out (1st Z80). seems to write here the value previously read through soundlatch (port 0x02).
- 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_DEVREAD("aysnd", ay8910_device, data_r)
AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
ADDRESS_MAP_END
@@ -780,6 +783,9 @@ static MACHINE_CONFIG_START( kas89, kas89_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, MASTER_CLOCK/12) /* Confirmed */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/kickgoal.cpp b/src/mame/drivers/kickgoal.cpp
index 818748e417e..f1f84912c10 100644
--- a/src/mame/drivers/kickgoal.cpp
+++ b/src/mame/drivers/kickgoal.cpp
@@ -480,7 +480,7 @@ static ADDRESS_MAP_START( kickgoal_program_map, AS_PROGRAM, 16, kickgoal_state )
/// AM_RANGE(0x30001e, 0x30001f) AM_WRITE(kickgoal_snd_w)
AM_RANGE(0x800000, 0x800001) AM_READ_PORT("P1_P2")
AM_RANGE(0x800002, 0x800003) AM_READ_PORT("SYSTEM")
-/// AM_RANGE(0x800004, 0x800005) AM_WRITE(soundlatch_word_w)
+/// AM_RANGE(0x800004, 0x800005) AM_DEVWRITE("soundlatch", generic_latch_16_device, write)
AM_RANGE(0x800004, 0x800005) AM_WRITE(actionhw_snd_w)
AM_RANGE(0x900000, 0x900005) AM_WRITE(kickgoal_eeprom_w)
AM_RANGE(0x900006, 0x900007) AM_READ(kickgoal_eeprom_r)
@@ -633,7 +633,7 @@ static MACHINE_CONFIG_START( kickgoal, kickgoal_state )
MCFG_CPU_PERIODIC_INT_DRIVER(kickgoal_state, kickgoal_interrupt, 240)
MCFG_CPU_ADD("audiocpu", PIC16C57, 12000000/4) /* 3MHz ? */
- MCFG_DEVICE_DISABLE() /* Disables since the internal rom isn't dumped */
+ MCFG_DEVICE_DISABLE() /* Disabled since the internal rom isn't dumped */
/* Program and Data Maps are internal to the MCU */
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
@@ -656,6 +656,9 @@ static MACHINE_CONFIG_START( kickgoal, kickgoal_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ //MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_OKIM6295_ADD("oki", 12000000/8, OKIM6295_PIN7_LOW)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MACHINE_CONFIG_END
@@ -668,7 +671,7 @@ static MACHINE_CONFIG_START( actionhw, kickgoal_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", kickgoal_state, irq6_line_hold)
MCFG_CPU_ADD("audiocpu", PIC16C57, XTAL_12MHz/3) /* verified on pcb */
- MCFG_DEVICE_DISABLE() /* Disables since the internal rom isn't dumped */
+ MCFG_DEVICE_DISABLE() /* Disabled since the internal rom isn't dumped */
/* Program and Data Maps are internal to the MCU */
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
@@ -691,6 +694,9 @@ static MACHINE_CONFIG_START( actionhw, kickgoal_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ //MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_OKIM6295_ADD("oki", XTAL_12MHz/12, OKIM6295_PIN7_HIGH) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/kingdrby.cpp b/src/mame/drivers/kingdrby.cpp
index ac0f42de2bd..59174b9abfe 100644
--- a/src/mame/drivers/kingdrby.cpp
+++ b/src/mame/drivers/kingdrby.cpp
@@ -303,7 +303,7 @@ WRITE8_MEMBER(kingdrby_state::sound_cmd_w)
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
m_sound_cmd = data;
/* soundlatch is unneeded since we are already using perfect interleave. */
- // soundlatch_byte_w(space,0, data);
+ // m_soundlatch->write(space,0, data);
}
diff --git a/src/mame/drivers/kingpin.cpp b/src/mame/drivers/kingpin.cpp
index 6f72cd2ee2c..0c386a32c37 100644
--- a/src/mame/drivers/kingpin.cpp
+++ b/src/mame/drivers/kingpin.cpp
@@ -35,6 +35,7 @@ Todo:
#include "cpu/z80/z80.h"
#include "video/tms9928a.h"
#include "sound/ay8910.h"
+#include "machine/gen_latch.h"
#include "machine/i8255.h"
#include "machine/nvram.h"
@@ -45,11 +46,13 @@ public:
kingpin_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_audiocpu(*this, "audiocpu"),
+ m_soundlatch(*this, "soundlatch")
{ }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE8_MEMBER(sound_nmi_w);
DECLARE_WRITE_LINE_MEMBER(vdp_interrupt);
@@ -58,7 +61,7 @@ public:
WRITE8_MEMBER(kingpin_state::sound_nmi_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -86,7 +89,7 @@ static ADDRESS_MAP_START( kingpin_sound_map, AS_PROGRAM, 8, kingpin_state )
//AM_RANGE(0x8400, 0x8400) AM_READNOP // ?
//AM_RANGE(0x8401, 0x8401) AM_WRITENOP // ?
AM_RANGE(0x8800, 0x8fff) AM_RAM
- AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x9000, 0x9000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -162,6 +165,9 @@ static MACHINE_CONFIG_START( kingpin, kingpin_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8912, XTAL_3_579545MHz)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ksayakyu.cpp b/src/mame/drivers/ksayakyu.cpp
index 050a11fc592..15707b5314d 100644
--- a/src/mame/drivers/ksayakyu.cpp
+++ b/src/mame/drivers/ksayakyu.cpp
@@ -89,7 +89,7 @@ WRITE8_MEMBER(ksayakyu_state::bank_select_w)
WRITE8_MEMBER(ksayakyu_state::latch_w)
{
m_sound_status &= ~0x80;
- soundlatch_byte_w(space, 0, data | 0x80);
+ m_soundlatch->write(space, 0, data | 0x80);
}
READ8_MEMBER(ksayakyu_state::sound_status_r)
@@ -100,7 +100,7 @@ READ8_MEMBER(ksayakyu_state::sound_status_r)
WRITE8_MEMBER(ksayakyu_state::tomaincpu_w)
{
m_sound_status |= 0x80;
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
}
static ADDRESS_MAP_START( maincpu_map, AS_PROGRAM, 8, ksayakyu_state )
@@ -276,8 +276,10 @@ static MACHINE_CONFIG_START( ksayakyu, ksayakyu_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, MAIN_CLOCK/16) //unknown 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(ksayakyu_state, dummy1_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/kurukuru.cpp b/src/mame/drivers/kurukuru.cpp
index af9ca15215c..f9f6ad3f23c 100644
--- a/src/mame/drivers/kurukuru.cpp
+++ b/src/mame/drivers/kurukuru.cpp
@@ -9,7 +9,7 @@
This hardware seems to be a derivative of MSX2 'on steroids'.
- It has many similarites with sothello.c and tonton.c
+ It has many similarities with sothello.cpp and tonton.cpp
Special thanks to Charles MacDonald, for all the hardware traces: clocks,
ports, descriptions and a lot of things... :)
@@ -147,9 +147,9 @@
Insert tokens (medals).
You can bet to any (or all) of the following 5 characters: Bote, Oume, Pyoko,
Kunio, and Pyon Pyon. Press start, and the reels start to roll. You'll win if
- you can get 3 of the choosen character(s) in a row, column or diagonal.
+ you can get 3 of the chosen character(s) in a row, column or diagonal.
- The black tadpoles behave just like jokers... If you have 2 choosen characters
+ The black tadpoles behave just like jokers... If you have 2 chosen characters
in a row and the remaining one is a black tadpole, it will transform into another
character to complete the 3 in a row, allowing you to win.
@@ -252,22 +252,29 @@
#include "video/v9938.h"
#include "machine/ticket.h"
#include "machine/nvram.h"
+#include "machine/gen_latch.h"
class kurukuru_state : public driver_device
{
public:
kurukuru_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_v9938(*this, "v9938"),
- m_maincpu(*this, "maincpu"),
m_adpcm(*this, "adpcm"),
m_hopper(*this, "hopper"),
+ m_soundlatch(*this, "soundlatch"),
m_bank1(*this, "bank1")
{ }
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<v9938_device> m_v9938;
+ required_device<msm5205_device> m_adpcm;
+ required_device<ticket_dispenser_device> m_hopper;
+ required_device<generic_latch_8_device> m_soundlatch;
+ required_memory_bank m_bank1;
UINT8 m_sound_irq_cause;
UINT8 m_adpcm_data;
@@ -287,10 +294,6 @@ public:
virtual void machine_reset() override;
DECLARE_WRITE_LINE_MEMBER(kurukuru_msm5205_vck);
DECLARE_WRITE_LINE_MEMBER(kurukuru_vdp_interrupt);
- required_device<cpu_device> m_maincpu;
- required_device<msm5205_device> m_adpcm;
- required_device<ticket_dispenser_device> m_hopper;
- required_memory_bank m_bank1;
};
#define MAIN_CLOCK XTAL_21_4772MHz
@@ -391,7 +394,7 @@ WRITE8_MEMBER(kurukuru_state::kurukuru_bankswitch_w)
WRITE8_MEMBER(kurukuru_state::kurukuru_soundlatch_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
update_sound_irq(m_sound_irq_cause | 1);
}
@@ -481,7 +484,7 @@ WRITE8_MEMBER(kurukuru_state::kurukuru_adpcm_reset_w)
READ8_MEMBER(kurukuru_state::kurukuru_soundlatch_r)
{
update_sound_irq(m_sound_irq_cause & ~1);
- return soundlatch_byte_r(space, 0);
+ return m_soundlatch->read(space, 0);
}
READ8_MEMBER(kurukuru_state::kurukuru_adpcm_timer_irqack_r)
@@ -739,6 +742,9 @@ static MACHINE_CONFIG_START( kurukuru, kurukuru_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym2149", YM2149, YM2149_CLOCK)
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2"))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(kurukuru_state, ym2149_aout_w))
@@ -774,6 +780,9 @@ static MACHINE_CONFIG_START( ppj, kurukuru_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym2149", YM2149, YM2149_CLOCK) // pin 26 (/SEL) is low so final clock is clk/2, handled inside the ym2149 core
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2"))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(kurukuru_state, ym2149_aout_w))
diff --git a/src/mame/drivers/ladyfrog.cpp b/src/mame/drivers/ladyfrog.cpp
index cf99c2192eb..14cd8b2c7dc 100644
--- a/src/mame/drivers/ladyfrog.cpp
+++ b/src/mame/drivers/ladyfrog.cpp
@@ -81,7 +81,7 @@ TIMER_CALLBACK_MEMBER(ladyfrog_state::nmi_callback)
WRITE8_MEMBER(ladyfrog_state::sound_command_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(ladyfrog_state::nmi_callback),this), data);
}
@@ -139,7 +139,7 @@ static ADDRESS_MAP_START( ladyfrog_sound_map, AS_PROGRAM, 8, ladyfrog_state )
AM_RANGE(0xca00, 0xca00) AM_WRITENOP
AM_RANGE(0xcb00, 0xcb00) AM_WRITENOP
AM_RANGE(0xcc00, 0xcc00) AM_WRITENOP
- AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) AM_WRITE(to_main_w)
+ AM_RANGE(0xd000, 0xd000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(to_main_w)
AM_RANGE(0xd200, 0xd200) AM_READNOP AM_WRITE(nmi_enable_w)
AM_RANGE(0xd400, 0xd400) AM_WRITE(nmi_disable_w)
AM_RANGE(0xd600, 0xd600) AM_WRITENOP
@@ -308,6 +308,8 @@ static MACHINE_CONFIG_START( ladyfrog, ladyfrog_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(ladyfrog_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(ladyfrog_state, unk_w))
diff --git a/src/mame/drivers/limenko.cpp b/src/mame/drivers/limenko.cpp
index 1d7870d50dc..cdc9f64e97b 100644
--- a/src/mame/drivers/limenko.cpp
+++ b/src/mame/drivers/limenko.cpp
@@ -27,6 +27,7 @@
#include "emu.h"
#include "cpu/e132xs/e132xs.h"
#include "machine/eepromser.h"
+#include "machine/gen_latch.h"
#include "sound/qs1000.h"
#include "sound/okim6295.h"
@@ -41,6 +42,7 @@ public:
m_qs1000(*this, "qs1000"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_mainram(*this, "mainram"),
m_fg_videoram(*this, "fg_videoram"),
m_md_videoram(*this, "md_videoram"),
@@ -54,6 +56,7 @@ public:
optional_device<qs1000_device> m_qs1000;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT32> m_mainram;
required_shared_ptr<UINT32> m_fg_videoram;
@@ -176,7 +179,7 @@ WRITE32_MEMBER(limenko_state::spriteram_buffer_w)
WRITE32_MEMBER(limenko_state::limenko_soundlatch_w)
{
- soundlatch_byte_w(space, 0, data >> 16);
+ m_soundlatch->write(space, 0, data >> 16);
m_qs1000->set_irq(ASSERT_LINE);
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
@@ -184,12 +187,12 @@ WRITE32_MEMBER(limenko_state::limenko_soundlatch_w)
WRITE32_MEMBER(limenko_state::spotty_soundlatch_w)
{
- soundlatch_byte_w(space, 0, data >> 16);
+ m_soundlatch->write(space, 0, data >> 16);
}
READ8_MEMBER(limenko_state::qs1000_p1_r)
{
- return soundlatch_byte_r(space, 0);
+ return m_soundlatch->read(space, 0);
}
WRITE8_MEMBER(limenko_state::qs1000_p1_w)
@@ -283,7 +286,7 @@ READ8_MEMBER(limenko_state::spotty_sound_r)
// check m_spotty_sound_cmd bits...
if(m_spotty_sound_cmd == 0xf7)
- return soundlatch_byte_r(space,0);
+ return m_soundlatch->read(space,0);
else
return m_oki->read(space,0);
}
@@ -749,6 +752,8 @@ static MACHINE_CONFIG_START( limenko, limenko_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(limenko_state, qs1000_p1_r))
@@ -787,6 +792,8 @@ static MACHINE_CONFIG_START( spotty, limenko_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_OKIM6295_ADD("oki", 4000000 / 4 , OKIM6295_PIN7_HIGH) //?
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/lkage.cpp b/src/mame/drivers/lkage.cpp
index 5aa2b49a471..d06da53b1b2 100644
--- a/src/mame/drivers/lkage.cpp
+++ b/src/mame/drivers/lkage.cpp
@@ -107,7 +107,7 @@ TIMER_CALLBACK_MEMBER(lkage_state::nmi_callback)
WRITE8_MEMBER(lkage_state::lkage_sound_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(lkage_state::nmi_callback),this), data);
}
@@ -187,7 +187,7 @@ static ADDRESS_MAP_START( lkage_sound_map, AS_PROGRAM, 8, lkage_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ym1", ym2203_device, read, write)
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
- AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r) AM_WRITENOP /* ??? */
+ AM_RANGE(0xb000, 0xb000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITENOP /* ??? */
AM_RANGE(0xb001, 0xb001) AM_READNOP /* ??? */ AM_WRITE(lkage_sh_nmi_enable_w)
AM_RANGE(0xb002, 0xb002) AM_WRITE(lkage_sh_nmi_disable_w)
AM_RANGE(0xb003, 0xb003) AM_WRITENOP
@@ -566,6 +566,8 @@ static MACHINE_CONFIG_START( lkage, lkage_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, AUDIO_CLOCK )
MCFG_YM2203_IRQ_HANDLER(WRITELINE(lkage_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.15)
@@ -611,6 +613,8 @@ static MACHINE_CONFIG_START( lkageb, lkage_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, AUDIO_CLOCK)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(lkage_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.15)
diff --git a/src/mame/drivers/looping.cpp b/src/mame/drivers/looping.cpp
index c7ec5bfc4ba..c7b0fb4275d 100644
--- a/src/mame/drivers/looping.cpp
+++ b/src/mame/drivers/looping.cpp
@@ -57,6 +57,7 @@ L056-6 9A " " VLI-8-4 7A "
#include "emu.h"
#include "cpu/tms9900/tms9995.h"
#include "cpu/tms9900/tms9980a.h"
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
@@ -110,7 +111,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_dac(*this, "dac"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -162,6 +164,7 @@ public:
required_device<dac_device> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
};
@@ -392,7 +395,7 @@ WRITE_LINE_MEMBER(looping_state::looping_spcint)
WRITE8_MEMBER(looping_state::looping_soundlatch_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(INT_9980A_LEVEL2, ASSERT_LINE);
}
@@ -650,8 +653,10 @@ static MACHINE_CONFIG_START( looping, looping_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, SOUND_CLOCK/4)
- 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.20)
MCFG_SOUND_ADD("tms", TMS5220, TMS_CLOCK)
diff --git a/src/mame/drivers/matmania.cpp b/src/mame/drivers/matmania.cpp
index d227a15805d..0384e2613d5 100644
--- a/src/mame/drivers/matmania.cpp
+++ b/src/mame/drivers/matmania.cpp
@@ -172,13 +172,13 @@ READ8_MEMBER(matmania_state::maniach_mcu_status_r)
WRITE8_MEMBER(matmania_state::matmania_sh_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
}
WRITE8_MEMBER(matmania_state::maniach_sh_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE);
}
@@ -231,7 +231,7 @@ static ADDRESS_MAP_START( matmania_sound_map, AS_PROGRAM, 8, matmania_state )
AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
AM_RANGE(0x2002, 0x2003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_device, write_signed8)
- AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x2007, 0x2007) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -239,7 +239,7 @@ static ADDRESS_MAP_START( maniach_sound_map, AS_PROGRAM, 8, matmania_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ymsnd", ym3526_device, write)
AM_RANGE(0x2002, 0x2002) AM_DEVWRITE("dac", dac_device, write_signed8)
- AM_RANGE(0x2004, 0x2004) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x2004, 0x2004) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -451,6 +451,8 @@ static MACHINE_CONFIG_START( matmania, matmania_state )
/* sound 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.30)
@@ -530,6 +532,8 @@ static MACHINE_CONFIG_START( maniach, matmania_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3526, 3600000)
MCFG_YM3526_IRQ_HANDLER(DEVWRITELINE("audiocpu", m6809_device, firq_line))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/mcatadv.cpp b/src/mame/drivers/mcatadv.cpp
index 7e07057a7c2..88990c41e42 100644
--- a/src/mame/drivers/mcatadv.cpp
+++ b/src/mame/drivers/mcatadv.cpp
@@ -148,7 +148,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
WRITE16_MEMBER(mcatadv_state::mcat_soundlatch_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -200,7 +200,7 @@ static ADDRESS_MAP_START( mcatadv_map, AS_PROGRAM, 16, mcatadv_state )
AM_RANGE(0xb00018, 0xb00019) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) // NOST Only
AM_RANGE(0xb0001e, 0xb0001f) AM_READ(mcat_wd_r) // MCAT Only
- AM_RANGE(0xc00000, 0xc00001) AM_READ(soundlatch2_word_r) AM_WRITE(mcat_soundlatch_w)
+ AM_RANGE(0xc00000, 0xc00001) AM_DEVREAD8("soundlatch2", generic_latch_8_device, read, 0x00ff) AM_WRITE(mcat_soundlatch_w)
ADDRESS_MAP_END
/*** Sound ***/
@@ -221,7 +221,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mcatadv_sound_io_map, AS_IO, 8, mcatadv_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x80, 0x80) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w)
+ AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
ADDRESS_MAP_END
@@ -236,7 +236,7 @@ static ADDRESS_MAP_START( nost_sound_io_map, AS_IO, 8, mcatadv_state )
AM_RANGE(0x00, 0x03) AM_DEVWRITE("ymsnd", ym2610_device, write)
AM_RANGE(0x04, 0x07) AM_DEVREAD("ymsnd", ym2610_device, read)
AM_RANGE(0x40, 0x40) AM_WRITE(mcatadv_sound_bw_w)
- AM_RANGE(0x80, 0x80) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w)
+ AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
ADDRESS_MAP_END
/*** Inputs ***/
@@ -465,6 +465,9 @@ static MACHINE_CONFIG_START( mcatadv, mcatadv_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(WRITELINE(mcatadv_state, sound_irq))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.32)
diff --git a/src/mame/drivers/mirax.cpp b/src/mame/drivers/mirax.cpp
index ec3bdaf751c..c4b11028968 100644
--- a/src/mame/drivers/mirax.cpp
+++ b/src/mame/drivers/mirax.cpp
@@ -102,6 +102,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
@@ -114,6 +115,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_colorram(*this, "colorram") { }
@@ -122,6 +124,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;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_spriteram;
@@ -282,7 +285,7 @@ WRITE8_MEMBER(mirax_state::nmi_mask_w)
WRITE8_MEMBER(mirax_state::sound_cmd_w)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -329,7 +332,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mirax_sound_map, AS_PROGRAM, 8, mirax_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x8000, 0x8fff) AM_RAM
- AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xe000, 0xe000) AM_WRITENOP
AM_RANGE(0xe001, 0xe001) AM_WRITENOP
@@ -492,6 +495,9 @@ static MACHINE_CONFIG_START( mirax, mirax_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", mirax)
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 12000000/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/drivers/missb2.cpp b/src/mame/drivers/missb2.cpp
index 85475271f05..cf3f597be5c 100644
--- a/src/mame/drivers/missb2.cpp
+++ b/src/mame/drivers/missb2.cpp
@@ -199,7 +199,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, missb2_state )
AM_RANGE(0x8000, 0x8fff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym3526_device, read, write)
- AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r) AM_WRITENOP // message for main cpu
+ AM_RANGE(0xb000, 0xb000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITENOP // message for main cpu
AM_RANGE(0xb001, 0xb001) AM_READNOP AM_WRITE(bublbobl_sh_nmi_enable_w) // bit 0: message pending for main cpu, bit 1: message pending for sound cpu
AM_RANGE(0xb002, 0xb002) AM_WRITE(bublbobl_sh_nmi_disable_w)
AM_RANGE(0xe000, 0xefff) AM_ROM // space for diagnostic ROM?
@@ -474,6 +474,8 @@ static MACHINE_CONFIG_START( missb2, missb2_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3526, MAIN_XTAL/8)
MCFG_YM3526_IRQ_HANDLER(WRITELINE(missb2_state, irqhandler))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
diff --git a/src/mame/drivers/msisaac.cpp b/src/mame/drivers/msisaac.cpp
index 0d97a8662f7..0e90da0184a 100644
--- a/src/mame/drivers/msisaac.cpp
+++ b/src/mame/drivers/msisaac.cpp
@@ -18,7 +18,7 @@
TO DO:
- sprites are probably banked differently (no way to be sure until MCU dump is available)
- TA7630 emulation needs filter support (characteristics depend on the frequency)
- - TA7630 volume table is hand tuned to match the sample, but still slighty off.
+ - TA7630 volume table is hand tuned to match the sample, but still slightly off.
*/
@@ -32,7 +32,7 @@ TIMER_CALLBACK_MEMBER(msisaac_state::nmi_callback)
WRITE8_MEMBER(msisaac_state::sound_command_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(msisaac_state::nmi_callback),this), data);
}
@@ -262,7 +262,7 @@ static ADDRESS_MAP_START( msisaac_sound_map, AS_PROGRAM, 8, msisaac_state )
AM_RANGE(0x8010, 0x801d) AM_DEVWRITE("msm", msm5232_device, write)
AM_RANGE(0x8020, 0x8020) AM_WRITE(sound_control_0_w)
AM_RANGE(0x8030, 0x8030) AM_WRITE(sound_control_1_w)
- AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xc001, 0xc001) AM_WRITE(nmi_enable_w)
AM_RANGE(0xc002, 0xc002) AM_WRITE(nmi_disable_w)
AM_RANGE(0xc003, 0xc003) AM_WRITENOP /*???*/ /* this is NOT mixer_enable */
@@ -494,6 +494,8 @@ static MACHINE_CONFIG_START( msisaac, msisaac_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.15)
diff --git a/src/mame/drivers/neoprint.cpp b/src/mame/drivers/neoprint.cpp
index bfa5cf007bd..afb32b04f26 100644
--- a/src/mame/drivers/neoprint.cpp
+++ b/src/mame/drivers/neoprint.cpp
@@ -23,6 +23,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "machine/nvram.h"
#include "sound/2610intf.h"
#include "machine/upd1990a.h"
@@ -41,6 +42,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_generic_paletteram_16(*this, "paletteram") { }
required_shared_ptr<UINT16> m_npvidram;
@@ -51,6 +53,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;
optional_shared_ptr<UINT16> m_generic_paletteram_16;
UINT8 m_audio_result;
@@ -198,7 +201,7 @@ WRITE8_MEMBER(neoprint_state::audio_cpu_clear_nmi_w)
WRITE8_MEMBER(neoprint_state::audio_command_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
audio_cpu_assert_nmi();
@@ -211,7 +214,7 @@ WRITE8_MEMBER(neoprint_state::audio_command_w)
READ8_MEMBER(neoprint_state::audio_command_r)
{
- UINT8 ret = soundlatch_byte_r(space, 0);
+ UINT8 ret = m_soundlatch->read(space, 0);
//if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", space.device().safe_pc(), ret);
@@ -506,6 +509,8 @@ static MACHINE_CONFIG_START( neoprint, neoprint_state )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 24000000 / 3)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(neoprint_state, audio_cpu_irq))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
@@ -549,6 +554,8 @@ static MACHINE_CONFIG_START( nprsp, neoprint_state )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 24000000 / 3)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(neoprint_state, audio_cpu_irq))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
diff --git a/src/mame/drivers/ninjakd2.cpp b/src/mame/drivers/ninjakd2.cpp
index 4b975ec2293..14d47b9a44f 100644
--- a/src/mame/drivers/ninjakd2.cpp
+++ b/src/mame/drivers/ninjakd2.cpp
@@ -153,6 +153,7 @@ TODO:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/2203intf.h"
+#include "machine/gen_latch.h"
#include "machine/mc8123.h"
#include "includes/ninjakd2.h"
@@ -376,7 +377,7 @@ static ADDRESS_MAP_START( ninjakd2_main_cpu, AS_PROGRAM, 8, ninjakd2_state )
AM_RANGE(0xc002, 0xc002) AM_READ_PORT("PAD2")
AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DIPSW1")
AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DIPSW2")
- 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(ninjakd2_soundreset_w)
AM_RANGE(0xc202, 0xc202) AM_WRITE(ninjakd2_bankselect_w)
AM_RANGE(0xc203, 0xc203) AM_WRITE(ninjakd2_sprite_overdraw_w)
@@ -401,7 +402,7 @@ static ADDRESS_MAP_START( mnight_main_cpu, AS_PROGRAM, 8, ninjakd2_state )
AM_RANGE(0xf802, 0xf802) AM_READ_PORT("PAD2")
AM_RANGE(0xf803, 0xf803) AM_READ_PORT("DIPSW1")
AM_RANGE(0xf804, 0xf804) AM_READ_PORT("DIPSW2")
- AM_RANGE(0xfa00, 0xfa00) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xfa00, 0xfa00) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xfa01, 0xfa01) AM_WRITE(ninjakd2_soundreset_w)
AM_RANGE(0xfa02, 0xfa02) AM_WRITE(ninjakd2_bankselect_w)
AM_RANGE(0xfa03, 0xfa03) AM_WRITE(ninjakd2_sprite_overdraw_w)
@@ -417,7 +418,7 @@ static ADDRESS_MAP_START( robokid_main_cpu, AS_PROGRAM, 8, ninjakd2_state )
AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(robokid_bg2_videoram_r, robokid_bg2_videoram_w) // banked
AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(robokid_bg1_videoram_r, robokid_bg1_videoram_w) // banked
AM_RANGE(0xd800, 0xdbff) AM_READWRITE(robokid_bg0_videoram_r, robokid_bg0_videoram_w) // banked
- AM_RANGE(0xdc00, 0xdc00) AM_READ_PORT("KEYCOIN") AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xdc00, 0xdc00) AM_READ_PORT("KEYCOIN") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xdc01, 0xdc01) AM_READ_PORT("PAD1") AM_WRITE(ninjakd2_soundreset_w)
AM_RANGE(0xdc02, 0xdc02) AM_READ_PORT("PAD2") AM_WRITE(ninjakd2_bankselect_w)
AM_RANGE(0xdc03, 0xdc03) AM_READ_PORT("DIPSW1") AM_WRITE(ninjakd2_sprite_overdraw_w)
@@ -436,7 +437,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( omegaf_main_cpu, AS_PROGRAM, 8, ninjakd2_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
- AM_RANGE(0xc000, 0xc000) AM_READ_PORT("KEYCOIN") AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xc000, 0xc000) AM_READ_PORT("KEYCOIN") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xc001, 0xc003) AM_READ(omegaf_io_protection_r)
AM_RANGE(0xc001, 0xc001) AM_WRITE(ninjakd2_soundreset_w)
AM_RANGE(0xc002, 0xc002) AM_WRITE(ninjakd2_bankselect_w)
@@ -463,7 +464,7 @@ static ADDRESS_MAP_START( ninjakd2_sound_cpu, AS_PROGRAM, 8, ninjakd2_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 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_WRITE(ninjakd2_pcm_play_w)
ADDRESS_MAP_END
@@ -471,7 +472,7 @@ static ADDRESS_MAP_START( ninjakid_nopcm_sound_cpu, AS_PROGRAM, 8, ninjakd2_stat
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 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_NOP
ADDRESS_MAP_END
@@ -963,6 +964,8 @@ static MACHINE_CONFIG_START( ninjakd2_core, ninjakd2_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("2203.1", YM2203, MAIN_CLOCK_12/8) /* verified */
MCFG_YM2203_IRQ_HANDLER(WRITELINE(ninjakd2_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.10)
diff --git a/src/mame/drivers/nmg5.cpp b/src/mame/drivers/nmg5.cpp
index 6a808ce11d4..51fd41f22e0 100644
--- a/src/mame/drivers/nmg5.cpp
+++ b/src/mame/drivers/nmg5.cpp
@@ -209,7 +209,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
("do you want to draw a medal ?" question) :
* BUTTON5 : Yes
* BUTTON6 : No
- - As hopper and other mecanisms aren't emulated, you can't
+ - As hopper and other mechanisms aren't emulated, you can't
draw a medal (winnings are always converted to credits).
I hope that someone will be able to fix that as I can't do it.
@@ -224,6 +224,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "sound/3812intf.h"
#include "video/decospr.h"
@@ -238,11 +239,12 @@ public:
m_bg_videoram(*this, "bg_videoram"),
m_fg_videoram(*this, "fg_videoram"),
m_bitmap(*this, "bitmap"),
- m_sprgen(*this, "spritegen"),
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
m_oki(*this, "oki"),
- m_gfxdecode(*this, "gfxdecode")
+ m_gfxdecode(*this, "gfxdecode"),
+ m_sprgen(*this, "spritegen"),
+ m_soundlatch(*this, "soundlatch")
{ }
/* memory pointers */
@@ -251,7 +253,6 @@ public:
required_shared_ptr<UINT16> m_bg_videoram;
required_shared_ptr<UINT16> m_fg_videoram;
required_shared_ptr<UINT16> m_bitmap;
- optional_device<decospr_device> m_sprgen;
/* video-related */
tilemap_t *m_bg_tilemap;
@@ -268,6 +269,8 @@ public:
required_device<cpu_device> m_soundcpu;
required_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
+ optional_device<decospr_device> m_sprgen;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE16_MEMBER(fg_videoram_w);
DECLARE_WRITE16_MEMBER(bg_videoram_w);
@@ -308,7 +311,7 @@ WRITE16_MEMBER(nmg5_state::nmg5_soundlatch_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -410,7 +413,7 @@ static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, nmg5_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(oki_banking_w)
AM_RANGE(0x10, 0x11) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write)
- AM_RANGE(0x18, 0x18) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x18, 0x18) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x1c, 0x1c) AM_DEVREADWRITE("oki", okim6295_device, read, write)
ADDRESS_MAP_END
@@ -1004,6 +1007,8 @@ static MACHINE_CONFIG_START( nmg5, nmg5_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, 4000000) /* 4MHz */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/nycaptor.cpp b/src/mame/drivers/nycaptor.cpp
index df2b1fe7583..d0baed92afe 100644
--- a/src/mame/drivers/nycaptor.cpp
+++ b/src/mame/drivers/nycaptor.cpp
@@ -12,7 +12,7 @@
What's new :
- added bootlegs - Bronx and Colt
- - Cycle Shooting added (bigger VRAM than nycpator, dfferent (unknwn yet) banking and
+ - Cycle Shooting added (bigger VRAM than nycpator, different (unknown yet) banking and
gfx control , ROMs probably are wrong mapped, gfx too)
- Sub CPU halt (cpu #0 ,$d001)
- Improved communication between main cpu and sound cpu ($d400 cpu#0 , $d000 sound cpu)
@@ -159,14 +159,14 @@ Stephh's additional notes (based on the game Z80 code and some tests) :
Furthermore, shooting birds kills you instead of recovering 3 "steps" of damage !
- I can't tell if it's an ingame bug of this bootleg, but the game hangs after bonus stage
(level 4) instead of looping back to level 1 with higher difficulty.
- The game also frezees sometimes for some unknown reasons.
+ The game also freezes sometimes for some unknown reasons.
2) 'cyclshtg' and clones
2a) 'cyclshtg'
- Lives (BCD coded) settings are not read from MCU, but from table at 0x0fee.
- - Even if it isn't mentionned in the manual, DSWB bit 7 allows you to reset damage to 0
+ - Even if it isn't mentioned in the manual, DSWB bit 7 allows you to reset damage to 0
at the end of a level (check code at 0x328d).
- When "Infinite Bullets" is set to ON, there is no timer to reload the bullets.
However, it's hard to notice as you don't see an indicator as in 'nycaptor'.
@@ -271,7 +271,7 @@ TIMER_CALLBACK_MEMBER(nycaptor_state::nmi_callback)
WRITE8_MEMBER(nycaptor_state::sound_command_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(nycaptor_state::nmi_callback),this), data);
}
@@ -360,7 +360,7 @@ static ADDRESS_MAP_START( nycaptor_sound_map, AS_PROGRAM, 8, nycaptor_state )
AM_RANGE(0xca00, 0xca00) AM_WRITENOP
AM_RANGE(0xcb00, 0xcb00) AM_WRITENOP
AM_RANGE(0xcc00, 0xcc00) AM_WRITENOP
- AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) AM_WRITE(to_main_w)
+ AM_RANGE(0xd000, 0xd000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(to_main_w)
AM_RANGE(0xd200, 0xd200) AM_READNOP AM_WRITE(nmi_enable_w)
AM_RANGE(0xd400, 0xd400) AM_WRITE(nmi_disable_w)
AM_RANGE(0xd600, 0xd600) AM_WRITENOP
@@ -837,6 +837,8 @@ static MACHINE_CONFIG_START( nycaptor, nycaptor_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nycaptor_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(nycaptor_state, unk_w))
@@ -898,6 +900,8 @@ static MACHINE_CONFIG_START( cyclshtg, nycaptor_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nycaptor_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(nycaptor_state, unk_w))
@@ -959,6 +963,8 @@ static MACHINE_CONFIG_START( bronx, nycaptor_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nycaptor_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(nycaptor_state, unk_w))
diff --git a/src/mame/drivers/oneshot.cpp b/src/mame/drivers/oneshot.cpp
index e6b0fee887d..cad1f105fa4 100644
--- a/src/mame/drivers/oneshot.cpp
+++ b/src/mame/drivers/oneshot.cpp
@@ -14,7 +14,7 @@ Notes :
- Gun X range is 0x0000-0x01ff and gun Y range is 0x0000-0x00ff, so you
can shoot sometimes out of the "visible area" ... NOT A BUG !
- Player 1 and 2 guns do NOT use the same routine to determine the
- coordonates of an impact on the screen : position both guns in the
+ coordinates of an impact on the screen : position both guns in the
"upper left" corner in the "gun test" to see what I mean.
- I've assumed that the shot was right at the place the shot was made,
but I don't have any more information about that
@@ -39,6 +39,7 @@ NOTE: An eBay auction of the PCB shows "1996.9.16 PROMAT" on the JAMMA+ adapter
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "includes/oneshot.h"
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "sound/3812intf.h"
@@ -110,8 +111,8 @@ static ADDRESS_MAP_START( oneshot_map, AS_PROGRAM, 16, oneshot_state )
AM_RANGE(0x181000, 0x181fff) AM_RAM_WRITE(oneshot_fg_videoram_w) AM_SHARE("fg_videoram") // credits etc.
AM_RANGE(0x182000, 0x182fff) AM_RAM_WRITE(oneshot_bg_videoram_w) AM_SHARE("bg_videoram") // credits etc.
AM_RANGE(0x188000, 0x18800f) AM_WRITEONLY AM_SHARE("scroll") // scroll registers
- AM_RANGE(0x190002, 0x190003) AM_READ(soundlatch_word_r)
- AM_RANGE(0x190010, 0x190011) AM_WRITE(soundlatch_word_w)
+ AM_RANGE(0x190002, 0x190003) AM_DEVREAD8("soundlatch", generic_latch_8_device, read, 0x00ff)
+ AM_RANGE(0x190010, 0x190011) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x190018, 0x190019) AM_WRITE(soundbank_w)
AM_RANGE(0x190026, 0x190027) AM_READ(oneshot_gun_x_p1_r)
AM_RANGE(0x19002e, 0x19002f) AM_READ(oneshot_gun_x_p2_r)
@@ -126,7 +127,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( oneshot_sound_map, AS_PROGRAM, 8, oneshot_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x8000) AM_READWRITE(soundlatch_byte_r,soundlatch_byte_w)
+ AM_RANGE(0x8000, 0x8000) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write)
AM_RANGE(0x8001, 0x87ff) AM_RAM
AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write)
AM_RANGE(0xe010, 0xe010) AM_DEVREADWRITE("oki", okim6295_device, read, write)
@@ -377,6 +378,8 @@ static MACHINE_CONFIG_START( oneshot, oneshot_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, 3500000)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/onetwo.cpp b/src/mame/drivers/onetwo.cpp
index 363b98e85c7..c89629a8673 100644
--- a/src/mame/drivers/onetwo.cpp
+++ b/src/mame/drivers/onetwo.cpp
@@ -43,6 +43,7 @@ Note: this is quite clearly a 'Korean bootleg' of Shisensho - Joshiryo-Hen / Mat
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "sound/3812intf.h"
@@ -61,7 +62,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_watchdog(*this, "watchdog"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_paletteram;
@@ -77,6 +79,7 @@ public:
required_device<watchdog_timer_device> m_watchdog;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE8_MEMBER(onetwo_fgram_w);
DECLARE_WRITE8_MEMBER(onetwo_cpubank_w);
@@ -146,7 +149,7 @@ WRITE8_MEMBER(onetwo_state::onetwo_coin_counters_w)
WRITE8_MEMBER(onetwo_state::onetwo_soundlatch_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -199,7 +202,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_cpu, AS_PROGRAM, 8, onetwo_state )
AM_RANGE(0x0000, 0x5fff) 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)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_cpu_io, AS_IO, 8, onetwo_state )
@@ -207,7 +210,7 @@ static ADDRESS_MAP_START( sound_cpu_io, AS_IO, 8, onetwo_state )
AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ymsnd", ym3812_device, status_port_r, control_port_w)
AM_RANGE(0x20, 0x20) AM_DEVWRITE("ymsnd", ym3812_device, write_port_w)
AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0xc0, 0xc0) AM_WRITE(soundlatch_clear_byte_w)
+ AM_RANGE(0xc0, 0xc0) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
ADDRESS_MAP_END
/*************************************
@@ -380,6 +383,8 @@ static MACHINE_CONFIG_START( onetwo, onetwo_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, MASTER_CLOCK)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/othello.cpp b/src/mame/drivers/othello.cpp
index 82f8959a507..06cf16dbce4 100644
--- a/src/mame/drivers/othello.cpp
+++ b/src/mame/drivers/othello.cpp
@@ -16,7 +16,7 @@ CPU Board:
D8243 - I/O Expander for D7751C (8048 based)
Video Board:
- almost empty - 3/4 sodlering pins not populated
+ almost empty - 3/4 soldering pins not populated
@@ -40,6 +40,7 @@ Limit for help/undo (matta):
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/mcs48/mcs48.h"
+#include "machine/gen_latch.h"
#include "machine/i8243.h"
#include "sound/dac.h"
#include "sound/ay8910.h"
@@ -58,7 +59,8 @@ public:
m_maincpu(*this, "maincpu"),
m_ay1(*this, "ay1"),
m_ay2(*this, "ay2"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch")
{
}
@@ -83,6 +85,7 @@ public:
mc6845_device *m_mc6845;
device_t *m_n7751;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_READ8_MEMBER(unk_87_r);
DECLARE_WRITE8_MEMBER(unk_8a_w);
@@ -212,14 +215,14 @@ static ADDRESS_MAP_START( main_portmap, AS_IO, 8, othello_state )
AM_RANGE(0x87, 0x87) AM_READ(unk_87_r)
AM_RANGE(0x8a, 0x8a) AM_WRITE(unk_8a_w)
AM_RANGE(0x8c, 0x8c) AM_READWRITE(unk_8c_r, unk_8c_w)
- AM_RANGE(0x8d, 0x8d) AM_READWRITE(sound_ack_r, soundlatch_byte_w)
+ AM_RANGE(0x8d, 0x8d) AM_READ(sound_ack_r) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0x8f, 0x8f) AM_WRITE(unk_8f_w)
ADDRESS_MAP_END
READ8_MEMBER(othello_state::latch_r)
{
- int retval = soundlatch_byte_r(space, 0);
- soundlatch_clear_byte_w(space, 0, 0);
+ int retval = m_soundlatch->read(space, 0);
+ m_soundlatch->clear_w(space, 0, 0);
return retval;
}
@@ -434,6 +437,8 @@ static MACHINE_CONFIG_START( othello, othello_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.15)
diff --git a/src/mame/drivers/pass.cpp b/src/mame/drivers/pass.cpp
index dc4a83ef6b0..6177ecc7ff2 100644
--- a/src/mame/drivers/pass.cpp
+++ b/src/mame/drivers/pass.cpp
@@ -92,7 +92,7 @@
--- Game Notes ---
Graphical Glitches caused when 2 sprites are close together are NOT bugs, the Sprites are
- infact contructed from a tilemap made of 4x4 tiles.
+ infact constructed from a tilemap made of 4x4 tiles.
I imagine flicker on the main character at times is also correct.
@@ -104,6 +104,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/gen_latch.h"
#include "sound/2203intf.h"
#include "sound/okim6295.h"
#include "includes/pass.h"
@@ -116,7 +117,7 @@ static ADDRESS_MAP_START( pass_map, AS_PROGRAM, 16, pass_state )
AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(pass_bg_videoram_w) AM_SHARE("bg_videoram") // Background
AM_RANGE(0x210000, 0x213fff) AM_RAM_WRITE(pass_fg_videoram_w) AM_SHARE("fg_videoram") // Foreground
AM_RANGE(0x220000, 0x2203ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x230000, 0x230001) AM_WRITE(soundlatch_word_w)
+ AM_RANGE(0x230000, 0x230001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x230100, 0x230101) AM_READ_PORT("DSW")
AM_RANGE(0x230200, 0x230201) AM_READ_PORT("INPUTS")
ADDRESS_MAP_END
@@ -129,10 +130,10 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pass_sound_io_map, AS_IO, 8, pass_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(0x70, 0x71) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
AM_RANGE(0x80, 0x80) AM_DEVWRITE("oki", okim6295_device, write)
- AM_RANGE(0xc0, 0xc0) AM_WRITE(soundlatch_clear_byte_w)
+ AM_RANGE(0xc0, 0xc0) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
ADDRESS_MAP_END
/* todo : work out function of unknown but used dsw */
@@ -262,6 +263,8 @@ static MACHINE_CONFIG_START( pass, pass_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, 14318180/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
diff --git a/src/mame/drivers/pbaction.cpp b/src/mame/drivers/pbaction.cpp
index 626a2e690c4..824a7c8f698 100644
--- a/src/mame/drivers/pbaction.cpp
+++ b/src/mame/drivers/pbaction.cpp
@@ -38,7 +38,7 @@ Stephh's notes (based on the game Z80 code and some tests) :
- There is an ingame bug that prevents you to get a bonus life at 1000000 points
when you set the "Bonus Life" Dip Switch to "200k 1000k" :
- * Bonus life table index starts at 0x63c6 (8 * 2 butes, LSB first) :
+ * Bonus life table index starts at 0x63c6 (8 * 2 bites, LSB first) :
63C6: D6 63 "70k 200k" -> 04 07 03 02 01 10
63C8: DC 63 "70k 200k 1000k" -> 04 07 03 02 02 01 01 10
@@ -74,7 +74,7 @@ Stephh's notes (based on the game Z80 code and some tests) :
WRITE8_MEMBER(pbaction_state::pbaction_sh_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0x00);
}
@@ -109,7 +109,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pbaction_sound_map, AS_PROGRAM, 8, pbaction_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM
- AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x8000, 0x8000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xffff, 0xffff) AM_WRITENOP /* watchdog? */
ADDRESS_MAP_END
@@ -262,11 +262,13 @@ INTERRUPT_GEN_MEMBER(pbaction_state::pbaction_interrupt)
void pbaction_state::machine_start()
{
+ save_item(NAME(m_nmi_mask));
save_item(NAME(m_scroll));
}
void pbaction_state::machine_reset()
{
+ m_nmi_mask = 0;
m_scroll = 0;
}
@@ -306,6 +308,8 @@ static MACHINE_CONFIG_START( pbaction, pbaction_state )
/* sound 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.25)
diff --git a/src/mame/drivers/pitnrun.cpp b/src/mame/drivers/pitnrun.cpp
index 0ce750d583c..6c2d6d7565f 100644
--- a/src/mame/drivers/pitnrun.cpp
+++ b/src/mame/drivers/pitnrun.cpp
@@ -10,7 +10,7 @@ TODO:
- analog sound
writes to $a8xx triggering analog sound :
- $a800 - drivers are gettin into the cars
+ $a800 - drivers are getting into the cars
$a801 - collisions
$a802 - same as above
$a803 - slide on water
@@ -68,6 +68,7 @@ K1000233A
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/pitnrun.h"
@@ -107,7 +108,7 @@ static ADDRESS_MAP_START( pitnrun_map, AS_PROGRAM, 8, pitnrun_state )
AM_RANGE(0xb005, 0xb005) AM_WRITE(char_bank_select)
AM_RANGE(0xb006, 0xb006) AM_WRITE(hflip_w)
AM_RANGE(0xb007, 0xb007) AM_WRITE(vflip_w)
- AM_RANGE(0xb800, 0xb800) AM_READ_PORT("INPUTS") AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xb800, 0xb800) AM_READ_PORT("INPUTS") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xc800, 0xc801) AM_WRITE(scroll_w)
AM_RANGE(0xc802, 0xc802) AM_WRITENOP/* VP(VF?)MCV - not used ?*/
AM_RANGE(0xc804, 0xc804) AM_WRITE(mcu_data_w)
@@ -126,7 +127,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pitnrun_sound_io_map, AS_IO, 8, pitnrun_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_byte_w)
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
AM_RANGE(0x8c, 0x8d) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
AM_RANGE(0x8e, 0x8f) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
AM_RANGE(0x8f, 0x8f) AM_DEVREAD("ay1", ay8910_device, data_r)
@@ -253,14 +254,16 @@ static MACHINE_CONFIG_START( pitnrun, pitnrun_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/12) /* verified on pcb */
- MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
- MCFG_AY8910_PORT_B_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_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/12) /* verified on pcb */
- MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
- MCFG_AY8910_PORT_B_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_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/quizpun2.cpp b/src/mame/drivers/quizpun2.cpp
index 91743602a1d..eeaad4a06d4 100644
--- a/src/mame/drivers/quizpun2.cpp
+++ b/src/mame/drivers/quizpun2.cpp
@@ -7,7 +7,7 @@ Quiz Punch 2 (C)1989 Space Computer
Preliminary driver by Luca Elia
- It uses an unknown DIP40 device for protection, that supplies
- the address to jump to (same as mosaic.c) and handles the EEPROM
+ the address to jump to (same as mosaic.cpp) and handles the EEPROM
PCB Layout
----------
@@ -78,6 +78,7 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/2203intf.h"
@@ -100,7 +101,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") { }
struct prot_t m_prot;
required_shared_ptr<UINT8> m_fg_ram;
@@ -123,6 +125,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;
};
@@ -364,7 +367,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_irq_ack)
WRITE8_MEMBER(quizpun2_state::quizpun2_soundlatch_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -405,7 +408,7 @@ static ADDRESS_MAP_START( quizpun2_sound_io_map, AS_IO, 8, quizpun2_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE( 0x00, 0x00 ) AM_WRITENOP // IRQ end
AM_RANGE( 0x20, 0x20 ) AM_WRITENOP // NMI end
- AM_RANGE( 0x40, 0x40 ) AM_READ(soundlatch_byte_r )
+ AM_RANGE( 0x40, 0x40 ) AM_DEVREAD("soundlatch", generic_latch_8_device, read )
AM_RANGE( 0x60, 0x61 ) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write )
ADDRESS_MAP_END
@@ -524,6 +527,8 @@ static MACHINE_CONFIG_START( quizpun2, quizpun2_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_8MHz / 4 ) // 2 MHz?
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/renegade.cpp b/src/mame/drivers/renegade.cpp
index d3379c75062..c42ac577d1b 100644
--- a/src/mame/drivers/renegade.cpp
+++ b/src/mame/drivers/renegade.cpp
@@ -170,7 +170,7 @@ WRITE_LINE_MEMBER(renegade_state::adpcm_int)
WRITE8_MEMBER(renegade_state::sound_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE);
}
@@ -621,7 +621,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( renegade_sound_map, AS_PROGRAM, 8, renegade_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
- AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x1000, 0x1000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x1800, 0x1800) AM_WRITE(adpcm_start_w)
AM_RANGE(0x2000, 0x2000) AM_WRITE(adpcm_addr_w)
AM_RANGE(0x2800, 0x2801) AM_DEVREADWRITE("ymsnd", ym3526_device, read, write)
@@ -872,6 +872,8 @@ static MACHINE_CONFIG_START( renegade, renegade_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3526, 12000000/4)
MCFG_YM3526_IRQ_HANDLER(DEVWRITELINE("audiocpu", m6809_device, firq_line))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/retofinv.cpp b/src/mame/drivers/retofinv.cpp
index ae14e05be51..023d848dca6 100644
--- a/src/mame/drivers/retofinv.cpp
+++ b/src/mame/drivers/retofinv.cpp
@@ -91,7 +91,7 @@ READ8_MEMBER(retofinv_state::cpu0_mf800_r)
WRITE8_MEMBER(retofinv_state::soundcommand_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
@@ -161,7 +161,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, retofinv_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x2000, 0x27ff) AM_RAM
- AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x4000, 0x4000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x6000, 0x6000) AM_WRITE(cpu2_m6000_w)
AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("sn1", sn76496_device, write)
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("sn2", sn76496_device, write)
@@ -406,6 +406,8 @@ static MACHINE_CONFIG_START( retofinv, retofinv_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("sn1", SN76496, 18432000/6)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/drivers/rollrace.cpp b/src/mame/drivers/rollrace.cpp
index 9b7137cd9bc..a6af5eb7edc 100644
--- a/src/mame/drivers/rollrace.cpp
+++ b/src/mame/drivers/rollrace.cpp
@@ -11,6 +11,7 @@ Issues:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
#include "includes/rollrace.h"
@@ -59,7 +60,7 @@ static ADDRESS_MAP_START( rollrace_map, AS_PROGRAM, 8, rollrace_state )
AM_RANGE(0xd900, 0xd900) AM_READWRITE(fake_d800_r,fake_d800_w) /* protection ??*/
AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE("videoram")
AM_RANGE(0xe400, 0xe47f) AM_RAM AM_SHARE("colorram")
- AM_RANGE(0xe800, 0xe800) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0xe800, 0xe800) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xec00, 0xec0f) AM_NOP /* Analog sound effects ?? ec00 sound enable ?*/
AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xf400, 0xf400) AM_WRITE(backgroundcolor_w)
@@ -80,7 +81,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( rollrace_sound_map, AS_PROGRAM, 8, rollrace_state )
AM_RANGE(0x0000, 0x0fff) AM_ROM
AM_RANGE(0x2000, 0x2fff) AM_RAM
- AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(sound_nmi_mask_w)
+ AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(sound_nmi_mask_w)
AM_RANGE(0x4000, 0x4001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
AM_RANGE(0x5000, 0x5001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
@@ -263,6 +264,8 @@ static MACHINE_CONFIG_START( rollrace, rollrace_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910,XTAL_24MHz/16) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.10)
diff --git a/src/mame/drivers/roul.cpp b/src/mame/drivers/roul.cpp
index e6634a6aa41..2e6814b95cc 100644
--- a/src/mame/drivers/roul.cpp
+++ b/src/mame/drivers/roul.cpp
@@ -64,6 +64,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 "sound/ay8910.h"
#include "roul.lh"
#include "machine/nvram.h"
@@ -75,10 +76,12 @@ public:
roul_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_soundcpu(*this, "soundcpu") { }
+ m_soundcpu(*this, "soundcpu"),
+ m_soundlatch(*this, "soundlatch") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
+ required_device<generic_latch_8_device> m_soundlatch;
UINT8 m_reg[0x10];
std::unique_ptr<UINT8[]> m_videobuf;
@@ -180,7 +183,7 @@ WRITE8_MEMBER(roul_state::blitter_cmd_w)
WRITE8_MEMBER(roul_state::sound_latch_w)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_soundcpu->set_input_line(0, HOLD_LINE);
}
@@ -216,7 +219,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_cpu_io_map, AS_IO, 8, roul_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(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
ADDRESS_MAP_END
@@ -315,6 +318,9 @@ static MACHINE_CONFIG_START( roul, roul_state )
MCFG_PALETTE_INIT_OWNER(roul_state, roul)
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, 1000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/sauro.cpp b/src/mame/drivers/sauro.cpp
index 025bb01e388..46661a8cd2f 100644
--- a/src/mame/drivers/sauro.cpp
+++ b/src/mame/drivers/sauro.cpp
@@ -26,7 +26,7 @@ Ports:
20 R DSW #2
40 R Input Ports Player 1
60 R Input Ports Player 2
-80 W Sound Commnand
+80 W Sound Command
c0 W Flip Screen
c1 W ???
c2-c4 W ???
@@ -81,7 +81,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
- Press START1 while in "test mode" to cycle through different screens
(colors, Dip Switches, Inputs)
- When "Freeze" Dip Switch is ON, press START1 to freeze and START2 to unfreeze.
- This setting (as well as others) must be defined before reseting the games.
+ This setting (as well as others) must be defined before resetting the games.
- "Test mode" crashes when trying to display "Difficult" ("Hard") because the full string
is 15 bytes long while other string are 14, so the 15th "char" is NOT 0x00 :
* 0xd49f : mask (0x30)
@@ -95,7 +95,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
- Press START1 while in "test mode" to cycle through different screens
(colors, Dip Switches, Inputs)
- When "Freeze" Dip Switch is ON, press START1 to freeze and START2 to unfreeze.
- This setting (as well as others) must be defined before reseting the games.
+ This setting (as well as others) must be defined before resetting the games.
2a) 'trckydoc'
@@ -133,13 +133,13 @@ Stephh's notes (based on the games Z80 code and some tests) :
WRITE8_MEMBER(sauro_state::sauro_sound_command_w)
{
data |= 0x80;
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
}
READ8_MEMBER(sauro_state::sauro_sound_command_r)
{
- int ret = soundlatch_byte_r(space, offset);
- soundlatch_clear_byte_w(space, offset, 0);
+ int ret = m_soundlatch->read(space, offset);
+ m_soundlatch->clear_w(space, offset, 0);
return ret;
}
@@ -420,6 +420,8 @@ static MACHINE_CONFIG_DERIVED( sauro, tecfri )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(sauro_state, screen_update_sauro)
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("speech", SP0256, 3120000)
MCFG_SP0256_DATA_REQUEST_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/shadfrce.cpp b/src/mame/drivers/shadfrce.cpp
index 59757c5f073..434fb0f4184 100644
--- a/src/mame/drivers/shadfrce.cpp
+++ b/src/mame/drivers/shadfrce.cpp
@@ -260,7 +260,7 @@ WRITE16_MEMBER(shadfrce_state::sound_brt_w)
{
if (ACCESSING_BITS_8_15)
{
- soundlatch_byte_w(space, 1, data >> 8);
+ m_soundlatch->write(space, 1, data >> 8);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
}
else
@@ -396,7 +396,7 @@ static ADDRESS_MAP_START( shadfrce_sound_map, AS_PROGRAM, 8, shadfrce_state )
AM_RANGE(0xc000, 0xc7ff) AM_RAM
AM_RANGE(0xc800, 0xc801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xd800, 0xd800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xe800, 0xe800) AM_WRITE(oki_bankswitch_w)
AM_RANGE(0xf000, 0xffff) AM_RAM
ADDRESS_MAP_END
@@ -562,6 +562,8 @@ static MACHINE_CONFIG_START( shadfrce, shadfrce_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
diff --git a/src/mame/drivers/sliver.cpp b/src/mame/drivers/sliver.cpp
index db675b6ab99..8deb646d3e6 100644
--- a/src/mame/drivers/sliver.cpp
+++ b/src/mame/drivers/sliver.cpp
@@ -66,6 +66,7 @@ Notes:
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "cpu/mcs51/mcs51.h"
#include "video/ramdac.h"
@@ -84,9 +85,10 @@ public:
sliver_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_colorram(*this, "colorram"),
m_audiocpu(*this, "audiocpu"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch"),
+ m_colorram(*this, "colorram") { }
UINT16 m_io_offset;
UINT16 m_io_reg[IO_SIZE];
@@ -101,6 +103,9 @@ public:
int m_clr_offset;
required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<screen_device> m_screen;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_colorram;
bitmap_rgb32 m_bitmap_fg;
bitmap_rgb32 m_bitmap_bg;
@@ -123,8 +128,6 @@ public:
void plot_pixel_pal(int x, int y, int addr);
void blit_gfx();
void render_jpeg();
- required_device<cpu_device> m_audiocpu;
- required_device<screen_device> m_screen;
};
void sliver_state::plot_pixel_rgb(int x, int y, UINT32 r, UINT32 g, UINT32 b)
@@ -316,7 +319,7 @@ WRITE16_MEMBER(sliver_state::io_data_w)
WRITE16_MEMBER(sliver_state::sound_w)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(MCS51_INT0_LINE, HOLD_LINE);
}
@@ -363,7 +366,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( soundmem_io, AS_IO, 8, sliver_state )
AM_RANGE(0x0100, 0x0100) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x0101, 0x0101) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x0101, 0x0101) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
/* ports */
AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_WRITE(oki_setbank )
ADDRESS_MAP_END
@@ -486,6 +489,8 @@ static MACHINE_CONFIG_START( sliver, sliver_state )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_OKIM6295_ADD("oki", 1000000, OKIM6295_PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.6)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.6)
diff --git a/src/mame/drivers/snowbros.cpp b/src/mame/drivers/snowbros.cpp
index 0133c266302..48e763e179f 100644
--- a/src/mame/drivers/snowbros.cpp
+++ b/src/mame/drivers/snowbros.cpp
@@ -65,7 +65,7 @@ out of the sprite list at that point.. (verify on real hw)
Ma Cheon Ru
-The electrified maze + ball minigame appears unreponsive to controls, this
+The electrified maze + ball minigame appears unresponsive to controls, this
is because it actually requires you to move the joysticks in a circular
motion through all 8 directions at a very even speed, a task which is
practically impossible to perform on keyboard, and not even that easy with
@@ -80,7 +80,6 @@ a joystick. This is not an emulation bug.
#include "cpu/z80/z80.h"
#include "sound/2151intf.h"
#include "sound/3812intf.h"
-#include "sound/okim6295.h"
#include "cpu/mcs51/mcs51.h" // for semicom mcu
#include "machine/watchdog.h"
@@ -179,7 +178,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros3_irq)
READ16_MEMBER(snowbros_state::snowbros_68000_sound_r)
{
- return soundlatch_byte_r(space,offset);
+ return m_soundlatch->read(space,offset);
}
@@ -187,14 +186,14 @@ WRITE16_MEMBER(snowbros_state::snowbros_68000_sound_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
WRITE16_MEMBER(snowbros_state::semicom_soundcmd_w)
{
- if (ACCESSING_BITS_0_7) soundlatch_byte_w(space,0,data & 0xff);
+ if (ACCESSING_BITS_0_7) m_soundlatch->write(space,0,data & 0xff);
}
READ16_MEMBER(snowbros_state::toto_read)
@@ -230,7 +229,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, snowbros_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write)
- AM_RANGE(0x04, 0x04) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w) /* goes back to the main CPU, checked during boot */
+ AM_RANGE(0x04, 0x04) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write) /* goes back to the main CPU, checked during boot */
ADDRESS_MAP_END
@@ -331,7 +330,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( honeydol_sound_io_map, AS_IO, 8, snowbros_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) // not connected?
- AM_RANGE(0x04, 0x04) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w) /* goes back to the main CPU, checked during boot */
+ AM_RANGE(0x04, 0x04) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write) /* goes back to the main CPU, checked during boot */
ADDRESS_MAP_END
/* Twin Adventure */
@@ -340,7 +339,7 @@ WRITE16_MEMBER(snowbros_state::twinadv_68000_sound_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -373,7 +372,7 @@ WRITE8_MEMBER(snowbros_state::twinadv_oki_bank_w)
static ADDRESS_MAP_START( twinadv_sound_io_map, AS_IO, 8, snowbros_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x02, 0x02) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w) // back to 68k?
+ AM_RANGE(0x02, 0x02) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write) // back to 68k?
AM_RANGE(0x04, 0x04) AM_WRITE(twinadv_oki_bank_w) // oki bank?
AM_RANGE(0x06, 0x06) AM_DEVREADWRITE("oki", okim6295_device, read, write)
ADDRESS_MAP_END
@@ -407,7 +406,7 @@ static ADDRESS_MAP_START( hyperpac_sound_map, AS_PROGRAM, 8, snowbros_state )
AM_RANGE(0xd000, 0xd7ff) AM_RAM
AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xf008, 0xf008) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( hyperpac_sound_io_map, AS_IO, 8, snowbros_state )
@@ -1684,6 +1683,8 @@ static MACHINE_CONFIG_START( snowbros, snowbros_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4) /* 3 MHz - confirmed */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -1774,7 +1775,7 @@ static MACHINE_CONFIG_START( honeydol, snowbros_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- /* sound hardware */
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4) /* 3Mhz */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
@@ -1814,6 +1815,8 @@ static MACHINE_CONFIG_START( twinadv, snowbros_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
/* sound hardware */
MCFG_OKIM6295_ADD("oki", XTAL_16MHz/16, OKIM6295_PIN7_HIGH) /* freq? */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/solomon.cpp b/src/mame/drivers/solomon.cpp
index 26de2ecfbb8..c4a9345de87 100644
--- a/src/mame/drivers/solomon.cpp
+++ b/src/mame/drivers/solomon.cpp
@@ -15,7 +15,7 @@ driver by Mirko Buffoni
WRITE8_MEMBER(solomon_state::solomon_sh_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -70,7 +70,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, solomon_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM
- AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x8000, 0x8000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xffff, 0xffff) AM_WRITENOP /* watchdog? */
ADDRESS_MAP_END
@@ -231,6 +231,8 @@ static MACHINE_CONFIG_START( solomon, solomon_state )
/* sound 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/sothello.cpp b/src/mame/drivers/sothello.cpp
index c72767f767b..0fce4532fed 100644
--- a/src/mame/drivers/sothello.cpp
+++ b/src/mame/drivers/sothello.cpp
@@ -39,6 +39,7 @@ OSC : 8.0000MHz(X1) 21.477 MHz(X2) 384kHz(X3)
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h"
+#include "machine/gen_latch.h"
#include "sound/2203intf.h"
#include "sound/msm5205.h"
#include "video/v9938.h"
@@ -174,7 +175,7 @@ static ADDRESS_MAP_START( maincpu_io_map, AS_IO, 8, sothello_state )
AM_RANGE( 0x31, 0x31) AM_READ(subcpu_halt_clear)
AM_RANGE( 0x32, 0x32) AM_READ(subcpu_comm_status)
AM_RANGE( 0x33, 0x33) AM_READ(soundcpu_status_r)
- AM_RANGE( 0x40, 0x4f) AM_WRITE(soundlatch_byte_w)
+ AM_RANGE( 0x40, 0x4f) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE( 0x50, 0x50) AM_WRITE(bank_w)
AM_RANGE( 0x60, 0x61) AM_MIRROR(0x02) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
/* not sure, but the A1 line is ignored, code @ $8b8 */
@@ -223,7 +224,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( soundcpu_io_map, AS_IO, 8, sothello_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(0x01, 0x01) AM_WRITE(msm_data_w)
AM_RANGE(0x02, 0x02) AM_WRITE(msm_cfg_w)
AM_RANGE(0x03, 0x03) AM_WRITE(soundcpu_busyflag_set_w)
@@ -372,6 +373,9 @@ static MACHINE_CONFIG_START( sothello, sothello_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, YM_CLOCK)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(sothello_state, irqhandler))
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
diff --git a/src/mame/drivers/spbactn.cpp b/src/mame/drivers/spbactn.cpp
index 80adbabc79b..4ba2a0a2b8b 100644
--- a/src/mame/drivers/spbactn.cpp
+++ b/src/mame/drivers/spbactn.cpp
@@ -9,8 +9,8 @@
-general info-------------------------------------------------------------------
A Pinball Game from Tecmo, the Hardware seems to be somewhere between that used
- for Tecmo's classic game Ninja Gaiden (see gaiden.c) and that used in Comad's
- Gals Pinball (see galspnbl.c) I imagine Comad took the hardware that this uses
+ for Tecmo's classic game Ninja Gaiden (see gaiden.cpp) and that used in Comad's
+ Gals Pinball (see galspnbl.cpp) I imagine Comad took the hardware that this uses
as a basis for writing their game on, adding a couple of features such as the
pixel layer.
@@ -45,7 +45,7 @@ The manual defines the controls as 4 push buttons:
a-u19 - Samples (27c1001)
- 1 custom chip (u94, surface scrached)
+ 1 custom chip (u94, surface scratched)
------
9002-B
@@ -61,9 +61,9 @@ The manual defines the controls as 4 push buttons:
b-u111 /
Custom chips:
- U101, U102, U106, U107: surface scrached
+ U101, U102, U106, U107: surface scratched
probably 2 pairs of TECMO-3&4
- U133: surface scrached
+ U133: surface scratched
probably TECMO-6
U112: TECMO-5
@@ -82,11 +82,10 @@ The manual defines the controls as 4 push buttons:
lev 6 : 0x78 : 0000 1ab2 - writes to 90031
lev 7 : 0x7c : ffff ffff - invalid
-TODO : (also check the notes from the galspnbl.c driver)
+TODO : (also check the notes from the galspnbl.cpp driver)
- coin insertion is not recognized consistently.
- - rewrite video, do single pass sprite render, move sprite code to device, share with gaiden.c etc.
- - convert to tilemaps
+ - convert to tilemaps
- all the unknown regs
@@ -144,7 +143,7 @@ WRITE16_MEMBER(spbactn_state::soundcommand_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -227,7 +226,7 @@ static ADDRESS_MAP_START( spbactn_sound_map, AS_PROGRAM, 8, spbactn_state )
AM_RANGE(0xf810, 0xf811) AM_DEVWRITE("ymsnd", ym3812_device, write)
AM_RANGE(0xfc00, 0xfc00) AM_READNOP AM_WRITENOP /* irq ack ?? */
- AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xfc20, 0xfc20) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -439,6 +438,8 @@ static MACHINE_CONFIG_START( spbactn, spbactn_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) /* Was 3.579545MHz, a common clock, but no way to generate via on PCB OSCs */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -490,6 +491,8 @@ static MACHINE_CONFIG_START( spbactnp, spbactn_state )
/* sound hardware - different? */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/spcforce.cpp b/src/mame/drivers/spcforce.cpp
index e6fb1fd93be..9e1d05d49f1 100644
--- a/src/mame/drivers/spcforce.cpp
+++ b/src/mame/drivers/spcforce.cpp
@@ -38,6 +38,7 @@ TODO:
#include "emu.h"
#include "cpu/i8085/i8085.h"
#include "cpu/mcs48/mcs48.h"
+#include "machine/gen_latch.h"
#include "includes/spcforce.h"
void spcforce_state::machine_start()
@@ -108,7 +109,7 @@ WRITE8_MEMBER(spcforce_state::irq_mask_w)
static ADDRESS_MAP_START( spcforce_map, AS_PROGRAM, 8, spcforce_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x43ff) AM_RAM
- AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW") AM_WRITE(soundlatch_byte_w)
+ AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0x7001, 0x7001) AM_READ_PORT("P1") AM_WRITE(soundtrigger_w)
AM_RANGE(0x7002, 0x7002) AM_READ_PORT("P2")
AM_RANGE(0x700b, 0x700b) AM_WRITE(flip_screen_w)
@@ -131,7 +132,7 @@ static ADDRESS_MAP_START( spcforce_sound_map, AS_PROGRAM, 8, spcforce_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( spcforce_sound_io_map, AS_IO, 8, spcforce_state )
- AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(soundlatch_byte_r)
+ AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(SN76496_latch_w)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(SN76496_select_r, SN76496_select_w)
AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(t0_r)
@@ -304,6 +305,8 @@ static MACHINE_CONFIG_START( spcforce, spcforce_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("sn1", SN76496, 2000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SN76496_READY_HANDLER(WRITELINE(spcforce_state, write_sn1_ready))
diff --git a/src/mame/drivers/spdodgeb.cpp b/src/mame/drivers/spdodgeb.cpp
index fea4bbb66ab..66dc17c3f38 100644
--- a/src/mame/drivers/spdodgeb.cpp
+++ b/src/mame/drivers/spdodgeb.cpp
@@ -32,7 +32,7 @@ Notes:
WRITE8_MEMBER(spdodgeb_state::sound_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE);
}
@@ -259,7 +259,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( spdodgeb_sound_map, AS_PROGRAM, 8, spdodgeb_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
- AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x1000, 0x1000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x2800, 0x2801) AM_DEVWRITE("ymsnd", ym3812_device, write)
AM_RANGE(0x3800, 0x3807) AM_WRITE(spd_adpcm_w)
AM_RANGE(0x8000, 0xffff) AM_ROM
@@ -430,6 +430,8 @@ static MACHINE_CONFIG_START( spdodgeb, spdodgeb_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
diff --git a/src/mame/drivers/speedspn.cpp b/src/mame/drivers/speedspn.cpp
index edbe1899df6..7fe4e785821 100644
--- a/src/mame/drivers/speedspn.cpp
+++ b/src/mame/drivers/speedspn.cpp
@@ -23,7 +23,6 @@ TODO:
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "sound/okim6295.h"
#include "includes/speedspn.h"
/*** README INFO **************************************************************
@@ -77,7 +76,7 @@ WRITE8_MEMBER(speedspn_state::rombank_w)
WRITE8_MEMBER(speedspn_state::sound_w)
{
- soundlatch_byte_w(space, 1, data);
+ m_soundlatch->write(space, 1, data);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
@@ -120,7 +119,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, speedspn_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
static ADDRESS_MAP_START( oki_map, AS_0, 8, speedspn_state )
@@ -301,6 +300,8 @@ static MACHINE_CONFIG_START( speedspn, speedspn_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_OKIM6295_ADD("oki", 1122000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map)
diff --git a/src/mame/drivers/ssozumo.cpp b/src/mame/drivers/ssozumo.cpp
index 470d92d6cf2..1f13c6b6138 100644
--- a/src/mame/drivers/ssozumo.cpp
+++ b/src/mame/drivers/ssozumo.cpp
@@ -24,7 +24,7 @@ void ssozumo_state::machine_start()
WRITE8_MEMBER(ssozumo_state::sh_command_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
}
@@ -60,7 +60,7 @@ static ADDRESS_MAP_START( ssozumo_sound_map, AS_PROGRAM, 8, ssozumo_state )
AM_RANGE(0x2002, 0x2003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_device, write_signed8)
AM_RANGE(0x2005, 0x2005) AM_WRITE(sound_nmi_mask_w)
- AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x2007, 0x2007) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -220,6 +220,8 @@ static MACHINE_CONFIG_START( ssozumo, ssozumo_state )
/* sound 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.30)
diff --git a/src/mame/drivers/stuntair.cpp b/src/mame/drivers/stuntair.cpp
index 749416a13c5..dbe817727f2 100644
--- a/src/mame/drivers/stuntair.cpp
+++ b/src/mame/drivers/stuntair.cpp
@@ -81,6 +81,7 @@ Bprom dump by f205v
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
class stuntair_state : public driver_device
@@ -95,7 +96,8 @@ public:
m_bgattrram(*this, "bgattrram"),
m_sprram(*this, "sprram"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch")
{ }
required_device<cpu_device> m_maincpu;
@@ -106,6 +108,7 @@ public:
required_shared_ptr<UINT8> m_sprram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
@@ -303,7 +306,7 @@ WRITE8_MEMBER(stuntair_state::stuntair_coin_w)
WRITE8_MEMBER(stuntair_state::stuntair_sound_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -531,8 +534,10 @@ static MACHINE_CONFIG_START( stuntair, stuntair_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono") // stereo?
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/12)
- 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(stuntair_state, ay8910_portb_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
diff --git a/src/mame/drivers/suprslam.cpp b/src/mame/drivers/suprslam.cpp
index 20fd606a1f9..94a5a675a7c 100644
--- a/src/mame/drivers/suprslam.cpp
+++ b/src/mame/drivers/suprslam.cpp
@@ -98,7 +98,7 @@ WRITE16_MEMBER(suprslam_state::sound_command_w)
if (ACCESSING_BITS_0_7)
{
m_pending_command = 1;
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -153,7 +153,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, suprslam_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(suprslam_sh_bankswitch_w)
- AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w)
+ AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(pending_command_clear_w)
AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
ADDRESS_MAP_END
@@ -333,6 +333,8 @@ static MACHINE_CONFIG_START( suprslam, suprslam_state )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(suprslam_state, irqhandler))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
diff --git a/src/mame/drivers/tagteam.cpp b/src/mame/drivers/tagteam.cpp
index 520aaf9c623..dab1d7a459c 100644
--- a/src/mame/drivers/tagteam.cpp
+++ b/src/mame/drivers/tagteam.cpp
@@ -40,7 +40,7 @@ void tagteam_state::machine_start()
WRITE8_MEMBER(tagteam_state::sound_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
}
@@ -75,7 +75,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, tagteam_state )
AM_RANGE(0x2002, 0x2003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_device, write_unsigned8)
AM_RANGE(0x2005, 0x2005) AM_WRITE(sound_nmi_mask_w)
- AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x2007, 0x2007) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -236,6 +236,8 @@ static MACHINE_CONFIG_START( tagteam, tagteam_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)
diff --git a/src/mame/drivers/tail2nos.cpp b/src/mame/drivers/tail2nos.cpp
index 7a327e589a8..880cf4d188c 100644
--- a/src/mame/drivers/tail2nos.cpp
+++ b/src/mame/drivers/tail2nos.cpp
@@ -22,7 +22,7 @@ WRITE16_MEMBER(tail2nos_state::sound_command_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -57,7 +57,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, tail2nos_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x07, 0x07) AM_READ(soundlatch_byte_r) AM_WRITENOP /* the write is a clear pending command */
+ AM_RANGE(0x07, 0x07) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITENOP /* the write is a clear pending command */
AM_RANGE(0x08, 0x0b) AM_DEVWRITE("ymsnd", ym2608_device, write)
#if 0
AM_RANGE(0x18, 0x1b) AM_DEVREAD("ymsnd", ym2608_device, read)
@@ -236,6 +236,8 @@ static MACHINE_CONFIG_START( tail2nos, tail2nos_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2608, XTAL_8MHz) /* verified on pcb */
MCFG_YM2608_IRQ_HANDLER(WRITELINE(tail2nos_state, irqhandler))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(tail2nos_state, sound_bankswitch_w))
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp
index 409722d8c45..6cab7901b66 100644
--- a/src/mame/drivers/taitosj.cpp
+++ b/src/mame/drivers/taitosj.cpp
@@ -92,7 +92,7 @@ Address Dir Data Name Description
although bioatack and spaceskr do initialise the second bank.
[2] Priority is controlled by a 256x4 PROM.
- Bits 0-3 of PRY go to A4-A7 of the PROM, bit 4 selectes D0-D1 or D2-D3.
+ Bits 0-3 of PRY go to A4-A7 of the PROM, bit 4 selects D0-D1 or D2-D3.
A0-A3 of the PROM is fed with a mask of the inactive planes in the order
OBJ-SCN1-SCN2-SCN3. The 2-bit code which comes out from the PROM selects
the plane to display.
@@ -170,7 +170,6 @@ TODO:
#include "cpu/m6805/m6805.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
-#include "sound/dac.h"
#include "includes/taitosj.h"
@@ -181,7 +180,7 @@ WRITE8_MEMBER(taitosj_state::taitosj_sndnmi_msk_w)
WRITE8_MEMBER(taitosj_state::taitosj_soundcommand_w)
{
- soundlatch_byte_w(space,offset,data);
+ m_soundlatch->write(space,offset,data);
if (!m_sndnmi_disable) m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -347,7 +346,7 @@ static ADDRESS_MAP_START( taitosj_audio_map, AS_PROGRAM, 8, taitosj_state )
AM_RANGE(0x4803, 0x4803) AM_DEVREAD("ay3", ay8910_device, data_r)
AM_RANGE(0x4804, 0x4805) AM_DEVWRITE("ay4", ay8910_device, address_data_w)
AM_RANGE(0x4805, 0x4805) AM_DEVREAD("ay4", ay8910_device, data_r)
- AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x5000, 0x5000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostic ROM */
ADDRESS_MAP_END
@@ -1776,6 +1775,8 @@ static MACHINE_CONFIG_START( nomcu, taitosj_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 6000000/4)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3"))
diff --git a/src/mame/drivers/taotaido.cpp b/src/mame/drivers/taotaido.cpp
index f977e8beb69..a0b9c4c572f 100644
--- a/src/mame/drivers/taotaido.cpp
+++ b/src/mame/drivers/taotaido.cpp
@@ -94,7 +94,7 @@ WRITE16_MEMBER(taotaido_state::sound_command_w)
if (ACCESSING_BITS_0_7)
{
m_pending_command = 1;
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -148,7 +148,7 @@ static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, taotaido_state )
AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
AM_RANGE(0x04, 0x04) AM_WRITE(sh_bankswitch_w)
AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w)
- AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x0c, 0x0c) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -391,6 +391,8 @@ static MACHINE_CONFIG_START( taotaido, taotaido_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
diff --git a/src/mame/drivers/tatsumi.cpp b/src/mame/drivers/tatsumi.cpp
index 6d3056d6e77..163a8987db3 100644
--- a/src/mame/drivers/tatsumi.cpp
+++ b/src/mame/drivers/tatsumi.cpp
@@ -142,10 +142,8 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/nec/nec.h"
-#include "cpu/m68000/m68000.h"
#include "includes/tatsumi.h"
#include "sound/2151intf.h"
-#include "sound/okim6295.h"
#include "machine/nvram.h"
#include "roundup5.lh"
@@ -184,7 +182,7 @@ WRITE16_MEMBER(tatsumi_state::bigfight_a60000_w)
WRITE16_MEMBER(tatsumi_state::cyclwarr_sound_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);
}
@@ -334,7 +332,7 @@ static ADDRESS_MAP_START( cyclwarr_z80_map, AS_PROGRAM, 8, tatsumi_state )
AM_RANGE(0xe000, 0xffef) AM_RAM
AM_RANGE(0xfff0, 0xfff1) AM_READ(tatsumi_hack_ym2151_r) AM_DEVWRITE("ymsnd", ym2151_device, write)
AM_RANGE(0xfff4, 0xfff4) AM_READ(tatsumi_hack_oki_r) AM_DEVWRITE("oki", okim6295_device, write)
- AM_RANGE(0xfffc, 0xfffc) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xfffc, 0xfffc) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xfffe, 0xfffe) AM_WRITENOP
ADDRESS_MAP_END
@@ -992,6 +990,8 @@ static MACHINE_CONFIG_START( cyclwarr, tatsumi_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", CLOCK_1 / 4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_IRQ0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
@@ -1035,6 +1035,8 @@ static MACHINE_CONFIG_START( bigfight, tatsumi_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", CLOCK_1 / 4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_IRQ0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
diff --git a/src/mame/drivers/tbowl.cpp b/src/mame/drivers/tbowl.cpp
index 4f6a062eb3a..badd259b005 100644
--- a/src/mame/drivers/tbowl.cpp
+++ b/src/mame/drivers/tbowl.cpp
@@ -17,7 +17,6 @@ Might be some priority glitches
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/3812intf.h"
-#include "sound/msm5205.h"
#include "rendlay.h"
#include "includes/tbowl.h"
@@ -29,7 +28,7 @@ WRITE8_MEMBER(tbowl_state::coincounter_w)
/*** Banking
-note: check this, its borrowed from tecmo.c / wc90.c at the moment and could well be wrong
+note: check this, its borrowed from tecmo.cpp / wc90.cpp at the moment and could well be wrong
***/
@@ -49,7 +48,7 @@ WRITE8_MEMBER(tbowl_state::boardc_bankswitch_w)
WRITE8_MEMBER(tbowl_state::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);
}
@@ -180,7 +179,7 @@ static ADDRESS_MAP_START( 6206A_map, AS_PROGRAM, 8, tbowl_state )
AM_RANGE(0xe004, 0xe005) AM_WRITE(adpcm_vol_w)
AM_RANGE(0xe006, 0xe006) AM_WRITENOP
AM_RANGE(0xe007, 0xe007) AM_WRITENOP /* NMI acknowledge */
- AM_RANGE(0xe010, 0xe010) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xe010, 0xe010) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
/*** Input Ports
@@ -481,6 +480,8 @@ static MACHINE_CONFIG_START( tbowl, tbowl_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM3812, 4000000)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/drivers/tecmo.cpp b/src/mame/drivers/tecmo.cpp
index 199423116b5..44bdc809e11 100644
--- a/src/mame/drivers/tecmo.cpp
+++ b/src/mame/drivers/tecmo.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Nicola Salmoria
/***************************************************************************
-tecmo.c
+tecmo.cpp
driver by Nicola Salmoria
@@ -64,7 +64,7 @@ WRITE8_MEMBER(tecmo_state::bankswitch_w)
WRITE8_MEMBER(tecmo_state::sound_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_soundcpu->set_input_line(INPUT_LINE_NMI,ASSERT_LINE);
}
@@ -227,7 +227,7 @@ static ADDRESS_MAP_START( rygar_sound_map, AS_PROGRAM, 8, tecmo_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM
AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ymsnd", ym3812_device, write)
- AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) AM_WRITE(adpcm_start_w)
+ AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(adpcm_start_w)
AM_RANGE(0xd000, 0xd000) AM_WRITE(adpcm_end_w)
AM_RANGE(0xe000, 0xe000) AM_WRITE(adpcm_vol_w)
AM_RANGE(0xf000, 0xf000) AM_WRITE(nmi_ack_w)
@@ -239,7 +239,7 @@ static ADDRESS_MAP_START( tecmo_sound_map, AS_PROGRAM, 8, tecmo_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ymsnd", ym3812_device, write)
- AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) AM_WRITE(adpcm_start_w)
+ AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(adpcm_start_w)
AM_RANGE(0xc400, 0xc400) AM_WRITE(adpcm_end_w)
AM_RANGE(0xc800, 0xc800) AM_WRITE(adpcm_vol_w)
AM_RANGE(0xcc00, 0xcc00) AM_WRITE(nmi_ack_w)
@@ -644,6 +644,8 @@ static MACHINE_CONFIG_START( rygar, tecmo_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) /* verified on pcb */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/tecmo16.cpp b/src/mame/drivers/tecmo16.cpp
index 820de48507a..dd1c30d5f70 100644
--- a/src/mame/drivers/tecmo16.cpp
+++ b/src/mame/drivers/tecmo16.cpp
@@ -38,7 +38,7 @@ WRITE16_MEMBER(tecmo16_state::sound_command_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, 0x00, data & 0xff);
+ m_soundlatch->write(space, 0x00, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -98,7 +98,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, tecmo16_state )
AM_RANGE(0xf000, 0xfbff) AM_RAM /* Sound RAM */
AM_RANGE(0xfc00, 0xfc00) AM_DEVREADWRITE("oki", okim6295_device, read, write)
AM_RANGE(0xfc04, 0xfc05) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE(0xfc08, 0xfc08) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xfc08, 0xfc08) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xfc0c, 0xfc0c) AM_NOP
AM_RANGE(0xfffe, 0xffff) AM_RAM
ADDRESS_MAP_END
@@ -404,6 +404,8 @@ static MACHINE_CONFIG_START( fstarfrc, tecmo16_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", MASTER_CLOCK/6) // 4 MHz
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
diff --git a/src/mame/drivers/tecmosys.cpp b/src/mame/drivers/tecmosys.cpp
index c6d687469a2..3a4edcdfabb 100644
--- a/src/mame/drivers/tecmosys.cpp
+++ b/src/mame/drivers/tecmosys.cpp
@@ -20,7 +20,7 @@ T.Slanina 20040530 :
20080528
- Removed ROM patches and debug keypresses
- - Added protection simulation in machine/tecmosys.c
+ - Added protection simulation in machine/tecmosys.cpp
- Fixed inputs
- Added watchdog
@@ -184,7 +184,6 @@ ae500w07.ad1 - M6295 Samples (23c4001)
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "machine/eepromser.h"
#include "includes/tecmosys.h"
#include "cpu/m68000/m68000.h"
#include "sound/okim6295.h"
@@ -198,7 +197,7 @@ READ16_MEMBER(tecmosys_state::sound_r)
if (ACCESSING_BITS_0_7)
{
machine().scheduler().synchronize();
- return soundlatch2_byte_r(space, 0 );
+ return m_soundlatch2->read(space, 0);
}
return 0;
@@ -209,7 +208,7 @@ WRITE16_MEMBER(tecmosys_state::sound_w)
if (ACCESSING_BITS_0_7)
{
machine().scheduler().synchronize();
- soundlatch_byte_w(space, 0x00, data & 0xff);
+ m_soundlatch->write(space, 0x00, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -351,8 +350,8 @@ static ADDRESS_MAP_START( io_map, AS_IO, 8, tecmosys_state )
AM_RANGE(0x10, 0x10) AM_DEVREADWRITE("oki", okim6295_device, read, write)
AM_RANGE(0x20, 0x20) AM_WRITE(oki_bank_w)
AM_RANGE(0x30, 0x30) AM_WRITE(z80_bank_w)
- AM_RANGE(0x40, 0x40) AM_READ(soundlatch_byte_r)
- AM_RANGE(0x50, 0x50) AM_WRITE(soundlatch2_byte_w)
+ AM_RANGE(0x40, 0x40) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ AM_RANGE(0x50, 0x50) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
AM_RANGE(0x60, 0x61) AM_DEVREADWRITE("ymz", ymz280b_device, read, write)
ADDRESS_MAP_END
@@ -482,6 +481,9 @@ static MACHINE_CONFIG_START( deroon, tecmosys_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+
MCFG_SOUND_ADD("ymf", YMF262, XTAL_14_31818MHz)
MCFG_YMF262_IRQ_HANDLER(WRITELINE(tecmosys_state, sound_irq))
MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
diff --git a/src/mame/drivers/tehkanwc.cpp b/src/mame/drivers/tehkanwc.cpp
index 9bf4a47e329..0d934c8215e 100644
--- a/src/mame/drivers/tehkanwc.cpp
+++ b/src/mame/drivers/tehkanwc.cpp
@@ -151,7 +151,7 @@ WRITE8_MEMBER(tehkanwc_state::track_1_reset_w)
WRITE8_MEMBER(tehkanwc_state::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);
}
@@ -169,7 +169,7 @@ void tehkanwc_state::device_timer(emu_timer &timer, device_timer_id id, int para
WRITE8_MEMBER(tehkanwc_state::sound_answer_w)
{
- soundlatch2_byte_w(space, 0, data);
+ m_soundlatch2->write(space, 0, data);
/* in Gridiron, the sound CPU goes in a tight loop after the self test, */
/* probably waiting to be reset by a watchdog */
@@ -244,7 +244,7 @@ static ADDRESS_MAP_START( main_mem, AS_PROGRAM, 8, tehkanwc_state )
AM_RANGE(0xf810, 0xf811) AM_READWRITE(track_1_r, track_1_reset_w) /* track 1 x/y */
AM_RANGE(0xf812, 0xf812) AM_WRITE(gridiron_led1_w)
AM_RANGE(0xf813, 0xf813) AM_READ_PORT("P2BUT")
- AM_RANGE(0xf820, 0xf820) AM_READ(soundlatch2_byte_r) AM_WRITE(sound_command_w) /* answer from the sound CPU */
+ AM_RANGE(0xf820, 0xf820) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) AM_WRITE(sound_command_w) /* answer from the sound CPU */
AM_RANGE(0xf840, 0xf840) AM_READ_PORT("DSW1") AM_WRITE(sub_cpu_halt_w)
AM_RANGE(0xf850, 0xf850) AM_READ_PORT("DSW2") AM_WRITENOP /* ?? writes 0x00 or 0xff */
AM_RANGE(0xf860, 0xf860) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(flipscreen_x_w)
@@ -272,7 +272,7 @@ static ADDRESS_MAP_START( sound_mem, AS_PROGRAM, 8, tehkanwc_state )
AM_RANGE(0x8001, 0x8001) AM_WRITE(msm_reset_w)/* MSM51xx reset */
AM_RANGE(0x8002, 0x8002) AM_WRITENOP /* ?? written in the IRQ handler */
AM_RANGE(0x8003, 0x8003) AM_WRITENOP /* ?? written in the NMI handler */
- AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) AM_WRITE(sound_answer_w)
+ AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(sound_answer_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_port, AS_IO, 8, tehkanwc_state )
@@ -662,6 +662,9 @@ static MACHINE_CONFIG_START( tehkanwc, tehkanwc_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, 1536000)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(tehkanwc_state, portA_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(tehkanwc_state, portB_w))
diff --git a/src/mame/drivers/thedeep.cpp b/src/mame/drivers/thedeep.cpp
index 12e4926c632..127898f370d 100644
--- a/src/mame/drivers/thedeep.cpp
+++ b/src/mame/drivers/thedeep.cpp
@@ -47,7 +47,7 @@ WRITE8_MEMBER(thedeep_state::nmi_w)
WRITE8_MEMBER(thedeep_state::sound_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -177,7 +177,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, thedeep_state )
AM_RANGE(0x0000, 0x07ff) AM_RAM
AM_RANGE(0x0800, 0x0801) AM_DEVWRITE("ymsnd", ym2203_device, write) //
- AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) // From Main CPU
+ AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) // From Main CPU
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -446,6 +446,8 @@ static MACHINE_CONFIG_START( thedeep, thedeep_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/timelimt.cpp b/src/mame/drivers/timelimt.cpp
index 41c8b140247..0f130df9535 100644
--- a/src/mame/drivers/timelimt.cpp
+++ b/src/mame/drivers/timelimt.cpp
@@ -9,12 +9,13 @@ driver by Ernesto Corvi
Notes:
- Sprite colors are wrong (missing colortable?)
-- driver should probably be merged with suprridr.c and thepit.c
+- driver should probably be merged with suprridr.cpp and thepit.cpp
***************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "includes/timelimt.h"
@@ -56,7 +57,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, timelimt_state )
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW")
AM_RANGE(0xb000, 0xb000) AM_WRITE(nmi_enable_w) /* nmi enable */
AM_RANGE(0xb003, 0xb003) AM_WRITE(sound_reset_w)/* sound reset ? */
- AM_RANGE(0xb800, 0xb800) AM_WRITE(soundlatch_byte_w) /* sound write */
+ AM_RANGE(0xb800, 0xb800) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) /* sound write */
AM_RANGE(0xb800, 0xb800) AM_READNOP /* NMI ack? */
AM_RANGE(0xc800, 0xc800) AM_WRITE(scroll_x_lsb_w)
AM_RANGE(0xc801, 0xc801) AM_WRITE(scroll_x_msb_w)
@@ -77,7 +78,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, timelimt_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_byte_w)
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
AM_RANGE(0x8c, 0x8d) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_data_w)
AM_RANGE(0x8e, 0x8f) AM_DEVREADWRITE("ay2", ay8910_device, data_r, address_data_w)
ADDRESS_MAP_END
@@ -249,11 +250,13 @@ static MACHINE_CONFIG_START( timelimt, timelimt_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ay1", AY8910, 18432000/12)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, 18432000/12)
- 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.25)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp
index 3dd335855ad..bbb15359f14 100644
--- a/src/mame/drivers/tnzs.cpp
+++ b/src/mame/drivers/tnzs.cpp
@@ -801,7 +801,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(tnzs_state::tnzsb_sound_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
}
@@ -850,7 +850,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( tnzsb_io_map, AS_IO, 8, tnzs_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
- AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
static ADDRESS_MAP_START( i8742_io_map, AS_IO, 8, tnzs_state )
@@ -1826,6 +1826,8 @@ static MACHINE_CONFIG_START( tnzsb, tnzs_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */
MCFG_YM2203_IRQ_HANDLER(WRITELINE(tnzs_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 1.0)
diff --git a/src/mame/drivers/toaplan2.cpp b/src/mame/drivers/toaplan2.cpp
index 11a6c1dc7d0..ccdd556a167 100644
--- a/src/mame/drivers/toaplan2.cpp
+++ b/src/mame/drivers/toaplan2.cpp
@@ -850,7 +850,7 @@ WRITE16_MEMBER(toaplan2_state::bgaregga_soundlatch_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
}
@@ -906,7 +906,7 @@ WRITE16_MEMBER(toaplan2_state::batrider_soundlatch_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch_byte_w(space, offset, data & 0xff);
+ m_soundlatch->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
}
@@ -916,7 +916,7 @@ WRITE16_MEMBER(toaplan2_state::batrider_soundlatch2_w)
{
if (ACCESSING_BITS_0_7)
{
- soundlatch2_byte_w(space, offset, data & 0xff);
+ m_soundlatch2->write(space, offset, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
}
@@ -1343,8 +1343,8 @@ static ADDRESS_MAP_START( batrider_68k_mem, AS_PROGRAM, 16, toaplan2_state )
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("SYS-DSW")
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("DSW")
AM_RANGE(0x500006, 0x500007) AM_READ(video_count_r)
- AM_RANGE(0x500008, 0x500009) AM_READ(soundlatch3_word_r)
- AM_RANGE(0x50000a, 0x50000b) AM_READ(soundlatch4_word_r)
+ AM_RANGE(0x500008, 0x500009) AM_DEVREAD8("soundlatch3", generic_latch_8_device, read, 0x00ff)
+ AM_RANGE(0x50000a, 0x50000b) AM_DEVREAD8("soundlatch4", generic_latch_8_device, read, 0x00ff)
AM_RANGE(0x50000c, 0x50000d) AM_READ(batrider_z80_busack_r)
AM_RANGE(0x500010, 0x500011) AM_WRITE(toaplan2_coin_word_w)
AM_RANGE(0x500020, 0x500021) AM_WRITE(batrider_soundlatch_w)
@@ -1374,8 +1374,8 @@ static ADDRESS_MAP_START( bbakraid_68k_mem, AS_PROGRAM, 16, toaplan2_state )
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("DSW")
AM_RANGE(0x500006, 0x500007) AM_READ(video_count_r)
AM_RANGE(0x500008, 0x500009) AM_WRITE(toaplan2_coin_word_w)
- AM_RANGE(0x500010, 0x500011) AM_READ(soundlatch3_word_r)
- AM_RANGE(0x500012, 0x500013) AM_READ(soundlatch4_word_r)
+ AM_RANGE(0x500010, 0x500011) AM_DEVREAD8("soundlatch3", generic_latch_8_device, read, 0x00ff)
+ AM_RANGE(0x500012, 0x500013) AM_DEVREAD8("soundlatch4", generic_latch_8_device, read, 0x00ff)
AM_RANGE(0x500014, 0x500015) AM_WRITE(batrider_soundlatch_w)
AM_RANGE(0x500016, 0x500017) AM_WRITE(batrider_soundlatch2_w)
AM_RANGE(0x500018, 0x500019) AM_READ(bbakraid_eeprom_r)
@@ -1414,7 +1414,7 @@ static ADDRESS_MAP_START( bgaregga_sound_z80_mem, AS_PROGRAM, 8, toaplan2_state
AM_RANGE(0xe006, 0xe008) AM_WRITE(raizing_oki_bankswitch_w)
AM_RANGE(0xe00a, 0xe00a) AM_WRITE(raizing_z80_bankswitch_w)
AM_RANGE(0xe00c, 0xe00c) AM_WRITE(bgaregga_E00C_w)
- AM_RANGE(0xe01c, 0xe01c) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xe01c, 0xe01c) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xe01d, 0xe01d) AM_READ(bgaregga_E01D_r)
ADDRESS_MAP_END
@@ -1428,12 +1428,12 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( batrider_sound_z80_port, AS_IO, 8, toaplan2_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x40, 0x40) AM_WRITE(soundlatch3_byte_w)
- AM_RANGE(0x42, 0x42) AM_WRITE(soundlatch4_byte_w)
+ AM_RANGE(0x40, 0x40) AM_DEVWRITE("soundlatch3", generic_latch_8_device, write)
+ AM_RANGE(0x42, 0x42) AM_DEVWRITE("soundlatch4", generic_latch_8_device, write)
AM_RANGE(0x44, 0x44) AM_WRITE(batrider_sndirq_w)
AM_RANGE(0x46, 0x46) AM_WRITE(batrider_clear_nmi_w)
- AM_RANGE(0x48, 0x48) AM_READ(soundlatch_byte_r)
- AM_RANGE(0x4a, 0x4a) AM_READ(soundlatch2_byte_r)
+ AM_RANGE(0x48, 0x48) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ AM_RANGE(0x4a, 0x4a) AM_DEVREAD("soundlatch2", generic_latch_8_device, read)
AM_RANGE(0x80, 0x81) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x82, 0x82) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
AM_RANGE(0x84, 0x84) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
@@ -1450,12 +1450,12 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( bbakraid_sound_z80_port, AS_IO, 8, toaplan2_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x40, 0x40) AM_WRITE(soundlatch3_byte_w)
- AM_RANGE(0x42, 0x42) AM_WRITE(soundlatch4_byte_w)
+ AM_RANGE(0x40, 0x40) AM_DEVWRITE("soundlatch3", generic_latch_8_device, write)
+ AM_RANGE(0x42, 0x42) AM_DEVWRITE("soundlatch4", generic_latch_8_device, write)
AM_RANGE(0x44, 0x44) AM_WRITE(batrider_sndirq_w)
AM_RANGE(0x46, 0x46) AM_WRITE(batrider_clear_nmi_w)
- AM_RANGE(0x48, 0x48) AM_READ(soundlatch_byte_r)
- AM_RANGE(0x4a, 0x4a) AM_READ(soundlatch2_byte_r)
+ AM_RANGE(0x48, 0x48) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ AM_RANGE(0x4a, 0x4a) AM_DEVREAD("soundlatch2", generic_latch_8_device, read)
AM_RANGE(0x80, 0x81) AM_DEVREADWRITE("ymz", ymz280b_device, read, write)
ADDRESS_MAP_END
@@ -3908,6 +3908,8 @@ static MACHINE_CONFIG_START( bgaregga, toaplan2_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_32MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -3964,6 +3966,11 @@ static MACHINE_CONFIG_START( batrider, toaplan2_state )
/* 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_GENERIC_LATCH_8_ADD("soundlatch4")
+
MCFG_YM2151_ADD("ymsnd", XTAL_32MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -4020,6 +4027,11 @@ static MACHINE_CONFIG_START( bbakraid, toaplan2_state )
/* 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_GENERIC_LATCH_8_ADD("soundlatch4")
+
MCFG_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
// IRQ not used ??? Connected to a test pin (TP082)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/tsamurai.cpp b/src/mame/drivers/tsamurai.cpp
index 003326865d8..ffdfa325c3e 100644
--- a/src/mame/drivers/tsamurai.cpp
+++ b/src/mame/drivers/tsamurai.cpp
@@ -325,7 +325,7 @@ READ8_MEMBER(tsamurai_state::vsgongf_a100_r)
WRITE8_MEMBER(tsamurai_state::vsgongf_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);
}
@@ -359,7 +359,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_vsgongf_map, AS_PROGRAM, 8, tsamurai_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x6000, 0x63ff) AM_RAM /* work RAM */
- AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r) AM_WRITE(vsgongf_sound_nmi_enable_w) /* NMI enable */
+ AM_RANGE(0x8000, 0x8000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(vsgongf_sound_nmi_enable_w) /* NMI enable */
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
ADDRESS_MAP_END
@@ -775,6 +775,8 @@ static MACHINE_CONFIG_START( vsgongf, tsamurai_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_24MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
diff --git a/src/mame/drivers/vball.cpp b/src/mame/drivers/vball.cpp
index 2522ed99919..a4e70ebff79 100644
--- a/src/mame/drivers/vball.cpp
+++ b/src/mame/drivers/vball.cpp
@@ -24,7 +24,7 @@
Remaining Issues:
-1) IRQ & NMI code is totally guessed, and needs to be solved properly
-Measurements from Guru (someone needs to rewrite INTERRUPT_GEN() in video/vball.c):
+Measurements from Guru (someone needs to rewrite INTERRUPT_GEN() in video/vball.cpp):
6502 /IRQ = 1.720kHz
6202 /NMI = 58 Hz
VBlank = 58Hz
@@ -171,7 +171,7 @@ WRITE8_MEMBER(vball_state::bankswitch_w)
/* The sound system comes all but verbatim from Double Dragon */
WRITE8_MEMBER(vball_state::cpu_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);
}
@@ -229,7 +229,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, vball_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x9800, 0x9803) 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
@@ -423,6 +423,8 @@ static MACHINE_CONFIG_START( vball, vball_state )
/* sound hardware */
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", 0.60)
diff --git a/src/mame/drivers/wc90.cpp b/src/mame/drivers/wc90.cpp
index 3459467fd8e..c0aa05e5971 100644
--- a/src/mame/drivers/wc90.cpp
+++ b/src/mame/drivers/wc90.cpp
@@ -72,7 +72,7 @@ WRITE8_MEMBER(wc90_state::bankswitch1_w)
WRITE8_MEMBER(wc90_state::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);
}
@@ -127,7 +127,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, wc90_state )
AM_RANGE(0xf000, 0xf7ff) AM_RAM
AM_RANGE(0xf800, 0xf803) AM_DEVREADWRITE("ymsnd", ym2608_device, read, write)
AM_RANGE(0xfc00, 0xfc00) AM_READNOP /* ??? adpcm ??? */
- AM_RANGE(0xfc10, 0xfc10) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xfc10, 0xfc10) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -382,6 +382,8 @@ static MACHINE_CONFIG_START( wc90, wc90_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2608, XTAL_8MHz) /* verified on pcb */
MCFG_YM2608_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
diff --git a/src/mame/drivers/wc90b.cpp b/src/mame/drivers/wc90b.cpp
index fa192ba4db7..7d849d44429 100644
--- a/src/mame/drivers/wc90b.cpp
+++ b/src/mame/drivers/wc90b.cpp
@@ -51,11 +51,11 @@ fd08: scroll bg #2 X coordinate
fd0a: scroll bg #2 Y coordinate
fd0e: ????
-What i used instead, was the local copy kept in RAM. These values
+What I used instead, was the local copy kept in RAM. These values
are the ones the original machine uses. This will differ when trying
-to use some of this code to write a driver for a similar tecmo bootleg.
+to use some of this code to write a driver for a similar Tecmo bootleg.
-Sprites are also very different. Theres a code snippet in the ROM
+Sprites are also very different. There's a code snippet in the ROM
that converts the original sprites to the new format, which only allows
16x16 sprites. That snippet also does some ( nasty ) clipping.
@@ -87,7 +87,6 @@ Noted added by ClawGrip 28-Mar-2008:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/2203intf.h"
-#include "sound/msm5205.h"
#include "includes/wc90b.h"
#define TEST_DIPS false /* enable to test unmapped dip switches */
@@ -110,7 +109,7 @@ WRITE8_MEMBER(wc90b_state::bankswitch1_w)
WRITE8_MEMBER(wc90b_state::sound_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
@@ -166,7 +165,7 @@ static ADDRESS_MAP_START( sound_cpu, AS_PROGRAM, 8, wc90b_state )
AM_RANGE(0xe400, 0xe400) AM_WRITE(adpcm_data_w)
AM_RANGE(0xe800, 0xe801) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
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)
ADDRESS_MAP_END
@@ -365,6 +364,8 @@ static MACHINE_CONFIG_START( wc90b, wc90b_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2203, YM2203_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
diff --git a/src/mame/drivers/welltris.cpp b/src/mame/drivers/welltris.cpp
index 780e3036660..533b7b65c77 100644
--- a/src/mame/drivers/welltris.cpp
+++ b/src/mame/drivers/welltris.cpp
@@ -4,11 +4,11 @@
Welltris (c)1991 Video System
********************************************************************************
- hardware is similar to aerofgt.c but with slightly different sprites, sound,
+ hardware is similar to aerofgt.cpp but with slightly different sprites, sound,
and an additional 'pixel' layer used for the backdrops
Driver by David Haywood, with help from Steph from The Ultimate Patchers
- Thanks to the authors of aerofgt.c and fromance.c on which most of this is
+ Thanks to the authors of aerofgt.cpp and fromance.cpp on which most of this is
based
********************************************************************************
OW-13 CPU
@@ -51,7 +51,7 @@ V-SYSTEM VS8803 6082 9040 EBBB
********************************************************************************
its impossible to know what some of the video registers do due to lack of
- evidence (bg palette has a selector, but i'm not sure which ... test mode
+ evidence (bg palette has a selector, but I'm not sure which ... test mode
colours use different palette on rgb test
********************************************************************************
@@ -167,8 +167,8 @@ To select a player, press one of his 2 buttons ...
- When it's OFF, only player 1 can play, the number of credits is decremented when
you press the player buttons ... If you wait until timer reaches 0 without selecting
- a player, 1 credit will be substracted, and you'll start a game with player 1 ...
- - When it's ON, 1 credit will be automatically substracted, then the 4 players can
+ a player, 1 credit will be subtracted, and you'll start a game with player 1 ...
+ - When it's ON, 1 credit will be automatically subtracted, then the 4 players can
play by pressing one of their buttons ... If you wait until timer reaches 0 without
selecting a player, you'll start a game with player 1 ...
@@ -333,7 +333,7 @@ WRITE16_MEMBER(welltris_state::sound_command_w)
if (ACCESSING_BITS_0_7)
{
m_pending_command = 1;
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -383,7 +383,7 @@ static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, welltris_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(sound_bankswitch_w)
AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
- AM_RANGE(0x10, 0x10) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x10, 0x10) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x18, 0x18) AM_WRITE(pending_command_clear_w)
ADDRESS_MAP_END
@@ -727,6 +727,8 @@ static MACHINE_CONFIG_START( welltris, welltris_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(WRITELINE(welltris_state, irqhandler))
MCFG_SOUND_ROUTE(0, "mono", 0.25)
diff --git a/src/mame/drivers/wwfsstar.cpp b/src/mame/drivers/wwfsstar.cpp
index 623e7d6dd1d..1607b3fade3 100644
--- a/src/mame/drivers/wwfsstar.cpp
+++ b/src/mame/drivers/wwfsstar.cpp
@@ -140,7 +140,7 @@ Notes:
- About the bootleg set:
- It matches the US (ealier) set 99.99% just in 64K chunks. The ONLY difference
+ It matches the US (earlier) set 99.99% just in 64K chunks. The ONLY difference
in the data is WWFS47.BIN has 5 bytes with a single bit stuck (0x00001000):
Offset WWFS47.BIN 24j6-0.112 (first 0x10000 bytes)
@@ -194,7 +194,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, wwfsstar_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
@@ -219,7 +219,7 @@ WRITE16_MEMBER(wwfsstar_state::scroll_w)
WRITE16_MEMBER(wwfsstar_state::sound_w)
{
- soundlatch_byte_w(space, 1, data & 0xff);
+ m_soundlatch->write(space, 1, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
}
@@ -437,6 +437,8 @@ static MACHINE_CONFIG_START( wwfsstar, wwfsstar_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
diff --git a/src/mame/drivers/wyvernf0.cpp b/src/mame/drivers/wyvernf0.cpp
index 01c7bbd83ae..275538a4860 100644
--- a/src/mame/drivers/wyvernf0.cpp
+++ b/src/mame/drivers/wyvernf0.cpp
@@ -31,6 +31,7 @@ Actual game video: http://www.nicozon.net/watch/sm10823430
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
#include "sound/msm5232.h"
@@ -47,7 +48,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_mcu(*this, "mcu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
// memory pointers
required_shared_ptr<UINT8> m_bgram;
@@ -96,6 +98,7 @@ public:
optional_device<cpu_device> m_mcu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
};
@@ -352,7 +355,7 @@ TIMER_CALLBACK_MEMBER(wyvernf0_state::nmi_callback)
WRITE8_MEMBER(wyvernf0_state::sound_command_w)
{
- soundlatch_byte_w(space, 0, data);
+ m_soundlatch->write(space, 0, data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(wyvernf0_state::nmi_callback),this), data);
}
@@ -402,7 +405,7 @@ static ADDRESS_MAP_START( wyvernf0_map, AS_PROGRAM, 8, wyvernf0_state )
AM_RANGE(0xd606, 0xd606) AM_READ_PORT("JOY2")
AM_RANGE(0xd607, 0xd607) AM_READ_PORT("FIRE2")
- AM_RANGE(0xd610, 0xd610) AM_READWRITE(soundlatch_byte_r, sound_command_w)
+ AM_RANGE(0xd610, 0xd610) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(sound_command_w)
// d613 write (FF -> 00 at boot)
AM_RANGE(0xd800, 0xdbff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
@@ -419,7 +422,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, wyvernf0_state )
// ca00 write
// cb00 write
// cc00 write
- AM_RANGE(0xd000, 0xd000) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w)
+ AM_RANGE(0xd000, 0xd000) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write)
AM_RANGE(0xd200, 0xd200) AM_WRITE(nmi_enable_w)
AM_RANGE(0xd400, 0xd400) AM_WRITE(nmi_disable_w)
AM_RANGE(0xd600, 0xd600) AM_RAM // VOL/BAL?
@@ -663,6 +666,8 @@ static MACHINE_CONFIG_START( wyvernf0, wyvernf0_state )
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
// coin, fire, lift-off
MCFG_SOUND_ADD("ay1", YM2149, 3000000) // YM2149 clock ??, pin 26 ??
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
diff --git a/src/mame/drivers/xain.cpp b/src/mame/drivers/xain.cpp
index 7566770d773..7f6bb5b2072 100644
--- a/src/mame/drivers/xain.cpp
+++ b/src/mame/drivers/xain.cpp
@@ -224,7 +224,7 @@ WRITE8_MEMBER(xain_state::cpuB_bankswitch_w)
WRITE8_MEMBER(xain_state::sound_command_w)
{
- soundlatch_byte_w(space,offset,data);
+ m_soundlatch->write(space,offset,data);
m_audiocpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE);
}
@@ -438,7 +438,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, xain_state )
AM_RANGE(0x0000, 0x07ff) AM_RAM
- AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0x1000, 0x1000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x2800, 0x2801) AM_DEVWRITE("ym1", ym2203_device, write)
AM_RANGE(0x3000, 0x3001) AM_DEVWRITE("ym2", ym2203_device, write)
AM_RANGE(0x4000, 0xffff) AM_ROM
@@ -610,6 +610,8 @@ static MACHINE_CONFIG_START( xsleena, xain_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ym1", YM2203, MCU_CLOCK)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
MCFG_SOUND_ROUTE(0, "mono", 0.50)
diff --git a/src/mame/drivers/yunsun16.cpp b/src/mame/drivers/yunsun16.cpp
index e84541e2a90..198edee2ab4 100644
--- a/src/mame/drivers/yunsun16.cpp
+++ b/src/mame/drivers/yunsun16.cpp
@@ -71,7 +71,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
4) 'bombkick'
- DSW1 bits 3 and 4 determine difficulty (code at 0x0003a4). But DSW1 bit 4 is also used
- in combinaison with DSW1 bit 5 to determine the number of special powers (code at 0x0003c2) !
+ in combination with DSW1 bit 5 to determine the number of special powers (code at 0x0003c2) !
This means that you can have 2 or 3 special powers when you set difficulty to "Easy" or "Normal",
but you'll ALWAYS have 3 special powers when you set difficulty to "Hard" or "Very Hard".
- DSW2 bits 2 to 7 are checked when you select a level :
@@ -143,7 +143,7 @@ number 0 on each voice. That sample is 00000-00000.
*/
if ((data & 0xff) != 0x3a)
{
- soundlatch_byte_w(space, 0, data & 0xff);
+ m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -171,7 +171,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, yunsun16_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x10, 0x11) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write)
- AM_RANGE(0x18, 0x18) AM_READ(soundlatch_byte_r ) // From Main CPU
+ AM_RANGE(0x18, 0x18) AM_DEVREAD("soundlatch", generic_latch_8_device, read) // From Main CPU
AM_RANGE(0x1c, 0x1c) AM_DEVREADWRITE("oki", okim6295_device, read, write) // M6295
ADDRESS_MAP_END
@@ -610,6 +610,8 @@ static MACHINE_CONFIG_START( magicbub, yunsun16_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_16MHz/4)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
diff --git a/src/mame/drivers/yunsung8.cpp b/src/mame/drivers/yunsung8.cpp
index 282815bd235..8c1ef5f83ec 100644
--- a/src/mame/drivers/yunsung8.cpp
+++ b/src/mame/drivers/yunsung8.cpp
@@ -33,8 +33,8 @@ To Do:
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/3812intf.h"
-#include "sound/msm5205.h"
#include "includes/yunsung8.h"
/***************************************************************************
@@ -78,7 +78,7 @@ static ADDRESS_MAP_START( port_map, AS_IO, 8, yunsung8_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READ_PORT("SYSTEM") AM_WRITE(yunsung8_videobank_w) // video RAM bank
AM_RANGE(0x01, 0x01) AM_READ_PORT("P1") AM_WRITE(yunsung8_bankswitch_w) // ROM Bank + Layers Enable
- AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") AM_WRITE(soundlatch_byte_w) // To Sound CPU
+ AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") AM_DEVWRITE("soundlatch", generic_latch_8_device, write) // To Sound CPU
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1")
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW2")
AM_RANGE(0x06, 0x06) AM_WRITE(yunsung8_flipscreen_w) // Flip Screen
@@ -120,7 +120,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, yunsung8_state )
AM_RANGE(0xe400, 0xe400) AM_WRITE(yunsung8_adpcm_w)
AM_RANGE(0xec00, 0xec01) AM_DEVWRITE("ymsnd", ym3812_device, write)
AM_RANGE(0xf000, 0xf7ff) AM_RAM
- AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) // From Main CPU
+ AM_RANGE(0xf800, 0xf800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) // From Main CPU
ADDRESS_MAP_END
@@ -510,6 +510,8 @@ static MACHINE_CONFIG_START( yunsung8, yunsung8_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_16MHz/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
@@ -558,7 +560,7 @@ Yun Sung, 1995
Sound CPU: Z80A
Sound: Yamaha YM3812 + Oki M5205 + YM3014 DAC
Video: QuickLogic FPGA - unknown type / model
- OSC: 16MHz + 400Khz resontator
+ OSC: 16MHz + 400Khz resonator
Memory: 2 x MCM2018AN45, 2 x HM6264, CXK5118PN-15L, GM76C28-10 & 6116
Misc: DSW1 is a 8 position dipswitch
DSW2 is not populated
@@ -645,7 +647,7 @@ Cannon Ball (vertical)
Sound CPU: Z80A
Sound: Yamaha YM3812 + Oki M5205 + YM3014 DAC
Video: Cypress CY7C384A - Very high speed 6K gate CMOS FPGA
- OSC: 16MHz + 400Khz resontator
+ OSC: 16MHz + 400Khz resonator
Memory: 2 x MCM2018AN45, 2 x HM6264, CXK5118PN-15L, GM76C28-10 & 6116
Misc: DSW1 is a 8 position dipswitch
DSW2 is not populated
diff --git a/src/mame/includes/40love.h b/src/mame/includes/40love.h
index 4cccbd9a040..48da17e5960 100644
--- a/src/mame/includes/40love.h
+++ b/src/mame/includes/40love.h
@@ -1,6 +1,8 @@
// license:GPL-2.0+
// copyright-holders:Jarek Burczynski
+
#include "machine/buggychl.h"
+#include "machine/gen_latch.h"
#include "sound/msm5232.h"
class fortyl_state : public driver_device
@@ -20,7 +22,8 @@ public:
m_bmcu(*this, "bmcu"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -77,6 +80,7 @@ public:
required_device<msm5232_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE8_MEMBER(sound_command_w);
DECLARE_WRITE8_MEMBER(nmi_disable_w);
diff --git a/src/mame/includes/aerofgt.h b/src/mame/includes/aerofgt.h
index a5b8583791e..71d4b7d4ee0 100644
--- a/src/mame/includes/aerofgt.h
+++ b/src/mame/includes/aerofgt.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+
+#include "machine/gen_latch.h"
#include "video/vsystem_spr.h"
#include "video/vsystem_spr2.h"
#include "sound/okim6295.h"
@@ -17,14 +19,15 @@ public:
m_spriteram2(*this, "spriteram2"),
m_spriteram3(*this, "spriteram3"),
m_tx_tilemap_ram(*this, "tx_tilemap_ram"),
- m_spr(*this, "vsystem_spr"),
- m_spr_old(*this, "vsystem_spr_old"),
- m_spr_old2(*this, "vsystem_spr_ol2"),
- 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_palette(*this, "palette"),
+ m_spr(*this, "vsystem_spr"),
+ m_spr_old(*this, "vsystem_spr_old"),
+ m_spr_old2(*this, "vsystem_spr_ol2"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_bg1videoram;
@@ -37,9 +40,15 @@ public:
optional_shared_ptr<UINT16> m_tx_tilemap_ram;
/* devices referenced above */
+ required_device<cpu_device> m_maincpu;
+ optional_device<cpu_device> m_audiocpu;
+ optional_device<okim6295_device> m_oki;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
optional_device<vsystem_spr_device> m_spr; // only the aerofgt parent uses this chip
optional_device<vsystem_spr2_device> m_spr_old; // every other (non-bootleg) uses this
optional_device<vsystem_spr2_device> m_spr_old2; // or a pair of them..
+ optional_device<generic_latch_8_device> m_soundlatch;
/* video-related */
@@ -64,9 +73,6 @@ public:
/* misc */
int m_pending_command;
- /* other devices */
- optional_device<cpu_device> m_audiocpu;
-
/* handlers */
DECLARE_WRITE16_MEMBER(sound_command_w);
DECLARE_WRITE16_MEMBER(turbofrc_sound_command_w);
@@ -125,8 +131,4 @@ public:
void spikes91_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
void aerfboot_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
void wbbc97_draw_bitmap( bitmap_rgb32 &bitmap );
- required_device<cpu_device> m_maincpu;
- optional_device<okim6295_device> m_oki;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/amspdwy.h b/src/mame/includes/amspdwy.h
index 079b811b7f6..a969761c664 100644
--- a/src/mame/includes/amspdwy.h
+++ b/src/mame/includes/amspdwy.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "sound/2151intf.h"
class amspdwy_state : public driver_device
@@ -21,7 +22,8 @@ public:
m_ym2151(*this, "ymsnd"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch")
{ }
/* memory pointers */
@@ -36,6 +38,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;
/* video-related */
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/ashnojoe.h b/src/mame/includes/ashnojoe.h
index 028ccdd650a..ee2ebab8694 100644
--- a/src/mame/includes/ashnojoe.h
+++ b/src/mame/includes/ashnojoe.h
@@ -1,10 +1,13 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+
/*************************************************************************
Success Joe / Ashita no Joe
*************************************************************************/
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class ashnojoe_state : public driver_device
@@ -20,10 +23,11 @@ public:
m_tileram_7(*this, "tileram_7"),
m_tileram(*this, "tileram"),
m_tilemap_reg(*this, "tilemap_reg"),
- m_audiocpu(*this, "audiocpu"),
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_msm(*this, "msm"),
- m_gfxdecode(*this, "gfxdecode") { }
+ m_gfxdecode(*this, "gfxdecode"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
UINT16 * m_tileram_1;
@@ -51,7 +55,12 @@ public:
int m_msm5205_vclk_toggle;
/* devices */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<msm5205_device> m_msm;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_READ16_MEMBER(fake_4a00a_r);
DECLARE_WRITE16_MEMBER(ashnojoe_soundlatch_w);
DECLARE_WRITE8_MEMBER(adpcm_w);
@@ -82,7 +91,4 @@ public:
UINT32 screen_update_ashnojoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(ym2203_irq_handler);
DECLARE_WRITE_LINE_MEMBER(ashnojoe_vclk_cb);
- required_device<cpu_device> m_maincpu;
- required_device<msm5205_device> m_msm;
- required_device<gfxdecode_device> m_gfxdecode;
};
diff --git a/src/mame/includes/aztarac.h b/src/mame/includes/aztarac.h
index 45cb076ec3c..2525c707f24 100644
--- a/src/mame/includes/aztarac.h
+++ b/src/mame/includes/aztarac.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "video/vector.h"
class aztarac_state : public driver_device
@@ -17,6 +18,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_vector(*this, "vector"),
m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch"),
m_nvram(*this, "nvram") ,
m_vectorram(*this, "vectorram") { }
@@ -24,6 +26,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<vector_device> m_vector;
required_device<screen_device> m_screen;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT16> m_nvram;
required_shared_ptr<UINT16> m_vectorram;
diff --git a/src/mame/includes/bking.h b/src/mame/includes/bking.h
index c6776381cb0..84303d17071 100644
--- a/src/mame/includes/bking.h
+++ b/src/mame/includes/bking.h
@@ -1,6 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Mike Balfour, Zsolt Vasvari
+
#include "machine/buggychl.h"
+#include "machine/gen_latch.h"
class bking_state : public driver_device
{
@@ -13,7 +15,8 @@ public:
m_bmcu(*this, "bmcu"),
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<UINT8> m_playfield_ram;
@@ -53,6 +56,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;
#if 0
/* 68705 */
diff --git a/src/mame/includes/blockout.h b/src/mame/includes/blockout.h
index 81758b92397..740c0f39a4f 100644
--- a/src/mame/includes/blockout.h
+++ b/src/mame/includes/blockout.h
@@ -1,11 +1,14 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+
/***************************************************************************
Blockout
***************************************************************************/
+#include "machine/gen_latch.h"
+
class blockout_state : public driver_device
{
public:
@@ -17,7 +20,8 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_videoram;
@@ -33,6 +37,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE_LINE_MEMBER(irq_handler);
DECLARE_WRITE16_MEMBER(blockout_sound_command_w);
diff --git a/src/mame/includes/bublbobl.h b/src/mame/includes/bublbobl.h
index c308ac921b5..7f8ad3ae759 100644
--- a/src/mame/includes/bublbobl.h
+++ b/src/mame/includes/bublbobl.h
@@ -1,6 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Chris Moore, Nicola Salmoria
+#include "machine/gen_latch.h"
+
class bublbobl_state : public driver_device
{
public:
@@ -20,7 +22,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_slave(*this, "slave"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"){ }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -71,6 +74,7 @@ public:
required_device<cpu_device> m_slave;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE8_MEMBER(bublbobl_bankswitch_w);
DECLARE_WRITE8_MEMBER(tokio_bankswitch_w);
diff --git a/src/mame/includes/buggychl.h b/src/mame/includes/buggychl.h
index f55343b1122..0e9fbc09b01 100644
--- a/src/mame/includes/buggychl.h
+++ b/src/mame/includes/buggychl.h
@@ -5,6 +5,7 @@
*/
#include "machine/buggychl.h"
+#include "machine/gen_latch.h"
#include "sound/msm5232.h"
class buggychl_state : public driver_device
@@ -24,7 +25,8 @@ public:
m_msm(*this, "msm"),
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<UINT8> m_charram;
@@ -57,7 +59,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;
DECLARE_WRITE8_MEMBER(bankswitch_w);
DECLARE_WRITE8_MEMBER(sound_command_w);
diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h
index 938a4757559..4492d27a918 100644
--- a/src/mame/includes/cave.h
+++ b/src/mame/includes/cave.h
@@ -1,11 +1,14 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
+
/***************************************************************************
Cave hardware
***************************************************************************/
+
#include "machine/eepromser.h"
+#include "machine/gen_latch.h"
#include "machine/nmk112.h"
#include "sound/okim6295.h"
@@ -46,7 +49,8 @@ public:
m_eeprom(*this, "eeprom"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
optional_shared_ptr_array<UINT16, 4> m_videoregs;
@@ -131,6 +135,8 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_16_device> m_soundlatch;
+
int m_rasflag;
int m_old_rasflag;
DECLARE_READ16_MEMBER(cave_irq_cause_r);
diff --git a/src/mame/includes/crshrace.h b/src/mame/includes/crshrace.h
index eb809fbceba..4d19a884ba4 100644
--- a/src/mame/includes/crshrace.h
+++ b/src/mame/includes/crshrace.h
@@ -1,6 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "video/bufsprite.h"
#include "video/vsystem_spr.h"
#include "video/k053936.h"
@@ -13,14 +15,15 @@ public:
m_videoram1(*this, "videoram1"),
m_videoram2(*this, "videoram2"),
m_z80bank(*this, "bank1"),
+ m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
+ m_spr(*this, "vsystem_spr"),
m_k053936(*this, "k053936"),
m_spriteram(*this, "spriteram"),
m_spriteram2(*this, "spriteram2"),
- m_spr(*this, "vsystem_spr"),
- 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<UINT16> m_videoram1;
@@ -28,11 +31,15 @@ public:
required_memory_bank m_z80bank;
+ required_device<cpu_device> m_maincpu;
required_device<z80_device> m_audiocpu;
+ required_device<vsystem_spr_device> m_spr;
required_device<k053936_device> m_k053936;
required_device<buffered_spriteram16_device> m_spriteram;
required_device<buffered_spriteram16_device> m_spriteram2;
- required_device<vsystem_spr_device> m_spr;
+ 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_tilemap1;
@@ -66,7 +73,4 @@ public:
void draw_bg( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
void draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/dcheese.h b/src/mame/includes/dcheese.h
index d8c9455f899..981adefe6d6 100644
--- a/src/mame/includes/dcheese.h
+++ b/src/mame/includes/dcheese.h
@@ -1,11 +1,14 @@
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
+
/***************************************************************************
HAR MadMax hardware
**************************************************************************/
+#include "machine/gen_latch.h"
+#include "sound/bsmt2000.h"
class dcheese_state : public driver_device
{
@@ -20,7 +23,9 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_bsmt(*this, "bsmt"),
+ m_soundlatch(*this, "soundlatch") { }
/* video-related */
UINT16 m_blitter_color[2];
@@ -41,7 +46,9 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<screen_device> m_screen;
- device_t *m_bsmt;
+ required_device<bsmt2000_device> m_bsmt;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE16_MEMBER(eeprom_control_w);
DECLARE_WRITE16_MEMBER(sound_command_w);
DECLARE_READ8_MEMBER(sound_command_r);
diff --git a/src/mame/includes/ddragon.h b/src/mame/includes/ddragon.h
index 1c5d203856d..ca4547434a1 100644
--- a/src/mame/includes/ddragon.h
+++ b/src/mame/includes/ddragon.h
@@ -5,6 +5,8 @@
Double Dragon & Double Dragon II (but also China Gate)
*************************************************************************/
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class ddragon_state : public driver_device
@@ -27,7 +29,8 @@ public:
m_adpcm2(*this, "adpcm2"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
optional_shared_ptr<UINT8> m_rambase;
@@ -77,6 +80,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;
int scanline_to_vcount(int scanline);
diff --git a/src/mame/includes/ddragon3.h b/src/mame/includes/ddragon3.h
index 5513ca9076f..dc7079000bf 100644
--- a/src/mame/includes/ddragon3.h
+++ b/src/mame/includes/ddragon3.h
@@ -1,10 +1,13 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Haywood
+
/*************************************************************************
Double Dragon 3 & The Combatribes
*************************************************************************/
+
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "video/bufsprite.h"
@@ -22,8 +25,8 @@ public:
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette")
-
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch")
{
vblank_level = 6;
raster_level = 5;
@@ -60,6 +63,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;
DECLARE_WRITE16_MEMBER(ddragon3_io_w);
DECLARE_WRITE16_MEMBER(ddragon3_scroll_w);
diff --git a/src/mame/includes/esd16.h b/src/mame/includes/esd16.h
index 7a683d5d39b..5b381152e61 100644
--- a/src/mame/includes/esd16.h
+++ b/src/mame/includes/esd16.h
@@ -7,6 +7,7 @@
***************************************************************************/
#include "machine/eepromser.h"
+#include "machine/gen_latch.h"
#include "video/decospr.h"
class esd16_state : public driver_device
@@ -26,7 +27,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_sprgen(*this, "spritegen"),
- m_eeprom(*this, "eeprom")
+ m_eeprom(*this, "eeprom"),
+ m_soundlatch(*this, "soundlatch")
{}
/* memory pointers */
@@ -53,6 +55,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
optional_device<decospr_device> m_sprgen;
optional_device<eeprom_serial_93cxx_device> m_eeprom;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE16_MEMBER(esd16_sound_command_w);
DECLARE_WRITE16_MEMBER(hedpanic_platform_w);
diff --git a/src/mame/includes/f1gp.h b/src/mame/includes/f1gp.h
index ac790335d6f..6b5d1d20060 100644
--- a/src/mame/includes/f1gp.h
+++ b/src/mame/includes/f1gp.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+
+#include "machine/gen_latch.h"
#include "video/vsystem_spr.h"
#include "video/vsystem_spr2.h"
#include "video/k053936.h"
@@ -22,14 +24,15 @@ public:
m_fgregs(*this, "fgregs"),
m_rozregs(*this, "rozregs"),
m_z80bank(*this, "bank1"),
+ m_maincpu(*this, "maincpu"),
m_spr_old(*this, "vsystem_spr_old"),
m_spr_old2(*this, "vsystem_spr_ol2"),
m_spr(*this, "vsystem_spr"),
- m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_audiocpu(*this, "audiocpu"),
m_k053936(*this, "k053936"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_sharedram;
@@ -47,12 +50,6 @@ public:
optional_memory_bank m_z80bank;
- /* devices referenced above */
- optional_device<vsystem_spr2_device> m_spr_old; // f1gp
- optional_device<vsystem_spr2_device> m_spr_old2; // f1gp
- optional_device<vsystem_spr_device> m_spr; // f1gp2
-
-
UINT16 * m_zoomdata;
/* video-related */
@@ -71,10 +68,14 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
+ optional_device<vsystem_spr2_device> m_spr_old; // f1gp
+ optional_device<vsystem_spr2_device> m_spr_old2; // f1gp
+ optional_device<vsystem_spr_device> m_spr; // f1gp2
required_device<gfxdecode_device> m_gfxdecode;
optional_device<cpu_device> m_audiocpu;
optional_device<k053936_device> m_k053936;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch; // not f1gpb
DECLARE_WRITE8_MEMBER(f1gp_sh_bankswitch_w);
DECLARE_WRITE16_MEMBER(sound_command_w);
diff --git a/src/mame/includes/flstory.h b/src/mame/includes/flstory.h
index f8ec570fa43..7637e018390 100644
--- a/src/mame/includes/flstory.h
+++ b/src/mame/includes/flstory.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+
+#include "machine/gen_latch.h"
#include "sound/msm5232.h"
class flstory_state : public driver_device
@@ -16,7 +18,8 @@ public:
m_mcu(*this, "mcu"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -66,6 +69,7 @@ public:
required_device<msm5232_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
/* mcu */
UINT8 m_mcu_cmd;
diff --git a/src/mame/includes/fromanc2.h b/src/mame/includes/fromanc2.h
index 8041c7974f3..4b903df912c 100644
--- a/src/mame/includes/fromanc2.h
+++ b/src/mame/includes/fromanc2.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Takahiro Nogi, Uki
+
+#include "machine/gen_latch.h"
#include "machine/eepromser.h"
class fromanc2_state : public driver_device
@@ -13,7 +15,9 @@ public:
m_eeprom(*this, "eeprom"),
m_gfxdecode(*this, "gfxdecode"),
m_lpalette(*this, "lpalette"),
- m_rpalette(*this, "rpalette") { }
+ m_rpalette(*this, "rpalette"),
+ m_soundlatch(*this, "soundlatch"),
+ m_soundlatch2(*this, "soundlatch2") { }
/* memory pointers */
std::unique_ptr<UINT16[]> m_videoram[2][4];
@@ -42,6 +46,9 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_lpalette;
required_device<palette_device> m_rpalette;
+ required_device<generic_latch_8_device> m_soundlatch;
+ required_device<generic_latch_8_device> m_soundlatch2;
+
DECLARE_WRITE16_MEMBER(fromanc2_sndcmd_w);
DECLARE_WRITE16_MEMBER(fromanc2_portselect_w);
DECLARE_READ16_MEMBER(fromanc2_keymatrix_r);
diff --git a/src/mame/includes/gaiden.h b/src/mame/includes/gaiden.h
index d96d1e27826..175a43645d3 100644
--- a/src/mame/includes/gaiden.h
+++ b/src/mame/includes/gaiden.h
@@ -1,11 +1,13 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
+
/***************************************************************************
Ninja Gaiden
***************************************************************************/
+#include "machine/gen_latch.h"
#include "video/tecmo_spr.h"
#include "video/tecmo_mix.h"
@@ -18,13 +20,14 @@ public:
m_videoram2(*this, "videoram2"),
m_videoram3(*this, "videoram3"),
m_spriteram(*this, "spriteram"),
- m_audiocpu(*this, "audiocpu"),
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
- m_mixer(*this, "mixer")
+ m_mixer(*this, "mixer"),
+ m_soundlatch(*this, "soundlatch")
{ }
/* memory pointers */
@@ -58,7 +61,15 @@ public:
const int *m_raiga_jumppoints;
/* 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;
+ optional_device<tecmo_spr_device> m_sprgen;
+ optional_device<tecmo_mix_device> m_mixer;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE16_MEMBER(gaiden_sound_command_w);
DECLARE_WRITE16_MEMBER(drgnbowl_sound_command_w);
DECLARE_WRITE16_MEMBER(wildfang_protection_w);
@@ -101,10 +112,4 @@ public:
void descramble_drgnbowl(int descramble_cpu);
void descramble_mastninj_gfx(UINT8* src);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
- optional_device<tecmo_spr_device> m_sprgen;
- optional_device<tecmo_mix_device> m_mixer;
};
diff --git a/src/mame/includes/gladiatr.h b/src/mame/includes/gladiatr.h
index 06813718742..07097be9b01 100644
--- a/src/mame/includes/gladiatr.h
+++ b/src/mame/includes/gladiatr.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Victor Trucco,Steve Ellenoff,Phil Stroffolino,Tatsuyuki Satoh,Tomasz Slanina,Nicola Salmoria
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class gladiatr_state : public driver_device
@@ -13,6 +15,7 @@ public:
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_nvram(*this, "nvram") ,
m_spriteram(*this, "spriteram"),
m_videoram(*this, "videoram"),
@@ -26,6 +29,7 @@ public:
required_device<msm5205_device> m_msm;
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_nvram;
required_shared_ptr<UINT8> m_spriteram;
diff --git a/src/mame/includes/grchamp.h b/src/mame/includes/grchamp.h
index 04d70341b0a..af20e887316 100644
--- a/src/mame/includes/grchamp.h
+++ b/src/mame/includes/grchamp.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
#include "sound/discrete.h"
@@ -22,6 +23,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch"),
m_radarram(*this, "radarram"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
@@ -37,6 +39,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_radarram;
required_shared_ptr<UINT8> m_videoram;
diff --git a/src/mame/includes/gstriker.h b/src/mame/includes/gstriker.h
index 7491fe1aa40..68e9bbdbc66 100644
--- a/src/mame/includes/gstriker.h
+++ b/src/mame/includes/gstriker.h
@@ -1,8 +1,10 @@
// license:BSD-3-Clause
// copyright-holders:Farfetch'd, David Haywood
+
#ifndef __GSTRIKER_H
#define __GSTRIKER_H
+#include "machine/gen_latch.h"
#include "video/vsystem_spr.h"
#include "video/mb60553.h"
#include "video/vs920a.h"
@@ -22,6 +24,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_CG10103_m_vram(*this, "cg10103_m_vram"),
m_work_ram(*this, "work_ram"),
m_mixerregs1(*this, "mixerregs1"),
@@ -36,6 +39,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<UINT16> m_CG10103_m_vram;
required_shared_ptr<UINT16> m_work_ram;
diff --git a/src/mame/includes/gsword.h b/src/mame/includes/gsword.h
index 014cc175082..c8caa962bfb 100644
--- a/src/mame/includes/gsword.h
+++ b/src/mame/includes/gsword.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Steve Ellenoff,Jarek Parchanski
+
+#include "machine/gen_latch.h"
#include "sound/ay8910.h"
#include "sound/msm5205.h"
@@ -16,6 +18,7 @@ public:
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_spritetile_ram(*this, "spritetile_ram"),
m_spritexy_ram(*this, "spritexy_ram"),
m_spriteattrib_ram(*this, "spriteattram"),
@@ -30,6 +33,7 @@ public:
optional_device<msm5205_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch; // not josvolly
required_shared_ptr<UINT8> m_spritetile_ram;
required_shared_ptr<UINT8> m_spritexy_ram;
diff --git a/src/mame/includes/himesiki.h b/src/mame/includes/himesiki.h
index 5412e564b2a..4a5338cf56d 100644
--- a/src/mame/includes/himesiki.h
+++ b/src/mame/includes/himesiki.h
@@ -1,11 +1,14 @@
// license:BSD-3-Clause
// copyright-holders:Uki
+
/*************************************************************************
Himeshikibu
*************************************************************************/
+#include "machine/gen_latch.h"
+
class himesiki_state : public driver_device
{
public:
@@ -14,10 +17,11 @@ public:
m_bg_ram(*this, "bg_ram"),
m_spriteram_p103a(*this, "sprram_p103a"),
m_spriteram(*this, "spriteram"),
- m_subcpu(*this, "sub"),
m_maincpu(*this, "maincpu"),
+ m_subcpu(*this, "sub"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_bg_ram;
@@ -32,7 +36,12 @@ public:
int m_flipscreen;
/* devices */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE8_MEMBER(himesiki_rombank_w);
DECLARE_WRITE8_MEMBER(himesiki_sound_w);
DECLARE_WRITE8_MEMBER(himesiki_bg_ram_w);
@@ -44,7 +53,4 @@ public:
virtual void video_start() override;
UINT32 screen_update_himesiki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void himesiki_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/homedata.h b/src/mame/includes/homedata.h
index 084bdecb8cb..94b55813073 100644
--- a/src/mame/includes/homedata.h
+++ b/src/mame/includes/homedata.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino, Nicola Salmoria
+
+#include "machine/gen_latch.h"
#include "sound/dac.h"
#include "sound/sn76496.h"
#include "sound/2203intf.h"
@@ -16,7 +18,9 @@ public:
m_dac(*this, "dac"),
m_ymsnd(*this, "ymsnd"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
+ m_sn(*this, "snsnd")
{
}
@@ -53,7 +57,9 @@ public:
optional_device<ym2203_device> m_ymsnd;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- sn76489a_device *m_sn;
+ optional_device<generic_latch_8_device> m_soundlatch; // mrokumei
+ optional_device<sn76489a_device> m_sn; // mrokumei and pteacher
+
UINT8 m_prot_data;
DECLARE_READ8_MEMBER(mrokumei_keyboard_r);
DECLARE_WRITE8_MEMBER(mrokumei_keyboard_select_w);
diff --git a/src/mame/includes/inufuku.h b/src/mame/includes/inufuku.h
index 24ed3325158..951d74f2c10 100644
--- a/src/mame/includes/inufuku.h
+++ b/src/mame/includes/inufuku.h
@@ -1,6 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Takahiro Nogi
+#include "machine/gen_latch.h"
+
class inufuku_state : public driver_device
{
public:
@@ -11,11 +13,12 @@ public:
m_tx_videoram(*this, "tx_videoram"),
m_spriteram1(*this, "spriteram1"),
m_spriteram2(*this, "spriteram2"),
- m_spr(*this, "vsystem_spr"),
- 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_spr(*this, "vsystem_spr"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_bg_videoram;
@@ -23,7 +26,6 @@ public:
required_shared_ptr<UINT16> m_tx_videoram;
required_shared_ptr<UINT16> m_spriteram1;
required_shared_ptr<UINT16> m_spriteram2;
- required_device<vsystem_spr_device> m_spr;
/* video-related */
tilemap_t *m_bg_tilemap;
@@ -42,7 +44,13 @@ public:
UINT16 m_pending_command;
/* 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<vsystem_spr_device> m_spr;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE16_MEMBER(inufuku_soundcommand_w);
DECLARE_WRITE8_MEMBER(pending_command_clear_w);
DECLARE_WRITE8_MEMBER(inufuku_soundrombank_w);
@@ -61,7 +69,4 @@ public:
UINT32 screen_update_inufuku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_inufuku(screen_device &screen, bool state);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/ksayakyu.h b/src/mame/includes/ksayakyu.h
index 0f6873d8e7a..1000b18628a 100644
--- a/src/mame/includes/ksayakyu.h
+++ b/src/mame/includes/ksayakyu.h
@@ -1,11 +1,14 @@
// license:LGPL-2.1+
// copyright-holders:Tomasz Slanina
+
/*************************************************************************
Kusayakyuu
*************************************************************************/
+#include "machine/gen_latch.h"
+
class ksayakyu_state : public driver_device
{
public:
@@ -15,7 +18,8 @@ public:
m_spriteram(*this, "spriteram"),
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;
@@ -49,4 +53,5 @@ public:
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;
};
diff --git a/src/mame/includes/ladyfrog.h b/src/mame/includes/ladyfrog.h
index 39114c577dd..e35efa73b13 100644
--- a/src/mame/includes/ladyfrog.h
+++ b/src/mame/includes/ladyfrog.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "sound/msm5232.h"
class ladyfrog_state : public driver_device
@@ -15,11 +16,12 @@ public:
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_scrlram(*this, "scrlram"),
- m_audiocpu(*this, "audiocpu"),
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -41,7 +43,13 @@ public:
UINT8 m_snd_data;
/* devices */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<msm5232_device> m_msm;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_READ8_MEMBER(from_snd_r);
DECLARE_WRITE8_MEMBER(to_main_w);
DECLARE_WRITE8_MEMBER(sound_cpu_reset_w);
@@ -69,8 +77,4 @@ public:
UINT32 screen_update_ladyfrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(nmi_callback);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- required_device<cpu_device> m_maincpu;
- required_device<msm5232_device> m_msm;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/lkage.h b/src/mame/includes/lkage.h
index 863e84b1f5e..b7db305c93e 100644
--- a/src/mame/includes/lkage.h
+++ b/src/mame/includes/lkage.h
@@ -1,6 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
+#include "machine/gen_latch.h"
+
class lkage_state : public driver_device
{
public:
@@ -14,7 +16,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_mcu(*this, "mcu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
required_shared_ptr<UINT8> m_vreg;
required_shared_ptr<UINT8> m_scroll;
@@ -60,6 +63,7 @@ public:
optional_device<cpu_device> m_mcu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE8_MEMBER(lkage_sound_command_w);
DECLARE_WRITE8_MEMBER(lkage_sh_nmi_disable_w);
diff --git a/src/mame/includes/matmania.h b/src/mame/includes/matmania.h
index af41168bed5..f5d8c419b36 100644
--- a/src/mame/includes/matmania.h
+++ b/src/mame/includes/matmania.h
@@ -1,6 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Brad Oliver
+#include "machine/gen_latch.h"
+
class matmania_state : public driver_device
{
public:
@@ -21,7 +23,8 @@ public:
m_mcu(*this, "mcu"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch")
{ }
/* memory pointers */
@@ -43,6 +46,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;
/* video-related */
std::unique_ptr<bitmap_ind16> m_tmpbitmap;
diff --git a/src/mame/includes/mcatadv.h b/src/mame/includes/mcatadv.h
index bcb990b392c..d1de6a5511a 100644
--- a/src/mame/includes/mcatadv.h
+++ b/src/mame/includes/mcatadv.h
@@ -1,6 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Paul Priest, David Haywood
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
class mcatadv_state : public driver_device
@@ -18,7 +19,8 @@ public:
m_soundcpu(*this, "soundcpu"),
m_watchdog(*this, "watchdog"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_videoram1;
@@ -42,6 +44,7 @@ public:
required_device<watchdog_timer_device> m_watchdog;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE16_MEMBER(mcat_soundlatch_w);
DECLARE_READ16_MEMBER(mcat_wd_r);
diff --git a/src/mame/includes/msisaac.h b/src/mame/includes/msisaac.h
index 23453743854..513948fa1df 100644
--- a/src/mame/includes/msisaac.h
+++ b/src/mame/includes/msisaac.h
@@ -1,7 +1,10 @@
// license:GPL-2.0+
// copyright-holders:Jarek Burczynski
+
#include "machine/buggychl.h"
+#include "machine/gen_latch.h"
#include "sound/msm5232.h"
+
/* Disabled because the mcu dump is currently unavailable. -AS */
//#define USE_MCU
@@ -19,7 +22,8 @@ public:
m_bmcu(*this, "bmcu"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_spriteram;
@@ -58,6 +62,7 @@ public:
required_device<msm5232_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE8_MEMBER(sound_command_w);
DECLARE_WRITE8_MEMBER(nmi_disable_w);
diff --git a/src/mame/includes/nycaptor.h b/src/mame/includes/nycaptor.h
index 893014050cd..cd6e03f18b3 100644
--- a/src/mame/includes/nycaptor.h
+++ b/src/mame/includes/nycaptor.h
@@ -1,5 +1,7 @@
// license:LGPL-2.1+
// copyright-holders:Tomasz Slanina
+
+#include "machine/gen_latch.h"
#include "sound/msm5232.h"
class nycaptor_state : public driver_device
@@ -17,7 +19,8 @@ public:
m_mcu(*this, "mcu"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -65,6 +68,7 @@ public:
required_device<msm5232_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE8_MEMBER(sub_cpu_halt_w);
DECLARE_READ8_MEMBER(from_snd_r);
diff --git a/src/mame/includes/pbaction.h b/src/mame/includes/pbaction.h
index aa7fa2ddd35..26887d301ee 100644
--- a/src/mame/includes/pbaction.h
+++ b/src/mame/includes/pbaction.h
@@ -6,6 +6,8 @@
*************************************************************************/
+#include "machine/gen_latch.h"
+
class pbaction_state : public driver_device
{
public:
@@ -21,6 +23,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* memory pointers */
@@ -41,6 +44,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;
optional_shared_ptr<UINT8> m_decrypted_opcodes;
UINT8 m_nmi_mask;
diff --git a/src/mame/includes/renegade.h b/src/mame/includes/renegade.h
index fc619d2c8be..c3c109e0103 100644
--- a/src/mame/includes/renegade.h
+++ b/src/mame/includes/renegade.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino, Carlos A. Lozano, Rob Rosenbrock
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
#define MCU_BUFFER_MAX 6
@@ -14,6 +16,7 @@ public:
m_mcu(*this, "mcu"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
+ m_soundlatch(*this, "soundlatch"),
m_fg_videoram(*this, "fg_videoram"),
m_bg_videoram(*this, "bg_videoram"),
m_spriteram(*this, "spriteram"),
@@ -25,6 +28,7 @@ public:
optional_device<cpu_device> m_mcu;
required_device<msm5205_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_fg_videoram;
required_shared_ptr<UINT8> m_bg_videoram;
diff --git a/src/mame/includes/retofinv.h b/src/mame/includes/retofinv.h
index 9e35b0455b0..bc7e91c825f 100644
--- a/src/mame/includes/retofinv.h
+++ b/src/mame/includes/retofinv.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Jarek Parchanski, Andrea Mazzoleni
+
+#include "machine/gen_latch.h"
+
class retofinv_state : public driver_device
{
public:
@@ -11,6 +14,7 @@ public:
m_68705(*this, "68705"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_fg_videoram(*this, "fg_videoram"),
m_sharedram(*this, "sharedram"),
m_bg_videoram(*this, "bg_videoram") { }
@@ -21,6 +25,7 @@ public:
optional_device<cpu_device> m_68705;
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_fg_videoram;
required_shared_ptr<UINT8> m_sharedram;
diff --git a/src/mame/includes/sauro.h b/src/mame/includes/sauro.h
index dfa69ed44f2..ab0a7e79e42 100644
--- a/src/mame/includes/sauro.h
+++ b/src/mame/includes/sauro.h
@@ -1,6 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Zsolt Vasvari
+#include "machine/gen_latch.h"
#include "sound/sp0256.h"
@@ -13,6 +14,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_sp0256(*this, "speech"),
+ m_soundlatch(*this, "soundlatch"),
m_spriteram(*this, "spriteram"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
@@ -23,6 +25,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
optional_device<sp0256_device> m_sp0256;
+ optional_device<generic_latch_8_device> m_soundlatch; // sauro only
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_videoram;
diff --git a/src/mame/includes/shadfrce.h b/src/mame/includes/shadfrce.h
index 82ce0cba31b..05aeb736d67 100644
--- a/src/mame/includes/shadfrce.h
+++ b/src/mame/includes/shadfrce.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
class shadfrce_state : public driver_device
@@ -13,6 +15,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_io_p1(*this, "P1"),
m_io_p2(*this, "P2"),
m_io_dsw1(*this, "DSW1"),
@@ -32,6 +35,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_ioport m_io_p1;
required_ioport m_io_p2;
diff --git a/src/mame/includes/snowbros.h b/src/mame/includes/snowbros.h
index a1102dbd7a8..8eda9c9b896 100644
--- a/src/mame/includes/snowbros.h
+++ b/src/mame/includes/snowbros.h
@@ -1,6 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood, Mike Coates
-#include "emu.h"
+
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "video/kan_pand.h" // for the original pandora
@@ -14,6 +15,7 @@ public:
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_pandora(*this, "pandora"),
m_hyperpac_ram(*this, "hyperpac_ram"),
m_bootleg_spriteram16(*this, "spriteram16b")
@@ -24,6 +26,7 @@ public:
optional_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch; // not snowbro3
optional_device<kaneko_pandora_device> m_pandora;
optional_shared_ptr<UINT16> m_hyperpac_ram;
diff --git a/src/mame/includes/solomon.h b/src/mame/includes/solomon.h
index 0d8ab74ce02..0e2edd9983b 100644
--- a/src/mame/includes/solomon.h
+++ b/src/mame/includes/solomon.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Mirko Buffoni
+
+#include "machine/gen_latch.h"
+
class solomon_state : public driver_device
{
public:
@@ -13,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<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_videoram;
@@ -43,4 +47,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/spbactn.h b/src/mame/includes/spbactn.h
index 2868c951dd6..ded656e40b9 100644
--- a/src/mame/includes/spbactn.h
+++ b/src/mame/includes/spbactn.h
@@ -1,6 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+#include "machine/gen_latch.h"
#include "video/tecmo_spr.h"
#include "video/tecmo_mix.h"
@@ -16,6 +17,7 @@ public:
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
m_mixer(*this, "mixer"),
+ m_soundlatch(*this, "soundlatch"),
m_bgvideoram(*this, "bgvideoram"),
m_fgvideoram(*this, "fgvideoram"),
m_spvideoram(*this, "spvideoram"),
@@ -30,6 +32,7 @@ public:
required_device<palette_device> m_palette;
required_device<tecmo_spr_device> m_sprgen;
required_device<tecmo_mix_device> m_mixer;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT16> m_bgvideoram;
required_shared_ptr<UINT16> m_fgvideoram;
diff --git a/src/mame/includes/spdodgeb.h b/src/mame/includes/spdodgeb.h
index 04b6362c12a..5fd53a68353 100644
--- a/src/mame/includes/spdodgeb.h
+++ b/src/mame/includes/spdodgeb.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class spdodgeb_state : public driver_device
@@ -20,6 +21,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram") { }
@@ -30,6 +32,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_videoram;
required_shared_ptr<UINT8> m_spriteram;
diff --git a/src/mame/includes/speedspn.h b/src/mame/includes/speedspn.h
index 9167d0192d4..19f3f8bd1ae 100644
--- a/src/mame/includes/speedspn.h
+++ b/src/mame/includes/speedspn.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood, Farfetch'd
+
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
class speedspn_state : public driver_device
@@ -12,6 +14,7 @@ public:
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_prgbank(*this, "prgbank"),
m_okibank(*this, "okibank"),
m_attram(*this, "attram") { }
@@ -21,6 +24,7 @@ public:
required_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
required_memory_bank m_prgbank;
required_memory_bank m_okibank;
diff --git a/src/mame/includes/ssozumo.h b/src/mame/includes/ssozumo.h
index eee0334c406..86b61f8f2df 100644
--- a/src/mame/includes/ssozumo.h
+++ b/src/mame/includes/ssozumo.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Takahiro Nogi
+
+#include "machine/gen_latch.h"
+
class ssozumo_state : public driver_device
{
public:
@@ -9,6 +12,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_spriteram(*this, "spriteram"),
m_paletteram(*this, "paletteram"),
m_videoram(*this, "videoram"),
@@ -20,6 +24,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;
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_paletteram;
diff --git a/src/mame/includes/suprslam.h b/src/mame/includes/suprslam.h
index ffe87dd36bf..d4b72ef094b 100644
--- a/src/mame/includes/suprslam.h
+++ b/src/mame/includes/suprslam.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "video/k053936.h"
class suprslam_state : public driver_device
@@ -19,12 +20,13 @@ public:
m_spriteram(*this, "spriteram"),
m_spr_ctrl(*this, "spr_ctrl"),
m_screen_vregs(*this, "screen_vregs"),
- m_spr(*this, "vsystem_spr"),
+ m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_k053936(*this, "k053936"),
- m_maincpu(*this, "maincpu"),
+ m_spr(*this, "vsystem_spr"),
+ m_palette(*this, "palette"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_screen_videoram;
@@ -33,7 +35,6 @@ public:
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_spr_ctrl;
required_shared_ptr<UINT16> m_screen_vregs;
- required_device<vsystem_spr_device> m_spr;
/* video-related */
tilemap_t *m_screen_tilemap;
@@ -46,8 +47,14 @@ public:
int m_pending_command;
/* devices */
+ required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<k053936_device> m_k053936;
+ required_device<vsystem_spr_device> m_spr;
+ required_device<palette_device> m_palette;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<generic_latch_8_device> m_soundlatch;
+
DECLARE_WRITE16_MEMBER(sound_command_w);
DECLARE_WRITE8_MEMBER(pending_command_clear_w);
DECLARE_WRITE8_MEMBER(suprslam_sh_bankswitch_w);
@@ -61,7 +68,4 @@ public:
virtual void video_start() override;
UINT32 screen_update_suprslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/tagteam.h b/src/mame/includes/tagteam.h
index a39e95dcc4f..b74f9cc2179 100644
--- a/src/mame/includes/tagteam.h
+++ b/src/mame/includes/tagteam.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Steve Ellenoff, Brad Oliver
+
+#include "machine/gen_latch.h"
+
class tagteam_state : public driver_device
{
public:
@@ -9,6 +12,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram") { }
@@ -16,6 +20,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;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_colorram;
diff --git a/src/mame/includes/tail2nos.h b/src/mame/includes/tail2nos.h
index f4eb8bb919f..2760c342341 100644
--- a/src/mame/includes/tail2nos.h
+++ b/src/mame/includes/tail2nos.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "machine/gen_latch.h"
#include "video/k051316.h"
class tail2nos_state : public driver_device
@@ -20,7 +21,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_k051316(*this, "k051316"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
required_shared_ptr<UINT16> m_txvideoram;
@@ -39,6 +41,7 @@ public:
required_device<k051316_device> m_k051316;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE16_MEMBER(sound_command_w);
DECLARE_WRITE16_MEMBER(tail2nos_txvideoram_w);
diff --git a/src/mame/includes/taitosj.h b/src/mame/includes/taitosj.h
index b99a071d025..439cf153aa3 100644
--- a/src/mame/includes/taitosj.h
+++ b/src/mame/includes/taitosj.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+
+#include "machine/gen_latch.h"
#include "sound/dac.h"
class taitosj_state : public driver_device
@@ -27,7 +29,8 @@ public:
m_dac(*this, "dac"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
typedef void (taitosj_state::*copy_layer_func_t)(bitmap_ind16 &,
const rectangle &, int, int *, rectangle *);
@@ -132,4 +135,5 @@ 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;
};
diff --git a/src/mame/includes/taotaido.h b/src/mame/includes/taotaido.h
index 3c7e566469c..1fdb80c3103 100644
--- a/src/mame/includes/taotaido.h
+++ b/src/mame/includes/taotaido.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+
+#include "machine/gen_latch.h"
+
class taotaido_state : public driver_device
{
public:
@@ -9,6 +12,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_spr(*this, "vsystem_spr"),
+ m_soundlatch(*this, "soundlatch"),
m_spriteram(*this, "spriteram"),
m_spriteram2(*this, "spriteram2"),
m_scrollram(*this, "scrollram"),
@@ -18,6 +22,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<vsystem_spr_device> m_spr;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_spriteram2;
diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h
index 0b1aac7f23f..14475645a44 100644
--- a/src/mame/includes/tatsumi.h
+++ b/src/mame/includes/tatsumi.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
+
#include "sound/okim6295.h"
#include "cpu/m68000/m68000.h"
+#include "machine/gen_latch.h"
class tatsumi_state : public driver_device
{
@@ -15,6 +17,7 @@ public:
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_videoram(*this, "videoram"),
m_cyclwarr_cpua_ram(*this, "cw_cpua_ram"),
m_cyclwarr_cpub_ram(*this, "cw_cpub_ram"),
@@ -41,6 +44,7 @@ public:
required_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch;
optional_shared_ptr<UINT16> m_videoram;
optional_shared_ptr<UINT16> m_cyclwarr_cpua_ram;
diff --git a/src/mame/includes/tbowl.h b/src/mame/includes/tbowl.h
index 523cf8c0595..087bc5130a7 100644
--- a/src/mame/includes/tbowl.h
+++ b/src/mame/includes/tbowl.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
#include "video/tecmo_spr.h"
@@ -15,6 +17,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
+ m_soundlatch(*this, "soundlatch"),
m_txvideoram(*this, "txvideoram"),
m_bgvideoram(*this, "bgvideoram"),
m_bg2videoram(*this, "bg2videoram"),
@@ -28,6 +31,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<tecmo_spr_device> m_sprgen;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_txvideoram;
required_shared_ptr<UINT8> m_bgvideoram;
diff --git a/src/mame/includes/tecmo.h b/src/mame/includes/tecmo.h
index aed50ccd174..c342e21eae6 100644
--- a/src/mame/includes/tecmo.h
+++ b/src/mame/includes/tecmo.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
#include "video/tecmo_spr.h"
@@ -14,6 +16,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
+ m_soundlatch(*this, "soundlatch"),
m_txvideoram(*this, "txvideoram"),
m_fgvideoram(*this, "fgvideoram"),
m_bgvideoram(*this, "bgvideoram"),
@@ -25,6 +28,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<tecmo_spr_device> m_sprgen;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_txvideoram;
required_shared_ptr<UINT8> m_fgvideoram;
diff --git a/src/mame/includes/tecmo16.h b/src/mame/includes/tecmo16.h
index f4a10d1f5be..7017d4f7f3e 100644
--- a/src/mame/includes/tecmo16.h
+++ b/src/mame/includes/tecmo16.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Hau, Nicola Salmoria
+
+#include "machine/gen_latch.h"
#include "video/tecmo_spr.h"
#include "video/tecmo_mix.h"
@@ -15,6 +17,7 @@ public:
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
m_mixer(*this, "mixer"),
+ m_soundlatch(*this, "soundlatch"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_videoram2(*this, "videoram2"),
@@ -30,6 +33,7 @@ public:
required_device<palette_device> m_palette;
required_device<tecmo_spr_device> m_sprgen;
required_device<tecmo_mix_device> m_mixer;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT16> m_videoram;
required_shared_ptr<UINT16> m_colorram;
diff --git a/src/mame/includes/tecmosys.h b/src/mame/includes/tecmosys.h
index 7f39d3b3bf3..ab260552532 100644
--- a/src/mame/includes/tecmosys.h
+++ b/src/mame/includes/tecmosys.h
@@ -5,7 +5,9 @@
tecmosys protection simulation
***************************************************************************/
+
#include "machine/eepromser.h"
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
class tecmosys_state : public driver_device
@@ -20,6 +22,8 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
+ m_soundlatch2(*this, "soundlatch2"),
m_spriteram(*this, "spriteram"),
m_tilemap_paletteram16(*this, "tmap_palette"),
m_bg2tilemap_ram(*this, "bg2tilemap_ram"),
@@ -42,6 +46,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_spriteram;
required_shared_ptr<UINT16> m_tilemap_paletteram16;
diff --git a/src/mame/includes/tehkanwc.h b/src/mame/includes/tehkanwc.h
index 22f98d76586..3202531818e 100644
--- a/src/mame/includes/tehkanwc.h
+++ b/src/mame/includes/tehkanwc.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Ernesto Corvi, Roberto Fresca
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class tehkanwc_state : public driver_device
@@ -18,6 +20,8 @@ public:
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
+ m_soundlatch2(*this, "soundlatch2"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_videoram2(*this, "videoram2"),
@@ -29,6 +33,8 @@ public:
required_device<msm5205_device> m_msm;
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_soundlatch2;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_colorram;
diff --git a/src/mame/includes/thedeep.h b/src/mame/includes/thedeep.h
index c95574628b9..341efdb0b3b 100644
--- a/src/mame/includes/thedeep.h
+++ b/src/mame/includes/thedeep.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
+
+#include "machine/gen_latch.h"
#include "video/decmxc06.h"
@@ -13,12 +15,13 @@ public:
m_mcu(*this, "mcu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_spritegen(*this, "spritegen"),
+ m_soundlatch(*this, "soundlatch"),
m_spriteram(*this, "spriteram"),
m_vram_0(*this, "vram_0"),
m_vram_1(*this, "vram_1"),
m_scroll(*this, "scroll"),
- m_scroll2(*this, "scroll2"),
- m_spritegen(*this, "spritegen")
+ m_scroll2(*this, "scroll2")
{ }
required_device<cpu_device> m_maincpu;
@@ -26,13 +29,14 @@ public:
required_device<cpu_device> m_mcu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<deco_mxc06_device> m_spritegen;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_vram_0;
required_shared_ptr<UINT8> m_vram_1;
required_shared_ptr<UINT8> m_scroll;
required_shared_ptr<UINT8> m_scroll2;
- required_device<deco_mxc06_device> m_spritegen;
int m_nmi_enable;
UINT8 m_protection_command;
diff --git a/src/mame/includes/timelimt.h b/src/mame/includes/timelimt.h
index 7b7af434c15..0b8da8c3398 100644
--- a/src/mame/includes/timelimt.h
+++ b/src/mame/includes/timelimt.h
@@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Ernesto Corvi
+
class timelimt_state : public driver_device
{
public:
diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h
index 9ac5c6688da..3020bfc0ebc 100644
--- a/src/mame/includes/tnzs.h
+++ b/src/mame/includes/tnzs.h
@@ -1,10 +1,12 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia, Mirko Buffoni, Takahiro Nogi
+
#include "sound/dac.h"
#include "sound/samples.h"
#include "video/seta001.h"
#include "cpu/mcs48/mcs48.h"
#include "machine/bankdev.h"
+#include "machine/gen_latch.h"
#define MAX_SAMPLES 0x2f /* max samples */
@@ -35,6 +37,7 @@ public:
m_dac(*this, "dac"),
m_samples(*this, "samples"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_mainbank(*this, "mainbank"),
m_subbank(*this, "subbank"),
m_audiobank(*this, "audiobank"),
@@ -58,6 +61,7 @@ public:
optional_device<dac_device> m_dac;
optional_device<samples_device> m_samples;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch;
optional_device<address_map_bank_device> m_mainbank;
optional_memory_bank m_subbank; /* optional because of reuse from cchance.c */
optional_memory_bank m_audiobank;
diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h
index 198cd1ce6ec..660d809899f 100644
--- a/src/mame/includes/toaplan2.h
+++ b/src/mame/includes/toaplan2.h
@@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Quench, Yochizo, David Haywood
+
/**************** Machine stuff ******************/
//#define USE_HD64x180 /* Define if CPU support is available */
//#define TRUXTON2_STEREO /* Uncomment to hear truxton2 music in stereo */
@@ -9,6 +10,7 @@
#include "cpu/m68000/m68000.h"
#include "machine/eepromser.h"
+#include "machine/gen_latch.h"
#include "machine/nmk112.h"
#include "machine/upd4992.h"
#include "video/gp9001.h"
@@ -43,7 +45,9 @@ public:
m_rtc(*this, "rtc"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
+ m_soundlatch2(*this, "soundlatch2") { }
optional_shared_ptr<UINT8> m_shared_ram; // 8 bit RAM shared between 68K and sound CPU
optional_shared_ptr<UINT16> m_shared_ram16; // Really 8 bit RAM connected to Z180
@@ -66,6 +70,8 @@ public:
optional_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch; // batrider and bgaregga and batsugun
+ optional_device<generic_latch_8_device> m_soundlatch2;
UINT16 m_mcu_data;
INT8 m_old_p1_paddle_h; /* For Ghox */
diff --git a/src/mame/includes/tsamurai.h b/src/mame/includes/tsamurai.h
index 2db05642d68..cd371126147 100644
--- a/src/mame/includes/tsamurai.h
+++ b/src/mame/includes/tsamurai.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
+
+#include "machine/gen_latch.h"
+
class tsamurai_state : public driver_device
{
public:
@@ -11,6 +14,7 @@ public:
m_audio3(*this, "audio3"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_bg_videoram(*this, "bg_videoram"),
@@ -22,6 +26,7 @@ public:
optional_device<cpu_device> m_audio3;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch; // vsgongf only
required_shared_ptr<UINT8> m_videoram;
optional_shared_ptr<UINT8> m_colorram;
diff --git a/src/mame/includes/vball.h b/src/mame/includes/vball.h
index ad1c41d9a07..65613c99715 100644
--- a/src/mame/includes/vball.h
+++ b/src/mame/includes/vball.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Paul Hampson
+
+#include "machine/gen_latch.h"
+
class vball_state : public driver_device
{
public:
@@ -10,6 +13,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_attribram(*this, "attribram"),
m_videoram(*this, "videoram"),
m_scrolly_lo(*this, "scrolly_lo"),
@@ -20,6 +24,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_attribram;
required_shared_ptr<UINT8> m_videoram;
diff --git a/src/mame/includes/wc90.h b/src/mame/includes/wc90.h
index 46944d5da83..0fafbf92886 100644
--- a/src/mame/includes/wc90.h
+++ b/src/mame/includes/wc90.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Ernesto Corvi
+
+#include "machine/gen_latch.h"
#include "video/tecmo_spr.h"
class wc90_state : public driver_device
@@ -12,6 +14,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
+ m_soundlatch(*this, "soundlatch"),
m_fgvideoram(*this, "fgvideoram"),
m_bgvideoram(*this, "bgvideoram"),
m_txvideoram(*this, "txvideoram"),
@@ -36,6 +39,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<tecmo_spr_device> m_sprgen;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT8> m_fgvideoram;
required_shared_ptr<UINT8> m_bgvideoram;
diff --git a/src/mame/includes/wc90b.h b/src/mame/includes/wc90b.h
index c4c81289a3a..7140969b407 100644
--- a/src/mame/includes/wc90b.h
+++ b/src/mame/includes/wc90b.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Ernesto Corvi
+
+#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class wc90b_state : public driver_device
@@ -12,6 +14,7 @@ public:
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_fgvideoram(*this, "fgvideoram"),
m_bgvideoram(*this, "bgvideoram"),
m_txvideoram(*this, "txvideoram"),
@@ -27,6 +30,7 @@ public:
required_device<msm5205_device> m_msm;
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_fgvideoram;
required_shared_ptr<UINT8> m_bgvideoram;
diff --git a/src/mame/includes/welltris.h b/src/mame/includes/welltris.h
index cedd5ab7385..f72ffd49268 100644
--- a/src/mame/includes/welltris.h
+++ b/src/mame/includes/welltris.h
@@ -1,5 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+
+#include "machine/gen_latch.h"
#include "video/vsystem_spr2.h"
class welltris_state : public driver_device
@@ -11,6 +13,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_spr_old(*this, "vsystem_spr_old"),
m_gfxdecode(*this, "gfxdecode"),
+ m_soundlatch(*this, "soundlatch"),
m_spriteram(*this, "spriteram"),
m_pixelram(*this, "pixelram"),
m_charvideoram(*this, "charvideoram") { }
@@ -20,6 +23,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<vsystem_spr2_device> m_spr_old;
required_device<gfxdecode_device> m_gfxdecode;
+ required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_pixelram;
diff --git a/src/mame/includes/wwfsstar.h b/src/mame/includes/wwfsstar.h
index 70fdd5dfab3..da7d6cfc0ff 100644
--- a/src/mame/includes/wwfsstar.h
+++ b/src/mame/includes/wwfsstar.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood
+
+#include "machine/gen_latch.h"
+
class wwfsstar_state : public driver_device
{
public:
@@ -10,6 +13,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_spriteram(*this, "spriteram"),
m_fg0_videoram(*this, "fg0_videoram"),
m_bg0_videoram(*this, "bg0_videoram") { }
@@ -19,6 +23,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<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_fg0_videoram;
diff --git a/src/mame/includes/xain.h b/src/mame/includes/xain.h
index ad7c14cfdb9..db61f38e425 100644
--- a/src/mame/includes/xain.h
+++ b/src/mame/includes/xain.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano, Rob Rosenbrock, Phil Stroffolino
+
+#include "machine/gen_latch.h"
+
class xain_state : public driver_device
{
public:
@@ -12,6 +15,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_charram(*this, "charram"),
m_bgram0(*this, "bgram0"),
m_bgram1(*this, "bgram1"),
@@ -24,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_charram;
required_shared_ptr<UINT8> m_bgram0;
diff --git a/src/mame/includes/yunsun16.h b/src/mame/includes/yunsun16.h
index 0e21a85b962..90c20686d8f 100644
--- a/src/mame/includes/yunsun16.h
+++ b/src/mame/includes/yunsun16.h
@@ -1,11 +1,14 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
+
/*************************************************************************
Yun Sung 16 Bit Games
*************************************************************************/
+#include "machine/gen_latch.h"
+
class yunsun16_state : public driver_device
{
public:
@@ -16,6 +19,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch"),
m_vram_0(*this, "vram_0"),
m_vram_1(*this, "vram_1"),
m_scrollram_0(*this, "scrollram_0"),
@@ -29,6 +33,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch; // not shocking
/* memory pointers */
required_shared_ptr<UINT16> m_vram_0;
diff --git a/src/mame/includes/yunsung8.h b/src/mame/includes/yunsung8.h
index 9fb440e8d9a..3d6c0e9982f 100644
--- a/src/mame/includes/yunsung8.h
+++ b/src/mame/includes/yunsung8.h
@@ -5,6 +5,7 @@
Yun Sung 8 Bit Games
*************************************************************************/
+
#include "sound/msm5205.h"
class yunsung8_state : public driver_device
diff --git a/src/mame/machine/bublbobl.cpp b/src/mame/machine/bublbobl.cpp
index df5cf37dbac..1b9a288e153 100644
--- a/src/mame/machine/bublbobl.cpp
+++ b/src/mame/machine/bublbobl.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Chris Moore, Nicola Salmoria
/***************************************************************************
- machine.c
+ bublbobl.cpp
Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
I/O ports)
@@ -107,7 +107,7 @@ void bublbobl_state::device_timer(emu_timer &timer, device_timer_id id, int para
WRITE8_MEMBER(bublbobl_state::bublbobl_sound_command_w)
{
- soundlatch_byte_w(space, offset, data);
+ m_soundlatch->write(space, offset, data);
synchronize(TIMER_NMI, data);
}