diff options
Diffstat (limited to 'src/devices/bus/coco/cococart.h')
-rw-r--r-- | src/devices/bus/coco/cococart.h | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/src/devices/bus/coco/cococart.h b/src/devices/bus/coco/cococart.h index 2d5d37fd443..c559a2eea53 100644 --- a/src/devices/bus/coco/cococart.h +++ b/src/devices/bus/coco/cococart.h @@ -25,15 +25,6 @@ // direct region update handler typedef delegate<void (uint8_t *)> cococart_base_update_delegate; -#define MCFG_COCO_CARTRIDGE_CART_CB(_devcb) \ - downcast<cococart_slot_device &>(*device).set_cart_callback(DEVCB_##_devcb); - -#define MCFG_COCO_CARTRIDGE_NMI_CB(_devcb) \ - downcast<cococart_slot_device &>(*device).set_nmi_callback(DEVCB_##_devcb); - -#define MCFG_COCO_CARTRIDGE_HALT_CB(_devcb) \ - downcast<cococart_slot_device &>(*device).set_halt_callback(DEVCB_##_devcb); - // ======================> cococart_slot_device class device_cococart_interface; @@ -72,9 +63,6 @@ public: } cococart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_cart_callback(Object &&cb) { return m_cart_callback.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_nmi_callback(Object &&cb) { return m_nmi_callback.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_halt_callback(Object &&cb) { return m_halt_callback.set_callback(std::forward<Object>(cb)); } auto cart_callback() { return m_cart_callback.bind(); } auto nmi_callback() { return m_nmi_callback.bind(); } auto halt_callback() { return m_halt_callback.bind(); } @@ -199,9 +187,25 @@ protected: // cartridges (e.g. - Orch-90, Multi-Pak interface) for their control registers, independently // of the SCS or CTS lines address_space &cartridge_space(); - void install_read_handler(uint16_t addrstart, uint16_t addrend, read8_delegate rhandler); - void install_write_handler(uint16_t addrstart, uint16_t addrend, write8_delegate whandler); - void install_readwrite_handler(uint16_t addrstart, uint16_t addrend, read8_delegate rhandler, write8_delegate whandler); + template <typename R> + void install_read_handler(u16 addrstart, u16 addrend, R &&rhandler) + { + address_space &space(cartridge_space()); + space.install_read_handler(addrstart, addrend, std::forward<R>(rhandler)); + } + template <typename W> + void install_write_handler(u16 addrstart, u16 addrend, W &&whandler) + { + address_space &space(cartridge_space()); + space.install_write_handler(addrstart, addrend, std::forward<W>(whandler)); + } + template <typename R, typename W> + void install_readwrite_handler(u16 addrstart, u16 addrend, R &&rhandler, W &&whandler) + { + address_space &space(cartridge_space()); + space.install_read_handler(addrstart, addrend, std::forward<R>(rhandler)); + space.install_write_handler(addrstart, addrend, std::forward<W>(whandler)); + } // setting line values void set_line_value(cococart_slot_device::line line, cococart_slot_device::line_value value); @@ -216,16 +220,4 @@ private: device_cococart_host_interface * m_host; }; - -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_COCO_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ - MCFG_DEVICE_ADD(_tag, COCOCART_SLOT, DERIVED_CLOCK(1, 1)) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - -#define MCFG_COCO_CARTRIDGE_REMOVE(_tag) \ - MCFG_DEVICE_REMOVE(_tag) - #endif // MAME_BUS_COCO_COCOCART_H |