diff options
author | mooglyguy <therealmogminer@gmail.com> | 2018-09-06 20:04:41 +0200 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2018-09-06 20:04:53 +0200 |
commit | 85699f365d6b694d581733df4c68e6366988bee7 (patch) | |
tree | c592e92305e5fbe077e1a42bde8964d9030b1510 | |
parent | 43cba38b7e3b19eb11d527dd4f86579df72fa1f8 (diff) |
-lh5810: De-MCFG, nw
-rw-r--r-- | src/devices/machine/lh5810.h | 47 | ||||
-rw-r--r-- | src/mame/drivers/pc1500.cpp | 12 |
2 files changed, 13 insertions, 46 deletions
diff --git a/src/devices/machine/lh5810.h b/src/devices/machine/lh5810.h index 776e5497d56..75716274c38 100644 --- a/src/devices/machine/lh5810.h +++ b/src/devices/machine/lh5810.h @@ -11,49 +11,18 @@ #pragma once - -//************************************************************************* -// INTERFACE CONFIGURATION MACROS -//************************************************************************* - -#define MCFG_LH5810_PORTA_R_CB(_devcb) \ - downcast<lh5810_device &>(*device).set_porta_r_callback(DEVCB_##_devcb); - -#define MCFG_LH5810_PORTA_W_CB(_devcb) \ - downcast<lh5810_device &>(*device).set_porta_w_callback(DEVCB_##_devcb); - -#define MCFG_LH5810_PORTB_R_CB(_devcb) \ - downcast<lh5810_device &>(*device).set_portb_r_callback(DEVCB_##_devcb); - -#define MCFG_LH5810_PORTB_W_CB(_devcb) \ - downcast<lh5810_device &>(*device).set_portb_w_callback(DEVCB_##_devcb); - -#define MCFG_LH5810_PORTC_W_CB(_devcb) \ - downcast<lh5810_device &>(*device).set_portc_w_callback(DEVCB_##_devcb); - -#define MCFG_LH5810_OUT_INT_CB(_devcb) \ - downcast<lh5810_device &>(*device).set_out_int_callback(DEVCB_##_devcb); //currently unused - - - -//************************************************************************* -// TYPE DEFINITIONS -//************************************************************************* - -// ======================> lh5810_device - class lh5810_device : public device_t { public: // construction/destruction - lh5810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + lh5810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - template <class Object> devcb_base &set_porta_r_callback(Object &&cb) { return m_porta_r_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_porta_w_callback(Object &&cb) { return m_porta_w_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_portb_r_callback(Object &&cb) { return m_portb_r_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_portb_w_callback(Object &&cb) { return m_portb_w_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_portc_w_callback(Object &&cb) { return m_portc_w_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_out_int_callback(Object &&cb) { return m_out_int_cb.set_callback(std::forward<Object>(cb)); } + auto porta_r() { return m_porta_r_cb.bind(); } + auto porta_w() { return m_porta_w_cb.bind(); } + auto portb_r() { return m_portb_r_cb.bind(); } + auto portb_w() { return m_portb_w_cb.bind(); } + auto portc_w() { return m_portc_w_cb.bind(); } + auto out_int() { return m_out_int_cb.bind(); } DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( data_w ); @@ -77,8 +46,6 @@ private: uint8_t m_irq; }; - -// device type definition DECLARE_DEVICE_TYPE(LH5810, lh5810_device) #endif // MAME_MACHINE_LH5810_H diff --git a/src/mame/drivers/pc1500.cpp b/src/mame/drivers/pc1500.cpp index 5c9bf79d7fe..52ba566fe6d 100644 --- a/src/mame/drivers/pc1500.cpp +++ b/src/mame/drivers/pc1500.cpp @@ -288,12 +288,12 @@ MACHINE_CONFIG_START(pc1500_state::pc1500) MCFG_PALETTE_ADD("palette", 2) MCFG_PALETTE_INIT_OWNER(pc1500_state, pc1500) - MCFG_DEVICE_ADD("lh5810", LH5810, 0) - MCFG_LH5810_PORTA_R_CB(READ8(*this, pc1500_state, port_a_r)) - MCFG_LH5810_PORTA_W_CB(WRITE8(*this, pc1500_state, kb_matrix_w)) - MCFG_LH5810_PORTB_R_CB(READ8(*this, pc1500_state, port_b_r)) - MCFG_LH5810_PORTC_W_CB(WRITE8(*this, pc1500_state, port_c_w)) - MCFG_LH5810_OUT_INT_CB(INPUTLINE("maincpu", LH5801_LINE_MI)) + lh5810_device &ioports(LH5810(config, "lh5810")); + ioports.porta_r().set(FUNC(pc1500_state::port_a_r)); + ioports.porta_w().set(FUNC(pc1500_state::kb_matrix_w)); + ioports.portb_r().set(FUNC(pc1500_state::port_b_r)); + ioports.portc_w().set(FUNC(pc1500_state::port_c_w)); + ioports.out_int().set_inputline("maincpu", LH5801_LINE_MI); MCFG_UPD1990A_ADD("upd1990a", XTAL(32'768), NOOP, NOOP) MACHINE_CONFIG_END |