diff options
Diffstat (limited to 'src/devices/machine/latch.h')
-rw-r--r-- | src/devices/machine/latch.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/devices/machine/latch.h b/src/devices/machine/latch.h index 8c93a40f8b0..edc87eefd1c 100644 --- a/src/devices/machine/latch.h +++ b/src/devices/machine/latch.h @@ -7,36 +7,35 @@ #define MCFG_OUTPUT_LATCH_BIT0_HANDLER(_devcb) \ - devcb = &output_latch_device::set_bit_handler<0>(*device, DEVCB_##_devcb); + devcb = &downcast<output_latch_device &>(*device).set_bit_handler<0>(DEVCB_##_devcb); #define MCFG_OUTPUT_LATCH_BIT1_HANDLER(_devcb) \ - devcb = &output_latch_device::set_bit_handler<1>(*device, DEVCB_##_devcb); + devcb = &downcast<output_latch_device &>(*device).set_bit_handler<1>(DEVCB_##_devcb); #define MCFG_OUTPUT_LATCH_BIT2_HANDLER(_devcb) \ - devcb = &output_latch_device::set_bit_handler<2>(*device, DEVCB_##_devcb); + devcb = &downcast<output_latch_device &>(*device).set_bit_handler<2>(DEVCB_##_devcb); #define MCFG_OUTPUT_LATCH_BIT3_HANDLER(_devcb) \ - devcb = &output_latch_device::set_bit_handler<3>(*device, DEVCB_##_devcb); + devcb = &downcast<output_latch_device &>(*device).set_bit_handler<3>(DEVCB_##_devcb); #define MCFG_OUTPUT_LATCH_BIT4_HANDLER(_devcb) \ - devcb = &output_latch_device::set_bit_handler<4>(*device, DEVCB_##_devcb); + devcb = &downcast<output_latch_device &>(*device).set_bit_handler<4>(DEVCB_##_devcb); #define MCFG_OUTPUT_LATCH_BIT5_HANDLER(_devcb) \ - devcb = &output_latch_device::set_bit_handler<5>(*device, DEVCB_##_devcb); + devcb = &downcast<output_latch_device &>(*device).set_bit_handler<5>(DEVCB_##_devcb); #define MCFG_OUTPUT_LATCH_BIT6_HANDLER(_devcb) \ - devcb = &output_latch_device::set_bit_handler<6>(*device, DEVCB_##_devcb); + devcb = &downcast<output_latch_device &>(*device).set_bit_handler<6>(DEVCB_##_devcb); #define MCFG_OUTPUT_LATCH_BIT7_HANDLER(_devcb) \ - devcb = &output_latch_device::set_bit_handler<7>(*device, DEVCB_##_devcb); + devcb = &downcast<output_latch_device &>(*device).set_bit_handler<7>(DEVCB_##_devcb); class output_latch_device : public device_t { public: output_latch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <unsigned Bit, class Object> static devcb_base &set_bit_handler(device_t &device, Object &&cb) - { return downcast<output_latch_device &>(device).m_bit_handlers[Bit].set_callback(std::forward<Object>(cb)); } + template <unsigned Bit, class Object> devcb_base &set_bit_handler(Object &&cb) { return m_bit_handlers[Bit].set_callback(std::forward<Object>(cb)); } void write(uint8_t data); DECLARE_WRITE8_MEMBER(write) { write(data); } |