summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/msx_cart/konami.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/msx_cart/konami.cpp')
-rw-r--r--src/devices/bus/msx_cart/konami.cpp67
1 files changed, 45 insertions, 22 deletions
diff --git a/src/devices/bus/msx_cart/konami.cpp b/src/devices/bus/msx_cart/konami.cpp
index 6ec28cd8469..d84ee41c5c5 100644
--- a/src/devices/bus/msx_cart/konami.cpp
+++ b/src/devices/bus/msx_cart/konami.cpp
@@ -35,8 +35,12 @@ msx_cart_konami_device::msx_cart_konami_device(const machine_config &mconfig, co
void msx_cart_konami_device::device_start()
{
save_item(NAME(m_selected_bank));
+}
+
- machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_konami_device::restore_banks), this));
+void msx_cart_konami_device::device_post_load()
+{
+ restore_banks();
}
@@ -84,13 +88,13 @@ void msx_cart_konami_device::initialize_cartridge()
}
-READ8_MEMBER(msx_cart_konami_device::read_cart)
+uint8_t msx_cart_konami_device::read_cart(offs_t offset)
{
return m_bank_base[offset >> 13][offset & 0x1fff];
}
-WRITE8_MEMBER(msx_cart_konami_device::write_cart)
+void msx_cart_konami_device::write_cart(offs_t offset, uint8_t data)
{
switch (offset & 0xe000)
{
@@ -153,8 +157,12 @@ void msx_cart_konami_scc_device::device_start()
{
save_item(NAME(m_selected_bank));
save_item(NAME(m_scc_active));
+}
- machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_konami_scc_device::restore_banks), this));
+
+void msx_cart_konami_scc_device::device_post_load()
+{
+ restore_banks();
}
@@ -203,8 +211,10 @@ void msx_cart_konami_scc_device::initialize_cartridge()
}
-READ8_MEMBER(msx_cart_konami_scc_device::read_cart)
+uint8_t msx_cart_konami_scc_device::read_cart(offs_t offset)
{
+ address_space &space = machine().dummy_space();
+
if ( m_scc_active && offset >= 0x9800 && offset < 0xa000 )
{
if (offset & 0x80)
@@ -225,8 +235,10 @@ READ8_MEMBER(msx_cart_konami_scc_device::read_cart)
}
-WRITE8_MEMBER(msx_cart_konami_scc_device::write_cart)
+void msx_cart_konami_scc_device::write_cart(offs_t offset, uint8_t data)
{
+ address_space &space = machine().dummy_space();
+
switch (offset & 0xf800)
{
case 0x5000:
@@ -311,8 +323,12 @@ msx_cart_gamemaster2_device::msx_cart_gamemaster2_device(const machine_config &m
void msx_cart_gamemaster2_device::device_start()
{
save_item(NAME(m_selected_bank));
+}
+
- machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_gamemaster2_device::restore_banks), this));
+void msx_cart_gamemaster2_device::device_post_load()
+{
+ restore_banks();
}
@@ -397,7 +413,7 @@ void msx_cart_gamemaster2_device::initialize_cartridge()
}
-READ8_MEMBER(msx_cart_gamemaster2_device::read_cart)
+uint8_t msx_cart_gamemaster2_device::read_cart(offs_t offset)
{
uint8_t bank = offset >> 13;
@@ -431,7 +447,7 @@ READ8_MEMBER(msx_cart_gamemaster2_device::read_cart)
}
-WRITE8_MEMBER(msx_cart_gamemaster2_device::write_cart)
+void msx_cart_gamemaster2_device::write_cart(offs_t offset, uint8_t data)
{
switch (offset & 0xf000)
{
@@ -499,7 +515,7 @@ void msx_cart_synthesizer_device::initialize_cartridge()
}
-READ8_MEMBER(msx_cart_synthesizer_device::read_cart)
+uint8_t msx_cart_synthesizer_device::read_cart(offs_t offset)
{
if (offset >= 0x4000 && offset < 0xc000 )
{
@@ -509,7 +525,7 @@ READ8_MEMBER(msx_cart_synthesizer_device::read_cart)
}
-WRITE8_MEMBER(msx_cart_synthesizer_device::write_cart)
+void msx_cart_synthesizer_device::write_cart(offs_t offset, uint8_t data)
{
if ((offset & 0xc010) == 0x4000)
{
@@ -561,8 +577,12 @@ void msx_cart_konami_sound_device::device_start()
save_item(NAME(m_scc_active));
save_item(NAME(m_sccplus_active));
save_item(NAME(m_ram_enabled));
+}
- machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_konami_sound_device::restore_banks), this));
+
+void msx_cart_konami_sound_device::device_post_load()
+{
+ restore_banks();
}
@@ -620,8 +640,10 @@ void msx_cart_konami_sound_device::initialize_cartridge()
}
-READ8_MEMBER(msx_cart_konami_sound_device::read_cart)
+uint8_t msx_cart_konami_sound_device::read_cart(offs_t offset)
{
+ address_space &space = machine().dummy_space();
+
if ( m_scc_active && offset >= 0x9800 && offset < 0x9fe0 )
{
offset &= 0xff;
@@ -668,8 +690,10 @@ READ8_MEMBER(msx_cart_konami_sound_device::read_cart)
}
-WRITE8_MEMBER(msx_cart_konami_sound_device::write_cart)
+void msx_cart_konami_sound_device::write_cart(offs_t offset, uint8_t data)
{
+ address_space &space = machine().dummy_space();
+
switch (offset & 0xe000)
{
case 0x4000:
@@ -887,10 +911,9 @@ void msx_cart_keyboard_master_device::device_add_mconfig(machine_config &config)
void msx_cart_keyboard_master_device::device_start()
{
// Install IO read/write handlers
- address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO);
- space.install_write_handler(0x00, 0x00, write8_delegate(FUNC(vlm5030_device::data_w), m_vlm5030.target()));
- space.install_write_handler(0x20, 0x20, write8_delegate(FUNC(msx_cart_keyboard_master_device::io_20_w), this));
- space.install_read_handler(0x00, 0x00, read8_delegate(FUNC(msx_cart_keyboard_master_device::io_00_r), this));
+ io_space().install_write_handler(0x00, 0x00, write8_delegate(FUNC(vlm5030_device::data_w), m_vlm5030.target()));
+ io_space().install_write_handler(0x20, 0x20, write8smo_delegate(FUNC(msx_cart_keyboard_master_device::io_20_w), this));
+ io_space().install_read_handler(0x00, 0x00, read8smo_delegate(FUNC(msx_cart_keyboard_master_device::io_00_r), this));
}
@@ -903,7 +926,7 @@ void msx_cart_keyboard_master_device::initialize_cartridge()
}
-READ8_MEMBER(msx_cart_keyboard_master_device::read_cart)
+uint8_t msx_cart_keyboard_master_device::read_cart(offs_t offset)
{
if (offset >= 0x4000 && offset < 0x8000)
{
@@ -913,13 +936,13 @@ READ8_MEMBER(msx_cart_keyboard_master_device::read_cart)
}
-READ8_MEMBER(msx_cart_keyboard_master_device::read_vlm)
+uint8_t msx_cart_keyboard_master_device::read_vlm(offs_t offset)
{
return m_rom_vlm5030[offset];
}
-WRITE8_MEMBER(msx_cart_keyboard_master_device::io_20_w)
+void msx_cart_keyboard_master_device::io_20_w(uint8_t data)
{
m_vlm5030->rst((data & 0x01) ? 1 : 0);
m_vlm5030->vcu((data & 0x04) ? 1 : 0);
@@ -927,7 +950,7 @@ WRITE8_MEMBER(msx_cart_keyboard_master_device::io_20_w)
}
-READ8_MEMBER(msx_cart_keyboard_master_device::io_00_r)
+uint8_t msx_cart_keyboard_master_device::io_00_r()
{
return m_vlm5030->bsy() ? 0x10 : 0x00;
}