diff options
Diffstat (limited to 'src/devices/cpu/tlcs90/tlcs90.h')
-rw-r--r-- | src/devices/cpu/tlcs90/tlcs90.h | 70 |
1 files changed, 2 insertions, 68 deletions
diff --git a/src/devices/cpu/tlcs90/tlcs90.h b/src/devices/cpu/tlcs90/tlcs90.h index 73a168efb84..ee7fa72f042 100644 --- a/src/devices/cpu/tlcs90/tlcs90.h +++ b/src/devices/cpu/tlcs90/tlcs90.h @@ -5,64 +5,6 @@ #pragma once - -// I/O callbacks -#define MCFG_TLCS90_PORT_P0_READ_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_read_cb(0, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P1_READ_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_read_cb(1, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P2_READ_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_read_cb(2, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P3_READ_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_read_cb(3, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P4_READ_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_read_cb(4, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P5_READ_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_read_cb(5, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P6_READ_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_read_cb(6, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P7_READ_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_read_cb(7, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P8_READ_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_read_cb(8, DEVCB_##_devcb); - - -#define MCFG_TLCS90_PORT_P0_WRITE_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_write_cb(0, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P1_WRITE_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_write_cb(1, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P2_WRITE_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_write_cb(2, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P3_WRITE_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_write_cb(3, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P4_WRITE_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_write_cb(4, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P5_WRITE_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_write_cb(5, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P6_WRITE_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_write_cb(6, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P7_WRITE_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_write_cb(7, DEVCB_##_devcb); - -#define MCFG_TLCS90_PORT_P8_WRITE_CB(_devcb) \ - downcast<tlcs90_device &>(*device).set_port_write_cb(8, DEVCB_##_devcb); - - enum tlcs90_e_irq { INTSWI = 0, INTNMI, INTWD, INT0, INTT0, INTT1, INTT2, INTT3, INTT4, INT1, INTT5, INT2, INTRX, INTTX, INTMAX }; DECLARE_ENUM_INCDEC_OPERATORS(tlcs90_e_irq) @@ -89,16 +31,8 @@ protected: public: // configuration - template<class Object> devcb_base &set_port_read_cb(int port, Object &&object) - { - assert(port >= 0 && port < MAX_PORTS); - return m_port_read_cb[port].set_callback(std::forward<Object>(object)); - } - template<class Object> devcb_base &set_port_write_cb(int port, Object &&object) - { - assert(port >= 0 && port < MAX_PORTS); - return m_port_write_cb[port].set_callback(std::forward<Object>(object)); - } + template <size_t Port> auto port_read() { return m_port_read_cb[Port].bind(); } + template <size_t Port> auto port_write() { return m_port_write_cb[Port].bind(); } protected: // construction/destruction |