summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/msx_slot/cartridge.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/msx_slot/cartridge.cpp')
-rw-r--r--src/devices/bus/msx_slot/cartridge.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/devices/bus/msx_slot/cartridge.cpp b/src/devices/bus/msx_slot/cartridge.cpp
index 522ea6f4548..87b89f93c78 100644
--- a/src/devices/bus/msx_slot/cartridge.cpp
+++ b/src/devices/bus/msx_slot/cartridge.cpp
@@ -43,7 +43,7 @@ msx_slot_cartridge_device::msx_slot_cartridge_device(const machine_config &mconf
: device_t(mconfig, type, tag, owner, clock)
, device_image_interface(mconfig, *this)
, device_slot_interface(mconfig, *this)
- , msx_internal_slot_interface()
+ , msx_internal_slot_interface(mconfig, *this)
, m_irq_handler(*this)
, m_cartridge(nullptr)
{
@@ -90,10 +90,17 @@ static const char *msx_cart_get_slot_option(int type)
}
-void msx_slot_cartridge_device::device_start()
+void msx_slot_cartridge_device::device_resolve_objects()
{
m_irq_handler.resolve_safe();
m_cartridge = dynamic_cast<msx_cart_interface *>(get_card_device());
+ if (m_cartridge)
+ m_cartridge->m_exp = this;
+}
+
+
+void msx_slot_cartridge_device::device_start()
+{
}
@@ -169,7 +176,7 @@ image_init_result msx_slot_cartridge_device::call_load()
}
}
- m_cartridge->set_out_irq_cb(DEVCB_WRITELINE(*this, msx_slot_cartridge_device, irq_out));
+ m_cartridge->m_exp = this;
m_cartridge->initialize_cartridge();
if (m_cartridge->get_sram_size() > 0)
@@ -331,21 +338,21 @@ std::string msx_slot_cartridge_device::get_default_card_software(get_default_car
}
-READ8_MEMBER(msx_slot_cartridge_device::read)
+uint8_t msx_slot_cartridge_device::read(offs_t offset)
{
if ( m_cartridge )
{
- return m_cartridge->read_cart(space, offset);
+ return m_cartridge->read_cart(offset);
}
return 0xFF;
}
-WRITE8_MEMBER(msx_slot_cartridge_device::write)
+void msx_slot_cartridge_device::write(offs_t offset, uint8_t data)
{
if ( m_cartridge )
{
- m_cartridge->write_cart(space, offset, data);
+ m_cartridge->write_cart(offset, data);
}
}
@@ -360,8 +367,4 @@ msx_slot_yamaha_expansion_device::msx_slot_yamaha_expansion_device(const machine
void msx_slot_yamaha_expansion_device::device_start()
{
- m_irq_handler.resolve_safe();
- m_cartridge = dynamic_cast<msx_cart_interface *>(get_card_device());
- if (m_cartridge)
- m_cartridge->set_out_irq_cb(DEVCB_WRITELINE(*this, msx_slot_cartridge_device, irq_out));
}