From cc59e2123eaa5e6c5c71317d28b55f425bb6a333 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 14 Nov 2018 18:56:50 +0100 Subject: [PATCH] ay8910: finished MCFG macros removal (nw) --- src/devices/bus/cbus/pc9801_118.cpp | 21 ++++++------ src/devices/bus/cbus/pc9801_26.cpp | 19 ++++++----- src/devices/bus/cbus/pc9801_86.cpp | 48 +++++++++++++-------------- src/devices/bus/cbus/pc9801_86.h | 2 +- src/devices/bus/cbus/pc9801_amd98.cpp | 27 +++++++-------- src/devices/bus/coco/coco_ssc.cpp | 6 ++-- src/devices/bus/intv/ecs.cpp | 10 +++--- src/devices/sound/ay8910.h | 23 ------------- src/mame/audio/mario.cpp | 19 +++++------ src/mame/drivers/aces1.cpp | 20 +++++------ src/mame/drivers/aquarius.cpp | 8 ++--- src/mame/drivers/bitgraph.cpp | 6 ++-- src/mame/drivers/bml3.cpp | 24 ++++---------- src/mame/drivers/calomega.cpp | 15 ++++----- src/mame/drivers/carrera.cpp | 8 ++--- src/mame/drivers/cb2001.cpp | 8 ++--- src/mame/drivers/clpoker.cpp | 8 ++--- src/mame/drivers/cocoloco.cpp | 14 ++++---- src/mame/drivers/coinmstr.cpp | 6 ++-- src/mame/drivers/dfruit.cpp | 8 ++--- src/mame/drivers/dominob.cpp | 10 +++--- src/mame/drivers/dragon.cpp | 8 ++--- src/mame/drivers/dwarfd.cpp | 8 ++--- src/mame/drivers/efdt.cpp | 24 +++++++------- src/mame/drivers/einstein.cpp | 8 ++--- src/mame/drivers/epos.cpp | 11 +++--- src/mame/drivers/ettrivia.cpp | 15 ++++----- src/mame/drivers/fc100.cpp | 12 +++---- src/mame/drivers/flipjack.cpp | 9 +++-- src/mame/drivers/fortecar.cpp | 8 ++--- src/mame/drivers/gamemasters.cpp | 15 +++++---- src/mame/drivers/gluck2.cpp | 8 ++--- src/mame/drivers/gsword.cpp | 6 ++-- src/mame/drivers/halleys.cpp | 20 +++++------ src/mame/drivers/hitpoker.cpp | 8 ++--- src/mame/drivers/homedata.cpp | 24 +++++++------- src/mame/drivers/hotblock.cpp | 8 ++--- src/mame/drivers/icecold.cpp | 30 ++++++++--------- src/mame/drivers/idsa.cpp | 27 +++++++-------- src/mame/drivers/inder.cpp | 12 +++---- src/mame/drivers/jeutel.cpp | 8 ++--- src/mame/drivers/joctronic.cpp | 25 +++++++------- src/mame/drivers/jp.cpp | 8 ++--- src/mame/drivers/kurukuru.cpp | 10 +++--- src/mame/drivers/kyugo.cpp | 11 +++--- src/mame/drivers/ladyfrog.cpp | 10 +++--- src/mame/drivers/lola8a.cpp | 8 ++--- src/mame/drivers/ltcasino.cpp | 8 ++--- src/mame/drivers/marywu.cpp | 16 ++++----- src/mame/drivers/mephistp.cpp | 8 ++--- src/mame/drivers/mgavegas.cpp | 8 ++--- src/mame/drivers/miniboy7.cpp | 8 ++--- src/mame/drivers/mosaic.cpp | 6 ++-- src/mame/drivers/multi8.cpp | 6 ++-- src/mame/drivers/myvision.cpp | 12 +++---- src/mame/drivers/mz2500.cpp | 16 ++++----- src/mame/drivers/pc6001.cpp | 8 ++--- src/mame/drivers/pc8801.cpp | 20 +++++------ src/mame/drivers/pentagon.cpp | 10 +++--- src/mame/drivers/peyper.cpp | 16 ++++----- src/mame/drivers/phc25.cpp | 8 ++--- src/mame/drivers/poker72.cpp | 8 ++--- src/mame/drivers/popeye.cpp | 24 ++++++++------ src/mame/drivers/proconn.cpp | 15 +++++---- src/mame/drivers/re900.cpp | 43 ++++++++++++------------ src/mame/drivers/sanremo.cpp | 6 ++-- src/mame/drivers/shangkid.cpp | 15 ++++----- src/mame/drivers/sothello.cpp | 20 +++++------ src/mame/drivers/spc1000.cpp | 8 ++--- src/mame/drivers/spc1500.cpp | 8 ++--- src/mame/drivers/squale.cpp | 12 +++---- src/mame/drivers/stuntair.cpp | 13 ++++---- src/mame/drivers/supstarf.cpp | 16 ++++----- src/mame/drivers/svi318.cpp | 8 ++--- src/mame/drivers/taxidriv.cpp | 14 ++++---- src/mame/drivers/tickee.cpp | 24 +++++++------- src/mame/drivers/tiki100.cpp | 8 ++--- src/mame/drivers/timex.cpp | 3 +- src/mame/drivers/vd.cpp | 14 ++++---- src/mame/drivers/vega.cpp | 12 +++---- src/mame/drivers/votrpss.cpp | 8 ++--- src/mame/drivers/vroulet.cpp | 12 +++---- src/mame/drivers/x1.cpp | 14 ++++---- src/mame/drivers/x1twin.cpp | 14 ++++---- 84 files changed, 536 insertions(+), 584 deletions(-) diff --git a/src/devices/bus/cbus/pc9801_118.cpp b/src/devices/bus/cbus/pc9801_118.cpp index 78da6ba04c9..96f0d0b4091 100644 --- a/src/devices/bus/cbus/pc9801_118.cpp +++ b/src/devices/bus/cbus/pc9801_118.cpp @@ -39,18 +39,19 @@ WRITE_LINE_MEMBER(pc9801_118_device::sound_irq) // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(pc9801_118_device::device_add_mconfig) +void pc9801_118_device::device_add_mconfig(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("opn3", YM2608, XTAL_5B * 2 / 5) // actually YMF297-F, unknown clock / divider, more likely uses 5D clock - MCFG_YM2608_IRQ_HANDLER(WRITELINE(*this, pc9801_118_device, sound_irq)) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, pc9801_118_device, opn_porta_r)) - //MCFG_AY8910_PORT_B_READ_CB(READ8(*this, pc9801_state, opn_portb_r)) - //MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, pc9801_state, opn_porta_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, pc9801_118_device, opn_portb_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00) -MACHINE_CONFIG_END + YM2608(config, m_opn3, XTAL_5B * 2 / 5); // actually YMF297-F, unknown clock / divider, more likely uses 5D clock + m_opn3->irq_handler().set(FUNC(pc9801_118_device::sound_irq)); + m_opn3->port_a_read_callback().set(FUNC(pc9801_118_device::opn_porta_r)); + //m_opn3->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r)); + //m_opn3->port_a_write_callback().set(FUNC(pc8801_state::opn_porta_w)); + m_opn3->port_b_write_callback().set(FUNC(pc9801_118_device::opn_portb_w)); + m_opn3->add_route(ALL_OUTPUTS, "lspeaker", 1.00); + m_opn3->add_route(ALL_OUTPUTS, "rspeaker", 1.00); +} //------------------------------------------------- diff --git a/src/devices/bus/cbus/pc9801_26.cpp b/src/devices/bus/cbus/pc9801_26.cpp index 729e173bec3..41141476483 100644 --- a/src/devices/bus/cbus/pc9801_26.cpp +++ b/src/devices/bus/cbus/pc9801_26.cpp @@ -36,16 +36,17 @@ WRITE_LINE_MEMBER(pc9801_26_device::sound_irq) // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(pc9801_26_device::device_add_mconfig) +void pc9801_26_device::device_add_mconfig(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("opn", YM2203, 15.9744_MHz_XTAL / 4) // divider not verified - MCFG_YM2203_IRQ_HANDLER(WRITELINE(*this, pc9801_26_device, sound_irq)) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, pc9801_26_device, opn_porta_r)) - //MCFG_AY8910_PORT_B_READ_CB(READ8(*this, pc9801_state, opn_portb_r)) - //MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, pc9801_state, opn_porta_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, pc9801_26_device, opn_portb_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) -MACHINE_CONFIG_END + YM2203(config, m_opn, 15.9744_MHz_XTAL / 4); // divider not verified + m_opn->irq_handler().set(FUNC(pc9801_26_device::sound_irq)); + m_opn->port_a_read_callback().set(FUNC(pc9801_26_device::opn_porta_r)); + //m_opn->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r)); + //m_opn->port_a_write_callback().set(FUNC(pc8801_state::opn_porta_w)); + m_opn->port_b_write_callback().set(FUNC(pc9801_26_device::opn_portb_w)); + m_opn->add_route(ALL_OUTPUTS, "mono", 1.00); +} // to load a different bios for slots: // -cbus0 pc9801_26,bios=N diff --git a/src/devices/bus/cbus/pc9801_86.cpp b/src/devices/bus/cbus/pc9801_86.cpp index 96e159cbc8e..00590f3471f 100644 --- a/src/devices/bus/cbus/pc9801_86.cpp +++ b/src/devices/bus/cbus/pc9801_86.cpp @@ -50,17 +50,16 @@ WRITE_LINE_MEMBER(pc9801_86_device::sound_irq) MACHINE_CONFIG_START(pc9801_86_device::pc9801_86_config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("opna", YM2608, 7.987_MHz_XTAL) - MCFG_YM2608_IRQ_HANDLER(WRITELINE(*this, pc9801_86_device, sound_irq)) - MCFG_AY8910_OUTPUT_TYPE(0) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, pc9801_86_device, opn_porta_r)) - //MCFG_AY8910_PORT_B_READ_CB(READ8(*this, pc9801_state, opn_portb_r)) - //MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, pc9801_state, opn_porta_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, pc9801_86_device, opn_portb_w)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.00) - MCFG_SOUND_ROUTE(0, "rspeaker", 1.00) - MCFG_SOUND_ROUTE(1, "lspeaker", 1.00) - MCFG_SOUND_ROUTE(2, "rspeaker", 1.00) + YM2608(config, m_opna, 7.987_MHz_XTAL); + m_opna->irq_handler().set(FUNC(pc9801_86_device::sound_irq)); + m_opna->port_a_read_callback().set(FUNC(pc9801_86_device::opn_porta_r)); + //m_opna->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r)); + //m_opna->port_a_write_callback().set(FUNC(pc8801_state::opn_porta_w)); + m_opna->port_b_write_callback().set(FUNC(pc9801_86_device::opn_portb_w)); + m_opna->add_route(0, "lspeaker", 1.00); + m_opna->add_route(0, "rspeaker", 1.00); + m_opna->add_route(1, "lspeaker", 1.00); + m_opna->add_route(2, "rspeaker", 1.00); MCFG_DEVICE_ADD("ldac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // burr brown pcm61p MCFG_DEVICE_ADD("rdac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // burr brown pcm61p @@ -386,23 +385,22 @@ pc9801_speakboard_device::pc9801_speakboard_device(const machine_config &mconfig { } -MACHINE_CONFIG_START(pc9801_speakboard_device::device_add_mconfig) +void pc9801_speakboard_device::device_add_mconfig(machine_config &config) +{ pc9801_86_config(config); - MCFG_DEVICE_MODIFY("opna") - MCFG_SOUND_ROUTES_RESET() - MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(0, "rspeaker", 0.50) - MCFG_SOUND_ROUTE(1, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(2, "rspeaker", 0.50) + m_opna->reset_routes(); + m_opna->add_route(0, "lspeaker", 0.50); + m_opna->add_route(0, "rspeaker", 0.50); + m_opna->add_route(1, "lspeaker", 0.50); + m_opna->add_route(2, "rspeaker", 0.50); - MCFG_DEVICE_ADD("opna_slave", YM2608, 7.987_MHz_XTAL) - MCFG_AY8910_OUTPUT_TYPE(0) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(0, "rspeaker", 0.50) - MCFG_SOUND_ROUTE(1, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(2, "rspeaker", 0.50) -MACHINE_CONFIG_END + YM2608(config, m_opna_slave, 7.987_MHz_XTAL); + m_opna_slave->add_route(0, "lspeaker", 0.50); + m_opna_slave->add_route(0, "rspeaker", 0.50); + m_opna_slave->add_route(1, "lspeaker", 0.50); + m_opna_slave->add_route(2, "rspeaker", 0.50); +} void pc9801_speakboard_device::device_start() { diff --git a/src/devices/bus/cbus/pc9801_86.h b/src/devices/bus/cbus/pc9801_86.h index 2042bb0eda3..de3b9190aab 100644 --- a/src/devices/bus/cbus/pc9801_86.h +++ b/src/devices/bus/cbus/pc9801_86.h @@ -51,6 +51,7 @@ protected: void pc9801_86_config(machine_config &config); required_device m_bus; + required_device m_opna; private: int queue_count(); @@ -60,7 +61,6 @@ private: uint8_t m_mask, m_pcm_mode, m_vol[7], m_pcm_ctrl, m_pcm_mute; uint16_t m_head, m_tail, m_count, m_irq_rate; bool m_pcmirq, m_fmirq, m_pcm_clk, m_init; - required_device m_opna; required_device m_ldac; required_device m_rdac; std::vector m_queue; diff --git a/src/devices/bus/cbus/pc9801_amd98.cpp b/src/devices/bus/cbus/pc9801_amd98.cpp index f6114cb2dc7..f7207aabd21 100644 --- a/src/devices/bus/cbus/pc9801_amd98.cpp +++ b/src/devices/bus/cbus/pc9801_amd98.cpp @@ -43,23 +43,24 @@ DEFINE_DEVICE_TYPE(PC9801_AMD98, pc9801_amd98_device, "pc9801_amd98", "pc9801_am // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(pc9801_amd98_device::device_add_mconfig) +void pc9801_amd98_device::device_add_mconfig(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ay1", AY8910, 1'996'800) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("OPN_PA1")) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, pc9801_amd98_device,ay3_address_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) + AY8910(config, m_ay1, 1'996'800); + m_ay1->port_a_read_callback().set_ioport("OPN_PA1"); + m_ay1->port_b_write_callback().set(FUNC(pc9801_amd98_device::ay3_address_w)); + m_ay1->add_route(ALL_OUTPUTS, "lspeaker", 0.50); - MCFG_DEVICE_ADD("ay2", AY8910, 1'996'800) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("OPN_PA2")) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, pc9801_amd98_device,ay3_data_latch_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) + AY8910(config, m_ay2, 1'996'800); + m_ay2->port_a_read_callback().set_ioport("OPN_PA2"); + m_ay2->port_b_write_callback().set(FUNC(pc9801_amd98_device::ay3_data_latch_w)); + m_ay2->add_route(ALL_OUTPUTS, "rspeaker", 0.50); - MCFG_DEVICE_ADD("ay3", AY8910, 1'996'800) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) -MACHINE_CONFIG_END + AY8910(config, m_ay3, 1'996'800); + m_ay3->add_route(ALL_OUTPUTS, "lspeaker", 0.25); + m_ay3->add_route(ALL_OUTPUTS, "rspeaker", 0.25); +} static INPUT_PORTS_START( pc9801_amd98 ) PORT_START("OPN_PA1") diff --git a/src/devices/bus/coco/coco_ssc.cpp b/src/devices/bus/coco/coco_ssc.cpp index 21eab3abc53..1b0abd7217d 100644 --- a/src/devices/bus/coco/coco_ssc.cpp +++ b/src/devices/bus/coco/coco_ssc.cpp @@ -169,9 +169,9 @@ MACHINE_CONFIG_START(coco_ssc_device::device_add_mconfig) m_spo->add_route(ALL_OUTPUTS, "ssc_audio", SP0256_GAIN); m_spo->data_request_callback().set_inputline(m_tms7040, TMS7000_INT1_LINE); - MCFG_DEVICE_ADD(AY_TAG, AY8913, DERIVED_CLOCK(2, 1)) - MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "coco_sac_tag", AY8913_GAIN) + AY8913(config, m_ay, DERIVED_CLOCK(2, 1)); + m_ay->set_flags(AY8910_SINGLE_OUTPUT); + m_ay->add_route(ALL_OUTPUTS, "coco_sac_tag", AY8913_GAIN); MCFG_DEVICE_ADD("coco_sac_tag", COCOSSC_SAC, DERIVED_CLOCK(2, 1)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "ssc_audio", 1.0) diff --git a/src/devices/bus/intv/ecs.cpp b/src/devices/bus/intv/ecs.cpp index 27d100d5864..e1d7f9b0b98 100644 --- a/src/devices/bus/intv/ecs.cpp +++ b/src/devices/bus/intv/ecs.cpp @@ -97,11 +97,11 @@ void intv_ecs_device::late_subslot_setup() MACHINE_CONFIG_START(intv_ecs_device::device_add_mconfig) SPEAKER(config, "mono_ecs").front_center(); - MCFG_DEVICE_ADD("ay8914", AY8914, XTAL(3'579'545)/2) - MCFG_AY8910_PORT_A_READ_CB(READ8("ctrl_port", intvecs_control_port_device, portA_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8("ctrl_port", intvecs_control_port_device, portB_r)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("ctrl_port", intvecs_control_port_device, portA_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono_ecs", 0.33) + AY8914(config, m_snd, XTAL(3'579'545)/2); + m_snd->port_a_read_callback().set("ctrl_port", FUNC(intvecs_control_port_device::portA_r)); + m_snd->port_b_read_callback().set("ctrl_port", FUNC(intvecs_control_port_device::portB_r)); + m_snd->port_a_write_callback().set("ctrl_port", FUNC(intvecs_control_port_device::portA_w)); + m_snd->add_route(ALL_OUTPUTS, "mono_ecs", 0.33); MCFG_INTVECS_CONTROL_PORT_ADD("ctrl_port", intvecs_control_port_devices, "keybd") MCFG_INTV_CARTRIDGE_ADD("subslot", intv_cart, nullptr) diff --git a/src/devices/sound/ay8910.h b/src/devices/sound/ay8910.h index 890d46a3670..29a7ae674d4 100644 --- a/src/devices/sound/ay8910.h +++ b/src/devices/sound/ay8910.h @@ -52,25 +52,6 @@ #define YM2149_PIN26_LOW (0x10) -#define MCFG_AY8910_OUTPUT_TYPE(_flag) \ - downcast(*device).set_flags(_flag); - -#define MCFG_AY8910_RES_LOADS(_res0, _res1, _res2) \ - downcast(*device).set_resistors_load(_res0, _res1, _res2); - -#define MCFG_AY8910_PORT_A_READ_CB(_devcb) \ - downcast(*device).set_port_a_read_callback(DEVCB_##_devcb); - -#define MCFG_AY8910_PORT_B_READ_CB(_devcb) \ - downcast(*device).set_port_b_read_callback(DEVCB_##_devcb); - -#define MCFG_AY8910_PORT_A_WRITE_CB(_devcb) \ - downcast(*device).set_port_a_write_callback(DEVCB_##_devcb); - -#define MCFG_AY8910_PORT_B_WRITE_CB(_devcb) \ - downcast(*device).set_port_b_write_callback(DEVCB_##_devcb); - - class ay8910_device : public device_t, public device_sound_interface { public: @@ -87,10 +68,6 @@ public: void set_flags(int flags) { m_flags = flags; } void set_psg_type(psg_type_t psg_type) { set_type(psg_type); } void set_resistors_load(int res_load0, int res_load1, int res_load2) { m_res_load[0] = res_load0; m_res_load[1] = res_load1; m_res_load[2] = res_load2; } - template devcb_base &set_port_a_read_callback(Object &&cb) { return m_port_a_read_cb.set_callback(std::forward(cb)); } - template devcb_base &set_port_b_read_callback(Object &&cb) { return m_port_b_read_cb.set_callback(std::forward(cb)); } - template devcb_base &set_port_a_write_callback(Object &&cb) { return m_port_a_write_cb.set_callback(std::forward(cb)); } - template devcb_base &set_port_b_write_callback(Object &&cb) { return m_port_b_write_cb.set_callback(std::forward(cb)); } auto port_a_read_callback() { return m_port_a_read_cb.bind(); } auto port_b_read_callback() { return m_port_b_read_cb.bind(); } auto port_a_write_callback() { return m_port_a_write_cb.bind(); } diff --git a/src/mame/audio/mario.cpp b/src/mame/audio/mario.cpp index 6706e8f3b48..f47773f6e9d 100644 --- a/src/mame/audio/mario.cpp +++ b/src/mame/audio/mario.cpp @@ -678,17 +678,16 @@ MACHINE_CONFIG_START(mario_state::mario_audio) MACHINE_CONFIG_END -MACHINE_CONFIG_START(mario_state::masao_audio) - - MCFG_DEVICE_ADD("audiocpu", Z80, 24576000/16) /* ???? */ - MCFG_DEVICE_PROGRAM_MAP(masao_sound_map) +void mario_state::masao_audio(machine_config &config) +{ + Z80(config, m_audiocpu, 24576000/16); /* ???? */ + m_audiocpu->set_addrmap(AS_PROGRAM, &mario_state::masao_sound_map); SPEAKER(config, "mono").front_center(); - MCFG_GENERIC_LATCH_8_ADD("soundlatch") + GENERIC_LATCH_8(config, m_soundlatch); - MCFG_DEVICE_ADD("aysnd", AY8910, 14318000/6) - MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - -MACHINE_CONFIG_END + ay8910_device &aysnd(AY8910(config, "aysnd", 14318000/6)); + aysnd.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/drivers/aces1.cpp b/src/mame/drivers/aces1.cpp index bf2b291152a..a50faea8c79 100644 --- a/src/mame/drivers/aces1.cpp +++ b/src/mame/drivers/aces1.cpp @@ -447,11 +447,11 @@ static INPUT_PORTS_START( aces1 ) INPUT_PORTS_END -MACHINE_CONFIG_START(aces1_state::aces1) - - MCFG_DEVICE_ADD(m_maincpu, Z80, XTAL(8'000'000) / 2 ) /* XTAL verified, divisor not */ - MCFG_DEVICE_PROGRAM_MAP(aces1_map) - MCFG_DEVICE_IO_MAP(aces1_portmap) +void aces1_state::aces1(machine_config &config) +{ + Z80(config, m_maincpu, XTAL(8'000'000) / 2); /* XTAL verified, divisor not */ + m_maincpu->set_addrmap(AS_PROGRAM, &aces1_state::aces1_map); + m_maincpu->set_addrmap(AS_IO, &aces1_state::aces1_portmap); // 0xafb0 IC24 - lamps, 7segs i8255_device &ic24(I8255A(config, "ic24")); @@ -477,10 +477,10 @@ MACHINE_CONFIG_START(aces1_state::aces1) SPEAKER(config, "mono").front_center(); // 0xadf0 - Dips, Sound - MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(8'000'000) / 8) /* XTAL verified, divisor not */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(8'000'000) / 8)); /* XTAL verified, divisor not */ + aysnd.port_a_read_callback().set_ioport("DSWA"); + aysnd.port_b_read_callback().set_ioport("DSWB"); + aysnd.add_route(ALL_OUTPUTS, "mono", 1.00); /* steppers */ REEL(config, m_reel[0], STARPOINT_48STEP_REEL, 1, 3, 0x09, 4); @@ -491,7 +491,7 @@ MACHINE_CONFIG_START(aces1_state::aces1) m_reel[2]->optic_handler().set(FUNC(aces1_state::reel_optic_cb<2>)); REEL(config, m_reel[3], STARPOINT_48STEP_REEL, 1, 3, 0x09, 4); m_reel[3]->optic_handler().set(FUNC(aces1_state::reel_optic_cb<3>)); -MACHINE_CONFIG_END +} ROM_START( ac1clbmn ) diff --git a/src/mame/drivers/aquarius.cpp b/src/mame/drivers/aquarius.cpp index d5bce27b7d2..582f7233628 100644 --- a/src/mame/drivers/aquarius.cpp +++ b/src/mame/drivers/aquarius.cpp @@ -376,10 +376,10 @@ MACHINE_CONFIG_START(aquarius_state::aquarius) MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("ay8910", AY8910, XTAL(3'579'545)/2) // ??? AY-3-8914 - MCFG_AY8910_PORT_A_READ_CB(IOPORT("RIGHT")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("LEFT")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + ay8910_device &ay8910(AY8910(config, "ay8910", XTAL(3'579'545)/2)); // ??? AY-3-8914 + ay8910.port_a_read_callback().set_ioport("RIGHT"); + ay8910.port_b_read_callback().set_ioport("LEFT"); + ay8910.add_route(ALL_OUTPUTS, "mono", 0.25); /* cassette */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/bitgraph.cpp b/src/mame/drivers/bitgraph.cpp index 7da4e8ffb34..0343a8b5a73 100644 --- a/src/mame/drivers/bitgraph.cpp +++ b/src/mame/drivers/bitgraph.cpp @@ -553,9 +553,9 @@ MACHINE_CONFIG_START(bitgraph_state::bg_motherboard) MCFG_DEVICE_ADD(EAROM_TAG, ER2055, 0) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD(PSG_TAG, AY8912, XTAL(1'294'400)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, bitgraph_state, earom_write)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + AY8912(config, m_psg, XTAL(1'294'400)); + m_psg->port_a_write_callback().set(FUNC(bitgraph_state::earom_write)); + m_psg->add_route(ALL_OUTPUTS, "mono", 1.00); MACHINE_CONFIG_END #ifdef UNUSED_FUNCTION diff --git a/src/mame/drivers/bml3.cpp b/src/mame/drivers/bml3.cpp index 1c81b1f7f8e..496afcd23ef 100644 --- a/src/mame/drivers/bml3.cpp +++ b/src/mame/drivers/bml3.cpp @@ -949,18 +949,6 @@ TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::bml3_c ) m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz } -#if 0 -static const ay8910_interface ay8910_config = -{ - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NOOP, // read A - DEVCB_NOOP, // read B - DEVCB_NOOP, // write A - DEVCB_NOOP // write B -}; -#endif - static void bml3_cards(device_slot_interface &device) { device.option_add("bml3mp1802", BML3BUS_MP1802); // MP-1802 Floppy Controller Card @@ -1046,12 +1034,12 @@ MACHINE_CONFIG_START(bml3_state::bml3) #if 0 // TODO: slot device for sound card // audio - MCFG_DEVICE_ADD("ym2203", YM2203, 2000000) //unknown clock / divider - MCFG_YM2203_AY8910_INTF(&ay8910_config) - MCFG_SOUND_ROUTE(0, "mono", 0.25) - MCFG_SOUND_ROUTE(1, "mono", 0.25) - MCFG_SOUND_ROUTE(2, "mono", 0.50) - MCFG_SOUND_ROUTE(3, "mono", 0.50) + YM2203(config, m_ym2203, 2000000); //unknown clock / divider + m_ym2203->set_flags(AY8910_LEGACY_OUTPUT); + m_ym2203->add_route(0, "mono", 0.25); + m_ym2203->add_route(1, "mono", 0.25); + m_ym2203->add_route(2, "mono", 0.50); + m_ym2203->add_route(3, "mono", 0.50); #endif MACHINE_CONFIG_END diff --git a/src/mame/drivers/calomega.cpp b/src/mame/drivers/calomega.cpp index 4b5ff4644ea..b3fdb1416eb 100644 --- a/src/mame/drivers/calomega.cpp +++ b/src/mame/drivers/calomega.cpp @@ -2606,9 +2606,9 @@ MACHINE_CONFIG_START(calomega_state::sys903) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8912", AY8912, SND_CLOCK) /* confirmed */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("SW3")) /* from schematics */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) + ay8912_device &ay8912(AY8912(config, "ay8912", SND_CLOCK)); /* confirmed */ + ay8912.port_a_read_callback().set_ioport("SW3"); /* from schematics */ + ay8912.add_route(ALL_OUTPUTS, "mono", 0.75); /* acia */ ACIA6850(config, m_acia6850_0, 0); @@ -2628,8 +2628,7 @@ MACHINE_CONFIG_START(calomega_state::s903mod) MCFG_DEVICE_PROGRAM_MAP(s903mod_map) /* sound hardware */ - MCFG_DEVICE_MODIFY("ay8912") - MCFG_AY8910_PORT_A_READ_CB(CONSTANT(0)) + subdevice("ay8912")->port_a_read_callback().set_constant(0); MCFG_DEVICE_REMOVE("acia6850_0") @@ -2651,8 +2650,7 @@ MACHINE_CONFIG_START(calomega_state::sys905) m_pia[1]->writepb_handler().set(FUNC(calomega_state::s905_mux_w)); /* sound hardware */ - MCFG_DEVICE_MODIFY("ay8912") - MCFG_AY8910_PORT_A_READ_CB(CONSTANT(0)) + subdevice("ay8912")->port_a_read_callback().set_constant(0); MCFG_DEVICE_REMOVE("acia6850_0") @@ -2682,8 +2680,7 @@ MACHINE_CONFIG_START(calomega_state::sys906) MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_sys906) /* sound hardware */ - MCFG_DEVICE_MODIFY("ay8912") - MCFG_AY8910_PORT_A_READ_CB(IOPORT("SW2")) /* From PCB pic. Value is stored at $0539 */ + subdevice("ay8912")->port_a_read_callback().set_ioport("SW2"); /* From PCB pic. Value is stored at $0539 */ MCFG_DEVICE_REMOVE("acia6850_0") diff --git a/src/mame/drivers/carrera.cpp b/src/mame/drivers/carrera.cpp index 8ed52ba75f6..96f117bf11f 100644 --- a/src/mame/drivers/carrera.cpp +++ b/src/mame/drivers/carrera.cpp @@ -341,11 +341,11 @@ MACHINE_CONFIG_START(carrera_state::carrera) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, MASTER_CLOCK/12) + ay8910_device &aysnd(AY8910(config, "aysnd", MASTER_CLOCK/12)); /* these are set as input, but I have no idea which input port it uses is for the AY */ - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, carrera_state, unknown_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, carrera_state, unknown_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + aysnd.port_a_read_callback().set(FUNC(carrera_state::unknown_r)); + aysnd.port_b_read_callback().set(FUNC(carrera_state::unknown_r)); + aysnd.add_route(ALL_OUTPUTS, "mono", 1.00); MACHINE_CONFIG_END diff --git a/src/mame/drivers/cb2001.cpp b/src/mame/drivers/cb2001.cpp index c0df4f2fa6d..0e1f1cfef79 100644 --- a/src/mame/drivers/cb2001.cpp +++ b/src/mame/drivers/cb2001.cpp @@ -852,10 +852,10 @@ MACHINE_CONFIG_START(cb2001_state::cb2001) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, 1500000) // wrong - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW4")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW5")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ay8910_device &aysnd(AY8910(config, "aysnd", 1500000)); // wrong + aysnd.port_a_read_callback().set_ioport("DSW4"); + aysnd.port_b_read_callback().set_ioport("DSW5"); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END diff --git a/src/mame/drivers/clpoker.cpp b/src/mame/drivers/clpoker.cpp index eaedb21383f..587e946bdfc 100644 --- a/src/mame/drivers/clpoker.cpp +++ b/src/mame/drivers/clpoker.cpp @@ -290,10 +290,10 @@ MACHINE_CONFIG_START(clpoker_state::clpoker) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(12'000'000) / 8) // AY38910A/P, divider not verified - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(12'000'000) / 8)); // AY38910A/P, divider not verified + aysnd.port_a_read_callback().set_ioport("DSW1"); + aysnd.port_b_read_callback().set_ioport("DSW2"); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); MACHINE_CONFIG_END diff --git a/src/mame/drivers/cocoloco.cpp b/src/mame/drivers/cocoloco.cpp index eb1f1d53d47..7e71a0a32b4 100644 --- a/src/mame/drivers/cocoloco.cpp +++ b/src/mame/drivers/cocoloco.cpp @@ -527,13 +527,13 @@ MACHINE_CONFIG_START(cocoloco_state::cocoloco) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, SND_CLOCK) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) - MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT) - MCFG_SOUND_ROUTE(0, "snd_nl", 1.0, 0) - MCFG_SOUND_ROUTE(1, "snd_nl", 1.0, 1) - MCFG_SOUND_ROUTE(2, "snd_nl", 1.0, 2) + ay8910_device &ay8910(AY8910(config, "ay8910", SND_CLOCK)); + ay8910.port_a_read_callback().set_ioport("DSW1"); + ay8910.port_b_read_callback().set_ioport("DSW2"); + ay8910.set_flags(AY8910_RESISTOR_OUTPUT); + ay8910.add_route(0, "snd_nl", 1.0, 0); + ay8910.add_route(1, "snd_nl", 1.0, 1); + ay8910.add_route(2, "snd_nl", 1.0, 2); /* NETLIST configuration using internal AY8910 resistor values */ diff --git a/src/mame/drivers/coinmstr.cpp b/src/mame/drivers/coinmstr.cpp index 2fc4f6ec92e..555a42a4ed0 100644 --- a/src/mame/drivers/coinmstr.cpp +++ b/src/mame/drivers/coinmstr.cpp @@ -1291,9 +1291,9 @@ MACHINE_CONFIG_START(coinmstr_state::coinmstr) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, SND_CLOCK) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + ay8910_device &aysnd(AY8910(config, "aysnd", SND_CLOCK)); + aysnd.port_a_read_callback().set_ioport("DSW1"); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END MACHINE_CONFIG_START(coinmstr_state::quizmstr) diff --git a/src/mame/drivers/dfruit.cpp b/src/mame/drivers/dfruit.cpp index 59d9707773a..4e542240a84 100644 --- a/src/mame/drivers/dfruit.cpp +++ b/src/mame/drivers/dfruit.cpp @@ -404,10 +404,10 @@ MACHINE_CONFIG_START(dfruit_state::dfruit) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("opn", YM2203, MASTER_CLOCK/4) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("IN4")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN5")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + ym2203_device &opn(YM2203(config, "opn", MASTER_CLOCK/4)); + opn.port_a_read_callback().set_ioport("IN4"); + opn.port_b_read_callback().set_ioport("IN5"); + opn.add_route(ALL_OUTPUTS, "mono", 0.30); MACHINE_CONFIG_END /*************************************************************************** diff --git a/src/mame/drivers/dominob.cpp b/src/mame/drivers/dominob.cpp index 67e9431691f..05e2fb172e4 100644 --- a/src/mame/drivers/dominob.cpp +++ b/src/mame/drivers/dominob.cpp @@ -187,8 +187,8 @@ void dominob_state::memmap(address_map &map) map(0x0000, 0xbfff).rom().nopw(); // there are some garbage writes to ROM map(0xc000, 0xc7ff).ram(); - map(0xd000, 0xd001).w("aysnd", FUNC(ay8910_device::address_data_w)); - map(0xd001, 0xd001).r("aysnd", FUNC(ay8910_device::data_r)); + map(0xd000, 0xd001).w("aysnd", FUNC(ym2149_device::address_data_w)); + map(0xd001, 0xd001).r("aysnd", FUNC(ym2149_device::data_r)); map(0xd008, 0xd008).w(FUNC(dominob_state::dominob_d008_w)); map(0xd00c, 0xd00c).portr("IN0"); map(0xd010, 0xd010).portr("IN1").nopw(); @@ -321,9 +321,9 @@ MACHINE_CONFIG_START(dominob_state::dominob) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(12'000'000)/4) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + ym2149_device &aysnd(YM2149(config, "aysnd", XTAL(12'000'000)/4)); + aysnd.port_b_read_callback().set_ioport("DSW"); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); MACHINE_CONFIG_END /*************************************************************************** diff --git a/src/mame/drivers/dragon.cpp b/src/mame/drivers/dragon.cpp index 2a6657b40c0..c71602fe078 100644 --- a/src/mame/drivers/dragon.cpp +++ b/src/mame/drivers/dragon.cpp @@ -339,10 +339,10 @@ MACHINE_CONFIG_START(dragon_alpha_state::dgnalpha) MCFG_FLOPPY_DRIVE_SOUND(true) // sound hardware - MCFG_DEVICE_ADD(AY8912_TAG, AY8912, 1000000) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, dragon_alpha_state, psg_porta_read)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, dragon_alpha_state, psg_porta_write)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75) + ay8912_device &ay8912(AY8912(config, AY8912_TAG, 1000000)); + ay8912.port_a_read_callback().set(FUNC(dragon_alpha_state::psg_porta_read)); + ay8912.port_a_write_callback().set(FUNC(dragon_alpha_state::psg_porta_write)); + ay8912.add_route(ALL_OUTPUTS, "speaker", 0.75); // pia 2 pia6821_device &pia2(PIA6821(config, PIA2_TAG, 0)); diff --git a/src/mame/drivers/dwarfd.cpp b/src/mame/drivers/dwarfd.cpp index c8abf018049..fba7b069a75 100644 --- a/src/mame/drivers/dwarfd.cpp +++ b/src/mame/drivers/dwarfd.cpp @@ -760,10 +760,10 @@ MACHINE_CONFIG_START(dwarfd_state::dwarfd) MCFG_PALETTE_INIT_OWNER(dwarfd_state, dwarfd) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, 1500000) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("IN2")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + ay8910_device &aysnd(AY8910(config, "aysnd", 1500000)); + aysnd.port_a_read_callback().set_ioport("IN2"); + aysnd.port_b_read_callback().set_ioport("IN1"); + aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); MACHINE_CONFIG_END MACHINE_CONFIG_START(dwarfd_state::pokeresp) diff --git a/src/mame/drivers/efdt.cpp b/src/mame/drivers/efdt.cpp index 522451ba8c5..70cadeb523a 100644 --- a/src/mame/drivers/efdt.cpp +++ b/src/mame/drivers/efdt.cpp @@ -582,19 +582,19 @@ MACHINE_CONFIG_START( efdt_state::efdt ) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay1", AY8910, AY8910_CLOCK) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, efdt_state, soundlatch_0_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, efdt_state, soundlatch_1_r)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, efdt_state, soundlatch_0_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, efdt_state, soundlatch_1_w)) + ay8910_device &ay1(AY8910(config, "ay1", AY8910_CLOCK)); + ay1.add_route(ALL_OUTPUTS, "mono", 1.0); + ay1.port_a_read_callback().set(FUNC(efdt_state::soundlatch_0_r)); + ay1.port_b_read_callback().set(FUNC(efdt_state::soundlatch_1_r)); + ay1.port_a_write_callback().set(FUNC(efdt_state::soundlatch_0_w)); + ay1.port_b_write_callback().set(FUNC(efdt_state::soundlatch_1_w)); - MCFG_DEVICE_ADD("ay2", AY8910, AY8910_CLOCK) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, efdt_state, soundlatch_2_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, efdt_state, soundlatch_3_r)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, efdt_state, soundlatch_2_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, efdt_state, soundlatch_3_w)) + ay8910_device &ay2(AY8910(config, "ay2", AY8910_CLOCK)); + ay2.add_route(ALL_OUTPUTS, "mono", 1.0); + ay2.port_a_read_callback().set(FUNC(efdt_state::soundlatch_2_r)); + ay2.port_b_read_callback().set(FUNC(efdt_state::soundlatch_3_r)); + ay2.port_a_write_callback().set(FUNC(efdt_state::soundlatch_2_w)); + ay2.port_b_write_callback().set(FUNC(efdt_state::soundlatch_3_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp index 8ab0ba8b198..0a8cd815e1b 100644 --- a/src/mame/drivers/einstein.cpp +++ b/src/mame/drivers/einstein.cpp @@ -619,10 +619,10 @@ MACHINE_CONFIG_START(einstein_state::einstein) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD(IC_I030, AY8910, XTAL_X002 / 4) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, einstein_state, keyboard_data_read)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, einstein_state, keyboard_line_write)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) + AY8910(config, m_psg, XTAL_X002 / 4); + m_psg->port_b_read_callback().set(FUNC(einstein_state::keyboard_data_read)); + m_psg->port_a_write_callback().set(FUNC(einstein_state::keyboard_line_write)); + m_psg->add_route(ALL_OUTPUTS, "mono", 0.20); adc0844_device &adc(ADC0844(config, "adc", 0)); adc.intr_callback().set(m_adc_daisy, FUNC(z80daisy_generic_device::int_w)); diff --git a/src/mame/drivers/epos.cpp b/src/mame/drivers/epos.cpp index 4b60990ed01..319e88a202d 100644 --- a/src/mame/drivers/epos.cpp +++ b/src/mame/drivers/epos.cpp @@ -480,8 +480,7 @@ MACHINE_CONFIG_START(epos_state::epos) /* EPOS TRISTAR 8000 PCB */ /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8912, XTAL(11'000'000)/16) /* 0.6875 MHz, confirmed from schematics */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + AY8912(config, "aysnd", XTAL(11'000'000)/16).add_route(ALL_OUTPUTS, "mono", 1.0); /* 0.6875 MHz, confirmed from schematics */ MACHINE_CONFIG_END @@ -517,11 +516,11 @@ MACHINE_CONFIG_START(epos_state::dealer) /* EPOS TRISTAR 9000 PCB */ /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(22'118'400)/32) /* 0.6912 MHz (measured) */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, epos_state, ay_porta_mpx_r)) + ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(22'118'400)/32)); /* 0.6912 MHz (measured) */ + aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); + aysnd.port_a_read_callback().set(FUNC(epos_state::ay_porta_mpx_r)); // port a writes? - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, epos_state, flip_screen_w)) // flipscreen and ay port a multiplex control + aysnd.port_b_write_callback().set(FUNC(epos_state::flip_screen_w)); // flipscreen and ay port a multiplex control MACHINE_CONFIG_END diff --git a/src/mame/drivers/ettrivia.cpp b/src/mame/drivers/ettrivia.cpp index 2caa8c5b747..6575021ede4 100644 --- a/src/mame/drivers/ettrivia.cpp +++ b/src/mame/drivers/ettrivia.cpp @@ -321,16 +321,15 @@ MACHINE_CONFIG_START(ettrivia_state::ettrivia) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay1", AY8912, 1500000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + AY8912(config, m_ay[0], 1500000).add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("ay2", AY8912, 1500000) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("IN1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + AY8912(config, m_ay[1], 1500000); + m_ay[1]->port_a_read_callback().set_ioport("IN1"); + m_ay[1]->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("ay3", AY8912, 1500000) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("IN0")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + AY8912(config, m_ay[2], 1500000); + m_ay[2]->port_a_read_callback().set_ioport("IN0"); + m_ay[2]->add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END ROM_START( promutrv ) diff --git a/src/mame/drivers/fc100.cpp b/src/mame/drivers/fc100.cpp index 44690eb1a6c..a0bfc9e39ac 100644 --- a/src/mame/drivers/fc100.cpp +++ b/src/mame/drivers/fc100.cpp @@ -535,12 +535,12 @@ MACHINE_CONFIG_START(fc100_state::fc100) /* sound hardware */ SPEAKER(config, "mono").front_center(); WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); - MCFG_DEVICE_ADD("psg", AY8910, XTAL(7'159'090)/3/2) /* AY-3-8910 - clock not verified */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY0")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("JOY1")) - //MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, fc100_state, ay_port_a_w)) - //MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, fc100_state, ay_port_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50) + ay8910_device &psg(AY8910(config, "psg", XTAL(7'159'090)/3/2)); /* AY-3-8910 - clock not verified */ + psg.port_a_read_callback().set_ioport("JOY0"); + psg.port_b_read_callback().set_ioport("JOY1"); + //psg.port_a_write_callback().set(FUNC(fc100_state::ay_port_a_w)); + //psg.port_b_write_callback().set(FUNC(fc100_state::ay_port_b_w)); + psg.add_route(ALL_OUTPUTS, "mono", 1.50); /* Devices */ MCFG_CASSETTE_ADD("cassette") diff --git a/src/mame/drivers/flipjack.cpp b/src/mame/drivers/flipjack.cpp index ad9fa153f72..837adeb2fed 100644 --- a/src/mame/drivers/flipjack.cpp +++ b/src/mame/drivers/flipjack.cpp @@ -460,12 +460,11 @@ MACHINE_CONFIG_START(flipjack_state::flipjack) GENERIC_LATCH_8(config, m_soundlatch); - MCFG_DEVICE_ADD("ay1", AY8910, MASTER_CLOCK/8) - MCFG_AY8910_PORT_A_READ_CB(READ8(m_soundlatch, generic_latch_8_device, read)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ay8910_device &ay1(AY8910(config, "ay1", MASTER_CLOCK/8)); + ay1.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); + ay1.add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_ADD("ay2", AY8910, MASTER_CLOCK/8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + AY8910(config, "ay2", MASTER_CLOCK/8).add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END diff --git a/src/mame/drivers/fortecar.cpp b/src/mame/drivers/fortecar.cpp index 1309531ef47..10341bb3b68 100644 --- a/src/mame/drivers/fortecar.cpp +++ b/src/mame/drivers/fortecar.cpp @@ -723,10 +723,10 @@ MACHINE_CONFIG_START(fortecar_state::fortecar) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, AY_CLOCK) /* 1.5 MHz, measured */ - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, fortecar_state, ayporta_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, fortecar_state, ayportb_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ay8910_device &aysnd(AY8910(config, "aysnd", AY_CLOCK)); /* 1.5 MHz, measured */ + aysnd.port_a_write_callback().set(FUNC(fortecar_state::ayporta_w)); + aysnd.port_b_write_callback().set(FUNC(fortecar_state::ayportb_w)); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END diff --git a/src/mame/drivers/gamemasters.cpp b/src/mame/drivers/gamemasters.cpp index ef6262e9381..551439970e3 100644 --- a/src/mame/drivers/gamemasters.cpp +++ b/src/mame/drivers/gamemasters.cpp @@ -76,19 +76,20 @@ void gamemasters_state::mem_map(address_map &map) } -MACHINE_CONFIG_START(gamemasters_state::gmsshoot) - MCFG_DEVICE_ADD("maincpu", R65C02, 4_MHz_XTAL / 4) // divider not verified - MCFG_DEVICE_PROGRAM_MAP(mem_map) +void gamemasters_state::gmsshoot(machine_config &config) +{ + R65C02(config, m_maincpu, 4_MHz_XTAL / 4); // divider not verified + m_maincpu->set_addrmap(AS_PROGRAM, &gamemasters_state::mem_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // MK48Z02B-25 // LCD video? SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8912, 4_MHz_XTAL / 4) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) -MACHINE_CONFIG_END + ay8912_device &aysnd(AY8912(config, "aysnd", 4_MHz_XTAL / 4)); + aysnd.port_a_read_callback().set_ioport("DSW"); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); +} static INPUT_PORTS_START(gmsshoot) diff --git a/src/mame/drivers/gluck2.cpp b/src/mame/drivers/gluck2.cpp index dec80e19483..0bc57fa355b 100644 --- a/src/mame/drivers/gluck2.cpp +++ b/src/mame/drivers/gluck2.cpp @@ -515,13 +515,13 @@ MACHINE_CONFIG_START(gluck2_state::gluck2) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, MASTER_CLOCK/8) /* guess */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("SW3")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("SW2")) + ay8910_device &ay8910(AY8910(config, "ay8910", MASTER_CLOCK/8)); /* guess */ + ay8910.port_a_read_callback().set_ioport("SW3"); + ay8910.port_b_read_callback().set_ioport("SW2"); /* Output ports have a minimal activity during init. They seems unused (at least for Good Luck II) */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + ay8910.add_route(ALL_OUTPUTS, "mono", 1.0); MCFG_DEVICE_ADD("ymsnd", YM2413, SND_CLOCK) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) diff --git a/src/mame/drivers/gsword.cpp b/src/mame/drivers/gsword.cpp index e56c263bced..99326bdaa72 100644 --- a/src/mame/drivers/gsword.cpp +++ b/src/mame/drivers/gsword.cpp @@ -893,11 +893,9 @@ MACHINE_CONFIG_START(josvolly_state::josvolly) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay1", AY8910, 1500000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + AY8910(config, m_ay0, 1500000).add_route(ALL_OUTPUTS, "mono", 0.30); - MCFG_DEVICE_ADD("ay2", AY8910, 1500000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + AY8910(config, m_ay1, 1500000).add_route(ALL_OUTPUTS, "mono", 0.30); #if 0 MCFG_DEVICE_ADD("msm", MSM5205, 384000) diff --git a/src/mame/drivers/halleys.cpp b/src/mame/drivers/halleys.cpp index 997e261bb31..9078e189656 100644 --- a/src/mame/drivers/halleys.cpp +++ b/src/mame/drivers/halleys.cpp @@ -1667,12 +1667,12 @@ void halleys_state::sound_map(address_map &map) { map(0x0000, 0x3fff).rom(); map(0x4000, 0x47ff).ram(); - map(0x4800, 0x4801).w("ay2", FUNC(ay8910_device::address_data_w)); - map(0x4801, 0x4801).r("ay2", FUNC(ay8910_device::data_r)); - map(0x4802, 0x4803).w("ay3", FUNC(ay8910_device::address_data_w)); - map(0x4803, 0x4803).r("ay3", FUNC(ay8910_device::data_r)); - map(0x4804, 0x4805).w("ay4", FUNC(ay8910_device::address_data_w)); - map(0x4805, 0x4805).r("ay4", FUNC(ay8910_device::data_r)); + map(0x4800, 0x4801).w("ay2", FUNC(ym2149_device::address_data_w)); + map(0x4801, 0x4801).r("ay2", FUNC(ym2149_device::data_r)); + map(0x4802, 0x4803).w("ay3", FUNC(ym2149_device::address_data_w)); + map(0x4803, 0x4803).r("ay3", FUNC(ym2149_device::data_r)); + map(0x4804, 0x4805).w("ay4", FUNC(ym2149_device::address_data_w)); + map(0x4805, 0x4805).r("ay4", FUNC(ym2149_device::data_r)); map(0x5000, 0x5000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); map(0xe000, 0xefff).rom(); // space for diagnostic ROM } @@ -1957,13 +1957,13 @@ MACHINE_CONFIG_START(halleys_state::halleys) GENERIC_LATCH_8(config, m_soundlatch); - AY8910(config, "ay1", XTAL(6'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.15); /* verified on pcb */ + YM2149(config, "ay1", XTAL(6'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.15); /* verified on pcb */ - AY8910(config, "ay2", XTAL(6'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.15); /* verified on pcb */ + YM2149(config, "ay2", XTAL(6'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.15); /* verified on pcb */ - AY8910(config, "ay3", XTAL(6'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.15); /* verified on pcb */ + YM2149(config, "ay3", XTAL(6'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.15); /* verified on pcb */ - ay8910_device &ay4(AY8910(config, "ay4", XTAL(6'000'000)/4)); /* verified on pcb */ + ym2149_device &ay4(YM2149(config, "ay4", XTAL(6'000'000)/4)); /* verified on pcb */ ay4.port_b_write_callback().set(FUNC(halleys_state::sndnmi_msk_w)); ay4.add_route(ALL_OUTPUTS, "mono", 0.15); MACHINE_CONFIG_END diff --git a/src/mame/drivers/hitpoker.cpp b/src/mame/drivers/hitpoker.cpp index 7c63dae816e..1328d2429e5 100644 --- a/src/mame/drivers/hitpoker.cpp +++ b/src/mame/drivers/hitpoker.cpp @@ -489,10 +489,10 @@ MACHINE_CONFIG_START(hitpoker_state::hitpoker) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", YM2149, 1500000) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ym2149_device &aysnd(YM2149(config, "aysnd", 1500000)); + aysnd.port_a_read_callback().set_ioport("DSW1"); + aysnd.port_b_read_callback().set_ioport("DSW2"); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END void hitpoker_state::init_hitpoker() diff --git a/src/mame/drivers/homedata.cpp b/src/mame/drivers/homedata.cpp index 863d2bdb4cd..c3b83d15c18 100644 --- a/src/mame/drivers/homedata.cpp +++ b/src/mame/drivers/homedata.cpp @@ -1300,13 +1300,13 @@ MACHINE_CONFIG_START(homedata_state::reikaids) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2203, 3000000) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) - MCFG_SOUND_ROUTE(0, "speaker", 0.25) - MCFG_SOUND_ROUTE(1, "speaker", 0.25) - MCFG_SOUND_ROUTE(2, "speaker", 0.25) - MCFG_SOUND_ROUTE(3, "speaker", 1.0) + YM2203(config, m_ymsnd, 3000000); + m_ymsnd->port_a_read_callback().set_ioport("DSW1"); + m_ymsnd->port_b_read_callback().set_ioport("DSW2"); + m_ymsnd->add_route(0, "speaker", 0.25); + m_ymsnd->add_route(1, "speaker", 0.25); + m_ymsnd->add_route(2, "speaker", 0.25); + m_ymsnd->add_route(3, "speaker", 1.0); MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) @@ -1527,11 +1527,11 @@ MACHINE_CONFIG_START(homedata_state::mirderby) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2203, 2000000) - MCFG_SOUND_ROUTE(0, "speaker", 0.25) - MCFG_SOUND_ROUTE(1, "speaker", 0.25) - MCFG_SOUND_ROUTE(2, "speaker", 0.25) - MCFG_SOUND_ROUTE(3, "speaker", 1.0) + YM2203(config, m_ymsnd, 2000000); + m_ymsnd->add_route(0, "speaker", 0.25); + m_ymsnd->add_route(1, "speaker", 0.25); + m_ymsnd->add_route(2, "speaker", 0.25); + m_ymsnd->add_route(3, "speaker", 1.0); MACHINE_CONFIG_END /**************************************************************************/ diff --git a/src/mame/drivers/hotblock.cpp b/src/mame/drivers/hotblock.cpp index 0083304783d..332e36140e6 100644 --- a/src/mame/drivers/hotblock.cpp +++ b/src/mame/drivers/hotblock.cpp @@ -228,10 +228,10 @@ MACHINE_CONFIG_START(hotblock_state::hotblock) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", YM2149, 24_MHz_XTAL / 24) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ym2149_device &aysnd(YM2149(config, "aysnd", 24_MHz_XTAL / 24)); + aysnd.port_a_read_callback().set_ioport("P1"); + aysnd.port_b_read_callback().set_ioport("P2"); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END ROM_START( hotblock ) diff --git a/src/mame/drivers/icecold.cpp b/src/mame/drivers/icecold.cpp index 85a5c3f95d6..a273f44e262 100644 --- a/src/mame/drivers/icecold.cpp +++ b/src/mame/drivers/icecold.cpp @@ -362,11 +362,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(icecold_state::icecold_motors_timer) } } -MACHINE_CONFIG_START(icecold_state::icecold) - +void icecold_state::icecold(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", MC6809E, XTAL(6'000'000)/4) // 68A09E - MCFG_DEVICE_PROGRAM_MAP(icecold_map) + MC6809E(config, m_maincpu, XTAL(6'000'000)/4); // 68A09E + m_maincpu->set_addrmap(AS_PROGRAM, &icecold_state::icecold_map); pia6821_device &pia0(PIA6821(config, "pia0", 0)); pia0.readpa_handler().set_ioport("JOY"); @@ -392,26 +392,26 @@ MACHINE_CONFIG_START(icecold_state::icecold) kbdc.in_rl_callback().set(FUNC(icecold_state::kbd_r)); // kbd RL lines // 30Hz signal from CH-C of ay0 - MCFG_TIMER_DRIVER_ADD_PERIODIC("sint_timer", icecold_state, icecold_sint_timer, attotime::from_hz(30)) + TIMER(config, "sint_timer", 0).configure_periodic(timer_device::expired_delegate(FUNC(icecold_state::icecold_sint_timer), this), attotime::from_hz(30)); // for update motors position - MCFG_TIMER_DRIVER_ADD_PERIODIC("motors_timer", icecold_state, icecold_motors_timer, attotime::from_msec(50)) + TIMER(config, "motors_timer", 0).configure_periodic(timer_device::expired_delegate(FUNC(icecold_state::icecold_motors_timer), this), attotime::from_msec(50)); // video hardware config.set_default_layout(layout_icecold); // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay0", AY8910, XTAL(6'000'000)/4) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW4")) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, icecold_state, ay8910_0_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + AY8910(config, m_ay8910[0], XTAL(6'000'000)/4); + m_ay8910[0]->port_a_read_callback().set_ioport("DSW4"); + m_ay8910[0]->port_b_write_callback().set(FUNC(icecold_state::ay8910_0_b_w)); + m_ay8910[0]->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("ay1", AY8910, XTAL(6'000'000)/4) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, icecold_state, ay8910_1_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, icecold_state, ay8910_1_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + AY8910(config, m_ay8910[1], XTAL(6'000'000)/4); + m_ay8910[1]->port_a_write_callback().set(FUNC(icecold_state::ay8910_1_a_w)); + m_ay8910[1]->port_b_write_callback().set(FUNC(icecold_state::ay8910_1_b_w)); + m_ay8910[1]->add_route(ALL_OUTPUTS, "mono", 0.25); +} /*------------------------------------------------------------------- / Ice Cold Beer diff --git a/src/mame/drivers/idsa.cpp b/src/mame/drivers/idsa.cpp index b73051d0867..dc570538a7b 100644 --- a/src/mame/drivers/idsa.cpp +++ b/src/mame/drivers/idsa.cpp @@ -351,22 +351,23 @@ MACHINE_CONFIG_START(idsa_state::idsa) SP0256(config, m_speech, 3120000); // unknown variant m_speech->add_route(ALL_OUTPUTS, "lspeaker", 1.5); - MCFG_DEVICE_ADD("aysnd1", AY8910, 2000000) // 2Mhz according to pinmame, schematic omits the clock line - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.75) + ay8910_device &aysnd1(AY8910(config, "aysnd1", 2000000)); // 2Mhz according to pinmame, schematic omits the clock line + aysnd1.port_a_write_callback().set(FUNC(idsa_state::ay1_a_w)); + aysnd1.port_b_write_callback().set(FUNC(idsa_state::ay1_b_w)); + aysnd1.add_route(ALL_OUTPUTS, "lspeaker", 0.75); - MCFG_DEVICE_ADD("aysnd2", AY8910, 2000000) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, idsa_state, ay1_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, idsa_state, ay1_b_w)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, idsa_state, ay2_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, idsa_state, ay2_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.75) + ay8910_device &aysnd2(AY8910(config, "aysnd2", 2000000)); + aysnd2.port_a_write_callback().set(FUNC(idsa_state::ay2_a_w)); + aysnd2.port_b_write_callback().set(FUNC(idsa_state::ay2_b_w)); + aysnd2.add_route(ALL_OUTPUTS, "rspeaker", 0.75); MACHINE_CONFIG_END -MACHINE_CONFIG_START(idsa_state::bsktbllp) +void idsa_state::bsktbllp(machine_config &config) +{ idsa(config); - MCFG_DEVICE_MODIFY("aysnd1") - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, idsa_state, ppi_control_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, idsa_state, ppi_data_w)) + auto &aysnd1(*subdevice("aysnd1")); + aysnd1.port_a_write_callback().set(FUNC(idsa_state::ppi_control_w)); + aysnd1.port_b_write_callback().set(FUNC(idsa_state::ppi_data_w)); I8255(config, m_ppi[0]); m_ppi[0]->out_pa_callback().set(FUNC(idsa_state::ppi1_a_w)); @@ -377,7 +378,7 @@ MACHINE_CONFIG_START(idsa_state::bsktbllp) m_ppi[1]->out_pa_callback().set(FUNC(idsa_state::ppi2_a_w)); m_ppi[1]->out_pb_callback().set(FUNC(idsa_state::ppi2_b_w)); m_ppi[1]->out_pc_callback().set(FUNC(idsa_state::ppi2_c_w)); -MACHINE_CONFIG_END +} ROM_START(v1) diff --git a/src/mame/drivers/inder.cpp b/src/mame/drivers/inder.cpp index 2378c5d420a..76811d220f9 100644 --- a/src/mame/drivers/inder.cpp +++ b/src/mame/drivers/inder.cpp @@ -1389,8 +1389,7 @@ MACHINE_CONFIG_START(inder_state::canasta) /* Sound */ genpin_audio(config); SPEAKER(config, "ayvol").front_center(); - MCFG_DEVICE_ADD("ay", AY8910, XTAL(4'000'000) / 2) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "ayvol", 1.0) + AY8910(config, "ay", XTAL(4'000'000) / 2).add_route(ALL_OUTPUTS, "ayvol", 1.0); MACHINE_CONFIG_END MACHINE_CONFIG_START(inder_state::lapbylap) @@ -1410,11 +1409,10 @@ MACHINE_CONFIG_START(inder_state::lapbylap) /* Sound */ genpin_audio(config); SPEAKER(config, "ayvol").front_center(); - MCFG_DEVICE_ADD("ay1", AY8910, XTAL(2'000'000)) // same xtal that drives subcpu - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "ayvol", 1.0) - MCFG_DEVICE_ADD("ay2", AY8910, XTAL(2'000'000)) // same xtal that drives subcpu - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, inder_state, sndcmd_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "ayvol", 1.0) + AY8910(config, "ay1", XTAL(2'000'000)).add_route(ALL_OUTPUTS, "ayvol", 1.0); // same xtal that drives subcpu + ay8910_device &ay2(AY8910(config, "ay2", XTAL(2'000'000))); // same xtal that drives subcpu + ay2.port_a_read_callback().set(FUNC(inder_state::sndcmd_r)); + ay2.add_route(ALL_OUTPUTS, "ayvol", 1.0); MACHINE_CONFIG_END MACHINE_CONFIG_START(inder_state::inder) diff --git a/src/mame/drivers/jeutel.cpp b/src/mame/drivers/jeutel.cpp index 2993eca74d7..175737bc586 100644 --- a/src/mame/drivers/jeutel.cpp +++ b/src/mame/drivers/jeutel.cpp @@ -217,10 +217,10 @@ MACHINE_CONFIG_START(jeutel_state::jeutel) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, 639450) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, jeutel_state,porta_w)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, jeutel_state,portb_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) + ay8910_device &aysnd(AY8910(config, "aysnd", 639450)); + aysnd.port_a_write_callback().set(FUNC(jeutel_state::porta_w)); + aysnd.port_b_read_callback().set(FUNC(jeutel_state::portb_r)); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.40); MCFG_DEVICE_ADD("tms", TMS5110A, 640000) //MCFG_TMS5110_M0_CB(WRITELINE("tmsprom", tmsprom_device, m0_w)) diff --git a/src/mame/drivers/joctronic.cpp b/src/mame/drivers/joctronic.cpp index 1132ff95d38..5e681b158bd 100644 --- a/src/mame/drivers/joctronic.cpp +++ b/src/mame/drivers/joctronic.cpp @@ -366,13 +366,12 @@ MACHINE_CONFIG_START(joctronic_state::joctronic) SPEAKER(config, "mono").front_center(); // Datasheet suggests YM2203 as a possible replacement for this AY8910 - MCFG_DEVICE_ADD("aysnd1", AY8910, XTAL(12'000'000)/8) // 1.5 MHz - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("r2r1", dac_8bit_r2r_device, data_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("r2r2", dac_8bit_r2r_device, data_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) + ay8910_device &aysnd1(AY8910(config, "aysnd1", XTAL(12'000'000)/8)); // 1.5 MHz + aysnd1.port_a_write_callback().set("r2r1", FUNC(dac_8bit_r2r_device::data_w)); + aysnd1.port_b_write_callback().set("r2r2", FUNC(dac_8bit_r2r_device::data_w)); + aysnd1.add_route(ALL_OUTPUTS, "mono", 0.40); - MCFG_DEVICE_ADD("aysnd2", AY8910, XTAL(12'000'000)/8) // 1.5 MHz - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) + AY8910(config, "aysnd2", XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.40); // 1.5 MHz MCFG_DEVICE_ADD("r2r1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) @@ -413,14 +412,14 @@ MACHINE_CONFIG_START(joctronic_state::slalom03) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd1", AY8910, XTAL(12'000'000)/8) // 1.5 MHz - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, joctronic_state, slalom03_oki_bank_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("adpcm_select", ls157_device, ba_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) + ay8910_device &aysnd1(AY8910(config, "aysnd1", XTAL(12'000'000)/8)); // 1.5 MHz + aysnd1.port_a_write_callback().set(FUNC(joctronic_state::slalom03_oki_bank_w)); + aysnd1.port_b_write_callback().set(m_adpcm_select, FUNC(ls157_device::ba_w)); + aysnd1.add_route(ALL_OUTPUTS, "mono", 0.40); - MCFG_DEVICE_ADD("aysnd2", AY8910, XTAL(12'000'000)/8) // 1.5 MHz - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("r2r", dac_8bit_r2r_device, data_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) + ay8910_device &aysnd2(AY8910(config, "aysnd2", XTAL(12'000'000)/8)); // 1.5 MHz + aysnd2.port_a_write_callback().set("r2r", FUNC(dac_8bit_r2r_device::data_w)); + aysnd2.add_route(ALL_OUTPUTS, "mono", 0.40); MCFG_DEVICE_ADD("r2r", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) diff --git a/src/mame/drivers/jp.cpp b/src/mame/drivers/jp.cpp index 5e79fd57b5b..249c23bc588 100644 --- a/src/mame/drivers/jp.cpp +++ b/src/mame/drivers/jp.cpp @@ -374,10 +374,10 @@ MACHINE_CONFIG_START(jp_state::jp) /* Sound */ genpin_audio(config); SPEAKER(config, "ayvol").front_center(); - MCFG_DEVICE_ADD("ay", AY8910, 8_MHz_XTAL / 4) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, jp_state, porta_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, jp_state, portb_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "ayvol", 0.9) + ay8910_device &ay(AY8910(config, "ay", 8_MHz_XTAL / 4)); + ay.port_a_read_callback().set(FUNC(jp_state::porta_r)); + ay.port_b_read_callback().set(FUNC(jp_state::portb_r)); + ay.add_route(ALL_OUTPUTS, "ayvol", 0.9); MACHINE_CONFIG_END WRITE8_MEMBER(jp_state::sample_bank_w) diff --git a/src/mame/drivers/kurukuru.cpp b/src/mame/drivers/kurukuru.cpp index a9d6e5a692c..47157c2ff0b 100644 --- a/src/mame/drivers/kurukuru.cpp +++ b/src/mame/drivers/kurukuru.cpp @@ -873,11 +873,11 @@ MACHINE_CONFIG_START(kurukuru_state::kurukuru) // if both are asserted, the vector becomes $f7 AND $ef = $e7 (rst $20) RST_NEG_BUFFER(config, m_soundirq, 0).int_callback().set_inputline(m_audiocpu, 0); - MCFG_DEVICE_ADD("ym2149", YM2149, YM2149_CLOCK) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, kurukuru_state, ym2149_aout_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, kurukuru_state, ym2149_bout_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + ym2149_device &ym2149(YM2149(config, "ym2149", YM2149_CLOCK)); + ym2149.port_b_read_callback().set_ioport("DSW2"); + ym2149.port_a_write_callback().set(FUNC(kurukuru_state::ym2149_aout_w)); + ym2149.port_b_write_callback().set(FUNC(kurukuru_state::ym2149_bout_w)); + ym2149.add_route(ALL_OUTPUTS, "mono", 0.80); MCFG_DEVICE_ADD("adpcm", MSM5205, M5205_CLOCK) MCFG_MSM5205_VCLK_CB(WRITELINE(*this, kurukuru_state, kurukuru_msm5205_vck)) diff --git a/src/mame/drivers/kyugo.cpp b/src/mame/drivers/kyugo.cpp index bbb47a078fc..19bf850a073 100644 --- a/src/mame/drivers/kyugo.cpp +++ b/src/mame/drivers/kyugo.cpp @@ -554,13 +554,12 @@ MACHINE_CONFIG_START(kyugo_state::kyugo_base) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay1", AY8910, XTAL(18'432'000)/12) /* verified on pcb */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + ay8910_device &ay1(AY8910(config, "ay1", XTAL(18'432'000)/12)); /* verified on pcb */ + ay1.port_a_read_callback().set_ioport("DSW1"); + ay1.port_b_read_callback().set_ioport("DSW2"); + ay1.add_route(ALL_OUTPUTS, "mono", 0.30); - MCFG_DEVICE_ADD("ay2", AY8910, XTAL(18'432'000)/12) /* verified on pcb */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + AY8910(config, "ay2", XTAL(18'432'000)/12).add_route(ALL_OUTPUTS, "mono", 0.30); /* verified on pcb */ MACHINE_CONFIG_END MACHINE_CONFIG_START(kyugo_state::gyrodine) diff --git a/src/mame/drivers/ladyfrog.cpp b/src/mame/drivers/ladyfrog.cpp index 2f18b09dc98..314584fdbff 100644 --- a/src/mame/drivers/ladyfrog.cpp +++ b/src/mame/drivers/ladyfrog.cpp @@ -319,12 +319,12 @@ MACHINE_CONFIG_START(ladyfrog_state::ladyfrog) /* 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(8'000'000)/4) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, ladyfrog_state, unk_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, ladyfrog_state, unk_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) + ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(8'000'000)/4)); + aysnd.port_a_write_callback().set(FUNC(ladyfrog_state::unk_w)); + aysnd.port_b_write_callback().set(FUNC(ladyfrog_state::unk_w)); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.15); MCFG_DEVICE_ADD("msm", MSM5232, XTAL(8'000'000)/4) MCFG_MSM5232_SET_CAPACITORS(0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6) diff --git a/src/mame/drivers/lola8a.cpp b/src/mame/drivers/lola8a.cpp index ec804f1da91..ed99bcdd65e 100644 --- a/src/mame/drivers/lola8a.cpp +++ b/src/mame/drivers/lola8a.cpp @@ -274,10 +274,10 @@ MACHINE_CONFIG_START(lola8a_state::lola8a) MCFG_I8085A_SOD(WRITELINE(*this, lola8a_state, cass_w)) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD(AY8910_TAG, AY8910, XTAL(4'915'200) / 4) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, lola8a_state, lola8a_port_a_r)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, lola8a_state, lola8a_port_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",1.0) + ay8910_device &aysnd(AY8910(config, AY8910_TAG, XTAL(4'915'200) / 4)); + aysnd.port_a_read_callback().set(FUNC(lola8a_state::lola8a_port_a_r)); + aysnd.port_b_write_callback().set(FUNC(lola8a_state::lola8a_port_b_w)); + aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/ltcasino.cpp b/src/mame/drivers/ltcasino.cpp index 27bb96fd597..15f5ef264bb 100644 --- a/src/mame/drivers/ltcasino.cpp +++ b/src/mame/drivers/ltcasino.cpp @@ -764,11 +764,11 @@ MACHINE_CONFIG_START(ltcasino_state::ltcasino) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(18'432'000)/18) /* 1.024MHz ?? (or 18.432MHz/16 = 1.152MHz) - not verified */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("BUTTONS")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN6")) + ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(18'432'000)/18)); /* 1.024MHz ?? (or 18.432MHz/16 = 1.152MHz) - not verified */ + aysnd.port_a_read_callback().set_ioport("BUTTONS"); + aysnd.port_b_read_callback().set_ioport("IN6"); //ltcasino -> pc: F3F3 (A in service) and F3FD (B in service) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4) + aysnd.add_route(ALL_OUTPUTS, "mono", 0.4); MACHINE_CONFIG_END diff --git a/src/mame/drivers/marywu.cpp b/src/mame/drivers/marywu.cpp index a1d7aed0d4a..0d99de7f3f2 100644 --- a/src/mame/drivers/marywu.cpp +++ b/src/mame/drivers/marywu.cpp @@ -204,15 +204,15 @@ MACHINE_CONFIG_START(marywu_state::marywu) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay1", AY8910, XTAL(10'738'635)) /* should it be perhaps a fraction of the XTAL clock ? */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, marywu_state, ay1_port_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, marywu_state, ay1_port_b_w)) + ay8910_device &ay1(AY8910(config, "ay1", XTAL(10'738'635))); /* should it be perhaps a fraction of the XTAL clock ? */ + ay1.add_route(ALL_OUTPUTS, "mono", 0.50); + ay1.port_a_write_callback().set(FUNC(marywu_state::ay1_port_a_w)); + ay1.port_b_write_callback().set(FUNC(marywu_state::ay1_port_b_w)); - MCFG_DEVICE_ADD("ay2", AY8910, XTAL(10'738'635)) /* should it be perhaps a fraction of the XTAL clock ? */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, marywu_state, ay2_port_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, marywu_state, ay2_port_b_w)) + ay8910_device &ay2(AY8910(config, "ay2", XTAL(10'738'635))); /* should it be perhaps a fraction of the XTAL clock ? */ + ay2.add_route(ALL_OUTPUTS, "mono", 0.50); + ay2.port_a_write_callback().set(FUNC(marywu_state::ay2_port_a_w)); + ay2.port_b_write_callback().set(FUNC(marywu_state::ay2_port_b_w)); MACHINE_CONFIG_END ROM_START( marywu ) diff --git a/src/mame/drivers/mephistp.cpp b/src/mame/drivers/mephistp.cpp index b8b7ad40242..eb3d27e56a8 100644 --- a/src/mame/drivers/mephistp.cpp +++ b/src/mame/drivers/mephistp.cpp @@ -190,10 +190,10 @@ MACHINE_CONFIG_START(mephisto_pinball_state::mephisto) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(12'000'000)/8) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, mephisto_pinball_state, ay8910_columns_w)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, mephisto_pinball_state, ay8910_inputs_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) + AY8910(config, m_aysnd, XTAL(12'000'000)/8); + m_aysnd->port_a_write_callback().set(FUNC(mephisto_pinball_state::ay8910_columns_w)); + m_aysnd->port_b_read_callback().set(FUNC(mephisto_pinball_state::ay8910_inputs_r)); + m_aysnd->add_route(ALL_OUTPUTS, "mono", 0.5); MCFG_DEVICE_ADD("dac", DAC08, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) diff --git a/src/mame/drivers/mgavegas.cpp b/src/mame/drivers/mgavegas.cpp index b50f04c22a1..2b0fe10a3b8 100644 --- a/src/mame/drivers/mgavegas.cpp +++ b/src/mame/drivers/mgavegas.cpp @@ -599,10 +599,10 @@ MACHINE_CONFIG_START(mgavegas_state::mgavegas) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, AY_CLK) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.3) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, mgavegas_state, ay8910_a_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, mgavegas_state, ay8910_b_r)) + AY8910(config, m_ay, AY_CLK); + m_ay->add_route(ALL_OUTPUTS, "mono", 0.3); + m_ay->port_a_read_callback().set(FUNC(mgavegas_state::ay8910_a_r)); + m_ay->port_b_read_callback().set(FUNC(mgavegas_state::ay8910_b_r)); MCFG_DEVICE_ADD("5205", MSM5205, MSM_CLK) MCFG_MSM5205_PRESCALER_SELECTOR(S64_4B) diff --git a/src/mame/drivers/miniboy7.cpp b/src/mame/drivers/miniboy7.cpp index 1e3d22dfc56..cbed8e82180 100644 --- a/src/mame/drivers/miniboy7.cpp +++ b/src/mame/drivers/miniboy7.cpp @@ -547,10 +547,10 @@ MACHINE_CONFIG_START(miniboy7_state::miniboy7) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, MASTER_CLOCK / 8) /* guess */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, miniboy7_state, ay_pa_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, miniboy7_state, ay_pb_w)) + ay8910_device &ay8910(AY8910(config, "ay8910", MASTER_CLOCK / 8)); /* guess */ + ay8910.add_route(ALL_OUTPUTS, "mono", 0.75); + ay8910.port_a_write_callback().set(FUNC(miniboy7_state::ay_pa_w)); + ay8910.port_b_write_callback().set(FUNC(miniboy7_state::ay_pb_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/mosaic.cpp b/src/mame/drivers/mosaic.cpp index 509d9340f8d..58af0266ad7 100644 --- a/src/mame/drivers/mosaic.cpp +++ b/src/mame/drivers/mosaic.cpp @@ -303,9 +303,9 @@ MACHINE_CONFIG_START(mosaic_state::mosaic) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(12'288'000)/4) /* 3.072MHz or 3.579545MHz (14.31818MHz/4)? */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'288'000)/4)); /* 3.072MHz or 3.579545MHz (14.31818MHz/4)? */ + ymsnd.port_a_read_callback().set_ioport("DSW"); + ymsnd.add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END MACHINE_CONFIG_START(mosaic_state::gfire2) diff --git a/src/mame/drivers/multi8.cpp b/src/mame/drivers/multi8.cpp index 716086febab..56a7767ef06 100644 --- a/src/mame/drivers/multi8.cpp +++ b/src/mame/drivers/multi8.cpp @@ -585,9 +585,9 @@ MACHINE_CONFIG_START(multi8_state::multi8) /* Audio */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8912, 1500000) //unknown clock / divider - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, multi8_state, ym2203_porta_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + AY8912(config, m_aysnd, 1500000); //unknown clock / divider + m_aysnd->port_a_write_callback().set(FUNC(multi8_state::ym2203_porta_w)); + m_aysnd->add_route(ALL_OUTPUTS, "mono", 0.50); MCFG_DEVICE_ADD("beeper", BEEP, 1200) // guesswork MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) diff --git a/src/mame/drivers/myvision.cpp b/src/mame/drivers/myvision.cpp index e5e1c874ff3..66d6788c6d4 100644 --- a/src/mame/drivers/myvision.cpp +++ b/src/mame/drivers/myvision.cpp @@ -229,12 +229,12 @@ MACHINE_CONFIG_START(myvision_state::myvision) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, XTAL(10'738'635)/3/2) /* Exact model and clock not verified */ - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, myvision_state, ay_port_a_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, myvision_state, ay_port_b_r)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, myvision_state, ay_port_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, myvision_state, ay_port_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ay8910_device &ay8910(AY8910(config, "ay8910", XTAL(10'738'635)/3/2)); /* Exact model and clock not verified */ + ay8910.port_a_read_callback().set(FUNC(myvision_state::ay_port_a_r)); + ay8910.port_b_read_callback().set(FUNC(myvision_state::ay_port_b_r)); + ay8910.port_a_write_callback().set(FUNC(myvision_state::ay_port_a_w)); + ay8910.port_b_write_callback().set(FUNC(myvision_state::ay_port_b_w)); + ay8910.add_route(ALL_OUTPUTS, "mono", 0.50); /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "myvision_cart") diff --git a/src/mame/drivers/mz2500.cpp b/src/mame/drivers/mz2500.cpp index a1851236ed8..9ec57559e98 100644 --- a/src/mame/drivers/mz2500.cpp +++ b/src/mame/drivers/mz2500.cpp @@ -1855,14 +1855,14 @@ MACHINE_CONFIG_START(mz2500_state::mz2500) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ym", YM2203, 2000000) //unknown clock / divider - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, mz2500_state, opn_porta_r)) // read A - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1")) // read B - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, mz2500_state, opn_porta_w)) // write A - MCFG_SOUND_ROUTE(0, "mono", 0.25) - MCFG_SOUND_ROUTE(1, "mono", 0.25) - MCFG_SOUND_ROUTE(2, "mono", 0.50) - MCFG_SOUND_ROUTE(3, "mono", 0.50) + ym2203_device &ym(YM2203(config, "ym", 2000000)); //unknown clock / divider + ym.port_a_read_callback().set(FUNC(mz2500_state::opn_porta_r)); + ym.port_b_read_callback().set_ioport("DSW1"); + ym.port_a_write_callback().set(FUNC(mz2500_state::opn_porta_w)); + ym.add_route(0, "mono", 0.25); + ym.add_route(1, "mono", 0.25); + ym.add_route(2, "mono", 0.50); + ym.add_route(3, "mono", 0.50); MCFG_DEVICE_ADD("beeper", BEEP, 4096) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) diff --git a/src/mame/drivers/pc6001.cpp b/src/mame/drivers/pc6001.cpp index 83ace5d1679..107118c63d3 100644 --- a/src/mame/drivers/pc6001.cpp +++ b/src/mame/drivers/pc6001.cpp @@ -1522,10 +1522,10 @@ MACHINE_CONFIG_START(pc6001_state::pc6001) MCFG_GENERIC_EXTENSIONS("cas,p6") SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, PC6001_MAIN_CLOCK/4) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + ay8910_device &ay8910(AY8910(config, "ay8910", PC6001_MAIN_CLOCK/4)); + ay8910.port_a_read_callback().set_ioport("P1"); + ay8910.port_b_read_callback().set_ioport("P2"); + ay8910.add_route(ALL_OUTPUTS, "mono", 1.00); // WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* TODO: accurate timing on this */ diff --git a/src/mame/drivers/pc8801.cpp b/src/mame/drivers/pc8801.cpp index f404fc5bbff..67390407e52 100644 --- a/src/mame/drivers/pc8801.cpp +++ b/src/mame/drivers/pc8801.cpp @@ -2405,17 +2405,17 @@ MACHINE_CONFIG_START(pc8801_state::pc8801) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("opn", YM2203, MASTER_CLOCK) - MCFG_YM2203_IRQ_HANDLER(WRITELINE(*this, pc8801_state, pc8801_sound_irq)) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, pc8801_state, opn_porta_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, pc8801_state, opn_portb_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + YM2203(config, m_opn, MASTER_CLOCK); + m_opn->irq_handler().set(FUNC(pc8801_state::pc8801_sound_irq)); + m_opn->port_a_read_callback().set(FUNC(pc8801_state::opn_porta_r)); + m_opn->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r)); + m_opn->add_route(ALL_OUTPUTS, "mono", 1.00); - MCFG_DEVICE_ADD("opna", YM2608, MASTER_CLOCK*2) - MCFG_YM2608_IRQ_HANDLER(WRITELINE(*this, pc8801_state, pc8801_sound_irq)) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, pc8801_state, opn_porta_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, pc8801_state, opn_portb_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + YM2608(config, m_opna, MASTER_CLOCK*2); + m_opna->irq_handler().set(FUNC(pc8801_state::pc8801_sound_irq)); + m_opna->port_a_read_callback().set(FUNC(pc8801_state::opn_porta_r)); + m_opna->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r)); + m_opna->add_route(ALL_OUTPUTS, "mono", 1.00); MCFG_DEVICE_ADD("beeper", BEEP, 2400) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) diff --git a/src/mame/drivers/pentagon.cpp b/src/mame/drivers/pentagon.cpp index ae7569726c9..ba8e316c3d6 100644 --- a/src/mame/drivers/pentagon.cpp +++ b/src/mame/drivers/pentagon.cpp @@ -297,11 +297,11 @@ MACHINE_CONFIG_START(pentagon_state::pentagon) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_REPLACE("ay8912", AY8912, XTAL(14'000'000) / 8) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(1, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.25) - MCFG_SOUND_ROUTE(2, "rspeaker", 0.50) + ay8912_device &ay8912(AY8912(config.replace(), "ay8912", XTAL(14'000'000)/8)); + ay8912.add_route(0, "lspeaker", 0.50); + ay8912.add_route(1, "lspeaker", 0.25); + ay8912.add_route(1, "rspeaker", 0.25); + ay8912.add_route(2, "rspeaker", 0.50); MCFG_DEVICE_REMOVE("exp") diff --git a/src/mame/drivers/peyper.cpp b/src/mame/drivers/peyper.cpp index 969c993cce9..c81928a9184 100644 --- a/src/mame/drivers/peyper.cpp +++ b/src/mame/drivers/peyper.cpp @@ -615,14 +615,14 @@ MACHINE_CONFIG_START(peyper_state::peyper) /* Sound */ genpin_audio(config); SPEAKER(config, "ayvol").front_center(); - MCFG_DEVICE_ADD("ay1", AY8910, 2500000) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, peyper_state, p1a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, peyper_state, p1b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "ayvol", 1.0) - MCFG_DEVICE_ADD("ay2", AY8910, 2500000) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, peyper_state, p2a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, peyper_state, p2b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "ayvol", 1.0) + ay8910_device &ay1(AY8910(config, "ay1", 2500000)); + ay1.port_a_write_callback().set(FUNC(peyper_state::p1a_w)); + ay1.port_b_write_callback().set(FUNC(peyper_state::p1b_w)); + ay1.add_route(ALL_OUTPUTS, "ayvol", 1.0); + ay8910_device &ay2(AY8910(config, "ay2", 2500000)); + ay2.port_a_write_callback().set(FUNC(peyper_state::p2a_w)); + ay2.port_b_write_callback().set(FUNC(peyper_state::p2b_w)); + ay2.add_route(ALL_OUTPUTS, "ayvol", 1.0); /* Devices */ i8279_device &kbdc(I8279(config, "i8279", 2500000)); diff --git a/src/mame/drivers/phc25.cpp b/src/mame/drivers/phc25.cpp index 893b3939602..ca346dd36c0 100644 --- a/src/mame/drivers/phc25.cpp +++ b/src/mame/drivers/phc25.cpp @@ -316,10 +316,10 @@ MACHINE_CONFIG_START(phc25_state::phc25) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD(AY8910_TAG, AY8910, 1996750) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY0")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("JOY1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + ay8910_device &psg(AY8910(config, AY8910_TAG, 1996750)); + psg.port_a_read_callback().set_ioport("JOY0"); + psg.port_b_read_callback().set_ioport("JOY1"); + psg.add_route(ALL_OUTPUTS, "mono", 1.00); WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.15); /* devices */ diff --git a/src/mame/drivers/poker72.cpp b/src/mame/drivers/poker72.cpp index 63ecc375c7a..0f5f37e5d74 100644 --- a/src/mame/drivers/poker72.cpp +++ b/src/mame/drivers/poker72.cpp @@ -394,10 +394,10 @@ MACHINE_CONFIG_START(poker72_state::poker72) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay", AY8910, 8000000/8) /* ? Mhz */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("SW2")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("SW3")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ay8910_device &ay(AY8910(config, "ay", 8000000/8)); /* ? Mhz */ + ay.port_a_read_callback().set_ioport("SW2"); + ay.port_b_read_callback().set_ioport("SW3"); + ay.add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END diff --git a/src/mame/drivers/popeye.cpp b/src/mame/drivers/popeye.cpp index fb8b4158e36..1a98cdafd96 100644 --- a/src/mame/drivers/popeye.cpp +++ b/src/mame/drivers/popeye.cpp @@ -610,21 +610,23 @@ MACHINE_CONFIG_START(tnx1_state::config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(8'000'000)/4) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0")) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, tnx1_state, popeye_portB_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) + ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(8'000'000)/4)); + aysnd.port_a_read_callback().set_ioport("DSW0"); + aysnd.port_b_write_callback().set(FUNC(tnx1_state::popeye_portB_w)); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.40); + MACHINE_CONFIG_END MACHINE_CONFIG_START(tpp2_state::config) tpp1_state::config(config); - MCFG_DEVICE_MODIFY("aysnd") - MCFG_SOUND_ROUTES_RESET() - MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT) /* Does tnx1, tpp1 & popeyebl have the same filtering? */ - MCFG_AY8910_RES_LOADS(2000.0, 2000.0, 2000.0) - MCFG_SOUND_ROUTE(0, "snd_nl", 1.0, 0) - MCFG_SOUND_ROUTE(1, "snd_nl", 1.0, 1) - MCFG_SOUND_ROUTE(2, "snd_nl", 1.0, 2) + + auto &aysnd(*subdevice("aysnd")); + aysnd.reset_routes(); + aysnd.set_flags(AY8910_RESISTOR_OUTPUT); /* Does tnx1, tpp1 & popeyebl have the same filtering? */ + aysnd.set_resistors_load(2000.0, 2000.0, 2000.0); + aysnd.add_route(0, "snd_nl", 1.0, 0); + aysnd.add_route(1, "snd_nl", 1.0, 1); + aysnd.add_route(2, "snd_nl", 1.0, 2); /* NETLIST configuration using internal AY8910 resistor values */ diff --git a/src/mame/drivers/proconn.cpp b/src/mame/drivers/proconn.cpp index 3479a876d83..72b46428cdc 100644 --- a/src/mame/drivers/proconn.cpp +++ b/src/mame/drivers/proconn.cpp @@ -265,7 +265,8 @@ void proconn_state::machine_reset() m_vfd->reset(); // reset display1 } -MACHINE_CONFIG_START(proconn_state::proconn) +void proconn_state::proconn(machine_config &config) +{ Z80(config, m_maincpu, 4000000); /* ?? Mhz */ m_maincpu->set_daisy_config(z80_daisy_chain); m_maincpu->set_addrmap(AS_PROGRAM, &proconn_state::proconn_map); @@ -329,13 +330,13 @@ MACHINE_CONFIG_START(proconn_state::proconn) config.set_default_layout(layout_proconn); - MCFG_DEVICE_ADD("aysnd", AY8910, 1000000) /* ?? Mhz */ // YM2149F on PC92? - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, proconn_state, meter_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33) + AY8910(config, m_ay, 1000000); /* ?? Mhz */ // YM2149F on PC92? + m_ay->port_b_write_callback().set(FUNC(proconn_state::meter_w)); + m_ay->add_route(ALL_OUTPUTS, "rspeaker", 0.33); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) -MACHINE_CONFIG_END + METERS(config, m_meters, 0); + m_meters->set_number_meters(8); +} diff --git a/src/mame/drivers/re900.cpp b/src/mame/drivers/re900.cpp index 5dba489ae58..4c98a94c6c1 100644 --- a/src/mame/drivers/re900.cpp +++ b/src/mame/drivers/re900.cpp @@ -2,7 +2,7 @@ // copyright-holders:Grull Osgo, Roberto Fresca /*********************************************************************************** - re900.c + re900.cpp Ruleta RE-900 - Entretenimientos GEMINIS & GENATRON (C) 1993 @@ -388,13 +388,13 @@ INPUT_PORTS_END * Machine Driver * ***************************/ -MACHINE_CONFIG_START(re900_state::re900) - +void re900_state::re900(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8051, MAIN_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(mem_prg) - MCFG_DEVICE_IO_MAP(mem_io) - MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, re900_state, cpu_port_0_w)) + i8051_device &maincpu(I8051(config, m_maincpu, MAIN_CLOCK)); + maincpu.set_addrmap(AS_PROGRAM, &re900_state::mem_prg); + maincpu.set_addrmap(AS_IO, &re900_state::mem_io); + maincpu.port_out_cb<0>().set(FUNC(re900_state::cpu_port_0_w)); /* video hardware */ tms9128_device &vdp(TMS9128(config, "tms9128", VDP_CLOCK)); /* TMS9128NL on the board */ @@ -407,24 +407,25 @@ MACHINE_CONFIG_START(re900_state::re900) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay_re900", AY8910, TMS_CLOCK) /* From TMS9128NL - Pin 37 (GROMCLK) */ - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, re900_state, re_psg_portA_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, re900_state, re_psg_portB_r)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, re900_state, re_mux_port_A_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, re900_state, re_mux_port_B_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + ay8910_device &ay_re900(AY8910(config, "ay_re900", TMS_CLOCK)); /* From TMS9128NL - Pin 37 (GROMCLK) */ + ay_re900.port_a_read_callback().set(FUNC(re900_state::re_psg_portA_r)); + ay_re900.port_b_read_callback().set(FUNC(re900_state::re_psg_portB_r)); + ay_re900.port_a_write_callback().set(FUNC(re900_state::re_mux_port_A_w)); + ay_re900.port_b_write_callback().set(FUNC(re900_state::re_mux_port_B_w)); + ay_re900.add_route(ALL_OUTPUTS, "mono", 0.5); +} -MACHINE_CONFIG_START(re900_state::bs94) +void re900_state::bs94(machine_config &config) +{ re900(config); /* sound hardware */ - MCFG_DEVICE_MODIFY("ay_re900") - MCFG_AY8910_PORT_A_READ_CB(IOPORT("IN0")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN1")) - MCFG_AY8910_PORT_A_WRITE_CB(NOOP) - MCFG_AY8910_PORT_B_WRITE_CB(NOOP) -MACHINE_CONFIG_END + auto &ay_re900(*subdevice("ay_re900")); + ay_re900.port_a_read_callback().set_ioport("IN0"); + ay_re900.port_b_read_callback().set_ioport("IN1"); + ay_re900.port_a_write_callback().set_nop(); + ay_re900.port_b_write_callback().set_nop(); +} /************************* diff --git a/src/mame/drivers/sanremo.cpp b/src/mame/drivers/sanremo.cpp index 6ed2c6e639c..9d70666ebbc 100644 --- a/src/mame/drivers/sanremo.cpp +++ b/src/mame/drivers/sanremo.cpp @@ -387,9 +387,9 @@ MACHINE_CONFIG_START(sanremo_state::sanremo) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, SND_CLOCK) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + ay8910_device &ay8910(AY8910(config, "ay8910", SND_CLOCK)); + ay8910.port_a_read_callback().set_ioport("DSW"); + ay8910.add_route(ALL_OUTPUTS, "mono", 1.00); MACHINE_CONFIG_END diff --git a/src/mame/drivers/shangkid.cpp b/src/mame/drivers/shangkid.cpp index f9de5613fc8..7f6a3b5aab3 100644 --- a/src/mame/drivers/shangkid.cpp +++ b/src/mame/drivers/shangkid.cpp @@ -424,10 +424,10 @@ MACHINE_CONFIG_START(shangkid_state::chinhero) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) - MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(18'432'000)/12) /* verified on pcb */ - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, shangkid_state, chinhero_ay8910_porta_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, shangkid_state, ay8910_portb_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) + AY8910(config, m_aysnd, XTAL(18'432'000)/12); /* verified on pcb */ + m_aysnd->port_a_write_callback().set(FUNC(shangkid_state::chinhero_ay8910_porta_w)); + m_aysnd->port_b_write_callback().set(FUNC(shangkid_state::ay8910_portb_w)); + m_aysnd->add_route(ALL_OUTPUTS, "speaker", 0.1); MACHINE_CONFIG_END @@ -452,9 +452,7 @@ MACHINE_CONFIG_START(shangkid_state::shangkid) /* video hardware */ MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_shangkid) - MCFG_DEVICE_MODIFY("aysnd") - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, shangkid_state, shangkid_ay8910_porta_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, shangkid_state, ay8910_portb_w)) + m_aysnd->port_a_write_callback().set(FUNC(shangkid_state::shangkid_ay8910_porta_w)); MACHINE_CONFIG_END @@ -511,8 +509,7 @@ MACHINE_CONFIG_START(shangkid_state::dynamski) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, 2000000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) + AY8910(config, m_aysnd, 2000000).add_route(ALL_OUTPUTS, "speaker", 0.1); MACHINE_CONFIG_END /***************************************************************************************/ diff --git a/src/mame/drivers/sothello.cpp b/src/mame/drivers/sothello.cpp index 2c1d6a33211..30956b73eb0 100644 --- a/src/mame/drivers/sothello.cpp +++ b/src/mame/drivers/sothello.cpp @@ -380,18 +380,16 @@ MACHINE_CONFIG_START(sothello_state::sothello) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_GENERIC_LATCH_8_ADD("soundlatch") + GENERIC_LATCH_8(config, "soundlatch"); - MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(21'477'272) / 12) - MCFG_YM2203_IRQ_HANDLER(INPUTLINE("subcpu", 0)) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB")) - MCFG_SOUND_ROUTE(0, "mono", 0.25) - MCFG_SOUND_ROUTE(1, "mono", 0.25) - MCFG_SOUND_ROUTE(2, "mono", 0.25) - MCFG_SOUND_ROUTE(3, "mono", 0.50) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(21'477'272) / 12)); + ymsnd.irq_handler().set_inputline(m_subcpu, 0); + ymsnd.port_a_read_callback().set_ioport("DSWA"); + ymsnd.port_b_read_callback().set_ioport("DSWB"); + ymsnd.add_route(0, "mono", 0.25); + ymsnd.add_route(1, "mono", 0.25); + ymsnd.add_route(2, "mono", 0.25); + ymsnd.add_route(3, "mono", 0.50); MCFG_DEVICE_ADD("msm", MSM5205, XTAL(384'000)) MCFG_MSM5205_VCLK_CB(WRITELINE(*this, sothello_state, adpcm_int)) /* interrupt function */ diff --git a/src/mame/drivers/spc1000.cpp b/src/mame/drivers/spc1000.cpp index 6fbcdd16f7e..51d1c928844 100644 --- a/src/mame/drivers/spc1000.cpp +++ b/src/mame/drivers/spc1000.cpp @@ -484,10 +484,10 @@ MACHINE_CONFIG_START(spc1000_state::spc1000) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, XTAL(4'000'000) / 1) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, spc1000_state, porta_r)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("cent_data_out", output_latch_device, bus_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + ay8910_device &ay8910(AY8910(config, "ay8910", XTAL(4'000'000) / 1)); + ay8910.port_a_read_callback().set(FUNC(spc1000_state::porta_r)); + ay8910.port_b_write_callback().set("cent_data_out", FUNC(output_latch_device::bus_w)); + ay8910.add_route(ALL_OUTPUTS, "mono", 1.00); WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); MCFG_DEVICE_ADD("ext1", SPC1000_EXP_SLOT, 0) diff --git a/src/mame/drivers/spc1500.cpp b/src/mame/drivers/spc1500.cpp index 03ec48c0495..e3763f556bd 100644 --- a/src/mame/drivers/spc1500.cpp +++ b/src/mame/drivers/spc1500.cpp @@ -912,10 +912,10 @@ MACHINE_CONFIG_START(spc1500_state::spc1500) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, XTAL(4'000'000) / 2) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, spc1500_state, psga_r)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, spc1500_state, psgb_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + AY8910(config, m_sound, XTAL(4'000'000) / 2); + m_sound->port_a_read_callback().set(FUNC(spc1500_state::psga_r)); + m_sound->port_b_write_callback().set(FUNC(spc1500_state::psgb_w)); + m_sound->add_route(ALL_OUTPUTS, "mono", 1.00); WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer") diff --git a/src/mame/drivers/squale.cpp b/src/mame/drivers/squale.cpp index 18e101de8f0..5e434cd86f7 100644 --- a/src/mame/drivers/squale.cpp +++ b/src/mame/drivers/squale.cpp @@ -804,13 +804,13 @@ MACHINE_CONFIG_START(squale_state::squale) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, AY_CLOCK) + AY8910(config, m_ay8910, AY_CLOCK); // TODO : Add port I/O handler - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, squale_state, ay_porta_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, squale_state, ay_portb_r)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, squale_state, ay_porta_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, squale_state, ay_portb_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + m_ay8910->port_a_read_callback().set(FUNC(squale_state::ay_porta_r)); + m_ay8910->port_b_read_callback().set(FUNC(squale_state::ay_portb_r)); + m_ay8910->port_a_write_callback().set(FUNC(squale_state::ay_porta_w)); + m_ay8910->port_b_write_callback().set(FUNC(squale_state::ay_portb_w)); + m_ay8910->add_route(ALL_OUTPUTS, "mono", 0.50); MCFG_DEVICE_ADD ("ef6850", ACIA6850, 0) diff --git a/src/mame/drivers/stuntair.cpp b/src/mame/drivers/stuntair.cpp index e054617b546..4df4d4c6f79 100644 --- a/src/mame/drivers/stuntair.cpp +++ b/src/mame/drivers/stuntair.cpp @@ -559,15 +559,14 @@ MACHINE_CONFIG_START(stuntair_state::stuntair) /* sound hardware */ SPEAKER(config, "mono").front_center(); // stereo? - MCFG_GENERIC_LATCH_8_ADD("soundlatch") + GENERIC_LATCH_8(config, m_soundlatch); - MCFG_DEVICE_ADD("ay1", AY8910, XTAL(18'432'000)/12) - MCFG_AY8910_PORT_A_READ_CB(READ8("soundlatch", generic_latch_8_device, read)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, stuntair_state, ay8910_portb_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ay8910_device &ay1(AY8910(config, "ay1", XTAL(18'432'000)/12)); + ay1.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); + ay1.port_b_write_callback().set(FUNC(stuntair_state::ay8910_portb_w)); + ay1.add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_ADD("ay2", AY8910, XTAL(18'432'000)/12) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + AY8910(config, "ay2", XTAL(18'432'000)/12).add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END diff --git a/src/mame/drivers/supstarf.cpp b/src/mame/drivers/supstarf.cpp index 938e728e0e6..98477550199 100644 --- a/src/mame/drivers/supstarf.cpp +++ b/src/mame/drivers/supstarf.cpp @@ -198,15 +198,15 @@ MACHINE_CONFIG_START(supstarf_state::supstarf) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("psg1", AY8910, XTAL(5'068'800) / 6) // from 8035 pin 1 (T0) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, supstarf_state, lights_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, supstarf_state, lights_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + AY8910(config, m_psg[0], XTAL(5'068'800) / 6); // from 8035 pin 1 (T0) + m_psg[0]->port_a_write_callback().set(FUNC(supstarf_state::lights_a_w)); + m_psg[0]->port_b_write_callback().set(FUNC(supstarf_state::lights_b_w)); + m_psg[0]->add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_ADD("psg2", AY8910, XTAL(5'068'800) / 6) // from 8035 pin 1 (T0) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("JO")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("I1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + AY8910(config, m_psg[1], XTAL(5'068'800) / 6); // from 8035 pin 1 (T0) + m_psg[1]->port_a_read_callback().set_ioport("JO"); + m_psg[1]->port_b_read_callback().set_ioport("I1"); + m_psg[1]->add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END static INPUT_PORTS_START(supstarf) diff --git a/src/mame/drivers/svi318.cpp b/src/mame/drivers/svi318.cpp index 65461ffdf1f..bcca2074c81 100644 --- a/src/mame/drivers/svi318.cpp +++ b/src/mame/drivers/svi318.cpp @@ -549,10 +549,10 @@ MACHINE_CONFIG_START(svi3x8_state::svi318) SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.25); WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("psg", AY8910, XTAL(10'738'635) / 6) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY")) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, svi3x8_state, bank_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) + ay8910_device &psg(AY8910(config, "psg", XTAL(10'738'635) / 6)); + psg.port_a_read_callback().set_ioport("JOY"); + psg.port_b_write_callback().set(FUNC(svi3x8_state::bank_w)); + psg.add_route(ALL_OUTPUTS, "mono", 0.75); // cassette MCFG_CASSETTE_ADD("cassette") diff --git a/src/mame/drivers/taxidriv.cpp b/src/mame/drivers/taxidriv.cpp index 745e6afebd0..616ac9ecbea 100644 --- a/src/mame/drivers/taxidriv.cpp +++ b/src/mame/drivers/taxidriv.cpp @@ -396,14 +396,14 @@ MACHINE_CONFIG_START(taxidriv_state::taxidriv) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay1", AY8910, 1250000) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, taxidriv_state, p8910_0a_r)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, taxidriv_state, p8910_0b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + ay8910_device &ay1(AY8910(config, "ay1", 1250000)); + ay1.port_a_read_callback().set(FUNC(taxidriv_state::p8910_0a_r)); + ay1.port_b_write_callback().set(FUNC(taxidriv_state::p8910_0b_w)); + ay1.add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("ay2", AY8910, 1250000) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, taxidriv_state, p8910_1a_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + ay8910_device &ay2(AY8910(config, "ay2", 1250000)); + ay2.port_a_read_callback().set(FUNC(taxidriv_state::p8910_1a_r)); + ay2.add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END diff --git a/src/mame/drivers/tickee.cpp b/src/mame/drivers/tickee.cpp index 0e21be1246c..43437631ae3 100644 --- a/src/mame/drivers/tickee.cpp +++ b/src/mame/drivers/tickee.cpp @@ -786,15 +786,15 @@ MACHINE_CONFIG_START(tickee_state::tickee) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ym1", YM2149, VIDEO_CLOCK/8) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ym2149_device &ym1(YM2149(config, "ym1", VIDEO_CLOCK/8)); + ym1.port_a_read_callback().set_ioport("DSW"); + ym1.port_b_read_callback().set_ioport("IN1"); + ym1.add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_ADD("ym2", YM2149, VIDEO_CLOCK/8) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("IN0")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN2")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ym2149_device &ym2(YM2149(config, "ym2", VIDEO_CLOCK/8)); + ym2.port_a_read_callback().set_ioport("IN0"); + ym2.port_b_read_callback().set_ioport("IN2"); + ym2.add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END @@ -867,10 +867,10 @@ MACHINE_CONFIG_START(tickee_state::mouseatk) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ym", YM2149, OKI_CLOCK) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("IN1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + ym2149_device &ym(YM2149(config, "ym", OKI_CLOCK)); + ym.port_a_read_callback().set_ioport("DSW"); + ym.port_b_read_callback().set_ioport("IN1"); + ym.add_route(ALL_OUTPUTS, "mono", 0.50); MCFG_DEVICE_ADD("oki", OKIM6295, OKI_CLOCK, okim6295_device::PIN7_HIGH) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) diff --git a/src/mame/drivers/tiki100.cpp b/src/mame/drivers/tiki100.cpp index ffc4c6b0ae3..ff6955d30b2 100644 --- a/src/mame/drivers/tiki100.cpp +++ b/src/mame/drivers/tiki100.cpp @@ -774,10 +774,10 @@ MACHINE_CONFIG_START(tiki100_state::tiki100) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD(AY8912_TAG, AY8912, 8_MHz_XTAL / 4) - MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, tiki100_state, video_scroll_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + AY8912(config, m_psg, 8_MHz_XTAL / 4); + m_psg->set_flags(AY8910_SINGLE_OUTPUT); + m_psg->port_a_write_callback().set(FUNC(tiki100_state::video_scroll_w)); + m_psg->add_route(ALL_OUTPUTS, "mono", 0.25); /* internal ram */ RAM(config, RAM_TAG).set_default_size("64K"); diff --git a/src/mame/drivers/timex.cpp b/src/mame/drivers/timex.cpp index 0c962ef5511..18386314adb 100644 --- a/src/mame/drivers/timex.cpp +++ b/src/mame/drivers/timex.cpp @@ -715,8 +715,7 @@ MACHINE_CONFIG_START(spectrum_state::ts2068) MCFG_VIDEO_START_OVERRIDE(spectrum_state, ts2068 ) /* sound */ - MCFG_DEVICE_REPLACE("ay8912", AY8912, XTAL(14'112'000)/8) /* From Schematic; 1.764 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + AY8912(config.replace(), "ay8912", XTAL(14'112'000)/8).add_route(ALL_OUTPUTS, "mono", 0.25); /* From Schematic; 1.764 MHz */ /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("dockslot", generic_plain_slot, "timex_cart") diff --git a/src/mame/drivers/vd.cpp b/src/mame/drivers/vd.cpp index 99664a605b0..2d56a9afaa8 100644 --- a/src/mame/drivers/vd.cpp +++ b/src/mame/drivers/vd.cpp @@ -197,13 +197,13 @@ MACHINE_CONFIG_START(vd_state::vd) genpin_audio(config); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ay1", AY8910, 2000000) //? - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.33/3) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1")) - MCFG_DEVICE_ADD("ay2", AY8910, 2000000) //? - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33/3) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3")) //? + ay8910_device &ay1(AY8910(config, "ay1", 2000000)); //? + ay1.add_route(ALL_OUTPUTS, "lspeaker", 0.33/3); + ay1.port_a_read_callback().set_ioport("DSW2"); + ay1.port_b_read_callback().set_ioport("DSW1"); + ay8910_device &ay2(AY8910(config, "ay2", 2000000)); //? + ay2.add_route(ALL_OUTPUTS, "rspeaker", 0.33/3); + ay2.port_b_read_callback().set_ioport("DSW3"); /* Video */ config.set_default_layout(layout_vd); diff --git a/src/mame/drivers/vega.cpp b/src/mame/drivers/vega.cpp index 9139b13f7ad..b5211ac654a 100644 --- a/src/mame/drivers/vega.cpp +++ b/src/mame/drivers/vega.cpp @@ -842,12 +842,12 @@ MACHINE_CONFIG_START(vega_state::vega) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, 1500000 ) - MCFG_AY8910_PORT_A_READ_CB(READ8(*this, vega_state, ay8910_pa_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(*this, vega_state, ay8910_pb_r)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, vega_state, ay8910_pa_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, vega_state, ay8910_pb_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + AY8910(config, m_ay8910, 1500000); + m_ay8910->port_a_read_callback().set(FUNC(vega_state::ay8910_pa_r)); + m_ay8910->port_b_read_callback().set(FUNC(vega_state::ay8910_pb_r)); + m_ay8910->port_a_write_callback().set(FUNC(vega_state::ay8910_pa_w)); + m_ay8910->port_b_write_callback().set(FUNC(vega_state::ay8910_pb_w)); + m_ay8910->add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END diff --git a/src/mame/drivers/votrpss.cpp b/src/mame/drivers/votrpss.cpp index e36f0209a60..8d02332522e 100644 --- a/src/mame/drivers/votrpss.cpp +++ b/src/mame/drivers/votrpss.cpp @@ -254,10 +254,10 @@ MACHINE_CONFIG_START(votrpss_state::votrpss) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay", AY8910, XTAL(8'000'000)/4) /* 2.000 MHz, verified */ - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1")) // port B read - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("votrax", votrax_sc01_device, write)) // port A write - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + ay8910_device &ay(AY8910(config, "ay", XTAL(8'000'000)/4)); /* 2.000 MHz, verified */ + ay.port_b_read_callback().set_ioport("DSW1"); + ay.port_a_write_callback().set("votrax", FUNC(votrax_sc01_device::write)); + ay.add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000) /* 720 kHz? needs verify */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) diff --git a/src/mame/drivers/vroulet.cpp b/src/mame/drivers/vroulet.cpp index 338b3c53d40..900de567c43 100644 --- a/src/mame/drivers/vroulet.cpp +++ b/src/mame/drivers/vroulet.cpp @@ -168,8 +168,8 @@ void vroulet_state::vroulet_map(address_map &map) void vroulet_state::vroulet_io_map(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).r("aysnd", FUNC(ay8910_device::data_r)); - map(0x00, 0x01).w("aysnd", FUNC(ay8910_device::data_address_w)); + map(0x00, 0x00).r("aysnd", FUNC(ym2149_device::data_r)); + map(0x00, 0x01).w("aysnd", FUNC(ym2149_device::data_address_w)); map(0x10, 0x13).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x80, 0x83).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); } @@ -313,10 +313,10 @@ MACHINE_CONFIG_START(vroulet_state::vroulet) // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("aysnd", AY8910, 2000000) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + ym2149_device &aysnd(YM2149(config, "aysnd", 2000000)); + aysnd.port_a_read_callback().set_ioport("DSWA"); + aysnd.port_b_read_callback().set_ioport("DSWB"); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END diff --git a/src/mame/drivers/x1.cpp b/src/mame/drivers/x1.cpp index 2b5a93f04c2..55c9652d601 100644 --- a/src/mame/drivers/x1.cpp +++ b/src/mame/drivers/x1.cpp @@ -2264,13 +2264,13 @@ MACHINE_CONFIG_START(x1_state::x1) SPEAKER(config, "rspeaker").front_right(); /* TODO:is the AY mono or stereo? Also volume balance isn't right. */ - MCFG_DEVICE_ADD("ay", AY8910, MAIN_CLOCK/8) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) - MCFG_SOUND_ROUTE(1, "lspeaker", 0.5) - MCFG_SOUND_ROUTE(2, "rspeaker", 0.5) + ay8910_device &ay(AY8910(config, "ay", MAIN_CLOCK/8)); + ay.port_a_read_callback().set_ioport("P1"); + ay.port_b_read_callback().set_ioport("P2"); + ay.add_route(0, "lspeaker", 0.25); + ay.add_route(0, "rspeaker", 0.25); + ay.add_route(1, "lspeaker", 0.5); + ay.add_route(2, "rspeaker", 0.5); WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "lspeaker", 0.25).add_route(ALL_OUTPUTS, "rspeaker", 0.10); MCFG_CASSETTE_ADD("cassette") diff --git a/src/mame/drivers/x1twin.cpp b/src/mame/drivers/x1twin.cpp index b62cad73988..4cbd79fd31f 100644 --- a/src/mame/drivers/x1twin.cpp +++ b/src/mame/drivers/x1twin.cpp @@ -499,13 +499,13 @@ MACHINE_CONFIG_START(x1twin_state::x1twin) // SPEAKER(config, "rspeaker").front_right(); /* TODO:is the AY mono or stereo? Also volume balance isn't right. */ - MCFG_DEVICE_ADD("ay", AY8910, MAIN_CLOCK/8) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) - MCFG_SOUND_ROUTE(0, "x1_l", 0.25) - MCFG_SOUND_ROUTE(0, "x1_r", 0.25) - MCFG_SOUND_ROUTE(1, "x1_l", 0.5) - MCFG_SOUND_ROUTE(2, "x1_r", 0.5) + ay8910_device &ay(AY8910(config, "ay", MAIN_CLOCK/8)); + ay.port_a_read_callback().set_ioport("P1"); + ay.port_b_read_callback().set_ioport("P2"); + ay.add_route(0, "x1_l", 0.25); + ay.add_route(0, "x1_r", 0.25); + ay.add_route(1, "x1_l", 0.5); + ay.add_route(2, "x1_r", 0.5); WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "x1_l", 0.25).add_route(ALL_OUTPUTS, "x1_r", 0.10); MCFG_CASSETTE_ADD("cassette")