summaryrefslogtreecommitdiffstats
path: root/src/devices/bus/svi3x8
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/svi3x8')
-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
4 files changed, 53 insertions, 83 deletions
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