diff options
Diffstat (limited to 'src/devices/bus/kc/kc.h')
-rw-r--r-- | src/devices/bus/kc/kc.h | 62 |
1 files changed, 21 insertions, 41 deletions
diff --git a/src/devices/bus/kc/kc.h b/src/devices/bus/kc/kc.h index 0689169c5ee..0c14a8ef5d3 100644 --- a/src/devices/bus/kc/kc.h +++ b/src/devices/bus/kc/kc.h @@ -48,12 +48,21 @@ class kcexp_slot_device : public device_t, { public: // construction/destruction + template <typename T> + kcexp_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : kcexp_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } kcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~kcexp_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)); } - template <class Object> devcb_base &set_out_halt_callback(Object &&cb) { return m_out_halt_cb.set_callback(std::forward<Object>(cb)); } + auto irq() { return m_out_irq_cb.bind(); } + auto nmi() { return m_out_nmi_cb.bind(); } + auto halt() { return m_out_halt_cb.bind(); } // inline configuration void set_next_slot(const char *next_module_tag) { m_next_slot_tag = next_module_tag; } @@ -91,6 +100,15 @@ class kccart_slot_device : public kcexp_slot_device, { public: // construction/destruction + template <typename T> + kccart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : kccart_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } kccart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~kccart_slot_device(); @@ -115,42 +133,4 @@ public: DECLARE_DEVICE_TYPE(KCEXP_SLOT, kcexp_slot_device) DECLARE_DEVICE_TYPE(KCCART_SLOT, kccart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_KCEXP_SLOT_OUT_IRQ_CB(_devcb) \ - downcast<kcexp_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb); - -#define MCFG_KCEXP_SLOT_OUT_NMI_CB(_devcb) \ - downcast<kcexp_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb); - -#define MCFG_KCEXP_SLOT_OUT_HALT_CB(_devcb) \ - downcast<kcexp_slot_device &>(*device).set_out_halt_callback(DEVCB_##_devcb); - -#define MCFG_KCEXP_SLOT_NEXT_SLOT(_next_slot_tag) \ - downcast<kcexp_slot_device &>(*device).set_next_slot(_next_slot_tag); - - -#define MCFG_KCCART_SLOT_OUT_IRQ_CB(_devcb) \ - downcast<kccart_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb); - -#define MCFG_KCCART_SLOT_OUT_NMI_CB(_devcb) \ - downcast<kccart_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb); - -#define MCFG_KCCART_SLOT_OUT_HALT_CB(_devcb) \ - downcast<kccart_slot_device &>(*device).set_out_halt_callback(DEVCB_##_devcb); - -#define MCFG_KCCART_SLOT_NEXT_SLOT(_next_slot_tag) \ - downcast<kccart_slot_device &>(*device).set_next_slot(_next_slot_tag); - -// #define MCFG_KC85_EXPANSION_ADD(_tag,_next_slot_tag,_config,_slot_intf,_def_slot) -// MCFG_DEVICE_ADD(_tag, KCEXP_SLOT, 0) -// MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - -// #define MCFG_KC85_CARTRIDGE_ADD(_tag,_next_slot_tag,_config,_slot_intf,_def_slot) -// MCFG_DEVICE_ADD(_tag, KCCART_SLOT, 0) -// MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - #endif // MAME_BUS_KC_KC_H |