summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/coco/cococart.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
committer Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
commit97b67170277437131adf6ed4d60139c172529e4f (patch)
tree7a5cbf608f191075f1612b1af15832c206a3fe2d /src/devices/bus/coco/cococart.h
parentb380514764cf857469bae61c11143a19f79a74c5 (diff)
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
Diffstat (limited to 'src/devices/bus/coco/cococart.h')
-rw-r--r--src/devices/bus/coco/cococart.h46
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