summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/mame/audio/cclimber.cpp6
-rw-r--r--src/mame/audio/midway.cpp27
-rw-r--r--src/mame/drivers/ampoker2.cpp3
-rw-r--r--src/mame/drivers/astrocde.cpp10
-rw-r--r--src/mame/drivers/aztarac.cpp14
-rw-r--r--src/mame/drivers/buster.cpp3
-rw-r--r--src/mame/drivers/cclimber.cpp14
-rw-r--r--src/mame/drivers/cgc7900.cpp3
-rw-r--r--src/mame/drivers/champbas.cpp29
-rw-r--r--src/mame/drivers/chinsan.cpp14
-rw-r--r--src/mame/drivers/dday.cpp6
-rw-r--r--src/mame/drivers/dmndrby.cpp5
-rw-r--r--src/mame/drivers/funkybee.cpp6
-rw-r--r--src/mame/drivers/galaxian.cpp145
-rw-r--r--src/mame/drivers/galaxold.cpp9
-rw-r--r--src/mame/drivers/gamate.cpp10
-rw-r--r--src/mame/drivers/goldnpkr.cpp6
-rw-r--r--src/mame/drivers/gyruss.cpp80
-rw-r--r--src/mame/drivers/hanaawas.cpp8
-rw-r--r--src/mame/drivers/hyhoo.cpp8
-rw-r--r--src/mame/drivers/imolagp.cpp3
-rw-r--r--src/mame/drivers/jangou.cpp10
-rw-r--r--src/mame/drivers/jollyjgr.cpp3
-rw-r--r--src/mame/drivers/jpms80.cpp8
-rw-r--r--src/mame/drivers/junofrst.cpp18
-rw-r--r--src/mame/drivers/jupace.cpp3
-rw-r--r--src/mame/drivers/kncljoe.cpp10
-rw-r--r--src/mame/drivers/labyrunr.cpp28
-rw-r--r--src/mame/drivers/lasso.cpp6
-rw-r--r--src/mame/drivers/liberate.cpp16
-rw-r--r--src/mame/drivers/ltd.cpp6
-rw-r--r--src/mame/drivers/magmax.cpp14
-rw-r--r--src/mame/drivers/mainsnk.cpp12
-rw-r--r--src/mame/drivers/marinedt.cpp2
-rw-r--r--src/mame/drivers/maygay1b.cpp10
-rw-r--r--src/mame/drivers/megazone.cpp16
-rw-r--r--src/mame/drivers/merit.cpp6
-rw-r--r--src/mame/drivers/mermaid.cpp6
-rw-r--r--src/mame/drivers/microtan.cpp6
-rw-r--r--src/mame/drivers/mirax.cpp8
-rw-r--r--src/mame/drivers/mouser.cpp6
-rw-r--r--src/mame/drivers/mrflea.cpp33
-rw-r--r--src/mame/drivers/nbmj8688.cpp16
-rw-r--r--src/mame/drivers/nbmj8891.cpp27
-rw-r--r--src/mame/drivers/nbmj8991.cpp18
-rw-r--r--src/mame/drivers/nemesis.cpp120
-rw-r--r--src/mame/drivers/nibble.cpp3
-rw-r--r--src/mame/drivers/nichild.cpp3
-rw-r--r--src/mame/drivers/nightgal.cpp16
-rw-r--r--src/mame/drivers/nsm.cpp11
-rw-r--r--src/mame/drivers/othello.cpp8
-rw-r--r--src/mame/drivers/pacman.cpp8
-rw-r--r--src/mame/drivers/pandoras.cpp12
-rw-r--r--src/mame/drivers/pastelg.cpp16
-rw-r--r--src/mame/drivers/pbaction.cpp11
-rw-r--r--src/mame/drivers/peplus.cpp3
-rw-r--r--src/mame/drivers/phoenix.cpp7
-rw-r--r--src/mame/drivers/play_2.cpp3
-rw-r--r--src/mame/drivers/play_3.cpp6
-rw-r--r--src/mame/drivers/popper.cpp6
-rw-r--r--src/mame/drivers/progolf.cpp6
-rw-r--r--src/mame/drivers/pturn.cpp8
-rw-r--r--src/mame/drivers/quizdna.cpp14
-rw-r--r--src/mame/drivers/quizo.cpp3
-rw-r--r--src/mame/drivers/ron.cpp6
-rw-r--r--src/mame/drivers/scobra.cpp30
-rw-r--r--src/mame/drivers/scramble.cpp43
-rw-r--r--src/mame/drivers/scregg.cpp12
-rw-r--r--src/mame/drivers/segag80v.cpp3
-rw-r--r--src/mame/drivers/seicross.cpp8
-rw-r--r--src/mame/drivers/seta.cpp10
-rw-r--r--src/mame/drivers/shougi.cpp3
-rw-r--r--src/mame/drivers/skeetsht.cpp3
-rw-r--r--src/mame/drivers/snk.cpp21
-rw-r--r--src/mame/drivers/solomon.cpp11
-rw-r--r--src/mame/drivers/sonson.cpp8
-rw-r--r--src/mame/drivers/spartanxtec.cpp17
-rw-r--r--src/mame/drivers/speedatk.cpp8
-rw-r--r--src/mame/drivers/splus.cpp3
-rw-r--r--src/mame/drivers/spyhuntertec.cpp23
-rw-r--r--src/mame/drivers/srmp2.cpp24
-rw-r--r--src/mame/drivers/ssingles.cpp6
-rw-r--r--src/mame/drivers/stargame.cpp3
-rw-r--r--src/mame/drivers/statriv2.cpp3
-rw-r--r--src/mame/drivers/sub.cpp12
-rw-r--r--src/mame/drivers/supertnk.cpp9
-rw-r--r--src/mame/drivers/suprgolf.cpp14
-rw-r--r--src/mame/drivers/tagteam.cpp10
-rw-r--r--src/mame/drivers/thedealr.cpp8
-rw-r--r--src/mame/drivers/thief.cpp6
-rw-r--r--src/mame/drivers/trvmadns.cpp3
-rw-r--r--src/mame/drivers/tsamurai.cpp11
-rw-r--r--src/mame/drivers/tubep.cpp53
-rw-r--r--src/mame/drivers/tugboat.cpp3
-rw-r--r--src/mame/drivers/videopkr.cpp3
-rw-r--r--src/mame/drivers/vpoker.cpp3
-rw-r--r--src/mame/drivers/wallc.cpp11
-rw-r--r--src/mame/drivers/wink.cpp8
98 files changed, 618 insertions, 742 deletions
diff --git a/src/mame/audio/cclimber.cpp b/src/mame/audio/cclimber.cpp
index f61d22e2d6c..1288bdae653 100644
--- a/src/mame/audio/cclimber.cpp
+++ b/src/mame/audio/cclimber.cpp
@@ -58,9 +58,9 @@ void cclimber_audio_device::device_start()
//-------------------------------------------------
MACHINE_CONFIG_START(cclimber_audio_device::device_add_mconfig)
- MCFG_DEVICE_ADD("aysnd", AY8910, SND_CLOCK/2)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, cclimber_audio_device, sample_select_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":speaker", 0.5)
+ ay8910_device &aysnd(AY8910(config, "aysnd", SND_CLOCK/2));
+ aysnd.port_a_write_callback().set(FUNC(cclimber_audio_device::sample_select_w));
+ aysnd.add_route(ALL_OUTPUTS, ":speaker", 0.5);
MCFG_DEVICE_ADD("samples", SAMPLES)
MCFG_SAMPLES_CHANNELS(1)
diff --git a/src/mame/audio/midway.cpp b/src/mame/audio/midway.cpp
index b12adc67b59..679c2a8feb2 100644
--- a/src/mame/audio/midway.cpp
+++ b/src/mame/audio/midway.cpp
@@ -410,22 +410,23 @@ const tiny_rom_entry *midway_ssio_device::device_rom_region() const
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(midway_ssio_device::device_add_mconfig)
- MCFG_DEVICE_ADD("cpu", Z80, DERIVED_CLOCK(1, 2*4))
- MCFG_DEVICE_PROGRAM_MAP(ssio_map)
+void midway_ssio_device::device_add_mconfig(machine_config &config)
+{
+ Z80(config, m_cpu, DERIVED_CLOCK(1, 2*4));
+ m_cpu->set_addrmap(AS_PROGRAM, &midway_ssio_device::ssio_map);
if (clock())
- MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF, midway_ssio_device, clock_14024, clock() / (2*16*10))
+ m_cpu->set_periodic_int(DEVICE_SELF, FUNC(midway_ssio_device::clock_14024), attotime::from_hz(clock() / (2*16*10)));
- MCFG_DEVICE_ADD("ay0", AY8910, DERIVED_CLOCK(1, 2*4))
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, midway_ssio_device, porta0_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, midway_ssio_device, portb0_w))
- MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.33, 0)
+ AY8910(config, m_ay0, DERIVED_CLOCK(1, 2*4));
+ m_ay0->port_a_write_callback().set(FUNC(midway_ssio_device::porta0_w));
+ m_ay0->port_b_write_callback().set(FUNC(midway_ssio_device::portb0_w));
+ m_ay0->add_route(ALL_OUTPUTS, *this, 0.33, 0);
- MCFG_DEVICE_ADD("ay1", AY8910, DERIVED_CLOCK(1, 2*4))
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, midway_ssio_device, porta1_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, midway_ssio_device, portb1_w))
- MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.33, 1)
-MACHINE_CONFIG_END
+ AY8910(config, m_ay1, DERIVED_CLOCK(1, 2*4));
+ m_ay1->port_a_write_callback().set(FUNC(midway_ssio_device::porta1_w));
+ m_ay1->port_b_write_callback().set(FUNC(midway_ssio_device::portb1_w));
+ m_ay1->add_route(ALL_OUTPUTS, *this, 0.33, 1);
+}
//-------------------------------------------------
diff --git a/src/mame/drivers/ampoker2.cpp b/src/mame/drivers/ampoker2.cpp
index debb7da0133..5f417fd245b 100644
--- a/src/mame/drivers/ampoker2.cpp
+++ b/src/mame/drivers/ampoker2.cpp
@@ -1189,8 +1189,7 @@ MACHINE_CONFIG_START(ampoker2_state::ampoker2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, MASTER_CLOCK/4) /* 1.5 MHz, measured */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ AY8910(config, "aysnd", MASTER_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 0.30); /* 1.5 MHz, measured */
MACHINE_CONFIG_END
MACHINE_CONFIG_START(ampoker2_state::sigma2k)
diff --git a/src/mame/drivers/astrocde.cpp b/src/mame/drivers/astrocde.cpp
index 798d67e35b1..aae7f09dbe9 100644
--- a/src/mame/drivers/astrocde.cpp
+++ b/src/mame/drivers/astrocde.cpp
@@ -1519,12 +1519,12 @@ MACHINE_CONFIG_START(tenpindx_state::tenpindx)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("sub", INPUT_LINE_NMI))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_subcpu, INPUT_LINE_NMI);
- MCFG_DEVICE_ADD("aysnd", AY8912, ASTROCADE_CLOCK/4) /* real clock unknown */
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DIPSW"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
+ ay8912_device &aysnd(AY8912(config, "aysnd", ASTROCADE_CLOCK/4)); /* real clock unknown */
+ aysnd.port_a_read_callback().set_ioport("DIPSW");
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.33);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/aztarac.cpp b/src/mame/drivers/aztarac.cpp
index c4bdc4cbae3..083fb952962 100644
--- a/src/mame/drivers/aztarac.cpp
+++ b/src/mame/drivers/aztarac.cpp
@@ -177,19 +177,15 @@ MACHINE_CONFIG_START(aztarac_state::aztarac)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ AY8910(config, "ay1", 2000000).add_route(ALL_OUTPUTS, "mono", 0.15);
- MCFG_DEVICE_ADD("ay2", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ AY8910(config, "ay2", 2000000).add_route(ALL_OUTPUTS, "mono", 0.15);
- MCFG_DEVICE_ADD("ay3", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ AY8910(config, "ay3", 2000000).add_route(ALL_OUTPUTS, "mono", 0.15);
- MCFG_DEVICE_ADD("ay4", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ AY8910(config, "ay4", 2000000).add_route(ALL_OUTPUTS, "mono", 0.15);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/buster.cpp b/src/mame/drivers/buster.cpp
index 310e851cde5..42f1a7cb5df 100644
--- a/src/mame/drivers/buster.cpp
+++ b/src/mame/drivers/buster.cpp
@@ -346,8 +346,7 @@ MACHINE_CONFIG_START(buster_state::buster)
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 1500000/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, "aysnd", 1500000/2).add_route(ALL_OUTPUTS, "mono", 0.25);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cclimber.cpp b/src/mame/drivers/cclimber.cpp
index 355f09c8e8d..96f8a320b76 100644
--- a/src/mame/drivers/cclimber.cpp
+++ b/src/mame/drivers/cclimber.cpp
@@ -1210,11 +1210,9 @@ MACHINE_CONFIG_START(cclimber_state::yamato)
/* audio hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(18'432'000)/12) /* 1.536 MHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, "ay1", XTAL(18'432'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.25); /* 1.536 MHz */
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(18'432'000)/12) /* 1.536 MHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, "ay2", XTAL(18'432'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.25); /* 1.536 MHz */
MACHINE_CONFIG_END
@@ -1281,13 +1279,11 @@ MACHINE_CONFIG_START(cclimber_state::swimmer)
/* audio hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(4'000'000)/2) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, "ay1", XTAL(4'000'000)/2).add_route(ALL_OUTPUTS, "speaker", 0.25); /* verified on pcb */
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(4'000'000)/2) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, "ay2", XTAL(4'000'000)/2).add_route(ALL_OUTPUTS, "speaker", 0.25); /* verified on pcb */
MACHINE_CONFIG_END
void cclimber_state::guzzler(machine_config &config)
diff --git a/src/mame/drivers/cgc7900.cpp b/src/mame/drivers/cgc7900.cpp
index ae9e76055a4..1e4106ea4bb 100644
--- a/src/mame/drivers/cgc7900.cpp
+++ b/src/mame/drivers/cgc7900.cpp
@@ -482,8 +482,7 @@ MACHINE_CONFIG_START(cgc7900_state::cgc7900)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD(AY8910_TAG, AY8910, XTAL(28'480'000)/16)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, AY8910_TAG, XTAL(28'480'000)/16).add_route(ALL_OUTPUTS, "mono", 0.25);
/* devices */
MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0)
diff --git a/src/mame/drivers/champbas.cpp b/src/mame/drivers/champbas.cpp
index 09bbfed8995..85b1e8564e9 100644
--- a/src/mame/drivers/champbas.cpp
+++ b/src/mame/drivers/champbas.cpp
@@ -564,10 +564,9 @@ MACHINE_CONFIG_START(champbas_state::talbot)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(18'432'000)/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ AY8910(config, "ay1", XTAL(18'432'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.5);
MACHINE_CONFIG_END
@@ -609,10 +608,9 @@ MACHINE_CONFIG_START(champbas_state::champbas)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(18'432'000)/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
+ AY8910(config, "ay1", XTAL(18'432'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.3);
MCFG_DEVICE_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
@@ -721,20 +719,16 @@ MACHINE_CONFIG_START(exctsccr_state::exctsccr)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
/* AY (melody) clock is specified by a VR (0.9 - 3.9 MHz) */
- MCFG_DEVICE_ADD("ay1", AY8910, 1940000) /* VR has a factory mark and this is the value read */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.08)
+ AY8910(config, "ay1", 1940000).add_route(ALL_OUTPUTS, "speaker", 0.08); /* VR has a factory mark and this is the value read */
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(14'318'181)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.08)
+ AY8910(config, "ay2", XTAL(14'318'181)/8).add_route(ALL_OUTPUTS, "speaker", 0.08);
- MCFG_DEVICE_ADD("ay3", AY8910, XTAL(14'318'181)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.08)
+ AY8910(config, "ay3", XTAL(14'318'181)/8).add_route(ALL_OUTPUTS, "speaker", 0.08);
- MCFG_DEVICE_ADD("ay4", AY8910, XTAL(14'318'181)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.08)
+ AY8910(config, "ay4", XTAL(14'318'181)/8).add_route(ALL_OUTPUTS, "speaker", 0.08);
MCFG_DEVICE_ADD("dac1", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
MCFG_DEVICE_ADD("dac2", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
@@ -785,10 +779,9 @@ MACHINE_CONFIG_START(exctsccr_state::exctsccrb)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(18'432'000)/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
+ AY8910(config, "ay1", XTAL(18'432'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.3);
MCFG_DEVICE_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
diff --git a/src/mame/drivers/chinsan.cpp b/src/mame/drivers/chinsan.cpp
index ab72d68d0e6..39d1ad84d7d 100644
--- a/src/mame/drivers/chinsan.cpp
+++ b/src/mame/drivers/chinsan.cpp
@@ -535,13 +535,13 @@ MACHINE_CONFIG_START(chinsan_state::chinsan)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(10'000'000)/8)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2"))
- MCFG_SOUND_ROUTE(0, "mono", 0.15)
- MCFG_SOUND_ROUTE(1, "mono", 0.15)
- MCFG_SOUND_ROUTE(2, "mono", 0.15)
- MCFG_SOUND_ROUTE(3, "mono", 0.10)
+ ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(10'000'000)/8));
+ ymsnd.port_a_read_callback().set_ioport("DSW1");
+ ymsnd.port_b_read_callback().set_ioport("DSW2");
+ ymsnd.add_route(0, "mono", 0.15);
+ ymsnd.add_route(1, "mono", 0.15);
+ ymsnd.add_route(2, "mono", 0.15);
+ ymsnd.add_route(3, "mono", 0.10);
MCFG_DEVICE_ADD("adpcm", MSM5205, XTAL(384'000))
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, chinsan_state, adpcm_int_w))
diff --git a/src/mame/drivers/dday.cpp b/src/mame/drivers/dday.cpp
index 1385c36f450..d0239efaa17 100644
--- a/src/mame/drivers/dday.cpp
+++ b/src/mame/drivers/dday.cpp
@@ -279,11 +279,9 @@ MACHINE_CONFIG_START(dday_state::dday)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, 1000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, m_ay1, 1000000).add_route(ALL_OUTPUTS, "mono", 0.25);
- MCFG_DEVICE_ADD("ay2", AY8910, 1000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, "ay2", 1000000).add_route(ALL_OUTPUTS, "mono", 0.25);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/dmndrby.cpp b/src/mame/drivers/dmndrby.cpp
index 51d1fe111c8..6b40b0fc807 100644
--- a/src/mame/drivers/dmndrby.cpp
+++ b/src/mame/drivers/dmndrby.cpp
@@ -560,10 +560,9 @@ MACHINE_CONFIG_START(dmndrby_state::dderby)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8910, 1789750) // frequency guessed
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ AY8910(config, "ay1", 1789750).add_route(ALL_OUTPUTS, "mono", 0.35); // frequency guessed
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/funkybee.cpp b/src/mame/drivers/funkybee.cpp
index c10a49a58b1..186fcdde25c 100644
--- a/src/mame/drivers/funkybee.cpp
+++ b/src/mame/drivers/funkybee.cpp
@@ -317,9 +317,9 @@ MACHINE_CONFIG_START(funkybee_state::funkybee)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8912, 1500000) // AY-3-8912 verified for Sky Lancer
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ ay8912_device &ay8912(AY8912(config, "aysnd", 1500000)); // AY-3-8912 verified for Sky Lancer
+ ay8912.port_a_read_callback().set_ioport("DSW");
+ ay8912.add_route(ALL_OUTPUTS, "mono", 0.50);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp
index 878d1a5b614..8398e5bb285 100644
--- a/src/mame/drivers/galaxian.cpp
+++ b/src/mame/drivers/galaxian.cpp
@@ -5985,7 +5985,7 @@ void galaxian_state::konami_base(machine_config &config)
m_ppi8255[0]->out_pc_callback().set(FUNC(galaxian_state::konami_portc_0_w));
I8255A(config, m_ppi8255[1]);
- m_ppi8255[1]->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255[1]->out_pa_callback().set(m_soundlatch, FUNC(generic_latch_8_device::write));
m_ppi8255[1]->out_pb_callback().set(FUNC(galaxian_state::konami_sound_control_w));
m_ppi8255[1]->in_pc_callback().set_ioport("IN3");
m_ppi8255[1]->out_pc_callback().set(FUNC(galaxian_state::konami_portc_1_w));
@@ -5999,17 +5999,17 @@ MACHINE_CONFIG_START(galaxian_state::konami_sound_1x_ay8910)
MCFG_DEVICE_PROGRAM_MAP(frogger_sound_map)
MCFG_DEVICE_IO_MAP(frogger_sound_portmap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* sound hardware */
- MCFG_DEVICE_ADD("8910.0", AY8910, KONAMI_SOUND_CLOCK/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(RES_K(5.1), RES_K(5.1), RES_K(5.1))
- MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, galaxian_state, frogger_sound_timer_r))
- MCFG_SOUND_ROUTE(0, "konami", 1.0, 0)
- MCFG_SOUND_ROUTE(1, "konami", 1.0, 1)
- MCFG_SOUND_ROUTE(2, "konami", 1.0, 2)
+ AY8910(config, m_ay8910[0], KONAMI_SOUND_CLOCK/8);
+ m_ay8910[0]->set_flags(AY8910_DISCRETE_OUTPUT);
+ m_ay8910[0]->set_resistors_load(RES_K(5.1), RES_K(5.1), RES_K(5.1));
+ m_ay8910[0]->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
+ m_ay8910[0]->port_b_read_callback().set(FUNC(galaxian_state::frogger_sound_timer_r));
+ m_ay8910[0]->add_route(0, "konami", 1.0, 0);
+ m_ay8910[0]->add_route(1, "konami", 1.0, 1);
+ m_ay8910[0]->add_route(2, "konami", 1.0, 2);
MCFG_DEVICE_ADD("konami", DISCRETE, konami_sound_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
@@ -6023,24 +6023,24 @@ MACHINE_CONFIG_START(galaxian_state::konami_sound_2x_ay8910)
MCFG_DEVICE_PROGRAM_MAP(konami_sound_map)
MCFG_DEVICE_IO_MAP(konami_sound_portmap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* sound hardware */
- MCFG_DEVICE_ADD("8910.0", AY8910, KONAMI_SOUND_CLOCK/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(RES_K(5.1), RES_K(5.1), RES_K(5.1))
- MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, galaxian_state, konami_sound_timer_r))
- MCFG_SOUND_ROUTE(0, "konami", 1.0, 0)
- MCFG_SOUND_ROUTE(1, "konami", 1.0, 1)
- MCFG_SOUND_ROUTE(2, "konami", 1.0, 2)
-
- MCFG_DEVICE_ADD("8910.1", AY8910, KONAMI_SOUND_CLOCK/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(RES_K(5.1), RES_K(5.1), RES_K(5.1))
- MCFG_SOUND_ROUTE(0, "konami", 1.0, 3)
- MCFG_SOUND_ROUTE(1, "konami", 1.0, 4)
- MCFG_SOUND_ROUTE(2, "konami", 1.0, 5)
+ AY8910(config, m_ay8910[0], KONAMI_SOUND_CLOCK/8);
+ m_ay8910[0]->set_flags(AY8910_DISCRETE_OUTPUT);
+ m_ay8910[0]->set_resistors_load(RES_K(5.1), RES_K(5.1), RES_K(5.1));
+ m_ay8910[0]->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
+ m_ay8910[0]->port_b_read_callback().set(FUNC(galaxian_state::konami_sound_timer_r));
+ m_ay8910[0]->add_route(0, "konami", 1.0, 0);
+ m_ay8910[0]->add_route(1, "konami", 1.0, 1);
+ m_ay8910[0]->add_route(2, "konami", 1.0, 2);
+
+ AY8910(config, m_ay8910[1], KONAMI_SOUND_CLOCK/8);
+ m_ay8910[1]->set_flags(AY8910_DISCRETE_OUTPUT);
+ m_ay8910[1]->set_resistors_load(RES_K(5.1), RES_K(5.1), RES_K(5.1));
+ m_ay8910[1]->add_route(0, "konami", 1.0, 3);
+ m_ay8910[1]->add_route(1, "konami", 1.0, 4);
+ m_ay8910[1]->add_route(2, "konami", 1.0, 5);
MCFG_DEVICE_ADD("konami", DISCRETE, konami_sound_discrete)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
@@ -6128,8 +6128,7 @@ MACHINE_CONFIG_START(galaxian_state::zigzag)
MCFG_DEVICE_PROGRAM_MAP(zigzag_map)
/* sound hardware */
- MCFG_DEVICE_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) /* matches PCB video - unconfirmed */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ AY8910(config, m_ay8910[0], GALAXIAN_PIXEL_CLOCK/3/2).add_route(ALL_OUTPUTS, "speaker", 0.5); /* matches PCB video - unconfirmed */
MACHINE_CONFIG_END
@@ -6193,11 +6192,9 @@ MACHINE_CONFIG_START(galaxian_state::fantastc)
MCFG_DEVICE_PROGRAM_MAP(fantastc_map)
/* sound hardware */
- MCFG_DEVICE_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) // 3.072MHz
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, m_ay8910[0], GALAXIAN_PIXEL_CLOCK/3/2).add_route(ALL_OUTPUTS, "speaker", 0.25); // 3.072MHz
- MCFG_DEVICE_ADD("8910.1", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) // 3.072MHz
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, m_ay8910[1], GALAXIAN_PIXEL_CLOCK/3/2).add_route(ALL_OUTPUTS, "speaker", 0.25); // 3.072MHz
MACHINE_CONFIG_END
@@ -6231,8 +6228,7 @@ MACHINE_CONFIG_START(galaxian_state::jumpbug)
MCFG_DEVICE_PROGRAM_MAP(jumpbug_map)
/* sound hardware */
- MCFG_DEVICE_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK/3/2/2) /* matches PCB video - unconfirmed */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ AY8910(config, m_ay8910[0], GALAXIAN_PIXEL_CLOCK/3/2/2).add_route(ALL_OUTPUTS, "speaker", 0.5); /* matches PCB video - unconfirmed */
MACHINE_CONFIG_END
@@ -6245,11 +6241,10 @@ MACHINE_CONFIG_START(galaxian_state::checkman)
MCFG_DEVICE_IO_MAP(checkman_sound_portmap)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", galaxian_state, irq0_line_hold) /* NMIs are triggered by the main CPU */
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* sound hardware */
- MCFG_DEVICE_ADD("8910.0", AY8910, 1789750)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ AY8910(config, m_ay8910[0], 1789750).add_route(ALL_OUTPUTS, "speaker", 0.5);
MACHINE_CONFIG_END
@@ -6266,12 +6261,12 @@ MACHINE_CONFIG_START(galaxian_state::checkmaj)
MCFG_TIMER_DRIVER_ADD_SCANLINE("irq0", galaxian_state, checkmaj_irq0_gen, "screen", 0, 8)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* sound hardware */
- MCFG_DEVICE_ADD("8910.0", AY8910, 1620000)
- MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 2)
+ AY8910(config, m_ay8910[0], 1620000);
+ m_ay8910[0]->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
+ m_ay8910[0]->add_route(ALL_OUTPUTS, "speaker", 2);
MACHINE_CONFIG_END
@@ -6297,7 +6292,7 @@ MACHINE_CONFIG_START(galaxian_state::kingball)
MCFG_DEVICE_PROGRAM_MAP(kingball_sound_map)
MCFG_DEVICE_IO_MAP(kingball_sound_portmap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* sound hardware */
MCFG_DEVICE_ADD("dac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.53) // unknown DAC
@@ -6408,12 +6403,11 @@ MACHINE_CONFIG_START(galaxian_state::jungsub)
MCFG_DEVICE_IO_MAP(checkman_sound_portmap)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", galaxian_state, irq0_line_hold)
- 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);
/* sound hardware */
- MCFG_DEVICE_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK / 3 / 2 / 2) // clock not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ AY8910(config, m_ay8910[0], GALAXIAN_PIXEL_CLOCK / 3 / 2 / 2).add_route(ALL_OUTPUTS, "speaker", 0.5); // clock not verified
MACHINE_CONFIG_END
MACHINE_CONFIG_START(galaxian_state::explorer) // Sidam 10800
@@ -6428,16 +6422,16 @@ MACHINE_CONFIG_START(galaxian_state::explorer) // Sidam 10800
MCFG_DEVICE_PROGRAM_MAP(konami_sound_map)
MCFG_DEVICE_IO_MAP(konami_sound_portmap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* sound hardware is a pair of AY-3-8912 */
- MCFG_DEVICE_ADD("8910.0", AY8912, 12_MHz_XTAL / 2 / 2 / 2) /* matches PCB, needs verification */
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, galaxian_state, explorer_sound_latch_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8912(config, m_ay8910[0], 12_MHz_XTAL / 2 / 2 / 2); /* matches PCB, needs verification */
+ m_ay8910[0]->port_a_read_callback().set(FUNC(galaxian_state::explorer_sound_latch_r));
+ m_ay8910[0]->add_route(ALL_OUTPUTS, "speaker", 0.25);
- MCFG_DEVICE_ADD("8910.1", AY8912, 12_MHz_XTAL / 2 / 2 / 2) /* matches PCB, needs verification */
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, galaxian_state, konami_sound_timer_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8912(config, m_ay8910[1], 12_MHz_XTAL / 2 / 2 / 2); /* matches PCB, needs verification */
+ m_ay8910[0]->port_a_read_callback().set(FUNC(galaxian_state::konami_sound_timer_r));
+ m_ay8910[0]->add_route(ALL_OUTPUTS, "speaker", 0.25);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(galaxian_state::takeoff) // Sidam 10900, with 1 x AY-3-8912
@@ -6449,12 +6443,12 @@ MACHINE_CONFIG_START(galaxian_state::takeoff) // Sidam 10900, with 1 x AY-3-8912
MCFG_DEVICE_IO_MAP(takeoff_sound_portmap)
/* sound hardware */
- MCFG_DEVICE_REMOVE("8910.0")
- MCFG_DEVICE_REMOVE("8910.1")
+ config.device_remove("8910.0");
+ config.device_remove("8910.1");
- MCFG_DEVICE_ADD("8912", AY8912, XTAL(12'000'000) / 8)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, galaxian_state, explorer_sound_latch_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ ay8912_device &ay8912(AY8912(config, "8912", XTAL(12'000'000) / 8));
+ ay8912.port_a_read_callback().set(FUNC(galaxian_state::explorer_sound_latch_r));
+ ay8912.add_route(ALL_OUTPUTS, "speaker", 0.25);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(galaxian_state::amigo2) // marked "AMI", but similar to above
@@ -6468,15 +6462,15 @@ MACHINE_CONFIG_START(galaxian_state::amigo2) // marked "AMI", but similar to abo
MCFG_DEVICE_ADD("audiocpu", Z80, 12_MHz_XTAL / 2 / 2 / 2) /* clock not verified */
MCFG_DEVICE_PROGRAM_MAP(konami_sound_map)
MCFG_DEVICE_IO_MAP(konami_sound_portmap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
/* sound hardware */
- MCFG_DEVICE_ADD("8910.0", AY8910, 12_MHz_XTAL / 2 / 2 / 2) /* matches PCB, needs verification */
- MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, galaxian_state, konami_sound_timer_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DEVICE_ADD("8910.1", AY8910, 12_MHz_XTAL / 2 / 2 / 2) /* matches PCB, needs verification */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, m_ay8910[0], 12_MHz_XTAL / 2 / 2 / 2); /* matches PCB, needs verification */
+ m_ay8910[0]->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
+ m_ay8910[0]->port_b_read_callback().set(FUNC(galaxian_state::konami_sound_timer_r));
+ m_ay8910[0]->add_route(ALL_OUTPUTS, "speaker", 0.25);
+
+ AY8910(config, m_ay8910[1], 12_MHz_XTAL / 2 / 2 / 2).add_route(ALL_OUTPUTS, "speaker", 0.25); /* matches PCB, needs verification */
MACHINE_CONFIG_END
MACHINE_CONFIG_START(galaxian_state::scorpion)
@@ -6493,13 +6487,12 @@ MACHINE_CONFIG_START(galaxian_state::scorpion)
m_ppi8255[1]->out_pc_callback().set(FUNC(galaxian_state::scorpion_protection_w));
/* extra AY8910 with I/O ports */
- MCFG_DEVICE_ADD("8910.2", AY8910, KONAMI_SOUND_CLOCK/8)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("digitalker", digitalker_device, digitalker_data_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, galaxian_state, scorpion_digitalker_control_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, m_ay8910[2], KONAMI_SOUND_CLOCK/8);
+ m_ay8910[2]->port_a_write_callback().set(m_digitalker, FUNC(digitalker_device::digitalker_data_w));
+ m_ay8910[2]->port_b_write_callback().set(FUNC(galaxian_state::scorpion_digitalker_control_w));
+ m_ay8910[2]->add_route(ALL_OUTPUTS, "speaker", 0.25);
- MCFG_DIGITALKER_ADD("digitalker", 4_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.16)
+ DIGITALKER(config, m_digitalker, 4_MHz_XTAL).add_route(ALL_OUTPUTS, "speaker", 0.16);
MACHINE_CONFIG_END
@@ -6519,12 +6512,11 @@ MACHINE_CONFIG_START(galaxian_state::sfx)
I8255A(config, m_ppi8255[2]);
m_ppi8255[2]->in_pa_callback().set("soundlatch2", FUNC(generic_latch_8_device::read));
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch2");
/* port on 2nd 8910 is used for communication */
- MCFG_DEVICE_MODIFY("8910.1")
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("soundlatch2", generic_latch_8_device, write))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, galaxian_state, sfx_sample_control_w))
+ m_ay8910[1]->port_a_write_callback().set("soundlatch2", FUNC(generic_latch_8_device::write));
+ m_ay8910[1]->port_b_write_callback().set(FUNC(galaxian_state::sfx_sample_control_w));
/* DAC for the sample player */
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // 16-pin IC (not identified by schematics)
@@ -6617,8 +6609,7 @@ MACHINE_CONFIG_START(galaxian_state::quaak)
konami_base(config);
konami_sound_2x_ay8910(config);
- MCFG_DEVICE_MODIFY("8910.0")
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, galaxian_state, frogger_sound_timer_r))
+ m_ay8910[0]->port_b_read_callback().set(FUNC(galaxian_state::frogger_sound_timer_r));
/* alternate memory map */
MCFG_DEVICE_MODIFY("maincpu")
diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp
index 78834a5444e..a0b16efb5e1 100644
--- a/src/mame/drivers/galaxold.cpp
+++ b/src/mame/drivers/galaxold.cpp
@@ -2495,8 +2495,7 @@ MACHINE_CONFIG_START(galaxold_state::ozon1)
MCFG_PALETTE_INIT_OWNER(galaxold_state,rockclim)
MCFG_VIDEO_START_OVERRIDE(galaxold_state,ozon1)
- MCFG_DEVICE_ADD("aysnd", AY8910, PIXEL_CLOCK/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ AY8910(config, "aysnd", PIXEL_CLOCK/4).add_route(ALL_OUTPUTS, "speaker", 0.5);
MACHINE_CONFIG_END
@@ -2546,9 +2545,9 @@ MACHINE_CONFIG_START(galaxold_state::bongo)
MCFG_SCREEN_UPDATE_DRIVER(galaxold_state, screen_update_galaxold)
/* sound hardware */
- MCFG_DEVICE_ADD("aysnd", AY8910, PIXEL_CLOCK/4)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ ay8910_device &aysnd(AY8910(config, "aysnd", PIXEL_CLOCK/4));
+ aysnd.port_a_read_callback().set_ioport("DSW1");
+ aysnd.add_route(ALL_OUTPUTS, "speaker", 0.5);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gamate.cpp b/src/mame/drivers/gamate.cpp
index 0cf3423272d..25248474736 100644
--- a/src/mame/drivers/gamate.cpp
+++ b/src/mame/drivers/gamate.cpp
@@ -185,11 +185,11 @@ MACHINE_CONFIG_START(gamate_state::gamate)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left(); // Stereo headphone output
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("ay8910", AY8910, 4433000 / 4) // AY compatible, no actual AY chip present
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.5)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.5)
- MCFG_SOUND_ROUTE(2, "lspeaker", 0.25)
- MCFG_SOUND_ROUTE(2, "rspeaker", 0.25)
+ AY8910(config, m_ay, 4433000 / 4); // AY compatible, no actual AY chip present
+ m_ay->add_route(0, "lspeaker", 0.5);
+ m_ay->add_route(1, "rspeaker", 0.5);
+ m_ay->add_route(2, "lspeaker", 0.25);
+ m_ay->add_route(2, "rspeaker", 0.25);
MCFG_GAMATE_CARTRIDGE_ADD("cartslot", gamate_cart, nullptr)
diff --git a/src/mame/drivers/goldnpkr.cpp b/src/mame/drivers/goldnpkr.cpp
index 120e8cb8614..6c5eb4512f2 100644
--- a/src/mame/drivers/goldnpkr.cpp
+++ b/src/mame/drivers/goldnpkr.cpp
@@ -4416,8 +4416,7 @@ MACHINE_CONFIG_START(goldnpkr_state::wcfalcon)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay8910", AY8910, MASTER_CLOCK/4) /* guess, seems ok */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ AY8910(config, m_ay8910, MASTER_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 1.00); /* guess, seems ok */
MACHINE_CONFIG_END
@@ -4489,8 +4488,7 @@ MACHINE_CONFIG_START(goldnpkr_state::wildcrdb)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay8910", AY8910, MASTER_CLOCK/4) /* guess, seems ok */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ AY8910(config, m_ay8910, MASTER_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 1.00); /* guess, seems ok */
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gyruss.cpp b/src/mame/drivers/gyruss.cpp
index 3e367a95ad1..77f1e4070bd 100644
--- a/src/mame/drivers/gyruss.cpp
+++ b/src/mame/drivers/gyruss.cpp
@@ -517,46 +517,46 @@ MACHINE_CONFIG_START(gyruss_state::gyruss)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
-
- MCFG_DEVICE_ADD("ay1", AY8910, SOUND_CLOCK/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(RES_K(3.3), RES_K(3.3), RES_K(3.3))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, gyruss_state, gyruss_filter0_w))
- MCFG_SOUND_ROUTE(0, "discrete", 1.0, 0)
- MCFG_SOUND_ROUTE(1, "discrete", 1.0, 1)
- MCFG_SOUND_ROUTE(2, "discrete", 1.0, 2)
-
- MCFG_DEVICE_ADD("ay2", AY8910, SOUND_CLOCK/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(RES_K(3.3), RES_K(3.3), RES_K(3.3))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, gyruss_state, gyruss_filter1_w))
- MCFG_SOUND_ROUTE(0, "discrete", 1.0, 3)
- MCFG_SOUND_ROUTE(1, "discrete", 1.0, 4)
- MCFG_SOUND_ROUTE(2, "discrete", 1.0, 5)
-
- MCFG_DEVICE_ADD("ay3", AY8910, SOUND_CLOCK/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(RES_K(3.3), RES_K(3.3), RES_K(3.3))
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, gyruss_state, gyruss_portA_r))
- MCFG_SOUND_ROUTE(0, "discrete", 1.0, 6)
- MCFG_SOUND_ROUTE(1, "discrete", 1.0, 7)
- MCFG_SOUND_ROUTE(2, "discrete", 1.0, 8)
-
- MCFG_DEVICE_ADD("ay4", AY8910, SOUND_CLOCK/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(RES_K(3.3), RES_K(3.3), RES_K(3.3))
- MCFG_SOUND_ROUTE(0, "discrete", 1.0, 9)
- MCFG_SOUND_ROUTE(1, "discrete", 1.0, 10)
- MCFG_SOUND_ROUTE(2, "discrete", 1.0, 11)
-
- MCFG_DEVICE_ADD("ay5", AY8910, SOUND_CLOCK/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(RES_K(3.3), RES_K(3.3), RES_K(3.3))
- MCFG_SOUND_ROUTE(0, "discrete", 1.0, 12)
- MCFG_SOUND_ROUTE(1, "discrete", 1.0, 13)
- MCFG_SOUND_ROUTE(2, "discrete", 1.0, 14)
+ GENERIC_LATCH_8(config, "soundlatch");
+ GENERIC_LATCH_8(config, "soundlatch2");
+
+ ay8910_device &ay1(AY8910(config, "ay1", SOUND_CLOCK/8));
+ ay1.set_flags(AY8910_DISCRETE_OUTPUT);
+ ay1.set_resistors_load(RES_K(3.3), RES_K(3.3), RES_K(3.3));
+ ay1.port_b_write_callback().set(FUNC(gyruss_state::gyruss_filter0_w));
+ ay1.add_route(0, "discrete", 1.0, 0);
+ ay1.add_route(1, "discrete", 1.0, 1);
+ ay1.add_route(2, "discrete", 1.0, 2);
+
+ ay8910_device &ay2(AY8910(config, "ay2", SOUND_CLOCK/8));
+ ay2.set_flags(AY8910_DISCRETE_OUTPUT);
+ ay2.set_resistors_load(RES_K(3.3), RES_K(3.3), RES_K(3.3));
+ ay2.port_b_write_callback().set(FUNC(gyruss_state::gyruss_filter1_w));
+ ay2.add_route(0, "discrete", 1.0, 3);
+ ay2.add_route(1, "discrete", 1.0, 4);
+ ay2.add_route(2, "discrete", 1.0, 5);
+
+ ay8910_device &ay3(AY8910(config, "ay3", SOUND_CLOCK/8));
+ ay3.set_flags(AY8910_DISCRETE_OUTPUT);
+ ay3.set_resistors_load(RES_K(3.3), RES_K(3.3), RES_K(3.3));
+ ay3.port_a_read_callback().set(FUNC(gyruss_state::gyruss_portA_r));
+ ay3.add_route(0, "discrete", 1.0, 6);
+ ay3.add_route(1, "discrete", 1.0, 7);
+ ay3.add_route(2, "discrete", 1.0, 8);
+
+ ay8910_device &ay4(AY8910(config, "ay4", SOUND_CLOCK/8));
+ ay4.set_flags(AY8910_DISCRETE_OUTPUT);
+ ay4.set_resistors_load(RES_K(3.3), RES_K(3.3), RES_K(3.3));
+ ay4.add_route(0, "discrete", 1.0, 9);
+ ay4.add_route(1, "discrete", 1.0, 10);
+ ay4.add_route(2, "discrete", 1.0, 11);
+
+ ay8910_device &ay5(AY8910(config, "ay5", SOUND_CLOCK/8));
+ ay5.set_flags(AY8910_DISCRETE_OUTPUT);
+ ay5.set_resistors_load(RES_K(3.3), RES_K(3.3), RES_K(3.3));
+ ay5.add_route(0, "discrete", 1.0, 12);
+ ay5.add_route(1, "discrete", 1.0, 13);
+ ay5.add_route(2, "discrete", 1.0, 14);
MCFG_DEVICE_ADD("discrete", DISCRETE, gyruss_sound_discrete)
MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)
diff --git a/src/mame/drivers/hanaawas.cpp b/src/mame/drivers/hanaawas.cpp
index 9d6124346bf..1eb7a808fdb 100644
--- a/src/mame/drivers/hanaawas.cpp
+++ b/src/mame/drivers/hanaawas.cpp
@@ -241,10 +241,10 @@ MACHINE_CONFIG_START(hanaawas_state::hanaawas)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 18432000/12)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW"))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, hanaawas_state, hanaawas_portB_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ ay8910_device &aysnd(AY8910(config, "aysnd", 18432000/12));
+ aysnd.port_a_read_callback().set_ioport("DSW");
+ aysnd.port_b_write_callback().set(FUNC(hanaawas_state::hanaawas_portB_w));
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.50);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/hyhoo.cpp b/src/mame/drivers/hyhoo.cpp
index 9f28afd5516..acb753dd0d0 100644
--- a/src/mame/drivers/hyhoo.cpp
+++ b/src/mame/drivers/hyhoo.cpp
@@ -251,10 +251,10 @@ MACHINE_CONFIG_START(hyhoo_state::hyhoo)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
+ ay8910_device &aysnd(AY8910(config, "aysnd", 1250000));
+ aysnd.port_a_read_callback().set_ioport("DSWA");
+ aysnd.port_b_read_callback().set_ioport("DSWB");
+ aysnd.add_route(ALL_OUTPUTS, "speaker", 0.35);
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/imolagp.cpp b/src/mame/drivers/imolagp.cpp
index 00782c004ad..a76239b068f 100644
--- a/src/mame/drivers/imolagp.cpp
+++ b/src/mame/drivers/imolagp.cpp
@@ -547,8 +547,7 @@ MACHINE_CONFIG_START(imolagp_state::imolagp)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 2000000) // ?
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ AY8910(config, "aysnd", 2000000).add_route(ALL_OUTPUTS, "mono", 0.5); // ?
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/jangou.cpp b/src/mame/drivers/jangou.cpp
index 63aeb744462..7d6f47ac171 100644
--- a/src/mame/drivers/jangou.cpp
+++ b/src/mame/drivers/jangou.cpp
@@ -900,12 +900,12 @@ MACHINE_CONFIG_START(jangou_state::jangou)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("aysnd", AY8910, MASTER_CLOCK / 16)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, jangou_state, input_mux_r))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, jangou_state, input_system_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ ay8910_device &aysnd(AY8910(config, "aysnd", MASTER_CLOCK / 16));
+ aysnd.port_a_read_callback().set(FUNC(jangou_state::input_mux_r));
+ aysnd.port_b_read_callback().set(FUNC(jangou_state::input_system_r));
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.40);
MCFG_DEVICE_ADD("cvsd", HC55516, MASTER_CLOCK / 1024)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
diff --git a/src/mame/drivers/jollyjgr.cpp b/src/mame/drivers/jollyjgr.cpp
index fd45f919e17..7c025e3845d 100644
--- a/src/mame/drivers/jollyjgr.cpp
+++ b/src/mame/drivers/jollyjgr.cpp
@@ -704,8 +704,7 @@ MACHINE_CONFIG_START(jollyjgr_state::jollyjgr)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(3'579'545)/2) /* 1.7897725MHz verified */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
+ AY8910(config, "aysnd", XTAL(3'579'545)/2).add_route(ALL_OUTPUTS, "mono", 0.45); /* 1.7897725MHz verified */
MACHINE_CONFIG_END
MACHINE_CONFIG_START(jollyjgr_state::fspider)
diff --git a/src/mame/drivers/jpms80.cpp b/src/mame/drivers/jpms80.cpp
index 84fb746a6c2..718f91c464e 100644
--- a/src/mame/drivers/jpms80.cpp
+++ b/src/mame/drivers/jpms80.cpp
@@ -127,7 +127,8 @@ void jpms80_state::machine_reset()
{
}
-MACHINE_CONFIG_START(jpms80_state::jpms80)
+void jpms80_state::jpms80(machine_config &config)
+{
// CPU TMS9980A, standard variant; no line connections
TMS9980A(config, m_maincpu, 10_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &jpms80_state::jpms80_map);
@@ -155,9 +156,8 @@ MACHINE_CONFIG_START(jpms80_state::jpms80)
TMS9902(config, m_acc, 10_MHz_XTAL / 4);
m_acc->int_cb().set_inputline(m_maincpu, INT_9980A_LEVEL3);
- MCFG_DEVICE_ADD("aysnd", AY8912, 10_MHz_XTAL / 8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ AY8912(config, "aysnd", 10_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 1.0);
+}
void jpms80_state::init_jpms80()
{
diff --git a/src/mame/drivers/junofrst.cpp b/src/mame/drivers/junofrst.cpp
index 66e2bcabe65..5175bd96ba5 100644
--- a/src/mame/drivers/junofrst.cpp
+++ b/src/mame/drivers/junofrst.cpp
@@ -443,15 +443,15 @@ MACHINE_CONFIG_START(junofrst_state::junofrst)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
-
- MCFG_DEVICE_ADD("aysnd", AY8910, 14318000/8)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, junofrst_state, portA_r))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, junofrst_state, portB_w))
- MCFG_SOUND_ROUTE(0, "filter.0.0", 0.30)
- MCFG_SOUND_ROUTE(1, "filter.0.1", 0.30)
- MCFG_SOUND_ROUTE(2, "filter.0.2", 0.30)
+ GENERIC_LATCH_8(config, "soundlatch");
+ GENERIC_LATCH_8(config, "soundlatch2");
+
+ ay8910_device &aysnd(AY8910(config, "aysnd", 14318000/8));
+ aysnd.port_a_read_callback().set(FUNC(junofrst_state::portA_r));
+ aysnd.port_b_write_callback().set(FUNC(junofrst_state::portB_w));
+ aysnd.add_route(0, "filter.0.0", 0.30);
+ aysnd.add_route(1, "filter.0.1", 0.30);
+ aysnd.add_route(2, "filter.0.2", 0.30);
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // 100K (R56-63)/200K (R64-71) ladder network
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
diff --git a/src/mame/drivers/jupace.cpp b/src/mame/drivers/jupace.cpp
index dcf80912314..9fd23d91b72 100644
--- a/src/mame/drivers/jupace.cpp
+++ b/src/mame/drivers/jupace.cpp
@@ -779,8 +779,7 @@ MACHINE_CONFIG_START(ace_state::ace)
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25);
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 1.00);
- MCFG_DEVICE_ADD(AY8910_TAG, AY8910, XTAL(6'500'000) / 2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, AY8910_TAG, XTAL(6'500'000) / 2).add_route(ALL_OUTPUTS, "mono", 0.25);
SP0256(config, m_sp0256, XTAL(3'000'000));
m_sp0256->add_route(ALL_OUTPUTS, "mono", 0.25);
diff --git a/src/mame/drivers/kncljoe.cpp b/src/mame/drivers/kncljoe.cpp
index 4096293d74a..f03e8eaeee3 100644
--- a/src/mame/drivers/kncljoe.cpp
+++ b/src/mame/drivers/kncljoe.cpp
@@ -282,12 +282,12 @@ MACHINE_CONFIG_START(kncljoe_state::kncljoe)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(3'579'545)/4) /* verified on pcb */
- MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, kncljoe_state, unused_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ AY8910(config, m_ay8910, XTAL(3'579'545)/4); /* verified on pcb */
+ m_ay8910->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
+ m_ay8910->port_b_write_callback().set(FUNC(kncljoe_state::unused_w));
+ m_ay8910->add_route(ALL_OUTPUTS, "mono", 0.30);
MCFG_DEVICE_ADD("sn1", SN76489, XTAL(3'579'545)) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
diff --git a/src/mame/drivers/labyrunr.cpp b/src/mame/drivers/labyrunr.cpp
index 350aba889fe..197f7b4218f 100644
--- a/src/mame/drivers/labyrunr.cpp
+++ b/src/mame/drivers/labyrunr.cpp
@@ -196,20 +196,20 @@ MACHINE_CONFIG_START(labyrunr_state::labyrunr)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ym1", YM2203, 3000000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2"))
- MCFG_SOUND_ROUTE(0, "mono", 0.40)
- MCFG_SOUND_ROUTE(1, "mono", 0.40)
- MCFG_SOUND_ROUTE(2, "mono", 0.40)
- MCFG_SOUND_ROUTE(3, "mono", 0.80)
-
- MCFG_DEVICE_ADD("ym2", YM2203, 3000000)
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3"))
- MCFG_SOUND_ROUTE(0, "mono", 0.40)
- MCFG_SOUND_ROUTE(1, "mono", 0.40)
- MCFG_SOUND_ROUTE(2, "mono", 0.40)
- MCFG_SOUND_ROUTE(3, "mono", 0.80)
+ ym2203_device &ym1(YM2203(config, "ym1", 3000000));
+ ym1.port_a_read_callback().set_ioport("DSW1");
+ ym1.port_b_read_callback().set_ioport("DSW2");
+ ym1.add_route(0, "mono", 0.40);
+ ym1.add_route(1, "mono", 0.40);
+ ym1.add_route(2, "mono", 0.40);
+ ym1.add_route(3, "mono", 0.80);
+
+ ym2203_device &ym2(YM2203(config, "ym2", 3000000));
+ ym2.port_b_read_callback().set_ioport("DSW3");
+ ym2.add_route(0, "mono", 0.40);
+ ym2.add_route(1, "mono", 0.40);
+ ym2.add_route(2, "mono", 0.40);
+ ym2.add_route(3, "mono", 0.80);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/lasso.cpp b/src/mame/drivers/lasso.cpp
index cd973f5adc6..3a1d4d2f75c 100644
--- a/src/mame/drivers/lasso.cpp
+++ b/src/mame/drivers/lasso.cpp
@@ -609,11 +609,9 @@ MACHINE_CONFIG_START(lasso_state::pinbo)
MCFG_DEVICE_REMOVE("sn76489.1")
MCFG_DEVICE_REMOVE("sn76489.2")
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(18'000'000)/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.55)
+ AY8910(config, "ay1", XTAL(18'000'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.55);
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(18'000'000)/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.55)
+ AY8910(config, "ay2", XTAL(18'000'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.55);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/liberate.cpp b/src/mame/drivers/liberate.cpp
index cc5f5fb8a9b..834a0b67cd5 100644
--- a/src/mame/drivers/liberate.cpp
+++ b/src/mame/drivers/liberate.cpp
@@ -776,13 +776,11 @@ MACHINE_CONFIG_START(liberate_state::liberate_base)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8912, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ AY8912(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.30);
- MCFG_DEVICE_ADD("ay2", AY8912, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ AY8912(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.50);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(liberate_state::liberate)
@@ -866,13 +864,11 @@ MACHINE_CONFIG_START(liberate_state::prosport)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8912, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ AY8912(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.30);
- MCFG_DEVICE_ADD("ay2", AY8912, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ AY8912(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.50);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ltd.cpp b/src/mame/drivers/ltd.cpp
index 3e4f83fbdcf..7e7ef9404e9 100644
--- a/src/mame/drivers/ltd.cpp
+++ b/src/mame/drivers/ltd.cpp
@@ -557,10 +557,8 @@ MACHINE_CONFIG_START(ltd_state::ltd4)
genpin_audio(config);
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd_0", AY8910, XTAL(3'579'545)/2) /* guess */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.3)
- MCFG_DEVICE_ADD("aysnd_1", AY8910, XTAL(3'579'545)/2) /* guess */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.3)
+ AY8910(config, "aysnd_0", XTAL(3'579'545)/2).add_route(ALL_OUTPUTS, "mono", 0.3); /* guess */
+ AY8910(config, "aysnd_1", XTAL(3'579'545)/2).add_route(ALL_OUTPUTS, "mono", 0.3); /* guess */
MACHINE_CONFIG_END
/*-------------------------------------------------------------------
diff --git a/src/mame/drivers/magmax.cpp b/src/mame/drivers/magmax.cpp
index 726d2219e8b..f49e5b62df5 100644
--- a/src/mame/drivers/magmax.cpp
+++ b/src/mame/drivers/magmax.cpp
@@ -355,16 +355,14 @@ MACHINE_CONFIG_START(magmax_state::magmax)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD(m_ay[0], AY8910, XTAL(20'000'000)/16) /* verified on pcb */
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, magmax_state, ay8910_portA_0_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, magmax_state, ay8910_portB_0_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ AY8910(config, m_ay[0], XTAL(20'000'000)/16); /* verified on pcb */
+ m_ay[0]->port_a_write_callback().set(FUNC(magmax_state::ay8910_portA_0_w));
+ m_ay[0]->port_b_write_callback().set(FUNC(magmax_state::ay8910_portB_0_w));
+ m_ay[0]->add_route(ALL_OUTPUTS, "mono", 0.40);
- MCFG_DEVICE_ADD(m_ay[1], AY8910, XTAL(20'000'000)/16) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ AY8910(config, m_ay[1], XTAL(20'000'000)/16).add_route(ALL_OUTPUTS, "mono", 0.40); /* verified on pcb */
- MCFG_DEVICE_ADD(m_ay[2], AY8910, XTAL(20'000'000)/16) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ AY8910(config, m_ay[2], XTAL(20'000'000)/16).add_route(ALL_OUTPUTS, "mono", 0.40); /* verified on pcb */
GENERIC_LATCH_8(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
diff --git a/src/mame/drivers/mainsnk.cpp b/src/mame/drivers/mainsnk.cpp
index d0cdd066687..b24c874af41 100644
--- a/src/mame/drivers/mainsnk.cpp
+++ b/src/mame/drivers/mainsnk.cpp
@@ -401,15 +401,13 @@ MACHINE_CONFIG_START(mainsnk_state::mainsnk)
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("ay1", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ AY8910(config, "ay1", 2000000).add_route(ALL_OUTPUTS, "mono", 0.35);
- MCFG_DEVICE_ADD("ay2", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ AY8910(config, "ay2", 2000000).add_route(ALL_OUTPUTS, "mono", 0.35);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/marinedt.cpp b/src/mame/drivers/marinedt.cpp
index 7f685c8cd03..9549c0dd151 100644
--- a/src/mame/drivers/marinedt.cpp
+++ b/src/mame/drivers/marinedt.cpp
@@ -649,8 +649,6 @@ MACHINE_CONFIG_START(marinedt_state::marinedt)
/* sound hardware */
SPEAKER(config, "mono").front_center();
-// MCFG_DEVICE_ADD("aysnd", AY8910, MAIN_CLOCK/4)
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/maygay1b.cpp b/src/mame/drivers/maygay1b.cpp
index 035d342a33b..79afee44c9a 100644
--- a/src/mame/drivers/maygay1b.cpp
+++ b/src/mame/drivers/maygay1b.cpp
@@ -795,11 +795,11 @@ MACHINE_CONFIG_START(maygay1b_state::maygay_m1)
S16LF01(config, m_vfd);
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("aysnd", YM2149, M1_MASTER_CLOCK)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, maygay1b_state, m1_meter_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, maygay1b_state, m1_lockout_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ YM2149(config, m_ay, M1_MASTER_CLOCK);
+ m_ay->port_a_write_callback().set(FUNC(maygay1b_state::m1_meter_w));
+ m_ay->port_b_write_callback().set(FUNC(maygay1b_state::m1_lockout_w));
+ m_ay->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ m_ay->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
MCFG_DEVICE_ADD("ymsnd", YM2413, M1_MASTER_CLOCK/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
diff --git a/src/mame/drivers/megazone.cpp b/src/mame/drivers/megazone.cpp
index 5536e6be4a0..9a36ef1fe47 100644
--- a/src/mame/drivers/megazone.cpp
+++ b/src/mame/drivers/megazone.cpp
@@ -338,14 +338,14 @@ MACHINE_CONFIG_START(megazone_state::megazone)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
-
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(14'318'181)/8)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, megazone_state, megazone_port_a_r))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, megazone_state, megazone_port_b_w))
- MCFG_SOUND_ROUTE(0, "filter.0.0", 0.30)
- MCFG_SOUND_ROUTE(1, "filter.0.1", 0.30)
- MCFG_SOUND_ROUTE(2, "filter.0.2", 0.30)
+ GENERIC_LATCH_8(config, "soundlatch");
+
+ ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(14'318'181)/8));
+ aysnd.port_a_read_callback().set(FUNC(megazone_state::megazone_port_a_r));
+ aysnd.port_b_write_callback().set(FUNC(megazone_state::megazone_port_b_w));
+ aysnd.add_route(0, "filter.0.0", 0.30);
+ aysnd.add_route(1, "filter.0.1", 0.30);
+ aysnd.add_route(2, "filter.0.2", 0.30);
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/merit.cpp b/src/mame/drivers/merit.cpp
index 0cd46ca556d..0ccb27e933b 100644
--- a/src/mame/drivers/merit.cpp
+++ b/src/mame/drivers/merit.cpp
@@ -1440,9 +1440,9 @@ MACHINE_CONFIG_START(merit_state::pitboss)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8912, CRTC_CLOCK)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, merit_state, led2_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
+ ay8912_device &aysnd(AY8912(config, "aysnd", CRTC_CLOCK));
+ aysnd.port_a_write_callback().set(FUNC(merit_state::led2_w));
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.33);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(merit_state::casino5)
diff --git a/src/mame/drivers/mermaid.cpp b/src/mame/drivers/mermaid.cpp
index 2f0b660c138..f880ea86a19 100644
--- a/src/mame/drivers/mermaid.cpp
+++ b/src/mame/drivers/mermaid.cpp
@@ -457,11 +457,9 @@ MACHINE_CONFIG_START(mermaid_state::mermaid)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, m_ay8910[0], 1500000).add_route(ALL_OUTPUTS, "mono", 0.25);
- MCFG_DEVICE_ADD("ay2", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, m_ay8910[1], 1500000).add_route(ALL_OUTPUTS, "mono", 0.25);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/microtan.cpp b/src/mame/drivers/microtan.cpp
index 57231a6fd30..028187ced5e 100644
--- a/src/mame/drivers/microtan.cpp
+++ b/src/mame/drivers/microtan.cpp
@@ -232,10 +232,8 @@ MACHINE_CONFIG_START(microtan_state::microtan)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "speaker", 0.25);
- MCFG_DEVICE_ADD(m_ay8910[0], AY8910, 1000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DEVICE_ADD(m_ay8910[1], AY8910, 1000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ AY8910(config, m_ay8910[0], 1000000).add_route(ALL_OUTPUTS, "speaker", 0.5);
+ AY8910(config, m_ay8910[1], 1000000).add_route(ALL_OUTPUTS, "speaker", 0.5);
/* snapshot/quickload */
MCFG_SNAPSHOT_ADD("snapshot", microtan_state, microtan, "m65", 0.5)
diff --git a/src/mame/drivers/mirax.cpp b/src/mame/drivers/mirax.cpp
index c12bf206d73..daf03bf9933 100644
--- a/src/mame/drivers/mirax.cpp
+++ b/src/mame/drivers/mirax.cpp
@@ -515,13 +515,11 @@ MACHINE_CONFIG_START(mirax_state::mirax)
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8912, 12000000/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ AY8912(config, m_ay[0], 12000000/4).add_route(ALL_OUTPUTS, "mono", 0.80);
- MCFG_DEVICE_ADD("ay2", AY8912, 12000000/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ AY8912(config, m_ay[1], 12000000/4).add_route(ALL_OUTPUTS, "mono", 0.80);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mouser.cpp b/src/mame/drivers/mouser.cpp
index af4ea923efb..a4fa0b228c2 100644
--- a/src/mame/drivers/mouser.cpp
+++ b/src/mame/drivers/mouser.cpp
@@ -227,11 +227,9 @@ MACHINE_CONFIG_START(mouser_state::mouser)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, 4000000/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ AY8910(config, "ay1", 4000000/2).add_route(ALL_OUTPUTS, "mono", 0.50);
- MCFG_DEVICE_ADD("ay2", AY8910, 4000000/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ AY8910(config, "ay2", 4000000/2).add_route(ALL_OUTPUTS, "mono", 0.50);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mrflea.cpp b/src/mame/drivers/mrflea.cpp
index dbc3ba46330..7e0de9fc710 100644
--- a/src/mame/drivers/mrflea.cpp
+++ b/src/mame/drivers/mrflea.cpp
@@ -301,23 +301,22 @@ MACHINE_CONFIG_START(mrflea_state::mrflea)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, 2000000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("IN1"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN0"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-
- MCFG_DEVICE_ADD("ay2", AY8910, 2000000) // not used for sound?
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-
- MCFG_DEVICE_ADD("ay3", AY8910, 2000000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-
- MCFG_DEVICE_ADD("ay4", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("UNKNOWN"))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, mrflea_state, mrflea_data1_w))
+ ay8910_device &ay1(AY8910(config, "ay1", 2000000));
+ ay1.port_a_read_callback().set_ioport("IN1");
+ ay1.port_b_read_callback().set_ioport("IN0");
+ ay1.add_route(ALL_OUTPUTS, "mono", 0.25);
+
+ AY8910(config, "ay2", 2000000).add_route(ALL_OUTPUTS, "mono", 0.25); // not used for sound?
+
+ ay8910_device &ay3(AY8910(config, "ay3", 2000000));
+ ay3.port_a_read_callback().set_ioport("DSW2");
+ ay3.port_b_read_callback().set_ioport("DSW1");
+ ay3.add_route(ALL_OUTPUTS, "mono", 0.25);
+
+ ay8910_device &ay4(AY8910(config, "ay4", 2000000));
+ ay4.port_a_read_callback().set_ioport("UNKNOWN");
+ ay4.port_b_write_callback().set(FUNC(mrflea_state::mrflea_data1_w));
+ ay4.add_route(ALL_OUTPUTS, "mono", 0.25);
MACHINE_CONFIG_END
/*************************************
diff --git a/src/mame/drivers/nbmj8688.cpp b/src/mame/drivers/nbmj8688.cpp
index 50080e53e2b..5a2f465b868 100644
--- a/src/mame/drivers/nbmj8688.cpp
+++ b/src/mame/drivers/nbmj8688.cpp
@@ -2479,10 +2479,10 @@ MACHINE_CONFIG_START(nbmj8688_state::NBMJDRV_4096)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("psg", AY8910, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, nbmj8688_state, dipsw1_r)) // DIPSW-A read
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, nbmj8688_state, dipsw2_r)) // DIPSW-B read
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
+ ay8910_device &psg(AY8910(config, "psg", 1250000));
+ psg.port_a_read_callback().set(FUNC(nbmj8688_state::dipsw1_r)); // DIPSW-A read
+ psg.port_b_read_callback().set(FUNC(nbmj8688_state::dipsw2_r)); // DIPSW-B read
+ psg.add_route(ALL_OUTPUTS, "speaker", 0.35);
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
@@ -2676,10 +2676,10 @@ MACHINE_CONFIG_START(nbmj8688_state::mbmj_p16bit_LCD)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("psg", AY8910, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, nbmj8688_state, dipsw1_r)) // DIPSW-A read
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, nbmj8688_state, dipsw2_r)) // DIPSW-B read
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
+ ay8910_device &psg(AY8910(config, "psg", 1250000));
+ psg.port_a_read_callback().set(FUNC(nbmj8688_state::dipsw1_r)); // DIPSW-A read
+ psg.port_b_read_callback().set(FUNC(nbmj8688_state::dipsw2_r)); // DIPSW-B read
+ psg.add_route(ALL_OUTPUTS, "speaker", 0.35);
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
diff --git a/src/mame/drivers/nbmj8891.cpp b/src/mame/drivers/nbmj8891.cpp
index b56da85789b..bed6adeb6bb 100644
--- a/src/mame/drivers/nbmj8891.cpp
+++ b/src/mame/drivers/nbmj8891.cpp
@@ -2215,8 +2215,7 @@ MACHINE_CONFIG_START(nbmj8891_state::gionbana)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("fmsnd", YM3812, 2500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ YM3812(config, "fmsnd", 2500000).add_route(ALL_OUTPUTS, "speaker", 0.5);
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.37) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
@@ -2251,10 +2250,10 @@ MACHINE_CONFIG_START(nbmj8891_state::omotesnd)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* sound hardware */
- MCFG_DEVICE_REPLACE("fmsnd", AY8910, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
+ ay8910_device &fmsnd(AY8910(config.replace(), "fmsnd", 1250000));
+ fmsnd.port_a_read_callback().set_ioport("DSWA");
+ fmsnd.port_b_read_callback().set_ioport("DSWB");
+ fmsnd.add_route(ALL_OUTPUTS, "speaker", 0.35);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(nbmj8891_state::abunai)
@@ -2525,10 +2524,10 @@ MACHINE_CONFIG_START(nbmj8891_state::mjfocusm)
MCFG_VIDEO_START_OVERRIDE(nbmj8891_state,_1layer)
/* sound hardware */
- MCFG_DEVICE_REPLACE("fmsnd", AY8910, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
+ ay8910_device &fmsnd(AY8910(config.replace(), "fmsnd", 1250000));
+ fmsnd.port_a_read_callback().set_ioport("DSWA");
+ fmsnd.port_b_read_callback().set_ioport("DSWB");
+ fmsnd.add_route(ALL_OUTPUTS, "speaker", 0.7);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(nbmj8891_state::scandalm)
@@ -2558,10 +2557,10 @@ MACHINE_CONFIG_START(nbmj8891_state::taiwanmb)
MCFG_VIDEO_START_OVERRIDE(nbmj8891_state,_1layer)
/* sound hardware */
- MCFG_DEVICE_REPLACE("fmsnd", AY8910, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
+ ay8910_device &fmsnd(AY8910(config.replace(), "fmsnd", 1250000));
+ fmsnd.port_a_read_callback().set_ioport("DSWA");
+ fmsnd.port_b_read_callback().set_ioport("DSWB");
+ fmsnd.add_route(ALL_OUTPUTS, "speaker", 0.7);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/nbmj8991.cpp b/src/mame/drivers/nbmj8991.cpp
index 01c90a0e4ef..29dda727a64 100644
--- a/src/mame/drivers/nbmj8991.cpp
+++ b/src/mame/drivers/nbmj8991.cpp
@@ -1350,8 +1350,7 @@ MACHINE_CONFIG_START(nbmj8991_state::nbmjdrv1) // galkoku
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("fmsnd", YM3812, 25000000/10)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
+ YM3812(config, "fmsnd", 25000000/10).add_route(ALL_OUTPUTS, "speaker", 0.7);
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)
@@ -1401,17 +1400,16 @@ MACHINE_CONFIG_START(nbmj8991_state::nbmjdrv2) // pstadium
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(nbmj8991_state::nbmjdrv3)
+void nbmj8991_state::nbmjdrv3(machine_config &config)
+{
nbmjdrv1(config);
- /* basic machine hardware */
-
/* sound hardware */
- MCFG_DEVICE_REPLACE("fmsnd", AY8910, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
-MACHINE_CONFIG_END
+ ay8910_device &fmsnd(AY8910(config.replace(), "fmsnd", 1250000));
+ fmsnd.port_a_read_callback().set_ioport("DSWA");
+ fmsnd.port_b_read_callback().set_ioport("DSWB");
+ fmsnd.add_route(ALL_OUTPUTS, "speaker", 0.35);
+}
// ---------------------------------------------------------------------
diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp
index cde3018c4ea..a271ecd1c70 100644
--- a/src/mame/drivers/nemesis.cpp
+++ b/src/mame/drivers/nemesis.cpp
@@ -1497,19 +1497,19 @@ MACHINE_CONFIG_START(nemesis_state::nemesis)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("ay1", AY8910, 14318180/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, nemesis_state, nemesis_portA_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter1", 0.20)
+ ay8910_device &ay1(AY8910(config, "ay1", 14318180/8));
+ ay1.set_flags(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT);
+ ay1.port_a_read_callback().set(FUNC(nemesis_state::nemesis_portA_r));
+ ay1.add_route(ALL_OUTPUTS, "filter1", 0.20);
- MCFG_DEVICE_ADD("ay2", AY8910, 14318180/8)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_A_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_B_w))
- MCFG_SOUND_ROUTE(0, "filter2", 1.00)
- MCFG_SOUND_ROUTE(1, "filter3", 1.00)
- MCFG_SOUND_ROUTE(2, "filter4", 1.00)
+ ay8910_device &ay2(AY8910(config, "ay2", 14318180/8));
+ ay2.port_a_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_A_w));
+ ay2.port_b_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_B_w));
+ ay2.add_route(0, "filter2", 1.00);
+ ay2.add_route(1, "filter3", 1.00);
+ ay2.add_route(2, "filter4", 1.00);
MCFG_DEVICE_ADD("filter1", FILTER_RC)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -1566,19 +1566,19 @@ MACHINE_CONFIG_START(nemesis_state::gx400)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("ay1", AY8910, 14318180/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, nemesis_state, nemesis_portA_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter1", 0.20)
+ ay8910_device &ay1(AY8910(config, "ay1", 14318180/8));
+ ay1.set_flags(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT);
+ ay1.port_a_read_callback().set(FUNC(nemesis_state::nemesis_portA_r));
+ ay1.add_route(ALL_OUTPUTS, "filter1", 0.20);
- MCFG_DEVICE_ADD("ay2", AY8910, 14318180/8)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_A_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_B_w))
- MCFG_SOUND_ROUTE(0, "filter2", 1.00)
- MCFG_SOUND_ROUTE(1, "filter3", 1.00)
- MCFG_SOUND_ROUTE(2, "filter4", 1.00)
+ ay8910_device &ay2(AY8910(config, "ay2", 14318180/8));
+ ay2.port_a_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_A_w));
+ ay2.port_b_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_B_w));
+ ay2.add_route(0, "filter2", 1.00);
+ ay2.add_route(1, "filter3", 1.00);
+ ay2.add_route(2, "filter4", 1.00);
MCFG_DEVICE_ADD("filter1", FILTER_RC)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -1637,19 +1637,19 @@ MACHINE_CONFIG_START(nemesis_state::konamigt)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("ay1", AY8910, 14318180/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, nemesis_state, nemesis_portA_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter1", 0.20)
+ ay8910_device &ay1(AY8910(config, "ay1", 14318180/8));
+ ay1.set_flags(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT);
+ ay1.port_a_read_callback().set(FUNC(nemesis_state::nemesis_portA_r));
+ ay1.add_route(ALL_OUTPUTS, "filter1", 0.20);
- MCFG_DEVICE_ADD("ay2", AY8910, 14318180/8)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_A_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_B_w))
- MCFG_SOUND_ROUTE(0, "filter2", 1.00)
- MCFG_SOUND_ROUTE(1, "filter3", 1.00)
- MCFG_SOUND_ROUTE(2, "filter4", 1.00)
+ ay8910_device &ay2(AY8910(config, "ay2", 14318180/8));
+ ay2.port_a_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_A_w));
+ ay2.port_b_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_B_w));
+ ay2.add_route(0, "filter2", 1.00);
+ ay2.add_route(1, "filter3", 1.00);
+ ay2.add_route(2, "filter4", 1.00);
MCFG_DEVICE_ADD("filter1", FILTER_RC)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -1706,19 +1706,19 @@ MACHINE_CONFIG_START(nemesis_state::rf2_gx400)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("ay1", AY8910, 14318180/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, nemesis_state, nemesis_portA_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter1", 0.20)
+ ay8910_device &ay1(AY8910(config, "ay1", 14318180/8));
+ ay1.set_flags(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT);
+ ay1.port_a_read_callback().set(FUNC(nemesis_state::nemesis_portA_r));
+ ay1.add_route(ALL_OUTPUTS, "filter1", 0.20);
- MCFG_DEVICE_ADD("ay2", AY8910, 14318180/8)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_A_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_B_w))
- MCFG_SOUND_ROUTE(0, "filter2", 1.00)
- MCFG_SOUND_ROUTE(1, "filter3", 1.00)
- MCFG_SOUND_ROUTE(2, "filter4", 1.00)
+ ay8910_device &ay2(AY8910(config, "ay2", 14318180/8));
+ ay2.port_a_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_A_w));
+ ay2.port_b_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_B_w));
+ ay2.add_route(0, "filter2", 1.00);
+ ay2.add_route(1, "filter3", 1.00);
+ ay2.add_route(2, "filter4", 1.00);
MCFG_DEVICE_ADD("filter1", FILTER_RC)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@@ -1769,7 +1769,7 @@ MACHINE_CONFIG_START(nemesis_state::salamand)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("vlm", VLM5030, 3579545)
MCFG_DEVICE_ADDRESS_MAP(0, salamand_vlm_map)
@@ -1821,7 +1821,7 @@ MACHINE_CONFIG_START(nemesis_state::blkpnthr)
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", K007232, 3579545)
MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, nemesis_state, volume_callback))
@@ -1868,7 +1868,7 @@ MACHINE_CONFIG_START(nemesis_state::citybomb)
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", K007232, 3579545)
MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, nemesis_state, volume_callback))
@@ -1919,7 +1919,7 @@ MACHINE_CONFIG_START(nemesis_state::nyanpani)
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", K007232, 3579545)
MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, nemesis_state, volume_callback))
@@ -1974,7 +1974,7 @@ MACHINE_CONFIG_START(nemesis_state::hcrash)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
MCFG_DEVICE_ADD("vlm", VLM5030, 3579545)
MCFG_DEVICE_ADDRESS_MAP(0, salamand_vlm_map)
@@ -2735,19 +2735,19 @@ MACHINE_CONFIG_START(nemesis_state::bubsys)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("ay1", AY8910, 14318180/8)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, nemesis_state, nemesis_portA_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter1", 0.20)
+ ay8910_device &ay1(AY8910(config, "ay1", 14318180/8));
+ ay1.set_flags(AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT);
+ ay1.port_a_read_callback().set(FUNC(nemesis_state::nemesis_portA_r));
+ ay1.add_route(ALL_OUTPUTS, "filter1", 0.20);
- MCFG_DEVICE_ADD("ay2", AY8910, 14318180/8)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_A_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("k005289", k005289_device, k005289_control_B_w))
- MCFG_SOUND_ROUTE(0, "filter2", 1.00)
- MCFG_SOUND_ROUTE(1, "filter3", 1.00)
- MCFG_SOUND_ROUTE(2, "filter4", 1.00)
+ ay8910_device &ay2(AY8910(config, "ay2", 14318180/8));
+ ay2.port_a_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_A_w));
+ ay2.port_b_write_callback().set(m_k005289, FUNC(k005289_device::k005289_control_B_w));
+ ay2.add_route(0, "filter2", 1.00);
+ ay2.add_route(1, "filter3", 1.00);
+ ay2.add_route(2, "filter4", 1.00);
MCFG_DEVICE_ADD("filter1", FILTER_RC)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
diff --git a/src/mame/drivers/nibble.cpp b/src/mame/drivers/nibble.cpp
index dcd06dfaaa8..4b6c764c9e3 100644
--- a/src/mame/drivers/nibble.cpp
+++ b/src/mame/drivers/nibble.cpp
@@ -360,8 +360,7 @@ MACHINE_CONFIG_START(nibble_state::nibble)
MCFG_MC6845_CHAR_WIDTH(8)
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, MASTER_CLOCK/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ AY8910(config, "aysnd", MASTER_CLOCK/8).add_route(ALL_OUTPUTS, "mono", 0.50);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/nichild.cpp b/src/mame/drivers/nichild.cpp
index 9728da99c64..a2873212d43 100644
--- a/src/mame/drivers/nichild.cpp
+++ b/src/mame/drivers/nichild.cpp
@@ -255,8 +255,7 @@ MACHINE_CONFIG_START(nichild_state::nichild)
/* sound hardware */
SPEAKER(config, "mono").front_center();
-// MCFG_DEVICE_ADD("aysnd", AY8910, MAIN_CLOCK/4)
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+// YM3812(config, "fmsnd", SOUND_CLOCK).add_route(ALL_OUTPUTS, "speaker", 0.7);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/nightgal.cpp b/src/mame/drivers/nightgal.cpp
index cb997043c9a..a3e743ca27d 100644
--- a/src/mame/drivers/nightgal.cpp
+++ b/src/mame/drivers/nightgal.cpp
@@ -816,10 +816,10 @@ MACHINE_CONFIG_START(nightgal_state::royalqn)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, MASTER_CLOCK / 8)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, nightgal_state, input_1p_r))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, nightgal_state, input_2p_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ ay8910_device &aysnd(AY8910(config, "aysnd", MASTER_CLOCK / 8));
+ aysnd.port_a_read_callback().set(FUNC(nightgal_state::input_1p_r));
+ aysnd.port_b_read_callback().set(FUNC(nightgal_state::input_2p_r));
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.40);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(nightgal_state::sexygal)
@@ -846,10 +846,10 @@ MACHINE_CONFIG_START(nightgal_state::sexygal)
MCFG_DEVICE_REMOVE("aysnd")
- MCFG_DEVICE_ADD("ymsnd", YM2203, MASTER_CLOCK / 8)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, nightgal_state, input_1p_r))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, nightgal_state, input_2p_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ ym2203_device &ymsnd(YM2203(config, "ymsnd", MASTER_CLOCK / 8));
+ ymsnd.port_a_read_callback().set(FUNC(nightgal_state::input_1p_r));
+ ymsnd.port_b_read_callback().set(FUNC(nightgal_state::input_2p_r));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.40);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(nightgal_state::sweetgal)
diff --git a/src/mame/drivers/nsm.cpp b/src/mame/drivers/nsm.cpp
index 6aa80f72652..d8f10617a91 100644
--- a/src/mame/drivers/nsm.cpp
+++ b/src/mame/drivers/nsm.cpp
@@ -126,7 +126,8 @@ void nsm_state::machine_reset()
m_maincpu->reset_line(ASSERT_LINE);
}
-MACHINE_CONFIG_START(nsm_state::nsm)
+void nsm_state::nsm(machine_config &config)
+{
// CPU TMS9995, standard variant; no line connection
TMS9995(config, m_maincpu, 11052000);
m_maincpu->set_addrmap(AS_PROGRAM, &nsm_state::nsm_map);
@@ -138,11 +139,9 @@ MACHINE_CONFIG_START(nsm_state::nsm)
/* Sound */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("ay1", AY8912, 11052000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.75)
- MCFG_DEVICE_ADD("ay2", AY8912, 11052000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.75)
-MACHINE_CONFIG_END
+ AY8912(config, "ay1", 11052000/8).add_route(ALL_OUTPUTS, "lspeaker", 0.75);
+ AY8912(config, "ay2", 11052000/8).add_route(ALL_OUTPUTS, "rspeaker", 0.75);
+}
/*-------------------------------------------------------------------
/ Cosmic Flash (1985)
diff --git a/src/mame/drivers/othello.cpp b/src/mame/drivers/othello.cpp
index 9d0439c2d17..08b064f6d60 100644
--- a/src/mame/drivers/othello.cpp
+++ b/src/mame/drivers/othello.cpp
@@ -432,13 +432,11 @@ MACHINE_CONFIG_START(othello_state::othello)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD(m_ay[0], AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
+ AY8910(config, m_ay[0], 2000000).add_route(ALL_OUTPUTS, "speaker", 0.15);
- MCFG_DEVICE_ADD(m_ay[1], AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
+ AY8910(config, m_ay[1], 2000000).add_route(ALL_OUTPUTS, "speaker", 0.15);
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
diff --git a/src/mame/drivers/pacman.cpp b/src/mame/drivers/pacman.cpp
index 44cb77c265c..d93521c16cf 100644
--- a/src/mame/drivers/pacman.cpp
+++ b/src/mame/drivers/pacman.cpp
@@ -3683,9 +3683,8 @@ MACHINE_CONFIG_START(pacman_state::dremshpr)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, pacman_state, vblank_nmi))
/* sound hardware */
- MCFG_DEVICE_REMOVE("namco")
- MCFG_DEVICE_ADD("ay8910", AY8910, 14318000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ config.device_remove("namco");
+ AY8910(config, "ay8910", 14318000/8).add_route(ALL_OUTPUTS, "mono", 0.50);
m_mainlatch->q_out_cb<1>().set_nop();
MACHINE_CONFIG_END
@@ -3892,8 +3891,7 @@ MACHINE_CONFIG_START(pacman_state::crushs)
MCFG_DEVICE_IO_MAP(crushs_portmap)
/* sound hardware */
- MCFG_DEVICE_ADD("ay8912", AY8912, 1789750)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ AY8912(config, "ay8912", 1789750).add_route(ALL_OUTPUTS, "mono", 0.75);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/pandoras.cpp b/src/mame/drivers/pandoras.cpp
index b9e96478f2b..3d6108a1ef9 100644
--- a/src/mame/drivers/pandoras.cpp
+++ b/src/mame/drivers/pandoras.cpp
@@ -355,13 +355,13 @@ MACHINE_CONFIG_START(pandoras_state::pandoras)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- 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("aysnd", AY8910, SOUND_CLOCK/8)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, pandoras_state, pandoras_portA_r)) // not used
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, pandoras_state, pandoras_portB_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
+ ay8910_device &aysnd(AY8910(config, "aysnd", SOUND_CLOCK/8));
+ aysnd.port_a_read_callback().set(FUNC(pandoras_state::pandoras_portA_r)); // not used
+ aysnd.port_b_read_callback().set(FUNC(pandoras_state::pandoras_portB_r));
+ aysnd.add_route(ALL_OUTPUTS, "speaker", 0.4);
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.12) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
diff --git a/src/mame/drivers/pastelg.cpp b/src/mame/drivers/pastelg.cpp
index 1f93be1a6d5..82625ffa55f 100644
--- a/src/mame/drivers/pastelg.cpp
+++ b/src/mame/drivers/pastelg.cpp
@@ -425,10 +425,10 @@ MACHINE_CONFIG_START(pastelg_state::pastelg)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWB"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWA"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
+ ay8910_device &aysnd(AY8910(config, "aysnd", 1250000));
+ aysnd.port_a_read_callback().set_ioport("DSWA");
+ aysnd.port_b_read_callback().set_ioport("DSWB");
+ aysnd.add_route(ALL_OUTPUTS, "speaker", 0.35);
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)
@@ -484,10 +484,10 @@ MACHINE_CONFIG_START(pastelg_state::threeds)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 1250000)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWB"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWA"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
+ ay8910_device &aysnd(AY8910(config, "aysnd", 1250000));
+ aysnd.port_a_read_callback().set_ioport("DSWB");
+ aysnd.port_b_read_callback().set_ioport("DSWA");
+ aysnd.add_route(ALL_OUTPUTS, "speaker", 0.35);
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/pbaction.cpp b/src/mame/drivers/pbaction.cpp
index 64e16099fcd..3c5b54c4a4d 100644
--- a/src/mame/drivers/pbaction.cpp
+++ b/src/mame/drivers/pbaction.cpp
@@ -479,16 +479,13 @@ MACHINE_CONFIG_START(pbaction_state::pbaction)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8910, 12_MHz_XTAL/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, "ay1", 12_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.25);
- MCFG_DEVICE_ADD("ay2", AY8910, 12_MHz_XTAL/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, "ay2", 12_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.25);
- MCFG_DEVICE_ADD("ay3", AY8910, 12_MHz_XTAL/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, "ay3", 12_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.25);
MACHINE_CONFIG_END
void pbaction_state::pbactionx(machine_config &config)
diff --git a/src/mame/drivers/peplus.cpp b/src/mame/drivers/peplus.cpp
index de73bf1a0b2..741a7b2f290 100644
--- a/src/mame/drivers/peplus.cpp
+++ b/src/mame/drivers/peplus.cpp
@@ -1401,8 +1401,7 @@ MACHINE_CONFIG_START(peplus_state::peplus)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8912, XTAL(20'000'000)/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ AY8912(config, "aysnd", XTAL(20'000'000)/12).add_route(ALL_OUTPUTS, "mono", 0.75);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/phoenix.cpp b/src/mame/drivers/phoenix.cpp
index 80905f99ec7..5618a461161 100644
--- a/src/mame/drivers/phoenix.cpp
+++ b/src/mame/drivers/phoenix.cpp
@@ -538,9 +538,10 @@ MACHINE_CONFIG_START(phoenix_state::survival)
SPEAKER(config, "mono").front_center();
/* FIXME: check clock */
- MCFG_DEVICE_ADD("aysnd", AY8910, 11000000/4)
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, phoenix_state, survival_protection_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ ay8910_device &aysnd(AY8910(config, "aysnd", 11000000/4));
+ aysnd.port_b_read_callback().set(FUNC(phoenix_state::survival_protection_r));
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.50);
+
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/play_2.cpp b/src/mame/drivers/play_2.cpp
index e0090987692..2b22ec37f48 100644
--- a/src/mame/drivers/play_2.cpp
+++ b/src/mame/drivers/play_2.cpp
@@ -406,8 +406,7 @@ MACHINE_CONFIG_START(play_2_state::zira)
MCFG_COP400_WRITE_L_CB(WRITE8(*this, play_2_state, psg_w))
MCFG_COP400_READ_IN_CB(READ8(*this, play_2_state, sound_in_r))
- MCFG_DEVICE_ADD("aysnd1", AY8910, 2_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ AY8910(config, m_aysnd1, 2_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.00);
MACHINE_CONFIG_END
void play_2_state::init_zira()
diff --git a/src/mame/drivers/play_3.cpp b/src/mame/drivers/play_3.cpp
index 3199fd2cb33..7559a52b34f 100644
--- a/src/mame/drivers/play_3.cpp
+++ b/src/mame/drivers/play_3.cpp
@@ -516,10 +516,8 @@ MACHINE_CONFIG_START(play_3_state::play_3)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("aysnd1", AY8910, 3.579545_MHz_XTAL / 2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.75)
- MCFG_DEVICE_ADD("aysnd2", AY8910, 3.579545_MHz_XTAL / 2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.75)
+ AY8910(config, m_aysnd1, 3.579545_MHz_XTAL / 2).add_route(ALL_OUTPUTS, "lspeaker", 0.75);
+ AY8910(config, m_aysnd2, 3.579545_MHz_XTAL / 2).add_route(ALL_OUTPUTS, "rspeaker", 0.75);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(play_3_state::megaaton)
diff --git a/src/mame/drivers/popper.cpp b/src/mame/drivers/popper.cpp
index d3c8aa43eb9..a4ea15e8d2d 100644
--- a/src/mame/drivers/popper.cpp
+++ b/src/mame/drivers/popper.cpp
@@ -557,11 +557,9 @@ MACHINE_CONFIG_START(popper_state::popper)
// audio hardware
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(18'432'000)/3/2/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, m_ay[0], XTAL(18'432'000)/3/2/2).add_route(ALL_OUTPUTS, "mono", 0.25);
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(18'432'000)/3/2/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, m_ay[1], XTAL(18'432'000)/3/2/2).add_route(ALL_OUTPUTS, "mono", 0.25);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/progolf.cpp b/src/mame/drivers/progolf.cpp
index 2d4544c3983..bc414a39fe6 100644
--- a/src/mame/drivers/progolf.cpp
+++ b/src/mame/drivers/progolf.cpp
@@ -452,11 +452,9 @@ MACHINE_CONFIG_START(progolf_state::progolf)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, 12000000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
+ AY8910(config, "ay1", 12000000/8).add_route(ALL_OUTPUTS, "mono", 0.23);
- MCFG_DEVICE_ADD("ay2", AY8910, 12000000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
+ AY8910(config, "ay2", 12000000/8).add_route(ALL_OUTPUTS, "mono", 0.23);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(progolf_state::progolfa)
diff --git a/src/mame/drivers/pturn.cpp b/src/mame/drivers/pturn.cpp
index 38ceea02897..add0ace9755 100644
--- a/src/mame/drivers/pturn.cpp
+++ b/src/mame/drivers/pturn.cpp
@@ -550,13 +550,11 @@ MACHINE_CONFIG_START(pturn_state::pturn)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, "ay1", 2000000).add_route(ALL_OUTPUTS, "mono", 0.25);
- MCFG_DEVICE_ADD("ay2", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8910(config, "ay2", 2000000).add_route(ALL_OUTPUTS, "mono", 0.25);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/quizdna.cpp b/src/mame/drivers/quizdna.cpp
index 15910dd3b15..eb46cf5ba49 100644
--- a/src/mame/drivers/quizdna.cpp
+++ b/src/mame/drivers/quizdna.cpp
@@ -464,13 +464,13 @@ MACHINE_CONFIG_START(quizdna_state::quizdna)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ymsnd", YM2203, MCLK/4)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW3"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2"))
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
- MCFG_SOUND_ROUTE(1, "mono", 0.10)
- MCFG_SOUND_ROUTE(2, "mono", 0.10)
- MCFG_SOUND_ROUTE(3, "mono", 0.40)
+ ym2203_device &ymsnd(YM2203(config, "ymsnd", MCLK/4));
+ ymsnd.port_a_read_callback().set_ioport("DSW3");
+ ymsnd.port_b_read_callback().set_ioport("DSW2");
+ ymsnd.add_route(0, "mono", 0.10);
+ ymsnd.add_route(1, "mono", 0.10);
+ ymsnd.add_route(2, "mono", 0.10);
+ ymsnd.add_route(3, "mono", 0.40);
MCFG_DEVICE_ADD("oki", OKIM6295, (MCLK/1024)*132, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
diff --git a/src/mame/drivers/quizo.cpp b/src/mame/drivers/quizo.cpp
index b581f208c81..b9ee97557a0 100644
--- a/src/mame/drivers/quizo.cpp
+++ b/src/mame/drivers/quizo.cpp
@@ -241,8 +241,7 @@ MACHINE_CONFIG_START(quizo_state::quizo)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL2/16 )
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ AY8910(config, "aysnd", XTAL2/16).add_route(ALL_OUTPUTS, "mono", 1.0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ron.cpp b/src/mame/drivers/ron.cpp
index 3d8106edec5..d3d8e46a61a 100644
--- a/src/mame/drivers/ron.cpp
+++ b/src/mame/drivers/ron.cpp
@@ -518,9 +518,9 @@ MACHINE_CONFIG_START(ron_state::ron)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 0) // T0 CLK from I8035 (not verified)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, ron_state, ay_pa_w))
+ AY8910(config, m_ay, 0); // T0 CLK from I8035 (not verified)
+ m_ay->add_route(ALL_OUTPUTS, "mono", 0.30);
+ m_ay->port_a_write_callback().set(FUNC(ron_state::ay_pa_w));
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/scobra.cpp b/src/mame/drivers/scobra.cpp
index fbbf5b6d598..bdff53af871 100644
--- a/src/mame/drivers/scobra.cpp
+++ b/src/mame/drivers/scobra.cpp
@@ -887,7 +887,7 @@ MACHINE_CONFIG_START(scobra_state::type1)
m_ppi8255_0->in_pc_callback().set_ioport("IN2");
I8255A(config, m_ppi8255_1);
- m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pa_callback().set(m_soundlatch, FUNC(generic_latch_8_device::write));
m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
ttl7474_device &ttl7474_9m_1(TTL7474(config, "7474_9m_1", 0));
@@ -918,15 +918,14 @@ MACHINE_CONFIG_START(scobra_state::type1)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8910, 14318000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
+ AY8910(config, "ay1", 14318000/8).add_route(ALL_OUTPUTS, "mono", 0.16);
- MCFG_DEVICE_ADD("ay2", AY8910, 14318000/8)
- MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, scramble_state, scramble_portB_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
+ ay8910_device &ay2(AY8910(config, "ay2", 14318000/8));
+ ay2.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
+ ay2.port_b_read_callback().set(FUNC(scramble_state::scramble_portB_r));
+ ay2.add_route(ALL_OUTPUTS, "mono", 0.16);
MACHINE_CONFIG_END
@@ -1016,7 +1015,7 @@ MACHINE_CONFIG_START(scobra_state::stratgyx)
/* basic machine hardware */
- m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pa_callback().set(m_soundlatch, FUNC(generic_latch_8_device::write));
m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
m_ppi8255_1->in_pc_callback().set_ioport("IN3");
@@ -1075,7 +1074,7 @@ MACHINE_CONFIG_START(scobra_state::hustler)
m_ppi8255_0->in_pc_callback().set_ioport("IN2");
I8255A(config, m_ppi8255_1);
- m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pa_callback().set(m_soundlatch, FUNC(generic_latch_8_device::write));
m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
/* video hardware */
@@ -1095,11 +1094,12 @@ MACHINE_CONFIG_START(scobra_state::hustler)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_DEVICE_ADD("aysnd", AY8910, 14318000/8)
- MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, scramble_state, hustler_portB_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
+ GENERIC_LATCH_8(config, m_soundlatch);
+
+ ay8910_device &aysnd(AY8910(config, "aysnd", 14318000/8));
+ aysnd.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
+ aysnd.port_b_read_callback().set(FUNC(scramble_state::hustler_portB_r));
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.33);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(scobra_state::hustlerb)
diff --git a/src/mame/drivers/scramble.cpp b/src/mame/drivers/scramble.cpp
index 1a0b4086d90..2280ef3a64f 100644
--- a/src/mame/drivers/scramble.cpp
+++ b/src/mame/drivers/scramble.cpp
@@ -1334,7 +1334,7 @@ MACHINE_CONFIG_START(scramble_state::scramble)
m_ppi8255_0->in_pc_callback().set_ioport("IN2");
I8255A(config, m_ppi8255_1);
- m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pa_callback().set(m_soundlatch, FUNC(generic_latch_8_device::write));
m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
/* video hardware */
@@ -1355,15 +1355,14 @@ MACHINE_CONFIG_START(scramble_state::scramble)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("8910.1", AY8910, 14318000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
+ AY8910(config, "8910.1", 14318000/8).add_route(ALL_OUTPUTS, "mono", 0.16);
- MCFG_DEVICE_ADD("8910.2", AY8910, 14318000/8)
- MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, scramble_state, scramble_portB_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
+ ay8910_device &ay2(AY8910(config, "8910.2", 14318000/8));
+ ay2.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
+ ay2.port_b_read_callback().set(FUNC(scramble_state::scramble_portB_r));
+ ay2.add_route(ALL_OUTPUTS, "mono", 0.16);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(scramble_state::mars)
@@ -1373,7 +1372,7 @@ MACHINE_CONFIG_START(scramble_state::mars)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(mars_map)
- m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pa_callback().set(m_soundlatch, FUNC(generic_latch_8_device::write));
m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::scramble_sh_irqtrigger_w));
m_ppi8255_1->in_pc_callback().set_ioport("IN3");
@@ -1420,7 +1419,7 @@ MACHINE_CONFIG_START(scramble_state::mrkougb)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(mrkougar_map)
- m_ppi8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
+ m_ppi8255_1->out_pa_callback().set(m_soundlatch, FUNC(generic_latch_8_device::write));
m_ppi8255_1->out_pb_callback().set(FUNC(scramble_state::mrkougar_sh_irqtrigger_w));
m_ppi8255_1->in_pc_callback().set_constant(0);
@@ -1472,15 +1471,12 @@ MACHINE_CONFIG_START(scramble_state::hotshock)
MCFG_PALETTE_INIT_OWNER(scramble_state,galaxold)
MCFG_VIDEO_START_OVERRIDE(scramble_state,pisces)
- MCFG_DEVICE_MODIFY("8910.1")
- MCFG_SOUND_ROUTES_RESET()
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
+ subdevice<ay8910_device>("8910.1")->reset_routes();
+ subdevice<ay8910_device>("8910.1")->add_route(ALL_OUTPUTS, "mono", 0.33);
- MCFG_DEVICE_MODIFY("8910.2")
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, scramble_state, hotshock_soundlatch_r))
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, scramble_state, scramble_portB_r))
- MCFG_SOUND_ROUTES_RESET()
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
+ subdevice<ay8910_device>("8910.2")->port_a_read_callback().set(FUNC(scramble_state::hotshock_soundlatch_r));
+ subdevice<ay8910_device>("8910.2")->reset_routes();
+ subdevice<ay8910_device>("8910.2")->add_route(ALL_OUTPUTS, "mono", 0.33);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(scramble_state::cavelon)
@@ -1636,13 +1632,12 @@ MACHINE_CONFIG_START(scramble_state::harem)
MCFG_VIDEO_START_OVERRIDE(scramble_state,harem)
/* extra AY8910 with I/O ports */
- MCFG_DEVICE_ADD("8910.3", AY8910, 14318000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("digitalker", digitalker_device, digitalker_data_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, scramble_state, harem_digitalker_control_w))
+ ay8910_device &ay3(AY8910(config, "8910.3", 14318000/8));
+ ay3.add_route(ALL_OUTPUTS, "mono", 0.16);
+ ay3.port_a_write_callback().set(m_digitalker, FUNC(digitalker_device::digitalker_data_w));
+ ay3.port_b_write_callback().set(FUNC(scramble_state::harem_digitalker_control_w));
- MCFG_DIGITALKER_ADD("digitalker", 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
+ DIGITALKER(config, m_digitalker, 4000000).add_route(ALL_OUTPUTS, "mono", 0.16);
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/scregg.cpp b/src/mame/drivers/scregg.cpp
index 7b6a278073a..71db552c60d 100644
--- a/src/mame/drivers/scregg.cpp
+++ b/src/mame/drivers/scregg.cpp
@@ -292,11 +292,9 @@ MACHINE_CONFIG_START(scregg_state::dommy)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(12'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
+ AY8910(config, "ay1", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.23);
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(12'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
+ AY8910(config, "ay2", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.23);
MACHINE_CONFIG_END
@@ -324,11 +322,9 @@ MACHINE_CONFIG_START(scregg_state::scregg)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(12'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
+ AY8910(config, "ay1", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.23);
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(12'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
+ AY8910(config, "ay2", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.23);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/segag80v.cpp b/src/mame/drivers/segag80v.cpp
index a2b4e2425dc..19e5b5e2639 100644
--- a/src/mame/drivers/segag80v.cpp
+++ b/src/mame/drivers/segag80v.cpp
@@ -951,8 +951,7 @@ MACHINE_CONFIG_START(segag80v_state::zektor)
MCFG_SAMPLES_NAMES(zektor_sample_names)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
- MCFG_DEVICE_ADD("aysnd", AY8912, VIDEO_CLOCK/4/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.33)
+ AY8912(config, m_aysnd, VIDEO_CLOCK/4/2).add_route(ALL_OUTPUTS, "speaker", 0.33);
/* speech board */
sega_speech_board(config);
diff --git a/src/mame/drivers/seicross.cpp b/src/mame/drivers/seicross.cpp
index c6a57466f5f..a9a7e599ccc 100644
--- a/src/mame/drivers/seicross.cpp
+++ b/src/mame/drivers/seicross.cpp
@@ -427,10 +427,10 @@ MACHINE_CONFIG_START(seicross_state::no_nvram)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(18'432'000) / 12)
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, seicross_state, portB_r))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, seicross_state, portB_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(18'432'000) / 12));
+ aysnd.port_b_read_callback().set(FUNC(seicross_state::portB_r));
+ aysnd.port_b_write_callback().set(FUNC(seicross_state::portB_w));
+ aysnd.add_route(ALL_OUTPUTS, "speaker", 0.25);
MCFG_DEVICE_ADD("dac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.12) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp
index 9edde5eb618..b33b9dc8c33 100644
--- a/src/mame/drivers/seta.cpp
+++ b/src/mame/drivers/seta.cpp
@@ -7880,11 +7880,11 @@ MACHINE_CONFIG_START(seta_state::tndrcade)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("ym1", YM2203, 16000000/4) /* 4 MHz */
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, seta_state, dsw1_r)) /* input A: DSW 1 */
- MCFG_AY8910_PORT_B_READ_CB(READ8(*this, seta_state, dsw2_r)) /* input B: DSW 2 */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.35)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.35)
+ ym2203_device &ym1(YM2203(config, "ym1", 16000000/4)); /* 4 MHz */
+ ym1.port_a_read_callback().set(FUNC(seta_state::dsw1_r)); /* input A: DSW 1 */
+ ym1.port_b_read_callback().set(FUNC(seta_state::dsw2_r)); /* input B: DSW 2 */
+ ym1.add_route(ALL_OUTPUTS, "lspeaker", 0.35);
+ ym1.add_route(ALL_OUTPUTS, "rspeaker", 0.35);
MCFG_DEVICE_ADD("ym2", YM3812, 16000000/4) /* 4 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
diff --git a/src/mame/drivers/shougi.cpp b/src/mame/drivers/shougi.cpp
index 1b91a739420..dd38e1395d4 100644
--- a/src/mame/drivers/shougi.cpp
+++ b/src/mame/drivers/shougi.cpp
@@ -410,8 +410,7 @@ MACHINE_CONFIG_START(shougi_state::shougi)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(10'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ AY8910(config, "aysnd", XTAL(10'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.30);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/skeetsht.cpp b/src/mame/drivers/skeetsht.cpp
index ebddda70296..17d957e7137 100644
--- a/src/mame/drivers/skeetsht.cpp
+++ b/src/mame/drivers/skeetsht.cpp
@@ -260,8 +260,7 @@ MACHINE_CONFIG_START(skeetsht_state::skeetsht)
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 2000000) // ?
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ AY8910(config, m_ay, 2000000).add_route(ALL_OUTPUTS, "mono", 0.50); // ?
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/snk.cpp b/src/mame/drivers/snk.cpp
index c4e21a84818..37ca05d3681 100644
--- a/src/mame/drivers/snk.cpp
+++ b/src/mame/drivers/snk.cpp
@@ -3648,17 +3648,14 @@ MACHINE_CONFIG_START(snk_state::marvins)
/* sound hardware */
SPEAKER(config, "mono").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);
- MCFG_DEVICE_ADD("ay1", AY8910, 2000000) /* verified on schematics */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ AY8910(config, "ay1", 2000000).add_route(ALL_OUTPUTS, "mono", 0.35); /* verified on schematics */
- MCFG_DEVICE_ADD("ay2", AY8910, 2000000) /* verified on schematics */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ AY8910(config, "ay2", 2000000).add_route(ALL_OUTPUTS, "mono", 0.35);/* verified on schematics */
- MCFG_DEVICE_ADD("wave", SNKWAVE, 8000000) /* verified on schematics */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ SNKWAVE(config, "wave", 8000000).add_route(ALL_OUTPUTS, "mono", 0.30); /* verified on schematics */
MACHINE_CONFIG_END
@@ -3723,13 +3720,11 @@ MACHINE_CONFIG_START(snk_state::jcross)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8910, 2000000) /* NOT verified */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ AY8910(config, "ay1", 2000000).add_route(ALL_OUTPUTS, "mono", 0.35); /* NOT verified */
- MCFG_DEVICE_ADD("ay2", AY8910, 2000000) /* NOT verified */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ AY8910(config, "ay2", 2000000).add_route(ALL_OUTPUTS, "mono", 0.35); /* NOT verified */
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/solomon.cpp b/src/mame/drivers/solomon.cpp
index cdb486c2f95..742d4bfaa35 100644
--- a/src/mame/drivers/solomon.cpp
+++ b/src/mame/drivers/solomon.cpp
@@ -238,16 +238,13 @@ MACHINE_CONFIG_START(solomon_state::solomon)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("ay1", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
+ AY8910(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.12);
- MCFG_DEVICE_ADD("ay2", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
+ AY8910(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.12);
- MCFG_DEVICE_ADD("ay3", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
+ AY8910(config, "ay3", 1500000).add_route(ALL_OUTPUTS, "mono", 0.12);
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/sonson.cpp b/src/mame/drivers/sonson.cpp
index b8966be6c7a..6cad8d16ba4 100644
--- a/src/mame/drivers/sonson.cpp
+++ b/src/mame/drivers/sonson.cpp
@@ -259,13 +259,11 @@ MACHINE_CONFIG_START(sonson_state::sonson)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(12'000'000)/8) /* 1.5 MHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ AY8910(config, "ay1", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.30); /* 1.5 MHz */
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(12'000'000)/8) /* 1.5 MHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ AY8910(config, "ay2", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.30); /* 1.5 MHz */
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/spartanxtec.cpp b/src/mame/drivers/spartanxtec.cpp
index 50780bf8bec..b6656318b0a 100644
--- a/src/mame/drivers/spartanxtec.cpp
+++ b/src/mame/drivers/spartanxtec.cpp
@@ -392,15 +392,14 @@ MACHINE_CONFIG_START(spartanxtec_state::spartanxtec)
/* 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_DEVICE_ADD("ay1", AY8912, 1000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_DEVICE_ADD("ay2", AY8912, 1000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_DEVICE_ADD("ay3", AY8912, 1000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
+
+ AY8912(config, "ay1", 1000000).add_route(ALL_OUTPUTS, "mono", 0.25);
+
+ AY8912(config, "ay2", 1000000).add_route(ALL_OUTPUTS, "mono", 0.25);
+
+ AY8912(config, "ay3", 1000000).add_route(ALL_OUTPUTS, "mono", 0.25);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/speedatk.cpp b/src/mame/drivers/speedatk.cpp
index eeaf8ceed4b..c069458ade6 100644
--- a/src/mame/drivers/speedatk.cpp
+++ b/src/mame/drivers/speedatk.cpp
@@ -336,10 +336,10 @@ MACHINE_CONFIG_START(speedatk_state::speedatk)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, MASTER_CLOCK/4) //divider is unknown
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW"))
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, speedatk_state, output_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ ay8910_device &aysnd(AY8910(config, "aysnd", MASTER_CLOCK/4)); //divider is unknown
+ aysnd.port_b_read_callback().set_ioport("DSW");
+ aysnd.port_a_write_callback().set(FUNC(speedatk_state::output_w));
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.5);
MACHINE_CONFIG_END
ROM_START( speedatk )
diff --git a/src/mame/drivers/splus.cpp b/src/mame/drivers/splus.cpp
index b796171f60f..e7fc884cbee 100644
--- a/src/mame/drivers/splus.cpp
+++ b/src/mame/drivers/splus.cpp
@@ -703,8 +703,7 @@ MACHINE_CONFIG_START(splus_state::splus) // basic machine hardware
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8912, SOUND_CLOCK)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ AY8912(config, "aysnd", SOUND_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.75);
MACHINE_CONFIG_END
/*************************
diff --git a/src/mame/drivers/spyhuntertec.cpp b/src/mame/drivers/spyhuntertec.cpp
index 519321165f0..5e554220c9c 100644
--- a/src/mame/drivers/spyhuntertec.cpp
+++ b/src/mame/drivers/spyhuntertec.cpp
@@ -704,21 +704,20 @@ MACHINE_CONFIG_START(spyhuntertec_state::spyhuntertec)
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("ay1", AY8912, 3000000/2) // AY-3-8912
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, spyhuntertec_state, ay1_porta_r))
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, spyhuntertec_state, ay1_porta_w))
+ ay8912_device &ay1(AY8912(config, "ay1", 3000000/2)); // AY-3-8912
+ ay1.add_route(ALL_OUTPUTS, "mono", 0.25);
+ ay1.port_a_read_callback().set(FUNC(spyhuntertec_state::ay1_porta_r));
+ ay1.port_a_write_callback().set(FUNC(spyhuntertec_state::ay1_porta_w));
- MCFG_DEVICE_ADD("ay2", AY8912, 3000000/2) // "
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, spyhuntertec_state, ay2_porta_r))
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, spyhuntertec_state, ay2_porta_w))
+ ay8912_device &ay2(AY8912(config, "ay2", 3000000/2)); // "
+ ay2.add_route(ALL_OUTPUTS, "mono", 0.25);
+ ay2.port_a_read_callback().set(FUNC(spyhuntertec_state::ay2_porta_r));
+ ay2.port_a_write_callback().set(FUNC(spyhuntertec_state::ay2_porta_w));
- MCFG_DEVICE_ADD("ay3", AY8912, 3000000/2) // "
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8912(config, "ay3", 3000000/2).add_route(ALL_OUTPUTS, "mono", 0.25); // "
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/srmp2.cpp b/src/mame/drivers/srmp2.cpp
index 7a3e46c2163..5f2deef2faa 100644
--- a/src/mame/drivers/srmp2.cpp
+++ b/src/mame/drivers/srmp2.cpp
@@ -1167,10 +1167,10 @@ MACHINE_CONFIG_START(srmp2_state::srmp2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 20000000/16)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ ay8910_device &aysnd(AY8910(config, "aysnd", 20000000/16));
+ aysnd.port_a_read_callback().set_ioport("DSW2");
+ aysnd.port_b_read_callback().set_ioport("DSW1");
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.40);
MCFG_DEVICE_ADD("msm", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, srmp2_state, adpcm_int)) /* IRQ handler */
@@ -1214,10 +1214,10 @@ MACHINE_CONFIG_START(srmp2_state::srmp3)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 16000000/16)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ ay8910_device &aysnd(AY8910(config, "aysnd", 16000000/16));
+ aysnd.port_a_read_callback().set_ioport("DSW2");
+ aysnd.port_b_read_callback().set_ioport("DSW1");
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.20);
MCFG_DEVICE_ADD("msm", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, srmp2_state, adpcm_int)) /* IRQ handler */
@@ -1267,10 +1267,10 @@ MACHINE_CONFIG_START(srmp2_state::mjyuugi)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 16000000/16)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ ay8910_device &aysnd(AY8910(config, "aysnd", 16000000/16));
+ aysnd.port_a_read_callback().set_ioport("DSW2");
+ aysnd.port_b_read_callback().set_ioport("DSW1");
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.20);
MCFG_DEVICE_ADD("msm", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, srmp2_state, adpcm_int)) /* IRQ handler */
diff --git a/src/mame/drivers/ssingles.cpp b/src/mame/drivers/ssingles.cpp
index af6e7142d5a..80b589956cf 100644
--- a/src/mame/drivers/ssingles.cpp
+++ b/src/mame/drivers/ssingles.cpp
@@ -575,11 +575,9 @@ MACHINE_CONFIG_START(ssingles_state::ssingles)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, 1500000) /* ? MHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ AY8910(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.5); /* ? MHz */
- MCFG_DEVICE_ADD("ay2", AY8910, 1500000) /* ? MHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ AY8910(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.5); /* ? MHz */
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/stargame.cpp b/src/mame/drivers/stargame.cpp
index 813470bf2a7..10b96f5fd3e 100644
--- a/src/mame/drivers/stargame.cpp
+++ b/src/mame/drivers/stargame.cpp
@@ -129,8 +129,7 @@ MACHINE_CONFIG_START(stargame_state::stargame)
MCFG_DEVICE_ADD("mea8000", MEA8000, 15000000 / 4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "measnd", 1.0)
SPEAKER(config, "aysnd").front_center();
- MCFG_DEVICE_ADD("ay", AY8910, 15000000 / 8) // clock line marked as CK2 and derived from 15MHz crystal
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "aysnd", 0.25)
+ AY8910(config, "ay", 15000000 / 8).add_route(ALL_OUTPUTS, "aysnd", 0.25); // clock line marked as CK2 and derived from 15MHz crystal
ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<0>().set_nop(); // DADIS
diff --git a/src/mame/drivers/statriv2.cpp b/src/mame/drivers/statriv2.cpp
index 4cbb3a179ef..a858a1a15da 100644
--- a/src/mame/drivers/statriv2.cpp
+++ b/src/mame/drivers/statriv2.cpp
@@ -639,8 +639,7 @@ MACHINE_CONFIG_START(statriv2_state::statriv2)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, MASTER_CLOCK/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ AY8910(config, "aysnd", MASTER_CLOCK/8).add_route(ALL_OUTPUTS, "mono", 1.0);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(statriv2_state::statriv2v)
diff --git a/src/mame/drivers/sub.cpp b/src/mame/drivers/sub.cpp
index 1fd35c94682..a030fb5ecc3 100644
--- a/src/mame/drivers/sub.cpp
+++ b/src/mame/drivers/sub.cpp
@@ -342,16 +342,14 @@ MACHINE_CONFIG_START(sub_state::sub)
/* 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_GENERIC_LATCH_8_ADD("soundlatch2")
+ GENERIC_LATCH_8(config, "soundlatch2");
- MCFG_DEVICE_ADD("ay1", AY8910, MASTER_CLOCK/6/2) /* ? Mhz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
+ AY8910(config, "ay1", MASTER_CLOCK/6/2).add_route(ALL_OUTPUTS, "mono", 0.23); /* ? Mhz */
- MCFG_DEVICE_ADD("ay2", AY8910, MASTER_CLOCK/6/2) /* ? Mhz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
+ AY8910(config, "ay2", MASTER_CLOCK/6/2).add_route(ALL_OUTPUTS, "mono", 0.23); /* ? Mhz */
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/supertnk.cpp b/src/mame/drivers/supertnk.cpp
index 7010cf67d04..451c9d57b58 100644
--- a/src/mame/drivers/supertnk.cpp
+++ b/src/mame/drivers/supertnk.cpp
@@ -439,8 +439,8 @@ INPUT_PORTS_END
*
*************************************/
-MACHINE_CONFIG_START(supertnk_state::supertnk)
-
+void supertnk_state::supertnk(machine_config &config)
+{
// CPU TMS9980A; no line connections
TMS9980A(config, m_maincpu, 20.79_MHz_XTAL / 2); // divider not verified (possibly should be /3)
m_maincpu->set_addrmap(AS_PROGRAM, &supertnk_state::supertnk_map);
@@ -465,9 +465,8 @@ MACHINE_CONFIG_START(supertnk_state::supertnk)
/* audio hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-MACHINE_CONFIG_END
+ AY8910(config, "aysnd", 2000000).add_route(ALL_OUTPUTS, "mono", 0.50);
+}
diff --git a/src/mame/drivers/suprgolf.cpp b/src/mame/drivers/suprgolf.cpp
index 9247e579d14..8c179c2d359 100644
--- a/src/mame/drivers/suprgolf.cpp
+++ b/src/mame/drivers/suprgolf.cpp
@@ -531,13 +531,13 @@ MACHINE_CONFIG_START(suprgolf_state::suprgolf)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ymsnd", YM2203, MASTER_CLOCK/4) /* guess */
- //MCFG_YM2203_IRQ_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, suprgolf_state, writeA))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, suprgolf_state, writeB))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ ym2203_device &ymsnd(YM2203(config, "ymsnd", MASTER_CLOCK/4)); /* guess */
+ //ymsnd.irq_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ ymsnd.port_a_read_callback().set_ioport("DSW0");
+ ymsnd.port_b_read_callback().set_ioport("DSW1");
+ ymsnd.port_a_write_callback().set(FUNC(suprgolf_state::writeA));
+ ymsnd.port_b_write_callback().set(FUNC(suprgolf_state::writeB));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.5);
MCFG_DEVICE_ADD("msm", MSM5205, XTAL(384'000)) /* guess */
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, suprgolf_state, adpcm_int)) /* interrupt function */
diff --git a/src/mame/drivers/tagteam.cpp b/src/mame/drivers/tagteam.cpp
index 93abcc2a935..82d89150c8a 100644
--- a/src/mame/drivers/tagteam.cpp
+++ b/src/mame/drivers/tagteam.cpp
@@ -236,14 +236,12 @@ MACHINE_CONFIG_START(tagteam_state::tagteam)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", M6502_IRQ_LINE))
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, M6502_IRQ_LINE);
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(12'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, "ay1", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "speaker", 0.25);
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(12'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ AY8910(config, "ay2", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "speaker", 0.25);
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/thedealr.cpp b/src/mame/drivers/thedealr.cpp
index 12a7f3c5d35..72b8c77ad06 100644
--- a/src/mame/drivers/thedealr.cpp
+++ b/src/mame/drivers/thedealr.cpp
@@ -574,10 +574,10 @@ MACHINE_CONFIG_START(thedealr_state::thedealr)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", YM2149, XTAL(16'000'000)/8) // 2 MHz?
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
- MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ ym2149_device &aysnd(YM2149(config, "aysnd", XTAL(16'000'000)/8)); // 2 MHz?
+ aysnd.port_a_read_callback().set_ioport("DSW2");
+ aysnd.port_b_read_callback().set_ioport("DSW1");
+ aysnd.add_route(ALL_OUTPUTS, "mono", 0.50);
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/thief.cpp b/src/mame/drivers/thief.cpp
index 52e6409b97a..b1551c30e56 100644
--- a/src/mame/drivers/thief.cpp
+++ b/src/mame/drivers/thief.cpp
@@ -419,11 +419,9 @@ MACHINE_CONFIG_START(thief_state::thief)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(8'000'000)/2/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ AY8910(config, "ay1", XTAL(8'000'000)/2/4).add_route(ALL_OUTPUTS, "mono", 0.50);
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(8'000'000)/2/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ AY8910(config, "ay2", XTAL(8'000'000)/2/4).add_route(ALL_OUTPUTS, "mono", 0.50);
MCFG_DEVICE_ADD("samples", SAMPLES)
MCFG_SAMPLES_CHANNELS(2)
diff --git a/src/mame/drivers/trvmadns.cpp b/src/mame/drivers/trvmadns.cpp
index 6d5f731121b..6be42577be8 100644
--- a/src/mame/drivers/trvmadns.cpp
+++ b/src/mame/drivers/trvmadns.cpp
@@ -410,8 +410,7 @@ MACHINE_CONFIG_START(trvmadns_state::trvmadns)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(10'000'000)/2/4) //?
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ AY8910(config, "aysnd", XTAL(10'000'000)/2/4).add_route(ALL_OUTPUTS, "mono", 1.0); //?
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/tsamurai.cpp b/src/mame/drivers/tsamurai.cpp
index 9caeb6e83e8..9a47a3c3dc1 100644
--- a/src/mame/drivers/tsamurai.cpp
+++ b/src/mame/drivers/tsamurai.cpp
@@ -756,8 +756,7 @@ MACHINE_CONFIG_START(tsamurai_state::tsamurai)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(24'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
+ AY8910(config,"aysnd", XTAL(24'000'000)/8).add_route(ALL_OUTPUTS, "speaker", 0.1);
MCFG_DEVICE_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
MCFG_DEVICE_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
@@ -804,10 +803,9 @@ MACHINE_CONFIG_START(tsamurai_state::vsgongf)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(24'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
+ AY8910(config,"aysnd", XTAL(24'000'000)/8).add_route(ALL_OUTPUTS, "speaker", 0.1);
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
@@ -860,8 +858,7 @@ MACHINE_CONFIG_START(tsamurai_state::m660)
/* sound hardware */
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(24'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
+ AY8910(config,"aysnd", XTAL(24'000'000)/8).add_route(ALL_OUTPUTS, "speaker", 0.1);
MCFG_DEVICE_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
MCFG_DEVICE_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
diff --git a/src/mame/drivers/tubep.cpp b/src/mame/drivers/tubep.cpp
index 35062587c75..dd913f9c02b 100644
--- a/src/mame/drivers/tubep.cpp
+++ b/src/mame/drivers/tubep.cpp
@@ -866,20 +866,20 @@ MACHINE_CONFIG_START(tubep_state::tubep)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, 19968000 / 8 / 2)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portA_0_w)) /* write port A */
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portB_0_w)) /* write port B */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DEVICE_ADD("ay2", AY8910, 19968000 / 8 / 2)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portA_1_w)) /* write port A */
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portB_1_w)) /* write port B */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DEVICE_ADD("ay3", AY8910, 19968000 / 8 / 2)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portA_2_w)) /* write port A */
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portB_2_w)) /* write port B */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ ay8910_device &ay1(AY8910(config, "ay1", 19968000 / 8 / 2));
+ ay1.port_a_write_callback().set(FUNC(tubep_state::ay8910_portA_0_w));
+ ay1.port_b_write_callback().set(FUNC(tubep_state::ay8910_portB_0_w));
+ ay1.add_route(ALL_OUTPUTS, "mono", 0.10);
+
+ ay8910_device &ay2(AY8910(config, "ay2", 19968000 / 8 / 2));
+ ay2.port_a_write_callback().set(FUNC(tubep_state::ay8910_portA_1_w));
+ ay2.port_b_write_callback().set(FUNC(tubep_state::ay8910_portB_1_w));
+ ay2.add_route(ALL_OUTPUTS, "mono", 0.10);
+
+ ay8910_device &ay3(AY8910(config, "ay3", 19968000 / 8 / 2));
+ ay3.port_a_write_callback().set(FUNC(tubep_state::ay8910_portA_2_w));
+ ay3.port_b_write_callback().set(FUNC(tubep_state::ay8910_portB_2_w));
+ ay3.add_route(ALL_OUTPUTS, "mono", 0.10);
MACHINE_CONFIG_END
@@ -939,25 +939,26 @@ MACHINE_CONFIG_START(tubep_state::rjammer)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, 19968000 / 8 / 2)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portA_0_w)) /* write port A */
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portB_0_w)) /* write port B */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ ay8910_device &ay1(AY8910(config, "ay1", 19968000 / 8 / 2));
+ ay1.port_a_write_callback().set(FUNC(tubep_state::ay8910_portA_0_w));
+ ay1.port_b_write_callback().set(FUNC(tubep_state::ay8910_portB_0_w));
+ ay1.add_route(ALL_OUTPUTS, "mono", 0.10);
- MCFG_DEVICE_ADD("ay2", AY8910, 19968000 / 8 / 2)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portA_1_w)) /* write port A */
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portB_1_w)) /* write port B */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ ay8910_device &ay2(AY8910(config, "ay2", 19968000 / 8 / 2));
+ ay2.port_a_write_callback().set(FUNC(tubep_state::ay8910_portA_1_w));
+ ay2.port_b_write_callback().set(FUNC(tubep_state::ay8910_portB_1_w));
+ ay2.add_route(ALL_OUTPUTS, "mono", 0.10);
- MCFG_DEVICE_ADD("ay3", AY8910, 19968000 / 8 / 2)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portA_2_w)) /* write port A */
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, tubep_state, ay8910_portB_2_w)) /* write port B */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ ay8910_device &ay3(AY8910(config, "ay3", 19968000 / 8 / 2));
+ ay3.port_a_write_callback().set(FUNC(tubep_state::ay8910_portA_2_w));
+ ay3.port_b_write_callback().set(FUNC(tubep_state::ay8910_portB_2_w));
+ ay3.add_route(ALL_OUTPUTS, "mono", 0.10);
MCFG_DEVICE_ADD("msm", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, tubep_state, rjammer_adpcm_vck)) /* VCK function */
MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8 KHz (changes at run time) */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/tugboat.cpp b/src/mame/drivers/tugboat.cpp
index 607ee338e55..e5231a3e925 100644
--- a/src/mame/drivers/tugboat.cpp
+++ b/src/mame/drivers/tugboat.cpp
@@ -389,8 +389,7 @@ MACHINE_CONFIG_START(tugboat_state::tugboat)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8912, XTAL(10'000'000)/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ AY8912(config, "aysnd", XTAL(10'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.35);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/videopkr.cpp b/src/mame/drivers/videopkr.cpp
index 53851a0987c..bbdea1f53b6 100644
--- a/src/mame/drivers/videopkr.cpp
+++ b/src/mame/drivers/videopkr.cpp
@@ -1341,8 +1341,7 @@ MACHINE_CONFIG_START(videopkr_state::babypkr)
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_videodad)
MCFG_VIDEO_START_OVERRIDE(videopkr_state,vidadcba)
- MCFG_DEVICE_ADD("aysnd", AY8910, CPU_CLOCK / 6) /* no ports used */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
+ AY8910(config, m_aysnd, CPU_CLOCK / 6).add_route(ALL_OUTPUTS, "speaker", 0.3); /* no ports used */
MACHINE_CONFIG_END
MACHINE_CONFIG_START(videopkr_state::fortune1)
diff --git a/src/mame/drivers/vpoker.cpp b/src/mame/drivers/vpoker.cpp
index 773d2548ccf..1a2686458fe 100644
--- a/src/mame/drivers/vpoker.cpp
+++ b/src/mame/drivers/vpoker.cpp
@@ -661,8 +661,7 @@ MACHINE_CONFIG_START(vpoker_state::vpoker)
/* sound hardware */
SPEAKER(config, "mono").front_center();
-// MCFG_DEVICE_ADD("aysnd", AY8910, 8000000/4 /* guess */)
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+// AY8910(config, "aysnd", 8000000/4 /* guess */).add_route(ALL_OUTPUTS, "mono", 0.30);
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/wallc.cpp b/src/mame/drivers/wallc.cpp
index 644d263a862..5dbfa2c663f 100644
--- a/src/mame/drivers/wallc.cpp
+++ b/src/mame/drivers/wallc.cpp
@@ -320,7 +320,7 @@ void wallc_state::unkitpkr_map(address_map &map)
map(0xb100, 0xb100).w(FUNC(wallc_state::unkitpkr_out1_w));
map(0xb200, 0xb200).w(FUNC(wallc_state::unkitpkr_out2_w));
map(0xb500, 0xb500).w("aysnd", FUNC(ay8912_device::address_w));
- map(0xb600, 0xb600).rw("aysnd", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); // Port A = DSW
+ map(0xb600, 0xb600).rw("aysnd", FUNC(ay8912_device::data_r), FUNC(ay8910_device::data_w)); // Port A = DSW
}
@@ -536,8 +536,7 @@ MACHINE_CONFIG_START(wallc_state::wallc)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("aysnd", AY8912, 12288000 / 8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ AY8912(config, "aysnd", 12288000 / 8).add_route(ALL_OUTPUTS, "mono", 0.30);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(wallc_state::wallca)
@@ -557,9 +556,9 @@ MACHINE_CONFIG_START(wallc_state::unkitpkr)
MCFG_PALETTE_INIT_OWNER(wallc_state, unkitpkr)
/* sound hardware */
- MCFG_DEVICE_MODIFY("aysnd")
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ subdevice<ay8912_device>("aysnd")->port_a_read_callback().set_ioport("DSW2");
+ subdevice<ay8912_device>("aysnd")->reset_routes();
+ subdevice<ay8912_device>("aysnd")->add_route(ALL_OUTPUTS, "mono", 0.50);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(wallc_state::sidampkr)
diff --git a/src/mame/drivers/wink.cpp b/src/mame/drivers/wink.cpp
index 46b186ae68d..8a1bca08a64 100644
--- a/src/mame/drivers/wink.cpp
+++ b/src/mame/drivers/wink.cpp
@@ -423,11 +423,11 @@ MACHINE_CONFIG_START(wink_state::wink)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, "soundlatch");
- MCFG_DEVICE_ADD("aysnd", AY8912, 12000000 / 8)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, wink_state, sound_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ ay8912_device &aysnd(AY8912(config, "aysnd", 12000000 / 8));
+ aysnd.port_a_read_callback().set(FUNC(wink_state::sound_r));
+ aysnd.add_route(ALL_OUTPUTS, "mono", 1.0);
MACHINE_CONFIG_END
/***************************************************************************