summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/msx_slot/cartridge.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/msx_slot/cartridge.h')
-rw-r--r--src/devices/bus/msx_slot/cartridge.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/devices/bus/msx_slot/cartridge.h b/src/devices/bus/msx_slot/cartridge.h
index faabf394042..be0856e8d82 100644
--- a/src/devices/bus/msx_slot/cartridge.h
+++ b/src/devices/bus/msx_slot/cartridge.h
@@ -14,6 +14,18 @@ DECLARE_DEVICE_TYPE(MSX_SLOT_CARTRIDGE, msx_slot_cartridge_device)
DECLARE_DEVICE_TYPE(MSX_SLOT_YAMAHA_EXPANSION, msx_slot_yamaha_expansion_device)
+#define MCFG_MSX_SLOT_CARTRIDGE_ADD(_tag, _devcb) \
+ MCFG_DEVICE_ADD(_tag, MSX_SLOT_CARTRIDGE, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(msx_cart, nullptr, false) \
+ downcast<msx_slot_cartridge_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+
+
+#define MCFG_MSX_SLOT_YAMAHA_EXPANSION_ADD(_tag, _devcb, _default) \
+ MCFG_DEVICE_ADD(_tag, MSX_SLOT_YAMAHA_EXPANSION, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(msx_yamaha_60pin, _default, false) \
+ downcast<msx_slot_cartridge_device &>(*device).set_irq_handler(DEVCB_##_devcb);
+
+
class msx_slot_cartridge_device : public device_t
, public device_image_interface
, public device_slot_interface
@@ -23,8 +35,8 @@ public:
// construction/destruction
msx_slot_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // configuration helpers
- auto irq_handler() { return m_irq_handler.bind(); }
+ // static configuration helpers
+ template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
// image-level overrides
virtual image_init_result call_load() override;
@@ -45,8 +57,8 @@ public:
virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
// msx_internal_slot-level overrides
- virtual uint8_t read(offs_t offset) override;
- virtual void write(offs_t offset, uint8_t data) override;
+ virtual DECLARE_READ8_MEMBER(read) override;
+ virtual DECLARE_WRITE8_MEMBER(write) override;
DECLARE_WRITE_LINE_MEMBER(irq_out);
@@ -54,7 +66,6 @@ protected:
msx_slot_cartridge_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
- virtual void device_resolve_objects() override;
virtual void device_start() override;
devcb_write_line m_irq_handler;