summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2018-11-15 18:47:07 +0100
committerGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2018-11-15 18:47:07 +0100
commit8f0b24640bb78f97ed322eb5216b3b4c847f1914 (patch) (github)
treef6a99a26b02ff99c75c4582b96d453b8e9dd1bbc
parentfead82756e2c13a68ef254c6aa6c5891072435ac (diff)
downloadmame-8f0b24640bb78f97ed322eb5216b3b4c847f1914.tar.bz2
mame-8f0b24640bb78f97ed322eb5216b3b4c847f1914.zip
gen_latch: removed MCFG macros (nw)
-rw-r--r--src/devices/machine/gen_latch.h18
-rw-r--r--src/mame/audio/cage.cpp2
-rw-r--r--src/mame/audio/jedi.cpp4
-rw-r--r--src/mame/audio/leland.cpp8
-rw-r--r--src/mame/audio/mario.cpp8
-rw-r--r--src/mame/audio/nichisnd.cpp2
-rw-r--r--src/mame/audio/rax.cpp4
-rw-r--r--src/mame/audio/redalert.cpp2
-rw-r--r--src/mame/drivers/1943.cpp2
-rw-r--r--src/mame/drivers/40love.cpp10
-rw-r--r--src/mame/drivers/88games.cpp2
-rw-r--r--src/mame/drivers/actfancr.cpp8
-rw-r--r--src/mame/drivers/aerofgt.cpp56
-rw-r--r--src/mame/drivers/airbustr.cpp6
-rw-r--r--src/mame/drivers/ajax.cpp2
-rw-r--r--src/mame/drivers/aliens.cpp2
-rw-r--r--src/mame/drivers/alpha68k.cpp16
-rw-r--r--src/mame/drivers/amspdwy.cpp4
-rw-r--r--src/mame/drivers/aquarium.cpp6
-rw-r--r--src/mame/drivers/argus.cpp6
-rw-r--r--src/mame/drivers/armedf.cpp10
-rw-r--r--src/mame/drivers/battlnts.cpp2
-rw-r--r--src/mame/drivers/bbusters.cpp8
-rw-r--r--src/mame/drivers/bfm_sc1.cpp2
-rw-r--r--src/mame/drivers/bigevglf.cpp16
-rw-r--r--src/mame/drivers/bingoc.cpp2
-rw-r--r--src/mame/drivers/bionicc.cpp2
-rw-r--r--src/mame/drivers/blktiger.cpp2
-rw-r--r--src/mame/drivers/blockhl.cpp2
-rw-r--r--src/mame/drivers/blockout.cpp4
-rw-r--r--src/mame/drivers/bnstars.cpp4
-rw-r--r--src/mame/drivers/bombjack.cpp2
-rw-r--r--src/mame/drivers/bottom9.cpp2
-rw-r--r--src/mame/drivers/brkthru.cpp8
-rw-r--r--src/mame/drivers/btime.cpp7
-rw-r--r--src/mame/drivers/bublbobl.cpp12
-rw-r--r--src/mame/drivers/cabal.cpp6
-rw-r--r--src/mame/drivers/calorie.cpp2
-rw-r--r--src/mame/drivers/cave.cpp20
-rw-r--r--src/mame/drivers/cbuster.cpp4
-rw-r--r--src/mame/drivers/chinagat.cpp12
-rw-r--r--src/mame/drivers/chqflag.cpp5
-rw-r--r--src/mame/drivers/circusc.cpp2
-rw-r--r--src/mame/drivers/cischeat.cpp4
-rw-r--r--src/mame/drivers/citycon.cpp4
-rw-r--r--src/mame/drivers/cninja.cpp4
-rw-r--r--src/mame/drivers/cntsteer.cpp2
-rw-r--r--src/mame/drivers/combatsc.cpp4
-rw-r--r--src/mame/drivers/commando.cpp2
-rw-r--r--src/mame/drivers/contra.cpp2
-rw-r--r--src/mame/drivers/coolpool.cpp14
-rw-r--r--src/mame/drivers/cps1.cpp4
-rw-r--r--src/mame/drivers/crgolf.cpp6
-rw-r--r--src/mame/drivers/crimfght.cpp2
-rw-r--r--src/mame/drivers/crospang.cpp2
-rw-r--r--src/mame/drivers/crshrace.cpp6
-rw-r--r--src/mame/drivers/cvs.cpp2
-rw-r--r--src/mame/drivers/cybertnk.cpp4
-rw-r--r--src/mame/drivers/dacholer.cpp4
-rw-r--r--src/mame/drivers/dassault.cpp4
-rw-r--r--src/mame/drivers/dbz.cpp2
-rw-r--r--src/mame/drivers/dcheese.cpp4
-rw-r--r--src/mame/drivers/ddenlovr.cpp4
-rw-r--r--src/mame/drivers/ddragon.cpp12
-rw-r--r--src/mame/drivers/ddragon3.cpp8
-rw-r--r--src/mame/drivers/dec0.cpp12
-rw-r--r--src/mame/drivers/dec8.cpp20
-rw-r--r--src/mame/drivers/deco32.cpp4
-rw-r--r--src/mame/drivers/decocass.cpp4
-rw-r--r--src/mame/drivers/deniam.cpp4
-rw-r--r--src/mame/drivers/discoboy.cpp4
-rw-r--r--src/mame/drivers/divebomb.cpp14
-rw-r--r--src/mame/drivers/diverboy.cpp2
-rw-r--r--src/mame/drivers/djboy.cpp12
-rw-r--r--src/mame/drivers/dooyong.cpp8
-rw-r--r--src/mame/drivers/egghunt.cpp2
-rw-r--r--src/mame/drivers/eolith.cpp3
-rw-r--r--src/mame/drivers/equites.cpp2
-rw-r--r--src/mame/drivers/esd16.cpp2
-rw-r--r--src/mame/drivers/espial.cpp4
-rw-r--r--src/mame/drivers/exedexes.cpp2
-rw-r--r--src/mame/drivers/exprraid.cpp4
-rw-r--r--src/mame/drivers/f1gp.cpp6
-rw-r--r--src/mame/drivers/fantland.cpp8
-rw-r--r--src/mame/drivers/fastfred.cpp2
-rw-r--r--src/mame/drivers/fcrash.cpp28
-rw-r--r--src/mame/drivers/finalizr.cpp2
-rw-r--r--src/mame/drivers/firefox.cpp6
-rw-r--r--src/mame/drivers/firetrap.cpp8
-rw-r--r--src/mame/drivers/flkatck.cpp2
-rw-r--r--src/mame/drivers/flower.cpp2
-rw-r--r--src/mame/drivers/flstory.cpp24
-rw-r--r--src/mame/drivers/fromanc2.cpp12
-rw-r--r--src/mame/drivers/fromance.cpp12
-rw-r--r--src/mame/drivers/funybubl.cpp4
-rw-r--r--src/mame/drivers/fuukifg2.cpp2
-rw-r--r--src/mame/drivers/gaelco.cpp4
-rw-r--r--src/mame/drivers/gaiden.cpp9
-rw-r--r--src/mame/drivers/galivan.cpp4
-rw-r--r--src/mame/drivers/galspnbl.cpp2
-rw-r--r--src/mame/drivers/ghosteo.cpp6
-rw-r--r--src/mame/drivers/gng.cpp2
-rw-r--r--src/mame/drivers/go2000.cpp2
-rw-r--r--src/mame/drivers/goal92.cpp2
-rw-r--r--src/mame/drivers/goindol.cpp2
-rw-r--r--src/mame/drivers/gotcha.cpp2
-rw-r--r--src/mame/drivers/gradius3.cpp2
-rw-r--r--src/mame/drivers/gstriker.cpp6
-rw-r--r--src/mame/drivers/gunsmoke.cpp2
-rw-r--r--src/mame/drivers/hcastle.cpp2
-rw-r--r--src/mame/drivers/hh_hmcs40.cpp4
-rw-r--r--src/mame/drivers/himesiki.cpp2
-rw-r--r--src/mame/drivers/homedata.cpp2
-rw-r--r--src/mame/drivers/hvyunit.cpp10
-rw-r--r--src/mame/drivers/hyperspt.cpp4
-rw-r--r--src/mame/drivers/inufuku.cpp6
-rw-r--r--src/mame/drivers/istellar.cpp10
-rw-r--r--src/mame/drivers/jack.cpp4
-rw-r--r--src/mame/drivers/kaneko16.cpp8
-rw-r--r--src/mame/drivers/karnov.cpp8
-rw-r--r--src/mame/drivers/kchamp.cpp8
-rw-r--r--src/mame/drivers/kickgoal.cpp4
-rw-r--r--src/mame/drivers/lasso.cpp2
-rw-r--r--src/mame/drivers/lastbank.cpp4
-rw-r--r--src/mame/drivers/lastduel.cpp4
-rw-r--r--src/mame/drivers/lemmings.cpp2
-rw-r--r--src/mame/drivers/limenko.cpp8
-rw-r--r--src/mame/drivers/lkage.cpp8
-rw-r--r--src/mame/drivers/lordgun.cpp8
-rw-r--r--src/mame/drivers/lsasquad.cpp10
-rw-r--r--src/mame/drivers/lwings.cpp6
-rw-r--r--src/mame/drivers/m107.cpp9
-rw-r--r--src/mame/drivers/m63.cpp4
-rw-r--r--src/mame/drivers/m72.cpp12
-rw-r--r--src/mame/drivers/m90.cpp12
-rw-r--r--src/mame/drivers/m92.cpp12
-rw-r--r--src/mame/drivers/macrossp.cpp2
-rw-r--r--src/mame/drivers/madmotor.cpp3
-rw-r--r--src/mame/drivers/mainevt.cpp4
-rw-r--r--src/mame/drivers/matmania.cpp2
-rw-r--r--src/mame/drivers/mcatadv.cpp5
-rw-r--r--src/mame/drivers/megasys1.cpp6
-rw-r--r--src/mame/drivers/meijinsn.cpp2
-rw-r--r--src/mame/drivers/metro.cpp26
-rw-r--r--src/mame/drivers/midyunit.cpp2
-rw-r--r--src/mame/drivers/mikie.cpp2
-rw-r--r--src/mame/drivers/missb2.cpp6
-rw-r--r--src/mame/drivers/mitchell.cpp6
-rw-r--r--src/mame/drivers/mouser.cpp3
-rw-r--r--src/mame/drivers/ms32.cpp4
-rw-r--r--src/mame/drivers/mugsmash.cpp4
-rw-r--r--src/mame/drivers/nbmj8991.cpp2
-rw-r--r--src/mame/drivers/nbmj9195.cpp2
-rw-r--r--src/mame/drivers/neoprint.cpp4
-rw-r--r--src/mame/drivers/ninjakd2.cpp2
-rw-r--r--src/mame/drivers/nmg5.cpp2
-rw-r--r--src/mame/drivers/nmk16.cpp40
-rw-r--r--src/mame/drivers/oneshot.cpp2
-rw-r--r--src/mame/drivers/pass.cpp2
-rw-r--r--src/mame/drivers/pcktgal.cpp2
-rw-r--r--src/mame/drivers/pgm.cpp6
-rw-r--r--src/mame/drivers/pipedrm.cpp12
-rw-r--r--src/mame/drivers/pokechmp.cpp2
-rw-r--r--src/mame/drivers/portrait.cpp2
-rw-r--r--src/mame/drivers/powerins.cpp2
-rw-r--r--src/mame/drivers/ppmast93.cpp2
-rw-r--r--src/mame/drivers/prehisle.cpp2
-rw-r--r--src/mame/drivers/progolf.cpp6
-rw-r--r--src/mame/drivers/psikyo.cpp18
-rw-r--r--src/mame/drivers/psychic5.cpp4
-rw-r--r--src/mame/drivers/punchout.cpp4
-rw-r--r--src/mame/drivers/quasar.cpp2
-rw-r--r--src/mame/drivers/quizpun2.cpp2
-rw-r--r--src/mame/drivers/renegade.cpp4
-rw-r--r--src/mame/drivers/retofinv.cpp2
-rw-r--r--src/mame/drivers/rockrage.cpp2
-rw-r--r--src/mame/drivers/roul.cpp2
-rw-r--r--src/mame/drivers/royalmah.cpp2
-rw-r--r--src/mame/drivers/rpunch.cpp8
-rw-r--r--src/mame/drivers/sandscrp.cpp8
-rw-r--r--src/mame/drivers/sauro.cpp2
-rw-r--r--src/mame/drivers/sbasketb.cpp2
-rw-r--r--src/mame/drivers/scotrsht.cpp2
-rw-r--r--src/mame/drivers/scyclone.cpp2
-rw-r--r--src/mame/drivers/segahang.cpp2
-rw-r--r--src/mame/drivers/segajw.cpp6
-rw-r--r--src/mame/drivers/segam1.cpp3
-rw-r--r--src/mame/drivers/segas16a.cpp2
-rw-r--r--src/mame/drivers/segas16b.cpp12
-rw-r--r--src/mame/drivers/segaybd.cpp3
-rw-r--r--src/mame/drivers/seicupbl.cpp4
-rw-r--r--src/mame/drivers/seta.cpp78
-rw-r--r--src/mame/drivers/sf.cpp2
-rw-r--r--src/mame/drivers/sfkick.cpp2
-rw-r--r--src/mame/drivers/shadfrce.cpp4
-rw-r--r--src/mame/drivers/shangha3.cpp8
-rw-r--r--src/mame/drivers/shisen.cpp6
-rw-r--r--src/mame/drivers/sidearms.cpp6
-rw-r--r--src/mame/drivers/sidepckt.cpp4
-rw-r--r--src/mame/drivers/sigmab52.cpp2
-rw-r--r--src/mame/drivers/silvmil.cpp2
-rw-r--r--src/mame/drivers/skyfox.cpp2
-rw-r--r--src/mame/drivers/sliver.cpp2
-rw-r--r--src/mame/drivers/snk.cpp8
-rw-r--r--src/mame/drivers/snk68.cpp4
-rw-r--r--src/mame/drivers/snowbros.cpp21
-rw-r--r--src/mame/drivers/spbactn.cpp8
-rw-r--r--src/mame/drivers/spcforce.cpp2
-rw-r--r--src/mame/drivers/spdodgeb.cpp4
-rw-r--r--src/mame/drivers/speedspn.cpp2
-rw-r--r--src/mame/drivers/splash.cpp14
-rw-r--r--src/mame/drivers/spy.cpp2
-rw-r--r--src/mame/drivers/srumbler.cpp2
-rw-r--r--src/mame/drivers/sslam.cpp2
-rw-r--r--src/mame/drivers/supbtime.cpp3
-rw-r--r--src/mame/drivers/supduck.cpp2
-rw-r--r--src/mame/drivers/suprslam.cpp6
-rw-r--r--src/mame/drivers/system1.cpp2
-rw-r--r--src/mame/drivers/system16.cpp10
-rw-r--r--src/mame/drivers/taotaido.cpp6
-rw-r--r--src/mame/drivers/tatsumi.cpp4
-rw-r--r--src/mame/drivers/tbowl.cpp6
-rw-r--r--src/mame/drivers/tecmo.cpp6
-rw-r--r--src/mame/drivers/tecmo16.cpp3
-rw-r--r--src/mame/drivers/tecmosys.cpp4
-rw-r--r--src/mame/drivers/terracre.cpp2
-rw-r--r--src/mame/drivers/tetrisp2.cpp4
-rw-r--r--src/mame/drivers/thedeep.cpp4
-rw-r--r--src/mame/drivers/thunderx.cpp2
-rw-r--r--src/mame/drivers/tigeroad.cpp6
-rw-r--r--src/mame/drivers/tmnt.cpp10
-rw-r--r--src/mame/drivers/toki.cpp2
-rw-r--r--src/mame/drivers/tp84.cpp2
-rw-r--r--src/mame/drivers/trackfld.cpp6
-rw-r--r--src/mame/drivers/tryout.cpp2
-rw-r--r--src/mame/drivers/tubep.cpp3
-rw-r--r--src/mame/drivers/tumbleb.cpp6
-rw-r--r--src/mame/drivers/twin16.cpp4
-rw-r--r--src/mame/drivers/ultraman.cpp2
-rw-r--r--src/mame/drivers/vamphalf.cpp6
-rw-r--r--src/mame/drivers/vball.cpp4
-rw-r--r--src/mame/drivers/vegaeo.cpp6
-rw-r--r--src/mame/drivers/vigilant.cpp18
-rw-r--r--src/mame/drivers/vulgus.cpp2
-rw-r--r--src/mame/drivers/wc90.cpp4
-rw-r--r--src/mame/drivers/wc90b.cpp2
-rw-r--r--src/mame/drivers/wecleman.cpp4
-rw-r--r--src/mame/drivers/welltris.cpp6
-rw-r--r--src/mame/drivers/wheelfir.cpp2
-rw-r--r--src/mame/drivers/wwfsstar.cpp4
-rw-r--r--src/mame/drivers/yunsun16.cpp2
-rw-r--r--src/mame/drivers/yunsung8.cpp3
-rw-r--r--src/mame/drivers/zaxxon.cpp2
-rw-r--r--src/mame/drivers/zerozone.cpp2
-rw-r--r--src/mame/includes/ddragon3.h4
-rw-r--r--src/mame/includes/fromance.h4
-rw-r--r--src/mame/includes/ms32.h10
257 files changed, 722 insertions, 767 deletions
diff --git a/src/devices/machine/gen_latch.h b/src/devices/machine/gen_latch.h
index 456bbaba8f7..d98bf428646 100644
--- a/src/devices/machine/gen_latch.h
+++ b/src/devices/machine/gen_latch.h
@@ -22,23 +22,6 @@ DECLARE_DEVICE_TYPE(GENERIC_LATCH_16, generic_latch_16_device)
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_GENERIC_LATCH_8_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, GENERIC_LATCH_8, 0)
-
-#define MCFG_GENERIC_LATCH_16_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, GENERIC_LATCH_16, 0)
-
-#define MCFG_GENERIC_LATCH_DATA_PENDING_CB(_devcb) \
- downcast<generic_latch_base_device &>(*device).set_data_pending_callback(DEVCB_##_devcb);
-
-#define MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(_ack) \
- downcast<generic_latch_base_device &>(*device).set_separate_acknowledge(_ack);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -48,7 +31,6 @@ class generic_latch_base_device : public device_t
{
public:
// configuration
- template <class Object> devcb_base &set_data_pending_callback(Object &&cb) { return m_data_pending_cb.set_callback(std::forward<Object>(cb)); }
auto data_pending_callback() { return m_data_pending_cb.bind(); }
void set_separate_acknowledge(bool ack) { m_separate_acknowledge = ack; }
diff --git a/src/mame/audio/cage.cpp b/src/mame/audio/cage.cpp
index 35b1fd1ecec..a3a24263ea9 100644
--- a/src/mame/audio/cage.cpp
+++ b/src/mame/audio/cage.cpp
@@ -627,7 +627,7 @@ MACHINE_CONFIG_START(atari_cage_device::device_add_mconfig)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ GENERIC_LATCH_16(config, m_soundlatch);
#if (DAC_BUFFER_CHANNELS == 4)
MCFG_DEVICE_ADD("dac1", DMADAC)
diff --git a/src/mame/audio/jedi.cpp b/src/mame/audio/jedi.cpp
index 31d2d6dc4db..b6b34a0180e 100644
--- a/src/mame/audio/jedi.cpp
+++ b/src/mame/audio/jedi.cpp
@@ -146,6 +146,6 @@ MACHINE_CONFIG_START(jedi_state::jedi_audio)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch") // 5E (LS374) + 3E (LS279) pins 13-15
- MCFG_GENERIC_LATCH_8_ADD("sacklatch") // 4E (LS374) + 3E (LS279) pins 1-4
+ GENERIC_LATCH_8(config, m_soundlatch); // 5E (LS374) + 3E (LS279) pins 13-15
+ GENERIC_LATCH_8(config, m_sacklatch); // 4E (LS374) + 3E (LS279) pins 1-4
MACHINE_CONFIG_END
diff --git a/src/mame/audio/leland.cpp b/src/mame/audio/leland.cpp
index f686e7c6b5f..8235dbf3eac 100644
--- a/src/mame/audio/leland.cpp
+++ b/src/mame/audio/leland.cpp
@@ -179,7 +179,7 @@ MACHINE_CONFIG_START(leland_80186_sound_device::device_add_mconfig)
m_pit[1]->set_clk<2>(4000000);
m_pit[1]->out_handler<2>().set(FUNC(leland_80186_sound_device::pit1_2_w));
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ GENERIC_LATCH_16(config, m_soundlatch);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(redline_80186_sound_device::device_add_mconfig)
@@ -236,7 +236,7 @@ MACHINE_CONFIG_START(redline_80186_sound_device::device_add_mconfig)
m_pit[2]->set_clk<1>(7000000);
m_pit[2]->set_clk<2>(7000000);
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ GENERIC_LATCH_16(config, m_soundlatch);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(ataxx_80186_sound_device::device_add_mconfig)
@@ -271,7 +271,7 @@ MACHINE_CONFIG_START(ataxx_80186_sound_device::device_add_mconfig)
m_pit[0]->set_clk<2>(4000000);
m_pit[0]->out_handler<2>().set(FUNC(leland_80186_sound_device::pit0_2_w));
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ GENERIC_LATCH_16(config, m_soundlatch);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(wsf_80186_sound_device::device_add_mconfig)
@@ -312,7 +312,7 @@ MACHINE_CONFIG_START(wsf_80186_sound_device::device_add_mconfig)
m_pit[0]->set_clk<2>(4000000);
m_pit[0]->out_handler<2>().set(FUNC(leland_80186_sound_device::pit0_2_w));
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ GENERIC_LATCH_16(config, m_soundlatch);
MACHINE_CONFIG_END
diff --git a/src/mame/audio/mario.cpp b/src/mame/audio/mario.cpp
index f47773f6e9d..384033a7d6a 100644
--- a/src/mame/audio/mario.cpp
+++ b/src/mame/audio/mario.cpp
@@ -653,10 +653,10 @@ MACHINE_CONFIG_START(mario_state::mario_audio)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch3")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch4")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
+ GENERIC_LATCH_8(config, m_soundlatch3);
+ GENERIC_LATCH_8(config, m_soundlatch4);
#if OLD_SOUND
MCFG_DEVICE_ADD("discrete", DISCRETE)
diff --git a/src/mame/audio/nichisnd.cpp b/src/mame/audio/nichisnd.cpp
index 9a9e5169a10..747a543e846 100644
--- a/src/mame/audio/nichisnd.cpp
+++ b/src/mame/audio/nichisnd.cpp
@@ -93,7 +93,7 @@ MACHINE_CONFIG_START(nichisnd_device::device_add_mconfig)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, 4000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
diff --git a/src/mame/audio/rax.cpp b/src/mame/audio/rax.cpp
index eb86b4b3c68..c20f19befc1 100644
--- a/src/mame/audio/rax.cpp
+++ b/src/mame/audio/rax.cpp
@@ -501,8 +501,8 @@ MACHINE_CONFIG_START(acclaim_rax_device::device_add_mconfig)
MCFG_TIMER_DEVICE_ADD("adsp_reg_timer0", DEVICE_SELF, acclaim_rax_device, adsp_irq0)
MCFG_TIMER_DEVICE_ADD("adsp_dma_timer", DEVICE_SELF, acclaim_rax_device, dma_timer_callback)
- MCFG_GENERIC_LATCH_16_ADD("data_in")
- MCFG_GENERIC_LATCH_16_ADD("data_out")
+ GENERIC_LATCH_16(config, m_data_in);
+ GENERIC_LATCH_16(config, m_data_out);
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
diff --git a/src/mame/audio/redalert.cpp b/src/mame/audio/redalert.cpp
index cd5ceba6085..2acfd945c68 100644
--- a/src/mame/audio/redalert.cpp
+++ b/src/mame/audio/redalert.cpp
@@ -204,7 +204,7 @@ MACHINE_CONFIG_START(redalert_state::redalert_audio_voice)
MCFG_I8085A_SID(READLINE(*this, redalert_state,sid_callback))
MCFG_I8085A_SOD(WRITELINE(*this, redalert_state,sod_callback))
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("cvsd", HC55516, REDALERT_HC55516_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
diff --git a/src/mame/drivers/1943.cpp b/src/mame/drivers/1943.cpp
index cd9da57c2c0..ac1fdc84a1c 100644
--- a/src/mame/drivers/1943.cpp
+++ b/src/mame/drivers/1943.cpp
@@ -341,7 +341,7 @@ MACHINE_CONFIG_START(_1943_state::_1943)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(24'000'000)/16) /* verified on pcb */
MCFG_SOUND_ROUTE(0, "mono", 0.15)
diff --git a/src/mame/drivers/40love.cpp b/src/mame/drivers/40love.cpp
index 5c3efac8876..5d566abf5ad 100644
--- a/src/mame/drivers/40love.cpp
+++ b/src/mame/drivers/40love.cpp
@@ -683,10 +683,9 @@ MACHINE_CONFIG_START(fortyl_state::_40love)
MCFG_DEVICE_PROGRAM_MAP(sound_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(fortyl_state, irq0_line_hold, 2*60) /* source/number of IRQs is unknown */
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
@@ -747,10 +746,9 @@ MACHINE_CONFIG_START(fortyl_state::undoukai)
MCFG_DEVICE_PROGRAM_MAP(sound_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(fortyl_state, irq0_line_hold, 2*60) /* source/number of IRQs is unknown */
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/88games.cpp b/src/mame/drivers/88games.cpp
index 49ca9d2580a..28ee66b131d 100644
--- a/src/mame/drivers/88games.cpp
+++ b/src/mame/drivers/88games.cpp
@@ -346,7 +346,7 @@ MACHINE_CONFIG_START(_88games_state::_88games)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_SOUND_ROUTE(0, "mono", 0.75)
diff --git a/src/mame/drivers/actfancr.cpp b/src/mame/drivers/actfancr.cpp
index 3c66891f729..1d92824ac48 100644
--- a/src/mame/drivers/actfancr.cpp
+++ b/src/mame/drivers/actfancr.cpp
@@ -324,8 +324,8 @@ MACHINE_CONFIG_START(actfancr_state::actfancr)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(0, "mono", 0.90)
@@ -385,8 +385,8 @@ MACHINE_CONFIG_START(actfancr_state::triothep)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(12'000'000)/8) /* verified on pcb */
MCFG_SOUND_ROUTE(0, "mono", 0.90)
diff --git a/src/mame/drivers/aerofgt.cpp b/src/mame/drivers/aerofgt.cpp
index bf34823edb9..1a08f0ef079 100644
--- a/src/mame/drivers/aerofgt.cpp
+++ b/src/mame/drivers/aerofgt.cpp
@@ -1502,9 +1502,9 @@ MACHINE_CONFIG_START(aerofgt_state::pspikes)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1632,9 +1632,9 @@ MACHINE_CONFIG_START(aerofgt_state::kickball)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(4'000'000)) // K-666 (YM3812)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1729,9 +1729,9 @@ MACHINE_CONFIG_START(aerofgt_state::karatblz)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, XTAL(8'000'000) ) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1782,8 +1782,8 @@ MACHINE_CONFIG_START(aerofgt_state::karatblzbl)
MCFG_VIDEO_START_OVERRIDE(aerofgt_state,karatblz)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
/* sound hardware */
@@ -1844,9 +1844,9 @@ MACHINE_CONFIG_START(aerofgt_state::spinlbrk)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, XTAL(8'000'000)) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1902,9 +1902,9 @@ MACHINE_CONFIG_START(aerofgt_state::turbofrc)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, XTAL(8'000'000)) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1961,9 +1961,9 @@ MACHINE_CONFIG_START(aerofgt_state::aerofgtb)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -2025,9 +2025,9 @@ MACHINE_CONFIG_START(aerofgt_state::aerofgt)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, XTAL(8'000'000)) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -2071,9 +2071,8 @@ MACHINE_CONFIG_START(aerofgt_state::aerfboot)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(false)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("oki", OKIM6295, 1056000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_DEVICE_ADDRESS_MAP(0, oki_map)
@@ -2152,9 +2151,8 @@ MACHINE_CONFIG_START(aerofgt_state::wbbc97)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(false)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM3812, 3579545)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/airbustr.cpp b/src/mame/drivers/airbustr.cpp
index 58e1720bdcf..598a131623d 100644
--- a/src/mame/drivers/airbustr.cpp
+++ b/src/mame/drivers/airbustr.cpp
@@ -606,10 +606,10 @@ MACHINE_CONFIG_START(airbustr_state::airbustr)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/4)); /* verified on pcb */
ymsnd.port_a_read_callback().set_ioport("DSW1"); // DSW-1 connected to port A
diff --git a/src/mame/drivers/ajax.cpp b/src/mame/drivers/ajax.cpp
index ba700056cf7..6f6113ae314 100644
--- a/src/mame/drivers/ajax.cpp
+++ b/src/mame/drivers/ajax.cpp
@@ -217,7 +217,7 @@ MACHINE_CONFIG_START(ajax_state::ajax)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/aliens.cpp b/src/mame/drivers/aliens.cpp
index 881c032b002..a41726fe493 100644
--- a/src/mame/drivers/aliens.cpp
+++ b/src/mame/drivers/aliens.cpp
@@ -234,7 +234,7 @@ MACHINE_CONFIG_START(aliens_state::aliens)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(*this, aliens_state,aliens_snd_bankswitch_w))
diff --git a/src/mame/drivers/alpha68k.cpp b/src/mame/drivers/alpha68k.cpp
index c0552fc6966..dc1760f2e82 100644
--- a/src/mame/drivers/alpha68k.cpp
+++ b/src/mame/drivers/alpha68k.cpp
@@ -1938,7 +1938,7 @@ MACHINE_CONFIG_START(alpha68k_state::sstingry)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 3000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
@@ -1990,7 +1990,7 @@ MACHINE_CONFIG_START(alpha68k_state::kyros)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 24_MHz_XTAL / 12) /* Verified on bootleg PCB */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
@@ -2041,7 +2041,7 @@ MACHINE_CONFIG_START(alpha68k_state::jongbou)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
ay8910_device &aysnd(AY8910(config, "aysnd", 2000000));
aysnd.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
@@ -2080,8 +2080,8 @@ MACHINE_CONFIG_START(alpha68k_state::alpha68k_I)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(HOLDLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0, HOLD_LINE);
MCFG_DEVICE_ADD("ymsnd", YM3812, 4000000)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -2133,7 +2133,7 @@ MACHINE_CONFIG_START(alpha68k_state::alpha68k_II)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
ym2203_device &ym1(YM2203(config, "ym1", 3000000));
ym1.port_a_write_callback().set(FUNC(alpha68k_state::porta_w));
@@ -2199,7 +2199,7 @@ MACHINE_CONFIG_START(alpha68k_state::alpha68k_V)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
ym2203_device &ym1(YM2203(config, "ym1", ALPHA68K_PIXEL_CLOCK / 2));
ym1.port_a_write_callback().set(FUNC(alpha68k_state::porta_w));
@@ -2254,7 +2254,7 @@ MACHINE_CONFIG_START(alpha68k_state::tnextspc)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, 4000000)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/amspdwy.cpp b/src/mame/drivers/amspdwy.cpp
index 2da1b3070f8..55ae5d18448 100644
--- a/src/mame/drivers/amspdwy.cpp
+++ b/src/mame/drivers/amspdwy.cpp
@@ -277,8 +277,8 @@ MACHINE_CONFIG_START(amspdwy_state::amspdwy)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3000000)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/aquarium.cpp b/src/mame/drivers/aquarium.cpp
index c6dbf21fb7a..1168eff394f 100644
--- a/src/mame/drivers/aquarium.cpp
+++ b/src/mame/drivers/aquarium.cpp
@@ -320,9 +320,9 @@ MACHINE_CONFIG_START(aquarium_state::aquarium)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(14'318'181)/4) // clock not verified on pcb
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/argus.cpp b/src/mame/drivers/argus.cpp
index 78b9c62e1a6..9ccbf38d2b1 100644
--- a/src/mame/drivers/argus.cpp
+++ b/src/mame/drivers/argus.cpp
@@ -515,7 +515,7 @@ MACHINE_CONFIG_START(argus_state::argus)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, 6000000 / 4)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -557,7 +557,7 @@ MACHINE_CONFIG_START(argus_state::valtric)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, 6000000 / 4)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -605,7 +605,7 @@ MACHINE_CONFIG_START(argus_state::butasan)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, 6000000 / 4)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/armedf.cpp b/src/mame/drivers/armedf.cpp
index 30fc5212a63..751130d5235 100644
--- a/src/mame/drivers/armedf.cpp
+++ b/src/mame/drivers/armedf.cpp
@@ -1259,7 +1259,7 @@ MACHINE_CONFIG_START(armedf_state::terraf_sound)
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(24'000'000)/6) // 4mhz
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
@@ -1340,7 +1340,7 @@ MACHINE_CONFIG_START(armedf_state::terrafjb)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(24'000'000)/6) // 4mhz
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
@@ -1421,7 +1421,7 @@ MACHINE_CONFIG_START(armedf_state::armedf)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(24'000'000)/6) // 4mhz
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
@@ -1468,7 +1468,7 @@ MACHINE_CONFIG_START(armedf_state::cclimbr2)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(24'000'000)/6) // or YM3526?
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
@@ -1510,7 +1510,7 @@ MACHINE_CONFIG_START(armedf_state::legion_common)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // 10-pin SIP with 74HC374P latch
MCFG_DEVICE_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // 10-pin SIP with 74HC374P latch
diff --git a/src/mame/drivers/battlnts.cpp b/src/mame/drivers/battlnts.cpp
index 41938ad3e68..6dae695b011 100644
--- a/src/mame/drivers/battlnts.cpp
+++ b/src/mame/drivers/battlnts.cpp
@@ -269,7 +269,7 @@ MACHINE_CONFIG_START(battlnts_state::battlnts)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM3812, XTAL(24'000'000) / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/bbusters.cpp b/src/mame/drivers/bbusters.cpp
index da8beebc4d0..6a05ca92f4b 100644
--- a/src/mame/drivers/bbusters.cpp
+++ b/src/mame/drivers/bbusters.cpp
@@ -667,8 +667,8 @@ MACHINE_CONFIG_START(bbusters_state::bbusters)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -708,8 +708,8 @@ MACHINE_CONFIG_START(mechatt_state::mechatt)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
MCFG_DEVICE_ADD("ymsnd", YM2608, 8000000)
MCFG_YM2608_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp
index 4591f20bb1f..df5d9900fa3 100644
--- a/src/mame/drivers/bfm_sc1.cpp
+++ b/src/mame/drivers/bfm_sc1.cpp
@@ -1083,7 +1083,7 @@ MACHINE_CONFIG_START(bfm_sc1_state::scorpion1)
MCFG_BFMBD1_ADD("vfd0",0)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
AY8912(config, "aysnd", MASTER_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 0.25);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/bigevglf.cpp b/src/mame/drivers/bigevglf.cpp
index 9e7e2a90f9e..98378c74f91 100644
--- a/src/mame/drivers/bigevglf.cpp
+++ b/src/mame/drivers/bigevglf.cpp
@@ -302,8 +302,8 @@ void bigevglf_state::bigevglf_sub_portmap(address_map &map)
map(0x0e, 0x0e).nopw(); /* 0-enable MCU, 1-keep reset line ASSERTED; D0 goes to the input of ls74 and the /Q of this ls74 goes to reset line on 68705 */
map(0x10, 0x17).w(FUNC(bigevglf_state::beg13_a_clr_w));
map(0x18, 0x1f).w(FUNC(bigevglf_state::beg13_b_set_w));
- map(0x20, 0x20).r("soundlatch2", FUNC(generic_latch_8_device::read));
- map(0x20, 0x20).w("soundlatch1", FUNC(generic_latch_8_device::write));
+ map(0x20, 0x20).r(m_soundlatch[1], FUNC(generic_latch_8_device::read));
+ map(0x20, 0x20).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
map(0x21, 0x21).r(FUNC(bigevglf_state::soundstate_r));
}
@@ -321,8 +321,8 @@ void bigevglf_state::sound_map(address_map &map)
map(0xca00, 0xca0d).w(m_msm, FUNC(msm5232_device::write));
map(0xcc00, 0xcc00).nopw();
map(0xce00, 0xce00).nopw();
- map(0xd800, 0xd800).r("soundlatch1", FUNC(generic_latch_8_device::read));
- map(0xd800, 0xd800).w("soundlatch2", FUNC(generic_latch_8_device::write)); /* write to D800 sets bit 1 in status */
+ map(0xd800, 0xd800).r(m_soundlatch[0], FUNC(generic_latch_8_device::read));
+ map(0xd800, 0xd800).w(m_soundlatch[1], FUNC(generic_latch_8_device::write)); /* write to D800 sets bit 1 in status */
map(0xda00, 0xda00).r(FUNC(bigevglf_state::soundstate_r));
map(0xda00, 0xda00).w("soundnmi", FUNC(input_merger_device::in_set<1>)); // enable NMI
map(0xdc00, 0xdc00).w("soundnmi", FUNC(input_merger_device::in_clear<1>)); // disable NMI
@@ -396,10 +396,10 @@ MACHINE_CONFIG_START(bigevglf_state::bigevglf)
2 irqs/frame give good music tempo but also SOUND ERROR in test mode,
4 irqs/frame give SOUND OK in test mode but music seems to be running too fast */
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
-
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
+
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/bingoc.cpp b/src/mame/drivers/bingoc.cpp
index 51266ba6d62..09a42d18122 100644
--- a/src/mame/drivers/bingoc.cpp
+++ b/src/mame/drivers/bingoc.cpp
@@ -207,7 +207,7 @@ MACHINE_CONFIG_START(bingoc_state::bingoc)
SPEAKER(config, "lspeaker").front_left(); //might just be mono...
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 7159160/2)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/bionicc.cpp b/src/mame/drivers/bionicc.cpp
index e5a9cee29ae..73e60278fe0 100644
--- a/src/mame/drivers/bionicc.cpp
+++ b/src/mame/drivers/bionicc.cpp
@@ -429,7 +429,7 @@ MACHINE_CONFIG_START(bionicc_state::bionicc)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(14'318'181) / 4)
MCFG_SOUND_ROUTE(0, "mono", 0.60)
diff --git a/src/mame/drivers/blktiger.cpp b/src/mame/drivers/blktiger.cpp
index bab2301d104..d49d094e458 100644
--- a/src/mame/drivers/blktiger.cpp
+++ b/src/mame/drivers/blktiger.cpp
@@ -329,7 +329,7 @@ MACHINE_CONFIG_START(blktiger_state::blktiger)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/blockhl.cpp b/src/mame/drivers/blockhl.cpp
index 520d2296d27..85eb1801e27 100644
--- a/src/mame/drivers/blockhl.cpp
+++ b/src/mame/drivers/blockhl.cpp
@@ -317,7 +317,7 @@ MACHINE_CONFIG_START(blockhl_state::blockhl)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545))
MCFG_SOUND_ROUTE(0, "mono", 0.60)
diff --git a/src/mame/drivers/blockout.cpp b/src/mame/drivers/blockout.cpp
index 6c2fe9c4fa1..9686ffde145 100644
--- a/src/mame/drivers/blockout.cpp
+++ b/src/mame/drivers/blockout.cpp
@@ -329,8 +329,8 @@ MACHINE_CONFIG_START(blockout_state::blockout)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, AUDIO_CLOCK)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(*this, blockout_state,irq_handler))
diff --git a/src/mame/drivers/bnstars.cpp b/src/mame/drivers/bnstars.cpp
index 995464ce054..5db86cc2948 100644
--- a/src/mame/drivers/bnstars.cpp
+++ b/src/mame/drivers/bnstars.cpp
@@ -855,8 +855,8 @@ MACHINE_CONFIG_START(bnstars_state::bnstars)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymf1", YMF271, 16934400)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/bombjack.cpp b/src/mame/drivers/bombjack.cpp
index f6f5cfa2a1a..f3646ad5166 100644
--- a/src/mame/drivers/bombjack.cpp
+++ b/src/mame/drivers/bombjack.cpp
@@ -359,7 +359,7 @@ MACHINE_CONFIG_START(bombjack_state::bombjack)
MCFG_DEVICE_PROGRAM_MAP(audio_map)
MCFG_DEVICE_IO_MAP(audio_io_map)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/bottom9.cpp b/src/mame/drivers/bottom9.cpp
index 67c584734e7..5243a1b6c4a 100644
--- a/src/mame/drivers/bottom9.cpp
+++ b/src/mame/drivers/bottom9.cpp
@@ -342,7 +342,7 @@ MACHINE_CONFIG_START(bottom9_state::bottom9)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("k007232_1", K007232, XTAL(3'579'545))
MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, bottom9_state, volume_callback0))
diff --git a/src/mame/drivers/brkthru.cpp b/src/mame/drivers/brkthru.cpp
index 40a31432ece..e917a67a313 100644
--- a/src/mame/drivers/brkthru.cpp
+++ b/src/mame/drivers/brkthru.cpp
@@ -399,8 +399,8 @@ MACHINE_CONFIG_START(brkthru_state::brkthru)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, MASTER_CLOCK/8)
MCFG_SOUND_ROUTE(0, "mono", 0.10)
@@ -451,8 +451,8 @@ MACHINE_CONFIG_START(brkthru_state::darwin)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, MASTER_CLOCK/8)
MCFG_SOUND_ROUTE(0, "mono", 0.10)
diff --git a/src/mame/drivers/btime.cpp b/src/mame/drivers/btime.cpp
index 8ae40ea3140..7624c4ba7e3 100644
--- a/src/mame/drivers/btime.cpp
+++ b/src/mame/drivers/btime.cpp
@@ -1308,8 +1308,8 @@ MACHINE_CONFIG_START(btime_state::btime)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
ay8910_device &ay1(AY8910(config, "ay1", HCLK2));
ay1.set_flags(AY8910_DISCRETE_OUTPUT);
@@ -1460,8 +1460,7 @@ MACHINE_CONFIG_START(btime_state::disco)
MCFG_DEVICE_MODIFY("audiocpu")
MCFG_DEVICE_PROGRAM_MAP(disco_audio_map)
- MCFG_DEVICE_MODIFY("soundlatch")
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ m_soundlatch->set_separate_acknowledge(true);
/* video hardware */
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_disco)
diff --git a/src/mame/drivers/bublbobl.cpp b/src/mame/drivers/bublbobl.cpp
index 20afcc12f84..6504096ee42 100644
--- a/src/mame/drivers/bublbobl.cpp
+++ b/src/mame/drivers/bublbobl.cpp
@@ -887,10 +887,10 @@ MACHINE_CONFIG_START(bublbobl_state::tokio)
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_8_ADD("main_to_sound")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<1>))
+ GENERIC_LATCH_8(config, m_main_to_sound);
+ m_main_to_sound->data_pending_callback().set(m_soundnmi, FUNC(input_merger_device::in_w<1>));
- MCFG_GENERIC_LATCH_8_ADD("sound_to_main")
+ GENERIC_LATCH_8(config, m_sound_to_main);
MCFG_DEVICE_ADD("ymsnd", YM2203, MAIN_XTAL/8)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1002,10 +1002,10 @@ MACHINE_CONFIG_START(bublbobl_state::bublbobl_nomcu)
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_8_ADD("main_to_sound")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<1>))
+ GENERIC_LATCH_8(config, m_main_to_sound);
+ m_main_to_sound->data_pending_callback().set(m_soundnmi, FUNC(input_merger_device::in_w<1>));
- MCFG_GENERIC_LATCH_8_ADD("sound_to_main")
+ GENERIC_LATCH_8(config, m_sound_to_main);
MCFG_DEVICE_ADD("ym1", YM2203, MAIN_XTAL/8)
MCFG_YM2203_IRQ_HANDLER(WRITELINE("soundirq", input_merger_device, in_w<0>))
diff --git a/src/mame/drivers/cabal.cpp b/src/mame/drivers/cabal.cpp
index a32ce364351..430896381a7 100644
--- a/src/mame/drivers/cabal.cpp
+++ b/src/mame/drivers/cabal.cpp
@@ -615,9 +615,9 @@ MACHINE_CONFIG_START(cabal_state::cabalbl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch3")
+ GENERIC_LATCH_8(config, "soundlatch");
+ GENERIC_LATCH_8(config, "soundlatch2");
+ GENERIC_LATCH_8(config, "soundlatch3");
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/calorie.cpp b/src/mame/drivers/calorie.cpp
index 50fa07c764f..1361c8fe495 100644
--- a/src/mame/drivers/calorie.cpp
+++ b/src/mame/drivers/calorie.cpp
@@ -494,7 +494,7 @@ MACHINE_CONFIG_START(calorie_state::calorie)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
YM2149(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.8);
diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp
index 5a4bdc9fe19..0b7742e5b34 100644
--- a/src/mame/drivers/cave.cpp
+++ b/src/mame/drivers/cave.cpp
@@ -2370,8 +2370,8 @@ MACHINE_CONFIG_START(cave_state::hotdogst)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_16(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2203, 32_MHz_XTAL/8)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -2470,8 +2470,8 @@ MACHINE_CONFIG_START(cave_state::mazinger)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_16(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2203, 4_MHz_XTAL)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -2525,8 +2525,8 @@ MACHINE_CONFIG_START(cave_state::metmqstr)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_16(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, 16_MHz_XTAL / 4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -2700,8 +2700,8 @@ MACHINE_CONFIG_START(cave_state::pwrinst2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_16(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2203, 16_MHz_XTAL / 4)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -2775,8 +2775,8 @@ MACHINE_CONFIG_START(cave_state::sailormn)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_16(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, 16_MHz_XTAL/4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/cbuster.cpp b/src/mame/drivers/cbuster.cpp
index 01c5feda7bd..697edfd0325 100644
--- a/src/mame/drivers/cbuster.cpp
+++ b/src/mame/drivers/cbuster.cpp
@@ -362,8 +362,8 @@ MACHINE_CONFIG_START(cbuster_state::twocrude)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
// YM2203_PITCH_HACK - Pitch is too low at 1.3425MHz (see also stfight.cpp)
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(32'220'000)/24 * 3) /* 1.3425MHz Verified */
diff --git a/src/mame/drivers/chinagat.cpp b/src/mame/drivers/chinagat.cpp
index a4ddd731712..bc713fc8262 100644
--- a/src/mame/drivers/chinagat.cpp
+++ b/src/mame/drivers/chinagat.cpp
@@ -590,8 +590,8 @@ MACHINE_CONFIG_START(chinagat_state::chinagat)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
@@ -644,8 +644,8 @@ MACHINE_CONFIG_START(chinagat_state::saiyugoub1)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
@@ -691,8 +691,8 @@ MACHINE_CONFIG_START(chinagat_state::saiyugoub2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, 3579545)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/chqflag.cpp b/src/mame/drivers/chqflag.cpp
index 419f391818a..7d0fdf7b6a3 100644
--- a/src/mame/drivers/chqflag.cpp
+++ b/src/mame/drivers/chqflag.cpp
@@ -369,9 +369,8 @@ MACHINE_CONFIG_START(chqflag_state::chqflag)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, "soundlatch");
+ GENERIC_LATCH_8(config, "soundlatch2").data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/circusc.cpp b/src/mame/drivers/circusc.cpp
index caa6e42ae6d..e9ab2c931f6 100644
--- a/src/mame/drivers/circusc.cpp
+++ b/src/mame/drivers/circusc.cpp
@@ -382,7 +382,7 @@ MACHINE_CONFIG_START(circusc_state::circusc)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("sn1", SN76496, XTAL(14'318'181)/8)
MCFG_SOUND_ROUTE(0, "fltdisc", 1.0, 0)
diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp
index f4369ee09a8..1e727f17f64 100644
--- a/src/mame/drivers/cischeat.cpp
+++ b/src/mame/drivers/cischeat.cpp
@@ -1994,8 +1994,8 @@ MACHINE_CONFIG_START(cischeat_state::bigrun)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
- MCFG_GENERIC_LATCH_16_ADD("soundlatch2")
+ GENERIC_LATCH_16(config, m_soundlatch);
+ GENERIC_LATCH_16(config, m_soundlatch2);
// TODO: all sound frequencies unverified (assume same as Mega System 1)
MCFG_DEVICE_ADD("ymsnd", YM2151, 7000000/2)
diff --git a/src/mame/drivers/citycon.cpp b/src/mame/drivers/citycon.cpp
index 71c998d3a7e..5fe5234e7c6 100644
--- a/src/mame/drivers/citycon.cpp
+++ b/src/mame/drivers/citycon.cpp
@@ -222,8 +222,8 @@ MACHINE_CONFIG_START(citycon_state::citycon)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch");
+ GENERIC_LATCH_8(config, "soundlatch2");
AY8910(config, "aysnd", MASTER_CLOCK / 16).add_route(ALL_OUTPUTS, "mono", 0.40); // schematics consistently specify AY-3-8910, though YM2149 found on one actual PCB
diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp
index d6ceb9b728a..cc6ab7678f9 100644
--- a/src/mame/drivers/cninja.cpp
+++ b/src/mame/drivers/cninja.cpp
@@ -1039,8 +1039,8 @@ MACHINE_CONFIG_START(cninja_state::cninjabl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(32'220'000) / 9)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/cntsteer.cpp b/src/mame/drivers/cntsteer.cpp
index 6bf73781ad4..d65e10d470a 100644
--- a/src/mame/drivers/cntsteer.cpp
+++ b/src/mame/drivers/cntsteer.cpp
@@ -1010,7 +1010,7 @@ MACHINE_CONFIG_START(cntsteer_state::zerotrgt)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
AY8910(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "speaker", 0.5);
diff --git a/src/mame/drivers/combatsc.cpp b/src/mame/drivers/combatsc.cpp
index 65a05970e7b..a5d121a4520 100644
--- a/src/mame/drivers/combatsc.cpp
+++ b/src/mame/drivers/combatsc.cpp
@@ -787,8 +787,8 @@ MACHINE_CONFIG_START(combatsc_state::combatscb)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2203, 3000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
diff --git a/src/mame/drivers/commando.cpp b/src/mame/drivers/commando.cpp
index be69b8b2dc1..6b521b451a4 100644
--- a/src/mame/drivers/commando.cpp
+++ b/src/mame/drivers/commando.cpp
@@ -282,7 +282,7 @@ MACHINE_CONFIG_START(commando_state::commando)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, PHI_B/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
diff --git a/src/mame/drivers/contra.cpp b/src/mame/drivers/contra.cpp
index 797c7ded4c1..80d1296b766 100644
--- a/src/mame/drivers/contra.cpp
+++ b/src/mame/drivers/contra.cpp
@@ -245,7 +245,7 @@ MACHINE_CONFIG_START(contra_state::contra)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
diff --git a/src/mame/drivers/coolpool.cpp b/src/mame/drivers/coolpool.cpp
index c9c7e9bccb6..ed595195357 100644
--- a/src/mame/drivers/coolpool.cpp
+++ b/src/mame/drivers/coolpool.cpp
@@ -732,9 +732,9 @@ MACHINE_CONFIG_START(coolpool_state::amerdart)
MCFG_TMS32010_BIO_IN_CB(READLINE(*this, coolpool_state, amerdart_dsp_bio_line_r))
MCFG_TIMER_DRIVER_ADD_SCANLINE("audioint", coolpool_state, amerdart_audio_int_gen, "screen", 0, 1)
- MCFG_GENERIC_LATCH_16_ADD("main2dsp")
- MCFG_GENERIC_LATCH_16_ADD("dsp2main")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("maincpu", 1))
+ GENERIC_LATCH_16(config, m_main2dsp);
+ GENERIC_LATCH_16(config, m_dsp2main);
+ m_dsp2main->data_pending_callback().set_inputline(m_maincpu, 1);
MCFG_MACHINE_RESET_OVERRIDE(coolpool_state,amerdart)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -773,13 +773,13 @@ MACHINE_CONFIG_START(coolpool_state::coolpool)
dsp.hold_in_cb().set(FUNC(coolpool_state::dsp_hold_line_r));
// dsp.hold_ack_out_cb().set(FUNC(coolpool_state::dsp_HOLDA_signal_w));
- MCFG_GENERIC_LATCH_16_ADD("main2dsp")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("dsp", 0)) /* ??? I have no idea who should generate this! */
+ GENERIC_LATCH_16(config, m_main2dsp);
+ m_main2dsp->data_pending_callback().set_inputline(m_dsp, 0); /* ??? I have no idea who should generate this! */
/* the DSP polls the status bit so it isn't strictly */
/* necessary to also have an IRQ */
- MCFG_GENERIC_LATCH_16_ADD("dsp2main")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("maincpu", 1))
+ GENERIC_LATCH_16(config, m_dsp2main);
+ m_dsp2main->data_pending_callback().set_inputline(m_maincpu, 1);
MCFG_MACHINE_RESET_OVERRIDE(coolpool_state,coolpool)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp
index 16438f628e5..48cc00e8c23 100644
--- a/src/mame/drivers/cps1.cpp
+++ b/src/mame/drivers/cps1.cpp
@@ -3409,8 +3409,8 @@ MACHINE_CONFIG_START(cps_state::cps1_10MHz)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("2151", YM2151, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/crgolf.cpp b/src/mame/drivers/crgolf.cpp
index 6929217896f..b8317049bf5 100644
--- a/src/mame/drivers/crgolf.cpp
+++ b/src/mame/drivers/crgolf.cpp
@@ -485,11 +485,9 @@ MACHINE_CONFIG_START(crgolf_state::crgolf)
mainlatch.q_out_cb<6>().set(FUNC(crgolf_state::screenb_enable_w));
mainlatch.q_out_cb<7>().set(FUNC(crgolf_state::screena_enable_w));
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, "soundlatch1").data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, "soundlatch2").data_pending_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
/* stride is technically 0x6000, but powers of 2 makes the memory map / address masking cleaner. */
diff --git a/src/mame/drivers/crimfght.cpp b/src/mame/drivers/crimfght.cpp
index 19491d387a6..2f8f73bd6f2 100644
--- a/src/mame/drivers/crimfght.cpp
+++ b/src/mame/drivers/crimfght.cpp
@@ -341,7 +341,7 @@ MACHINE_CONFIG_START(crimfght_state::crimfght)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(*this, crimfght_state, ym2151_ct_w))
diff --git a/src/mame/drivers/crospang.cpp b/src/mame/drivers/crospang.cpp
index baa07d8ff7b..0f314e76cca 100644
--- a/src/mame/drivers/crospang.cpp
+++ b/src/mame/drivers/crospang.cpp
@@ -458,7 +458,7 @@ MACHINE_CONFIG_START(crospang_state::crospang)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(14'318'181)/4) /* 3.579545MHz */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/crshrace.cpp b/src/mame/drivers/crshrace.cpp
index 2a8a00a6537..3e0156c4187 100644
--- a/src/mame/drivers/crshrace.cpp
+++ b/src/mame/drivers/crshrace.cpp
@@ -444,9 +444,9 @@ MACHINE_CONFIG_START(crshrace_state::crshrace)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/cvs.cpp b/src/mame/drivers/cvs.cpp
index 267e6b1d4f9..66cbed268f0 100644
--- a/src/mame/drivers/cvs.cpp
+++ b/src/mame/drivers/cvs.cpp
@@ -1017,7 +1017,7 @@ MACHINE_CONFIG_START(cvs_state::cvs)
/* audio hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
MCFG_DEVICE_ADD("dac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
diff --git a/src/mame/drivers/cybertnk.cpp b/src/mame/drivers/cybertnk.cpp
index b77ac2ab222..98f53b1e43d 100644
--- a/src/mame/drivers/cybertnk.cpp
+++ b/src/mame/drivers/cybertnk.cpp
@@ -854,8 +854,8 @@ MACHINE_CONFIG_START(cybertnk_state::cybertnk)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(HOLDLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0, HOLD_LINE);
// Splited output per chip
MCFG_DEVICE_ADD("ym1", Y8950, XTAL(3'579'545))
diff --git a/src/mame/drivers/dacholer.cpp b/src/mame/drivers/dacholer.cpp
index 0ea30585c29..630e420932f 100644
--- a/src/mame/drivers/dacholer.cpp
+++ b/src/mame/drivers/dacholer.cpp
@@ -700,8 +700,8 @@ MACHINE_CONFIG_START(dacholer_state::dacholer)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
AY8910(config, "ay1", XTAL(19'968'000)/16).add_route(ALL_OUTPUTS, "mono", 0.15);
diff --git a/src/mame/drivers/dassault.cpp b/src/mame/drivers/dassault.cpp
index 4376c02bd5a..189b3999d3e 100644
--- a/src/mame/drivers/dassault.cpp
+++ b/src/mame/drivers/dassault.cpp
@@ -604,8 +604,8 @@ MACHINE_CONFIG_START(dassault_state::dassault)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0)) // IRQ1
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); // IRQ1
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(32'220'000)/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
diff --git a/src/mame/drivers/dbz.cpp b/src/mame/drivers/dbz.cpp
index 798c7f20deb..2c5c52a7c7b 100644
--- a/src/mame/drivers/dbz.cpp
+++ b/src/mame/drivers/dbz.cpp
@@ -381,7 +381,7 @@ MACHINE_CONFIG_START(dbz_state::dbz)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 4000000)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/dcheese.cpp b/src/mame/drivers/dcheese.cpp
index 66e8a334037..d11233aeebd 100644
--- a/src/mame/drivers/dcheese.cpp
+++ b/src/mame/drivers/dcheese.cpp
@@ -405,8 +405,8 @@ MACHINE_CONFIG_START(dcheese_state::dcheese)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("bsmt", BSMT2000, SOUND_OSC)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.2)
diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp
index 656aa5d6ae7..587a66ddebf 100644
--- a/src/mame/drivers/ddenlovr.cpp
+++ b/src/mame/drivers/ddenlovr.cpp
@@ -9961,8 +9961,8 @@ MACHINE_CONFIG_START(ddenlovr_state::mmpanic)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
YM2413(config, "ym2413", 3579545).add_route(ALL_OUTPUTS, "mono", 0.80);
diff --git a/src/mame/drivers/ddragon.cpp b/src/mame/drivers/ddragon.cpp
index f4281f9a3b8..e921a615c97 100644
--- a/src/mame/drivers/ddragon.cpp
+++ b/src/mame/drivers/ddragon.cpp
@@ -974,8 +974,8 @@ MACHINE_CONFIG_START(ddragon_state::ddragon)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", M6809_IRQ_LINE))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, M6809_IRQ_LINE);
MCFG_DEVICE_ADD("fmsnd", YM2151, SOUND_CLOCK)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", M6809_FIRQ_LINE))
@@ -1047,8 +1047,8 @@ MACHINE_CONFIG_START(ddragon_state::ddragon6809)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", M6809_IRQ_LINE))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, M6809_IRQ_LINE);
MCFG_DEVICE_ADD("fmsnd", YM2151, SOUND_CLOCK)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", M6809_FIRQ_LINE))
@@ -1100,8 +1100,8 @@ MACHINE_CONFIG_START(ddragon_state::ddragon2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("fmsnd", YM2151, SOUND_CLOCK)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/ddragon3.cpp b/src/mame/drivers/ddragon3.cpp
index b0997b273fb..50839b0a88c 100644
--- a/src/mame/drivers/ddragon3.cpp
+++ b/src/mame/drivers/ddragon3.cpp
@@ -847,8 +847,8 @@ MACHINE_CONFIG_START(ddragon3_state::ddragon3)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym2151", YM2151, XTAL(3'579'545))
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -924,8 +924,8 @@ MACHINE_CONFIG_START(wwfwfest_state::wwfwfest)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym2151", YM2151, XTAL(3'579'545))
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp
index f28fd4e6719..7d1592a93a6 100644
--- a/src/mame/drivers/dec0.cpp
+++ b/src/mame/drivers/dec0.cpp
@@ -1637,8 +1637,8 @@ MACHINE_CONFIG_START(dec0_state::dec0_base)
MCFG_DECO_MXC06_GFX_REGION(3)
MCFG_DECO_MXC06_GFXDECODE("gfxdecode")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(dec0_state::dec0)
@@ -1775,8 +1775,8 @@ MACHINE_CONFIG_START(dec0_automat_state::automat)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("2203a", YM2203, 1250000)
MCFG_SOUND_ROUTE(0, "mono", 0.90)
@@ -1850,8 +1850,8 @@ MACHINE_CONFIG_START(dec0_automat_state::secretab)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("2203a", YM2203, 1250000)
MCFG_SOUND_ROUTE(0, "mono", 0.90)
diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp
index 4bfe058850a..f66c787ee05 100644
--- a/src/mame/drivers/dec8.cpp
+++ b/src/mame/drivers/dec8.cpp
@@ -1981,7 +1981,7 @@ MACHINE_CONFIG_START(dec8_state::lastmisn)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(0, "mono", 0.23)
@@ -2046,7 +2046,7 @@ MACHINE_CONFIG_START(dec8_state::shackled)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(0, "mono", 0.23)
@@ -2106,7 +2106,7 @@ MACHINE_CONFIG_START(dec8_state::gondo)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(0, "mono", 0.23)
@@ -2166,7 +2166,7 @@ MACHINE_CONFIG_START(dec8_state::garyoret)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(0, "mono", 0.23)
@@ -2226,7 +2226,7 @@ MACHINE_CONFIG_START(dec8_state::ghostb)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(0, "mono", 0.23)
@@ -2286,7 +2286,7 @@ MACHINE_CONFIG_START(dec8_state::csilver)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(12'000'000)/8) /* verified on pcb */
MCFG_SOUND_ROUTE(0, "mono", 0.23)
@@ -2350,8 +2350,8 @@ MACHINE_CONFIG_START(dec8_state::oscar)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", m6502_device::NMI_LINE))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, m6502_device::NMI_LINE);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(12'000'000)/8) /* verified on pcb */
MCFG_SOUND_ROUTE(0, "mono", 0.23)
@@ -2404,7 +2404,7 @@ MACHINE_CONFIG_START(dec8_state::srdarwin)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(0, "mono", 0.23)
@@ -2461,7 +2461,7 @@ MACHINE_CONFIG_START(dec8_state::cobracom)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(0, "mono", 0.53)
diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp
index b0eca76e194..cb03131bbfa 100644
--- a/src/mame/drivers/deco32.cpp
+++ b/src/mame/drivers/deco32.cpp
@@ -2008,8 +2008,8 @@ MACHINE_CONFIG_START(fghthist_state::fghthist)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM2151, 32220000/9)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1))
diff --git a/src/mame/drivers/decocass.cpp b/src/mame/drivers/decocass.cpp
index df402215443..e091999bbd8 100644
--- a/src/mame/drivers/decocass.cpp
+++ b/src/mame/drivers/decocass.cpp
@@ -988,8 +988,8 @@ MACHINE_CONFIG_START(decocass_state::decocass)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
AY8910(config, "ay1", HCLK2).add_route(ALL_OUTPUTS, "mono", 0.40);
diff --git a/src/mame/drivers/deniam.cpp b/src/mame/drivers/deniam.cpp
index 3a1ac0d5429..c341b2a607e 100644
--- a/src/mame/drivers/deniam.cpp
+++ b/src/mame/drivers/deniam.cpp
@@ -279,8 +279,8 @@ MACHINE_CONFIG_START(deniam_state::deniam16b)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(25'000'000)/6) /* "SM64" ym3812 clone; 4.166470 measured, = 4.166666Mhz verified */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/discoboy.cpp b/src/mame/drivers/discoboy.cpp
index 8f5c87dcfa7..de5bc4d40f9 100644
--- a/src/mame/drivers/discoboy.cpp
+++ b/src/mame/drivers/discoboy.cpp
@@ -486,8 +486,8 @@ MACHINE_CONFIG_START(discoboy_state::discoboy)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(10'000'000)/4) /* 2.5 MHz? */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.6)
diff --git a/src/mame/drivers/divebomb.cpp b/src/mame/drivers/divebomb.cpp
index 284199f4f5c..73d9d3b9b5b 100644
--- a/src/mame/drivers/divebomb.cpp
+++ b/src/mame/drivers/divebomb.cpp
@@ -405,17 +405,15 @@ MACHINE_CONFIG_START(divebomb_state::divebomb)
MCFG_INPUT_MERGER_ANY_HIGH("fgcpu_irq")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("fgcpu", INPUT_LINE_IRQ0))
- MCFG_GENERIC_LATCH_8_ADD("fg2spr")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("spritecpu", INPUT_LINE_IRQ0))
+ GENERIC_LATCH_8(config, "fg2spr").data_pending_callback().set_inputline(m_spritecpu, INPUT_LINE_IRQ0);
- MCFG_GENERIC_LATCH_8_ADD("fg2roz")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("rozcpu", INPUT_LINE_IRQ0))
+ GENERIC_LATCH_8(config, "fg2roz").data_pending_callback().set_inputline(m_rozcpu, INPUT_LINE_IRQ0);
- MCFG_GENERIC_LATCH_8_ADD("spr2fg")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("fgcpu_irq", input_merger_any_high_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_spr2fg_latch);
+ m_spr2fg_latch->data_pending_callback().set(m_fgcpu_irq, FUNC(input_merger_any_high_device::in_w<0>));
- MCFG_GENERIC_LATCH_8_ADD("roz2fg")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("fgcpu_irq", input_merger_any_high_device, in_w<1>))
+ GENERIC_LATCH_8(config, m_roz2fg_latch);
+ m_roz2fg_latch->data_pending_callback().set(m_fgcpu_irq, FUNC(input_merger_any_high_device::in_w<1>));
MCFG_DEVICE_ADD("k051316_1", K051316, 0)
MCFG_GFX_PALETTE("palette")
diff --git a/src/mame/drivers/diverboy.cpp b/src/mame/drivers/diverboy.cpp
index 90bd9101888..e6c8d8303de 100644
--- a/src/mame/drivers/diverboy.cpp
+++ b/src/mame/drivers/diverboy.cpp
@@ -299,7 +299,7 @@ MACHINE_CONFIG_START(diverboy_state::diverboy)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 1320000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
diff --git a/src/mame/drivers/djboy.cpp b/src/mame/drivers/djboy.cpp
index 8a49c17479d..2dd4d4765e4 100644
--- a/src/mame/drivers/djboy.cpp
+++ b/src/mame/drivers/djboy.cpp
@@ -508,11 +508,11 @@ MACHINE_CONFIG_START(djboy_state::djboy)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_GENERIC_LATCH_8_ADD("slavelatch")
+ GENERIC_LATCH_8(config, m_slavelatch);
- MCFG_GENERIC_LATCH_8_ADD("beastlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("beast", INPUT_LINE_IRQ0))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_beastlatch);
+ m_beastlatch->data_pending_callback().set_inputline(m_beast, INPUT_LINE_IRQ0);
+ m_beastlatch->set_separate_acknowledge(true);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(57.5)
@@ -532,8 +532,8 @@ MACHINE_CONFIG_START(djboy_state::djboy)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2203, 3000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
diff --git a/src/mame/drivers/dooyong.cpp b/src/mame/drivers/dooyong.cpp
index f81d5f773b5..a8e5524cdaf 100644
--- a/src/mame/drivers/dooyong.cpp
+++ b/src/mame/drivers/dooyong.cpp
@@ -1434,7 +1434,7 @@ MACHINE_CONFIG_START(dooyong_z80_ym2203_state::sound_2203)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
ym2203_device &ym1(YM2203(config, "ym1", 1500000));
ym1.irq_handler().set("soundirq", FUNC(input_merger_any_high_device::in_w<0>));
@@ -1450,7 +1450,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(dooyong_z80_state::sound_2151)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, 3.579'545_MHz_XTAL)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1464,7 +1464,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(dooyong_state::sound_2151_4mhz)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, 16_MHz_XTAL/4) /* 4MHz (16MHz/4 for most, 8Mhz/2 for Super-X) */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1515,7 +1515,7 @@ MACHINE_CONFIG_START(dooyong_z80_ym2203_state::lastday)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
ym2203_device &ym1(YM2203(config, "ym1", 16_MHz_XTAL/4)); /* 4MHz verified for Last Day / D-day */
ym1.irq_handler().set("soundirq", FUNC(input_merger_any_high_device::in_w<0>));
diff --git a/src/mame/drivers/egghunt.cpp b/src/mame/drivers/egghunt.cpp
index 6b23e6b51de..4fb42efedb0 100644
--- a/src/mame/drivers/egghunt.cpp
+++ b/src/mame/drivers/egghunt.cpp
@@ -456,7 +456,7 @@ MACHINE_CONFIG_START(egghunt_state::egghunt)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 1056000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/eolith.cpp b/src/mame/drivers/eolith.cpp
index 91a603af74f..bc5fcedbaed 100644
--- a/src/mame/drivers/eolith.cpp
+++ b/src/mame/drivers/eolith.cpp
@@ -576,8 +576,7 @@ MACHINE_CONFIG_START(eolith_state::eolith45)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", MCS51_INT0_LINE))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_soundcpu, MCS51_INT0_LINE);
MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000))
MCFG_QS1000_EXTERNAL_ROM(true)
diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp
index 7ae9912fba7..1ef57253fcf 100644
--- a/src/mame/drivers/equites.cpp
+++ b/src/mame/drivers/equites.cpp
@@ -1056,7 +1056,7 @@ MACHINE_CONFIG_START(equites_state::common_sound)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("msm", MSM5232, MSM5232_MAX_CLOCK) // will be adjusted at runtime through PORT_ADJUSTER
MCFG_MSM5232_SET_CAPACITORS(0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6) // verified
diff --git a/src/mame/drivers/esd16.cpp b/src/mame/drivers/esd16.cpp
index 056b535dbb7..48646183323 100644
--- a/src/mame/drivers/esd16.cpp
+++ b/src/mame/drivers/esd16.cpp
@@ -668,7 +668,7 @@ MACHINE_CONFIG_START(esd16_state::esd16)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(16'000'000)/4) /* 4MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
diff --git a/src/mame/drivers/espial.cpp b/src/mame/drivers/espial.cpp
index 848e4e937ff..50f62bf3d74 100644
--- a/src/mame/drivers/espial.cpp
+++ b/src/mame/drivers/espial.cpp
@@ -349,8 +349,8 @@ MACHINE_CONFIG_START(espial_state::espial)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
AY8910(config, "aysnd", 1500000).add_route(ALL_OUTPUTS, "mono", 0.50);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/exedexes.cpp b/src/mame/drivers/exedexes.cpp
index f0d8de76c03..8c7e124b9e0 100644
--- a/src/mame/drivers/exedexes.cpp
+++ b/src/mame/drivers/exedexes.cpp
@@ -252,7 +252,7 @@ MACHINE_CONFIG_START(exedexes_state::exedexes)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
AY8910(config, "aysnd", 1500000).add_route(ALL_OUTPUTS, "mono", 0.10);
diff --git a/src/mame/drivers/exprraid.cpp b/src/mame/drivers/exprraid.cpp
index 145d1fe4fbb..6c4d5e8ea1f 100644
--- a/src/mame/drivers/exprraid.cpp
+++ b/src/mame/drivers/exprraid.cpp
@@ -519,8 +519,8 @@ MACHINE_CONFIG_START(exprraid_state::exprraid)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("slave", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_slave, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(12'000'000) / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
diff --git a/src/mame/drivers/f1gp.cpp b/src/mame/drivers/f1gp.cpp
index bed81f729ef..fa2c4f0b560 100644
--- a/src/mame/drivers/f1gp.cpp
+++ b/src/mame/drivers/f1gp.cpp
@@ -477,9 +477,9 @@ MACHINE_CONFIG_START(f1gp_state::f1gp)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, XTAL(8'000'000))
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/fantland.cpp b/src/mame/drivers/fantland.cpp
index 36301c00534..67ae47255b7 100644
--- a/src/mame/drivers/fantland.cpp
+++ b/src/mame/drivers/fantland.cpp
@@ -839,7 +839,7 @@ MACHINE_CONFIG_START(fantland_state::fantland)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3000000)
MCFG_SOUND_ROUTE(0, "speaker", 0.35)
@@ -884,7 +884,7 @@ MACHINE_CONFIG_START(fantland_state::galaxygn)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3000000)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(*this, fantland_state, galaxygn_sound_irq))
@@ -961,7 +961,7 @@ MACHINE_CONFIG_START(borntofi_state::borntofi)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
// OKI M5205 running at 384kHz [18.432/48]. Sample rate = 384000 / 48
MCFG_DEVICE_ADD("msm1", MSM5205, 384000)
@@ -1013,7 +1013,7 @@ MACHINE_CONFIG_START(fantland_state::wheelrun)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3526, XTAL(14'000'000)/4)
MCFG_YM3526_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/fastfred.cpp b/src/mame/drivers/fastfred.cpp
index 5f674805195..3658ea79234 100644
--- a/src/mame/drivers/fastfred.cpp
+++ b/src/mame/drivers/fastfred.cpp
@@ -673,7 +673,7 @@ MACHINE_CONFIG_START(fastfred_state::fastfred)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
AY8910(config, "ay8910.1", XTAL(12'432'000)/8).add_route(ALL_OUTPUTS, "mono", 0.25); /* 1.554 MHz; xtal from pcb pics, divider not verified */
diff --git a/src/mame/drivers/fcrash.cpp b/src/mame/drivers/fcrash.cpp
index 814f246fc2f..478c3121893 100644
--- a/src/mame/drivers/fcrash.cpp
+++ b/src/mame/drivers/fcrash.cpp
@@ -1705,7 +1705,7 @@ MACHINE_CONFIG_START(cps_state::fcrash)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 24000000/6) /* ? */
MCFG_SOUND_ROUTE(0, "mono", 0.10)
@@ -1768,7 +1768,7 @@ MACHINE_CONFIG_START(cps_state::kodb)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("2151", YM2151, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1809,8 +1809,8 @@ MACHINE_CONFIG_START(cps_state::mtwinsb)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("2151", YM2151, XTAL(3'579'545))
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -1850,7 +1850,7 @@ MACHINE_CONFIG_START(cps_state::sf2mdt)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("2151", YM2151, 3579545)
MCFG_SOUND_ROUTE(0, "mono", 0.35)
@@ -1903,7 +1903,7 @@ MACHINE_CONFIG_START(cps_state::knightsb)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("2151", YM2151, 29821000 / 8)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -2286,7 +2286,7 @@ MACHINE_CONFIG_START(cps_state::dinopic)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
@@ -2475,8 +2475,8 @@ MACHINE_CONFIG_START(cps_state::sgyxz)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("2151", YM2151, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -2600,7 +2600,7 @@ MACHINE_CONFIG_START(cps_state::punipic)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
@@ -2788,8 +2788,8 @@ MACHINE_CONFIG_START(cps_state::sf2m1)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("2151", YM2151, XTAL(3'579'545))
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.35)
@@ -3269,8 +3269,8 @@ MACHINE_CONFIG_START(cps_state::varthb)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("2151", YM2151, XTAL(3'579'545))
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/finalizr.cpp b/src/mame/drivers/finalizr.cpp
index d19c5210829..e7252692072 100644
--- a/src/mame/drivers/finalizr.cpp
+++ b/src/mame/drivers/finalizr.cpp
@@ -297,7 +297,7 @@ MACHINE_CONFIG_START(finalizr_state::finalizr)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("snsnd", SN76489A, XTAL(18'432'000)/12)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp
index 54d91479561..e660eea76cb 100644
--- a/src/mame/drivers/firefox.cpp
+++ b/src/mame/drivers/firefox.cpp
@@ -711,10 +711,10 @@ MACHINE_CONFIG_START(firefox_state::firefox)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("pokey1", POKEY, MASTER_XTAL/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
diff --git a/src/mame/drivers/firetrap.cpp b/src/mame/drivers/firetrap.cpp
index 65f38a8f066..00561eca7e5 100644
--- a/src/mame/drivers/firetrap.cpp
+++ b/src/mame/drivers/firetrap.cpp
@@ -648,8 +648,8 @@ MACHINE_CONFIG_START(firetrap_state::firetrap)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM3526, FIRETRAP_XTAL/4) // 3 MHz
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -693,8 +693,8 @@ MACHINE_CONFIG_START(firetrap_state::firetrapbl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM3526, FIRETRAP_XTAL/4) // 3 MHz
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/flkatck.cpp b/src/mame/drivers/flkatck.cpp
index 0d111f7a17d..1728c860d22 100644
--- a/src/mame/drivers/flkatck.cpp
+++ b/src/mame/drivers/flkatck.cpp
@@ -246,7 +246,7 @@ MACHINE_CONFIG_START(flkatck_state::flkatck)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/flower.cpp b/src/mame/drivers/flower.cpp
index 31e1e357cb1..89f4daff5bb 100644
--- a/src/mame/drivers/flower.cpp
+++ b/src/mame/drivers/flower.cpp
@@ -517,7 +517,7 @@ MACHINE_CONFIG_START(flower_state::flower)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_flower)
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp
index d9a5ba03f1b..b79e7460cf3 100644
--- a/src/mame/drivers/flstory.cpp
+++ b/src/mame/drivers/flstory.cpp
@@ -771,13 +771,13 @@ MACHINE_CONFIG_START(flstory_state::flstory)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_TA7630_ADD("ta7630")
YM2149(config, m_ay, XTAL(8'000'000)/4); /* verified on pcb */
@@ -840,13 +840,13 @@ MACHINE_CONFIG_START(flstory_state::onna34ro)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_TA7630_ADD("ta7630")
YM2149(config, m_ay, XTAL(8'000'000)/4);
@@ -920,13 +920,13 @@ MACHINE_CONFIG_START(flstory_state::victnine)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_TA7630_ADD("ta7630")
YM2149(config, m_ay, XTAL(8'000'000)/4);
@@ -993,13 +993,13 @@ MACHINE_CONFIG_START(flstory_state::rumba)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_TA7630_ADD("ta7630")
YM2149(config, m_ay, XTAL(8'000'000)/4); /* verified on pcb */
diff --git a/src/mame/drivers/fromanc2.cpp b/src/mame/drivers/fromanc2.cpp
index 0bc5fdb4fa4..a030b6f59e5 100644
--- a/src/mame/drivers/fromanc2.cpp
+++ b/src/mame/drivers/fromanc2.cpp
@@ -551,8 +551,8 @@ MACHINE_CONFIG_START(fromanc2_state::fromanc2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -611,8 +611,8 @@ MACHINE_CONFIG_START(fromanc2_state::fromancr)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -672,8 +672,8 @@ MACHINE_CONFIG_START(fromanc2_state::fromanc4)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/fromance.cpp b/src/mame/drivers/fromance.cpp
index 6398d375e63..b5e6f8d42af 100644
--- a/src/mame/drivers/fromance.cpp
+++ b/src/mame/drivers/fromance.cpp
@@ -911,8 +911,8 @@ MACHINE_CONFIG_START(fromance_state::nekkyoku)
MCFG_DEVICE_PROGRAM_MAP(nekkyoku_sub_map)
MCFG_DEVICE_IO_MAP(nekkyoku_sub_io_map)
- MCFG_GENERIC_LATCH_8_ADD("sublatch")
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_sublatch);
+ m_sublatch->set_separate_acknowledge(true);
MCFG_MACHINE_START_OVERRIDE(fromance_state,fromance)
MCFG_MACHINE_RESET_OVERRIDE(fromance_state,fromance)
@@ -956,8 +956,8 @@ MACHINE_CONFIG_START(fromance_state::idolmj)
MCFG_DEVICE_PROGRAM_MAP(fromance_sub_map)
MCFG_DEVICE_IO_MAP(idolmj_sub_io_map)
- MCFG_GENERIC_LATCH_8_ADD("sublatch")
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_sublatch);
+ m_sublatch->set_separate_acknowledge(true);
MCFG_MACHINE_START_OVERRIDE(fromance_state,fromance)
MCFG_MACHINE_RESET_OVERRIDE(fromance_state,fromance)
@@ -1001,8 +1001,8 @@ MACHINE_CONFIG_START(fromance_state::fromance)
MCFG_DEVICE_PROGRAM_MAP(fromance_sub_map)
MCFG_DEVICE_IO_MAP(fromance_sub_io_map)
- MCFG_GENERIC_LATCH_8_ADD("sublatch")
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_sublatch);
+ m_sublatch->set_separate_acknowledge(true);
MCFG_MACHINE_START_OVERRIDE(fromance_state,fromance)
MCFG_MACHINE_RESET_OVERRIDE(fromance_state,fromance)
diff --git a/src/mame/drivers/funybubl.cpp b/src/mame/drivers/funybubl.cpp
index 59b316358c0..407f1a8b88d 100644
--- a/src/mame/drivers/funybubl.cpp
+++ b/src/mame/drivers/funybubl.cpp
@@ -247,8 +247,8 @@ MACHINE_CONFIG_START(funybubl_state::funybubl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("oki", OKIM6295, 8000000/8, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_DEVICE_ADDRESS_MAP(0, oki_map)
diff --git a/src/mame/drivers/fuukifg2.cpp b/src/mame/drivers/fuukifg2.cpp
index f5047c01b11..7f98f421c99 100644
--- a/src/mame/drivers/fuukifg2.cpp
+++ b/src/mame/drivers/fuukifg2.cpp
@@ -473,7 +473,7 @@ MACHINE_CONFIG_START(fuuki16_state::fuuki16)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(28'640'000) / 8) /* 3.58 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
diff --git a/src/mame/drivers/gaelco.cpp b/src/mame/drivers/gaelco.cpp
index a0c78b3cfd0..9a9988de55d 100644
--- a/src/mame/drivers/gaelco.cpp
+++ b/src/mame/drivers/gaelco.cpp
@@ -680,8 +680,8 @@ MACHINE_CONFIG_START(gaelco_state::bigkarnk)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, M6809_FIRQ_LINE);
MCFG_DEVICE_ADD("ymsnd", YM3812, 3580000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/gaiden.cpp b/src/mame/drivers/gaiden.cpp
index 67daef9ff66..129a1bc0ca1 100644
--- a/src/mame/drivers/gaiden.cpp
+++ b/src/mame/drivers/gaiden.cpp
@@ -793,8 +793,7 @@ MACHINE_CONFIG_START(gaiden_state::shadoww)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, 4000000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -873,8 +872,7 @@ MACHINE_CONFIG_START(gaiden_state::drgnbowl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM2151, 4000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
@@ -1033,8 +1031,7 @@ MACHINE_CONFIG_START(gaiden_state::mastninj)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0);
// YM2203 clocks chosen by analogy with Automat; actual rate unknown, but 4 MHz is obviously too fast
MCFG_DEVICE_ADD("ym1", YM2203, 1250000)
diff --git a/src/mame/drivers/galivan.cpp b/src/mame/drivers/galivan.cpp
index 067f9f1088b..c48aecdf6c0 100644
--- a/src/mame/drivers/galivan.cpp
+++ b/src/mame/drivers/galivan.cpp
@@ -467,7 +467,7 @@ MACHINE_CONFIG_START(galivan_state::galivan)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3526, XTAL(8'000'000)/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
@@ -527,7 +527,7 @@ MACHINE_CONFIG_START(galivan_state::ninjemak)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3526, XTAL(8'000'000)/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
diff --git a/src/mame/drivers/galspnbl.cpp b/src/mame/drivers/galspnbl.cpp
index 477a3047f76..1af7014c8c2 100644
--- a/src/mame/drivers/galspnbl.cpp
+++ b/src/mame/drivers/galspnbl.cpp
@@ -250,7 +250,7 @@ MACHINE_CONFIG_START(galspnbl_state::galspnbl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(4'000'000)) /* Use value from Super Pinball Action - NEEDS VERIFICATION!! */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/ghosteo.cpp b/src/mame/drivers/ghosteo.cpp
index 65c493c5e9a..38455847fb3 100644
--- a/src/mame/drivers/ghosteo.cpp
+++ b/src/mame/drivers/ghosteo.cpp
@@ -639,9 +639,9 @@ MACHINE_CONFIG_START(ghosteo_state::ghosteo)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("qs1000", qs1000_device, set_irq))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("qs1000", FUNC(qs1000_device::set_irq));
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000))
MCFG_QS1000_EXTERNAL_ROM(true)
diff --git a/src/mame/drivers/gng.cpp b/src/mame/drivers/gng.cpp
index 690d88dca4f..bbd9b6e9ba2 100644
--- a/src/mame/drivers/gng.cpp
+++ b/src/mame/drivers/gng.cpp
@@ -416,7 +416,7 @@ MACHINE_CONFIG_START(gng_state::gng)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(12'000'000)/8) /* verified on pcb */
MCFG_SOUND_ROUTE(0, "mono", 0.40)
diff --git a/src/mame/drivers/go2000.cpp b/src/mame/drivers/go2000.cpp
index 881280d7a13..de547825625 100644
--- a/src/mame/drivers/go2000.cpp
+++ b/src/mame/drivers/go2000.cpp
@@ -368,7 +368,7 @@ MACHINE_CONFIG_START(go2000_state::go2000)
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
SPEAKER(config, "speaker").front_center();
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.25) // unknown DAC
diff --git a/src/mame/drivers/goal92.cpp b/src/mame/drivers/goal92.cpp
index 5e9c6cc533a..4762d55d954 100644
--- a/src/mame/drivers/goal92.cpp
+++ b/src/mame/drivers/goal92.cpp
@@ -325,7 +325,7 @@ MACHINE_CONFIG_START(goal92_state::goal92)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 2500000/2)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(*this, goal92_state, irqhandler))
diff --git a/src/mame/drivers/goindol.cpp b/src/mame/drivers/goindol.cpp
index f687ac48942..388b1976c03 100644
--- a/src/mame/drivers/goindol.cpp
+++ b/src/mame/drivers/goindol.cpp
@@ -262,7 +262,7 @@ MACHINE_CONFIG_START(goindol_state::goindol)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(12'000'000)/8) /* Confirmed pitch from recording */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/gotcha.cpp b/src/mame/drivers/gotcha.cpp
index 6a946514a9a..099fa5815dd 100644
--- a/src/mame/drivers/gotcha.cpp
+++ b/src/mame/drivers/gotcha.cpp
@@ -293,7 +293,7 @@ MACHINE_CONFIG_START(gotcha_state::gotcha)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, 14318180/4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/gradius3.cpp b/src/mame/drivers/gradius3.cpp
index 1cea45f628e..eadbc2855f9 100644
--- a/src/mame/drivers/gradius3.cpp
+++ b/src/mame/drivers/gradius3.cpp
@@ -326,7 +326,7 @@ MACHINE_CONFIG_START(gradius3_state::gradius3)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/gstriker.cpp b/src/mame/drivers/gstriker.cpp
index 053bb44d477..492cbee9faf 100644
--- a/src/mame/drivers/gstriker.cpp
+++ b/src/mame/drivers/gstriker.cpp
@@ -542,9 +542,9 @@ MACHINE_CONFIG_START(gstriker_state::base)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/gunsmoke.cpp b/src/mame/drivers/gunsmoke.cpp
index 68156d4f9c9..6e3e86be024 100644
--- a/src/mame/drivers/gunsmoke.cpp
+++ b/src/mame/drivers/gunsmoke.cpp
@@ -332,7 +332,7 @@ MACHINE_CONFIG_START(gunsmoke_state::gunsmoke)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(0, "mono", 0.22)
diff --git a/src/mame/drivers/hcastle.cpp b/src/mame/drivers/hcastle.cpp
index 34672ff0a32..7c6f2cd9326 100644
--- a/src/mame/drivers/hcastle.cpp
+++ b/src/mame/drivers/hcastle.cpp
@@ -225,7 +225,7 @@ MACHINE_CONFIG_START(hcastle_state::hcastle)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("k007232", K007232, 3579545)
MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, hcastle_state, volume_callback))
diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp
index 3baefb4f54f..35c30d63887 100644
--- a/src/mame/drivers/hh_hmcs40.cpp
+++ b/src/mame/drivers/hh_hmcs40.cpp
@@ -1868,8 +1868,8 @@ MACHINE_CONFIG_START(pairmtch_state::pairmtch)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/himesiki.cpp b/src/mame/drivers/himesiki.cpp
index 99054c5fed5..9f358699ba2 100644
--- a/src/mame/drivers/himesiki.cpp
+++ b/src/mame/drivers/himesiki.cpp
@@ -465,7 +465,7 @@ MACHINE_CONFIG_START(himesiki_state::himesiki)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym2203", YM2203, CLK2/4) // ??
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("sub", 0))
diff --git a/src/mame/drivers/homedata.cpp b/src/mame/drivers/homedata.cpp
index c3b83d15c18..c355807717d 100644
--- a/src/mame/drivers/homedata.cpp
+++ b/src/mame/drivers/homedata.cpp
@@ -1247,7 +1247,7 @@ MACHINE_CONFIG_START(homedata_state::mrokumei)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("snsnd", SN76489A, 16000000/4) // SN76489AN actually
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
diff --git a/src/mame/drivers/hvyunit.cpp b/src/mame/drivers/hvyunit.cpp
index c8831beb1b9..96bf825d958 100644
--- a/src/mame/drivers/hvyunit.cpp
+++ b/src/mame/drivers/hvyunit.cpp
@@ -645,10 +645,10 @@ MACHINE_CONFIG_START(hvyunit_state::hvyunit)
MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, hvyunit_state, mermaid_p3_r))
MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, hvyunit_state, mermaid_p3_w))
- MCFG_GENERIC_LATCH_8_ADD("mermaidlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("mermaid", INPUT_LINE_IRQ0))
+ GENERIC_LATCH_8(config, m_mermaidlatch);
+ m_mermaidlatch->data_pending_callback().set_inputline(m_mermaid, INPUT_LINE_IRQ0);
- MCFG_GENERIC_LATCH_8_ADD("slavelatch")
+ GENERIC_LATCH_8(config, m_slavelatch);
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
@@ -671,8 +671,8 @@ MACHINE_CONFIG_START(hvyunit_state::hvyunit)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(12'000'000)/4) /* 3MHz verified on PCB */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/drivers/hyperspt.cpp b/src/mame/drivers/hyperspt.cpp
index 2d2b5aa13a2..422e0a8aec9 100644
--- a/src/mame/drivers/hyperspt.cpp
+++ b/src/mame/drivers/hyperspt.cpp
@@ -332,7 +332,7 @@ MACHINE_CONFIG_START(hyperspt_state::hyperspt)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD(m_soundbrd, TRACKFLD_AUDIO, 0, m_audiocpu, m_vlm)
@@ -380,7 +380,7 @@ MACHINE_CONFIG_START(hyperspt_state::hypersptb)
MCFG_DEVICE_ADD("adpcm", M6802, XTAL(14'318'181)/8) /* unknown clock */
MCFG_DEVICE_PROGRAM_MAP(hyprolyb_adpcm_map)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("hyprolyb_adpcm", HYPROLYB_ADPCM, 0)
diff --git a/src/mame/drivers/inufuku.cpp b/src/mame/drivers/inufuku.cpp
index 28425002790..f84756dfdbd 100644
--- a/src/mame/drivers/inufuku.cpp
+++ b/src/mame/drivers/inufuku.cpp
@@ -372,9 +372,9 @@ MACHINE_CONFIG_START(inufuku_state::inufuku)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, 32000000/4)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/istellar.cpp b/src/mame/drivers/istellar.cpp
index 5e5209c3ad9..766d8a7e9b1 100644
--- a/src/mame/drivers/istellar.cpp
+++ b/src/mame/drivers/istellar.cpp
@@ -35,7 +35,7 @@ class istellar_state : public driver_device
public:
istellar_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_laserdisc(*this, "laserdisc") ,
+ m_laserdisc(*this, "laserdisc") ,
m_tile_ram(*this, "tile_ram"),
m_tile_control_ram(*this, "tile_ctrl_ram"),
m_sprite_ram(*this, "sprite_ram"),
@@ -289,11 +289,11 @@ MACHINE_CONFIG_START(istellar_state::istellar)
MCFG_DEVICE_PROGRAM_MAP(z80_2_mem)
MCFG_DEVICE_IO_MAP(z80_2_io)
- MCFG_GENERIC_LATCH_8_ADD("latch1")
+ GENERIC_LATCH_8(config, "latch1");
- MCFG_GENERIC_LATCH_8_ADD("latch2")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("sub", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &latch2(GENERIC_LATCH_8(config, "latch2"));
+ latch2.data_pending_callback().set_inputline(m_subcpu, INPUT_LINE_NMI);
+ latch2.set_separate_acknowledge(true);
MCFG_LASERDISC_LDV1000_ADD("laserdisc")
MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, istellar_state, screen_update_istellar)
diff --git a/src/mame/drivers/jack.cpp b/src/mame/drivers/jack.cpp
index 69cb6553304..51aee2349fc 100644
--- a/src/mame/drivers/jack.cpp
+++ b/src/mame/drivers/jack.cpp
@@ -939,8 +939,8 @@ MACHINE_CONFIG_START(jack_state::jack)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(ASSERTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0, ASSERT_LINE);
ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(18'000'000)/12));
aysnd.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
diff --git a/src/mame/drivers/kaneko16.cpp b/src/mame/drivers/kaneko16.cpp
index 86210b5de5d..f7ae7585f58 100644
--- a/src/mame/drivers/kaneko16.cpp
+++ b/src/mame/drivers/kaneko16.cpp
@@ -1949,8 +1949,8 @@ MACHINE_CONFIG_START(kaneko16_state::blazeon)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD(m_ymsnd, YM2151, 4000000)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
@@ -2004,8 +2004,8 @@ MACHINE_CONFIG_START(kaneko16_state::wingforc)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
YM2151(config, m_ymsnd, XTAL(16'000'000)/4);
m_ymsnd->add_route(ALL_OUTPUTS, "mono", 0.4);
diff --git a/src/mame/drivers/karnov.cpp b/src/mame/drivers/karnov.cpp
index 057c289232f..47ca81c4310 100644
--- a/src/mame/drivers/karnov.cpp
+++ b/src/mame/drivers/karnov.cpp
@@ -843,8 +843,8 @@ MACHINE_CONFIG_START(karnov_state::karnov)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
@@ -921,8 +921,8 @@ MACHINE_CONFIG_START(karnov_state::wndrplnt)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/kchamp.cpp b/src/mame/drivers/kchamp.cpp
index ac5407e5a88..ef01ebc9eb5 100644
--- a/src/mame/drivers/kchamp.cpp
+++ b/src/mame/drivers/kchamp.cpp
@@ -442,8 +442,8 @@ MACHINE_CONFIG_START(kchamp_state::kchampvs)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
AY8910(config, m_ay[0], XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "speaker", 0.3); /* verified on pcb */
@@ -500,8 +500,8 @@ MACHINE_CONFIG_START(kchamp_state::kchamp)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
AY8910(config, m_ay[0], XTAL(12'000'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.3); /* Guess based on actual pcb recordings of karatedo */
diff --git a/src/mame/drivers/kickgoal.cpp b/src/mame/drivers/kickgoal.cpp
index 70b4c5bca19..e5167545cef 100644
--- a/src/mame/drivers/kickgoal.cpp
+++ b/src/mame/drivers/kickgoal.cpp
@@ -665,7 +665,7 @@ MACHINE_CONFIG_START(kickgoal_state::kickgoal)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- //MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ //GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("oki", OKIM6295, 12000000/8, okim6295_device::PIN7_LOW)
MCFG_DEVICE_ADDRESS_MAP(0, oki_map)
@@ -703,7 +703,7 @@ MACHINE_CONFIG_START(kickgoal_state::actionhw)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- //MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ //GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(12'000'000)/12, okim6295_device::PIN7_HIGH) /* verified on pcb */
MCFG_DEVICE_ADDRESS_MAP(0, oki_map)
diff --git a/src/mame/drivers/lasso.cpp b/src/mame/drivers/lasso.cpp
index 3a1d4d2f75c..82992ea8cd6 100644
--- a/src/mame/drivers/lasso.cpp
+++ b/src/mame/drivers/lasso.cpp
@@ -517,7 +517,7 @@ MACHINE_CONFIG_START(lasso_state::base)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("sn76489.1", SN76489, 2000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
diff --git a/src/mame/drivers/lastbank.cpp b/src/mame/drivers/lastbank.cpp
index 3327a59a2c8..45f3ca7b410 100644
--- a/src/mame/drivers/lastbank.cpp
+++ b/src/mame/drivers/lastbank.cpp
@@ -552,8 +552,8 @@ MACHINE_CONFIG_START(lastbank_state::lastbank)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch1");
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
diff --git a/src/mame/drivers/lastduel.cpp b/src/mame/drivers/lastduel.cpp
index 3891a3271e5..65ff04e1854 100644
--- a/src/mame/drivers/lastduel.cpp
+++ b/src/mame/drivers/lastduel.cpp
@@ -549,7 +549,7 @@ MACHINE_CONFIG_START(lastduel_state::lastduel)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(3'579'545))
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -595,7 +595,7 @@ MACHINE_CONFIG_START(lastduel_state::madgear)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(3'579'545))
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/lemmings.cpp b/src/mame/drivers/lemmings.cpp
index bce2f4b85ed..d5fa8836049 100644
--- a/src/mame/drivers/lemmings.cpp
+++ b/src/mame/drivers/lemmings.cpp
@@ -258,7 +258,7 @@ MACHINE_CONFIG_START(lemmings_state::lemmings)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 32220000/9)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/limenko.cpp b/src/mame/drivers/limenko.cpp
index 675301cda37..3a709cd28d9 100644
--- a/src/mame/drivers/limenko.cpp
+++ b/src/mame/drivers/limenko.cpp
@@ -730,9 +730,9 @@ MACHINE_CONFIG_START(limenko_state::limenko)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("qs1000", qs1000_device, set_irq))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("qs1000", FUNC(qs1000_device::set_irq));
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000))
MCFG_QS1000_EXTERNAL_ROM(true)
@@ -775,7 +775,7 @@ MACHINE_CONFIG_START(limenko_state::spotty)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 4000000 / 4 , okim6295_device::PIN7_HIGH) //?
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/lkage.cpp b/src/mame/drivers/lkage.cpp
index 30c3d3b53c1..93f24ec5fc8 100644
--- a/src/mame/drivers/lkage.cpp
+++ b/src/mame/drivers/lkage.cpp
@@ -519,8 +519,8 @@ MACHINE_CONFIG_START(lkage_state::lkage)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
@@ -570,8 +570,8 @@ MACHINE_CONFIG_START(lkage_state::lkageb)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/lordgun.cpp b/src/mame/drivers/lordgun.cpp
index 877342c8528..da2837287ea 100644
--- a/src/mame/drivers/lordgun.cpp
+++ b/src/mame/drivers/lordgun.cpp
@@ -671,8 +671,8 @@ MACHINE_CONFIG_START(lordgun_state::lordgun)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(3'579'545))
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
@@ -725,8 +725,8 @@ MACHINE_CONFIG_START(lordgun_state::aliencha)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, m_soundlatch2);
MCFG_DEVICE_ADD("ymf", YMF278B, XTAL(33'868'800)) // ? 33.8688MHz matches video (decrease for faster music tempo)
MCFG_DEVICE_ADDRESS_MAP(0, ymf278_map)
diff --git a/src/mame/drivers/lsasquad.cpp b/src/mame/drivers/lsasquad.cpp
index 38fceed971c..d1ed476bdfe 100644
--- a/src/mame/drivers/lsasquad.cpp
+++ b/src/mame/drivers/lsasquad.cpp
@@ -575,13 +575,13 @@ MACHINE_CONFIG_START(lsasquad_state::lsasquad)
MCFG_MACHINE_START_OVERRIDE(lsasquad_state,lsasquad)
MCFG_MACHINE_RESET_OVERRIDE(lsasquad_state,lsasquad)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch2);
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -641,8 +641,8 @@ MACHINE_CONFIG_START(lsasquad_state::daikaiju)
MCFG_MACHINE_START_OVERRIDE(lsasquad_state,lsasquad)
MCFG_MACHINE_RESET_OVERRIDE(lsasquad_state,lsasquad)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/lwings.cpp b/src/mame/drivers/lwings.cpp
index 82ae08e5430..68b61a7cd9e 100644
--- a/src/mame/drivers/lwings.cpp
+++ b/src/mame/drivers/lwings.cpp
@@ -964,7 +964,7 @@ MACHINE_CONFIG_START(lwings_state::lwings)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("2203a", YM2203, XTAL(12'000'000)/8) /* verified on PCB */
MCFG_SOUND_ROUTE(0, "mono", 0.20)
@@ -1014,7 +1014,7 @@ MACHINE_CONFIG_START(lwings_state::fball)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(12'000'000)/12, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -1048,7 +1048,7 @@ MACHINE_CONFIG_START(lwings_state::trojan)
/* sound hardware */
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("5205", MSM5205, XTAL(384'000)) /* verified on PCB */
MCFG_MSM5205_PRESCALER_SELECTOR(SEX_4B) /* slave mode */
diff --git a/src/mame/drivers/m107.cpp b/src/mame/drivers/m107.cpp
index c2c2b523660..7abdc485c7a 100644
--- a/src/mame/drivers/m107.cpp
+++ b/src/mame/drivers/m107.cpp
@@ -767,12 +767,11 @@ MACHINE_CONFIG_START(m107_state::firebarr)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP1))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set_inputline(m_soundcpu, NEC_INPUT_LINE_INTP1);
+ soundlatch.set_separate_acknowledge(true);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE(m_upd71059c, pic8259_device, ir3_w))
+ GENERIC_LATCH_8(config, "soundlatch2").data_pending_callback().set(m_upd71059c, FUNC(pic8259_device::ir3_w));
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(14'318'181)/4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP0))
diff --git a/src/mame/drivers/m63.cpp b/src/mame/drivers/m63.cpp
index f29c7a644fa..ed406b7ac5d 100644
--- a/src/mame/drivers/m63.cpp
+++ b/src/mame/drivers/m63.cpp
@@ -799,7 +799,7 @@ MACHINE_CONFIG_START(m63_state::m63)
/* sound hardware */
SPEAKER(config, "mono").front_center(); /* ????? */
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
AY8910(config, m_ay1, XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.25);
@@ -848,7 +848,7 @@ MACHINE_CONFIG_START(m63_state::fghtbskt)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
AY8910(config, m_ay1, XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 1.0);
diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp
index 1d0c385a0c9..60e6c98ccad 100644
--- a/src/mame/drivers/m72.cpp
+++ b/src/mame/drivers/m72.cpp
@@ -1806,9 +1806,9 @@ MACHINE_CONFIG_START(m72_state::m72_audio_chips)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundirq", rst_neg_buffer_device, rst18_w))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set("soundirq", FUNC(rst_neg_buffer_device::rst18_w));
+ soundlatch.set_separate_acknowledge(true);
RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline(m_soundcpu, 0);
@@ -1871,9 +1871,9 @@ MACHINE_CONFIG_START(m72_state::m72_8751)
//m_dpram->intl_callback().set(m_upd71059c, FUNC(pic8259_device::ir3_w)); // not actually used?
m_dpram->intr_callback().set_inputline("mcu", MCS51_INT0_LINE);
- MCFG_GENERIC_LATCH_8_ADD("mculatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("mcu", MCS51_INT1_LINE))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &mculatch(GENERIC_LATCH_8(config, "mculatch"));
+ mculatch.data_pending_callback().set_inputline(m_mcu, MCS51_INT1_LINE);
+ mculatch.set_separate_acknowledge(true);
MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000)) /* Uses its own XTAL */
MCFG_DEVICE_IO_MAP(mcu_io_map)
diff --git a/src/mame/drivers/m90.cpp b/src/mame/drivers/m90.cpp
index c63cdd8df10..8e41e64b154 100644
--- a/src/mame/drivers/m90.cpp
+++ b/src/mame/drivers/m90.cpp
@@ -760,9 +760,9 @@ MACHINE_CONFIG_START(m90_state::m90)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundirq", rst_neg_buffer_device, rst18_w))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set("soundirq", FUNC(rst_neg_buffer_device::rst18_w));
+ soundlatch.set_separate_acknowledge(true);
RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline(m_soundcpu, 0);
@@ -876,9 +876,9 @@ MACHINE_CONFIG_START(m90_state::dynablsb)
MCFG_DEVICE_REMOVE("m72")
MCFG_DEVICE_REMOVE("soundirq")
- MCFG_DEVICE_MODIFY("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(false)
+ auto &soundlatch(*subdevice<generic_latch_8_device>("soundlatch"));
+ soundlatch.data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
+ soundlatch.set_separate_acknowledge(false);
MCFG_DEVICE_MODIFY("ymsnd")
MCFG_YM2151_IRQ_HANDLER(NOOP) /* this bootleg polls the YM2151 instead of taking interrupts from it */
diff --git a/src/mame/drivers/m92.cpp b/src/mame/drivers/m92.cpp
index 293470ccb66..d5764aa32d3 100644
--- a/src/mame/drivers/m92.cpp
+++ b/src/mame/drivers/m92.cpp
@@ -952,12 +952,11 @@ MACHINE_CONFIG_START(m92_state::m92)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP1))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set_inputline(m_soundcpu, NEC_INPUT_LINE_INTP1);
+ soundlatch.set_separate_acknowledge(true);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE(m_upd71059c, pic8259_device, ir3_w))
+ GENERIC_LATCH_8(config, "soundlatch2").data_pending_callback().set(m_upd71059c, FUNC(pic8259_device::ir3_w));
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(14'318'181)/4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP0))
@@ -1081,8 +1080,7 @@ MACHINE_CONFIG_START(m92_state::nbbatman2bl)
/* 8951 MCU as sound CPU */
/* OKI6295 (AD-65) as sound */
- MCFG_DEVICE_MODIFY("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(NOOP)
+ subdevice<generic_latch_8_device>("soundlatch")->data_pending_callback().set_nop();
MACHINE_CONFIG_END
MACHINE_CONFIG_START(m92_state::psoldier)
diff --git a/src/mame/drivers/macrossp.cpp b/src/mame/drivers/macrossp.cpp
index 0ac3136fece..14c5f7251e3 100644
--- a/src/mame/drivers/macrossp.cpp
+++ b/src/mame/drivers/macrossp.cpp
@@ -570,7 +570,7 @@ MACHINE_CONFIG_START(macrossp_state::macrossp)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ GENERIC_LATCH_16(config, m_soundlatch);
MCFG_DEVICE_ADD("ensoniq", ES5506, 16000000)
MCFG_ES5506_REGION0("ensoniq.0")
diff --git a/src/mame/drivers/madmotor.cpp b/src/mame/drivers/madmotor.cpp
index 921471b9f71..a04bb19a0cc 100644
--- a/src/mame/drivers/madmotor.cpp
+++ b/src/mame/drivers/madmotor.cpp
@@ -300,8 +300,7 @@ MACHINE_CONFIG_START(madmotor_state::madmotor)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ym1", YM2203, 21470000/6)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
diff --git a/src/mame/drivers/mainevt.cpp b/src/mame/drivers/mainevt.cpp
index 94b5cd148fb..97312ca768c 100644
--- a/src/mame/drivers/mainevt.cpp
+++ b/src/mame/drivers/mainevt.cpp
@@ -460,7 +460,7 @@ MACHINE_CONFIG_START(mainevt_state::mainevt)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("k007232", K007232, 3.579545_MHz_XTAL)
MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, mainevt_state, volume_callback))
@@ -511,7 +511,7 @@ MACHINE_CONFIG_START(mainevt_state::devstors)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, 3.579545_MHz_XTAL)
MCFG_SOUND_ROUTE(0, "mono", 0.30)
diff --git a/src/mame/drivers/matmania.cpp b/src/mame/drivers/matmania.cpp
index 388229a2c2c..b5c3fd5f4d1 100644
--- a/src/mame/drivers/matmania.cpp
+++ b/src/mame/drivers/matmania.cpp
@@ -370,7 +370,7 @@ MACHINE_CONFIG_START(matmania_state::maniach)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3526, 3600000)
MCFG_YM3526_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
diff --git a/src/mame/drivers/mcatadv.cpp b/src/mame/drivers/mcatadv.cpp
index 44c1f30e5e2..bc140379566 100644
--- a/src/mame/drivers/mcatadv.cpp
+++ b/src/mame/drivers/mcatadv.cpp
@@ -466,10 +466,9 @@ MACHINE_CONFIG_START(mcatadv_state::mcatadv)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ymsnd", YM2610, XTAL(16'000'000)/2) /* verified on pcb */
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/megasys1.cpp b/src/mame/drivers/megasys1.cpp
index 511cacd6981..48b7efa4904 100644
--- a/src/mame/drivers/megasys1.cpp
+++ b/src/mame/drivers/megasys1.cpp
@@ -1719,8 +1719,8 @@ MACHINE_CONFIG_START(megasys1_state::system_A)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
- MCFG_GENERIC_LATCH_16_ADD("soundlatch2")
+ GENERIC_LATCH_16(config, m_soundlatch);
+ GENERIC_LATCH_16(config, m_soundlatch2);
MCFG_DEVICE_ADD("ymsnd", YM2151, SOUND_CPU_CLOCK/2) /* 3.5MHz (7MHz / 2) verified */
MCFG_YM2151_IRQ_HANDLER(WRITELINE(*this, megasys1_state,sound_irq))
@@ -1953,7 +1953,7 @@ MACHINE_CONFIG_START(megasys1_state::system_Z)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch_z")
+ GENERIC_LATCH_8(config, m_soundlatch_z);
MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/meijinsn.cpp b/src/mame/drivers/meijinsn.cpp
index 37910ccabb1..7e6beb344d2 100644
--- a/src/mame/drivers/meijinsn.cpp
+++ b/src/mame/drivers/meijinsn.cpp
@@ -387,7 +387,7 @@ MACHINE_CONFIG_START(meijinsn_state::meijinsn)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
ay8910_device &aysnd(AY8910(config, "aysnd", 2000000));
aysnd.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp
index 4ec8f31ea33..cf12a860470 100644
--- a/src/mame/drivers/metro.cpp
+++ b/src/mame/drivers/metro.cpp
@@ -3252,7 +3252,7 @@ MACHINE_CONFIG_START(metro_state::daitorid)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3.579545_MHz_XTAL)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", UPD7810_INTF2))
@@ -3292,7 +3292,7 @@ MACHINE_CONFIG_START(metro_state::dharma)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // sample rate = M6295 clock / 132
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
@@ -3319,7 +3319,7 @@ MACHINE_CONFIG_START(metro_state::karatour)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
@@ -3347,7 +3347,7 @@ MACHINE_CONFIG_START(metro_state::sankokushi)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
@@ -3375,7 +3375,7 @@ MACHINE_CONFIG_START(metro_state::lastfort)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_LOW) // sample rate = M6295 clock / 165
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
@@ -3401,7 +3401,7 @@ MACHINE_CONFIG_START(metro_state::lastforg)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
@@ -3536,7 +3536,7 @@ MACHINE_CONFIG_START(metro_state::pangpoms)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
@@ -3564,7 +3564,7 @@ MACHINE_CONFIG_START(metro_state::poitto)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
@@ -3592,7 +3592,7 @@ MACHINE_CONFIG_START(metro_state::pururun)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3.579545_MHz_XTAL) /* Confirmed match to reference video */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", UPD7810_INTF2))
@@ -3620,7 +3620,7 @@ MACHINE_CONFIG_START(metro_state::skyalert)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_LOW) // sample rate = M6295 clock / 165
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
@@ -3648,7 +3648,7 @@ MACHINE_CONFIG_START(metro_state::toride2g)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
@@ -3756,8 +3756,8 @@ MACHINE_CONFIG_START(metro_state::blzntrnd)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2610, 16_MHz_XTAL/2)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/midyunit.cpp b/src/mame/drivers/midyunit.cpp
index 699063c0d03..c5d9035e761 100644
--- a/src/mame/drivers/midyunit.cpp
+++ b/src/mame/drivers/midyunit.cpp
@@ -1278,7 +1278,7 @@ MACHINE_CONFIG_START(midyunit_state::mkyawdim)
/* sound hardware */
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(8'000'000) / 8, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
diff --git a/src/mame/drivers/mikie.cpp b/src/mame/drivers/mikie.cpp
index 613f2f3f4b1..42a3acd0156 100644
--- a/src/mame/drivers/mikie.cpp
+++ b/src/mame/drivers/mikie.cpp
@@ -295,7 +295,7 @@ MACHINE_CONFIG_START(mikie_state::mikie)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("sn1", SN76489A, XTAL/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
diff --git a/src/mame/drivers/missb2.cpp b/src/mame/drivers/missb2.cpp
index 94f7686f133..93cc408cc0a 100644
--- a/src/mame/drivers/missb2.cpp
+++ b/src/mame/drivers/missb2.cpp
@@ -510,10 +510,10 @@ MACHINE_CONFIG_START(missb2_state::missb2)
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_8_ADD("main_to_sound")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<1>))
+ GENERIC_LATCH_8(config, m_main_to_sound);
+ m_main_to_sound->data_pending_callback().set(m_soundnmi, FUNC(input_merger_device::in_w<1>));
- MCFG_GENERIC_LATCH_8_ADD("sound_to_main")
+ GENERIC_LATCH_8(config, m_sound_to_main);
MCFG_DEVICE_ADD("ymsnd", YM3526, MAIN_XTAL/8)
MCFG_YM3526_IRQ_HANDLER(WRITELINE(*this, missb2_state, irqhandler))
diff --git a/src/mame/drivers/mitchell.cpp b/src/mame/drivers/mitchell.cpp
index 7c15b8873ec..1b552d77dd5 100644
--- a/src/mame/drivers/mitchell.cpp
+++ b/src/mame/drivers/mitchell.cpp
@@ -1294,8 +1294,8 @@ MACHINE_CONFIG_START(mitchell_state::spangbl)
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_spangbl)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_REMOVE("oki")
MCFG_DEVICE_ADD("msm", MSM5205, 400000) // clock and prescaler unknown
@@ -1353,7 +1353,7 @@ MACHINE_CONFIG_START(mitchell_state::mstworld)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 990000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
diff --git a/src/mame/drivers/mouser.cpp b/src/mame/drivers/mouser.cpp
index a4fa0b228c2..253fd39f026 100644
--- a/src/mame/drivers/mouser.cpp
+++ b/src/mame/drivers/mouser.cpp
@@ -207,8 +207,7 @@ MACHINE_CONFIG_START(mouser_state::mouser)
mainlatch.q_out_cb<1>().set(FUNC(mouser_state::flip_screen_x_w));
mainlatch.q_out_cb<2>().set(FUNC(mouser_state::flip_screen_y_w));
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0);
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/ms32.cpp b/src/mame/drivers/ms32.cpp
index e42f1d03e13..582a0457c85 100644
--- a/src/mame/drivers/ms32.cpp
+++ b/src/mame/drivers/ms32.cpp
@@ -1731,8 +1731,8 @@ MACHINE_CONFIG_START(ms32_state::ms32)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymf", YMF271, 16934400)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/mugsmash.cpp b/src/mame/drivers/mugsmash.cpp
index 43cb683d017..e2871564057 100644
--- a/src/mame/drivers/mugsmash.cpp
+++ b/src/mame/drivers/mugsmash.cpp
@@ -425,8 +425,8 @@ MACHINE_CONFIG_START(mugsmash_state::mugsmash)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/nbmj8991.cpp b/src/mame/drivers/nbmj8991.cpp
index 29dda727a64..4e94edc3c3f 100644
--- a/src/mame/drivers/nbmj8991.cpp
+++ b/src/mame/drivers/nbmj8991.cpp
@@ -1387,7 +1387,7 @@ MACHINE_CONFIG_START(nbmj8991_state::nbmjdrv2) // pstadium
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("fmsnd", YM3812, 25000000/6.25)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
diff --git a/src/mame/drivers/nbmj9195.cpp b/src/mame/drivers/nbmj9195.cpp
index 72e5bbcca5f..39e2b2c3185 100644
--- a/src/mame/drivers/nbmj9195.cpp
+++ b/src/mame/drivers/nbmj9195.cpp
@@ -2541,7 +2541,7 @@ MACHINE_CONFIG_START(nbmj9195_state::NBMJDRV1_base)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, 4000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
diff --git a/src/mame/drivers/neoprint.cpp b/src/mame/drivers/neoprint.cpp
index 2b915d80eca..acbf3641ed1 100644
--- a/src/mame/drivers/neoprint.cpp
+++ b/src/mame/drivers/neoprint.cpp
@@ -528,7 +528,7 @@ MACHINE_CONFIG_START(neoprint_state::neoprint)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2610, 24000000 / 3)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -574,7 +574,7 @@ MACHINE_CONFIG_START(neoprint_state::nprsp)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2610, 24000000 / 3)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/ninjakd2.cpp b/src/mame/drivers/ninjakd2.cpp
index 30253cb6471..86d890d2fb1 100644
--- a/src/mame/drivers/ninjakd2.cpp
+++ b/src/mame/drivers/ninjakd2.cpp
@@ -993,7 +993,7 @@ MACHINE_CONFIG_START(ninjakd2_state::ninjakd2_core)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("2203.1", YM2203, MAIN_CLOCK_12/8) /* verified */
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/nmg5.cpp b/src/mame/drivers/nmg5.cpp
index 3273864efe7..f36da0fd338 100644
--- a/src/mame/drivers/nmg5.cpp
+++ b/src/mame/drivers/nmg5.cpp
@@ -1011,7 +1011,7 @@ MACHINE_CONFIG_START(nmg5_state::nmg5)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, 4000000) /* 4MHz */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/nmk16.cpp b/src/mame/drivers/nmk16.cpp
index 7baf37ce6d6..e58253c17de 100644
--- a/src/mame/drivers/nmk16.cpp
+++ b/src/mame/drivers/nmk16.cpp
@@ -4039,8 +4039,8 @@ MACHINE_CONFIG_START(nmk16_state::tharrier)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ymsnd", YM2203, 12_MHz_XTAL / 8)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -4389,8 +4389,8 @@ MACHINE_CONFIG_START(nmk16_state::ssmissin)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("oki1", OKIM6295, 8000000/8, okim6295_device::PIN7_HIGH) /* 1 Mhz, pin 7 high */
MCFG_DEVICE_ADDRESS_MAP(0, oki1_map)
@@ -4623,8 +4623,8 @@ MACHINE_CONFIG_START(nmk16_state::macross2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -4668,8 +4668,8 @@ MACHINE_CONFIG_START(nmk16_state::tdragon2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -4721,8 +4721,8 @@ MACHINE_CONFIG_START(nmk16_state::raphero)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -4825,8 +4825,8 @@ MACHINE_CONFIG_START(nmk16_state::manybloc)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -4870,8 +4870,8 @@ MACHINE_CONFIG_START(nmk16_tomagic_state::tomagic)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM3812, 12000000/4) // K-666 (YM3812) 3Mhz? */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -5396,8 +5396,8 @@ MACHINE_CONFIG_START(nmk16_state::stagger1)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(4'000'000)) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -5486,8 +5486,8 @@ MACHINE_CONFIG_START(nmk16_state::firehawk)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("oki1", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -5527,8 +5527,8 @@ MACHINE_CONFIG_START(nmk16_state::twinactn)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("oki1", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/oneshot.cpp b/src/mame/drivers/oneshot.cpp
index 09f84346b04..d7a3e8860b1 100644
--- a/src/mame/drivers/oneshot.cpp
+++ b/src/mame/drivers/oneshot.cpp
@@ -388,7 +388,7 @@ MACHINE_CONFIG_START(oneshot_state::oneshot)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM3812, 3500000)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/pass.cpp b/src/mame/drivers/pass.cpp
index 593897d580c..2a20556b217 100644
--- a/src/mame/drivers/pass.cpp
+++ b/src/mame/drivers/pass.cpp
@@ -270,7 +270,7 @@ MACHINE_CONFIG_START(pass_state::pass)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2203, 14318180/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
diff --git a/src/mame/drivers/pcktgal.cpp b/src/mame/drivers/pcktgal.cpp
index 68301399655..e9f4feb930f 100644
--- a/src/mame/drivers/pcktgal.cpp
+++ b/src/mame/drivers/pcktgal.cpp
@@ -256,7 +256,7 @@ MACHINE_CONFIG_START(pcktgal_state::pcktgal)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
diff --git a/src/mame/drivers/pgm.cpp b/src/mame/drivers/pgm.cpp
index 60c623592d5..7bc5983cc6e 100644
--- a/src/mame/drivers/pgm.cpp
+++ b/src/mame/drivers/pgm.cpp
@@ -544,9 +544,9 @@ MACHINE_CONFIG_START(pgm_state::pgmbase)
/*sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch3")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
+ GENERIC_LATCH_8(config, m_soundlatch3);
MCFG_ICS2115_ADD("ics", 0)
MCFG_ICS2115_IRQ_CB(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/pipedrm.cpp b/src/mame/drivers/pipedrm.cpp
index fa6c553e5ed..cf2e97504c3 100644
--- a/src/mame/drivers/pipedrm.cpp
+++ b/src/mame/drivers/pipedrm.cpp
@@ -622,9 +622,9 @@ MACHINE_CONFIG_START(pipedrm_state::pipedrm)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("sub", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_subcpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("sub", 0))
@@ -671,12 +671,12 @@ MACHINE_CONFIG_START(pipedrm_state::hatris)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->set_separate_acknowledge(true);
// Hatris polls commands *and* listens to the NMI; this causes it to miss
// sound commands. It's possible the NMI isn't really hooked up on the YM2608
// sound board.
- //MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("sub", INPUT_LINE_NMI))
+ //m_soundlatch->data_pending_callback().set_inputline(m_subcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2608, 8000000)
MCFG_YM2608_IRQ_HANDLER(INPUTLINE("sub", 0))
diff --git a/src/mame/drivers/pokechmp.cpp b/src/mame/drivers/pokechmp.cpp
index 48f2eec067f..90694075309 100644
--- a/src/mame/drivers/pokechmp.cpp
+++ b/src/mame/drivers/pokechmp.cpp
@@ -253,7 +253,7 @@ MACHINE_CONFIG_START(pokechmp_state::pokechmp)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(4'000'000)/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
diff --git a/src/mame/drivers/portrait.cpp b/src/mame/drivers/portrait.cpp
index a0431406ad1..4d1d4a11d67 100644
--- a/src/mame/drivers/portrait.cpp
+++ b/src/mame/drivers/portrait.cpp
@@ -281,7 +281,7 @@ MACHINE_CONFIG_START(portrait_state::portrait)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("tms", TMS5200, 640000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/powerins.cpp b/src/mame/drivers/powerins.cpp
index 8b0fc3d885a..f8d472f88d8 100644
--- a/src/mame/drivers/powerins.cpp
+++ b/src/mame/drivers/powerins.cpp
@@ -313,7 +313,7 @@ MACHINE_CONFIG_START(powerins_state::powerins)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("oki1", OKIM6295, 4000000, okim6295_device::PIN7_LOW)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
diff --git a/src/mame/drivers/ppmast93.cpp b/src/mame/drivers/ppmast93.cpp
index 519eb25fa5f..4ec692dd319 100644
--- a/src/mame/drivers/ppmast93.cpp
+++ b/src/mame/drivers/ppmast93.cpp
@@ -400,7 +400,7 @@ MACHINE_CONFIG_START(ppmast93_state::ppmast93)
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2413, 5000000/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
diff --git a/src/mame/drivers/prehisle.cpp b/src/mame/drivers/prehisle.cpp
index 70a19165cef..a9adb27b96d 100644
--- a/src/mame/drivers/prehisle.cpp
+++ b/src/mame/drivers/prehisle.cpp
@@ -227,7 +227,7 @@ MACHINE_CONFIG_START(prehisle_state::prehisle)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(4'000'000)) /* verified on pcb */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/progolf.cpp b/src/mame/drivers/progolf.cpp
index bc414a39fe6..7cc3ca967ad 100644
--- a/src/mame/drivers/progolf.cpp
+++ b/src/mame/drivers/progolf.cpp
@@ -428,9 +428,9 @@ MACHINE_CONFIG_START(progolf_state::progolf)
MCFG_QUANTUM_PERFECT_CPU("maincpu")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set_inputline(m_audiocpu, 0);
+ soundlatch.set_separate_acknowledge(true);
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/psikyo.cpp b/src/mame/drivers/psikyo.cpp
index 8b3516a9770..935ca51809d 100644
--- a/src/mame/drivers/psikyo.cpp
+++ b/src/mame/drivers/psikyo.cpp
@@ -1057,9 +1057,9 @@ MACHINE_CONFIG_START(psikyo_state::sngkace)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MACHINE_CONFIG_END
@@ -1103,9 +1103,9 @@ MACHINE_CONFIG_START(psikyo_state::gunbird)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(psikyo_state::s1945jn)
@@ -1189,9 +1189,9 @@ MACHINE_CONFIG_START(psikyo_state::s1945)
MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/psychic5.cpp b/src/mame/drivers/psychic5.cpp
index 6448e40c779..a7fc82b6f20 100644
--- a/src/mame/drivers/psychic5.cpp
+++ b/src/mame/drivers/psychic5.cpp
@@ -753,7 +753,7 @@ MACHINE_CONFIG_START(psychic5_state::psychic5)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(12'000'000)/8)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -800,7 +800,7 @@ MACHINE_CONFIG_START(psychic5_state::bombsa)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(12'000'000)/8)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/punchout.cpp b/src/mame/drivers/punchout.cpp
index e3a8dbf2528..344dd66a340 100644
--- a/src/mame/drivers/punchout.cpp
+++ b/src/mame/drivers/punchout.cpp
@@ -672,8 +672,8 @@ MACHINE_CONFIG_START(punchout_state::punchout)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "mono").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch");
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("vlm", VLM5030, N2A03_NTSC_XTAL/6)
MCFG_DEVICE_ADDRESS_MAP(0, punchout_vlm_map)
diff --git a/src/mame/drivers/quasar.cpp b/src/mame/drivers/quasar.cpp
index b6aac65b395..ac46452b9bc 100644
--- a/src/mame/drivers/quasar.cpp
+++ b/src/mame/drivers/quasar.cpp
@@ -345,7 +345,7 @@ MACHINE_CONFIG_START(quasar_state::quasar)
MCFG_VIDEO_START_OVERRIDE(quasar_state,quasar)
/* sound hardware */
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
SPEAKER(config, "speaker").front_center();
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
diff --git a/src/mame/drivers/quizpun2.cpp b/src/mame/drivers/quizpun2.cpp
index 3ccd16c1343..36f419f37cf 100644
--- a/src/mame/drivers/quizpun2.cpp
+++ b/src/mame/drivers/quizpun2.cpp
@@ -616,7 +616,7 @@ MACHINE_CONFIG_START(quizpun2_state::quizpun2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(8'000'000) / 2) // 4 MHz
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/renegade.cpp b/src/mame/drivers/renegade.cpp
index 5d3d7768d21..fb02847084c 100644
--- a/src/mame/drivers/renegade.cpp
+++ b/src/mame/drivers/renegade.cpp
@@ -499,8 +499,8 @@ MACHINE_CONFIG_START(renegade_state::renegade)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", M6809_IRQ_LINE))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, M6809_IRQ_LINE);
MCFG_DEVICE_ADD("ymsnd", YM3526, 12000000/4)
MCFG_YM3526_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
diff --git a/src/mame/drivers/retofinv.cpp b/src/mame/drivers/retofinv.cpp
index ffaad1659bc..f7af0a7db4f 100644
--- a/src/mame/drivers/retofinv.cpp
+++ b/src/mame/drivers/retofinv.cpp
@@ -458,7 +458,7 @@ MACHINE_CONFIG_START(retofinv_state::retofinv)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("sn1", SN76489A, XTAL(18'432'000)/6) /* @IC5?; XTAL, chip type, and divider verified, 3.072 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/drivers/rockrage.cpp b/src/mame/drivers/rockrage.cpp
index 742e95c5934..ab33ebb0bc1 100644
--- a/src/mame/drivers/rockrage.cpp
+++ b/src/mame/drivers/rockrage.cpp
@@ -290,7 +290,7 @@ MACHINE_CONFIG_START(rockrage_state::rockrage)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
diff --git a/src/mame/drivers/roul.cpp b/src/mame/drivers/roul.cpp
index 6ec4965d943..32318e15658 100644
--- a/src/mame/drivers/roul.cpp
+++ b/src/mame/drivers/roul.cpp
@@ -339,7 +339,7 @@ MACHINE_CONFIG_START(roul_state::roul)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
AY8910(config, "aysnd", 1000000).add_route(ALL_OUTPUTS, "mono", 1.0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp
index e3380e8a98c..44d3688df4f 100644
--- a/src/mame/drivers/royalmah.cpp
+++ b/src/mame/drivers/royalmah.cpp
@@ -3529,7 +3529,7 @@ MACHINE_CONFIG_START(royalmah_state::jansou)
MCFG_DEVICE_IO_MAP(jansou_sub_iomap)
MCFG_DEVICE_PERIODIC_INT_DRIVER(royalmah_state, irq0_line_hold, 4000000/512)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
diff --git a/src/mame/drivers/rpunch.cpp b/src/mame/drivers/rpunch.cpp
index 1023fe70976..40a3b33a6d2 100644
--- a/src/mame/drivers/rpunch.cpp
+++ b/src/mame/drivers/rpunch.cpp
@@ -466,8 +466,8 @@ MACHINE_CONFIG_START(rpunch_state::rpunch)
MCFG_DEVICE_ADD("audiocpu", Z80, MASTER_CLOCK/4)
MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundirq", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundirq", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ANY_HIGH("soundirq")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", 0))
@@ -517,8 +517,8 @@ MACHINE_CONFIG_START(rpunch_state::svolleybl)
MCFG_DEVICE_ADD("audiocpu", Z80, MASTER_CLOCK/4)
MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundirq", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundirq", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ANY_HIGH("soundirq")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/sandscrp.cpp b/src/mame/drivers/sandscrp.cpp
index b42a8315311..9139d181a12 100644
--- a/src/mame/drivers/sandscrp.cpp
+++ b/src/mame/drivers/sandscrp.cpp
@@ -508,10 +508,10 @@ MACHINE_CONFIG_START(sandscrp_state::sandscrp)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
-
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
MCFG_DEVICE_ADD("oki", OKIM6295, 12000000/6, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
diff --git a/src/mame/drivers/sauro.cpp b/src/mame/drivers/sauro.cpp
index 54d30fdc4bc..944cbb59616 100644
--- a/src/mame/drivers/sauro.cpp
+++ b/src/mame/drivers/sauro.cpp
@@ -520,7 +520,7 @@ MACHINE_CONFIG_START(sauro_state::sauro)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(sauro_state, screen_update_sauro)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_MODIFY("ymsnd")
MCFG_DEVICE_CLOCK(XTAL(20'000'000) / 5) /* verified on pcb */
diff --git a/src/mame/drivers/sbasketb.cpp b/src/mame/drivers/sbasketb.cpp
index 0ea1be8e625..8e40e7d3047 100644
--- a/src/mame/drivers/sbasketb.cpp
+++ b/src/mame/drivers/sbasketb.cpp
@@ -230,7 +230,7 @@ MACHINE_CONFIG_START(sbasketb_state::sbasketb)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD(m_soundbrd, TRACKFLD_AUDIO, 0, m_audiocpu, m_vlm)
diff --git a/src/mame/drivers/scotrsht.cpp b/src/mame/drivers/scotrsht.cpp
index c8e19beaee3..36e356362b4 100644
--- a/src/mame/drivers/scotrsht.cpp
+++ b/src/mame/drivers/scotrsht.cpp
@@ -217,7 +217,7 @@ MACHINE_CONFIG_START(scotrsht_state::scotrsht)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2203, 18432000/6)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
diff --git a/src/mame/drivers/scyclone.cpp b/src/mame/drivers/scyclone.cpp
index cd6488158ea..a76e52e51e2 100644
--- a/src/mame/drivers/scyclone.cpp
+++ b/src/mame/drivers/scyclone.cpp
@@ -622,7 +622,7 @@ MACHINE_CONFIG_START(scyclone_state::scyclone)
// no idea, but it does wait on an irq in places, irq0 increases a register checked in the wait loop so without it sound dies after a while
MCFG_DEVICE_PERIODIC_INT_DRIVER(scyclone_state, irq0_line_hold, 400*60)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* add shifter */
MB14241(config, "mb14241");
diff --git a/src/mame/drivers/segahang.cpp b/src/mame/drivers/segahang.cpp
index ee7834d9350..a004ffc2e3c 100644
--- a/src/mame/drivers/segahang.cpp
+++ b/src/mame/drivers/segahang.cpp
@@ -790,7 +790,7 @@ MACHINE_CONFIG_START(segahang_state::shared_base)
MCFG_SCREEN_UPDATE_DRIVER(segahang_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/segajw.cpp b/src/mame/drivers/segajw.cpp
index 42536438fbb..e581a2531fe 100644
--- a/src/mame/drivers/segajw.cpp
+++ b/src/mame/drivers/segajw.cpp
@@ -416,10 +416,10 @@ MACHINE_CONFIG_START(segajw_state::segajw)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ymsnd", YM3438, 8000000) // unknown clock
MCFG_YM2612_IRQ_HANDLER(INPUTLINE("maincpu", 5))
diff --git a/src/mame/drivers/segam1.cpp b/src/mame/drivers/segam1.cpp
index 944e974b39d..e9e8aa32da9 100644
--- a/src/mame/drivers/segam1.cpp
+++ b/src/mame/drivers/segam1.cpp
@@ -392,8 +392,7 @@ MACHINE_CONFIG_START(segam1_state::segam1)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline("audiocpu", INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM3438, 8000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp
index 58b2b9c97dc..81a3af1935d 100644
--- a/src/mame/drivers/segas16a.cpp
+++ b/src/mame/drivers/segas16a.cpp
@@ -2014,7 +2014,7 @@ MACHINE_CONFIG_START(segas16a_state::system16a)
// sound hardware
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 4000000)
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(*this, segas16a_state, n7751_control_w))
diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp
index 4ec921dbd3b..01970b34c42 100644
--- a/src/mame/drivers/segas16b.cpp
+++ b/src/mame/drivers/segas16b.cpp
@@ -3850,7 +3850,7 @@ MACHINE_CONFIG_START(segas16b_state::system16b_split)
MCFG_DEVICE_PROGRAM_MAP(bootleg_sound_map)
MCFG_DEVICE_IO_MAP(bootleg_sound_portmap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MACHINE_CONFIG_END
void segas16b_state::tilemap_16b_fpointbl_fill_latch(int i, uint16_t* latched_pageselect, uint16_t* latched_yscroll, uint16_t* latched_xscroll, uint16_t* textram)
@@ -3893,8 +3893,8 @@ MACHINE_CONFIG_START(segas16b_state::fpointbl)
MCFG_DEVICE_PROGRAM_MAP(fpointbl_sound_map)
MCFG_DEVICE_IO_MAP(bootleg_sound_portmap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, 0);
MCFG_DEVICE_ADD("sprites", SEGA_SYS16B_SPRITES, 0)
MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(75) // these align the pieces with the playfield
@@ -3947,8 +3947,8 @@ MACHINE_CONFIG_START(segas16b_state::lockonph)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(16'000'000)/4) // ??
// MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) // does set up the timer, but end up with no sound?
@@ -9796,7 +9796,7 @@ MACHINE_CONFIG_START(isgsm_state::isgsm)
MCFG_DEVICE_PROGRAM_MAP(bootleg_sound_map)
MCFG_DEVICE_IO_MAP(bootleg_sound_portmap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MACHINE_CONFIG_END
void isgsm_state::init_isgsm()
diff --git a/src/mame/drivers/segaybd.cpp b/src/mame/drivers/segaybd.cpp
index cd75deb9119..f2bc0ff7d20 100644
--- a/src/mame/drivers/segaybd.cpp
+++ b/src/mame/drivers/segaybd.cpp
@@ -1336,8 +1336,7 @@ MACHINE_CONFIG_START(segaybd_state::yboard)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, SOUND_CLOCK/8)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/seicupbl.cpp b/src/mame/drivers/seicupbl.cpp
index ec7f4c6cdc5..fb4068e4ee9 100644
--- a/src/mame/drivers/seicupbl.cpp
+++ b/src/mame/drivers/seicupbl.cpp
@@ -595,8 +595,8 @@ MACHINE_CONFIG_START(seicupbl_state::cupsocbl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp
index b33b9dc8c33..4845622f6da 100644
--- a/src/mame/drivers/seta.cpp
+++ b/src/mame/drivers/seta.cpp
@@ -1782,8 +1782,8 @@ void seta_state::calibr50_map(address_map &map)
map(0xd00000, 0xd005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
map(0xd00600, 0xd00607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16));
map(0xe00000, 0xe03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr
- map(0xb00001, 0xb00001).r("soundlatch2", FUNC(generic_latch_8_device::read)); // From Sub CPU
- map(0xb00001, 0xb00001).w("soundlatch1", FUNC(generic_latch_8_device::write)); // To Sub CPU
+ map(0xb00001, 0xb00001).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); // From Sub CPU
+ map(0xb00001, 0xb00001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write)); // To Sub CPU
map(0xc00000, 0xc00001).ram(); // ? $4000
map(0xff0000, 0xffffff).ram(); // RAM
@@ -1848,7 +1848,7 @@ void seta_state::usclssic_map(address_map &map)
map(0xb40001, 0xb40001).w(FUNC(seta_state::usclssic_lockout_w)); // Coin Lockout + Tiles Banking
map(0xb4000a, 0xb4000b).w(FUNC(seta_state::ipl1_ack_w));
map(0xb40010, 0xb40011).portr("COINS"); // Coins
- map(0xb40011, 0xb40011).w("soundlatch1", FUNC(generic_latch_8_device::write)); // To Sub CPU
+ map(0xb40011, 0xb40011).w(m_soundlatch[0], FUNC(generic_latch_8_device::write)); // To Sub CPU
map(0xb40018, 0xb4001f).r(FUNC(seta_state::usclssic_dsw_r)); // 2 DSWs
map(0xb40018, 0xb40019).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
map(0xb80000, 0xb80001).r(FUNC(seta_state::ipl2_ack_r));
@@ -2957,7 +2957,7 @@ void seta_state::thunderlbl_map(address_map &map)
map(0xb00004, 0xb00005).portr("COINS"); // Coins
map(0xb0000c, 0xb0000d).w(m_seta001, FUNC(seta001_device::spritectrl_w8)).umask16(0xff00); // the bootleg is modified to write the first byte of spritectrl here, rather than the usual address
map(0xb00008, 0xb00009).portr("P3"); // P3 (wits)
- map(0xb00008, 0xb00008).w("soundlatch1", FUNC(generic_latch_8_device::write));
+ map(0xb00008, 0xb00008).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
map(0xb0000a, 0xb0000b).portr("P4"); // P4 (wits)
map(0xc00000, 0xc00001).ram(); // ? 0x4000
map(0xd00000, 0xd005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
@@ -2986,7 +2986,7 @@ void seta_state::wiggie_map(address_map &map)
map(0xb00004, 0xb00005).portr("COINS"); // Coins
map(0xb0000c, 0xb0000d).r(FUNC(seta_state::thunderl_protection_r)); // Protection (not in wits)
map(0xb00008, 0xb00009).portr("P3"); // P3 (wits)
- map(0xb00008, 0xb00008).w("soundlatch1", FUNC(generic_latch_8_device::write));
+ map(0xb00008, 0xb00008).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
map(0xb0000a, 0xb0000b).portr("P4"); // P4 (wits)
map(0xc00000, 0xc00001).ram(); // ? 0x4000
map(0xd00000, 0xd005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
@@ -3000,7 +3000,7 @@ void seta_state::wiggie_sound_map(address_map &map)
map(0x0000, 0x7fff).rom();
map(0x8000, 0x87ff).ram();
map(0x9800, 0x9800).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
- map(0xa000, 0xa000).r("soundlatch1", FUNC(generic_latch_8_device::read));
+ map(0xa000, 0xa000).r(m_soundlatch[0], FUNC(generic_latch_8_device::read));
}
@@ -3059,7 +3059,7 @@ void seta_state::utoukond_map(address_map &map)
map(0xa00000, 0xa005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
map(0xa00600, 0xa00607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16));
map(0xb00000, 0xb03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr
- map(0xc00001, 0xc00001).w("soundlatch1", FUNC(generic_latch_8_device::write));
+ map(0xc00001, 0xc00001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write));
map(0xe00000, 0xe00001).nopw(); // ? ack
}
@@ -3439,8 +3439,8 @@ void seta_state::tndrcade_sub_map(address_map &map)
{
map(0x0000, 0x01ff).ram(); // RAM
map(0x0800, 0x0800).r(FUNC(seta_state::ff_r)); // ? (bits 0/1/2/3: 1 -> do test 0-ff/100-1e0/5001-57ff/banked rom)
- //AM_RANGE(0x0800, 0x0800) AM_DEVREAD("soundlatch1", generic_latch_8_device, read) //
- //AM_RANGE(0x0801, 0x0801) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) //
+ //AM_RANGE(0x0800, 0x0800) AM_DEVREAD(m_soundlatch[0], generic_latch_8_device, read) //
+ //AM_RANGE(0x0801, 0x0801) AM_DEVREAD(m_soundlatch[1], generic_latch_8_device, read) //
map(0x1000, 0x1000).portr("P1"); // P1
map(0x1000, 0x1000).w(FUNC(seta_state::sub_bankswitch_lockout_w)); // ROM Bank + Coin Lockout
map(0x1001, 0x1001).portr("P2"); // P2
@@ -3461,8 +3461,8 @@ void seta_state::tndrcade_sub_map(address_map &map)
void seta_state::twineagl_sub_map(address_map &map)
{
map(0x0000, 0x01ff).ram(); // RAM
- map(0x0800, 0x0800).r("soundlatch1", FUNC(generic_latch_8_device::read)); //
- map(0x0801, 0x0801).r("soundlatch2", FUNC(generic_latch_8_device::read)); //
+ map(0x0800, 0x0800).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); //
+ map(0x0801, 0x0801).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); //
map(0x1000, 0x1000).portr("P1"); // P1
map(0x1000, 0x1000).w(FUNC(seta_state::sub_bankswitch_lockout_w)); // ROM Bank + Coin Lockout
map(0x1001, 0x1001).portr("P2"); // P2
@@ -3504,8 +3504,8 @@ READ8_MEMBER(seta_state::downtown_ip_r)
void seta_state::downtown_sub_map(address_map &map)
{
map(0x0000, 0x01ff).ram(); // RAM
- map(0x0800, 0x0800).r("soundlatch1", FUNC(generic_latch_8_device::read)); //
- map(0x0801, 0x0801).r("soundlatch2", FUNC(generic_latch_8_device::read)); //
+ map(0x0800, 0x0800).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); //
+ map(0x0801, 0x0801).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); //
map(0x1000, 0x1007).r(FUNC(seta_state::downtown_ip_r)); // Input Ports
map(0x1000, 0x1000).w(FUNC(seta_state::sub_bankswitch_lockout_w)); // ROM Bank + Coin Lockout
map(0x5000, 0x57ff).ram().share("sharedram"); // Shared RAM
@@ -3553,7 +3553,7 @@ void seta_state::calibr50_sub_map(address_map &map)
map(0x0000, 0x1fff).lrw8("x1_soundram_rw",
[this](offs_t offset) { return m_x1->read(offset ^ 0x1000); },
[this](offs_t offset, u8 data) { m_x1->write(offset ^ 0x1000, data); }); // Sound
- map(0x4000, 0x4000).r("soundlatch1", FUNC(generic_latch_8_device::read)); // From Main CPU
+ map(0x4000, 0x4000).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); // From Main CPU
map(0x4000, 0x4000).w(FUNC(seta_state::calibr50_sub_bankswitch_w)); // Bankswitching
map(0x8000, 0xbfff).bankr("subbank"); // Banked ROM
map(0xc000, 0xffff).rom(); // ROM
@@ -3568,8 +3568,8 @@ void seta_state::calibr50_sub_map(address_map &map)
void seta_state::metafox_sub_map(address_map &map)
{
map(0x0000, 0x01ff).ram(); // RAM
- map(0x0800, 0x0800).r("soundlatch1", FUNC(generic_latch_8_device::read)); //
- map(0x0801, 0x0801).r("soundlatch2", FUNC(generic_latch_8_device::read)); //
+ map(0x0800, 0x0800).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); //
+ map(0x0801, 0x0801).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); //
map(0x1000, 0x1000).portr("COINS"); // Coins
map(0x1000, 0x1000).w(FUNC(seta_state::sub_bankswitch_lockout_w)); // ROM Bank + Coin Lockout
map(0x1002, 0x1002).portr("P1"); // P1
@@ -3598,7 +3598,7 @@ void seta_state::utoukond_sound_io_map(address_map &map)
map.global_mask(0xff);
map(0x00, 0x03).rw("ymsnd", FUNC(ym3438_device::read), FUNC(ym3438_device::write));
map(0x80, 0x80).w(FUNC(seta_state::utoukond_sound_control_w));
- map(0xc0, 0xc0).r("soundlatch1", FUNC(generic_latch_8_device::read));
+ map(0xc0, 0xc0).r(m_soundlatch[0], FUNC(generic_latch_8_device::read));
}
@@ -7934,8 +7934,8 @@ MACHINE_CONFIG_START(seta_state::twineagl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -7980,8 +7980,8 @@ MACHINE_CONFIG_START(seta_state::downtown)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
@@ -8065,9 +8065,9 @@ MACHINE_CONFIG_START(seta_state::usclssic)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("sub", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_subcpu, INPUT_LINE_NMI);
+ m_soundlatch[0]->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -8125,11 +8125,11 @@ MACHINE_CONFIG_START(seta_state::calibr50)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("sub", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_subcpu, INPUT_LINE_NMI);
+ m_soundlatch[0]->set_separate_acknowledge(true);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
@@ -8174,8 +8174,8 @@ MACHINE_CONFIG_START(seta_state::metafox)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ GENERIC_LATCH_8(config, m_soundlatch[1]);
MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -8356,7 +8356,7 @@ void seta_state::blockcarb_sound_portmap(address_map &map)
map.unmap_value_high();
map.global_mask(0xff);
// AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
-// AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3f) AM_DEVREAD("soundlatch1", generic_latch_8_device, read)
+// AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3f) AM_DEVREAD(m_soundlatch[0], generic_latch_8_device, read)
}
MACHINE_CONFIG_START(seta_state::blockcarb)
@@ -9388,7 +9388,7 @@ void seta_state::thunderlbl_sound_portmap(address_map &map)
map.unmap_value_high();
map.global_mask(0xff);
map(0x00, 0x01).mirror(0x3e).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
- map(0xc0, 0xc0).mirror(0x3f).r("soundlatch1", FUNC(generic_latch_8_device::read));
+ map(0xc0, 0xc0).mirror(0x3f).r(m_soundlatch[0], FUNC(generic_latch_8_device::read));
}
@@ -9410,8 +9410,8 @@ MACHINE_CONFIG_START(seta_state::thunderlbl)
MCFG_DEVICE_ADD("ymsnd", YM2151, 10000000/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, 0);
MACHINE_CONFIG_END
@@ -9449,8 +9449,8 @@ MACHINE_CONFIG_START(seta_state::wiggie)
MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, 0);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(seta_state::superbar)
@@ -9566,9 +9566,9 @@ MACHINE_CONFIG_START(seta_state::utoukond)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch1")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch[0]);
+ m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, 0);
+ m_soundlatch[0]->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("x1snd", X1_010, 16000000)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/sf.cpp b/src/mame/drivers/sf.cpp
index 3c1a509bab5..f5992f378c4 100644
--- a/src/mame/drivers/sf.cpp
+++ b/src/mame/drivers/sf.cpp
@@ -563,7 +563,7 @@ MACHINE_CONFIG_START(sf_state::sfan)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545))
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/sfkick.cpp b/src/mame/drivers/sfkick.cpp
index 025453b7c06..e951a72d06b 100644
--- a/src/mame/drivers/sfkick.cpp
+++ b/src/mame/drivers/sfkick.cpp
@@ -616,7 +616,7 @@ MACHINE_CONFIG_START(sfkick_state::sfkick)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, MASTER_CLOCK/6)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(*this, sfkick_state, irqhandler))
diff --git a/src/mame/drivers/shadfrce.cpp b/src/mame/drivers/shadfrce.cpp
index 5c937c16bd2..9150ce7dfdb 100644
--- a/src/mame/drivers/shadfrce.cpp
+++ b/src/mame/drivers/shadfrce.cpp
@@ -560,8 +560,8 @@ MACHINE_CONFIG_START(shadfrce_state::shadfrce)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/shangha3.cpp b/src/mame/drivers/shangha3.cpp
index 25eb15ea004..91afe495cc4 100644
--- a/src/mame/drivers/shangha3.cpp
+++ b/src/mame/drivers/shangha3.cpp
@@ -513,8 +513,8 @@ MACHINE_CONFIG_START(shangha3_state::heberpop)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM3438, 48_MHz_XTAL/6) /* 8 MHz? */
MCFG_YM2612_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
@@ -557,8 +557,8 @@ MACHINE_CONFIG_START(shangha3_state::blocken)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM3438, 48_MHz_XTAL/6) /* 8 MHz? */
MCFG_YM2612_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/shisen.cpp b/src/mame/drivers/shisen.cpp
index a82603f174c..c8654f930e5 100644
--- a/src/mame/drivers/shisen.cpp
+++ b/src/mame/drivers/shisen.cpp
@@ -244,9 +244,9 @@ MACHINE_CONFIG_START(shisen_state::shisen)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundirq", rst_neg_buffer_device, rst18_w))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set("soundirq", FUNC(rst_neg_buffer_device::rst18_w));
+ soundlatch.set_separate_acknowledge(true);
RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline("soundcpu", 0);
diff --git a/src/mame/drivers/sidearms.cpp b/src/mame/drivers/sidearms.cpp
index acb3a5dc0a0..a5d763028f7 100644
--- a/src/mame/drivers/sidearms.cpp
+++ b/src/mame/drivers/sidearms.cpp
@@ -631,7 +631,7 @@ MACHINE_CONFIG_START(sidearms_state::sidearms)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, 4000000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -680,7 +680,7 @@ MACHINE_CONFIG_START(sidearms_state::turtship)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, 4000000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -732,7 +732,7 @@ MACHINE_CONFIG_START(sidearms_state::whizz)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, 4000000)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/sidepckt.cpp b/src/mame/drivers/sidepckt.cpp
index 673e6219a78..beb7d7d5e12 100644
--- a/src/mame/drivers/sidepckt.cpp
+++ b/src/mame/drivers/sidepckt.cpp
@@ -395,8 +395,8 @@ MACHINE_CONFIG_START(sidepckt_state::sidepckt)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/sigmab52.cpp b/src/mame/drivers/sigmab52.cpp
index cc7d163dda0..a41586aeaa8 100644
--- a/src/mame/drivers/sigmab52.cpp
+++ b/src/mame/drivers/sigmab52.cpp
@@ -607,7 +607,7 @@ MACHINE_CONFIG_START(sigmab52_state::jwildb52)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(3'579'545))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/silvmil.cpp b/src/mame/drivers/silvmil.cpp
index 580b03e9f78..a9002334958 100644
--- a/src/mame/drivers/silvmil.cpp
+++ b/src/mame/drivers/silvmil.cpp
@@ -439,7 +439,7 @@ MACHINE_CONFIG_START(silvmil_state::silvmil)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(14'318'181)/4) /* Verified */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/skyfox.cpp b/src/mame/drivers/skyfox.cpp
index 464622e317b..02812022799 100644
--- a/src/mame/drivers/skyfox.cpp
+++ b/src/mame/drivers/skyfox.cpp
@@ -248,7 +248,7 @@ MACHINE_CONFIG_START(skyfox_state::skyfox)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(14'318'181)/8) /* Verified at 1.789772MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/drivers/sliver.cpp b/src/mame/drivers/sliver.cpp
index aed4fe6acdb..1f94cc5d072 100644
--- a/src/mame/drivers/sliver.cpp
+++ b/src/mame/drivers/sliver.cpp
@@ -542,7 +542,7 @@ MACHINE_CONFIG_START(sliver_state::sliver)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
MCFG_DEVICE_ADDRESS_MAP(0, oki_map)
diff --git a/src/mame/drivers/snk.cpp b/src/mame/drivers/snk.cpp
index 932e7e58d23..f6a798caa91 100644
--- a/src/mame/drivers/snk.cpp
+++ b/src/mame/drivers/snk.cpp
@@ -3801,7 +3801,7 @@ MACHINE_CONFIG_START(snk_state::tnk3)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM3526, XTAL(8'000'000)/2) /* verified on pcb */
MCFG_YM3526_IRQ_HANDLER(WRITELINE(*this, snk_state, ymirq_callback_1))
@@ -3903,7 +3903,7 @@ MACHINE_CONFIG_START(snk_state::ikari)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM3526, XTAL(8'000'000)/2) /* verified on pcb */
MCFG_YM3526_IRQ_HANDLER(WRITELINE(*this, snk_state, ymirq_callback_1))
@@ -3961,7 +3961,7 @@ MACHINE_CONFIG_START(snk_state::bermudat)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM3526, XTAL(8'000'000)/2) /* verified on pcb */
MCFG_YM3526_IRQ_HANDLER(WRITELINE(*this, snk_state, ymirq_callback_1))
@@ -4066,7 +4066,7 @@ MACHINE_CONFIG_START(snk_state::tdfever)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM3526, 4000000)
MCFG_YM3526_IRQ_HANDLER(WRITELINE(*this, snk_state, ymirq_callback_1))
diff --git a/src/mame/drivers/snk68.cpp b/src/mame/drivers/snk68.cpp
index 427afd49ac0..303aafa2b71 100644
--- a/src/mame/drivers/snk68.cpp
+++ b/src/mame/drivers/snk68.cpp
@@ -624,8 +624,8 @@ MACHINE_CONFIG_START(snk68_state::pow)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(8'000'000)/2) /* verified on pcb */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/snowbros.cpp b/src/mame/drivers/snowbros.cpp
index 65657beac03..8c69aef1f27 100644
--- a/src/mame/drivers/snowbros.cpp
+++ b/src/mame/drivers/snowbros.cpp
@@ -1756,10 +1756,10 @@ MACHINE_CONFIG_START(snowbros_state::snowbros)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(12'000'000)/4) /* 3 MHz - confirmed */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
@@ -1800,10 +1800,9 @@ MACHINE_CONFIG_START(snowbros_state::semicom)
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_hyperpac)
- MCFG_DEVICE_MODIFY("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(NOOP)
+ m_soundlatch->data_pending_callback().set_nop();
- MCFG_DEVICE_REMOVE("soundlatch2")
+ config.device_remove("soundlatch2");
/* sound hardware */
MCFG_DEVICE_REPLACE("ymsnd", YM2151, XTAL(16'000'000)/4) /* 4MHz - Confirmed */
@@ -1861,8 +1860,8 @@ MACHINE_CONFIG_START(snowbros_state::honeydol)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(12'000'000)/4) /* 3Mhz */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
@@ -1902,10 +1901,10 @@ MACHINE_CONFIG_START(snowbros_state::twinadv)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch2");
/* sound hardware */
MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH) /* freq? */
diff --git a/src/mame/drivers/spbactn.cpp b/src/mame/drivers/spbactn.cpp
index a7d0aa95bc5..f66dcd9514d 100644
--- a/src/mame/drivers/spbactn.cpp
+++ b/src/mame/drivers/spbactn.cpp
@@ -448,8 +448,8 @@ MACHINE_CONFIG_START(spbactn_state::spbactn)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(4'000'000)) /* Was 3.579545MHz, a common clock, but no way to generate via on PCB OSCs */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -503,8 +503,8 @@ MACHINE_CONFIG_START(spbactn_state::spbactnp)
/* sound hardware - different? */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(4'000'000))
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/spcforce.cpp b/src/mame/drivers/spcforce.cpp
index aea542beec6..beb5b84f011 100644
--- a/src/mame/drivers/spcforce.cpp
+++ b/src/mame/drivers/spcforce.cpp
@@ -320,7 +320,7 @@ MACHINE_CONFIG_START(spcforce_state::spcforce)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("sn1", SN76496, 2000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/spdodgeb.cpp b/src/mame/drivers/spdodgeb.cpp
index b937f73a657..77e8890962b 100644
--- a/src/mame/drivers/spdodgeb.cpp
+++ b/src/mame/drivers/spdodgeb.cpp
@@ -429,8 +429,8 @@ MACHINE_CONFIG_START(spdodgeb_state::spdodgeb)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", M6809_IRQ_LINE))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, M6809_IRQ_LINE);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(12'000'000)/4)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
diff --git a/src/mame/drivers/speedspn.cpp b/src/mame/drivers/speedspn.cpp
index d8c6f034a0b..4ba3f285ba6 100644
--- a/src/mame/drivers/speedspn.cpp
+++ b/src/mame/drivers/speedspn.cpp
@@ -308,7 +308,7 @@ MACHINE_CONFIG_START(speedspn_state::speedspn)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 1122000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/splash.cpp b/src/mame/drivers/splash.cpp
index ee4ee49bd2f..7381b8f8faa 100644
--- a/src/mame/drivers/splash.cpp
+++ b/src/mame/drivers/splash.cpp
@@ -521,8 +521,8 @@ MACHINE_CONFIG_START(splash_state::splash)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(30'000'000)/8) /* 3.75MHz (30/8) */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
@@ -584,9 +584,9 @@ MACHINE_CONFIG_START(splash_state::roldfrog)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(24'000'000) / 8)
MCFG_YM2203_IRQ_HANDLER(WRITELINE(*this, splash_state, ym_irq))
@@ -670,8 +670,8 @@ MACHINE_CONFIG_START(funystrp_state::funystrp)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("msm1", MSM5205, XTAL(400'000))
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, funystrp_state, adpcm_int1)) /* interrupt function */
diff --git a/src/mame/drivers/spy.cpp b/src/mame/drivers/spy.cpp
index 32e69d9eb5e..5b270dec439 100644
--- a/src/mame/drivers/spy.cpp
+++ b/src/mame/drivers/spy.cpp
@@ -531,7 +531,7 @@ MACHINE_CONFIG_START(spy_state::spy)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM3812, 3579545)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/srumbler.cpp b/src/mame/drivers/srumbler.cpp
index 158dfd44b02..7a1d6041c19 100644
--- a/src/mame/drivers/srumbler.cpp
+++ b/src/mame/drivers/srumbler.cpp
@@ -277,7 +277,7 @@ MACHINE_CONFIG_START(srumbler_state::srumbler)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ym1", YM2203, 4000000)
MCFG_SOUND_ROUTE(0, "mono", 0.10)
diff --git a/src/mame/drivers/sslam.cpp b/src/mame/drivers/sslam.cpp
index 18fb8def468..f02fb30cbf7 100644
--- a/src/mame/drivers/sslam.cpp
+++ b/src/mame/drivers/sslam.cpp
@@ -753,7 +753,7 @@ MACHINE_CONFIG_START(sslam_state::powerbls)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH) /* verified on original PCB */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
diff --git a/src/mame/drivers/supbtime.cpp b/src/mame/drivers/supbtime.cpp
index b51ab746c59..cbfa225b3b5 100644
--- a/src/mame/drivers/supbtime.cpp
+++ b/src/mame/drivers/supbtime.cpp
@@ -377,8 +377,7 @@ MACHINE_CONFIG_START(supbtime_state::supbtime)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(32'220'000) / 9)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) // IRQ 2
diff --git a/src/mame/drivers/supduck.cpp b/src/mame/drivers/supduck.cpp
index bfb7638a741..c34cb79c02d 100644
--- a/src/mame/drivers/supduck.cpp
+++ b/src/mame/drivers/supduck.cpp
@@ -474,7 +474,7 @@ MACHINE_CONFIG_START(supduck_state::supduck)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(8'000'000)/8, okim6295_device::PIN7_HIGH) // 1MHz - Verified on PCB, pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/suprslam.cpp b/src/mame/drivers/suprslam.cpp
index 3348666e239..89dbf8f2420 100644
--- a/src/mame/drivers/suprslam.cpp
+++ b/src/mame/drivers/suprslam.cpp
@@ -312,9 +312,9 @@ MACHINE_CONFIG_START(suprslam_state::suprslam)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp
index da6a08c8d6a..cd3fef74a5b 100644
--- a/src/mame/drivers/system1.cpp
+++ b/src/mame/drivers/system1.cpp
@@ -2194,7 +2194,7 @@ MACHINE_CONFIG_START(system1_state::sys1ppi)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("sn1", SN76489A, SOUND_CLOCK/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
diff --git a/src/mame/drivers/system16.cpp b/src/mame/drivers/system16.cpp
index 56f4753a7eb..968a0a70204 100644
--- a/src/mame/drivers/system16.cpp
+++ b/src/mame/drivers/system16.cpp
@@ -2183,7 +2183,7 @@ MACHINE_CONFIG_START(segas1x_bootleg_state::system16_base)
MCFG_VIDEO_START_OVERRIDE(segas1x_bootleg_state,system16)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(segas1x_bootleg_state::shinobi_datsu)
@@ -2284,7 +2284,7 @@ MACHINE_CONFIG_START(segas1x_bootleg_state::goldnaxeb_base)
MCFG_VIDEO_START_OVERRIDE(segas1x_bootleg_state,system16)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(segas1x_bootleg_state::goldnaxeb1)
@@ -2459,7 +2459,7 @@ MACHINE_CONFIG_START(segas1x_bootleg_state::system18)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("3438.0", YM3438, 8000000)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.40)
@@ -2511,8 +2511,8 @@ MACHINE_CONFIG_START(segas1x_bootleg_state::astormb2)
MCFG_DEVICE_ADD("sprites", SEGA_SYS16B_SPRITES, 0)
MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-107)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", 0))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, 0);
// 1 OKI M6295 instead of original sound hardware
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/taotaido.cpp b/src/mame/drivers/taotaido.cpp
index 3c5077dfe1d..3b72e18936a 100644
--- a/src/mame/drivers/taotaido.cpp
+++ b/src/mame/drivers/taotaido.cpp
@@ -397,9 +397,9 @@ MACHINE_CONFIG_START(taotaido_state::taotaido)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/tatsumi.cpp b/src/mame/drivers/tatsumi.cpp
index c9b41829a1f..b26bea65e53 100644
--- a/src/mame/drivers/tatsumi.cpp
+++ b/src/mame/drivers/tatsumi.cpp
@@ -1048,8 +1048,8 @@ MACHINE_CONFIG_START(cyclwarr_state::cyclwarr)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
-// MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+// m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, CLOCK_1 / 4)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/tbowl.cpp b/src/mame/drivers/tbowl.cpp
index 807e76c02ac..bcb31d00057 100644
--- a/src/mame/drivers/tbowl.cpp
+++ b/src/mame/drivers/tbowl.cpp
@@ -477,9 +477,9 @@ MACHINE_CONFIG_START(tbowl_state::tbowl)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ym1", YM3812, 4000000)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/tecmo.cpp b/src/mame/drivers/tecmo.cpp
index c8e87f7b8b0..c5dfa0a140f 100644
--- a/src/mame/drivers/tecmo.cpp
+++ b/src/mame/drivers/tecmo.cpp
@@ -728,9 +728,9 @@ MACHINE_CONFIG_START(tecmo_state::rygar)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
+ soundlatch.set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM3526, XTAL(4'000'000)) /* verified on pcb */
MCFG_YM3526_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
diff --git a/src/mame/drivers/tecmo16.cpp b/src/mame/drivers/tecmo16.cpp
index 7ab3910dd28..6e178f12414 100644
--- a/src/mame/drivers/tecmo16.cpp
+++ b/src/mame/drivers/tecmo16.cpp
@@ -396,8 +396,7 @@ MACHINE_CONFIG_START(tecmo16_state::fstarfrc)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, MASTER_CLOCK/6) // 4 MHz
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/tecmosys.cpp b/src/mame/drivers/tecmosys.cpp
index 89253ff00c5..46297501822 100644
--- a/src/mame/drivers/tecmosys.cpp
+++ b/src/mame/drivers/tecmosys.cpp
@@ -483,8 +483,8 @@ MACHINE_CONFIG_START(tecmosys_state::tecmosys)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundnmi", input_merger_device, in_w<0>))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>));
MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/terracre.cpp b/src/mame/drivers/terracre.cpp
index 869b1effa72..bea8a9ae9ec 100644
--- a/src/mame/drivers/terracre.cpp
+++ b/src/mame/drivers/terracre.cpp
@@ -482,7 +482,7 @@ MACHINE_CONFIG_START(terracre_state::ym3526)
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3526, XTAL(16'000'000)/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
diff --git a/src/mame/drivers/tetrisp2.cpp b/src/mame/drivers/tetrisp2.cpp
index 6acd4ecccac..0264390ef29 100644
--- a/src/mame/drivers/tetrisp2.cpp
+++ b/src/mame/drivers/tetrisp2.cpp
@@ -1944,7 +1944,7 @@ MACHINE_CONFIG_START(stepstag_state::stepstag)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ GENERIC_LATCH_16(config, m_soundlatch);
MCFG_DEVICE_ADD("ymz", YMZ280B, 16934400)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
@@ -2017,7 +2017,7 @@ MACHINE_CONFIG_START(stepstag_state::vjdash) // 4 Screens
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ GENERIC_LATCH_16(config, m_soundlatch);
MCFG_DEVICE_ADD("ymz", YMZ280B, 16934400)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/thedeep.cpp b/src/mame/drivers/thedeep.cpp
index 62699a0b103..d3014f5dd75 100644
--- a/src/mame/drivers/thedeep.cpp
+++ b/src/mame/drivers/thedeep.cpp
@@ -444,8 +444,8 @@ MACHINE_CONFIG_START(thedeep_state::thedeep)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(12'000'000)/4) /* verified on pcb */
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/thunderx.cpp b/src/mame/drivers/thunderx.cpp
index 816b5315fcb..0c6085cf828 100644
--- a/src/mame/drivers/thunderx.cpp
+++ b/src/mame/drivers/thunderx.cpp
@@ -677,7 +677,7 @@ MACHINE_CONFIG_START(thunderx_state::scontra)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545)) /* verified on pcb */
MCFG_SOUND_ROUTE(0, "mono", 1.0)
diff --git a/src/mame/drivers/tigeroad.cpp b/src/mame/drivers/tigeroad.cpp
index c9d41cc2e49..bf4a7525738 100644
--- a/src/mame/drivers/tigeroad.cpp
+++ b/src/mame/drivers/tigeroad.cpp
@@ -683,8 +683,8 @@ MACHINE_CONFIG_START(tigeroad_state::tigeroad)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("ym1", YM2203, XTAL(3'579'545)) /* verified on pcb */
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -761,7 +761,7 @@ MACHINE_CONFIG_START(tigeroad_state::f1dream_comad)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ym1", YM2203, 2000000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp
index 13631ad3113..0aff7e84108 100644
--- a/src/mame/drivers/tmnt.cpp
+++ b/src/mame/drivers/tmnt.cpp
@@ -2012,7 +2012,7 @@ MACHINE_CONFIG_START(tmnt_state::mia)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545))
MCFG_SOUND_ROUTE(0, "mono", 1.0)
@@ -2078,7 +2078,7 @@ MACHINE_CONFIG_START(tmnt_state::tmnt)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545))
MCFG_SOUND_ROUTE(0, "mono", 1.0)
@@ -2411,9 +2411,9 @@ MACHINE_CONFIG_START(tmnt_state::prmrsocr)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch3")
+ GENERIC_LATCH_8(config, "soundlatch");
+ GENERIC_LATCH_8(config, "soundlatch2");
+ GENERIC_LATCH_8(config, "soundlatch3");
MCFG_DEVICE_ADD("k054539", K054539, XTAL(18'432'000))
MCFG_K054539_TIMER_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/toki.cpp b/src/mame/drivers/toki.cpp
index e3d0124d770..d763090e806 100644
--- a/src/mame/drivers/toki.cpp
+++ b/src/mame/drivers/toki.cpp
@@ -578,7 +578,7 @@ MACHINE_CONFIG_START(toki_state::tokib)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, 3579545)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/tp84.cpp b/src/mame/drivers/tp84.cpp
index 2735f5b9b29..cd94eff3be6 100644
--- a/src/mame/drivers/tp84.cpp
+++ b/src/mame/drivers/tp84.cpp
@@ -371,7 +371,7 @@ MACHINE_CONFIG_START(tp84_state::tp84)
/* audio hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("y2404_1", Y2404, XTAL(14'318'181)/8) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter1", 0.75)
diff --git a/src/mame/drivers/trackfld.cpp b/src/mame/drivers/trackfld.cpp
index fc01c834e12..41578b7fb85 100644
--- a/src/mame/drivers/trackfld.cpp
+++ b/src/mame/drivers/trackfld.cpp
@@ -940,7 +940,7 @@ MACHINE_CONFIG_START(trackfld_state::trackfld)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD(m_soundbrd, TRACKFLD_AUDIO, 0, m_audiocpu, m_vlm)
@@ -1016,7 +1016,7 @@ MACHINE_CONFIG_START(trackfld_state::yieartf)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD(m_soundbrd, TRACKFLD_AUDIO, 0, finder_base::DUMMY_TAG, m_vlm)
@@ -1070,7 +1070,7 @@ MACHINE_CONFIG_START(trackfld_state::hyprolyb)
MCFG_DEVICE_ADD("adpcm", M6802, XTAL(14'318'181)/8) /* unknown clock */
MCFG_DEVICE_PROGRAM_MAP(hyprolyb_adpcm_map)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch2");
MCFG_DEVICE_ADD("hyprolyb_adpcm", HYPROLYB_ADPCM, 0)
diff --git a/src/mame/drivers/tryout.cpp b/src/mame/drivers/tryout.cpp
index ebab1a7767b..2faa973a506 100644
--- a/src/mame/drivers/tryout.cpp
+++ b/src/mame/drivers/tryout.cpp
@@ -216,7 +216,7 @@ MACHINE_CONFIG_START(tryout_state::tryout)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
diff --git a/src/mame/drivers/tubep.cpp b/src/mame/drivers/tubep.cpp
index dd913f9c02b..99f1c701c13 100644
--- a/src/mame/drivers/tubep.cpp
+++ b/src/mame/drivers/tubep.cpp
@@ -909,8 +909,7 @@ MACHINE_CONFIG_START(tubep_state::rjammer)
MCFG_DEVICE_PROGRAM_MAP(rjammer_sound_map)
MCFG_DEVICE_IO_MAP(rjammer_sound_portmap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("mcu",NSC8105,6000000) /* 6 MHz Xtal - divided internally ??? */
MCFG_DEVICE_PROGRAM_MAP(nsc_map)
diff --git a/src/mame/drivers/tumbleb.cpp b/src/mame/drivers/tumbleb.cpp
index 952ae90b9a7..0bbb07b7032 100644
--- a/src/mame/drivers/tumbleb.cpp
+++ b/src/mame/drivers/tumbleb.cpp
@@ -2154,7 +2154,7 @@ MACHINE_CONFIG_START(tumbleb_state::jumpkids)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 8000000/8, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
@@ -2254,7 +2254,7 @@ MACHINE_CONFIG_START(tumbleb_state::htchctch)
/* sound hardware - same as hyperpac */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* on at least hatch catch, cookie & bibi and choky choky the YM2151 clock is connected directly to the Z80 clock so the speed should match */
MCFG_DEVICE_ADD("ymsnd", YM2151, 15000000/4)
@@ -2368,7 +2368,7 @@ MACHINE_CONFIG_START(tumbleb_state::suprtrio)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 875000, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
diff --git a/src/mame/drivers/twin16.cpp b/src/mame/drivers/twin16.cpp
index 058b3d08511..bdc95c1a3ab 100644
--- a/src/mame/drivers/twin16.cpp
+++ b/src/mame/drivers/twin16.cpp
@@ -684,7 +684,7 @@ MACHINE_CONFIG_START(twin16_state::twin16)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545))
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
@@ -739,7 +739,7 @@ MACHINE_CONFIG_START(fround_state::fround)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545))
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/ultraman.cpp b/src/mame/drivers/ultraman.cpp
index 5ceab9446df..e98e746bb14 100644
--- a/src/mame/drivers/ultraman.cpp
+++ b/src/mame/drivers/ultraman.cpp
@@ -228,7 +228,7 @@ MACHINE_CONFIG_START(ultraman_state::ultraman)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM2151, 24000000/6)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/vamphalf.cpp b/src/mame/drivers/vamphalf.cpp
index dd1fd3dda7e..c717dd59a1d 100644
--- a/src/mame/drivers/vamphalf.cpp
+++ b/src/mame/drivers/vamphalf.cpp
@@ -1167,9 +1167,9 @@ MACHINE_CONFIG_START(vamphalf_state::sound_qs1000)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("qs1000", qs1000_device, set_irq))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("qs1000", FUNC(qs1000_device::set_irq));
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000))
MCFG_QS1000_EXTERNAL_ROM(true)
diff --git a/src/mame/drivers/vball.cpp b/src/mame/drivers/vball.cpp
index d8091935d56..db9d72e77bc 100644
--- a/src/mame/drivers/vball.cpp
+++ b/src/mame/drivers/vball.cpp
@@ -422,8 +422,8 @@ MACHINE_CONFIG_START(vball_state::vball)
SPEAKER(config, "rspeaker").front_right();
// The sound system comes all but verbatim from Double Dragon
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp
index 5de1155a080..08bf2bc82a2 100644
--- a/src/mame/drivers/vegaeo.cpp
+++ b/src/mame/drivers/vegaeo.cpp
@@ -199,9 +199,9 @@ MACHINE_CONFIG_START(vegaeo_state::vega)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("qs1000", qs1000_device, set_irq))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set("qs1000", FUNC(qs1000_device::set_irq));
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000))
MCFG_QS1000_EXTERNAL_ROM(true)
diff --git a/src/mame/drivers/vigilant.cpp b/src/mame/drivers/vigilant.cpp
index a36fd3a385c..b79b13c8b16 100644
--- a/src/mame/drivers/vigilant.cpp
+++ b/src/mame/drivers/vigilant.cpp
@@ -511,9 +511,9 @@ MACHINE_CONFIG_START(vigilant_state::vigilant)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundirq", rst_neg_buffer_device, rst18_w))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set("soundirq", FUNC(rst_neg_buffer_device::rst18_w));
+ soundlatch.set_separate_acknowledge(true);
RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline("soundcpu", 0);
@@ -561,9 +561,9 @@ MACHINE_CONFIG_START(vigilant_state::buccanrs)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundirq", rst_neg_buffer_device, rst18_w))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set("soundirq", FUNC(rst_neg_buffer_device::rst18_w));
+ soundlatch.set_separate_acknowledge(true);
RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline("soundcpu", 0);
@@ -626,9 +626,9 @@ MACHINE_CONFIG_START(vigilant_state::kikcubic)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(WRITELINE("soundirq", rst_neg_buffer_device, rst18_w))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
+ soundlatch.data_pending_callback().set("soundirq", FUNC(rst_neg_buffer_device::rst18_w));
+ soundlatch.set_separate_acknowledge(true);
RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline("soundcpu", 0);
diff --git a/src/mame/drivers/vulgus.cpp b/src/mame/drivers/vulgus.cpp
index 6a6fe6867fd..66877b57cc5 100644
--- a/src/mame/drivers/vulgus.cpp
+++ b/src/mame/drivers/vulgus.cpp
@@ -245,7 +245,7 @@ MACHINE_CONFIG_START(vulgus_state::vulgus)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
AY8910(config, "ay1", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.25); /* 1.5 MHz */
diff --git a/src/mame/drivers/wc90.cpp b/src/mame/drivers/wc90.cpp
index 10f675cd997..30963329b3f 100644
--- a/src/mame/drivers/wc90.cpp
+++ b/src/mame/drivers/wc90.cpp
@@ -380,8 +380,8 @@ MACHINE_CONFIG_START(wc90_state::wc90)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2608, XTAL(8'000'000)) /* verified on pcb */
MCFG_YM2608_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/wc90b.cpp b/src/mame/drivers/wc90b.cpp
index 4ae59c8cfd3..e91ad801888 100644
--- a/src/mame/drivers/wc90b.cpp
+++ b/src/mame/drivers/wc90b.cpp
@@ -385,7 +385,7 @@ MACHINE_CONFIG_START(wc90b_state::wc90b)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd1", YM2203, YM2203_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
diff --git a/src/mame/drivers/wecleman.cpp b/src/mame/drivers/wecleman.cpp
index 5cf1db7c6e8..7809e70342e 100644
--- a/src/mame/drivers/wecleman.cpp
+++ b/src/mame/drivers/wecleman.cpp
@@ -1085,7 +1085,7 @@ MACHINE_CONFIG_START(wecleman_state::wecleman)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("ymsnd", YM2151, 3579545)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.85)
@@ -1174,7 +1174,7 @@ MACHINE_CONFIG_START(wecleman_state::hotchase)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("k007232_1", K007232, 3579545)
// SLEV not used, volume control is elsewhere
diff --git a/src/mame/drivers/welltris.cpp b/src/mame/drivers/welltris.cpp
index 8e780ff6550..e3658e3eddd 100644
--- a/src/mame/drivers/welltris.cpp
+++ b/src/mame/drivers/welltris.cpp
@@ -705,9 +705,9 @@ MACHINE_CONFIG_START(welltris_state::welltris)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+ m_soundlatch->set_separate_acknowledge(true);
MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000)
MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/wheelfir.cpp b/src/mame/drivers/wheelfir.cpp
index 0aa94a1ed9b..f669e0027a9 100644
--- a/src/mame/drivers/wheelfir.cpp
+++ b/src/mame/drivers/wheelfir.cpp
@@ -764,7 +764,7 @@ MACHINE_CONFIG_START(wheelfir_state::wheelfir)
EEPROM_93C46_16BIT(config, "eeprom");
- MCFG_GENERIC_LATCH_16_ADD("soundlatch")
+ GENERIC_LATCH_16(config, "soundlatch");
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
diff --git a/src/mame/drivers/wwfsstar.cpp b/src/mame/drivers/wwfsstar.cpp
index ca9c1e0e56f..ce855a64b49 100644
--- a/src/mame/drivers/wwfsstar.cpp
+++ b/src/mame/drivers/wwfsstar.cpp
@@ -437,8 +437,8 @@ MACHINE_CONFIG_START(wwfsstar_state::wwfsstar)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
MCFG_DEVICE_ADD("ymsnd", YM2151, XTAL(3'579'545))
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/yunsun16.cpp b/src/mame/drivers/yunsun16.cpp
index 12ad533cb2e..c87de46da8e 100644
--- a/src/mame/drivers/yunsun16.cpp
+++ b/src/mame/drivers/yunsun16.cpp
@@ -617,7 +617,7 @@ MACHINE_CONFIG_START(yunsun16_state::magicbub)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(16'000'000)/4)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/yunsung8.cpp b/src/mame/drivers/yunsung8.cpp
index 3e8b6b14391..a3f5b764f5c 100644
--- a/src/mame/drivers/yunsung8.cpp
+++ b/src/mame/drivers/yunsung8.cpp
@@ -366,8 +366,7 @@ MACHINE_CONFIG_START(yunsung8_state::yunsung8)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(16'000'000)/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
diff --git a/src/mame/drivers/zaxxon.cpp b/src/mame/drivers/zaxxon.cpp
index 202f3a0ec9f..af814c7a61c 100644
--- a/src/mame/drivers/zaxxon.cpp
+++ b/src/mame/drivers/zaxxon.cpp
@@ -1071,7 +1071,7 @@ MACHINE_CONFIG_START(zaxxon_state::congo)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("sn1", SN76489A, SOUND_CLOCK) // schematic shows sn76489A
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
diff --git a/src/mame/drivers/zerozone.cpp b/src/mame/drivers/zerozone.cpp
index 9c402554a03..4e6f5690d15 100644
--- a/src/mame/drivers/zerozone.cpp
+++ b/src/mame/drivers/zerozone.cpp
@@ -200,7 +200,7 @@ MACHINE_CONFIG_START(zerozone_state::zerozone)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
MCFG_DEVICE_ADD("oki", OKIM6295, 1056000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/includes/ddragon3.h b/src/mame/includes/ddragon3.h
index cb07767640b..d4668ebe9d9 100644
--- a/src/mame/includes/ddragon3.h
+++ b/src/mame/includes/ddragon3.h
@@ -21,13 +21,13 @@ public:
ddragon3_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
m_bg_videoram(*this, "bg_videoram"),
m_fg_videoram(*this, "fg_videoram"),
m_spriteram(*this, "spriteram"),
- m_audiocpu(*this, "audiocpu"),
m_oki(*this, "oki"),
m_screen(*this, "screen")
{
@@ -43,6 +43,7 @@ public:
protected:
required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
@@ -85,7 +86,6 @@ private:
required_device<buffered_spriteram16_device> m_spriteram;
/* devices */
- required_device<cpu_device> m_audiocpu;
required_device<okim6295_device> m_oki;
required_device<screen_device> m_screen;
diff --git a/src/mame/includes/fromance.h b/src/mame/includes/fromance.h
index b8b67f756b8..1eb7f5be3eb 100644
--- a/src/mame/includes/fromance.h
+++ b/src/mame/includes/fromance.h
@@ -22,12 +22,12 @@ public:
fromance_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_subcpu(*this, "sub"),
m_spriteram(*this, "spriteram"),
m_palette(*this, "palette"),
m_gga(*this, "gga"),
m_videoram(*this, "videoram"),
m_spr_old(*this, "vsystem_spr_old"),
- m_subcpu(*this, "sub"),
m_sublatch(*this, "sublatch"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
@@ -44,6 +44,7 @@ public:
protected:
required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_subcpu;
optional_shared_ptr<uint8_t> m_spriteram;
required_device<palette_device> m_palette;
required_device<vsystem_gga_device> m_gga;
@@ -113,7 +114,6 @@ private:
inline void get_nekkyoku_tile_info( tile_data &tileinfo, int tile_index, int layer );
void crtc_refresh();
DECLARE_WRITE_LINE_MEMBER(fromance_adpcm_int);
- required_device<cpu_device> m_subcpu;
optional_device<generic_latch_8_device> m_sublatch;
optional_device<msm5205_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
diff --git a/src/mame/includes/ms32.h b/src/mame/includes/ms32.h
index 9fe4fa159f9..1a1f54a80db 100644
--- a/src/mame/includes/ms32.h
+++ b/src/mame/includes/ms32.h
@@ -13,10 +13,10 @@ public:
: driver_device(mconfig, type, tag),
m_palette(*this, "palette"),
m_gfxdecode(*this, "gfxdecode"),
- m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_screen(*this, "screen"),
m_soundlatch(*this, "soundlatch"),
+ m_maincpu(*this, "maincpu"),
+ m_screen(*this, "screen"),
m_mainram(*this, "mainram"),
m_roz_ctrl(*this, "roz_ctrl"),
m_tx_scroll(*this, "tx_scroll"),
@@ -66,13 +66,13 @@ protected:
int m_reverse_sprite_order;
int m_flipscreen;
+ required_device<cpu_device> m_audiocpu;
+ optional_device<generic_latch_8_device> m_soundlatch;
+
private:
required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
optional_device<screen_device> m_screen;
- optional_device<generic_latch_8_device> m_soundlatch;
-
optional_shared_ptr<uint32_t> m_mainram;
optional_shared_ptr<uint32_t> m_roz_ctrl;
optional_shared_ptr<uint32_t> m_tx_scroll;