From d82064f05a53c3a831d9e64101fea2e087e9db75 Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 27 Feb 2018 16:02:02 -0500 Subject: i8257: Cleanup (nw) --- src/devices/machine/i8257.h | 55 +++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 37 deletions(-) (limited to 'src/devices/machine/i8257.h') diff --git a/src/devices/machine/i8257.h b/src/devices/machine/i8257.h index c482fe0fe05..f20e68bcee1 100644 --- a/src/devices/machine/i8257.h +++ b/src/devices/machine/i8257.h @@ -54,40 +54,40 @@ devcb = &i8257_device::set_out_memw_callback(*device, DEVCB_##_devcb); #define MCFG_I8257_IN_IOR_0_CB(_devcb) \ - devcb = &i8257_device::set_in_ior_0_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_in_ior_callback(*device, 0, DEVCB_##_devcb); #define MCFG_I8257_IN_IOR_1_CB(_devcb) \ - devcb = &i8257_device::set_in_ior_1_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_in_ior_callback(*device, 1, DEVCB_##_devcb); #define MCFG_I8257_IN_IOR_2_CB(_devcb) \ - devcb = &i8257_device::set_in_ior_2_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_in_ior_callback(*device, 2, DEVCB_##_devcb); #define MCFG_I8257_IN_IOR_3_CB(_devcb) \ - devcb = &i8257_device::set_in_ior_3_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_in_ior_callback(*device, 3, DEVCB_##_devcb); #define MCFG_I8257_OUT_IOW_0_CB(_devcb) \ - devcb = &i8257_device::set_out_iow_0_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_out_iow_callback(*device, 0, DEVCB_##_devcb); #define MCFG_I8257_OUT_IOW_1_CB(_devcb) \ - devcb = &i8257_device::set_out_iow_1_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_out_iow_callback(*device, 1, DEVCB_##_devcb); #define MCFG_I8257_OUT_IOW_2_CB(_devcb) \ - devcb = &i8257_device::set_out_iow_2_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_out_iow_callback(*device, 2, DEVCB_##_devcb); #define MCFG_I8257_OUT_IOW_3_CB(_devcb) \ - devcb = &i8257_device::set_out_iow_3_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_out_iow_callback(*device, 3, DEVCB_##_devcb); #define MCFG_I8257_OUT_DACK_0_CB(_devcb) \ - devcb = &i8257_device::set_out_dack_0_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_out_dack_callback(*device, 0, DEVCB_##_devcb); #define MCFG_I8257_OUT_DACK_1_CB(_devcb) \ - devcb = &i8257_device::set_out_dack_1_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_out_dack_callback(*device, 1, DEVCB_##_devcb); #define MCFG_I8257_OUT_DACK_2_CB(_devcb) \ - devcb = &i8257_device::set_out_dack_2_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_out_dack_callback(*device, 2, DEVCB_##_devcb); #define MCFG_I8257_OUT_DACK_3_CB(_devcb) \ - devcb = &i8257_device::set_out_dack_3_callback(*device, DEVCB_##_devcb); + devcb = &i8257_device::set_out_dack_callback(*device, 3, DEVCB_##_devcb); // HACK: the radio86 and alikes require this, is it a bug in the soviet clone or is there something else happening? #define MCFG_I8257_REVERSE_RW_MODE(_flag) \ @@ -119,20 +119,10 @@ public: template static devcb_base &set_in_memr_callback(device_t &device, Object &&cb) { return downcast(device).m_in_memr_cb.set_callback(std::forward(cb)); } template static devcb_base &set_out_memw_callback(device_t &device, Object &&cb) { return downcast(device).m_out_memw_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_in_ior_0_callback(device_t &device, Object &&cb) { return downcast(device).m_in_ior_0_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_in_ior_1_callback(device_t &device, Object &&cb) { return downcast(device).m_in_ior_1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_in_ior_2_callback(device_t &device, Object &&cb) { return downcast(device).m_in_ior_2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_in_ior_3_callback(device_t &device, Object &&cb) { return downcast(device).m_in_ior_3_cb.set_callback(std::forward(cb)); } + template static devcb_base &set_in_ior_callback(device_t &device, int ch, Object &&cb) { return downcast(device).m_in_ior_cb[ch].set_callback(std::forward(cb)); } + template static devcb_base &set_out_iow_callback(device_t &device, int ch, Object &&cb) { return downcast(device).m_out_iow_cb[ch].set_callback(std::forward(cb)); } - template static devcb_base &set_out_iow_0_callback(device_t &device, Object &&cb) { return downcast(device).m_out_iow_0_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_iow_1_callback(device_t &device, Object &&cb) { return downcast(device).m_out_iow_1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_iow_2_callback(device_t &device, Object &&cb) { return downcast(device).m_out_iow_2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_iow_3_callback(device_t &device, Object &&cb) { return downcast(device).m_out_iow_3_cb.set_callback(std::forward(cb)); } - - template static devcb_base &set_out_dack_0_callback(device_t &device, Object &&cb) { return downcast(device).m_out_dack_0_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_dack_1_callback(device_t &device, Object &&cb) { return downcast(device).m_out_dack_1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_dack_2_callback(device_t &device, Object &&cb) { return downcast(device).m_out_dack_2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_dack_3_callback(device_t &device, Object &&cb) { return downcast(device).m_out_dack_3_cb.set_callback(std::forward(cb)); } + template static devcb_base &set_out_dack_callback(device_t &device, int ch, Object &&cb) { return downcast(device).m_out_dack_cb[ch].set_callback(std::forward(cb)); } static void static_set_reverse_rw_mode(device_t &device, bool flag) { downcast(device).m_reverse_rw = flag; } @@ -177,18 +167,9 @@ private: devcb_write8 m_out_memw_cb; /* channel accessors */ - devcb_read8 m_in_ior_0_cb; - devcb_read8 m_in_ior_1_cb; - devcb_read8 m_in_ior_2_cb; - devcb_read8 m_in_ior_3_cb; - devcb_write8 m_out_iow_0_cb; - devcb_write8 m_out_iow_1_cb; - devcb_write8 m_out_iow_2_cb; - devcb_write8 m_out_iow_3_cb; - devcb_write_line m_out_dack_0_cb; - devcb_write_line m_out_dack_1_cb; - devcb_write_line m_out_dack_2_cb; - devcb_write_line m_out_dack_3_cb; + devcb_read8 m_in_ior_cb[4]; + devcb_write8 m_out_iow_cb[4]; + devcb_write_line m_out_dack_cb[4]; struct { -- cgit v1.2.3-70-g09d2