From 5f93bb243f9e0f2d449b1812c40831b664c401a4 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Fri, 18 Jan 2019 18:13:03 +0100 Subject: src/devices: a bit more MCFG macro removal (nw) --- src/devices/bus/a2bus/a2midi.cpp | 4 ++-- src/devices/bus/c64/midi_maplin.cpp | 4 ++-- src/devices/bus/c64/midi_namesoft.cpp | 4 ++-- src/devices/bus/c64/midi_passport.cpp | 4 ++-- src/devices/bus/c64/midi_sci.cpp | 4 ++-- src/devices/bus/c64/midi_siel.cpp | 4 ++-- src/devices/bus/isa/gus.cpp | 4 ++-- src/devices/bus/isa/ibm_mfc.cpp | 17 +++++++------- src/devices/bus/ss50/mpc.cpp | 11 ++++----- src/devices/machine/clock.h | 7 ------ src/devices/machine/input_merger.h | 22 ------------------ src/devices/machine/meters.h | 5 +--- src/devices/machine/mos6551.cpp | 9 ++++---- src/devices/machine/msm6242.h | 5 ---- src/mame/audio/cmi01a.cpp | 8 +++---- src/mame/audio/exidy.cpp | 6 ++--- src/mame/drivers/4004clk.cpp | 4 ++-- src/mame/drivers/adp.cpp | 4 ++-- src/mame/drivers/amiga.cpp | 6 ++--- src/mame/drivers/apricotf.cpp | 3 +-- src/mame/drivers/att4425.cpp | 8 +++---- src/mame/drivers/bfcobra.cpp | 7 +++--- src/mame/drivers/bfm_sc1.cpp | 35 ++++++++++++++-------------- src/mame/drivers/bfm_sc2.cpp | 24 +++++++++---------- src/mame/drivers/bfmsys85.cpp | 19 ++++++++-------- src/mame/drivers/btime.cpp | 3 +-- src/mame/drivers/calomega.cpp | 43 ++++++++++++++++++----------------- src/mame/drivers/cdc721.cpp | 3 +-- src/mame/drivers/chessmst.cpp | 4 ++-- src/mame/drivers/cmi.cpp | 11 ++++----- src/mame/drivers/d9final.cpp | 2 +- src/mame/drivers/dblewing.cpp | 3 +-- src/mame/drivers/ddenlovr.cpp | 18 +++++---------- src/mame/drivers/decwritr.cpp | 3 +-- src/mame/drivers/divebomb.cpp | 3 +-- src/mame/drivers/dooyong.cpp | 11 ++++----- src/mame/drivers/duet16.cpp | 6 ++--- src/mame/drivers/dvk_kcgd.cpp | 4 ++-- src/mame/drivers/dvk_ksm.cpp | 4 ++-- src/mame/drivers/ecoinf2.cpp | 2 +- src/mame/drivers/fb01.cpp | 4 ++-- src/mame/drivers/fccpu30.cpp | 12 +++++----- src/mame/drivers/ggconnie.cpp | 2 +- src/mame/drivers/hazeltin.cpp | 3 +-- src/mame/drivers/idsa.cpp | 17 +++++++------- src/mame/drivers/inderp.cpp | 15 ++++++------ src/mame/drivers/instantm.cpp | 4 ++-- src/mame/drivers/isbc8010.cpp | 4 ++-- src/mame/drivers/joystand.cpp | 2 +- src/mame/drivers/jpmimpct.cpp | 6 ++--- src/mame/drivers/jpmmps.cpp | 13 +++++------ src/mame/drivers/jpmsys5.cpp | 4 ++-- src/mame/drivers/lsasquad.cpp | 6 ++--- src/mame/drivers/luckgrln.cpp | 4 ++-- src/mame/drivers/manohman.cpp | 18 +++++++-------- src/mame/drivers/maygay1b.cpp | 12 +++++----- src/mame/drivers/mekd2.cpp | 8 +++---- src/mame/drivers/mpu3.cpp | 16 ++++++------- src/mame/drivers/ms0515.cpp | 8 +++---- src/mame/drivers/namcona1.cpp | 2 +- src/mame/drivers/nc.cpp | 4 ++-- src/mame/drivers/nightgal.cpp | 16 ++++++------- src/mame/drivers/octopus.cpp | 8 +++---- src/mame/drivers/play_1.cpp | 24 +++++++++---------- src/mame/drivers/play_3.cpp | 32 ++++++++++++++------------ src/mame/drivers/poly.cpp | 3 +-- src/mame/drivers/proconn.cpp | 2 +- src/mame/drivers/prophet600.cpp | 4 ++-- src/mame/drivers/rpunch.cpp | 6 ++--- src/mame/drivers/spiders.cpp | 3 +-- src/mame/drivers/sun2.cpp | 6 ++--- src/mame/drivers/suprnova.cpp | 2 +- src/mame/drivers/swtpc.cpp | 6 ++--- src/mame/drivers/taitosj.cpp | 6 ++--- src/mame/drivers/tek405x.cpp | 4 ++-- src/mame/drivers/thomson.cpp | 11 ++++----- src/mame/drivers/tv910.cpp | 22 +++++++++--------- src/mame/drivers/ultraman.cpp | 3 +-- src/mame/drivers/v1050.cpp | 8 +++---- src/mame/drivers/vlc.cpp | 4 ++-- src/mame/drivers/wildpkr.cpp | 6 ++--- src/mame/drivers/williams.cpp | 21 +++++++---------- src/mame/drivers/wmg.cpp | 6 ++--- src/mame/drivers/zorba.cpp | 9 +++----- src/mame/machine/apollo.cpp | 4 ++-- src/mame/machine/mpu4.cpp | 16 ++++++------- 86 files changed, 333 insertions(+), 411 deletions(-) diff --git a/src/devices/bus/a2bus/a2midi.cpp b/src/devices/bus/a2bus/a2midi.cpp index d73aaf82bbc..7f7cde4fd03 100644 --- a/src/devices/bus/a2bus/a2midi.cpp +++ b/src/devices/bus/a2bus/a2midi.cpp @@ -46,8 +46,8 @@ MACHINE_CONFIG_START(a2bus_midi_device::device_add_mconfig) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") - MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, a2bus_midi_device, write_acia_clock)) + clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16)); + acia_clock.signal_handler().set(FUNC(a2bus_midi_device::write_acia_clock)); MACHINE_CONFIG_END //************************************************************************** diff --git a/src/devices/bus/c64/midi_maplin.cpp b/src/devices/bus/c64/midi_maplin.cpp index 1845f167e33..85aa5ef0cd2 100644 --- a/src/devices/bus/c64/midi_maplin.cpp +++ b/src/devices/bus/c64/midi_maplin.cpp @@ -54,8 +54,8 @@ MACHINE_CONFIG_START(c64_maplin_midi_cartridge_device::device_add_mconfig) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") - MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, c64_maplin_midi_cartridge_device, write_acia_clock)) + clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16)); + acia_clock.signal_handler().set(FUNC(c64_maplin_midi_cartridge_device::write_acia_clock)); MACHINE_CONFIG_END diff --git a/src/devices/bus/c64/midi_namesoft.cpp b/src/devices/bus/c64/midi_namesoft.cpp index c572cf4ea55..067abc90e5d 100644 --- a/src/devices/bus/c64/midi_namesoft.cpp +++ b/src/devices/bus/c64/midi_namesoft.cpp @@ -54,8 +54,8 @@ MACHINE_CONFIG_START(c64_namesoft_midi_cartridge_device::device_add_mconfig) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") - MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, c64_namesoft_midi_cartridge_device, write_acia_clock)) + clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16)); + acia_clock.signal_handler().set(FUNC(c64_namesoft_midi_cartridge_device::write_acia_clock)); MACHINE_CONFIG_END diff --git a/src/devices/bus/c64/midi_passport.cpp b/src/devices/bus/c64/midi_passport.cpp index bedab8e52c1..1544ef7c2b4 100644 --- a/src/devices/bus/c64/midi_passport.cpp +++ b/src/devices/bus/c64/midi_passport.cpp @@ -72,8 +72,8 @@ MACHINE_CONFIG_START(c64_passport_midi_cartridge_device::device_add_mconfig) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") - MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16) /// TODO: work out if the clock should come from the 6840 - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, c64_passport_midi_cartridge_device, write_acia_clock)) + clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16)); // TODO: work out if the clock should come from the 6840 + acia_clock.signal_handler().set(FUNC(c64_passport_midi_cartridge_device::write_acia_clock)); MACHINE_CONFIG_END diff --git a/src/devices/bus/c64/midi_sci.cpp b/src/devices/bus/c64/midi_sci.cpp index 9d58052b38a..2128c1dab71 100644 --- a/src/devices/bus/c64/midi_sci.cpp +++ b/src/devices/bus/c64/midi_sci.cpp @@ -54,8 +54,8 @@ MACHINE_CONFIG_START(c64_sequential_midi_cartridge_device::device_add_mconfig) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") - MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, c64_sequential_midi_cartridge_device, write_acia_clock)) + clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16)); + acia_clock.signal_handler().set(FUNC(c64_sequential_midi_cartridge_device::write_acia_clock)); MACHINE_CONFIG_END diff --git a/src/devices/bus/c64/midi_siel.cpp b/src/devices/bus/c64/midi_siel.cpp index f5338bc6995..b15eed4f0b6 100644 --- a/src/devices/bus/c64/midi_siel.cpp +++ b/src/devices/bus/c64/midi_siel.cpp @@ -54,8 +54,8 @@ MACHINE_CONFIG_START(c64_siel_midi_cartridge_device::device_add_mconfig) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") - MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, c64_siel_midi_cartridge_device, write_acia_clock)) + clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16)); + acia_clock.signal_handler().set(FUNC(c64_siel_midi_cartridge_device::write_acia_clock)); MACHINE_CONFIG_END diff --git a/src/devices/bus/isa/gus.cpp b/src/devices/bus/isa/gus.cpp index 99404470140..ecdc2f33c14 100644 --- a/src/devices/bus/isa/gus.cpp +++ b/src/devices/bus/isa/gus.cpp @@ -1275,8 +1275,8 @@ MACHINE_CONFIG_START(isa16_gus_device::device_add_mconfig) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") - MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, isa16_gus_device, write_acia_clock)) + clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16)); + acia_clock.signal_handler().set(FUNC(isa16_gus_device::write_acia_clock)); MACHINE_CONFIG_END ioport_constructor isa16_gus_device::device_input_ports() const diff --git a/src/devices/bus/isa/ibm_mfc.cpp b/src/devices/bus/isa/ibm_mfc.cpp index 30a638d1c27..40ce54ff6fc 100644 --- a/src/devices/bus/isa/ibm_mfc.cpp +++ b/src/devices/bus/isa/ibm_mfc.cpp @@ -374,10 +374,11 @@ ROM_END // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(isa8_ibm_mfc_device::device_add_mconfig) - MCFG_DEVICE_ADD("ibm_mfc", Z80, XTAL(11'800'000) / 2) - MCFG_DEVICE_PROGRAM_MAP(prg_map) - MCFG_DEVICE_IO_MAP(io_map) +void isa8_ibm_mfc_device::device_add_mconfig(machine_config &config) +{ + Z80(config, m_cpu, XTAL(11'800'000) / 2); + m_cpu->set_addrmap(AS_PROGRAM, &isa8_ibm_mfc_device::prg_map); + m_cpu->set_addrmap(AS_IO, &isa8_ibm_mfc_device::io_map); I8255(config, m_d71055c_0); m_d71055c_0->in_pa_callback().set(FUNC(isa8_ibm_mfc_device::ppi0_i_a)); @@ -390,10 +391,10 @@ MACHINE_CONFIG_START(isa8_ibm_mfc_device::device_add_mconfig) m_d71055c_1->in_pb_callback().set(FUNC(isa8_ibm_mfc_device::ppi1_i_b)); m_d71055c_1->out_pc_callback().set(FUNC(isa8_ibm_mfc_device::ppi1_o_c)); - I8251(config, "d71051", 0); + I8251(config, m_d71051, 0); - MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL(4'000'000) / 8) // 500KHz - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, isa8_ibm_mfc_device, write_usart_clock)) + clock_device &usart_clock(CLOCK(config, "usart_clock", XTAL(4'000'000) / 8)); // 500KHz + usart_clock.signal_handler().set(FUNC(isa8_ibm_mfc_device::write_usart_clock)); PIT8253(config, m_d8253, 0); m_d8253->set_clk<0>(XTAL(4'000'000) / 8); @@ -409,7 +410,7 @@ MACHINE_CONFIG_START(isa8_ibm_mfc_device::device_add_mconfig) m_ym2151->irq_handler().set(FUNC(isa8_ibm_mfc_device::ibm_mfc_ym_irq)); m_ym2151->add_route(0, "ymleft", 1.00); m_ym2151->add_route(1, "ymright", 1.00); -MACHINE_CONFIG_END +} //------------------------------------------------- diff --git a/src/devices/bus/ss50/mpc.cpp b/src/devices/bus/ss50/mpc.cpp index eeff1928e92..1627ca94285 100644 --- a/src/devices/bus/ss50/mpc.cpp +++ b/src/devices/bus/ss50/mpc.cpp @@ -100,7 +100,8 @@ DEVICE_INPUT_DEFAULTS_END // machine configuration //------------------------------------------------- -MACHINE_CONFIG_START(ss50_mpc_device::device_add_mconfig) +void ss50_mpc_device::device_add_mconfig(machine_config &config) +{ PIA6821(config, m_pia, 0); // actually MC6820 m_pia->writepa_handler().set("outgate", FUNC(input_merger_device::in_w<0>)).bit(0); m_pia->cb2_handler().set(FUNC(ss50_mpc_device::reader_control_w)); @@ -115,15 +116,13 @@ MACHINE_CONFIG_START(ss50_mpc_device::device_add_mconfig) rs232.rxd_handler().set(FUNC(ss50_mpc_device::serial_input_w)); rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); - MCFG_INPUT_MERGER_ALL_HIGH("outgate") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd)) + INPUT_MERGER_ALL_HIGH(config, "outgate").output_handler().set("rs232", FUNC(rs232_port_device::write_txd)); - MCFG_INPUT_MERGER_ANY_HIGH("loopback") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE("outgate", input_merger_device, in_w<1>)) + INPUT_MERGER_ANY_HIGH(config, m_loopback).output_handler().set("outgate", FUNC(input_merger_device::in_w<1>)); RIPPLE_COUNTER(config, m_counter); // CD4024AE (IC3) m_counter->set_stages(7); // only Q5 (÷32) and Q4 (÷16) are actually used -MACHINE_CONFIG_END +} //------------------------------------------------- diff --git a/src/devices/machine/clock.h b/src/devices/machine/clock.h index 32989a15149..46bb2361909 100644 --- a/src/devices/machine/clock.h +++ b/src/devices/machine/clock.h @@ -6,16 +6,9 @@ #pragma once -#define MCFG_CLOCK_ADD(_tag, _clock) \ - MCFG_DEVICE_ADD(_tag, CLOCK, _clock) - -#define MCFG_CLOCK_SIGNAL_HANDLER(_devcb) \ - downcast(*device).set_signal_handler(DEVCB_##_devcb); - class clock_device : public device_t { public: - template devcb_base &set_signal_handler(Object &&cb) { return m_signal_handler.set_callback(std::forward(cb)); } auto signal_handler() { return m_signal_handler.bind(); } clock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/devices/machine/input_merger.h b/src/devices/machine/input_merger.h index 53af1a38cfd..aa5e66cc1f1 100644 --- a/src/devices/machine/input_merger.h +++ b/src/devices/machine/input_merger.h @@ -15,27 +15,6 @@ #pragma once - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_INPUT_MERGER_ANY_HIGH(_tag) \ - MCFG_DEVICE_ADD(_tag, INPUT_MERGER_ANY_HIGH, 0) - -#define MCFG_INPUT_MERGER_ALL_HIGH(_tag) \ - MCFG_DEVICE_ADD(_tag, INPUT_MERGER_ALL_HIGH, 0) - -#define MCFG_INPUT_MERGER_ANY_LOW(_tag) \ - MCFG_DEVICE_ADD(_tag, INPUT_MERGER_ANY_LOW, 0) - -#define MCFG_INPUT_MERGER_ALL_LOW(_tag) \ - MCFG_DEVICE_ADD(_tag, INPUT_MERGER_ALL_LOW, 0) - -#define MCFG_INPUT_MERGER_OUTPUT_HANDLER(_devcb) \ - downcast(*device).set_output_handler(DEVCB_##_devcb); - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -44,7 +23,6 @@ class input_merger_device : public device_t { public: // callback - template devcb_base &set_output_handler(Object &&cb) { return m_output_handler.set_callback(std::forward(cb)); } auto output_handler() { return m_output_handler.bind(); } // input lines diff --git a/src/devices/machine/meters.h b/src/devices/machine/meters.h index 1a349f82485..c9a11790931 100644 --- a/src/devices/machine/meters.h +++ b/src/devices/machine/meters.h @@ -15,9 +15,6 @@ #pragma once -#define MCFG_METERS_NUMBER(_number) \ - downcast(*device).set_number_meters(_number); - class meters_device : public device_t { public: @@ -27,7 +24,7 @@ public: meters_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_number_meters(int number) { m_number_mtr = number; } + void set_number(int number) { m_number_mtr = number; } int update(int id, int state); int GetActivity(int id); diff --git a/src/devices/machine/mos6551.cpp b/src/devices/machine/mos6551.cpp index 37bb874aaf4..c6ba673d0f6 100644 --- a/src/devices/machine/mos6551.cpp +++ b/src/devices/machine/mos6551.cpp @@ -63,10 +63,11 @@ const int mos6551_device::transmitter_controls[4][3] = {0, 1, 1} }; -MACHINE_CONFIG_START(mos6551_device::device_add_mconfig) - MCFG_DEVICE_ADD("clock", CLOCK, 0) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, mos6551_device, internal_clock)) -MACHINE_CONFIG_END +void mos6551_device::device_add_mconfig(machine_config &config) +{ + CLOCK(config, m_internal_clock, 0); + m_internal_clock->signal_handler().set(FUNC(mos6551_device::internal_clock)); +} void mos6551_device::device_start() diff --git a/src/devices/machine/msm6242.h b/src/devices/machine/msm6242.h index bd6bd89403e..430bbbc10f0 100644 --- a/src/devices/machine/msm6242.h +++ b/src/devices/machine/msm6242.h @@ -40,10 +40,6 @@ #include "dirtc.h" -#define MCFG_MSM6242_OUT_INT_HANDLER(_devcb) \ - downcast(*device).set_out_int_handler(DEVCB_##_devcb); - - // ======================> msm6242_device class msm6242_device : public device_t, public device_rtc_interface @@ -52,7 +48,6 @@ public: // construction/destruction msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_out_int_handler(Object &&cb) { return m_out_int_handler.set_callback(std::forward(cb)); } auto out_int_handler() { return m_out_int_handler.bind(); } // I/O operations diff --git a/src/mame/audio/cmi01a.cpp b/src/mame/audio/cmi01a.cpp index ad3899ac48a..84677301c7b 100644 --- a/src/mame/audio/cmi01a.cpp +++ b/src/mame/audio/cmi01a.cpp @@ -26,7 +26,8 @@ cmi01a_device::cmi01a_device(const machine_config &mconfig, const char *tag, dev { } -MACHINE_CONFIG_START(cmi01a_device::device_add_mconfig) +void cmi01a_device::device_add_mconfig(machine_config &config) +{ PIA6821(config, m_pia[0], 0); // pia_cmi01a_1_config m_pia[0]->readcb1_handler().set(FUNC(cmi01a_device::tri_r)); m_pia[0]->writepa_handler().set(FUNC(cmi01a_device::ws_dir_w)); @@ -49,9 +50,8 @@ MACHINE_CONFIG_START(cmi01a_device::device_add_mconfig) m_ptm->o1_callback().set(FUNC(cmi01a_device::ptm_o1)); m_ptm->irq_callback().set("cmi01a_irq", FUNC(input_merger_device::in_w<4>)); - MCFG_INPUT_MERGER_ANY_HIGH("cmi01a_irq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE(*this, cmi01a_device, cmi01a_irq)) -MACHINE_CONFIG_END + INPUT_MERGER_ANY_HIGH(config, "cmi01a_irq").output_handler().set(FUNC(cmi01a_device::cmi01a_irq)); +} void cmi01a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) diff --git a/src/mame/audio/exidy.cpp b/src/mame/audio/exidy.cpp index 99511cfe215..9eabc95c405 100644 --- a/src/mame/audio/exidy.cpp +++ b/src/mame/audio/exidy.cpp @@ -768,8 +768,7 @@ MACHINE_CONFIG_START(venture_sound_device::device_add_mconfig) m_pia->cb2_handler().set(FUNC(venture_sound_device::pia_cb2_w)); m_pia->irqb_handler().set("audioirq", FUNC(input_merger_device::in_w<1>)); - MCFG_INPUT_MERGER_ANY_HIGH("audioirq") // open collector - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", m6502_device::IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "audioirq").output_handler().set_inputline("audiocpu", m6502_device::IRQ_LINE); // open collector SPEAKER(config, "mono").front_center(); @@ -997,8 +996,7 @@ MACHINE_CONFIG_START(victory_sound_device::device_add_mconfig) m_pia->cb2_handler().set(FUNC(victory_sound_device::main_ack_w)); m_pia->irqb_handler().set("audioirq", FUNC(input_merger_device::in_w<1>)); - MCFG_INPUT_MERGER_ANY_HIGH("audioirq") // open collector - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", m6502_device::IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "audioirq").output_handler().set_inputline("audiocpu", m6502_device::IRQ_LINE); // open collector SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/4004clk.cpp b/src/mame/drivers/4004clk.cpp index d80d369b3a8..e89a880e082 100644 --- a/src/mame/drivers/4004clk.cpp +++ b/src/mame/drivers/4004clk.cpp @@ -153,8 +153,8 @@ MACHINE_CONFIG_START(nixieclock_state::_4004clk) 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_CLOCK_ADD("clk", 60) - MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", I4004_TEST_LINE)) + clock_device &clk(CLOCK(config, "clk", 60)); + clk.signal_handler().set_inputline("maincpu", I4004_TEST_LINE); MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mame/drivers/adp.cpp b/src/mame/drivers/adp.cpp index a48674cf797..e25c64cd256 100644 --- a/src/mame/drivers/adp.cpp +++ b/src/mame/drivers/adp.cpp @@ -558,8 +558,8 @@ MACHINE_CONFIG_START(adp_state::quickjac) NVRAM(config, m_nvram, nvram_device::DEFAULT_NONE); - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) - //MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(*this, adp_state, rtc_irq)) + MSM6242(config, "rtc", XTAL(32'768)); + //rtc.out_int_handler().set(FUNC(adp_state::rtc_irq)); MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index 95b49816f68..63f958d05ab 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -1686,7 +1686,7 @@ MACHINE_CONFIG_START(a2000_state::a2000) ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_512kb_map).set_options(ENDIANNESS_BIG, 16, 22, 0x200000); // real-time clock - MCFG_DEVICE_ADD("u65", MSM6242, XTAL(32'768)) + MSM6242(config, m_rtc, XTAL(32'768)); // cpu slot MCFG_EXPANSION_SLOT_ADD("maincpu", a2000_expansion_cards, nullptr) @@ -1788,7 +1788,7 @@ MACHINE_CONFIG_START(cdtv_state::cdtv) NVRAM(config, "memcard", nvram_device::DEFAULT_ALL_0); // real-time clock - MCFG_DEVICE_ADD("u61", MSM6242, XTAL(32'768)) + MSM6242(config, m_rtc, XTAL(32'768)); // cd-rom controller AMIGA_DMAC(config, m_dmac, amiga_state::CLK_7M_PAL); @@ -1881,7 +1881,7 @@ MACHINE_CONFIG_START(a500p_state::a500p) ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_1mb_map).set_options(ENDIANNESS_BIG, 16, 22, 0x200000); // real-time clock - MCFG_DEVICE_ADD("u9", MSM6242, XTAL(32'768)) + MSM6242(config, m_rtc, XTAL(32'768)); // cpu slot MCFG_EXPANSION_SLOT_ADD("maincpu", a500_expansion_cards, nullptr) diff --git a/src/mame/drivers/apricotf.cpp b/src/mame/drivers/apricotf.cpp index ceffb12675d..9d868cdee5d 100644 --- a/src/mame/drivers/apricotf.cpp +++ b/src/mame/drivers/apricotf.cpp @@ -351,8 +351,7 @@ MACHINE_CONFIG_START(f1_state::act_f1) MCFG_DEVICE_PROGRAM_MAP(act_f1_mem) MCFG_DEVICE_IO_MAP(act_f1_io) - MCFG_INPUT_MERGER_ANY_HIGH("irqs") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0)) + INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0); /* video hardware */ MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) diff --git a/src/mame/drivers/att4425.cpp b/src/mame/drivers/att4425.cpp index 358703a5c43..7f072b37f98 100644 --- a/src/mame/drivers/att4425.cpp +++ b/src/mame/drivers/att4425.cpp @@ -282,8 +282,8 @@ MACHINE_CONFIG_START(att4425_state::att4425) rs232b.rxd_handler().set(m_sio, FUNC(z80sio_device::rxb_w)); // XXX - MCFG_DEVICE_ADD("line_clock", CLOCK, 9600*64) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, att4425_state, write_line_clock)) + clock_device &line_clock(CLOCK(config, "line_clock", 9600*64)); + line_clock.signal_handler().set(FUNC(att4425_state::write_line_clock)); I8251(config, m_i8251, 0); m_i8251->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); @@ -296,8 +296,8 @@ MACHINE_CONFIG_START(att4425_state::att4425) rs232.dsr_handler().set(m_i8251, FUNC(i8251_device::write_dsr)); // XXX - MCFG_DEVICE_ADD("keyboard_clock", CLOCK, 4800*64) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, att4425_state, write_keyboard_clock)) + clock_device &keyboard_clock(CLOCK(config, "keyboard_clock", 4800*64)); + keyboard_clock.signal_handler().set(FUNC(att4425_state::write_keyboard_clock)); RAM(config, RAM_TAG).set_default_size("32K").set_default_value(0); MACHINE_CONFIG_END diff --git a/src/mame/drivers/bfcobra.cpp b/src/mame/drivers/bfcobra.cpp index 4025c0d7ac1..ac979b2976c 100644 --- a/src/mame/drivers/bfcobra.cpp +++ b/src/mame/drivers/bfcobra.cpp @@ -1684,11 +1684,10 @@ MACHINE_CONFIG_START(bfcobra_state::bfcobra) m_acia6850_2->txd_handler().set(FUNC(bfcobra_state::data_acia_tx_w)); m_acia6850_2->irq_handler().set(FUNC(bfcobra_state::m6809_data_irq)); - MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16) // What are the correct ACIA clocks ? - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, bfcobra_state, write_acia_clock)) + clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16)); // What are the correct ACIA clocks ? + acia_clock.signal_handler().set(FUNC(bfcobra_state::write_acia_clock)); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) + METERS(config, m_meters, 0).set_number(8); MACHINE_CONFIG_END /*************************************************************************** diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp index fbd459e45ec..17dd7bd50b6 100644 --- a/src/mame/drivers/bfm_sc1.cpp +++ b/src/mame/drivers/bfm_sc1.cpp @@ -1073,10 +1073,11 @@ INPUT_PORTS_END // machine driver for scorpion1 board /////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// -MACHINE_CONFIG_START(bfm_sc1_state::scorpion1) - MCFG_DEVICE_ADD("maincpu", M6809, MASTER_CLOCK/4) // 6809 CPU at 1 Mhz - MCFG_DEVICE_PROGRAM_MAP(sc1_base) // setup read and write memorymap - MCFG_DEVICE_PERIODIC_INT_DRIVER(bfm_sc1_state, timer_irq, 1000) // generate 1000 IRQ's per second +void bfm_sc1_state::scorpion1(machine_config &config) +{ + M6809(config, m_maincpu, MASTER_CLOCK/4); // 6809 CPU at 1 Mhz + m_maincpu->set_addrmap(AS_PROGRAM, &bfm_sc1_state::sc1_base); // setup read and write memorymap + m_maincpu->set_periodic_int(FUNC(bfm_sc1_state::timer_irq), attotime::from_hz(1000)); // generate 1000 IRQ's per second WATCHDOG_TIMER(config, "watchdog").set_time(PERIOD_OF_555_MONOSTABLE(120000,100e-9)); @@ -1102,37 +1103,37 @@ MACHINE_CONFIG_START(bfm_sc1_state::scorpion1) REEL(config, m_reels[5], STARPOINT_48STEP_REEL, 1, 3, 0x09, 4); m_reels[5]->optic_handler().set(FUNC(bfm_sc1_state::reel_optic_cb<5>)); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) -MACHINE_CONFIG_END + METERS(config, m_meters, 0).set_number(8); +} ///////////////////////////////////////////////////////////////////////////////////// // machine driver for scorpion1 board + adder2 extension //////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// -MACHINE_CONFIG_START(bfm_sc1_state::scorpion1_adder2) +void bfm_sc1_state::scorpion1_adder2(machine_config &config) +{ scorpion1(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(sc1_adder2) // setup read and write memorymap + m_maincpu->set_addrmap(AS_PROGRAM, &bfm_sc1_state::sc1_adder2); // setup read and write memorymap config.set_default_layout(layout_sc1_vid); BFM_ADDER2(config, "adder2", 0); -MACHINE_CONFIG_END +} ///////////////////////////////////////////////////////////////////////////////////// // machine driver for scorpion1 board /////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// -MACHINE_CONFIG_START(bfm_sc1_state::scorpion1_viper) +void bfm_sc1_state::scorpion1_viper(machine_config &config) +{ scorpion1(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(sc1_viper) // setup read and write memorymap - MCFG_DEVICE_ADD("upd",UPD7759) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &bfm_sc1_state::sc1_viper); // setup read and write memorymap + + UPD7759(config, m_upd7759); + m_upd7759->add_route(ALL_OUTPUTS, "mono", 0.50); +} void bfm_sc1_state::sc1_common_init(int reels, int decrypt, int defaultbank) diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp index 7255d669bd1..e427608f631 100644 --- a/src/mame/drivers/bfm_sc2.cpp +++ b/src/mame/drivers/bfm_sc2.cpp @@ -2248,20 +2248,20 @@ INPUT_PORTS_END // machine config fragments for different meters numbers ////////////////// /////////////////////////////////////////////////////////////////////////// -MACHINE_CONFIG_START(bfm_sc2_state::_3meters) - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(3) -MACHINE_CONFIG_END +void bfm_sc2_state::_3meters(machine_config &config) +{ + METERS(config, m_meters, 0).set_number(3); +} -MACHINE_CONFIG_START(bfm_sc2_state::_5meters) - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(5) -MACHINE_CONFIG_END +void bfm_sc2_state::_5meters(machine_config &config) +{ + METERS(config, m_meters, 0).set_number(5); +} -MACHINE_CONFIG_START(bfm_sc2_state::_8meters) - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) -MACHINE_CONFIG_END +void bfm_sc2_state::_8meters(machine_config &config) +{ + METERS(config, m_meters, 0).set_number(8); +} /////////////////////////////////////////////////////////////////////////// // machine driver for scorpion2 board + adder2 expansion ////////////////// diff --git a/src/mame/drivers/bfmsys85.cpp b/src/mame/drivers/bfmsys85.cpp index 88a423de51c..ac14291e3a2 100644 --- a/src/mame/drivers/bfmsys85.cpp +++ b/src/mame/drivers/bfmsys85.cpp @@ -400,17 +400,19 @@ void bfmsys85_state::memmap(address_map &map) // machine driver for system85 board ////////////////////////////////////// -MACHINE_CONFIG_START(bfmsys85_state::bfmsys85) - MCFG_DEVICE_ADD("maincpu", M6809, MASTER_CLOCK/4) // 6809 CPU at 1 Mhz - MCFG_DEVICE_PROGRAM_MAP(memmap) // setup read and write memorymap - MCFG_DEVICE_PERIODIC_INT_DRIVER(bfmsys85_state, timer_irq, 1000) // generate 1000 IRQ's per second +void bfmsys85_state::bfmsys85(machine_config &config) +{ + M6809(config, m_maincpu, MASTER_CLOCK/4); // 6809 CPU at 1 Mhz + m_maincpu->set_addrmap(AS_PROGRAM, &bfmsys85_state::memmap); // setup read and write memorymap + m_maincpu->set_periodic_int(FUNC(bfmsys85_state::timer_irq), attotime::from_hz(1000)); // generate 1000 IRQ's per second + MSC1937(config, m_vfd); ACIA6850(config, m_acia6850_0, 0); m_acia6850_0->txd_handler().set(FUNC(bfmsys85_state::sys85_data_w)); - MCFG_DEVICE_ADD("acia_clock", CLOCK, 31250*16) // What are the correct ACIA clocks ? - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, bfmsys85_state, write_acia_clock)) + clock_device &acia_clock(CLOCK(config, "acia_clock", 31250*16)); // What are the correct ACIA clocks ? + acia_clock.signal_handler().set(FUNC(bfmsys85_state::write_acia_clock)); SPEAKER(config, "mono").front_center(); AY8912(config, "aysnd", MASTER_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 0.25); @@ -426,11 +428,10 @@ MACHINE_CONFIG_START(bfmsys85_state::bfmsys85) REEL(config, m_reel[3], STARPOINT_48STEP_REEL, 1, 3, 0x09, 4); m_reel[3]->optic_handler().set(FUNC(bfmsys85_state::reel_optic_cb<3>)); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) + METERS(config, m_meters, 0).set_number(8); config.set_default_layout(layout_bfmsys85); -MACHINE_CONFIG_END +} // input ports for system85 board ///////////////////////////////////////// diff --git a/src/mame/drivers/btime.cpp b/src/mame/drivers/btime.cpp index 03366773cbf..2cdb297dbe8 100644 --- a/src/mame/drivers/btime.cpp +++ b/src/mame/drivers/btime.cpp @@ -1287,8 +1287,7 @@ MACHINE_CONFIG_START(btime_state::btime) MCFG_DEVICE_PROGRAM_MAP(audio_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("8vck", btime_state, audio_nmi_gen, "screen", 0, 8) - MCFG_INPUT_MERGER_ALL_HIGH("audionmi") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) + INPUT_MERGER_ALL_HIGH(config, "audionmi").output_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI); /* video hardware */ MCFG_SCREEN_ADD(m_screen, RASTER) diff --git a/src/mame/drivers/calomega.cpp b/src/mame/drivers/calomega.cpp index 48a0be9467d..ebc3b18c442 100644 --- a/src/mame/drivers/calomega.cpp +++ b/src/mame/drivers/calomega.cpp @@ -2572,9 +2572,9 @@ WRITE_LINE_MEMBER(calomega_state::write_acia_clock) MACHINE_CONFIG_START(calomega_state::sys903) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, CPU_CLOCK) /* confirmed */ - MCFG_DEVICE_PROGRAM_MAP(sys903_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", calomega_state, irq0_line_hold) + M6502(config, m_maincpu, CPU_CLOCK); /* confirmed */ + m_maincpu->set_addrmap(AS_PROGRAM, &calomega_state::sys903_map); + m_maincpu->set_vblank_int("screen", FUNC(calomega_state::irq0_line_hold)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -2614,35 +2614,35 @@ MACHINE_CONFIG_START(calomega_state::sys903) ACIA6850(config, m_acia6850_0, 0); m_acia6850_0->txd_handler().set(FUNC(calomega_state::write_acia_tx)); - MCFG_DEVICE_ADD("aciabaud", CLOCK, UART_CLOCK) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, calomega_state, write_acia_clock)) + clock_device &aciabaud(CLOCK(config, "aciabaud", UART_CLOCK)); + aciabaud.signal_handler().set(FUNC(calomega_state::write_acia_clock)); MACHINE_CONFIG_END -MACHINE_CONFIG_START(calomega_state::s903mod) +void calomega_state::s903mod(machine_config &config) +{ sys903(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(s903mod_map) + m_maincpu->set_addrmap(AS_PROGRAM, &calomega_state::s903mod_map); /* sound hardware */ subdevice("ay8912")->port_a_read_callback().set_constant(0); - MCFG_DEVICE_REMOVE("acia6850_0") + config.device_remove("acia6850_0"); - MCFG_DEVICE_REMOVE("aciabaud") -MACHINE_CONFIG_END + config.device_remove("aciabaud"); +} -MACHINE_CONFIG_START(calomega_state::sys905) +void calomega_state::sys905(machine_config &config) +{ sys903(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(sys905_map) + m_maincpu->set_addrmap(AS_PROGRAM, &calomega_state::sys905_map); m_pia[0]->readpa_handler().set(FUNC(calomega_state::s905_mux_port_r)); m_pia[0]->writepb_handler().set(FUNC(calomega_state::lamps_905_w)); @@ -2652,19 +2652,20 @@ MACHINE_CONFIG_START(calomega_state::sys905) /* sound hardware */ subdevice("ay8912")->port_a_read_callback().set_constant(0); - MCFG_DEVICE_REMOVE("acia6850_0") + config.device_remove("acia6850_0"); - MCFG_DEVICE_REMOVE("aciabaud") -MACHINE_CONFIG_END + config.device_remove("aciabaud"); +} -MACHINE_CONFIG_START(calomega_state::sys906) +void calomega_state::sys906(machine_config &config) +{ sys903(config); /* basic machine hardware */ - MCFG_DEVICE_REPLACE("maincpu", M65C02, CPU_CLOCK) /* guess */ - MCFG_DEVICE_PROGRAM_MAP(sys906_map) + M65C02(config.replace(), m_maincpu, CPU_CLOCK); /* guess */ + m_maincpu->set_addrmap(AS_PROGRAM, &calomega_state::sys906_map); m_pia[0]->readpa_handler().set(FUNC(calomega_state::pia0_ain_r)); m_pia[0]->readpb_handler().set(FUNC(calomega_state::pia0_bin_r)); @@ -2684,7 +2685,7 @@ MACHINE_CONFIG_START(calomega_state::sys906) config.device_remove("acia6850_0"); config.device_remove("aciabaud"); -MACHINE_CONFIG_END +} /************************************************* diff --git a/src/mame/drivers/cdc721.cpp b/src/mame/drivers/cdc721.cpp index aa0a75f986b..d8e67681405 100644 --- a/src/mame/drivers/cdc721.cpp +++ b/src/mame/drivers/cdc721.cpp @@ -397,8 +397,7 @@ MACHINE_CONFIG_START(cdc721_state::cdc721) chb.cts_handler().set("pbuart", FUNC(ins8250_device::cts_w)); chb.ri_handler().set("pbuart", FUNC(ins8250_device::ri_w)); - MCFG_INPUT_MERGER_ANY_HIGH("int2") // 74S05 (open collector) - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE(*this, cdc721_state, int_w<2>)) + INPUT_MERGER_ANY_HIGH(config, "int2").output_handler().set(FUNC(cdc721_state::int_w<2>)); // 74S05 (open collector) MACHINE_CONFIG_END ROM_START( cdc721 ) diff --git a/src/mame/drivers/chessmst.cpp b/src/mame/drivers/chessmst.cpp index 5b8669f7782..4f2f5b257f0 100644 --- a/src/mame/drivers/chessmst.cpp +++ b/src/mame/drivers/chessmst.cpp @@ -448,8 +448,8 @@ MACHINE_CONFIG_START(chessmst_state::chessmstdm) config.set_default_layout(layout_chessmstdm); - MCFG_DEVICE_ADD("555_timer", CLOCK, 500) // from 555 timer - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, chessmst_state, timer_555_w)) + clock_device &_555_timer(CLOCK(config, "555_timer", 500)); // from 555 timer + _555_timer.signal_handler().set(FUNC(chessmst_state::timer_555_w)); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/cmi.cpp b/src/mame/drivers/cmi.cpp index 3b75ead0147..e67734b4981 100644 --- a/src/mame/drivers/cmi.cpp +++ b/src/mame/drivers/cmi.cpp @@ -2238,8 +2238,8 @@ MACHINE_CONFIG_START(cmi_state::cmi2x) m_cmi02_ptm->o2_callback().set(FUNC(cmi_state::cmi02_ptm_o2)); m_cmi02_ptm->irq_callback().set(FUNC(cmi_state::cmi02_ptm_irq)); - MCFG_DEVICE_ADD("mkbd_acia_clock", CLOCK, 1.8432_MHz_XTAL / 12) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, cmi_state, mkbd_acia_clock)) + clock_device &mkbd_acia_clock(CLOCK(config, "mkbd_acia_clock", 1.8432_MHz_XTAL / 12)); + mkbd_acia_clock.signal_handler().set(FUNC(cmi_state::mkbd_acia_clock)); for (auto &acia : m_q133_acia) MOS6551(config, acia, 1.8432_MHz_XTAL).set_xtal(1.8432_MHz_XTAL); @@ -2265,8 +2265,7 @@ MACHINE_CONFIG_START(cmi_state::cmi2x) m_acia_mkbd_kbd->rts_handler().set("ank_pia", FUNC(pia6821_device::ca2_w)); m_acia_mkbd_kbd->irq_handler().set(FUNC(cmi_state::mkbd_kbd_acia_int)); - MCFG_INPUT_MERGER_ANY_HIGH("irqs") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("alphakeys", M6802_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set_inputline(m_alphakeyscpu, M6802_IRQ_LINE); m_ank_pia->readpa_handler().set(FUNC(cmi_state::ank_col_r)); m_ank_pia->readcb1_handler().set(FUNC(cmi_state::ank_rts_r)); @@ -2275,8 +2274,8 @@ MACHINE_CONFIG_START(cmi_state::cmi2x) m_ank_pia->irqa_handler().set("irqs", FUNC(input_merger_device::in_w<0>)); m_ank_pia->irqb_handler().set("irqs", FUNC(input_merger_device::in_w<1>)); - MCFG_DEVICE_ADD("ank_pia_clock", CLOCK, 9600) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("ank_pia", pia6821_device, ca1_w)) + clock_device &ank_pia_clock(CLOCK(config, "ank_pia_clock", 9600)); + ank_pia_clock.signal_handler().set(m_ank_pia, FUNC(pia6821_device::ca1_w)); PTM6840(config, m_cmi07_ptm, 2000000); // ptm_cmi07_config TODO m_cmi07_ptm->irq_callback().set(FUNC(cmi_state::cmi07_irq)); diff --git a/src/mame/drivers/d9final.cpp b/src/mame/drivers/d9final.cpp index e1704b33ee1..ff62ed7a6fd 100644 --- a/src/mame/drivers/d9final.cpp +++ b/src/mame/drivers/d9final.cpp @@ -331,7 +331,7 @@ MACHINE_CONFIG_START(d9final_state::d9final) //MCFG_DEVICE_ADD("essnd", ES8712, 24000000/3) // clock unknown //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADD("rtc", RTC62421, XTAL(32'768)) // internal oscillator + RTC62421(config, "rtc", XTAL(32'768)); // internal oscillator MACHINE_CONFIG_END diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp index f973a632dcd..08305d4428d 100644 --- a/src/mame/drivers/dblewing.cpp +++ b/src/mame/drivers/dblewing.cpp @@ -364,8 +364,7 @@ MACHINE_CONFIG_START(dblewing_state::dblewing) MCFG_DEVICE_PROGRAM_MAP(sound_map) MCFG_DEVICE_IO_MAP(sound_io) - MCFG_INPUT_MERGER_ANY_HIGH("soundirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", 0)) + INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_audiocpu, 0); MCFG_QUANTUM_TIME(attotime::from_hz(6000)) diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp index ef3e339ba7f..18a0acb72da 100644 --- a/src/mame/drivers/ddenlovr.cpp +++ b/src/mame/drivers/ddenlovr.cpp @@ -10077,8 +10077,7 @@ void ddenlovr_state::kotbinyo(machine_config &config) m_oki->add_route(ALL_OUTPUTS, "mono", 0.80); /* devices */ -// MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) -// MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(*this, ddenlovr_state, hanakanz_rtc_irq)) +// MSM6242(config, "rtc", XTAL(32'768)).out_int_handler().set(FUNC(ddenlovr_state::hanakanz_rtc_irq)); } void ddenlovr_state::kotbinsp(machine_config &config) @@ -10484,8 +10483,7 @@ MACHINE_CONFIG_START(ddenlovr_state::jongtei) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) /* devices */ - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(*this, ddenlovr_state, hanakanz_rtc_irq)) + MSM6242(config, "rtc", XTAL(32'768)).out_int_handler().set(FUNC(ddenlovr_state::hanakanz_rtc_irq)); MACHINE_CONFIG_END MACHINE_CONFIG_START(ddenlovr_state::mjgnight) @@ -10542,8 +10540,7 @@ MACHINE_CONFIG_START(ddenlovr_state::sryudens) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) /* devices */ - MCFG_DEVICE_ADD("rtc", RTC62421, XTAL(32'768)) // internal oscillator - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, trg1)) + RTC62421(config, "rtc", XTAL(32'768)).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg1)); // internal oscillator MACHINE_CONFIG_END /*************************************************************************** @@ -10591,8 +10588,7 @@ MACHINE_CONFIG_START(ddenlovr_state::janshinp) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) /* devices */ - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, trg1)) + MSM6242(config, "rtc", XTAL(32'768)).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg1)); MACHINE_CONFIG_END // Same PCB as janshinp @@ -10665,8 +10661,7 @@ MACHINE_CONFIG_START(ddenlovr_state::seljan2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) /* devices */ - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, trg1)) + MSM6242(config, "rtc", XTAL(32'768)).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg1)); MACHINE_CONFIG_END @@ -10709,8 +10704,7 @@ MACHINE_CONFIG_START(ddenlovr_state::daimyojn) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) /* devices */ - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(*this, ddenlovr_state, hanakanz_rtc_irq)) + MSM6242(config, "rtc", XTAL(32'768)).out_int_handler().set(FUNC(ddenlovr_state::hanakanz_rtc_irq)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/decwritr.cpp b/src/mame/drivers/decwritr.cpp index ead4c944006..63d6637136b 100644 --- a/src/mame/drivers/decwritr.cpp +++ b/src/mame/drivers/decwritr.cpp @@ -453,8 +453,7 @@ MACHINE_CONFIG_START(decwriter_state::la120) usart.rts_handler().set(RS232_TAG, FUNC(rs232_port_device::write_rts)); usart.rxrdy_handler().set("mainint", FUNC(input_merger_device::in_w<1>)); - MCFG_INPUT_MERGER_ANY_HIGH("mainint") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", 0)) + INPUT_MERGER_ANY_HIGH(config, "mainint").output_handler().set_inputline(m_maincpu, 0); rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); rs232.rxd_handler().set("usart", FUNC(i8251_device::write_rxd)); diff --git a/src/mame/drivers/divebomb.cpp b/src/mame/drivers/divebomb.cpp index 842a7cb903a..018a963a6bf 100644 --- a/src/mame/drivers/divebomb.cpp +++ b/src/mame/drivers/divebomb.cpp @@ -402,8 +402,7 @@ MACHINE_CONFIG_START(divebomb_state::divebomb) MCFG_QUANTUM_PERFECT_CPU("fgcpu") - MCFG_INPUT_MERGER_ANY_HIGH("fgcpu_irq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("fgcpu", INPUT_LINE_IRQ0)) + INPUT_MERGER_ANY_HIGH(config, m_fgcpu_irq).output_handler().set_inputline(m_fgcpu, INPUT_LINE_IRQ0); GENERIC_LATCH_8(config, "fg2spr").data_pending_callback().set_inputline(m_spritecpu, INPUT_LINE_IRQ0); diff --git a/src/mame/drivers/dooyong.cpp b/src/mame/drivers/dooyong.cpp index d3545a18b82..44b4c2aa5d8 100644 --- a/src/mame/drivers/dooyong.cpp +++ b/src/mame/drivers/dooyong.cpp @@ -1428,9 +1428,9 @@ READ8_MEMBER(dooyong_z80_ym2203_state::unk_r) ***************************************************************************/ -MACHINE_CONFIG_START(dooyong_z80_ym2203_state::sound_2203) - MCFG_INPUT_MERGER_ANY_HIGH("soundirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", 0)) +void dooyong_z80_ym2203_state::sound_2203(machine_config &config) +{ + INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_audiocpu, 0); SPEAKER(config, "mono").front_center(); @@ -1445,7 +1445,7 @@ MACHINE_CONFIG_START(dooyong_z80_ym2203_state::sound_2203) ym2.irq_handler().set("soundirq", FUNC(input_merger_any_high_device::in_w<1>)); ym2.port_a_read_callback().set(FUNC(dooyong_z80_ym2203_state::unk_r)); ym2.add_route(ALL_OUTPUTS, "mono", 0.40); -MACHINE_CONFIG_END +} MACHINE_CONFIG_START(dooyong_z80_state::sound_2151) SPEAKER(config, "mono").front_center(); @@ -1509,8 +1509,7 @@ MACHINE_CONFIG_START(dooyong_z80_ym2203_state::lastday) MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, lastday) /* sound hardware */ - MCFG_INPUT_MERGER_ANY_HIGH("soundirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", 0)) + INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_audiocpu, 0); SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/duet16.cpp b/src/mame/drivers/duet16.cpp index eed4556f362..1bee25b35c7 100644 --- a/src/mame/drivers/duet16.cpp +++ b/src/mame/drivers/duet16.cpp @@ -401,11 +401,9 @@ MACHINE_CONFIG_START(duet16_state::duet16) kbd.rxd_handler().set("kbusart", FUNC(i8251_device::write_rxd)); kbd.set_option_device_input_defaults("keyboard", DEVICE_INPUT_DEFAULTS_NAME(keyboard)); - MCFG_INPUT_MERGER_ANY_HIGH("kbint") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE("pic", pic8259_device, ir5_w)) // INT2 + INPUT_MERGER_ANY_HIGH(config, "kbint").output_handler().set(m_pic, FUNC(pic8259_device::ir5_w)); // INT2 - MCFG_INPUT_MERGER_ANY_HIGH("tmint") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE("pic", pic8259_device, ir0_w)) // INT6 + INPUT_MERGER_ANY_HIGH(config, m_tmint).output_handler().set(m_pic, FUNC(pic8259_device::ir0_w)); // INT6 UPD765A(config, m_fdc, 8_MHz_XTAL, true, false); m_fdc->drq_wr_callback().set(m_dmac, FUNC(am9517a_device::dreq0_w)); diff --git a/src/mame/drivers/dvk_kcgd.cpp b/src/mame/drivers/dvk_kcgd.cpp index 713cd0fc139..40836bc3791 100644 --- a/src/mame/drivers/dvk_kcgd.cpp +++ b/src/mame/drivers/dvk_kcgd.cpp @@ -368,8 +368,8 @@ MACHINE_CONFIG_START(kcgd_state::kcgd) MS7004(config, m_ms7004, 0); m_ms7004->tx_handler().set("i8251kbd", FUNC(i8251_device::write_rxd)); - MCFG_DEVICE_ADD("keyboard_clock", CLOCK, 4800*16) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, kcgd_state, write_keyboard_clock)) + clock_device &keyboard_clock(CLOCK(config, "keyboard_clock", 4800*16)); + keyboard_clock.signal_handler().set(FUNC(kcgd_state::write_keyboard_clock)); #endif MACHINE_CONFIG_END diff --git a/src/mame/drivers/dvk_ksm.cpp b/src/mame/drivers/dvk_ksm.cpp index 1299bea8ee3..e7af7616f7a 100644 --- a/src/mame/drivers/dvk_ksm.cpp +++ b/src/mame/drivers/dvk_ksm.cpp @@ -465,8 +465,8 @@ MACHINE_CONFIG_START(ksm_state::ksm) m_ms7004->tx_handler().set(m_i8251kbd, FUNC(i8251_device::write_rxd)); // baud rate is supposed to be 4800 but keyboard is slightly faster - MCFG_DEVICE_ADD("keyboard_clock", CLOCK, 4960*16) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, ksm_state, write_keyboard_clock)) + clock_device &keyboard_clock(CLOCK(config, "keyboard_clock", 4960*16)); + keyboard_clock.signal_handler().set(FUNC(ksm_state::write_keyboard_clock)); MACHINE_CONFIG_END ROM_START( dvk_ksm ) diff --git a/src/mame/drivers/ecoinf2.cpp b/src/mame/drivers/ecoinf2.cpp index fef7051f799..c1d6844ba91 100644 --- a/src/mame/drivers/ecoinf2.cpp +++ b/src/mame/drivers/ecoinf2.cpp @@ -542,7 +542,7 @@ void ecoinf2_state::ecoinf2_oxo(machine_config &config) m_reels[3]->optic_handler().set(FUNC(ecoinf2_state::reel_optic_cb<3>)); METERS(config, m_meters, 0); - m_meters->set_number_meters(8); + m_meters->set_number(8); // I8255(config, "ic25_dips", 0); } diff --git a/src/mame/drivers/fb01.cpp b/src/mame/drivers/fb01.cpp index 1a9b62a6628..3a012f9f097 100644 --- a/src/mame/drivers/fb01.cpp +++ b/src/mame/drivers/fb01.cpp @@ -207,8 +207,8 @@ MACHINE_CONFIG_START(fb01_state::fb01) m_upd71051->txrdy_handler().set(FUNC(fb01_state::upd71051_txrdy_w)); m_upd71051->txd_handler().set("mdout", FUNC(midi_port_device::write_txd)); - MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL(4'000'000) / 8) // 500KHz - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, fb01_state, write_usart_clock)) + clock_device &usart_clock(CLOCK(config, "usart_clock", XTAL(4'000'000) / 8)); // 500KHz + usart_clock.signal_handler().set(FUNC(fb01_state::write_usart_clock)); MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") MCFG_MIDI_RX_HANDLER(WRITELINE(*this, fb01_state, midi_in)) diff --git a/src/mame/drivers/fccpu30.cpp b/src/mame/drivers/fccpu30.cpp index 5c56648e275..a51e6973ecf 100644 --- a/src/mame/drivers/fccpu30.cpp +++ b/src/mame/drivers/fccpu30.cpp @@ -749,14 +749,14 @@ MACHINE_CONFIG_START(cpu30_state::cpu30) // m_pit2->timer_irq_callback().set(m_fga002, FUNC(fga002_device::lirq3_w)); // The timer interrupt seems to silence the terminal interrupt, needs invectigation /* FGA-002, Force Gate Array */ - fga002_device &fga002(FGA002(config, m_fga002, 0)); - fga002.out_int().set(FUNC(cpu30_state::fga_irq_callback)); - fga002.liack4().set("duscc", FUNC(duscc_device::iack)); - fga002.liack5().set("duscc2", FUNC(duscc_device::iack)); + FGA002(config, m_fga002, 0); + m_fga002->out_int().set(FUNC(cpu30_state::fga_irq_callback)); + m_fga002->liack4().set("duscc", FUNC(duscc_device::iack)); + m_fga002->liack5().set("duscc2", FUNC(duscc_device::iack)); // RTC - MCFG_DEVICE_ADD("rtc", RTC72423, XTAL(32'768)) // Fake crystal value, the 72423 uses it own internal crystal - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("fga002", fga002_device, lirq0_w)) + RTC72423(config, m_rtc, XTAL(32'768)); // Fake crystal value, the 72423 uses it own internal crystal + m_rtc->out_int_handler().set(m_fga002, FUNC(fga002_device::lirq0_w)); // dual ported ram RAM(config, m_ram).set_default_size("4M").set_extra_options("8M, 16M, 32M"); diff --git a/src/mame/drivers/ggconnie.cpp b/src/mame/drivers/ggconnie.cpp index f640532dbfc..19bbaa6d757 100644 --- a/src/mame/drivers/ggconnie.cpp +++ b/src/mame/drivers/ggconnie.cpp @@ -306,7 +306,7 @@ MACHINE_CONFIG_START(ggconnie_state::ggconnie) huc6202.read_1_callback().set("huc6270_1", FUNC(huc6270_device::read)); huc6202.write_1_callback().set("huc6270_1", FUNC(huc6270_device::write)); - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) + MSM6242(config, m_rtc, XTAL(32'768)); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); diff --git a/src/mame/drivers/hazeltin.cpp b/src/mame/drivers/hazeltin.cpp index 5fc7cf60776..32970e9c271 100644 --- a/src/mame/drivers/hazeltin.cpp +++ b/src/mame/drivers/hazeltin.cpp @@ -700,8 +700,7 @@ MACHINE_CONFIG_START(hazl1500_state::hazl1500) MCFG_DEVICE_IO_MAP(hazl1500_io) MCFG_QUANTUM_PERFECT_CPU(CPU_TAG) - MCFG_INPUT_MERGER_ANY_HIGH("mainint") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE(CPU_TAG, INPUT_LINE_IRQ0)) + INPUT_MERGER_ANY_HIGH(config, "mainint").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0); /* video hardware */ MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) diff --git a/src/mame/drivers/idsa.cpp b/src/mame/drivers/idsa.cpp index dc570538a7b..6598c92e068 100644 --- a/src/mame/drivers/idsa.cpp +++ b/src/mame/drivers/idsa.cpp @@ -332,17 +332,18 @@ void idsa_state::machine_reset() m_irqcnt = 0; } -MACHINE_CONFIG_START(idsa_state::idsa) +void idsa_state::idsa(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, XTAL(8'000'000) / 2) - MCFG_DEVICE_PROGRAM_MAP(maincpu_map) - MCFG_DEVICE_IO_MAP(maincpu_io_map) + Z80(config, m_maincpu, XTAL(8'000'000) / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &idsa_state::maincpu_map); + m_maincpu->set_addrmap(AS_IO, &idsa_state::maincpu_io_map); - MCFG_DEVICE_ADD("irqclk", CLOCK, XTAL(8'000'000) / 4 ) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, idsa_state, clock_w)) + clock_device &irqclock(CLOCK(config, "irqclock", XTAL(8'000'000) / 4)); + irqclock.signal_handler().set(FUNC(idsa_state::clock_w)); /* video hardware */ - //MCFG_DEFAULT_LAYOUT() + //config.set_default_layout() /* sound hardware */ genpin_audio(config); @@ -360,7 +361,7 @@ MACHINE_CONFIG_START(idsa_state::idsa) 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 +} void idsa_state::bsktbllp(machine_config &config) { diff --git a/src/mame/drivers/inderp.cpp b/src/mame/drivers/inderp.cpp index 89128a2074f..caa7b7b3f14 100644 --- a/src/mame/drivers/inderp.cpp +++ b/src/mame/drivers/inderp.cpp @@ -197,21 +197,22 @@ WRITE_LINE_MEMBER( inderp_state::clock_tick ) m_maincpu->set_input_line(M6504_IRQ_LINE, ASSERT_LINE); } -MACHINE_CONFIG_START(inderp_state::inderp) +void inderp_state::inderp(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6504, 434000) // possible calculation of frequency-derived time constant 100k res and 10pf cap - MCFG_DEVICE_PROGRAM_MAP(maincpu_map) + M6504(config, m_maincpu, 434000); // possible calculation of frequency-derived time constant 100k res and 10pf cap + m_maincpu->set_addrmap(AS_PROGRAM, &inderp_state::maincpu_map); - MCFG_DEVICE_ADD("cpoint_clock", CLOCK, 200) // crosspoint detector - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, inderp_state, clock_tick)) + clock_device &cpoint_clock(CLOCK(config, "cpoint_clock", 200)); // crosspoint detector + cpoint_clock.signal_handler().set(FUNC(inderp_state::clock_tick)); /* video hardware */ - //MCFG_DEFAULT_LAYOUT() + //config.set_default_layout() /* sound hardware */ //discrete ? genpin_audio(config); -MACHINE_CONFIG_END +} ROM_START(centauri) diff --git a/src/mame/drivers/instantm.cpp b/src/mame/drivers/instantm.cpp index 7f45523161f..2e2456f9aca 100644 --- a/src/mame/drivers/instantm.cpp +++ b/src/mame/drivers/instantm.cpp @@ -136,8 +136,8 @@ MACHINE_CONFIG_START(instantm_state::instantm) MCFG_DEVICE_IO_MAP(sub_io) // all guesswork - MCFG_DEVICE_ADD("voice_clock", CLOCK, 24000) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, instantm_state, clock_w)) + clock_device &voice_clock(CLOCK(config, "voice_clock", 24000)); + voice_clock.signal_handler().set(FUNC(instantm_state::clock_w)); SPEAKER(config, "speaker").front_center(); MCFG_DEVICE_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) diff --git a/src/mame/drivers/isbc8010.cpp b/src/mame/drivers/isbc8010.cpp index a6c4b4017fa..f0c7ab8f776 100644 --- a/src/mame/drivers/isbc8010.cpp +++ b/src/mame/drivers/isbc8010.cpp @@ -191,8 +191,8 @@ MACHINE_CONFIG_START(isbc8010_state::isbc8010) m_rs232->cts_handler().set(m_usart, FUNC(i8251_device::write_cts)); m_rs232->set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); - MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL(18'432'000)/60) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, isbc8010_state, usart_clock_tick)) + clock_device &usart_clock(CLOCK(config, "usart_clock", XTAL(18'432'000)/60)); + usart_clock.signal_handler().set(FUNC(isbc8010_state::usart_clock_tick)); /* video hardware */ // 96364 crt controller diff --git a/src/mame/drivers/joystand.cpp b/src/mame/drivers/joystand.cpp index 900f3ccb810..c1e946e5f46 100644 --- a/src/mame/drivers/joystand.cpp +++ b/src/mame/drivers/joystand.cpp @@ -637,7 +637,7 @@ MACHINE_CONFIG_START(joystand_state::joystand) // devices EEPROM_93C46_16BIT(config, "eeprom"); - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) + MSM6242(config, "rtc", XTAL(32'768)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/jpmimpct.cpp b/src/mame/drivers/jpmimpct.cpp index aa374ed298c..1cc9c691cfd 100644 --- a/src/mame/drivers/jpmimpct.cpp +++ b/src/mame/drivers/jpmimpct.cpp @@ -871,8 +871,7 @@ MACHINE_CONFIG_START(jpmimpct_state::jpmimpct) MCFG_VIDEO_START_OVERRIDE(jpmimpct_state,jpmimpct) - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(5) + METERS(config, m_meters, 0).set_number(5); MACHINE_CONFIG_END @@ -1348,8 +1347,7 @@ MACHINE_CONFIG_START(jpmimpct_state::impctawp) REEL(config, m_reel[5], STARPOINT_48STEP_REEL, 1, 3, 0x09, 4); m_reel[5]->optic_handler().set(FUNC(jpmimpct_state::reel_optic_cb<5>)); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(5) + METERS(config, m_meters, 0).set_number(5); MACHINE_CONFIG_END diff --git a/src/mame/drivers/jpmmps.cpp b/src/mame/drivers/jpmmps.cpp index 80ec4239389..a1b00b147f1 100644 --- a/src/mame/drivers/jpmmps.cpp +++ b/src/mame/drivers/jpmmps.cpp @@ -248,8 +248,8 @@ void jpmmps_state::machine_reset() m_maincpu->reset_line(ASSERT_LINE); } -MACHINE_CONFIG_START(jpmmps_state::jpmmps) - +void jpmmps_state::jpmmps(machine_config &config) +{ // CPU TMS9995, standard variant; no line connections TMS9995(config, m_maincpu, MAIN_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &jpmmps_state::jpmmps_map); @@ -284,14 +284,13 @@ MACHINE_CONFIG_START(jpmmps_state::jpmmps) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("sn", SN76489, SOUND_CLOCK) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + SN76489(config, m_psg, SOUND_CLOCK); + m_psg->add_route(ALL_OUTPUTS, "mono", 1.00); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(9) // TODO: meters.cpp sets a max of 8 + METERS(config, m_meters, 0).set_number(9); // TODO: meters.cpp sets a max of 8 config.set_default_layout(layout_jpmmps); -MACHINE_CONFIG_END +} diff --git a/src/mame/drivers/jpmsys5.cpp b/src/mame/drivers/jpmsys5.cpp index 9235db40b6a..38f431377b8 100644 --- a/src/mame/drivers/jpmsys5.cpp +++ b/src/mame/drivers/jpmsys5.cpp @@ -858,7 +858,7 @@ void jpmsys5_state::jpmsys5_ym(machine_config &config) ptm.irq_callback().set(FUNC(jpmsys5_state::ptm_irq)); config.set_default_layout(layout_jpmsys5); - METERS(config, m_meters, 0).set_number_meters(8); + METERS(config, m_meters, 0).set_number(8); } // the first rev PCB used an SAA1099 @@ -914,7 +914,7 @@ void jpmsys5_state::jpmsys5(machine_config &config) ptm.irq_callback().set(FUNC(jpmsys5_state::ptm_irq)); config.set_default_layout(layout_jpmsys5); - METERS(config, m_meters, 0).set_number_meters(8); + METERS(config, m_meters, 0).set_number(8); } /************************************* diff --git a/src/mame/drivers/lsasquad.cpp b/src/mame/drivers/lsasquad.cpp index b75ad9fb27e..603bb9f4161 100644 --- a/src/mame/drivers/lsasquad.cpp +++ b/src/mame/drivers/lsasquad.cpp @@ -578,8 +578,7 @@ MACHINE_CONFIG_START(lsasquad_state::lsasquad) GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>)); - MCFG_INPUT_MERGER_ALL_HIGH("soundnmi") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) + INPUT_MERGER_ALL_HIGH(config, "soundnmi").output_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI); GENERIC_LATCH_8(config, m_soundlatch2); @@ -644,8 +643,7 @@ MACHINE_CONFIG_START(lsasquad_state::daikaiju) GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set("soundnmi", FUNC(input_merger_device::in_w<0>)); - MCFG_INPUT_MERGER_ALL_HIGH("soundnmi") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) + INPUT_MERGER_ALL_HIGH(config, "soundnmi").output_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/luckgrln.cpp b/src/mame/drivers/luckgrln.cpp index 63507f60509..b0f1080b070 100644 --- a/src/mame/drivers/luckgrln.cpp +++ b/src/mame/drivers/luckgrln.cpp @@ -872,7 +872,7 @@ MACHINE_CONFIG_START(luckgrln_state::luckgrln) crtc.set_show_border_area(false); crtc.set_char_width(8); - MCFG_DEVICE_ADD("rtc", MSM6242, 0) + MSM6242(config, "rtc", 0); MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -895,7 +895,7 @@ MACHINE_CONFIG_START(luckgrln_state::_7smash) MCFG_DEVICE_PROGRAM_MAP(_7smash_map) MCFG_DEVICE_IO_MAP(_7smash_io) - MCFG_DEVICE_REMOVE("rtc") + config.device_remove("rtc"); MACHINE_CONFIG_END void luckgrln_state::init_luckgrln() diff --git a/src/mame/drivers/manohman.cpp b/src/mame/drivers/manohman.cpp index 21171980b66..57c29b77ebe 100644 --- a/src/mame/drivers/manohman.cpp +++ b/src/mame/drivers/manohman.cpp @@ -8,7 +8,7 @@ Preliminary driver by Roberto Fresca. - German board game similar to Ludo, derivated from the indian game Parchisi. + German board game similar to Ludo, derived from the Indian game Parchisi. Coin-operated machine for 1-4 players. No screen, just artwork and lamps. The machine was designed for pubs, etc... @@ -242,10 +242,11 @@ INPUT_PORTS_END * Machine Config * *********************************************/ -MACHINE_CONFIG_START(manohman_state::manohman) - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(8'000'000)) // MC68000P8 - MCFG_DEVICE_PROGRAM_MAP(mem_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(manohman_state, iack_handler) +void manohman_state::manohman(machine_config &config) +{ + M68000(config, m_maincpu, XTAL(8'000'000)); // MC68000P8 + m_maincpu->set_addrmap(AS_PROGRAM, &manohman_state::mem_map); + m_maincpu->set_irq_acknowledge_callback(FUNC(manohman_state::iack_handler)); PIT68230(config, m_pit, XTAL(8'000'000)); // MC68230P8 m_pit->timer_irq_callback().set_inputline("maincpu", M68K_IRQ_2); @@ -253,14 +254,13 @@ MACHINE_CONFIG_START(manohman_state::manohman) MC68681(config, m_duart, XTAL(3'686'400)); m_duart->irq_cb().set_inputline(m_maincpu, M68K_IRQ_4); - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) // M62X42B + MSM6242(config, "rtc", XTAL(32'768)); // M62X42B NVRAM(config, "nvram", nvram_device::DEFAULT_NONE); // KM6264BL-10 x2 + MAX696CFL + battery SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("saa", SAA1099, XTAL(8'000'000) / 2) // clock not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) -MACHINE_CONFIG_END + SAA1099(config, "saa", XTAL(8'000'000) / 2).add_route(ALL_OUTPUTS, "mono", 0.10); // clock not verified +} /********************************************* diff --git a/src/mame/drivers/maygay1b.cpp b/src/mame/drivers/maygay1b.cpp index e06204f27b4..90905c42dfd 100644 --- a/src/mame/drivers/maygay1b.cpp +++ b/src/mame/drivers/maygay1b.cpp @@ -836,25 +836,25 @@ MACHINE_CONFIG_START(maygay1b_state::maygay_m1) REEL(config, m_reels[5], STARPOINT_48STEP_REEL, 1, 3, 0x09, 4); m_reels[5]->optic_handler().set(FUNC(maygay1b_state::reel_optic_cb<5>)); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) + METERS(config, m_meters, 0).set_number(8); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); config.set_default_layout(layout_maygay1b); MACHINE_CONFIG_END -MACHINE_CONFIG_START(maygay1b_state::maygay_m1_no_oki) +void maygay1b_state::maygay_m1_no_oki(machine_config &config) +{ maygay_m1(config); - MCFG_DEVICE_REMOVE("msm6376") -MACHINE_CONFIG_END + config.device_remove("msm6376"); +} MACHINE_CONFIG_START(maygay1b_state::maygay_m1_nec) maygay_m1(config); MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(m1_nec_memmap) - MCFG_DEVICE_REMOVE("msm6376") + config.device_remove("msm6376"); MCFG_DEVICE_ADD("upd", UPD7759) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) diff --git a/src/mame/drivers/mekd2.cpp b/src/mame/drivers/mekd2.cpp index e0bd9db2663..868a42de83e 100644 --- a/src/mame/drivers/mekd2.cpp +++ b/src/mame/drivers/mekd2.cpp @@ -405,11 +405,11 @@ MACHINE_CONFIG_START(mekd2_state::mekd2) ACIA6850(config, m_acia, 0); m_acia->txd_handler().set(FUNC(mekd2_state::cass_w)); - MCFG_DEVICE_ADD("acia_tx_clock", CLOCK, XTAL_MEKD2 / 256) // 4800Hz - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia", acia6850_device, write_txc)) + clock_device &acia_tx_clock(CLOCK(config, "acia_tx_clock", XTAL_MEKD2 / 256)); // 4800Hz + acia_tx_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_txc)); - MCFG_DEVICE_ADD("acia_rx_clock", CLOCK, 300) // toggled by cassette circuit - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("acia", acia6850_device, write_rxc)) + clock_device &acia_rx_clock(CLOCK(config, "acia_rx_clock", 300)); // toggled by cassette circuit + acia_rx_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_rxc)); MCFG_TIMER_DRIVER_ADD_PERIODIC("mekd2_c", mekd2_state, mekd2_c, attotime::from_hz(4800)) MCFG_TIMER_DRIVER_ADD_PERIODIC("mekd2_p", mekd2_state, mekd2_p, attotime::from_hz(40000)) diff --git a/src/mame/drivers/mpu3.cpp b/src/mame/drivers/mpu3.cpp index fa4d828b5d7..c4a811eb4c8 100644 --- a/src/mame/drivers/mpu3.cpp +++ b/src/mame/drivers/mpu3.cpp @@ -822,17 +822,18 @@ void mpu3_state::mpu3_basemap(address_map &map) map(0xa800, 0xa803).rw(m_pia6, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); /* PIA6821 IC6 */ } -MACHINE_CONFIG_START(mpu3_state::mpu3base) - MCFG_DEVICE_ADD("maincpu", M6808, 4_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(mpu3_basemap) +void mpu3_state::mpu3base(machine_config &config) +{ + M6808(config, m_maincpu, 4_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &mpu3_state::mpu3_basemap); input_merger_device &mainirq(INPUT_MERGER_ANY_HIGH(config, "mainirq")); // open collector mainirq.output_handler().set_inputline("maincpu", M6808_IRQ_LINE); MSC1937(config, m_vfd); - MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu3_state, gen_50hz, attotime::from_hz(100)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("555_ic10", mpu3_state, ic10_callback, PERIOD_OF_555_ASTABLE(10000,1000,0.0000001)) + TIMER(config, "50hz").configure_periodic(FUNC(mpu3_state::gen_50hz), attotime::from_hz(100)); + TIMER(config, "555_ic10").configure_periodic(FUNC(mpu3_state::ic10_callback), PERIOD_OF_555_ASTABLE(10000,1000,0.0000001)); /* 6840 PTM */ PTM6840(config, m_ptm2, 4_MHz_XTAL / 4); @@ -880,13 +881,12 @@ MACHINE_CONFIG_START(mpu3_state::mpu3base) REEL(config, m_reels[3], MPU3_48STEP_REEL, 1, 3, 0x00, 2); m_reels[3]->optic_handler().set(FUNC(mpu3_state::reel_optic_cb<3>)); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) + METERS(config, m_meters, 0).set_number(8); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // 2x HM4334 or HMI6514 or MB8414 + 2.4V battery config.set_default_layout(layout_mpu3); -MACHINE_CONFIG_END +} static const mpu3_chr_table hprvpr_data[64] = { diff --git a/src/mame/drivers/ms0515.cpp b/src/mame/drivers/ms0515.cpp index 3d2de87af00..d8940b439b0 100644 --- a/src/mame/drivers/ms0515.cpp +++ b/src/mame/drivers/ms0515.cpp @@ -561,8 +561,8 @@ MACHINE_CONFIG_START(ms0515_state::ms0515) m_rs232->cts_handler().set(m_i8251line, FUNC(i8251_device::write_cts)); m_rs232->dsr_handler().set(m_i8251line, FUNC(i8251_device::write_dsr)); -// MCFG_DEVICE_ADD("line_clock", CLOCK, 4800*16) // 8251 is set to /16 on the clock input -// MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, ms0515_state, write_line_clock)) +// clock_device &line_clock(CLOCK(config, "line_clock", 4800*16)); // 8251 is set to /16 on the clock input +// line_clock.signal_handler().set(FUNC(ms0515_state::write_line_clock)); // serial connection to MS7004 keyboard I8251(config, m_i8251kbd, 0); @@ -574,8 +574,8 @@ MACHINE_CONFIG_START(ms0515_state::ms0515) m_ms7004->rts_handler().set(m_i8251kbd, FUNC(i8251_device::write_cts)); // baud rate is supposed to be 4800 but keyboard is slightly faster - MCFG_DEVICE_ADD("keyboard_clock", CLOCK, 4960*16) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, ms0515_state, write_keyboard_clock)) + clock_device &keyboard_clock(CLOCK(config, "keyboard_clock", 4960*16)); + keyboard_clock.signal_handler().set(FUNC(ms0515_state::write_keyboard_clock)); PIT8253(config, m_pit8253, 0); m_pit8253->set_clk<0>(XTAL(2'000'000)); diff --git a/src/mame/drivers/namcona1.cpp b/src/mame/drivers/namcona1.cpp index f8553076ba8..676acf39850 100644 --- a/src/mame/drivers/namcona1.cpp +++ b/src/mame/drivers/namcona1.cpp @@ -1043,7 +1043,7 @@ void xday2_namcona2_state::xday2(machine_config &config) EEPROM_2864(config, "eeprom"); // TODO: unknown sub type - MSM6242(config,"rtc", XTAL(32'768)); + MSM6242(config, "rtc", XTAL(32'768)); } /* NA-1 Hardware */ diff --git a/src/mame/drivers/nc.cpp b/src/mame/drivers/nc.cpp index 48f562c3dee..0bfa84aba27 100644 --- a/src/mame/drivers/nc.cpp +++ b/src/mame/drivers/nc.cpp @@ -1406,8 +1406,8 @@ MACHINE_CONFIG_START(nc_state::nc_base) /* uart */ I8251(config, m_uart, 0); - MCFG_DEVICE_ADD("uart_clock", CLOCK, 19200) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, nc_state, write_uart_clock)) + clock_device &uart_clock(CLOCK(config, "uart_clock", 19200)); + uart_clock.signal_handler().set(FUNC(nc_state::write_uart_clock)); /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("cardslot", generic_plain_slot, nullptr) diff --git a/src/mame/drivers/nightgal.cpp b/src/mame/drivers/nightgal.cpp index 1c37a4757e0..6e7572e468f 100644 --- a/src/mame/drivers/nightgal.cpp +++ b/src/mame/drivers/nightgal.cpp @@ -794,7 +794,7 @@ MACHINE_CONFIG_START(nightgal_state::royalqn) MCFG_DEVICE_ADD("maincpu", Z80,MASTER_CLOCK / 8) /* ? MHz */ MCFG_DEVICE_PROGRAM_MAP(royalqn_map) MCFG_DEVICE_IO_MAP(royalqn_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", nightgal_state, irq0_line_hold) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", nightgal_state, irq0_line_hold) MCFG_DEVICE_ADD("sub", NSC8105, MASTER_CLOCK / 8) MCFG_DEVICE_PROGRAM_MAP(royalqn_nsc_map) @@ -835,14 +835,14 @@ MACHINE_CONFIG_START(nightgal_state::sexygal) MCFG_DEVICE_ADD("audiocpu", NSC8105, MASTER_CLOCK / 8) MCFG_DEVICE_PROGRAM_MAP(sexygal_audio_map) - MCFG_DEVICE_ADD("sampleclk", CLOCK, 6000) // quite a wild guess - MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) + clock_device &sampleclk(CLOCK(config, "sampleclk", 6000)); // quite a wild guess + sampleclk.signal_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI); MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) // unknown DAC 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_REMOVE("aysnd") + config.device_remove("aysnd"); ym2203_device &ymsnd(YM2203(config, "ymsnd", MASTER_CLOCK / 8)); ymsnd.port_a_read_callback().set(FUNC(nightgal_state::input_1p_r)); @@ -856,8 +856,8 @@ MACHINE_CONFIG_START(nightgal_state::sweetgal) MCFG_DEVICE_PROGRAM_MAP(sweetgal_map) // doesn't have the extra NSC8105 (so how does this play samples?) - MCFG_DEVICE_REMOVE("audiocpu") - MCFG_DEVICE_REMOVE("sampleclk") + config.device_remove("audiocpu"); + config.device_remove("sampleclk"); MACHINE_CONFIG_END MACHINE_CONFIG_START(nightgal_state::ngalsumr) @@ -876,8 +876,8 @@ MACHINE_CONFIG_START(nightgal_state::sgaltrop) MCFG_DEVICE_MODIFY("sub") MCFG_DEVICE_PROGRAM_MAP(sgaltrop_nsc_map) - MCFG_DEVICE_REMOVE("audiocpu") - MCFG_DEVICE_REMOVE("sampleclk") + config.device_remove("audiocpu"); + config.device_remove("sampleclk"); MACHINE_CONFIG_END /* diff --git a/src/mame/drivers/octopus.cpp b/src/mame/drivers/octopus.cpp index ce0d1e97811..664ecf01c53 100644 --- a/src/mame/drivers/octopus.cpp +++ b/src/mame/drivers/octopus.cpp @@ -968,10 +968,10 @@ MACHINE_CONFIG_START(octopus_state::octopus) m_kb_uart->rts_handler().set(FUNC(octopus_state::beep_w)); rs232_port_device &keyboard_port(RS232_PORT(config, "keyboard_port", keyboard, "octopus")); keyboard_port.rxd_handler().set(m_kb_uart, FUNC(i8251_device::write_rxd)); - MCFG_DEVICE_ADD("keyboard_clock_rx", CLOCK, 9600 * 64) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(m_kb_uart,i8251_device,write_rxc)) - MCFG_DEVICE_ADD("keyboard_clock_tx", CLOCK, 1200 * 64) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(m_kb_uart,i8251_device,write_txc)) + clock_device &keyboard_clock_rx(CLOCK(config, "keyboard_clock_rx", 9600 * 64)); + keyboard_clock_rx.signal_handler().set(m_kb_uart, FUNC(i8251_device::write_rxc)); + clock_device &keyboard_clock_tx(CLOCK(config, "keyboard_clock_tx", 1200 * 64)); + keyboard_clock_tx.signal_handler().set(m_kb_uart, FUNC(i8251_device::write_txc)); FD1793(config, m_fdc, 16_MHz_XTAL / 8); m_fdc->intrq_wr_callback().set(m_pic1, FUNC(pic8259_device::ir5_w)); diff --git a/src/mame/drivers/play_1.cpp b/src/mame/drivers/play_1.cpp index 8bc2377518b..babe72507cb 100644 --- a/src/mame/drivers/play_1.cpp +++ b/src/mame/drivers/play_1.cpp @@ -470,7 +470,8 @@ WRITE_LINE_MEMBER( play_1_state::clock_w ) } } -MACHINE_CONFIG_START(play_1_state::play_1) +void play_1_state::play_1(machine_config &config) +{ /* basic machine hardware */ CDP1802(config, m_maincpu, 400000); // 2 gates, 1 cap, 1 resistor oscillating somewhere between 350 to 450 kHz m_maincpu->set_addrmap(AS_PROGRAM, &play_1_state::play_1_map); @@ -486,23 +487,22 @@ MACHINE_CONFIG_START(play_1_state::play_1) /* Video */ config.set_default_layout(layout_play_1); - MCFG_DEVICE_ADD("xpoint", CLOCK, 100) // crossing-point detector - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, play_1_state, clock_w)) + clock_device &xpoint(CLOCK(config, "xpoint", 100)); // crossing-point detector + xpoint.signal_handler().set(FUNC(play_1_state::clock_w)); /* Sound */ genpin_audio(config); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_DEVICE_ADD("monotone", CLOCK, 0) // sound device - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("speaker", speaker_sound_device, level_w)) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); + CLOCK(config, m_monotone, 0); // sound device + m_monotone->signal_handler().set("speaker", FUNC(speaker_sound_device::level_w)); +} -MACHINE_CONFIG_START(play_1_state::chance) +void play_1_state::chance(machine_config &config) +{ play_1(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(chance_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &play_1_state::chance_map); +} /*------------------------------------------------------------------- / Space Gambler (03/78) diff --git a/src/mame/drivers/play_3.cpp b/src/mame/drivers/play_3.cpp index 2bbedc27b12..fc80f44261c 100644 --- a/src/mame/drivers/play_3.cpp +++ b/src/mame/drivers/play_3.cpp @@ -475,7 +475,8 @@ WRITE_LINE_MEMBER( play_3_state::q4013a_w ) m_clockcnt = 0; } -MACHINE_CONFIG_START(play_3_state::play_3) +void play_3_state::play_3(machine_config &config) +{ /* basic machine hardware */ CDP1802(config, m_maincpu, 3.579545_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &play_3_state::play_3_map); @@ -493,8 +494,8 @@ MACHINE_CONFIG_START(play_3_state::play_3) config.set_default_layout(layout_play_3); // Devices - MCFG_DEVICE_ADD("xpoint", CLOCK, 60) // crossing-point detector - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, play_3_state, clock2_w)) + clock_device &xpoint(CLOCK(config, "xpoint", 60)); // crossing-point detector + xpoint.signal_handler().set(FUNC(play_3_state::clock2_w)); // This is actually a 4013 chip (has 2 RS flipflops) TTL7474(config, m_4013a, 0); @@ -518,28 +519,29 @@ MACHINE_CONFIG_START(play_3_state::play_3) SPEAKER(config, "rspeaker").front_right(); AY8910(config, m_aysnd1, 3.579545_MHz_XTAL / 2).add_route(ALL_OUTPUTS, "lspeaker", 0.75); AY8910(config, m_aysnd2, 3.579545_MHz_XTAL / 2).add_route(ALL_OUTPUTS, "rspeaker", 0.75); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(play_3_state::megaaton) +void play_3_state::megaaton(machine_config &config) +{ play_3(config); m_maincpu->set_clock(2.95_MHz_XTAL); m_maincpu->set_addrmap(AS_IO, &play_3_state::megaaton_io); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(play_3_state::sklflite) +void play_3_state::sklflite(machine_config &config) +{ play_3(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(sklflite_io) + m_maincpu->set_addrmap(AS_IO, &play_3_state::sklflite_io); - MCFG_DEVICE_REMOVE("audiocpu") - MCFG_DEVICE_REMOVE("aysnd1") - MCFG_DEVICE_REMOVE("aysnd2") - MCFG_DEVICE_REMOVE("lspeaker") - MCFG_DEVICE_REMOVE("rspeaker") + config.device_remove("audiocpu"); + config.device_remove("aysnd1"); + config.device_remove("aysnd2"); + config.device_remove("lspeaker"); + config.device_remove("rspeaker"); EFO_ZSU1(config, m_zsu, 0); -MACHINE_CONFIG_END +} /*------------------------------------------------------------------- diff --git a/src/mame/drivers/poly.cpp b/src/mame/drivers/poly.cpp index b7cf121941a..e9f76d90897 100644 --- a/src/mame/drivers/poly.cpp +++ b/src/mame/drivers/poly.cpp @@ -255,8 +255,7 @@ MACHINE_CONFIG_START(poly_state::poly) ADDRESS_MAP_BANK(config, "bankdev").set_map(&poly_state::poly_bank).set_options(ENDIANNESS_LITTLE, 8, 17, 0x10000); - MCFG_INPUT_MERGER_ANY_HIGH("irqs") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set_inputline(m_maincpu, M6809_IRQ_LINE); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/proconn.cpp b/src/mame/drivers/proconn.cpp index 72b46428cdc..f0bdc23deea 100644 --- a/src/mame/drivers/proconn.cpp +++ b/src/mame/drivers/proconn.cpp @@ -335,7 +335,7 @@ void proconn_state::proconn(machine_config &config) m_ay->add_route(ALL_OUTPUTS, "rspeaker", 0.33); METERS(config, m_meters, 0); - m_meters->set_number_meters(8); + m_meters->set_number(8); } diff --git a/src/mame/drivers/prophet600.cpp b/src/mame/drivers/prophet600.cpp index d4b8201f856..2e26ce1174e 100644 --- a/src/mame/drivers/prophet600.cpp +++ b/src/mame/drivers/prophet600.cpp @@ -294,8 +294,8 @@ MACHINE_CONFIG_START(prophet600_state::prophet600) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") - MCFG_DEVICE_ADD("acia_clock", CLOCK, XTAL(8'000'000)/16) // 500kHz = 16 times the MIDI rate - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, prophet600_state, acia_clock_w)) + clock_device &acia_clock(CLOCK(config, "acia_clock", XTAL(8'000'000)/16)); // 500kHz = 16 times the MIDI rate + acia_clock.signal_handler().set(FUNC(prophet600_state::acia_clock_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/rpunch.cpp b/src/mame/drivers/rpunch.cpp index 58707cda66d..6b16c5bd4d5 100644 --- a/src/mame/drivers/rpunch.cpp +++ b/src/mame/drivers/rpunch.cpp @@ -469,8 +469,7 @@ MACHINE_CONFIG_START(rpunch_state::rpunch) GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set("soundirq", FUNC(input_merger_device::in_w<0>)); - MCFG_INPUT_MERGER_ANY_HIGH("soundirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", 0)) + INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_audiocpu, 0); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -519,8 +518,7 @@ MACHINE_CONFIG_START(rpunch_state::svolleybl) GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set("soundirq", FUNC(input_merger_device::in_w<0>)); - MCFG_INPUT_MERGER_ANY_HIGH("soundirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", 0)) + INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_audiocpu, 0); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/spiders.cpp b/src/mame/drivers/spiders.cpp index 423e95dd834..e35b5186699 100644 --- a/src/mame/drivers/spiders.cpp +++ b/src/mame/drivers/spiders.cpp @@ -549,8 +549,7 @@ MACHINE_CONFIG_START(spiders_state::spiders) m_pia[2]->irqa_handler().set("mainirq", FUNC(input_merger_device::in_w<3>)); m_pia[2]->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<4>)); - MCFG_INPUT_MERGER_ANY_HIGH("mainirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6809_IRQ_LINE); PIA6821(config, m_pia[3], 0); m_pia[3]->writepa_handler().set(FUNC(spiders_state::spiders_audio_a_w)); diff --git a/src/mame/drivers/sun2.cpp b/src/mame/drivers/sun2.cpp index a7ae02f5ccd..8a8a07a1d86 100644 --- a/src/mame/drivers/sun2.cpp +++ b/src/mame/drivers/sun2.cpp @@ -644,8 +644,7 @@ MACHINE_CONFIG_START(sun2_state::sun2vme) timer.out4_cb().set("irq5", FUNC(input_merger_device::in_w<2>)); timer.out5_cb().set("irq5", FUNC(input_merger_device::in_w<3>)); - MCFG_INPUT_MERGER_ANY_HIGH("irq5") // 74LS05 open collectors - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M68K_IRQ_5)) + INPUT_MERGER_ANY_HIGH(config, "irq5").output_handler().set_inputline(m_maincpu, M68K_IRQ_5); // 74LS05 open collectors SCC8530N(config, SCC1_TAG, 19.6608_MHz_XTAL / 4); scc8530_device& scc2(SCC8530N(config, SCC2_TAG, 19.6608_MHz_XTAL / 4)); @@ -697,8 +696,7 @@ MACHINE_CONFIG_START(sun2_state::sun2mbus) timer.out4_cb().set("irq5", FUNC(input_merger_device::in_w<2>)); timer.out5_cb().set("irq5", FUNC(input_merger_device::in_w<3>)); - MCFG_INPUT_MERGER_ANY_HIGH("irq5") // 74LS05 open collectors - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M68K_IRQ_5)) + INPUT_MERGER_ANY_HIGH(config, "irq5").output_handler().set_inputline(m_maincpu, M68K_IRQ_5); // 74LS05 open collectors SCC8530N(config, SCC1_TAG, 39.3216_MHz_XTAL / 8); scc8530_device& scc2(SCC8530N(config, SCC2_TAG, 39.3216_MHz_XTAL / 8)); diff --git a/src/mame/drivers/suprnova.cpp b/src/mame/drivers/suprnova.cpp index 7278a77fefb..acf1867aaa3 100644 --- a/src/mame/drivers/suprnova.cpp +++ b/src/mame/drivers/suprnova.cpp @@ -792,7 +792,7 @@ MACHINE_CONFIG_START(skns_state::skns) MCFG_DEVICE_PROGRAM_MAP(skns_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", skns_state, irq, "screen", 0, 1) - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) + MSM6242(config, "rtc", XTAL(32'768)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); diff --git a/src/mame/drivers/swtpc.cpp b/src/mame/drivers/swtpc.cpp index 5f2343136f7..6b9c913c30d 100644 --- a/src/mame/drivers/swtpc.cpp +++ b/src/mame/drivers/swtpc.cpp @@ -169,10 +169,8 @@ MACHINE_CONFIG_START(swtpc_state::swtpc) MCFG_SS50_INTERFACE_IRQ_CALLBACK(WRITELINE("mainirq", input_merger_device, in_w<7>)) MCFG_SS50_INTERFACE_FIRQ_CALLBACK(WRITELINE("mainnmi", input_merger_device, in_w<7>)) - MCFG_INPUT_MERGER_ANY_HIGH("mainirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6800_IRQ_LINE)) - MCFG_INPUT_MERGER_ANY_HIGH("mainnmi") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI)) + INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6800_IRQ_LINE); + INPUT_MERGER_ANY_HIGH(config, "mainnmi").output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI); RAM(config, RAM_TAG).set_default_size("2K").set_extra_options("4K,8K,12K,16K,20K,24K,28K,32K"); MACHINE_CONFIG_END diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp index 41345a67756..feb87cc420b 100644 --- a/src/mame/drivers/taitosj.cpp +++ b/src/mame/drivers/taitosj.cpp @@ -1802,11 +1802,9 @@ MACHINE_CONFIG_START(taitosj_state::nomcu) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_INPUT_MERGER_ALL_HIGH("soundnmi") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE("soundnmi2", input_merger_device, in_w<0>)) + INPUT_MERGER_ALL_HIGH(config, m_soundnmi).output_handler().set(m_soundnmi2, FUNC(input_merger_device::in_w<0>)); - MCFG_INPUT_MERGER_ANY_HIGH("soundnmi2") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) + INPUT_MERGER_ANY_HIGH(config, m_soundnmi2).output_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI); AY8910(config, m_ay1, XTAL(6'000'000)/4); // 6mhz/4 on GAME board, AY-3-8910 @ IC53 (this is the only AY which uses proper mixing resistors, the 3 below have outputs tied together) m_ay1->port_a_read_callback().set_ioport("DSW2"); diff --git a/src/mame/drivers/tek405x.cpp b/src/mame/drivers/tek405x.cpp index 3500adf4d2f..89a2fb38c3f 100644 --- a/src/mame/drivers/tek405x.cpp +++ b/src/mame/drivers/tek405x.cpp @@ -1085,8 +1085,8 @@ MACHINE_CONFIG_START(tek4051_state::tek4051) ACIA6850(config, m_acia, 0); m_acia->irq_handler().set(FUNC(tek4051_state::acia_irq_w)); - MCFG_DEVICE_ADD("acia_clock", CLOCK, 38400) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, tek4051_state, write_acia_clock)) + CLOCK(config, m_acia_clock, 38400); + m_acia_clock->signal_handler().set(FUNC(tek4051_state::write_acia_clock)); MCFG_IEEE488_BUS_ADD() MCFG_IEEE488_EOI_CALLBACK(WRITELINE(MC6820_GPIB_TAG, pia6821_device, ca1_w)) diff --git a/src/mame/drivers/thomson.cpp b/src/mame/drivers/thomson.cpp index e80dce1a3b8..3ef9e4f2c03 100644 --- a/src/mame/drivers/thomson.cpp +++ b/src/mame/drivers/thomson.cpp @@ -628,11 +628,9 @@ MACHINE_CONFIG_START(thomson_state::to7_base) MCFG_DEVICE_ADD("maincpu", MC6809E, 16_MHz_XTAL / 16) MCFG_DEVICE_PROGRAM_MAP(to7) - MCFG_INPUT_MERGER_ANY_HIGH("mainirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6809_IRQ_LINE); - MCFG_INPUT_MERGER_ANY_HIGH("mainfirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6809_FIRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "mainfirq").output_handler().set_inputline(m_maincpu, M6809_FIRQ_LINE); /* video */ MCFG_SCREEN_ADD("screen", RASTER) @@ -733,9 +731,8 @@ MACHINE_CONFIG_START(thomson_state::to7_base) m_acia->txd_handler().set(FUNC(thomson_state::to7_modem_tx_w)); m_acia->irq_handler().set(FUNC(thomson_state::to7_modem_cb)); - MCFG_DEVICE_ADD("acia_clock", CLOCK, 1200) /* 1200 bauds, might be divided by 16 */ - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, thomson_state, write_acia_clock)) - + clock_device &acia_clock(CLOCK(config, "acia_clock", 1200)); /* 1200 bauds, might be divided by 16 */ + acia_clock.signal_handler().set(FUNC(thomson_state::write_acia_clock)); /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "to_cart") diff --git a/src/mame/drivers/tv910.cpp b/src/mame/drivers/tv910.cpp index 0cc5422dca5..8e00f79f291 100644 --- a/src/mame/drivers/tv910.cpp +++ b/src/mame/drivers/tv910.cpp @@ -509,17 +509,17 @@ MC6845_UPDATE_ROW( tv910_state::crtc_update_row ) } } -MACHINE_CONFIG_START(tv910_state::tv910) +void tv910_state::tv910(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK/8) - MCFG_DEVICE_PROGRAM_MAP(tv910_mem) + M6502(config, m_maincpu, MASTER_CLOCK/8); + m_maincpu->set_addrmap(AS_PROGRAM, &tv910_state::tv910_mem); - MCFG_INPUT_MERGER_ANY_HIGH("mainirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6502_IRQ_LINE); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK, 840, 0, 640, 270, 0, 240) - MCFG_SCREEN_UPDATE_DEVICE( CRTC_TAG, r6545_1_device, screen_update ) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(MASTER_CLOCK, 840, 0, 640, 270, 0, 240); + screen.set_screen_update(CRTC_TAG, FUNC(r6545_1_device::screen_update)); R6545_1(config, m_crtc, MASTER_CLOCK/8); m_crtc->set_screen("screen"); @@ -556,9 +556,9 @@ MACHINE_CONFIG_START(tv910_state::tv910) rs232.cts_handler().set(ACIA_TAG, FUNC(mos6551_device::write_cts)); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("bell", BEEP, MASTER_CLOCK / 8400) // 1620 Hz (Row 10 signal) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + BEEP(config, m_beep, MASTER_CLOCK / 8400); // 1620 Hz (Row 10 signal) + m_beep->add_route(ALL_OUTPUTS, "mono", 0.50); +} /* ROM definition */ ROM_START( tv910 ) diff --git a/src/mame/drivers/ultraman.cpp b/src/mame/drivers/ultraman.cpp index 3f6dce57925..a801ceec5ce 100644 --- a/src/mame/drivers/ultraman.cpp +++ b/src/mame/drivers/ultraman.cpp @@ -184,8 +184,7 @@ MACHINE_CONFIG_START(ultraman_state::ultraman) MCFG_DEVICE_PROGRAM_MAP(sound_map) MCFG_DEVICE_IO_MAP(sound_io_map) - MCFG_INPUT_MERGER_ALL_HIGH("soundnmi") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) + INPUT_MERGER_ALL_HIGH(config, "soundnmi").output_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI); MCFG_QUANTUM_TIME(attotime::from_hz(600)) diff --git a/src/mame/drivers/v1050.cpp b/src/mame/drivers/v1050.cpp index e23133798f8..f68e6dad1cc 100644 --- a/src/mame/drivers/v1050.cpp +++ b/src/mame/drivers/v1050.cpp @@ -1077,8 +1077,8 @@ MACHINE_CONFIG_START(v1050_state::v1050) m_uart_kb->txd_handler().set(V1050_KEYBOARD_TAG, FUNC(v1050_keyboard_device::si_w)); m_uart_kb->rxrdy_handler().set(FUNC(v1050_state::kb_rxrdy_w)); - MCFG_DEVICE_ADD(CLOCK_KB_TAG, CLOCK, 16_MHz_XTAL/4/13/8) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, v1050_state, write_keyboard_clock)) + clock_device &clock_kb(CLOCK(config, CLOCK_KB_TAG, 16_MHz_XTAL/4/13/8)); + clock_kb.signal_handler().set(FUNC(v1050_state::write_keyboard_clock)); // keyboard v1050_keyboard_device &keyboard(V1050_KEYBOARD(config, V1050_KEYBOARD_TAG, 0)); @@ -1095,8 +1095,8 @@ MACHINE_CONFIG_START(v1050_state::v1050) rs232.rxd_handler().set(m_uart_sio, FUNC(i8251_device::write_rxd)); rs232.dsr_handler().set(m_uart_sio, FUNC(i8251_device::write_dsr)); - MCFG_DEVICE_ADD(CLOCK_SIO_TAG, CLOCK, 16_MHz_XTAL/4) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, v1050_state, write_sio_clock)) + CLOCK(config, m_clock_sio, 16_MHz_XTAL/4); + m_clock_sio->signal_handler().set(FUNC(v1050_state::write_sio_clock)); MB8877(config, m_fdc, 16_MHz_XTAL/16); m_fdc->intrq_wr_callback().set(FUNC(v1050_state::fdc_intrq_w)); diff --git a/src/mame/drivers/vlc.cpp b/src/mame/drivers/vlc.cpp index 0c79771e89c..c9b3bc113f9 100644 --- a/src/mame/drivers/vlc.cpp +++ b/src/mame/drivers/vlc.cpp @@ -619,8 +619,8 @@ MACHINE_CONFIG_START(nevada_state::nevada) MICROTOUCH(config, m_microtouch, 9600).stx().set(m_duart[1], FUNC(mc68681_device::rx_a_w)); /* devices */ - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) - MCFG_MSM6242_OUT_INT_HANDLER(INPUTLINE("maincpu", M68K_IRQ_1)) // rtc interrupt on INT1 + MSM6242(config, m_rtc, XTAL(32'768)); + m_rtc->out_int_handler().set_inputline(m_maincpu, M68K_IRQ_1); // rtc interrupt on INT1 MACHINE_CONFIG_END diff --git a/src/mame/drivers/wildpkr.cpp b/src/mame/drivers/wildpkr.cpp index 2a14b8cdc91..3779bba3157 100644 --- a/src/mame/drivers/wildpkr.cpp +++ b/src/mame/drivers/wildpkr.cpp @@ -508,10 +508,10 @@ MACHINE_CONFIG_START(wildpkr_state::tabpkr) MC68681(config, m_duart, 3686400); m_duart->irq_cb().set_inputline(m_maincpu, M68K_IRQ_2, ASSERT_LINE); - MCFG_DEVICE_ADD("id", DS2401, 0) + DS2401(config, m_id, 0); - MCFG_DEVICE_ADD("dacclock", CLOCK, 1500000) // base rate derived from program code - MCFG_CLOCK_SIGNAL_HANDLER(ASSERTLINE("maincpu", M68K_IRQ_5)) + CLOCK(config, m_dac_clock, 1500000); // base rate derived from program code + m_dac_clock->signal_handler().set_inputline(m_maincpu, M68K_IRQ_5, ASSERT_LINE); MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) diff --git a/src/mame/drivers/williams.cpp b/src/mame/drivers/williams.cpp index 15cbc10d243..f8891d46ceb 100644 --- a/src/mame/drivers/williams.cpp +++ b/src/mame/drivers/williams.cpp @@ -1519,11 +1519,9 @@ MACHINE_CONFIG_START(williams_state::williams) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) /* pia */ - MCFG_INPUT_MERGER_ANY_HIGH("mainirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6809_IRQ_LINE); - MCFG_INPUT_MERGER_ANY_HIGH("soundirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("soundcpu", M6808_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_soundcpu, M6808_IRQ_LINE); PIA6821(config, m_pia[0], 0); m_pia[0]->readpa_handler().set_ioport("IN0"); @@ -1709,8 +1707,7 @@ MACHINE_CONFIG_START(blaster_state::blaster) m_muxb->a_in_callback().set_ioport("INP1"); m_muxb->b_in_callback().set_ioport("INP2"); - MCFG_INPUT_MERGER_ANY_HIGH("soundirq_b") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("soundcpu_b", M6808_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "soundirq_b").output_handler().set_inputline(m_soundcpu_b, M6808_IRQ_LINE); m_pia[1]->writepb_handler().set(FUNC(blaster_state::blaster_snd_cmd_w)); @@ -1722,9 +1719,9 @@ MACHINE_CONFIG_START(blaster_state::blaster) m_pia[3]->irqb_handler().set("soundirq_b", FUNC(input_merger_any_high_device::in_w<1>)); /* sound hardware */ - MCFG_DEVICE_REMOVE("speaker") - MCFG_DEVICE_REMOVE("dac") - MCFG_DEVICE_REMOVE("vref") + config.device_remove("speaker"); + config.device_remove("dac"); + config.device_remove("vref"); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -1777,11 +1774,9 @@ MACHINE_CONFIG_START(williams2_state::williams2) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) /* pia */ - MCFG_INPUT_MERGER_ANY_HIGH("mainirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6809_IRQ_LINE); - MCFG_INPUT_MERGER_ANY_HIGH("soundirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("soundcpu", M6808_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_soundcpu, M6808_IRQ_LINE); PIA6821(config, m_pia[0], 0); m_pia[0]->readpa_handler().set_ioport("IN0"); diff --git a/src/mame/drivers/wmg.cpp b/src/mame/drivers/wmg.cpp index e0476dd4ad3..afd1d7d8de3 100644 --- a/src/mame/drivers/wmg.cpp +++ b/src/mame/drivers/wmg.cpp @@ -554,11 +554,9 @@ MACHINE_CONFIG_START(wmg_state::wmg) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) /* pia */ - MCFG_INPUT_MERGER_ANY_HIGH("mainirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6809_IRQ_LINE); - MCFG_INPUT_MERGER_ANY_HIGH("soundirq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("soundcpu", M6808_IRQ_LINE)) + INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_soundcpu, M6808_IRQ_LINE); pia6821_device &pia0(PIA6821(config, "pia_0", 0)); pia0.readpa_handler().set_ioport("IN0"); diff --git a/src/mame/drivers/zorba.cpp b/src/mame/drivers/zorba.cpp index 3eb43d107a1..374efdf89f2 100644 --- a/src/mame/drivers/zorba.cpp +++ b/src/mame/drivers/zorba.cpp @@ -149,12 +149,9 @@ MACHINE_CONFIG_START(zorba_state::zorba) SPEAKER(config, "mono").front_center(); BEEP(config, m_beep, 800).add_route(ALL_OUTPUTS, "mono", 1.00); // should be horizontal frequency / 16, so depends on CRTC parameters - MCFG_INPUT_MERGER_ANY_HIGH("irq0") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE(*this, zorba_state, irq_w<0>)) - MCFG_INPUT_MERGER_ANY_HIGH("irq1") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE(*this, zorba_state, irq_w<1>)) - MCFG_INPUT_MERGER_ANY_HIGH("irq2") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE(*this, zorba_state, irq_w<2>)) + INPUT_MERGER_ANY_HIGH(config, "irq0").output_handler().set(FUNC(zorba_state::irq_w<0>)); + INPUT_MERGER_ANY_HIGH(config, "irq1").output_handler().set(FUNC(zorba_state::irq_w<1>)); + INPUT_MERGER_ANY_HIGH(config, "irq2").output_handler().set(FUNC(zorba_state::irq_w<2>)); /* devices */ Z80DMA(config, m_dma, 24_MHz_XTAL / 6); diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp index 2e2e96ddac1..8d626d22837 100644 --- a/src/mame/machine/apollo.cpp +++ b/src/mame/machine/apollo.cpp @@ -1097,8 +1097,8 @@ MACHINE_CONFIG_START(apollo_state::common) m_ptm->set_external_clocks(250000, 125000, 62500); m_ptm->irq_callback().set(FUNC(apollo_state::apollo_ptm_irq_function)); - MCFG_DEVICE_ADD("ptmclock", CLOCK, 250000) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, apollo_state, apollo_ptm_timer_tick)) + clock_device &ptmclock(CLOCK(config, "ptmclock", 250000)); + ptmclock.signal_handler().set(FUNC(apollo_state::apollo_ptm_timer_tick)); MC146818(config, m_rtc, 32.768_kHz_XTAL); // FIXME: is this interrupt really only connected on DN3000? diff --git a/src/mame/machine/mpu4.cpp b/src/mame/machine/mpu4.cpp index 125a28367d4..bfcc9372b32 100644 --- a/src/mame/machine/mpu4.cpp +++ b/src/mame/machine/mpu4.cpp @@ -2981,8 +2981,9 @@ void mpu4_state::mpu4_bwb_7reel(machine_config &config) m_reel[7]->optic_handler().set(FUNC(mpu4_state::reel_optic_cb<7>)); } -MACHINE_CONFIG_START(mpu4_state::mpu4_common) - MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu4_state, gen_50hz, attotime::from_hz(100)) +void mpu4_state::mpu4_common(machine_config &config) +{ + TIMER(config, "50hz").configure_periodic(FUNC(mpu4_state::gen_50hz), attotime::from_hz(100)); MSC1937(config, m_vfd); /* 6840 PTM */ @@ -3045,12 +3046,11 @@ MACHINE_CONFIG_START(mpu4_state::mpu4_common) m_pia8->irqa_handler().set(FUNC(mpu4_state::cpu0_irq)); m_pia8->irqb_handler().set(FUNC(mpu4_state::cpu0_irq)); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) - -MACHINE_CONFIG_END + METERS(config, m_meters, 0).set_number(8); +} -MACHINE_CONFIG_START(mpu4_state::mpu4_common2) +void mpu4_state::mpu4_common2(machine_config &config) +{ PTM6840(config, m_ptm_ic3ss, MPU4_MASTER_CLOCK / 4); m_ptm_ic3ss->set_external_clocks(0, 0, 0); m_ptm_ic3ss->o1_callback().set("ptm_ic3ss", FUNC(ptm6840_device::set_c2)); @@ -3064,7 +3064,7 @@ MACHINE_CONFIG_START(mpu4_state::mpu4_common2) pia_ic4ss.writepb_handler().set(FUNC(mpu4_state::pia_gb_portb_w)); pia_ic4ss.ca2_handler().set(FUNC(mpu4_state::pia_gb_ca2_w)); pia_ic4ss.cb2_handler().set(FUNC(mpu4_state::pia_gb_cb2_w)); -MACHINE_CONFIG_END +} /* machine driver for MOD 2 board */ MACHINE_CONFIG_START(mpu4_state::mpu4base) -- cgit v1.2.3