summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/cgenie/expansion/expansion.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/cgenie/expansion/expansion.h')
-rw-r--r--src/devices/bus/cgenie/expansion/expansion.h45
1 files changed, 28 insertions, 17 deletions
diff --git a/src/devices/bus/cgenie/expansion/expansion.h b/src/devices/bus/cgenie/expansion/expansion.h
index 3f61b275c19..2dd6f659f5e 100644
--- a/src/devices/bus/cgenie/expansion/expansion.h
+++ b/src/devices/bus/cgenie/expansion/expansion.h
@@ -39,8 +39,24 @@
#pragma once
-// include here so drivers don't need to
-#include "carts.h"
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_CG_EXP_SLOT_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, CG_EXP_SLOT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(cg_exp_slot_carts, nullptr, false)
+
+#define MCFG_CG_EXP_SLOT_INT_HANDLER(_devcb) \
+ downcast<cg_exp_slot_device &>(*device).set_int_handler(DEVCB_##_devcb);
+
+#define MCFG_CG_EXP_SLOT_NMI_HANDLER(_devcb) \
+ downcast<cg_exp_slot_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
+
+#define MCFG_CG_EXP_SLOT_RESET_HANDLER(_devcb) \
+ downcast<cg_exp_slot_device &>(*device).set_reset_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -53,32 +69,24 @@ class cg_exp_slot_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
- cg_exp_slot_device(machine_config const &mconfig, char const *tag, device_t *owner)
- : cg_exp_slot_device(mconfig, tag, owner, (uint32_t)0)
- {
- option_reset();
- cg_exp_slot_carts(*this);
- set_default_option(nullptr);
- set_fixed(false);
- }
cg_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~cg_exp_slot_device();
- template <typename T> void set_program_space(T &&tag, int spacenum) { m_program.set_tag(std::forward<T>(tag), spacenum); }
- template <typename T> void set_io_space(T &&tag, int spacenum) { m_io.set_tag(std::forward<T>(tag), spacenum); }
+ void set_program_space(address_space *program);
+ void set_io_space(address_space *io);
// callbacks
- auto int_handler() { return m_int_handler.bind(); }
- auto nmi_handler() { return m_nmi_handler.bind(); }
- auto reset_handler() { return m_reset_handler.bind(); }
+ 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_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_reset_handler(Object &&cb) { return m_reset_handler.set_callback(std::forward<Object>(cb)); }
// called from cart device
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); }
DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_reset_handler(state); }
- required_address_space m_program;
- required_address_space m_io;
+ address_space *m_program;
+ address_space *m_io;
protected:
// device-level overrides
@@ -109,4 +117,7 @@ protected:
// device type definition
DECLARE_DEVICE_TYPE(CG_EXP_SLOT, cg_exp_slot_device)
+// include here so drivers don't need to
+#include "carts.h"
+
#endif // MAME_BUS_CGENIE_EXPANSION_EXPANSION_H