summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/m6805/m68hc05.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/m6805/m68hc05.h')
-rw-r--r--src/devices/cpu/m6805/m68hc05.h36
1 files changed, 4 insertions, 32 deletions
diff --git a/src/devices/cpu/m6805/m68hc05.h b/src/devices/cpu/m6805/m68hc05.h
index 4aaa856b867..a0aee9a277c 100644
--- a/src/devices/cpu/m6805/m68hc05.h
+++ b/src/devices/cpu/m6805/m68hc05.h
@@ -25,41 +25,13 @@ DECLARE_DEVICE_TYPE(M68HC705C8A, m68hc705c8a_device)
// ======================> m68hc05_device
-#define MCFG_M68HC05_PORTA_R_CB(obj) \
- downcast<m68hc05_device &>(*device).set_port_cb_r<0>(DEVCB_##obj);
-
-#define MCFG_M68HC05_PORTB_R_CB(obj) \
- downcast<m68hc05_device &>(*device).set_port_cb_r<1>(DEVCB_##obj);
-
-#define MCFG_M68HC05_PORTC_R_CB(obj) \
- downcast<m68hc05_device &>(*device).set_port_cb_r<2>(DEVCB_##obj);
-
-#define MCFG_M68HC05_PORTD_R_CB(obj) \
- downcast<m68hc05_device &>(*device).set_port_cb_r<3>(DEVCB_##obj);
-
-#define MCFG_M68HC05_PORTA_W_CB(obj) \
- downcast<m68hc05_device &>(*device).set_port_cb_w<0>(DEVCB_##obj);
-
-#define MCFG_M68HC05_PORTB_W_CB(obj) \
- downcast<m68hc05_device &>(*device).set_port_cb_w<1>(DEVCB_##obj);
-
-#define MCFG_M68HC05_PORTC_W_CB(obj) \
- downcast<m68hc05_device &>(*device).set_port_cb_w<2>(DEVCB_##obj);
-
-#define MCFG_M68HC05_PORTD_W_CB(obj) \
- downcast<m68hc05_device &>(*device).set_port_cb_w<3>(DEVCB_##obj);
-
-#define MCFG_M68HC05_TCMP_CB(obj) \
- downcast<m68hc05_device &>(*device).set_tcmp_cb(DEVCB_##obj);
-
-
class m68hc05_device : public m6805_base_device
{
public:
// configuration helpers
- template<std::size_t N, typename Object> devcb_base &set_port_cb_r(Object &&obj) { return m_port_cb_r[N].set_callback(std::forward<Object>(obj)); }
- template<std::size_t N, typename Object> devcb_base &set_port_cb_w(Object &&obj) { return m_port_cb_w[N].set_callback(std::forward<Object>(obj)); }
- template<typename Object> devcb_base &set_tcmp_cb(Object &&obj) { return m_tcmp_cb.set_callback(std::forward<Object>(obj)); }
+ template <std::size_t N> auto port_r() { return m_port_cb_r[N].bind(); }
+ template <std::size_t N> auto port_w() { return m_port_cb_w[N].bind(); }
+ auto tcmp() { return m_tcmp_cb.bind(); }
protected:
// state index constants
@@ -109,7 +81,7 @@ protected:
void set_port_bits(std::array<u8, PORT_COUNT> const &bits);
void set_port_interrupt(std::array<u8, PORT_COUNT> const &interrupt);
- DECLARE_READ8_MEMBER(port_r);
+ DECLARE_READ8_MEMBER(port_read);
DECLARE_WRITE8_MEMBER(port_latch_w);
DECLARE_READ8_MEMBER(port_ddr_r);
DECLARE_WRITE8_MEMBER(port_ddr_w);