summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2019-01-31 18:02:11 +0100
committer Ivan Vangelista <mesgnet@yahoo.it>2019-01-31 18:02:11 +0100
commit49109286af145d9695fac40d836058eac2d97fb5 (patch)
tree245b70e36993f7e3c7d95d30f93f53b547b856c4
parent3add98785790f4d4b3585c714f55767f1149817b (diff)
devices\bus: some MCFG macros removal (nw)
-rw-r--r--src/devices/bus/cbmiec/cbmiec.h24
-rw-r--r--src/devices/bus/gamegear/smsctrladp.cpp11
-rw-r--r--src/devices/bus/ieee488/c2040fdc.h19
-rw-r--r--src/devices/bus/macpds/macpds.h11
-rw-r--r--src/devices/bus/nubus/nubus.h42
-rw-r--r--src/devices/bus/plus4/sid.cpp10
-rw-r--r--src/devices/bus/psx/ctlrport.cpp7
-rw-r--r--src/devices/bus/psx/ctlrport.h5
-rw-r--r--src/devices/bus/psx/memcard.h2
-rw-r--r--src/devices/bus/saturn/sat_slot.h16
-rw-r--r--src/devices/bus/scv/slot.h16
-rw-r--r--src/devices/bus/sg1000_exp/sg1000exp.h26
-rw-r--r--src/devices/bus/sms_ctrl/multitap.cpp21
-rw-r--r--src/devices/bus/sms_ctrl/rfu.cpp11
-rw-r--r--src/devices/bus/sms_ctrl/smsctrl.h34
-rw-r--r--src/devices/bus/sms_exp/smsexp.h23
-rw-r--r--src/devices/bus/snes_ctrl/ctrl.h22
-rw-r--r--src/devices/bus/snes_ctrl/multitap.cpp13
-rw-r--r--src/devices/bus/ss50/interface.h29
-rw-r--r--src/devices/bus/svi3x8/expander/expander.h54
-rw-r--r--src/devices/bus/svi3x8/expander/sv601.cpp27
-rw-r--r--src/devices/bus/svi3x8/expander/sv602.cpp15
-rw-r--r--src/devices/bus/svi3x8/slot/slot.h40
-rw-r--r--src/devices/bus/ti8x/teeconn.cpp19
-rw-r--r--src/devices/bus/ti8x/ti8x.h11
-rw-r--r--src/devices/bus/tiki100/exp.h52
-rw-r--r--src/devices/bus/tmc600/euro.h23
-rw-r--r--src/devices/bus/tvc/tvc.h26
-rw-r--r--src/devices/bus/vboy/slot.h15
-rw-r--r--src/devices/bus/vcs_ctrl/ctrl.h17
-rw-r--r--src/devices/bus/vectrex/slot.h4
-rw-r--r--src/devices/bus/vidbrain/exp.h30
-rw-r--r--src/devices/bus/vip/byteio.h28
-rw-r--r--src/devices/bus/vip/exp.h36
-rw-r--r--src/devices/bus/vip/vp575.cpp53
-rw-r--r--src/devices/bus/wangpc/wangpc.h77
-rw-r--r--src/devices/bus/x68k/x68kexp.h35
-rw-r--r--src/devices/bus/z88/z88.h19
-rw-r--r--src/mame/drivers/primo.cpp2
-rw-r--r--src/mame/drivers/saturn.cpp37
-rw-r--r--src/mame/drivers/scv.cpp10
-rw-r--r--src/mame/drivers/sg1000.cpp6
-rw-r--r--src/mame/drivers/sms.cpp30
-rw-r--r--src/mame/drivers/snes.cpp10
-rw-r--r--src/mame/drivers/svi318.cpp14
-rw-r--r--src/mame/drivers/swtpc.cpp71
-rw-r--r--src/mame/drivers/tiki100.cpp33
-rw-r--r--src/mame/drivers/tmc600.cpp7
-rw-r--r--src/mame/drivers/tvc.cpp28
-rw-r--r--src/mame/drivers/vboy.cpp2
-rw-r--r--src/mame/drivers/vidbrain.cpp2
-rw-r--r--src/mame/drivers/vip.cpp17
-rw-r--r--src/mame/drivers/wangpc.cpp45
-rw-r--r--src/mame/drivers/x68k.cpp14
-rw-r--r--src/mame/drivers/z88.cpp20
55 files changed, 504 insertions, 767 deletions
diff --git a/src/devices/bus/cbmiec/cbmiec.h b/src/devices/bus/cbmiec/cbmiec.h
index 6636dba45a2..ceb03d44948 100644
--- a/src/devices/bus/cbmiec/cbmiec.h
+++ b/src/devices/bus/cbmiec/cbmiec.h
@@ -21,30 +21,6 @@
#define CBM_IEC_TAG "iec_bus"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_CBM_IEC_BUS_ADD() \
- MCFG_DEVICE_ADD(CBM_IEC_TAG, CBM_IEC, 0)
-
-
-#define MCFG_CBM_IEC_SLOT_ADD(_tag, _address, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, CBM_IEC_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- downcast<cbm_iec_slot_device *>(device)->set_address(_address);
-
-
-#define MCFG_CBM_IEC_ADD(_default_drive) \
- MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, nullptr) \
- MCFG_CBM_IEC_SLOT_ADD("iec8", 8, cbm_iec_devices, _default_drive) \
- MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, nullptr) \
- MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, nullptr) \
- MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, nullptr) \
- MCFG_CBM_IEC_BUS_ADD()
-
-
void cbm_iec_devices(device_slot_interface &device);
//**************************************************************************
diff --git a/src/devices/bus/gamegear/smsctrladp.cpp b/src/devices/bus/gamegear/smsctrladp.cpp
index 7a5eee4ba4b..0b380cba8a0 100644
--- a/src/devices/bus/gamegear/smsctrladp.cpp
+++ b/src/devices/bus/gamegear/smsctrladp.cpp
@@ -80,9 +80,10 @@ READ32_MEMBER( sms_ctrl_adaptor_device::pixel_r )
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(sms_ctrl_adaptor_device::device_add_mconfig)
- MCFG_SMS_CONTROL_PORT_ADD("ctrl", sms_control_port_devices, "joypad")
- MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(WRITELINE(*this, sms_ctrl_adaptor_device, th_pin_w))
- MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(*this, sms_ctrl_adaptor_device, pixel_r))
-MACHINE_CONFIG_END
+void sms_ctrl_adaptor_device::device_add_mconfig(machine_config &config)
+{
+ SMS_CONTROL_PORT(config, m_subctrl_port, sms_control_port_devices, "joypad");
+ m_subctrl_port->th_input_handler().set(FUNC(sms_ctrl_adaptor_device::th_pin_w));
+ m_subctrl_port->pixel_handler().set(FUNC(sms_ctrl_adaptor_device::pixel_r));
+}
diff --git a/src/devices/bus/ieee488/c2040fdc.h b/src/devices/bus/ieee488/c2040fdc.h
index c73e9826fbf..64239991222 100644
--- a/src/devices/bus/ieee488/c2040fdc.h
+++ b/src/devices/bus/ieee488/c2040fdc.h
@@ -18,22 +18,6 @@
#include "imagedev/floppy.h"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_C2040_SYNC_CALLBACK(_write) \
- downcast<c2040_fdc_device &>(*device).set_sync_wr_callback(DEVCB_##_write);
-
-#define MCFG_C2040_READY_CALLBACK(_write) \
- downcast<c2040_fdc_device &>(*device).set_ready_wr_callback(DEVCB_##_write);
-
-#define MCFG_C2040_ERROR_CALLBACK(_write) \
- downcast<c2040_fdc_device &>(*device).set_error_wr_callback(DEVCB_##_write);
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -46,9 +30,6 @@ public:
// construction/destruction
c2040_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_sync_wr_callback(Object &&cb) { return m_write_sync.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ready_wr_callback(Object &&cb) { return m_write_ready.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_error_wr_callback(Object &&cb) { return m_write_error.set_callback(std::forward<Object>(cb)); }
auto sync_wr_callback() { return m_write_sync.bind(); }
auto ready_wr_callback() { return m_write_ready.bind(); }
auto error_wr_callback() { return m_write_error.bind(); }
diff --git a/src/devices/bus/macpds/macpds.h b/src/devices/bus/macpds/macpds.h
index a12b2a0bcb0..2354549afd5 100644
--- a/src/devices/bus/macpds/macpds.h
+++ b/src/devices/bus/macpds/macpds.h
@@ -14,17 +14,6 @@
#pragma once
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_MACPDS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \
- MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
- MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
- downcast<device_macpds_card_interface &>(*device).set_macpds_tag(_nbtag, _tag);
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
diff --git a/src/devices/bus/nubus/nubus.h b/src/devices/bus/nubus/nubus.h
index da7c784a6a7..2d42a4edd26 100644
--- a/src/devices/bus/nubus/nubus.h
+++ b/src/devices/bus/nubus/nubus.h
@@ -14,42 +14,6 @@
#pragma once
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_NUBUS_CPU(_cputag) \
- downcast<nubus_device &>(*device).set_cputag(_cputag);
-
-#define MCFG_NUBUS_OUT_IRQ9_CB(_devcb) \
- downcast<nubus_device &>(*device).set_out_irq9_callback(DEVCB_##_devcb);
-
-#define MCFG_NUBUS_OUT_IRQA_CB(_devcb) \
- downcast<nubus_device &>(*device).set_out_irqa_callback(DEVCB_##_devcb);
-
-#define MCFG_NUBUS_OUT_IRQB_CB(_devcb) \
- downcast<nubus_device &>(*device).set_out_irqb_callback(DEVCB_##_devcb);
-
-#define MCFG_NUBUS_OUT_IRQC_CB(_devcb) \
- downcast<nubus_device &>(*device).set_out_irqc_callback(DEVCB_##_devcb);
-
-#define MCFG_NUBUS_OUT_IRQD_CB(_devcb) \
- downcast<nubus_device &>(*device).set_out_irqd_callback(DEVCB_##_devcb);
-
-#define MCFG_NUBUS_OUT_IRQE_CB(_devcb) \
- downcast<nubus_device &>(*device).set_out_irqe_callback(DEVCB_##_devcb);
-
-#define MCFG_NUBUS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, NUBUS_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- downcast<nubus_slot_device &>(*device).set_nubus_slot(_nbtag, _tag);
-
-#define MCFG_NUBUS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \
- MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
- MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
- downcast<device_nubus_card_interface &>(*device).set_nubus_tag(_nbtag, _tag);
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -99,12 +63,6 @@ public:
// inline configuration
void set_cputag(const char *tag) { m_cputag = tag; }
- template <class Object> devcb_base &set_out_irq9_callback(Object &&cb) { return m_out_irq9_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_irqa_callback(Object &&cb) { return m_out_irqa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_irqb_callback(Object &&cb) { return m_out_irqb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_irqc_callback(Object &&cb) { return m_out_irqc_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_irqd_callback(Object &&cb) { return m_out_irqd_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_irqe_callback(Object &&cb) { return m_out_irqe_cb.set_callback(std::forward<Object>(cb)); }
auto out_irq9_callback() { return m_out_irq9_cb.bind(); }
auto out_irqa_callback() { return m_out_irqa_cb.bind(); }
auto out_irqb_callback() { return m_out_irqb_cb.bind(); }
diff --git a/src/devices/bus/plus4/sid.cpp b/src/devices/bus/plus4/sid.cpp
index f97deec6310..c5c0f3421e0 100644
--- a/src/devices/bus/plus4/sid.cpp
+++ b/src/devices/bus/plus4/sid.cpp
@@ -64,13 +64,13 @@ const tiny_rom_entry *plus4_sid_cartridge_device::device_rom_region() const
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(plus4_sid_cartridge_device::device_add_mconfig)
+void plus4_sid_cartridge_device::device_add_mconfig(machine_config &config)
+{
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD(MOS8580_TAG, MOS8580, XTAL(17'734'470)/20)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
+ MOS8580(config, m_sid, XTAL(17'734'470)/20).add_route(ALL_OUTPUTS, "speaker", 1.0);
- MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, nullptr)
-MACHINE_CONFIG_END
+ VCS_CONTROL_PORT(config, m_joy, vcs_control_port_devices, nullptr);
+}
diff --git a/src/devices/bus/psx/ctlrport.cpp b/src/devices/bus/psx/ctlrport.cpp
index b3c34f8b2b5..05aae5c5b72 100644
--- a/src/devices/bus/psx/ctlrport.cpp
+++ b/src/devices/bus/psx/ctlrport.cpp
@@ -25,9 +25,10 @@ void psx_controller_port_device::device_config_complete()
m_dev = dynamic_cast<device_psx_controller_interface *>(get_card_device());
}
-MACHINE_CONFIG_START(psx_controller_port_device::device_add_mconfig)
- MCFG_PSXCARD_ADD("card")
-MACHINE_CONFIG_END
+void psx_controller_port_device::device_add_mconfig(machine_config &config)
+{
+ PSXCARD(config, m_card, 0);
+}
void psx_controller_port_device::disable_card(bool state)
{
diff --git a/src/devices/bus/psx/ctlrport.h b/src/devices/bus/psx/ctlrport.h
index 718ac8fb35d..2058cf4868c 100644
--- a/src/devices/bus/psx/ctlrport.h
+++ b/src/devices/bus/psx/ctlrport.h
@@ -77,11 +77,6 @@ private:
required_ioport m_pad1;
};
-#define MCFG_PSX_CONTROLLER_PORTS_DSR_HANDLER(_devcb) \
- downcast<psxcontrollerports_device &>(*device).set_dsr_handler(DEVCB_##_devcb);
-
-#define MCFG_PSX_CONTROLLER_PORTS_RXD_HANDLER(_devcb) \
- downcast<psxcontrollerports_device &>(*device).set_rxd_handler(DEVCB_##_devcb);
class psxcontrollerports_device : public device_t
{
diff --git a/src/devices/bus/psx/memcard.h b/src/devices/bus/psx/memcard.h
index 51ac4f044ba..e292d89e589 100644
--- a/src/devices/bus/psx/memcard.h
+++ b/src/devices/bus/psx/memcard.h
@@ -8,8 +8,6 @@
class psx_controller_port_device;
-#define MCFG_PSXCARD_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, PSXCARD, 0)
class psxcard_device : public device_t,
public device_image_interface
diff --git a/src/devices/bus/saturn/sat_slot.h b/src/devices/bus/saturn/sat_slot.h
index 4d94ea472d6..63a9ae0dbca 100644
--- a/src/devices/bus/saturn/sat_slot.h
+++ b/src/devices/bus/saturn/sat_slot.h
@@ -67,7 +67,16 @@ class sat_cart_slot_device : public device_t,
{
public:
// construction/destruction
- sat_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ sat_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : sat_cart_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+ sat_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~sat_cart_slot_device();
// image-level overrides
@@ -117,9 +126,4 @@ DECLARE_DEVICE_TYPE(SATURN_CART_SLOT, sat_cart_slot_device)
#define SATSLOT_ROM_REGION_TAG ":cart:rom"
-#define MCFG_SATURN_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
- MCFG_DEVICE_ADD(_tag, SATURN_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-
#endif // MAME_BUS_SATURN_SAT_SLOT_H
diff --git a/src/devices/bus/scv/slot.h b/src/devices/bus/scv/slot.h
index 5dc3ec6e5b7..357c593c404 100644
--- a/src/devices/bus/scv/slot.h
+++ b/src/devices/bus/scv/slot.h
@@ -66,7 +66,17 @@ class scv_cart_slot_device : public device_t,
{
public:
// construction/destruction
- scv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ scv_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : scv_cart_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
+ scv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~scv_cart_slot_device();
// image-level overrides
@@ -116,8 +126,4 @@ DECLARE_DEVICE_TYPE(SCV_CART_SLOT, scv_cart_slot_device)
#define SCVSLOT_ROM_REGION_TAG ":cart:rom"
-#define MCFG_SCV_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
- MCFG_DEVICE_ADD(_tag, SCV_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
#endif // MAME_BUS_SCV_SLOT_H
diff --git a/src/devices/bus/sg1000_exp/sg1000exp.h b/src/devices/bus/sg1000_exp/sg1000exp.h
index 9a21c263407..c132b48d9dd 100644
--- a/src/devices/bus/sg1000_exp/sg1000exp.h
+++ b/src/devices/bus/sg1000_exp/sg1000exp.h
@@ -15,20 +15,6 @@
#pragma once
-
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SG1000_EXPANSION_ADD(_tag, _slot_intf, _def_slot, _fixed) \
- MCFG_DEVICE_ADD(_tag, SG1000_EXPANSION_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _fixed)
-#define MCFG_SG1000_EXPANSION_MODIFY(_tag) \
- MCFG_DEVICE_MODIFY(_tag)
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -41,7 +27,17 @@ class sg1000_expansion_slot_device : public device_t, public device_slot_interfa
{
public:
// construction/destruction
- sg1000_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ sg1000_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt, bool const fixed)
+ : sg1000_expansion_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(fixed);
+ }
+
+ sg1000_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~sg1000_expansion_slot_device();
DECLARE_READ8_MEMBER(read);
diff --git a/src/devices/bus/sms_ctrl/multitap.cpp b/src/devices/bus/sms_ctrl/multitap.cpp
index 56e7144cbd5..88dbe01acf4 100644
--- a/src/devices/bus/sms_ctrl/multitap.cpp
+++ b/src/devices/bus/sms_ctrl/multitap.cpp
@@ -129,15 +129,16 @@ READ32_MEMBER( sms_multitap_device::pixel_r )
}
-MACHINE_CONFIG_START(sms_multitap_device::device_add_mconfig)
+void sms_multitap_device::device_add_mconfig(machine_config &config)
+{
// Controller subports setup, without the TH callback declaration,
// because the circuit scheme shows TH of subports without connection.
- MCFG_SMS_CONTROL_PORT_ADD("ctrl1", sms_control_port_devices, "joypad")
- MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(*this, sms_multitap_device, pixel_r))
- MCFG_SMS_CONTROL_PORT_ADD("ctrl2", sms_control_port_devices, "joypad")
- MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(*this, sms_multitap_device, pixel_r))
- MCFG_SMS_CONTROL_PORT_ADD("ctrl3", sms_control_port_devices, "joypad")
- MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(*this, sms_multitap_device, pixel_r))
- MCFG_SMS_CONTROL_PORT_ADD("ctrl4", sms_control_port_devices, "joypad")
- MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(*this, sms_multitap_device, pixel_r))
-MACHINE_CONFIG_END
+ SMS_CONTROL_PORT(config, m_subctrl1_port, sms_control_port_devices, "joypad");
+ m_subctrl1_port->pixel_handler().set(FUNC(sms_multitap_device::pixel_r));
+ SMS_CONTROL_PORT(config, m_subctrl2_port, sms_control_port_devices, "joypad");
+ m_subctrl2_port->pixel_handler().set(FUNC(sms_multitap_device::pixel_r));
+ SMS_CONTROL_PORT(config, m_subctrl3_port, sms_control_port_devices, "joypad");
+ m_subctrl3_port->pixel_handler().set(FUNC(sms_multitap_device::pixel_r));
+ SMS_CONTROL_PORT(config, m_subctrl4_port, sms_control_port_devices, "joypad");
+ m_subctrl4_port->pixel_handler().set(FUNC(sms_multitap_device::pixel_r));
+}
diff --git a/src/devices/bus/sms_ctrl/rfu.cpp b/src/devices/bus/sms_ctrl/rfu.cpp
index 7b51da5983a..36a081abcd1 100644
--- a/src/devices/bus/sms_ctrl/rfu.cpp
+++ b/src/devices/bus/sms_ctrl/rfu.cpp
@@ -138,8 +138,9 @@ READ32_MEMBER( sms_rapid_fire_device::pixel_r )
}
-MACHINE_CONFIG_START(sms_rapid_fire_device::device_add_mconfig)
- MCFG_SMS_CONTROL_PORT_ADD("ctrl", sms_control_port_devices, "joypad")
- MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(WRITELINE(*this, sms_rapid_fire_device, th_pin_w))
- MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(*this, sms_rapid_fire_device, pixel_r))
-MACHINE_CONFIG_END
+void sms_rapid_fire_device::device_add_mconfig(machine_config &config)
+{
+ SMS_CONTROL_PORT(config, m_subctrl_port, sms_control_port_devices, "joypad");
+ m_subctrl_port->th_input_handler().set(FUNC(sms_rapid_fire_device::th_pin_w));
+ m_subctrl_port->pixel_handler().set(FUNC(sms_rapid_fire_device::pixel_r));
+}
diff --git a/src/devices/bus/sms_ctrl/smsctrl.h b/src/devices/bus/sms_ctrl/smsctrl.h
index d116f2c769d..3d11b4e60bd 100644
--- a/src/devices/bus/sms_ctrl/smsctrl.h
+++ b/src/devices/bus/sms_ctrl/smsctrl.h
@@ -16,26 +16,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SMS_CONTROL_PORT_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, SMS_CONTROL_PORT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-#define MCFG_SMS_CONTROL_PORT_MODIFY(_tag) \
- MCFG_DEVICE_MODIFY(_tag)
-
-
-#define MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(_devcb) \
- downcast<sms_control_port_device &>(*device).set_th_input_handler(DEVCB_##_devcb);
-
-
-#define MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(_devcb) \
- downcast<sms_control_port_device &>(*device).set_pixel_handler(DEVCB_##_devcb);
-
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -48,13 +28,23 @@ class sms_control_port_device : public device_t,
{
public:
// construction/destruction
+ template <typename T>
+ sms_control_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : sms_control_port_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
sms_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~sms_control_port_device();
// static configuration helpers
- template <class Object> devcb_base &set_th_input_handler(Object &&cb) { return m_th_pin_handler.set_callback(std::forward<Object>(cb)); }
+ auto th_input_handler() { return m_th_pin_handler.bind(); }
- template <class Object> devcb_base &set_pixel_handler(Object &&cb) { return m_pixel_handler.set_callback(std::forward<Object>(cb)); }
+ auto pixel_handler() { return m_pixel_handler.bind(); }
// Physical DE-9 connector interface
diff --git a/src/devices/bus/sms_exp/smsexp.h b/src/devices/bus/sms_exp/smsexp.h
index b53027af51e..6933b9a9df8 100644
--- a/src/devices/bus/sms_exp/smsexp.h
+++ b/src/devices/bus/sms_exp/smsexp.h
@@ -15,18 +15,6 @@
#pragma once
-
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SMS_EXPANSION_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, SMS_EXPANSION_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -61,7 +49,16 @@ class sms_expansion_slot_device : public device_t,
{
public:
// construction/destruction
- sms_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ sms_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : sms_expansion_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+ sms_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~sms_expansion_slot_device();
// reading and writing
diff --git a/src/devices/bus/snes_ctrl/ctrl.h b/src/devices/bus/snes_ctrl/ctrl.h
index 686db2f29e2..37db69537cc 100644
--- a/src/devices/bus/snes_ctrl/ctrl.h
+++ b/src/devices/bus/snes_ctrl/ctrl.h
@@ -51,7 +51,7 @@ public:
// construction/destruction
template <typename T>
snes_control_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
- : snes_control_port_device(mconfig, tag, owner, (uint32_t)0)
+ : snes_control_port_device(mconfig, tag, owner, 0)
{
option_reset();
opts(*this);
@@ -61,8 +61,8 @@ public:
snes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~snes_control_port_device();
- template <typename Object> void set_onscreen_callback(Object &&cb) { m_onscreen_cb = std::forward<Object>(cb); }
- template <typename Object> void set_gunlatch_callback(Object &&cb) { m_gunlatch_cb = std::forward<Object>(cb); }
+ template <typename... T> void set_onscreen_callback(T &&... args) { m_onscreen_cb = snesctrl_onscreen_delegate(std::forward<T>(args)...); }
+ template <typename... T> void set_gunlatch_callback(T &&... args) { m_gunlatch_cb = snesctrl_gunlatch_delegate(std::forward<T>(args)...); }
uint8_t read_pin4();
uint8_t read_pin5();
@@ -87,22 +87,6 @@ protected:
// device type definition
DECLARE_DEVICE_TYPE(SNES_CONTROL_PORT, snes_control_port_device)
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SNES_CONTROL_PORT_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, SNES_CONTROL_PORT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-#define MCFG_SNESCTRL_ONSCREEN_CB(_class, _method) \
- downcast<snes_control_port_device &>(*device).set_onscreen_callback(snesctrl_onscreen_delegate(&_class::_method, #_class "::" #_method, this));
-
-#define MCFG_SNESCTRL_GUNLATCH_CB(_class, _method) \
- downcast<snes_control_port_device &>(*device).set_gunlatch_callback(snesctrl_gunlatch_delegate(&_class::_method, #_class "::" #_method, this));
-
-
void snes_control_port_devices(device_slot_interface &device);
diff --git a/src/devices/bus/snes_ctrl/multitap.cpp b/src/devices/bus/snes_ctrl/multitap.cpp
index 262ef56fd26..ef630439276 100644
--- a/src/devices/bus/snes_ctrl/multitap.cpp
+++ b/src/devices/bus/snes_ctrl/multitap.cpp
@@ -47,12 +47,13 @@ static void snes_multitap(device_slot_interface &device)
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(snes_multitap_device::device_add_mconfig)
- MCFG_SNES_CONTROL_PORT_ADD("port1", snes_multitap, "joypad")
- MCFG_SNES_CONTROL_PORT_ADD("port2", snes_multitap, "joypad")
- MCFG_SNES_CONTROL_PORT_ADD("port3", snes_multitap, "joypad")
- MCFG_SNES_CONTROL_PORT_ADD("port4", snes_multitap, "joypad")
-MACHINE_CONFIG_END
+void snes_multitap_device::device_add_mconfig(machine_config &config)
+{
+ SNES_CONTROL_PORT(config, m_port1, snes_multitap, "joypad");
+ SNES_CONTROL_PORT(config, m_port2, snes_multitap, "joypad");
+ SNES_CONTROL_PORT(config, m_port3, snes_multitap, "joypad");
+ SNES_CONTROL_PORT(config, m_port4, snes_multitap, "joypad");
+}
//**************************************************************************
diff --git a/src/devices/bus/ss50/interface.h b/src/devices/bus/ss50/interface.h
index 1865eda6324..ff195c1bc7e 100644
--- a/src/devices/bus/ss50/interface.h
+++ b/src/devices/bus/ss50/interface.h
@@ -11,19 +11,6 @@
#ifndef MAME_DEVICES_BUS_SS50_INTERFACE_H
#define MAME_DEVICES_BUS_SS50_INTERFACE_H
-//**************************************************************************
-// CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SS50_INTERFACE_PORT_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, SS50_INTERFACE, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(ss50_##_slot_intf, _def_slot, false)
-
-#define MCFG_SS50_INTERFACE_IRQ_CALLBACK(_devcb) \
- downcast<ss50_interface_port_device &>(*device).set_irq_cb(DEVCB_##_devcb);
-
-#define MCFG_SS50_INTERFACE_FIRQ_CALLBACK(_devcb) \
- downcast<ss50_interface_port_device &>(*device).set_firq_cb(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -40,11 +27,21 @@ class ss50_interface_port_device : public device_t, public device_slot_interface
public:
// construction/destruction
- ss50_interface_port_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ template <typename T>
+ ss50_interface_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : ss50_interface_port_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
+ ss50_interface_port_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
// static configuration
- template<class Object> devcb_base &set_irq_cb(Object &&object) { return m_irq_cb.set_callback(std::forward<Object>(object)); }
- template<class Object> devcb_base &set_firq_cb(Object &&object) { return m_firq_cb.set_callback(std::forward<Object>(object)); }
+ auto irq_cb() { return m_irq_cb.bind(); }
+ auto firq_cb() { return m_firq_cb.bind(); }
// memory accesses
DECLARE_READ8_MEMBER(read);
diff --git a/src/devices/bus/svi3x8/expander/expander.h b/src/devices/bus/svi3x8/expander/expander.h
index 549a17c5970..b832fece8dd 100644
--- a/src/devices/bus/svi3x8/expander/expander.h
+++ b/src/devices/bus/svi3x8/expander/expander.h
@@ -40,36 +40,6 @@
#pragma once
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SVI_EXPANDER_BUS_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, SVI_EXPANDER, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(svi_expander_modules, nullptr, false)
-#define MCFG_SVI_EXPANDER_INT_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_int_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_ROMDIS_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_romdis_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_RAMDIS_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_ramdis_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_CTRL1_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_ctrl1_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_CTRL2_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_ctrl2_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_EXCSR_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_excsr_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_EXPANDER_EXCSW_HANDLER(_devcb) \
- downcast<svi_expander_device &>(*device).set_excsw_handler(DEVCB_##_devcb);
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -82,17 +52,27 @@ class svi_expander_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
+ template <typename T>
+ svi_expander_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts)
+ : svi_expander_device(mconfig, tag, owner, uint32_t(0))
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(nullptr);
+ set_fixed(false);
+ }
+
svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~svi_expander_device();
// callbacks
- template <class Object> devcb_base &set_int_handler(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_romdis_handler(Object &&cb) { return m_romdis_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ramdis_handler(Object &&cb) { return m_ramdis_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ctrl1_handler(Object &&cb) { return m_ctrl1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ctrl2_handler(Object &&cb) { return m_ctrl2_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_excsr_handler(Object &&cb) { return m_excsr_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_excsw_handler(Object &&cb) { return m_excsw_handler.set_callback(std::forward<Object>(cb)); }
+ auto int_handler() { return m_int_handler.bind(); }
+ auto romdis_handler() { return m_romdis_handler.bind(); }
+ auto ramdis_handler() { return m_ramdis_handler.bind(); }
+ auto ctrl1_handler() { return m_ctrl1_handler.bind(); }
+ auto ctrl2_handler() { return m_ctrl2_handler.bind(); }
+ auto excsr_handler() { return m_excsr_handler.bind(); }
+ auto excsw_handler() { return m_excsw_handler.bind(); }
// called from cart device
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
diff --git a/src/devices/bus/svi3x8/expander/sv601.cpp b/src/devices/bus/svi3x8/expander/sv601.cpp
index 51a51241897..cf112d800dc 100644
--- a/src/devices/bus/svi3x8/expander/sv601.cpp
+++ b/src/devices/bus/svi3x8/expander/sv601.cpp
@@ -20,19 +20,20 @@ DEFINE_DEVICE_TYPE(SV601, sv601_device, "sv601", "SV-601 Super Expander")
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(sv601_device::device_add_mconfig)
- MCFG_SVI_SLOT_BUS_ADD
- MCFG_SVI_SLOT_INT_HANDLER(WRITELINE(*this, sv601_device, int_w))
- MCFG_SVI_SLOT_ROMDIS_HANDLER(WRITELINE(*this, sv601_device, romdis_w))
- MCFG_SVI_SLOT_RAMDIS_HANDLER(WRITELINE(*this, sv601_device, ramdis_w))
- MCFG_SVI_SLOT_ADD("0", svi_slot_cards, nullptr)
- MCFG_SVI_SLOT_ADD("1", svi_slot_cards, nullptr)
- MCFG_SVI_SLOT_ADD("2", svi_slot_cards, nullptr)
- MCFG_SVI_SLOT_ADD("3", svi_slot_cards, nullptr)
- MCFG_SVI_SLOT_ADD("4", svi_slot_cards, nullptr)
- MCFG_SVI_SLOT_ADD("5", svi_slot_cards, nullptr)
- MCFG_SVI_SLOT_ADD("6", svi_slot_cards, nullptr)
-MACHINE_CONFIG_END
+void sv601_device::device_add_mconfig(machine_config &config)
+{
+ SVI_SLOT_BUS(config, m_slotbus, 0);
+ m_slotbus->int_handler().set(FUNC(sv601_device::int_w));
+ m_slotbus->romdis_handler().set(FUNC(sv601_device::romdis_w));
+ m_slotbus->ramdis_handler().set(FUNC(sv601_device::ramdis_w));
+ SVI_SLOT(config, "0", svi_slot_cards, nullptr);
+ SVI_SLOT(config, "1", svi_slot_cards, nullptr);
+ SVI_SLOT(config, "2", svi_slot_cards, nullptr);
+ SVI_SLOT(config, "3", svi_slot_cards, nullptr);
+ SVI_SLOT(config, "4", svi_slot_cards, nullptr);
+ SVI_SLOT(config, "5", svi_slot_cards, nullptr);
+ SVI_SLOT(config, "6", svi_slot_cards, nullptr);
+}
//**************************************************************************
diff --git a/src/devices/bus/svi3x8/expander/sv602.cpp b/src/devices/bus/svi3x8/expander/sv602.cpp
index b7c657bddce..d4d288437bf 100644
--- a/src/devices/bus/svi3x8/expander/sv602.cpp
+++ b/src/devices/bus/svi3x8/expander/sv602.cpp
@@ -20,13 +20,14 @@ DEFINE_DEVICE_TYPE(SV602, sv602_device, "sv602", "SV-602 Single Slot Expander")
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(sv602_device::device_add_mconfig)
- MCFG_SVI_SLOT_BUS_ADD
- MCFG_SVI_SLOT_INT_HANDLER(WRITELINE(*this, sv602_device, int_w))
- MCFG_SVI_SLOT_ROMDIS_HANDLER(WRITELINE(*this, sv602_device, romdis_w))
- MCFG_SVI_SLOT_RAMDIS_HANDLER(WRITELINE(*this, sv602_device, ramdis_w))
- MCFG_SVI_SLOT_ADD("0", sv602_slot_cards, nullptr)
-MACHINE_CONFIG_END
+void sv602_device::device_add_mconfig(machine_config &config)
+{
+ SVI_SLOT_BUS(config, m_slotbus, 0);
+ m_slotbus->int_handler().set(FUNC(sv602_device::int_w));
+ m_slotbus->romdis_handler().set(FUNC(sv602_device::romdis_w));
+ m_slotbus->ramdis_handler().set(FUNC(sv602_device::ramdis_w));
+ SVI_SLOT(config, "0", sv602_slot_cards, nullptr);
+}
//**************************************************************************
diff --git a/src/devices/bus/svi3x8/slot/slot.h b/src/devices/bus/svi3x8/slot/slot.h
index 702c005b770..3975624eb5a 100644
--- a/src/devices/bus/svi3x8/slot/slot.h
+++ b/src/devices/bus/svi3x8/slot/slot.h
@@ -40,29 +40,6 @@
#pragma once
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SVI_SLOT_BUS_ADD \
- MCFG_DEVICE_ADD("slotbus", SVI_SLOT_BUS, 0)
-
-#define MCFG_SVI_SLOT_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, SVI_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- downcast<svi_slot_device &>(*device).set_bus(this, "slotbus");
-
-#define MCFG_SVI_SLOT_INT_HANDLER(_devcb) \
- downcast<svi_slot_bus_device &>(*device).set_int_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_SLOT_ROMDIS_HANDLER(_devcb) \
- downcast<svi_slot_bus_device &>(*device).set_romdis_handler(DEVCB_##_devcb);
-
-#define MCFG_SVI_SLOT_RAMDIS_HANDLER(_devcb) \
- downcast<svi_slot_bus_device &>(*device).set_ramdis_handler(DEVCB_##_devcb);
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -79,9 +56,9 @@ public:
virtual ~svi_slot_bus_device();
// callbacks
- template <class Object> devcb_base &set_int_handler(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_romdis_handler(Object &&cb) { return m_romdis_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ramdis_handler(Object &&cb) { return m_ramdis_handler.set_callback(std::forward<Object>(cb)); }
+ auto int_handler() { return m_int_handler.bind(); }
+ auto romdis_handler() { return m_romdis_handler.bind(); }
+ auto ramdis_handler() { return m_ramdis_handler.bind(); }
void add_card(device_svi_slot_interface *card);
@@ -122,6 +99,17 @@ class svi_slot_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
+ template <typename T>
+ svi_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : svi_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ set_bus(this, "slot_bus");
+ }
+
svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
diff --git a/src/devices/bus/ti8x/teeconn.cpp b/src/devices/bus/ti8x/teeconn.cpp
index a251ee1ca4b..7277d4af93e 100644
--- a/src/devices/bus/ti8x/teeconn.cpp
+++ b/src/devices/bus/ti8x/teeconn.cpp
@@ -61,15 +61,16 @@ WRITE_LINE_MEMBER(tee_connector_device::ring_b_w)
}
-MACHINE_CONFIG_START(tee_connector_device::device_add_mconfig)
- MCFG_DEVICE_ADD(m_port_a, TI8X_LINK_PORT, default_ti8x_link_devices, nullptr)
- MCFG_TI8X_LINK_TIP_HANDLER(WRITELINE(*this, tee_connector_device, tip_a_w))
- MCFG_TI8X_LINK_RING_HANDLER(WRITELINE(*this, tee_connector_device, ring_a_w))
-
- MCFG_DEVICE_ADD(m_port_b, TI8X_LINK_PORT, default_ti8x_link_devices, nullptr)
- MCFG_TI8X_LINK_TIP_HANDLER(WRITELINE(*this, tee_connector_device, tip_b_w))
- MCFG_TI8X_LINK_RING_HANDLER(WRITELINE(*this, tee_connector_device, ring_b_w))
-MACHINE_CONFIG_END
+void tee_connector_device::device_add_mconfig(machine_config &config)
+{
+ TI8X_LINK_PORT(config, m_port_a, default_ti8x_link_devices, nullptr);
+ m_port_a->tip_handler().set(FUNC(tee_connector_device::tip_a_w));
+ m_port_a->ring_handler().set(FUNC(tee_connector_device::ring_a_w));
+
+ TI8X_LINK_PORT(config, m_port_b, default_ti8x_link_devices, nullptr);
+ m_port_b->tip_handler().set(FUNC(tee_connector_device::tip_b_w));
+ m_port_b->ring_handler().set(FUNC(tee_connector_device::ring_b_w));
+}
void tee_connector_device::device_start()
diff --git a/src/devices/bus/ti8x/ti8x.h b/src/devices/bus/ti8x/ti8x.h
index 1a01aeda2e3..e81a4fc5a9e 100644
--- a/src/devices/bus/ti8x/ti8x.h
+++ b/src/devices/bus/ti8x/ti8x.h
@@ -42,13 +42,6 @@
DECLARE_DEVICE_TYPE(TI8X_LINK_PORT, ti8x_link_port_device)
-#define MCFG_TI8X_LINK_TIP_HANDLER(cb) \
- downcast<ti8x_link_port_device &>(*device).set_tip_handler(DEVCB_##cb);
-
-#define MCFG_TI8X_LINK_RING_HANDLER(cb) \
- downcast<ti8x_link_port_device &>(*device).set_ring_handler(DEVCB_##cb);
-
-
class device_ti8x_link_port_interface;
@@ -67,8 +60,8 @@ public:
ti8x_link_port_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
// static configuration helpers
- template <class Object> devcb_base &set_tip_handler(Object &&cb) { return m_tip_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ring_handler(Object &&cb) { return m_ring_handler.set_callback(std::forward<Object>(cb)); }
+ auto tip_handler() { return m_tip_handler.bind(); }
+ auto ring_handler() { return m_ring_handler.bind(); }
DECLARE_WRITE_LINE_MEMBER(tip_w);
DECLARE_WRITE_LINE_MEMBER(ring_w);
diff --git a/src/devices/bus/tiki100/exp.h b/src/devices/bus/tiki100/exp.h
index fb82a62fdce..a36e0ac3419 100644
--- a/src/devices/bus/tiki100/exp.h
+++ b/src/devices/bus/tiki100/exp.h
@@ -25,36 +25,6 @@
#define TIKI100_BUS_TAG "tiki100bus"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_TIKI100_BUS_ADD() \
- MCFG_DEVICE_ADD(TIKI100_BUS_TAG, TIKI100_BUS, 0)
-
-#define MCFG_TIKI100_BUS_SLOT_ADD(_tag, _def_slot) \
- MCFG_DEVICE_ADD(_tag, TIKI100_BUS_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(tiki100_cards, _def_slot, false)
-
-
-#define MCFG_TIKI100_BUS_IRQ_CALLBACK(_write) \
- downcast<tiki100_bus_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
-
-#define MCFG_TIKI100_BUS_NMI_CALLBACK(_write) \
- downcast<tiki100_bus_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);
-
-#define MCFG_TIKI100_BUS_BUSRQ_CALLBACK(_write) \
- downcast<tiki100_bus_device &>(*device).set_busrq_wr_callback(DEVCB_##_write);
-
-#define MCFG_TIKI100_BUS_IN_MREQ_CALLBACK(_read) \
- downcast<tiki100_bus_device &>(*device).set_mrq_rd_callback(DEVCB_##_read);
-
-#define MCFG_TIKI100_BUS_OUT_MREQ_CALLBACK(_write) \
- downcast<tiki100_bus_device &>(*device).set_mrq_wr_callback(DEVCB_##_write);
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -111,7 +81,17 @@ class tiki100_bus_slot_device : public device_t,
{
public:
// construction/destruction
- tiki100_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ tiki100_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt)
+ : tiki100_bus_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
+ tiki100_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
// device-level overrides
virtual void device_start() override;
@@ -142,11 +122,11 @@ public:
tiki100_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~tiki100_bus_device() { m_device_list.detach_all(); }
- template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_nmi_wr_callback(Object &&cb) { return m_nmi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_busrq_wr_callback(Object &&cb) { return m_busrq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_mrq_rd_callback(Object &&cb) { return m_in_mrq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_mrq_wr_callback(Object &&cb) { return m_out_mrq_cb.set_callback(std::forward<Object>(cb)); }
+ auto irq_wr_callback() { return m_irq_cb.bind(); }
+ auto nmi_wr_callback() { return m_nmi_cb.bind(); }
+ auto busrq_wr_callback() { return m_busrq_cb.bind(); }
+ auto mrq_rd_callback() { return m_in_mrq_cb.bind(); }
+ auto mrq_wr_callback() { return m_out_mrq_cb.bind(); }
void add_card(device_tiki100bus_card_interface *card);
diff --git a/src/devices/bus/tmc600/euro.h b/src/devices/bus/tmc600/euro.h
index 7fe8c3c0ff6..51a4e435f2f 100644
--- a/src/devices/bus/tmc600/euro.h
+++ b/src/devices/bus/tmc600/euro.h
@@ -56,17 +56,6 @@
#define TMC600_EURO_BUS_TAG "bus"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_TMC600_EURO_BUS_SLOT_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, TMC600_EURO_BUS_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -96,7 +85,17 @@ class tmc600_euro_bus_slot_t : public device_t,
{
public:
// construction/destruction
- tmc600_euro_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ tmc600_euro_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt)
+ : tmc600_euro_bus_slot_t(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
+ tmc600_euro_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
protected:
// device-level overrides
diff --git a/src/devices/bus/tvc/tvc.h b/src/devices/bus/tvc/tvc.h
index 584e121f428..09ba7b35ffd 100644
--- a/src/devices/bus/tvc/tvc.h
+++ b/src/devices/bus/tvc/tvc.h
@@ -91,11 +91,21 @@ class tvcexp_slot_device : public device_t,
{
public:
// construction/destruction
- tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt)
+ : tvcexp_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
+ tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~tvcexp_slot_device();
- template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_irq_callback() { return m_out_irq_cb.bind(); }
+ auto out_nmi_callback() { return m_out_nmi_cb.bind(); }
// reading and writing
virtual uint8_t id_r();
@@ -120,14 +130,4 @@ protected:
DECLARE_DEVICE_TYPE(TVCEXP_SLOT, tvcexp_slot_device)
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_TVCEXP_SLOT_OUT_IRQ_CB(_devcb) \
- downcast<tvcexp_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
-
-#define MCFG_TVCEXP_SLOT_OUT_NMI_CB(_devcb) \
- downcast<tvcexp_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
-
#endif // MAME_BUS_TVC_TVC_H
diff --git a/src/devices/bus/vboy/slot.h b/src/devices/bus/vboy/slot.h
index a81efa07519..547f09b8523 100644
--- a/src/devices/bus/vboy/slot.h
+++ b/src/devices/bus/vboy/slot.h
@@ -62,7 +62,16 @@ class vboy_cart_slot_device : public device_t,
{
public:
// construction/destruction
- vboy_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ vboy_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : vboy_cart_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+ vboy_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~vboy_cart_slot_device();
// image-level overrides
@@ -110,8 +119,4 @@ DECLARE_DEVICE_TYPE(VBOY_CART_SLOT, vboy_cart_slot_device)
#define VBOYSLOT_ROM_REGION_TAG ":cart:rom"
-#define MCFG_VBOY_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
- MCFG_DEVICE_ADD(_tag, VBOY_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
#endif // MAME_BUS_VBOY_SLOT_H
diff --git a/src/devices/bus/vcs_ctrl/ctrl.h b/src/devices/bus/vcs_ctrl/ctrl.h
index 31f371d2fa8..574a7dc3ae8 100644
--- a/src/devices/bus/vcs_ctrl/ctrl.h
+++ b/src/devices/bus/vcs_ctrl/ctrl.h
@@ -15,22 +15,6 @@
#pragma once
-
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_VCS_CONTROL_PORT_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, VCS_CONTROL_PORT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-
-#define MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(_write) \
- downcast<vcs_control_port_device &>(*device).set_trigger_wr_callback(DEVCB_##_write);
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -79,7 +63,6 @@ public:
vcs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
// static configuration helpers
- template <class Object> devcb_base &set_trigger_wr_callback(Object &&cb) { return m_write_trigger.set_callback(std::forward<Object>(cb)); }
auto trigger_wr_callback() { return m_write_trigger.bind(); }
// computer interface
diff --git a/src/devices/bus/vectrex/slot.h b/src/devices/bus/vectrex/slot.h
index 605e273875f..f779bf5d514 100644
--- a/src/devices/bus/vectrex/slot.h
+++ b/src/devices/bus/vectrex/slot.h
@@ -112,8 +112,4 @@ DECLARE_DEVICE_TYPE(VECTREX_CART_SLOT, vectrex_cart_slot_device)
#define VECSLOT_ROM_REGION_TAG ":cart:rom"
-#define MCFG_VECTREX_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
- MCFG_DEVICE_ADD(_tag, VECTREX_CART_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
#endif // MAME_BUS_VECTREX_SLOT_H
diff --git a/src/devices/bus/vidbrain/exp.h b/src/devices/bus/vidbrain/exp.h
index fdb4b6a6ac7..37c58300030 100644
--- a/src/devices/bus/vidbrain/exp.h
+++ b/src/devices/bus/vidbrain/exp.h
@@ -49,21 +49,6 @@
#define VIDEOBRAIN_EXPANSION_SLOT_TAG "exp"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_VIDEOBRAIN_EXPANSION_SLOT_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, VIDEOBRAIN_EXPANSION_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-
-#define MCFG_VIDEOBRAIN_EXPANSION_SLOT_EXTRES_CALLBACK(_write) \
- downcast<videobrain_expansion_slot_device &>(*device).set_extres_wr_callback(DEVCB_##_write);
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -110,9 +95,18 @@ class videobrain_expansion_slot_device : public device_t,
{
public:
// construction/destruction
- videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- template <class Object> devcb_base &set_extres_wr_callback(Object &&cb) { return m_write_extres.set_callback(std::forward<Object>(cb)); }
+ template <typename T>
+ videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, char const* dflt)
+ : videobrain_expansion_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+ videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+
+ auto extres_wr_callback() { return m_write_extres.bind(); }
// computer interface
uint8_t bo_r(address_space &space, offs_t offset, int cs1, int cs2);
diff --git a/src/devices/bus/vip/byteio.h b/src/devices/bus/vip/byteio.h
index d2190214a2d..f2b12ca49f2 100644
--- a/src/devices/bus/vip/byteio.h
+++ b/src/devices/bus/vip/byteio.h
@@ -45,18 +45,6 @@
#define VIP_BYTEIO_PORT_TAG "byteio"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_VIP_BYTEIO_PORT_ADD(_tag, _slot_intf, _def_slot, _inst) \
- MCFG_DEVICE_ADD(_tag, VIP_BYTEIO_PORT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- downcast<vip_byteio_port_device *>(device)->set_inst_callback(DEVCB_##_inst);
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -70,9 +58,19 @@ class vip_byteio_port_device : public device_t,
{
public:
// construction/destruction
- vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- template <class Object> void set_inst_callback(Object &&inst) { m_write_inst.set_callback(std::forward<Object>(inst)); }
+ template <typename T>
+ vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt)
+ : vip_byteio_port_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
+ vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+
+ auto inst_callback() { return m_write_inst.bind(); }
// computer interface
uint8_t in_r();
diff --git a/src/devices/bus/vip/exp.h b/src/devices/bus/vip/exp.h
index dfca23fc038..82e131fbe09 100644
--- a/src/devices/bus/vip/exp.h
+++ b/src/devices/bus/vip/exp.h
@@ -46,27 +46,6 @@
#define VIP_EXPANSION_SLOT_TAG "exp"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_VIP_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, VIP_EXPANSION_SLOT, _clock) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-
-#define MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(_write) \
- downcast<vip_expansion_slot_device &>(*device).set_int_wr_callback(DEVCB_##_write);
-
-#define MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(_write) \
- downcast<vip_expansion_slot_device &>(*device).set_dma_out_wr_callback(DEVCB_##_write);
-
-#define MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(_write) \
- downcast<vip_expansion_slot_device &>(*device).set_dma_in_wr_callback(DEVCB_##_write);
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -80,11 +59,20 @@ class vip_expansion_slot_device : public device_t,
{
public:
// construction/destruction
+ template <typename T>
+ vip_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock, T &&opts, char const *dflt)
+ : vip_expansion_slot_device(mconfig, tag, owner, clock)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_int_wr_callback(Object &&cb) { return m_write_int.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_dma_out_wr_callback(Object &&cb) { return m_write_dma_out.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_dma_in_wr_callback(Object &&cb) { return m_write_dma_in.set_callback(std::forward<Object>(cb)); }
+ auto int_wr_callback() { return m_write_int.bind(); }
+ auto dma_out_wr_callback() { return m_write_dma_out.bind(); }
+ auto dma_in_wr_callback() { return m_write_dma_in.bind(); }
// computer interface
uint8_t program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh);
diff --git a/src/devices/bus/vip/vp575.cpp b/src/devices/bus/vip/vp575.cpp
index c69ccc5bade..7dbfabf0981 100644
--- a/src/devices/bus/vip/vp575.cpp
+++ b/src/devices/bus/vip/vp575.cpp
@@ -45,32 +45,33 @@ void vp575_device::update_interrupts()
// MACHINE_CONFIG_START( vp575 )
//-------------------------------------------------
-MACHINE_CONFIG_START(vp575_device::device_add_mconfig)
- MCFG_VIP_EXPANSION_SLOT_ADD("exp1", XTAL(3'521'280)/2, vip_expansion_cards, nullptr)
- MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(*this, vp575_device, exp1_int_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(*this, vp575_device, exp1_dma_out_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(*this, vp575_device, exp1_dma_in_w))
-
- MCFG_VIP_EXPANSION_SLOT_ADD("exp2", XTAL(3'521'280)/2, vip_expansion_cards, nullptr)
- MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(*this, vp575_device, exp2_int_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(*this, vp575_device, exp2_dma_out_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(*this, vp575_device, exp2_dma_in_w))
-
- MCFG_VIP_EXPANSION_SLOT_ADD("exp3", XTAL(3'521'280)/2, vip_expansion_cards, nullptr)
- MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(*this, vp575_device, exp3_int_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(*this, vp575_device, exp3_dma_out_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(*this, vp575_device, exp3_dma_in_w))
-
- MCFG_VIP_EXPANSION_SLOT_ADD("exp4", XTAL(3'521'280)/2, vip_expansion_cards, nullptr)
- MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(*this, vp575_device, exp4_int_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(*this, vp575_device, exp4_dma_out_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(*this, vp575_device, exp4_dma_in_w))
-
- MCFG_VIP_EXPANSION_SLOT_ADD("exp5", XTAL(3'521'280)/2, vip_expansion_cards, nullptr)
- MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(*this, vp575_device, exp5_int_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(*this, vp575_device, exp5_dma_out_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(*this, vp575_device, exp5_dma_in_w))
-MACHINE_CONFIG_END
+void vp575_device::device_add_mconfig(machine_config &config)
+{
+ VIP_EXPANSION_SLOT(config, m_expansion_slot[0], XTAL(3'521'280)/2, vip_expansion_cards, nullptr);
+ m_expansion_slot[0]->int_wr_callback().set(FUNC(vp575_device::exp1_int_w));
+ m_expansion_slot[0]->dma_out_wr_callback().set(FUNC(vp575_device::exp1_dma_out_w));
+ m_expansion_slot[0]->dma_in_wr_callback().set(FUNC(vp575_device::exp1_dma_in_w));
+
+ VIP_EXPANSION_SLOT(config, m_expansion_slot[1], XTAL(3'521'280)/2, vip_expansion_cards, nullptr);
+ m_expansion_slot[1]->int_wr_callback().set(FUNC(vp575_device::exp2_int_w));
+ m_expansion_slot[1]->dma_out_wr_callback().set(FUNC(vp575_device::exp2_dma_out_w));
+ m_expansion_slot[1]->dma_in_wr_callback().set(FUNC(vp575_device::exp2_dma_in_w));
+
+ VIP_EXPANSION_SLOT(config, m_expansion_slot[2], XTAL(3'521'280)/2, vip_expansion_cards, nullptr);
+ m_expansion_slot[2]->int_wr_callback().set(FUNC(vp575_device::exp3_int_w));
+ m_expansion_slot[2]->dma_out_wr_callback().set(FUNC(vp575_device::exp3_dma_out_w));
+ m_expansion_slot[2]->dma_in_wr_callback().set(FUNC(vp575_device::exp3_dma_in_w));
+
+ VIP_EXPANSION_SLOT(config, m_expansion_slot[3], XTAL(3'521'280)/2, vip_expansion_cards, nullptr);
+ m_expansion_slot[3]->int_wr_callback().set(FUNC(vp575_device::exp4_int_w));
+ m_expansion_slot[3]->dma_out_wr_callback().set(FUNC(vp575_device::exp4_dma_out_w));
+ m_expansion_slot[3]->dma_in_wr_callback().set(FUNC(vp575_device::exp4_dma_in_w));
+
+ VIP_EXPANSION_SLOT(config, m_expansion_slot[4], XTAL(3'521'280)/2, vip_expansion_cards, nullptr);
+ m_expansion_slot[4]->int_wr_callback().set(FUNC(vp575_device::exp5_int_w));
+ m_expansion_slot[4]->dma_out_wr_callback().set(FUNC(vp575_device::exp5_dma_out_w));
+ m_expansion_slot[4]->dma_in_wr_callback().set(FUNC(vp575_device::exp5_dma_in_w));
+}
diff --git a/src/devices/bus/wangpc/wangpc.h b/src/devices/bus/wangpc/wangpc.h
index 1f10892f7fc..2b3a7860fc1 100644
--- a/src/devices/bus/wangpc/wangpc.h
+++ b/src/devices/bus/wangpc/wangpc.h
@@ -24,51 +24,6 @@
#define WANGPC_BUS_TAG "wangpcbus"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_WANGPC_BUS_ADD() \
- MCFG_DEVICE_ADD(WANGPC_BUS_TAG, WANGPC_BUS, 0)
-
-#define MCFG_WANGPC_BUS_SLOT_ADD(_tag, _sid, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, WANGPC_BUS_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- downcast<wangpcbus_slot_device &>(*device).set_wangpcbus_slot(_sid);
-
-
-#define MCFG_WANGPC_BUS_IRQ2_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_irq2_wr_callback(DEVCB_##_write);
-
-#define MCFG_WANGPC_BUS_IRQ3_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_irq3_wr_callback(DEVCB_##_write);
-
-#define MCFG_WANGPC_BUS_IRQ4_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_irq4_wr_callback(DEVCB_##_write);
-
-#define MCFG_WANGPC_BUS_IRQ5_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_irq5_wr_callback(DEVCB_##_write);
-
-#define MCFG_WANGPC_BUS_IRQ6_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_irq6_wr_callback(DEVCB_##_write);
-
-#define MCFG_WANGPC_BUS_IRQ7_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_irq7_wr_callback(DEVCB_##_write);
-
-#define MCFG_WANGPC_BUS_DRQ1_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_drq1_wr_callback(DEVCB_##_write);
-
-#define MCFG_WANGPC_BUS_DRQ2_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_drq2_wr_callback(DEVCB_##_write);
-
-#define MCFG_WANGPC_BUS_DRQ3_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_drq3_wr_callback(DEVCB_##_write);
-
-#define MCFG_WANGPC_BUS_IOERROR_CALLBACK(_write) \
- downcast<wangpcbus_device &>(*device).set_ioerror_wr_callback(DEVCB_##_write);
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -81,7 +36,17 @@ class wangpcbus_slot_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
- wangpcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ wangpcbus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt, int sid)
+ : wangpcbus_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ set_wangpcbus_slot(sid);
+ }
+ wangpcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
// inline configuration
void set_wangpcbus_slot(int sid) { m_sid = sid; }
@@ -113,16 +78,16 @@ public:
wangpcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~wangpcbus_device() { m_device_list.detach_all(); }
- template <class Object> devcb_base &set_irq2_wr_callback(Object &&cb) { return m_write_irq2.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq3_wr_callback(Object &&cb) { return m_write_irq3.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq4_wr_callback(Object &&cb) { return m_write_irq4.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq5_wr_callback(Object &&cb) { return m_write_irq5.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq6_wr_callback(Object &&cb) { return m_write_irq6.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq7_wr_callback(Object &&cb) { return m_write_irq7.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_drq1_wr_callback(Object &&cb) { return m_write_drq1.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_drq2_wr_callback(Object &&cb) { return m_write_drq2.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_drq3_wr_callback(Object &&cb) { return m_write_drq3.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ioerror_wr_callback(Object &&cb) { return m_write_ioerror.set_callback(std::forward<Object>(cb)); }
+ auto irq2_wr_callback() { return m_write_irq2.bind(); }
+ auto irq3_wr_callback() { return m_write_irq3.bind(); }
+ auto irq4_wr_callback() { return m_write_irq4.bind(); }
+ auto irq5_wr_callback() { return m_write_irq5.bind(); }
+ auto irq6_wr_callback() { return m_write_irq6.bind(); }
+ auto irq7_wr_callback() { return m_write_irq7.bind(); }
+ auto drq1_wr_callback() { return m_write_drq1.bind(); }
+ auto drq2_wr_callback() { return m_write_drq2.bind(); }
+ auto drq3_wr_callback() { return m_write_drq3.bind(); }
+ auto ioerror_wr_callback() { return m_write_ioerror.bind(); }
void add_card(device_wangpcbus_card_interface *card, int sid);
diff --git a/src/devices/bus/x68k/x68kexp.h b/src/devices/bus/x68k/x68kexp.h
index 56f9feea8a5..5130fb668d8 100644
--- a/src/devices/bus/x68k/x68kexp.h
+++ b/src/devices/bus/x68k/x68kexp.h
@@ -73,22 +73,6 @@
#define X68K_EXP_SLOT_TAG "x68kexp"
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_X68K_EXPANSION_SLOT_OUT_IRQ2_CB(_devcb) \
- downcast<x68k_expansion_slot_device &>(*device).set_out_irq2_callback(DEVCB_##_devcb);
-
-#define MCFG_X68K_EXPANSION_SLOT_OUT_IRQ4_CB(_devcb) \
- downcast<x68k_expansion_slot_device &>(*device).set_out_irq4_callback(DEVCB_##_devcb);
-
-#define MCFG_X68K_EXPANSION_SLOT_OUT_NMI_CB(_devcb) \
- downcast<x68k_expansion_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
-
-#define MCFG_X68K_EXPANSION_SLOT_OUT_RESET_CB(_devcb) \
- downcast<x68k_expansion_slot_device &>(*device).set_out_reset_callback(DEVCB_##_devcb);
-
//**************************************************************************
// TYPE DEFINITIONS
@@ -123,13 +107,22 @@ class x68k_expansion_slot_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
- x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ x68k_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : x68k_expansion_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+ x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~x68k_expansion_slot_device();
- template <class Object> devcb_base &set_out_irq2_callback(Object &&cb) { return m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_irq4_callback(Object &&cb) { return m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_reset_callback(Object &&cb) { return m_out_reset_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_irq2_callback() { return m_out_irq2_cb.bind(); }
+ auto out_irq4_callback() { return m_out_irq4_cb.bind(); }
+ auto out_nmi_callback() { return m_out_nmi_cb.bind(); }
+ auto out_reset_callback() { return m_out_reset_cb.bind(); }
DECLARE_WRITE_LINE_MEMBER( irq2_w );
diff --git a/src/devices/bus/z88/z88.h b/src/devices/bus/z88/z88.h
index de8ecdc883f..444eeb3c111 100644
--- a/src/devices/bus/z88/z88.h
+++ b/src/devices/bus/z88/z88.h
@@ -90,9 +90,18 @@ class z88cart_slot_device : public device_t,
{
public:
// construction/destruction
+ template <typename T>
+ z88cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : z88cart_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
z88cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
- template <class Object> devcb_base &set_out_flp_callback(Object &&cb) { return m_out_flp_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_flp_callback() { return m_out_flp_cb.bind(); }
// image-level overrides
virtual image_init_result call_load() override;
@@ -133,12 +142,4 @@ private:
// device type definition
DECLARE_DEVICE_TYPE(Z88CART_SLOT, z88cart_slot_device)
-
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_Z88CART_SLOT_OUT_FLP_CB(_devcb) \
- downcast<z88cart_slot_device &>(*device).set_out_flp_callback(DEVCB_##_devcb);
-
#endif // MAME_BUS_Z88_Z88_H
diff --git a/src/mame/drivers/primo.cpp b/src/mame/drivers/primo.cpp
index 5fbd17d0078..6e13ebff83d 100644
--- a/src/mame/drivers/primo.cpp
+++ b/src/mame/drivers/primo.cpp
@@ -279,7 +279,7 @@ MACHINE_CONFIG_START(primo_state::primoa32)
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED);
/* floppy from serial bus */
- MCFG_CBM_IEC_ADD(nullptr)
+ cbm_iec_slot_device::add(config, m_iec, nullptr);
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot1", generic_plain_slot, nullptr)
diff --git a/src/mame/drivers/saturn.cpp b/src/mame/drivers/saturn.cpp
index b4a176123e4..b8bd86cd579 100644
--- a/src/mame/drivers/saturn.cpp
+++ b/src/mame/drivers/saturn.cpp
@@ -874,45 +874,44 @@ static void saturn_cart(device_slot_interface &device)
}
-MACHINE_CONFIG_START(sat_console_state::saturnus)
+void sat_console_state::saturnus(machine_config &config)
+{
saturn(config);
- MCFG_DEVICE_ADD("saturn_cdb", SATURN_CDB, 16000000)
+ SATURN_CDB(config, "saturn_cdb", 16000000);
SOFTWARE_LIST(config, "cd_list").set_original("saturn").set_filter("NTSC-U");
- MCFG_SATURN_CARTRIDGE_ADD("exp", saturn_cart, nullptr)
+ SATURN_CART_SLOT(config, "exp", saturn_cart, nullptr);
SOFTWARE_LIST(config, "cart_list").set_original("sat_cart");
- MCFG_DEVICE_MODIFY("smpc")
- downcast<smpc_hle_device &>(*device).set_region_code(4);
-
-MACHINE_CONFIG_END
+ m_smpc_hle->set_region_code(4);
+}
-MACHINE_CONFIG_START(sat_console_state::saturneu)
+void sat_console_state::saturneu(machine_config &config)
+{
saturn(config);
- MCFG_DEVICE_ADD("saturn_cdb", SATURN_CDB, 16000000)
+ SATURN_CDB(config, "saturn_cdb", 16000000);
SOFTWARE_LIST(config, "cd_list").set_original("saturn").set_filter("PAL");
- MCFG_SATURN_CARTRIDGE_ADD("exp", saturn_cart, nullptr)
+ SATURN_CART_SLOT(config, "exp", saturn_cart, nullptr);
SOFTWARE_LIST(config, "cart_list").set_original("sat_cart");
- MCFG_DEVICE_MODIFY("smpc")
- downcast<smpc_hle_device &>(*device).set_region_code(12);
-MACHINE_CONFIG_END
+ m_smpc_hle->set_region_code(12);
+}
-MACHINE_CONFIG_START(sat_console_state::saturnjp)
+void sat_console_state::saturnjp(machine_config &config)
+{
saturn(config);
- MCFG_DEVICE_ADD("saturn_cdb", SATURN_CDB, 16000000)
+ SATURN_CDB(config, "saturn_cdb", 16000000);
SOFTWARE_LIST(config, "cd_list").set_original("saturn").set_filter("NTSC-J");
- MCFG_SATURN_CARTRIDGE_ADD("exp", saturn_cart, nullptr)
+ SATURN_CART_SLOT(config, "exp", saturn_cart, nullptr);
SOFTWARE_LIST(config, "cart_list").set_original("sat_cart");
- MCFG_DEVICE_MODIFY("smpc")
- downcast<smpc_hle_device &>(*device).set_region_code(1);
-MACHINE_CONFIG_END
+ m_smpc_hle->set_region_code(1);
+}
void sat_console_state::saturn_init_driver(int rgn)
diff --git a/src/mame/drivers/scv.cpp b/src/mame/drivers/scv.cpp
index 1181da2b3aa..9c39e51a7d4 100644
--- a/src/mame/drivers/scv.cpp
+++ b/src/mame/drivers/scv.cpp
@@ -649,8 +649,8 @@ static void scv_cart(device_slot_interface &device)
device.option_add_internal("rom128k_ram", SCV_ROM128K_RAM4K);
}
-MACHINE_CONFIG_START(scv_state::scv)
-
+void scv_state::scv(machine_config &config)
+{
upd7801_device &upd(UPD7801(config, m_maincpu, 4_MHz_XTAL));
upd.set_addrmap(AS_PROGRAM, &scv_state::scv_mem);
upd.pa_out_cb().set(FUNC(scv_state::porta_w));
@@ -664,7 +664,7 @@ MACHINE_CONFIG_START(scv_state::scv)
m_screen->set_screen_update(FUNC(scv_state::screen_update_scv));
m_screen->set_palette("palette");
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_scv)
+ GFXDECODE(config, "gfxdecode", "palette", gfx_scv);
PALETTE(config, "palette", FUNC(scv_state::scv_palette), 16);
/* Sound is generated by UPD1771C clocked at XTAL(6'000'000) */
@@ -673,11 +673,11 @@ MACHINE_CONFIG_START(scv_state::scv)
m_upd1771c->ack_handler().set(FUNC(scv_state::upd1771_ack_w));
m_upd1771c->add_route(ALL_OUTPUTS, "mono", 1.00);
- MCFG_SCV_CARTRIDGE_ADD("cartslot", scv_cart, nullptr)
+ SCV_CART_SLOT(config, m_cart, scv_cart, nullptr);
/* Software lists */
SOFTWARE_LIST(config, "cart_list").set_original("scv");
-MACHINE_CONFIG_END
+}
void scv_state::scv_pal(machine_config &config)
diff --git a/src/mame/drivers/sg1000.cpp b/src/mame/drivers/sg1000.cpp
index e7feb118fed..70787c95f75 100644
--- a/src/mame/drivers/sg1000.cpp
+++ b/src/mame/drivers/sg1000.cpp
@@ -548,7 +548,7 @@ MACHINE_CONFIG_START(sg1000_state::sg1000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* expansion slot */
- MCFG_SG1000_EXPANSION_ADD(EXPSLOT_TAG, sg1000_expansion_devices, nullptr, false)
+ SG1000_EXPANSION_SLOT(config, m_sgexpslot, sg1000_expansion_devices, nullptr, false);
/* cartridge */
MCFG_SG1000_CARTRIDGE_ADD(CARTSLOT_TAG, sg1000_cart, nullptr)
@@ -600,7 +600,7 @@ MACHINE_CONFIG_START(sc3000_state::sc3000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* sc3000 has all sk1100 features built-in, so add it as a fixed slot */
- MCFG_SG1000_EXPANSION_ADD(EXPSLOT_TAG, sg1000_expansion_devices, "sk1100", true)
+ SG1000_EXPANSION_SLOT(config, m_sgexpslot, sg1000_expansion_devices, "sk1100", true);
/* cartridge */
MCFG_SC3000_CARTRIDGE_ADD(CARTSLOT_TAG, sg1000_cart, nullptr)
@@ -660,7 +660,7 @@ MACHINE_CONFIG_START(sf7000_state::sf7000)
m_centronics->set_output_latch(cent_data_out);
/* sf7000 (sc3000) has all sk1100 features built-in, so add it as a fixed slot */
- MCFG_SG1000_EXPANSION_ADD(EXPSLOT_TAG, sg1000_expansion_devices, "sk1100", true)
+ SG1000_EXPANSION_SLOT(config, m_sgexpslot, sg1000_expansion_devices, "sk1100", true);
/* software lists */
SOFTWARE_LIST(config, "flop_list").set_original("sf7000");
diff --git a/src/mame/drivers/sms.cpp b/src/mame/drivers/sms.cpp
index 3ae16b09df0..a4b3f51fd05 100644
--- a/src/mame/drivers/sms.cpp
+++ b/src/mame/drivers/sms.cpp
@@ -501,13 +501,13 @@ MACHINE_CONFIG_START(sms_state::sms_base)
SOFTWARE_LIST(config, "cart_list").set_original("sms");
- MCFG_SMS_CONTROL_PORT_ADD(CONTROL1_TAG, sms_control_port_devices, "joypad")
- MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(WRITELINE(*this, sms_state, sms_ctrl1_th_input))
- MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(*this, sms_state, sms_pixel_color))
+ SMS_CONTROL_PORT(config, m_port_ctrl1, sms_control_port_devices, "joypad");
+ m_port_ctrl1->th_input_handler().set(FUNC(sms_state::sms_ctrl1_th_input));
+ m_port_ctrl1->pixel_handler().set(FUNC(sms_state::sms_pixel_color));
- MCFG_SMS_CONTROL_PORT_ADD(CONTROL2_TAG, sms_control_port_devices, "joypad")
- MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(WRITELINE(*this, sms_state, sms_ctrl2_th_input))
- MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(*this, sms_state, sms_pixel_color))
+ SMS_CONTROL_PORT(config, m_port_ctrl2, sms_control_port_devices, "joypad");
+ m_port_ctrl2->th_input_handler().set(FUNC(sms_state::sms_ctrl2_th_input));
+ m_port_ctrl2->pixel_handler().set(FUNC(sms_state::sms_pixel_color));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(sms_state::sms_ntsc_base)
@@ -622,7 +622,7 @@ MACHINE_CONFIG_START(sms_state::sms1_ntsc)
// card and expansion slots, not present in Master System II
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
- MCFG_SMS_EXPANSION_ADD("smsexp", sms_expansion_devices, nullptr)
+ SMS_EXPANSION_SLOT(config, "smsexp", sms_expansion_devices, nullptr);
m_has_bios_full = true;
m_has_pwr_led = true;
@@ -744,7 +744,7 @@ MACHINE_CONFIG_START(sms_state::sms1_pal)
// card and expansion slots, not present in Master System II
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
- MCFG_SMS_EXPANSION_ADD("smsexp", sms_expansion_devices, nullptr)
+ SMS_EXPANSION_SLOT(config, "smsexp", sms_expansion_devices, nullptr);
m_has_bios_full = true;
m_has_pwr_led = true;
@@ -816,7 +816,7 @@ MACHINE_CONFIG_START(sms_state::sms1_paln)
// card and expansion slots, not present in Tec Toy Master System III
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
- MCFG_SMS_EXPANSION_ADD("smsexp", sms_expansion_devices, nullptr)
+ SMS_EXPANSION_SLOT(config, "smsexp", sms_expansion_devices, nullptr);
m_has_bios_full = true;
m_has_pwr_led = true;
@@ -890,7 +890,7 @@ MACHINE_CONFIG_START(sms_state::sms1_br)
// card and expansion slots, not present in Tec Toy Master System III
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
- MCFG_SMS_EXPANSION_ADD("smsexp", sms_expansion_devices, nullptr)
+ SMS_EXPANSION_SLOT(config, "smsexp", sms_expansion_devices, nullptr);
m_has_bios_full = true;
m_has_pwr_led = true;
@@ -922,7 +922,7 @@ MACHINE_CONFIG_START(sms_state::sms1_kr)
config.device_remove("smsexp");
MCFG_SG1000MK3_CARTRIDGE_ADD("slot", sg1000mk3_cart, nullptr)
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
- MCFG_SMS_EXPANSION_ADD("smsexp", sms_expansion_devices, nullptr)
+ SMS_EXPANSION_SLOT(config, "smsexp", sms_expansion_devices, nullptr);
SOFTWARE_LIST(config, "cart_list2").set_original("sg1000");
@@ -959,15 +959,13 @@ MACHINE_CONFIG_START(sms_state::sg1000m3)
config.device_remove("smsexp");
MCFG_SG1000MK3_CARTRIDGE_ADD("slot", sg1000mk3_cart, nullptr)
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
- MCFG_SG1000_EXPANSION_ADD("sgexp", sg1000_expansion_devices, nullptr, false)
+ SG1000_EXPANSION_SLOT(config, "sgexp", sg1000_expansion_devices, nullptr, false);
SOFTWARE_LIST(config, "cart_list2").set_original("sg1000");
// Mark III does not have TH connected.
- MCFG_SMS_CONTROL_PORT_MODIFY(CONTROL1_TAG)
- MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(NOOP)
- MCFG_SMS_CONTROL_PORT_MODIFY(CONTROL2_TAG)
- MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(NOOP)
+ m_port_ctrl1->th_input_handler().set_nop();
+ m_port_ctrl2->th_input_handler().set_nop();
m_has_bios_full = false;
m_is_mark_iii = true;
diff --git a/src/mame/drivers/snes.cpp b/src/mame/drivers/snes.cpp
index 43578dae602..a2b1f769baf 100644
--- a/src/mame/drivers/snes.cpp
+++ b/src/mame/drivers/snes.cpp
@@ -1356,11 +1356,11 @@ MACHINE_CONFIG_START(snes_console_state::snes)
m_ppu->open_bus_callback().set([this] { return snes_open_bus_r(); }); // lambda because overloaded function name
m_ppu->set_screen("screen");
- MCFG_SNES_CONTROL_PORT_ADD("ctrl1", snes_control_port_devices, "joypad")
- MCFG_SNESCTRL_ONSCREEN_CB(snes_console_state, onscreen_cb)
- MCFG_SNES_CONTROL_PORT_ADD("ctrl2", snes_control_port_devices, "joypad")
- MCFG_SNESCTRL_ONSCREEN_CB(snes_console_state, onscreen_cb)
- MCFG_SNESCTRL_GUNLATCH_CB(snes_console_state, gun_latch_cb)
+ SNES_CONTROL_PORT(config, m_ctrl1, snes_control_port_devices, "joypad");
+ m_ctrl1->set_onscreen_callback(FUNC(snes_console_state::onscreen_cb), this);
+ SNES_CONTROL_PORT(config, m_ctrl2, snes_control_port_devices, "joypad");
+ m_ctrl2->set_onscreen_callback(FUNC(snes_console_state::onscreen_cb), this);
+ m_ctrl2->set_gunlatch_callback(FUNC(snes_console_state::gun_latch_cb), this);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
diff --git a/src/mame/drivers/svi318.cpp b/src/mame/drivers/svi318.cpp
index 35e63eeddd2..0015a1a7766 100644
--- a/src/mame/drivers/svi318.cpp
+++ b/src/mame/drivers/svi318.cpp
@@ -568,13 +568,13 @@ MACHINE_CONFIG_START(svi3x8_state::svi318)
SOFTWARE_LIST(config, "cart_list").set_original("svi318_cart");
// expander bus
- MCFG_SVI_EXPANDER_BUS_ADD("exp")
- MCFG_SVI_EXPANDER_INT_HANDLER(WRITELINE(*this, svi3x8_state, intexp_w))
- MCFG_SVI_EXPANDER_ROMDIS_HANDLER(WRITELINE(*this, svi3x8_state, romdis_w))
- MCFG_SVI_EXPANDER_RAMDIS_HANDLER(WRITELINE(*this, svi3x8_state, ramdis_w))
- MCFG_SVI_EXPANDER_CTRL1_HANDLER(WRITELINE(*this, svi3x8_state, ctrl1_w))
- MCFG_SVI_EXPANDER_EXCSR_HANDLER(READ8(*this, svi3x8_state, excs_r))
- MCFG_SVI_EXPANDER_EXCSW_HANDLER(WRITE8(*this, svi3x8_state, excs_w))
+ SVI_EXPANDER(config, m_expander, svi_expander_modules);
+ m_expander->int_handler().set(FUNC(svi3x8_state::intexp_w));
+ m_expander->romdis_handler().set(FUNC(svi3x8_state::romdis_w));
+ m_expander->ramdis_handler().set(FUNC(svi3x8_state::ramdis_w));
+ m_expander->ctrl1_handler().set(FUNC(svi3x8_state::ctrl1_w));
+ m_expander->excsr_handler().set(FUNC(svi3x8_state::excs_r));
+ m_expander->excsw_handler().set(FUNC(svi3x8_state::excs_w));
MACHINE_CONFIG_END
void svi3x8_state::svi318p(machine_config &config)
diff --git a/src/mame/drivers/swtpc.cpp b/src/mame/drivers/swtpc.cpp
index 6b9c913c30d..c4250611299 100644
--- a/src/mame/drivers/swtpc.cpp
+++ b/src/mame/drivers/swtpc.cpp
@@ -97,10 +97,11 @@ void swtpc_state::machine_start()
m_maincpu->space(AS_PROGRAM).install_ram(0, m_ram->size() - 1, m_ram->pointer());
}
-MACHINE_CONFIG_START(swtpc_state::swtpc)
+void swtpc_state::swtpc(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6800, XTAL(1'843'200) / 2)
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
+ M6800(config, m_maincpu, XTAL(1'843'200) / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &swtpc_state::mem_map);
MC14411(config, m_brg, XTAL(1'843'200));
m_brg->out_f<7>().set("io0", FUNC(ss50_interface_port_device::f600_1200_w)); // 1200b
@@ -144,48 +145,46 @@ MACHINE_CONFIG_START(swtpc_state::swtpc)
m_brg->out_f<13>().append("io6", FUNC(ss50_interface_port_device::f110_w));
m_brg->out_f<13>().append("io7", FUNC(ss50_interface_port_device::f110_w));
- MCFG_SS50_INTERFACE_PORT_ADD("io0", default_2rs_devices, nullptr)
- MCFG_SS50_INTERFACE_IRQ_CALLBACK(WRITELINE("mainirq", input_merger_device, in_w<0>))
- MCFG_SS50_INTERFACE_FIRQ_CALLBACK(WRITELINE("mainnmi", input_merger_device, in_w<0>))
- MCFG_SS50_INTERFACE_PORT_ADD("io1", default_2rs_devices, "mps")
- MCFG_SS50_INTERFACE_IRQ_CALLBACK(WRITELINE("mainirq", input_merger_device, in_w<1>))
- MCFG_SS50_INTERFACE_FIRQ_CALLBACK(WRITELINE("mainnmi", input_merger_device, in_w<1>))
- MCFG_SS50_INTERFACE_PORT_ADD("io2", default_2rs_devices, nullptr)
- MCFG_SS50_INTERFACE_IRQ_CALLBACK(WRITELINE("mainirq", input_merger_device, in_w<2>))
- MCFG_SS50_INTERFACE_FIRQ_CALLBACK(WRITELINE("mainnmi", input_merger_device, in_w<2>))
- MCFG_SS50_INTERFACE_PORT_ADD("io3", default_2rs_devices, nullptr)
- MCFG_SS50_INTERFACE_IRQ_CALLBACK(WRITELINE("mainirq", input_merger_device, in_w<3>))
- MCFG_SS50_INTERFACE_FIRQ_CALLBACK(WRITELINE("mainnmi", input_merger_device, in_w<3>))
- MCFG_SS50_INTERFACE_PORT_ADD("io4", default_2rs_devices, nullptr)
- MCFG_SS50_INTERFACE_IRQ_CALLBACK(WRITELINE("mainirq", input_merger_device, in_w<4>))
- MCFG_SS50_INTERFACE_FIRQ_CALLBACK(WRITELINE("mainnmi", input_merger_device, in_w<4>))
- MCFG_SS50_INTERFACE_PORT_ADD("io5", default_2rs_devices, nullptr)
- MCFG_SS50_INTERFACE_IRQ_CALLBACK(WRITELINE("mainirq", input_merger_device, in_w<5>))
- MCFG_SS50_INTERFACE_FIRQ_CALLBACK(WRITELINE("mainnmi", input_merger_device, in_w<5>))
- MCFG_SS50_INTERFACE_PORT_ADD("io6", default_2rs_devices, nullptr)
- MCFG_SS50_INTERFACE_IRQ_CALLBACK(WRITELINE("mainirq", input_merger_device, in_w<6>))
- MCFG_SS50_INTERFACE_FIRQ_CALLBACK(WRITELINE("mainnmi", input_merger_device, in_w<6>))
- MCFG_SS50_INTERFACE_PORT_ADD("io7", default_2rs_devices, nullptr)
- 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>))
+ ss50_interface_port_device &io0(SS50_INTERFACE(config, "io0", ss50_default_2rs_devices, nullptr));
+ io0.irq_cb().set("mainirq", FUNC(input_merger_device::in_w<0>));
+ io0.firq_cb().set("mainnmi", FUNC(input_merger_device::in_w<0>));
+ ss50_interface_port_device &io1(SS50_INTERFACE(config, "io1", ss50_default_2rs_devices, "mps"));
+ io1.irq_cb().set("mainirq", FUNC(input_merger_device::in_w<1>));
+ io1.firq_cb().set("mainnmi", FUNC(input_merger_device::in_w<1>));
+ ss50_interface_port_device &io2(SS50_INTERFACE(config, "io2", ss50_default_2rs_devices, nullptr));
+ io2.irq_cb().set("mainirq", FUNC(input_merger_device::in_w<2>));
+ io2.firq_cb().set("mainnmi", FUNC(input_merger_device::in_w<2>));
+ ss50_interface_port_device &io3(SS50_INTERFACE(config, "io3", ss50_default_2rs_devices, nullptr));
+ io3.irq_cb().set("mainirq", FUNC(input_merger_device::in_w<3>));
+ io3.firq_cb().set("mainnmi", FUNC(input_merger_device::in_w<3>));
+ ss50_interface_port_device &io4(SS50_INTERFACE(config, "io4", ss50_default_2rs_devices, nullptr));
+ io4.irq_cb().set("mainirq", FUNC(input_merger_device::in_w<4>));
+ io4.firq_cb().set("mainnmi", FUNC(input_merger_device::in_w<4>));
+ ss50_interface_port_device &io5(SS50_INTERFACE(config, "io5", ss50_default_2rs_devices, nullptr));
+ io5.irq_cb().set("mainirq", FUNC(input_merger_device::in_w<5>));
+ io5.firq_cb().set("mainnmi", FUNC(input_merger_device::in_w<5>));
+ ss50_interface_port_device &io6(SS50_INTERFACE(config, "io6", ss50_default_2rs_devices, nullptr));
+ io6.irq_cb().set("mainirq", FUNC(input_merger_device::in_w<6>));
+ io6.firq_cb().set("mainnmi", FUNC(input_merger_device::in_w<6>));
+ ss50_interface_port_device &io7(SS50_INTERFACE(config, "io7", ss50_default_2rs_devices, nullptr));
+ io7.irq_cb().set("mainirq", FUNC(input_merger_device::in_w<7>));
+ io7.firq_cb().set("mainnmi", FUNC(input_merger_device::in_w<7>));
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
+}
-MACHINE_CONFIG_START(swtpc_state::swtpcm)
+void swtpc_state::swtpcm(machine_config &config)
+{
swtpc(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_CLOCK(XTAL(1'797'100) / 2)
+ m_maincpu->set_clock(XTAL(1'797'100) / 2);
- MCFG_DEVICE_MODIFY("brg")
- MCFG_DEVICE_CLOCK(XTAL(1'797'100))
+ m_brg->set_clock(XTAL(1'797'100));
- MCFG_DEVICE_MODIFY("io1")
- MCFG_SLOT_DEFAULT_OPTION("mpc")
-MACHINE_CONFIG_END
+ subdevice<ss50_interface_port_device>("io1")->set_default_option("mpc");
+}
/* ROM definition */
ROM_START( swtpc )
diff --git a/src/mame/drivers/tiki100.cpp b/src/mame/drivers/tiki100.cpp
index 6eaba94b0fc..d0ab73c679e 100644
--- a/src/mame/drivers/tiki100.cpp
+++ b/src/mame/drivers/tiki100.cpp
@@ -700,7 +700,8 @@ void tiki100_state::machine_reset()
/* Machine Driver */
-MACHINE_CONFIG_START(tiki100_state::tiki100)
+void tiki100_state::tiki100(machine_config &config)
+{
/* basic machine hardware */
Z80(config, m_maincpu, 8_MHz_XTAL / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &tiki100_state::tiki100_mem);
@@ -708,20 +709,20 @@ MACHINE_CONFIG_START(tiki100_state::tiki100)
m_maincpu->set_daisy_config(tiki100_daisy_chain);
/* video hardware */
- MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
- MCFG_SCREEN_RAW_PARAMS(20_MHz_XTAL, 1280, 0, 1024, 312, 0, 256)
- MCFG_SCREEN_UPDATE_DRIVER(tiki100_state, screen_update)
- MCFG_PALETTE_ADD("palette", 16)
-
- MCFG_TIKI100_BUS_ADD()
- MCFG_TIKI100_BUS_IRQ_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_TIKI100_BUS_NMI_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_NMI))
- MCFG_TIKI100_BUS_BUSRQ_CALLBACK(WRITELINE(*this, tiki100_state, busrq_w))
- MCFG_TIKI100_BUS_IN_MREQ_CALLBACK(READ8(*this, tiki100_state, mrq_r))
- MCFG_TIKI100_BUS_OUT_MREQ_CALLBACK(WRITE8(*this, tiki100_state, mrq_w))
- MCFG_TIKI100_BUS_SLOT_ADD("slot1", "8088")
- MCFG_TIKI100_BUS_SLOT_ADD("slot2", "hdc")
- MCFG_TIKI100_BUS_SLOT_ADD("slot3", nullptr)
+ screen_device &screen(SCREEN(config, SCREEN_TAG, SCREEN_TYPE_RASTER));
+ screen.set_raw(20_MHz_XTAL, 1280, 0, 1024, 312, 0, 256);
+ screen.set_screen_update(FUNC(tiki100_state::screen_update));
+ PALETTE(config, m_palette).set_entries(16);
+
+ TIKI100_BUS(config, m_exp, 0);
+ m_exp->irq_wr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
+ m_exp->nmi_wr_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ m_exp->busrq_wr_callback().set(FUNC(tiki100_state::busrq_w));
+ m_exp->mrq_rd_callback().set(FUNC(tiki100_state::mrq_r));
+ m_exp->mrq_wr_callback().set(FUNC(tiki100_state::mrq_w));
+ TIKI100_BUS_SLOT(config, "slot1", tiki100_cards, "8088");
+ TIKI100_BUS_SLOT(config, "slot2", tiki100_cards, "hdc");
+ TIKI100_BUS_SLOT(config, "slot3", tiki100_cards, nullptr);
/* devices */
Z80DART(config, m_dart, 8_MHz_XTAL / 4);
@@ -786,7 +787,7 @@ MACHINE_CONFIG_START(tiki100_state::tiki100)
// software list
SOFTWARE_LIST(config, "flop_list").set_original("tiki100");
-MACHINE_CONFIG_END
+}
/* ROMs */
diff --git a/src/mame/drivers/tmc600.cpp b/src/mame/drivers/tmc600.cpp
index 60c88428387..a4360ece5cc 100644
--- a/src/mame/drivers/tmc600.cpp
+++ b/src/mame/drivers/tmc600.cpp
@@ -253,7 +253,8 @@ WRITE8_MEMBER( tmc600_state::sc_w )
/* Machine Drivers */
-MACHINE_CONFIG_START(tmc600_state::tmc600)
+void tmc600_state::tmc600(machine_config &config)
+{
// CPU
cdp1802_device &cpu(CDP1802(config, CDP1802_TAG, 3.57_MHz_XTAL));
cpu.set_addrmap(AS_PROGRAM, &tmc600_state::tmc600_map);
@@ -293,11 +294,11 @@ MACHINE_CONFIG_START(tmc600_state::tmc600)
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED);
// expansion bus connector
- MCFG_TMC600_EURO_BUS_SLOT_ADD(TMC600_EURO_BUS_TAG, tmc600_euro_bus_cards, nullptr)
+ TMC600_EURO_BUS_SLOT(config, m_bus, tmc600_euro_bus_cards, nullptr);
// internal RAM
RAM(config, RAM_TAG).set_default_size("8K");
-MACHINE_CONFIG_END
+}
/* ROMs */
diff --git a/src/mame/drivers/tvc.cpp b/src/mame/drivers/tvc.cpp
index 7cbd642ed82..69ce9c7a9f6 100644
--- a/src/mame/drivers/tvc.cpp
+++ b/src/mame/drivers/tvc.cpp
@@ -809,22 +809,18 @@ MACHINE_CONFIG_START(tvc_state::tvc)
MCFG_GENERIC_EXTENSIONS("bin,rom,crt")
/* expansion interface */
- MCFG_DEVICE_ADD("exp1", TVCEXP_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(tvc_exp , nullptr, false)
- MCFG_TVCEXP_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
- MCFG_TVCEXP_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_DEVICE_ADD("exp2", TVCEXP_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(tvc_exp , nullptr, false)
- MCFG_TVCEXP_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
- MCFG_TVCEXP_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_DEVICE_ADD("exp3", TVCEXP_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(tvc_exp , nullptr, false)
- MCFG_TVCEXP_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
- MCFG_TVCEXP_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_DEVICE_ADD("exp4", TVCEXP_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(tvc_exp , nullptr, false)
- MCFG_TVCEXP_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
- MCFG_TVCEXP_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
+ TVCEXP_SLOT(config, m_expansions[0], tvc_exp , nullptr);
+ m_expansions[0]->out_irq_callback().set_inputline(m_maincpu, 0);
+ m_expansions[0]->out_nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ TVCEXP_SLOT(config, m_expansions[1], tvc_exp , nullptr);
+ m_expansions[1]->out_irq_callback().set_inputline(m_maincpu, 0);
+ m_expansions[1]->out_nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ TVCEXP_SLOT(config, m_expansions[2], tvc_exp , nullptr);
+ m_expansions[2]->out_irq_callback().set_inputline(m_maincpu, 0);
+ m_expansions[2]->out_nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ TVCEXP_SLOT(config, m_expansions[3], tvc_exp , nullptr);
+ m_expansions[3]->out_irq_callback().set_inputline(m_maincpu, 0);
+ m_expansions[3]->out_nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
/* cassette */
CASSETTE(config, m_cassette);
diff --git a/src/mame/drivers/vboy.cpp b/src/mame/drivers/vboy.cpp
index 3171ca06499..0a90f15eb9e 100644
--- a/src/mame/drivers/vboy.cpp
+++ b/src/mame/drivers/vboy.cpp
@@ -1337,7 +1337,7 @@ MACHINE_CONFIG_START(vboy_state::vboy)
MCFG_SCREEN_PALETTE(m_palette)
/* cartridge */
- MCFG_VBOY_CARTRIDGE_ADD("cartslot", vboy_cart, nullptr)
+ VBOY_CART_SLOT(config, m_cart, vboy_cart, nullptr);
/* software lists */
SOFTWARE_LIST(config, "cart_list").set_original("vboy");
diff --git a/src/mame/drivers/vidbrain.cpp b/src/mame/drivers/vidbrain.cpp
index b39f93b8d6c..e9128222dd0 100644
--- a/src/mame/drivers/vidbrain.cpp
+++ b/src/mame/drivers/vidbrain.cpp
@@ -425,7 +425,7 @@ MACHINE_CONFIG_START(vidbrain_state::vidbrain)
m_smi->int_req_callback().set_inputline(F3850_TAG, F8_INPUT_LINE_INT_REQ);
// cartridge
- MCFG_VIDEOBRAIN_EXPANSION_SLOT_ADD(VIDEOBRAIN_EXPANSION_SLOT_TAG, vidbrain_expansion_cards, nullptr)
+ VIDEOBRAIN_EXPANSION_SLOT(config, VIDEOBRAIN_EXPANSION_SLOT_TAG, vidbrain_expansion_cards, nullptr);
// software lists
SOFTWARE_LIST(config, "cart_list").set_original("vidbrain");
diff --git a/src/mame/drivers/vip.cpp b/src/mame/drivers/vip.cpp
index 8f8ca964f0b..836ab8d71cb 100644
--- a/src/mame/drivers/vip.cpp
+++ b/src/mame/drivers/vip.cpp
@@ -728,14 +728,15 @@ MACHINE_CONFIG_START(vip_state::vip)
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD(DISCRETE_TAG, DISCRETE, vip_discrete)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
-
- MCFG_VIP_BYTEIO_PORT_ADD(VIP_BYTEIO_PORT_TAG, vip_byteio_cards, nullptr, WRITELINE(*this, vip_state, byteio_inst_w))
- MCFG_VIP_EXPANSION_SLOT_ADD(VIP_EXPANSION_SLOT_TAG, 3.52128_MHz_XTAL / 2, vip_expansion_cards, nullptr)
- MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(*this, vip_state, exp_int_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(*this, vip_state, exp_dma_out_w))
- MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(*this, vip_state, exp_dma_in_w))
+ DISCRETE(config, m_beeper, vip_discrete);
+ m_beeper->add_route(ALL_OUTPUTS, "mono", 0.80);
+
+ VIP_BYTEIO_PORT(config, m_byteio, vip_byteio_cards, nullptr);
+ m_byteio->inst_callback().set(FUNC(vip_state::byteio_inst_w));
+ VIP_EXPANSION_SLOT(config, m_exp, 3.52128_MHz_XTAL / 2, vip_expansion_cards, nullptr);
+ m_exp->int_wr_callback().set(FUNC(vip_state::exp_int_w));
+ m_exp->dma_out_wr_callback().set(FUNC(vip_state::exp_dma_out_w));
+ m_exp->dma_in_wr_callback().set(FUNC(vip_state::exp_dma_in_w));
// devices
MCFG_QUICKLOAD_ADD("quickload", vip_state, vip, "bin,c8,c8x", 0)
diff --git a/src/mame/drivers/wangpc.cpp b/src/mame/drivers/wangpc.cpp
index c941b9d3e6b..a69de0c446a 100644
--- a/src/mame/drivers/wangpc.cpp
+++ b/src/mame/drivers/wangpc.cpp
@@ -1275,11 +1275,12 @@ void wangpc_state::on_disk1_unload(floppy_image_device *image)
// MACHINE_CONFIG( wangpc )
//-------------------------------------------------
-MACHINE_CONFIG_START(wangpc_state::wangpc)
- MCFG_DEVICE_ADD(I8086_TAG, I8086, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(wangpc_mem)
- MCFG_DEVICE_IO_MAP(wangpc_io)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE(I8259A_TAG, pic8259_device, inta_cb)
+void wangpc_state::wangpc(machine_config &config)
+{
+ I8086(config, m_maincpu, 8000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &wangpc_state::wangpc_mem);
+ m_maincpu->set_addrmap(AS_IO, &wangpc_state::wangpc_io);
+ m_maincpu->set_irq_acknowledge_callback(I8259A_TAG, FUNC(pic8259_device::inta_cb));
//config.m_perfect_cpu_quantum = subtag(I8086_TAG);
// devices
@@ -1351,29 +1352,29 @@ MACHINE_CONFIG_START(wangpc_state::wangpc)
WANGPC_KEYBOARD(config, "wangpckb").txd_handler().set(m_uart, FUNC(im6402_device::write_rri));
// bus
- MCFG_WANGPC_BUS_ADD()
- MCFG_WANGPC_BUS_IRQ2_CALLBACK(WRITELINE(*this, wangpc_state, bus_irq2_w))
- MCFG_WANGPC_BUS_IRQ3_CALLBACK(WRITELINE(I8259A_TAG, pic8259_device, ir3_w))
- MCFG_WANGPC_BUS_IRQ4_CALLBACK(WRITELINE(I8259A_TAG, pic8259_device, ir4_w))
- MCFG_WANGPC_BUS_IRQ5_CALLBACK(WRITELINE(I8259A_TAG, pic8259_device, ir5_w))
- MCFG_WANGPC_BUS_IRQ6_CALLBACK(WRITELINE(I8259A_TAG, pic8259_device, ir6_w))
- MCFG_WANGPC_BUS_IRQ7_CALLBACK(WRITELINE(I8259A_TAG, pic8259_device, ir7_w))
- MCFG_WANGPC_BUS_DRQ1_CALLBACK(WRITELINE(AM9517A_TAG, am9517a_device, dreq1_w))
- MCFG_WANGPC_BUS_DRQ2_CALLBACK(WRITELINE(AM9517A_TAG, am9517a_device, dreq2_w))
- MCFG_WANGPC_BUS_DRQ3_CALLBACK(WRITELINE(AM9517A_TAG, am9517a_device, dreq3_w))
- MCFG_WANGPC_BUS_IOERROR_CALLBACK(INPUTLINE(I8086_TAG, INPUT_LINE_NMI))
- MCFG_WANGPC_BUS_SLOT_ADD("slot1", 1, wangpc_cards, nullptr)
- MCFG_WANGPC_BUS_SLOT_ADD("slot2", 2, wangpc_cards, "mvc")
- MCFG_WANGPC_BUS_SLOT_ADD("slot3", 3, wangpc_cards, nullptr)
- MCFG_WANGPC_BUS_SLOT_ADD("slot4", 4, wangpc_cards, nullptr)
- MCFG_WANGPC_BUS_SLOT_ADD("slot5", 5, wangpc_cards, nullptr)
+ WANGPC_BUS(config, m_bus, 0);
+ m_bus->irq2_wr_callback().set(FUNC(wangpc_state::bus_irq2_w));
+ m_bus->irq3_wr_callback().set(m_pic, FUNC(pic8259_device::ir3_w));
+ m_bus->irq4_wr_callback().set(m_pic, FUNC(pic8259_device::ir4_w));
+ m_bus->irq5_wr_callback().set(m_pic, FUNC(pic8259_device::ir5_w));
+ m_bus->irq6_wr_callback().set(m_pic, FUNC(pic8259_device::ir6_w));
+ m_bus->irq7_wr_callback().set(m_pic, FUNC(pic8259_device::ir7_w));
+ m_bus->drq1_wr_callback().set(m_dmac, FUNC(am9517a_device::dreq1_w));
+ m_bus->drq2_wr_callback().set(m_dmac, FUNC(am9517a_device::dreq2_w));
+ m_bus->drq3_wr_callback().set(m_dmac, FUNC(am9517a_device::dreq3_w));
+ m_bus->ioerror_wr_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ WANGPC_BUS_SLOT(config, "slot1", wangpc_cards, nullptr, 1);
+ WANGPC_BUS_SLOT(config, "slot2", wangpc_cards, "mvc", 2);
+ WANGPC_BUS_SLOT(config, "slot3", wangpc_cards, nullptr, 3);
+ WANGPC_BUS_SLOT(config, "slot4", wangpc_cards, nullptr, 4);
+ WANGPC_BUS_SLOT(config, "slot5", wangpc_cards, nullptr, 5);
// internal ram
RAM(config, RAM_TAG).set_default_size("128K");
// software list
SOFTWARE_LIST(config, "flop_list").set_original("wangpc");
-MACHINE_CONFIG_END
+}
diff --git a/src/mame/drivers/x68k.cpp b/src/mame/drivers/x68k.cpp
index f62288e34d5..92d848b2348 100644
--- a/src/mame/drivers/x68k.cpp
+++ b/src/mame/drivers/x68k.cpp
@@ -1551,7 +1551,8 @@ static void keyboard_devices(device_slot_interface &device)
device.option_add("x68k", X68K_KEYBOARD);
}
-MACHINE_CONFIG_START(x68k_state::x68000_base)
+void x68k_state::x68000_base(machine_config &config)
+{
config.m_minimum_quantum = attotime::from_hz(60);
/* device hardware */
@@ -1626,17 +1627,16 @@ MACHINE_CONFIG_START(x68k_state::x68000_base)
SOFTWARE_LIST(config, "flop_list").set_original("x68k_flop");
- MCFG_DEVICE_ADD("exp", X68K_EXPANSION_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(x68000_exp_cards, nullptr, false)
- MCFG_X68K_EXPANSION_SLOT_OUT_IRQ2_CB(WRITELINE(*this, x68k_state, irq2_line))
- MCFG_X68K_EXPANSION_SLOT_OUT_IRQ4_CB(WRITELINE(*this, x68k_state, irq4_line))
- MCFG_X68K_EXPANSION_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", M68K_IRQ_7))
+ X68K_EXPANSION_SLOT(config, m_expansion, x68000_exp_cards, nullptr);
+ m_expansion->out_irq2_callback().set(FUNC(x68k_state::irq2_line));
+ m_expansion->out_irq4_callback().set(FUNC(x68k_state::irq4_line));
+ m_expansion->out_nmi_callback().set_inputline(m_maincpu, M68K_IRQ_7);
/* internal ram */
RAM(config, m_ram).set_default_size("4M").set_extra_options("1M,2M,3M,5M,6M,7M,8M,9M,10M,11M,12M");
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
-MACHINE_CONFIG_END
+}
void x68k_state::x68000(machine_config &config)
{
diff --git a/src/mame/drivers/z88.cpp b/src/mame/drivers/z88.cpp
index 577f2be7e96..7b44e8fd29e 100644
--- a/src/mame/drivers/z88.cpp
+++ b/src/mame/drivers/z88.cpp
@@ -596,7 +596,8 @@ static void z88_cart(device_slot_interface &device)
device.option_add("1024kflash", Z88_1024K_FLASH); // 1024KB Flash cart
}
-MACHINE_CONFIG_START(z88_state::z88)
+void z88_state::z88(machine_config &config)
+{
/* basic machine hardware */
Z80(config, m_maincpu, XTAL(9'830'400)/3); // divided by 3 through the uPD65031
m_maincpu->set_addrmap(AS_PROGRAM, &z88_state::z88_mem);
@@ -629,21 +630,18 @@ MACHINE_CONFIG_START(z88_state::z88)
RAM(config, RAM_TAG).set_default_size("128K").set_extra_options("32K,64K,256K,512K");
/* cartridges */
- device = &Z88CART_SLOT(config, m_carts[1]);
- MCFG_DEVICE_SLOT_INTERFACE(z88_cart, nullptr, false)
- MCFG_Z88CART_SLOT_OUT_FLP_CB(WRITELINE("blink", upd65031_device, flp_w))
+ Z88CART_SLOT(config, m_carts[1], z88_cart, nullptr);
+ m_carts[1]->out_flp_callback().set(m_blink, FUNC(upd65031_device::flp_w));
- device = &Z88CART_SLOT(config, m_carts[2]);
- MCFG_DEVICE_SLOT_INTERFACE(z88_cart, nullptr, false)
- MCFG_Z88CART_SLOT_OUT_FLP_CB(WRITELINE("blink", upd65031_device, flp_w))
+ Z88CART_SLOT(config, m_carts[2], z88_cart, nullptr);
+ m_carts[2]->out_flp_callback().set(m_blink, FUNC(upd65031_device::flp_w));
- device = &Z88CART_SLOT(config, m_carts[3]);
- MCFG_DEVICE_SLOT_INTERFACE(z88_cart, nullptr, false)
- MCFG_Z88CART_SLOT_OUT_FLP_CB(WRITELINE("blink", upd65031_device, flp_w))
+ Z88CART_SLOT(config, m_carts[3], z88_cart, nullptr);
+ m_carts[3]->out_flp_callback().set(m_blink, FUNC(upd65031_device::flp_w));
/* software lists */
SOFTWARE_LIST(config, "cart_list").set_original("z88_cart");
-MACHINE_CONFIG_END
+}
/***************************************************************************