diff options
Diffstat (limited to 'src/devices/bus/gamegear/ggext.h')
-rw-r--r-- | src/devices/bus/gamegear/ggext.h | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/devices/bus/gamegear/ggext.h b/src/devices/bus/gamegear/ggext.h index 71d6ecfcf72..1eed1545bed 100644 --- a/src/devices/bus/gamegear/ggext.h +++ b/src/devices/bus/gamegear/ggext.h @@ -16,28 +16,6 @@ #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 //************************************************************************** @@ -50,13 +28,23 @@ class gg_ext_port_device : public device_t, public device_slot_interface { public: // construction/destruction - gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + 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); virtual ~gg_ext_port_device(); // static configuration helpers - template <class Object> devcb_base &set_th_input_handler(Object &&cb) { return m_th_pin_handler.set_callback(std::forward<Object>(cb)); } + auto th_input_handler() { return m_th_pin_handler.bind(); } - template <class Object> devcb_base &set_pixel_handler(Object &&cb) { return m_pixel_handler.set_callback(std::forward<Object>(cb)); } + auto pixel_handler() { return m_pixel_handler.bind(); } // Currently, only the support for SMS Controller Adaptor is emulated, // for when SMS Compatibility mode is enabled. In that mode, the 10 pins |