summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/gamegear/ggext.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/gamegear/ggext.h')
-rw-r--r--src/devices/bus/gamegear/ggext.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/devices/bus/gamegear/ggext.h b/src/devices/bus/gamegear/ggext.h
index 1eed1545bed..71d6ecfcf72 100644
--- a/src/devices/bus/gamegear/ggext.h
+++ b/src/devices/bus/gamegear/ggext.h
@@ -16,6 +16,28 @@
#pragma once
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_GG_EXT_PORT_ADD(_tag, _slot_intf, _def_slot) \
+ MCFG_DEVICE_ADD(_tag, GG_EXT_PORT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
+#define MCFG_GG_EXT_PORT_MODIFY(_tag) \
+ MCFG_DEVICE_MODIFY(_tag)
+
+
+#define MCFG_GG_EXT_PORT_TH_INPUT_HANDLER(_devcb) \
+ downcast<gg_ext_port_device &>(*device).set_th_input_handler(DEVCB_##_devcb);
+
+
+#define MCFG_GG_EXT_PORT_PIXEL_HANDLER(_devcb) \
+ downcast<gg_ext_port_device &>(*device).set_pixel_handler(DEVCB_##_devcb);
+
+
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -28,23 +50,13 @@ class gg_ext_port_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
- template <typename T>
- gg_ext_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
- : gg_ext_port_device(mconfig, tag, owner, 0)
- {
- option_reset();
- opts(*this);
- set_default_option(dflt);
- set_fixed(false);
- }
-
- gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~gg_ext_port_device();
// static configuration helpers
- auto th_input_handler() { return m_th_pin_handler.bind(); }
+ template <class Object> devcb_base &set_th_input_handler(Object &&cb) { return m_th_pin_handler.set_callback(std::forward<Object>(cb)); }
- auto pixel_handler() { return m_pixel_handler.bind(); }
+ template <class Object> devcb_base &set_pixel_handler(Object &&cb) { return m_pixel_handler.set_callback(std::forward<Object>(cb)); }
// Currently, only the support for SMS Controller Adaptor is emulated,
// for when SMS Compatibility mode is enabled. In that mode, the 10 pins