diff options
author | andreasnaive <andreasnaive@gmail.com> | 2019-03-25 23:13:40 +0100 |
---|---|---|
committer | andreasnaive <andreasnaive@gmail.com> | 2019-03-25 23:13:40 +0100 |
commit | b380514764cf857469bae61c11143a19f79a74c5 (patch) | |
tree | 63c8012e262618f08a332da31dd714281aa2c5ed /src/devices/bus/coco/cococart.h | |
parent | c24473ddff715ecec2e258a6eb38960cf8c8e98e (diff) |
Revert "conflict resolution (nw)"
This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing
changes made to 009cba4fb8102102168ef32870892438327f3705.
Diffstat (limited to 'src/devices/bus/coco/cococart.h')
-rw-r--r-- | src/devices/bus/coco/cococart.h | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/src/devices/bus/coco/cococart.h b/src/devices/bus/coco/cococart.h index c559a2eea53..2d5d37fd443 100644 --- a/src/devices/bus/coco/cococart.h +++ b/src/devices/bus/coco/cococart.h @@ -25,6 +25,15 @@ // 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; @@ -63,6 +72,9 @@ 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(); } @@ -187,25 +199,9 @@ protected: // cartridges (e.g. - Orch-90, Multi-Pak interface) for their control registers, independently // of the SCS or CTS lines address_space &cartridge_space(); - 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)); - } + 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); // setting line values void set_line_value(cococart_slot_device::line line, cococart_slot_device::line_value value); @@ -220,4 +216,16 @@ 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 |