diff options
author | Vas Crabb <vas@vastheman.com> | 2018-05-07 18:35:05 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2018-05-07 18:35:51 +1000 |
commit | 21f535838cb8c71f4c4b807e0dad0c6aa7bbddc0 (patch) | |
tree | c978072465d9c779162693b55afccf50dd643f84 /src | |
parent | 3cb95fa87776237c105ad765196f8c33df8a77ae (diff) |
(nw) few more macros replaced with constructors
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/bus/a2bus/a2bus.cpp | 6 | ||||
-rw-r--r-- | src/devices/bus/rs232/sun_kbd.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/sunkbd/sunkbd.h | 15 | ||||
-rw-r--r-- | src/devices/bus/ti8x/teeconn.cpp | 4 | ||||
-rw-r--r-- | src/devices/bus/ti8x/ti8x.h | 15 | ||||
-rw-r--r-- | src/devices/bus/vic10/exp.h | 14 | ||||
-rw-r--r-- | src/devices/bus/vic20/exp.h | 15 | ||||
-rw-r--r-- | src/mame/drivers/sun3.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/sun3x.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/sun4.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/ti85.cpp | 6 | ||||
-rw-r--r-- | src/mame/drivers/vic10.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/vic20.cpp | 4 |
13 files changed, 54 insertions, 39 deletions
diff --git a/src/devices/bus/a2bus/a2bus.cpp b/src/devices/bus/a2bus/a2bus.cpp index ad2a835374a..9dfb82451a5 100644 --- a/src/devices/bus/a2bus/a2bus.cpp +++ b/src/devices/bus/a2bus/a2bus.cpp @@ -305,12 +305,8 @@ device_a2bus_card_interface::~device_a2bus_card_interface() void device_a2bus_card_interface::interface_validity_check(validity_checker &valid) const { - if (!m_a2bus_finder && !m_a2bus) - osd_printf_error("No bus configured/found\n"); if (m_a2bus_finder && m_a2bus && (m_a2bus != m_a2bus_finder)) - osd_printf_error("Contradictory buses configured\n"); - if (!m_a2bus_slottag) - osd_printf_error("No slot tag configured\n"); + osd_printf_error("Contradictory buses configured (%s and %s)\n", m_a2bus_finder->tag(), m_a2bus->tag()); } void device_a2bus_card_interface::interface_pre_start() diff --git a/src/devices/bus/rs232/sun_kbd.cpp b/src/devices/bus/rs232/sun_kbd.cpp index f54e48812b2..c1119694e16 100644 --- a/src/devices/bus/rs232/sun_kbd.cpp +++ b/src/devices/bus/rs232/sun_kbd.cpp @@ -23,7 +23,7 @@ sun_keyboard_adaptor_device::~sun_keyboard_adaptor_device() MACHINE_CONFIG_START(sun_keyboard_adaptor_device::device_add_mconfig) - MCFG_SUNKBD_PORT_ADD("keyboard", default_sun_keyboard_devices, nullptr) + MCFG_DEVICE_ADD(m_keyboard_port, SUNKBD_PORT, default_sun_keyboard_devices, nullptr) MCFG_SUNKBD_RXD_HANDLER(WRITELINE(*this, sun_keyboard_adaptor_device, output_rxd)) MACHINE_CONFIG_END diff --git a/src/devices/bus/sunkbd/sunkbd.h b/src/devices/bus/sunkbd/sunkbd.h index f0a0daeeb08..b0b9d4f0494 100644 --- a/src/devices/bus/sunkbd/sunkbd.h +++ b/src/devices/bus/sunkbd/sunkbd.h @@ -7,10 +7,6 @@ -#define MCFG_SUNKBD_PORT_ADD(tag, slot_intf, def_slot) \ - MCFG_DEVICE_ADD(tag, SUNKBD_PORT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(slot_intf, def_slot, false) - #define MCFG_SUNKBD_RXD_HANDLER(cb) \ devcb = &downcast<sun_keyboard_port_device &>(*device).set_rxd_handler(DEVCB_##cb); @@ -23,7 +19,16 @@ class sun_keyboard_port_device : public device_t, public device_slot_interface friend class device_sun_keyboard_port_interface; public: - sun_keyboard_port_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); + template <typename T> + sun_keyboard_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : sun_keyboard_port_device(mconfig, tag, owner, 0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + sun_keyboard_port_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock = 0); virtual ~sun_keyboard_port_device(); // static configuration helpers diff --git a/src/devices/bus/ti8x/teeconn.cpp b/src/devices/bus/ti8x/teeconn.cpp index 65a3c716cc7..a251ee1ca4b 100644 --- a/src/devices/bus/ti8x/teeconn.cpp +++ b/src/devices/bus/ti8x/teeconn.cpp @@ -62,11 +62,11 @@ WRITE_LINE_MEMBER(tee_connector_device::ring_b_w) MACHINE_CONFIG_START(tee_connector_device::device_add_mconfig) - MCFG_TI8X_LINK_PORT_ADD("a", default_ti8x_link_devices, nullptr) + 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_TI8X_LINK_PORT_ADD("b", default_ti8x_link_devices, nullptr) + 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 diff --git a/src/devices/bus/ti8x/ti8x.h b/src/devices/bus/ti8x/ti8x.h index 8b90a99b843..b17321d2ce5 100644 --- a/src/devices/bus/ti8x/ti8x.h +++ b/src/devices/bus/ti8x/ti8x.h @@ -42,10 +42,6 @@ DECLARE_DEVICE_TYPE(TI8X_LINK_PORT, ti8x_link_port_device) -#define MCFG_TI8X_LINK_PORT_ADD(tag, slot_intf, def_slot) \ - MCFG_DEVICE_ADD(tag, TI8X_LINK_PORT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(slot_intf, def_slot, false) - #define MCFG_TI8X_LINK_TIP_HANDLER(cb) \ devcb = &downcast<ti8x_link_port_device &>(*device).set_tip_handler(DEVCB_##cb); @@ -59,7 +55,16 @@ class device_ti8x_link_port_interface; class ti8x_link_port_device : public device_t, public device_slot_interface { public: - ti8x_link_port_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + template <typename T> + ti8x_link_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : ti8x_link_port_device(mconfig, tag, owner, 0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + 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)); } diff --git a/src/devices/bus/vic10/exp.h b/src/devices/bus/vic10/exp.h index 05b07924b48..c504be951cf 100644 --- a/src/devices/bus/vic10/exp.h +++ b/src/devices/bus/vic10/exp.h @@ -52,11 +52,6 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define MCFG_VIC10_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot) \ - MCFG_DEVICE_ADD(_tag, VIC10_EXPANSION_SLOT, _clock) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - - #define MCFG_VIC10_EXPANSION_SLOT_IRQ_CALLBACK(_write) \ devcb = &downcast<vic10_expansion_slot_device &>(*device).set_irq_wr_callback(DEVCB_##_write); @@ -92,6 +87,15 @@ class vic10_expansion_slot_device : public device_t, { public: // construction/destruction + template <typename T> + vic10_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock, T &&opts, char const *dflt) + : vic10_expansion_slot_device(mconfig, tag, owner, clock) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } vic10_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); } diff --git a/src/devices/bus/vic20/exp.h b/src/devices/bus/vic20/exp.h index 717a2d8c92c..231c6821f1d 100644 --- a/src/devices/bus/vic20/exp.h +++ b/src/devices/bus/vic20/exp.h @@ -51,12 +51,8 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define MCFG_VIC20_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot) \ - MCFG_DEVICE_ADD(_tag, VIC20_EXPANSION_SLOT, _clock) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - #define MCFG_VIC20_PASSTHRU_EXPANSION_SLOT_ADD(_tag) \ - MCFG_VIC20_EXPANSION_SLOT_ADD(_tag, 0, vic20_expansion_cards, nullptr) \ + MCFG_DEVICE_ADD(_tag, VIC20_EXPANSION_SLOT, DERIVED_CLOCK(1, 1), vic20_expansion_cards, nullptr) \ MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACK(WRITELINE(DEVICE_SELF_OWNER, vic20_expansion_slot_device, irq_w)) \ MCFG_VIC20_EXPANSION_SLOT_NMI_CALLBACK(WRITELINE(DEVICE_SELF_OWNER, vic20_expansion_slot_device, nmi_w)) \ MCFG_VIC20_EXPANSION_SLOT_RES_CALLBACK(WRITELINE(DEVICE_SELF_OWNER, vic20_expansion_slot_device, res_w)) @@ -87,6 +83,15 @@ class vic20_expansion_slot_device : public device_t, { public: // construction/destruction + template <typename T> + vic20_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock, T &&opts, char const *dflt) + : vic20_expansion_slot_device(mconfig, tag, owner, clock) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); } diff --git a/src/mame/drivers/sun3.cpp b/src/mame/drivers/sun3.cpp index 622751eaee7..5239f361adf 100644 --- a/src/mame/drivers/sun3.cpp +++ b/src/mame/drivers/sun3.cpp @@ -1019,7 +1019,7 @@ MACHINE_CONFIG_START(sun3_state::sun3) MCFG_SCC8530_ADD(SCC1_TAG, XTAL(4'915'200), 0, 0, 0, 0) MCFG_Z80SCC_OUT_TXDA_CB(WRITELINE(KEYBOARD_TAG, sun_keyboard_port_device, write_txd)) - MCFG_SUNKBD_PORT_ADD(KEYBOARD_TAG, default_sun_keyboard_devices, "type3hle") + MCFG_DEVICE_ADD(KEYBOARD_TAG, SUNKBD_PORT, default_sun_keyboard_devices, "type3hle") MCFG_SUNKBD_RXD_HANDLER(WRITELINE(SCC1_TAG, z80scc_device, rxa_w)) MCFG_SCC8530_ADD(SCC2_TAG, XTAL(4'915'200), 0, 0, 0, 0) @@ -1124,7 +1124,7 @@ MACHINE_CONFIG_START(sun3_state::sun3_50) MCFG_SCC8530_ADD(SCC1_TAG, XTAL(4'915'200), 0, 0, 0, 0) MCFG_Z80SCC_OUT_TXDA_CB(WRITELINE(KEYBOARD_TAG, sun_keyboard_port_device, write_txd)) - MCFG_SUNKBD_PORT_ADD(KEYBOARD_TAG, default_sun_keyboard_devices, "type3hle") + MCFG_DEVICE_ADD(KEYBOARD_TAG, SUNKBD_PORT, default_sun_keyboard_devices, "type3hle") MCFG_SUNKBD_RXD_HANDLER(WRITELINE(SCC1_TAG, z80scc_device, rxa_w)) MCFG_SCC8530_ADD(SCC2_TAG, XTAL(4'915'200), 0, 0, 0, 0) diff --git a/src/mame/drivers/sun3x.cpp b/src/mame/drivers/sun3x.cpp index 5c26ab47682..842c4128c98 100644 --- a/src/mame/drivers/sun3x.cpp +++ b/src/mame/drivers/sun3x.cpp @@ -592,7 +592,7 @@ MACHINE_CONFIG_START(sun3x_state::sun3_80) MCFG_SCC8530_ADD(SCC1_TAG, XTAL(4'915'200), 0, 0, 0, 0) MCFG_Z80SCC_OUT_TXDA_CB(WRITELINE(KEYBOARD_TAG, sun_keyboard_port_device, write_txd)) - MCFG_SUNKBD_PORT_ADD(KEYBOARD_TAG, default_sun_keyboard_devices, "type3hle") + MCFG_DEVICE_ADD(KEYBOARD_TAG, SUNKBD_PORT, default_sun_keyboard_devices, "type3hle") MCFG_SUNKBD_RXD_HANDLER(WRITELINE(SCC1_TAG, z80scc_device, rxa_w)) MCFG_SCC8530_ADD(SCC2_TAG, XTAL(4'915'200), 0, 0, 0, 0) diff --git a/src/mame/drivers/sun4.cpp b/src/mame/drivers/sun4.cpp index 1889b1a0ec4..a5b666da15d 100644 --- a/src/mame/drivers/sun4.cpp +++ b/src/mame/drivers/sun4.cpp @@ -1942,7 +1942,7 @@ MACHINE_CONFIG_START(sun4_state::sun4) MCFG_Z80SCC_OUT_INT_CB(WRITELINE(*this, sun4_state, scc1_int)) MCFG_Z80SCC_OUT_TXDA_CB(WRITELINE(KEYBOARD_TAG, sun_keyboard_port_device, write_txd)) - MCFG_SUNKBD_PORT_ADD(KEYBOARD_TAG, default_sun_keyboard_devices, "type4hle") + MCFG_DEVICE_ADD(KEYBOARD_TAG, SUNKBD_PORT, default_sun_keyboard_devices, "type4hle") MCFG_SUNKBD_RXD_HANDLER(WRITELINE(SCC1_TAG, z80scc_device, rxa_w)) // RS232 serial ports @@ -2007,7 +2007,7 @@ MACHINE_CONFIG_START(sun4_state::sun4c) MCFG_Z80SCC_OUT_INT_CB(WRITELINE(*this, sun4_state, scc1_int)) MCFG_Z80SCC_OUT_TXDA_CB(WRITELINE(KEYBOARD_TAG, sun_keyboard_port_device, write_txd)) - MCFG_SUNKBD_PORT_ADD(KEYBOARD_TAG, default_sun_keyboard_devices, "type5hle") + MCFG_DEVICE_ADD(KEYBOARD_TAG, SUNKBD_PORT, default_sun_keyboard_devices, "type5hle") MCFG_SUNKBD_RXD_HANDLER(WRITELINE(SCC1_TAG, z80scc_device, rxa_w)) // RS232 serial ports diff --git a/src/mame/drivers/ti85.cpp b/src/mame/drivers/ti85.cpp index 332b0931854..92609c639ee 100644 --- a/src/mame/drivers/ti85.cpp +++ b/src/mame/drivers/ti85.cpp @@ -613,7 +613,7 @@ MACHINE_CONFIG_START(ti85_state::ti85) MCFG_SCREEN_SIZE(128, 64) MCFG_SCREEN_VISIBLE_AREA(0, 128-1, 0, 64-1) - MCFG_TI8X_LINK_PORT_ADD("linkport", default_ti8x_link_devices, nullptr) + MCFG_DEVICE_ADD("linkport", TI8X_LINK_PORT, default_ti8x_link_devices, nullptr) MACHINE_CONFIG_END @@ -642,7 +642,7 @@ MACHINE_CONFIG_START(ti85_state::ti82) MCFG_DEVICE_ADD("t6a04", T6A04, 0) MCFG_T6A04_SIZE(96, 64) - MCFG_TI8X_LINK_PORT_ADD("linkport", default_ti8x_link_devices, nullptr) + MCFG_DEVICE_ADD("linkport", TI8X_LINK_PORT, default_ti8x_link_devices, nullptr) MACHINE_CONFIG_END MACHINE_CONFIG_START(ti85_state::ti81v2) @@ -728,7 +728,7 @@ MACHINE_CONFIG_START(ti85_state::ti83p) MCFG_DEVICE_ADD("t6a04", T6A04, 0) MCFG_T6A04_SIZE(96, 64) - MCFG_TI8X_LINK_PORT_ADD("linkport", default_ti8x_link_devices, nullptr) + MCFG_DEVICE_ADD("linkport", TI8X_LINK_PORT, default_ti8x_link_devices, nullptr) MCFG_AMD_29F400T_ADD("flash") MACHINE_CONFIG_END diff --git a/src/mame/drivers/vic10.cpp b/src/mame/drivers/vic10.cpp index 837b26bcd90..9cb9ed00a67 100644 --- a/src/mame/drivers/vic10.cpp +++ b/src/mame/drivers/vic10.cpp @@ -737,7 +737,7 @@ MACHINE_CONFIG_START(vic10_state::vic10) MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, nullptr) MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(WRITELINE(MOS6566_TAG, mos6566_device, lp_w)) MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy") - MCFG_VIC10_EXPANSION_SLOT_ADD(VIC10_EXPANSION_SLOT_TAG, XTAL(8'000'000)/8, vic10_expansion_cards, nullptr) + MCFG_DEVICE_ADD(VIC10_EXPANSION_SLOT_TAG, VIC10_EXPANSION_SLOT, XTAL(8'000'000)/8, vic10_expansion_cards, nullptr) MCFG_VIC10_EXPANSION_SLOT_IRQ_CALLBACK(WRITELINE(*this, vic10_state, exp_irq_w)) MCFG_VIC10_EXPANSION_SLOT_RES_CALLBACK(WRITELINE(*this, vic10_state, exp_reset_w)) MCFG_VIC10_EXPANSION_SLOT_CNT_CALLBACK(WRITELINE(MOS6526_TAG, mos6526_device, cnt_w)) diff --git a/src/mame/drivers/vic20.cpp b/src/mame/drivers/vic20.cpp index ee295f6f496..88c4c8312c5 100644 --- a/src/mame/drivers/vic20.cpp +++ b/src/mame/drivers/vic20.cpp @@ -872,7 +872,7 @@ MACHINE_CONFIG_START(vic20_state::ntsc) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) // devices - MCFG_VIC20_EXPANSION_SLOT_ADD(VIC20_EXPANSION_SLOT_TAG, MOS6560_CLOCK, vic20_expansion_cards, nullptr) + MCFG_DEVICE_ADD(VIC20_EXPANSION_SLOT_TAG, VIC20_EXPANSION_SLOT, MOS6560_CLOCK, vic20_expansion_cards, nullptr) MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACK(INPUTLINE(M6502_TAG, M6502_IRQ_LINE)) MCFG_VIC20_EXPANSION_SLOT_NMI_CALLBACK(INPUTLINE(M6502_TAG, M6502_NMI_LINE)) MCFG_VIC20_EXPANSION_SLOT_RES_CALLBACK(WRITELINE(*this, vic20_state, exp_reset_w)) @@ -920,7 +920,7 @@ MACHINE_CONFIG_START(vic20_state::pal) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) // devices - MCFG_VIC20_EXPANSION_SLOT_ADD(VIC20_EXPANSION_SLOT_TAG, MOS6561_CLOCK, vic20_expansion_cards, nullptr) + MCFG_DEVICE_ADD(VIC20_EXPANSION_SLOT_TAG, VIC20_EXPANSION_SLOT, MOS6561_CLOCK, vic20_expansion_cards, nullptr) MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACK(INPUTLINE(M6502_TAG, M6502_IRQ_LINE)) MCFG_VIC20_EXPANSION_SLOT_NMI_CALLBACK(INPUTLINE(M6502_TAG, M6502_NMI_LINE)) MCFG_VIC20_EXPANSION_SLOT_RES_CALLBACK(WRITELINE(*this, vic20_state, exp_reset_w)) |