diff options
Diffstat (limited to 'src/devices/machine/microtch.h')
-rw-r--r-- | src/devices/machine/microtch.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/devices/machine/microtch.h b/src/devices/machine/microtch.h index 696807f044c..d39e930de10 100644 --- a/src/devices/machine/microtch.h +++ b/src/devices/machine/microtch.h @@ -12,14 +12,14 @@ class microtouch_device : { public: microtouch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> static devcb_base &static_set_stx_callback(device_t &device, Object &&cb) { return downcast<microtouch_device &>(device).m_out_stx_func.set_callback(std::forward<Object>(cb)); } + template <class Object> devcb_base &set_stx_callback(Object &&cb) { return m_out_stx_func.set_callback(std::forward<Object>(cb)); } virtual ioport_constructor device_input_ports() const override; DECLARE_WRITE_LINE_MEMBER(rx) { device_serial_interface::rx_w(state); } DECLARE_INPUT_CHANGED_MEMBER(touch); typedef delegate<int (int *, int *)> touch_cb; - static void static_set_touch_callback(device_t &device, touch_cb &&object) { downcast<microtouch_device &>(device).m_out_touch_cb = std::move(object); } + template <typename Object> void set_touch_callback(Object &&cb) { m_out_touch_cb = std::forward<Object>(cb); } protected: virtual void device_start() override; @@ -73,9 +73,9 @@ DECLARE_DEVICE_TYPE(MICROTOUCH, microtouch_device) #define MCFG_MICROTOUCH_ADD(_tag, _clock, _devcb) \ MCFG_DEVICE_ADD(_tag, MICROTOUCH, _clock) \ - devcb = µtouch_device::static_set_stx_callback(*device, DEVCB_##_devcb); + devcb = &downcast<microtouch_device &>(*device).set_stx_callback(DEVCB_##_devcb); #define MCFG_MICROTOUCH_TOUCH_CB(_class, _touch_cb) \ - microtouch_device::static_set_touch_callback(*device, microtouch_device::touch_cb(&_class::_touch_cb, this)); + downcast<microtouch_device &>(*device).set_touch_callback(microtouch_device::touch_cb(&_class::_touch_cb, this)); #endif // MAME_MACHINE_MICROTCH_H |