summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/msx_cart/korean.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/msx_cart/korean.cpp')
-rw-r--r--src/devices/bus/msx_cart/korean.cpp35
1 files changed, 12 insertions, 23 deletions
diff --git a/src/devices/bus/msx_cart/korean.cpp b/src/devices/bus/msx_cart/korean.cpp
index 1906a5eb51b..cfa96ecb7aa 100644
--- a/src/devices/bus/msx_cart/korean.cpp
+++ b/src/devices/bus/msx_cart/korean.cpp
@@ -21,12 +21,8 @@ msx_cart_korean_80in1_device::msx_cart_korean_80in1_device(const machine_config
void msx_cart_korean_80in1_device::device_start()
{
save_item(NAME(m_selected_bank));
-}
-
-void msx_cart_korean_80in1_device::device_post_load()
-{
- restore_banks();
+ machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_korean_80in1_device::restore_banks), this));
}
@@ -76,7 +72,7 @@ void msx_cart_korean_80in1_device::initialize_cartridge()
}
-uint8_t msx_cart_korean_80in1_device::read_cart(offs_t offset)
+READ8_MEMBER(msx_cart_korean_80in1_device::read_cart)
{
if (offset >= 0x4000 && offset < 0xc000)
{
@@ -87,7 +83,7 @@ uint8_t msx_cart_korean_80in1_device::read_cart(offs_t offset)
}
-void msx_cart_korean_80in1_device::write_cart(offs_t offset, uint8_t data)
+WRITE8_MEMBER(msx_cart_korean_80in1_device::write_cart)
{
if (offset >= 0x4000 && offset < 0x4004)
{
@@ -116,14 +112,11 @@ void msx_cart_korean_90in1_device::device_start()
{
save_item(NAME(m_selected_bank));
- // Install IO read/write handlers
- io_space().install_write_handler(0x77, 0x77, write8smo_delegate(FUNC(msx_cart_korean_90in1_device::banking), this));
-}
-
+ machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_korean_90in1_device::restore_banks), this));
-void msx_cart_korean_90in1_device::device_post_load()
-{
- restore_banks();
+ // Install IO read/write handlers
+ address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO);
+ space.install_write_handler(0x77, 0x77, write8_delegate(FUNC(msx_cart_korean_90in1_device::banking), this));
}
@@ -188,7 +181,7 @@ void msx_cart_korean_90in1_device::initialize_cartridge()
}
-uint8_t msx_cart_korean_90in1_device::read_cart(offs_t offset)
+READ8_MEMBER(msx_cart_korean_90in1_device::read_cart)
{
if (offset >= 0x4000 && offset < 0xc000)
{
@@ -199,7 +192,7 @@ uint8_t msx_cart_korean_90in1_device::read_cart(offs_t offset)
}
-void msx_cart_korean_90in1_device::banking(uint8_t data)
+WRITE8_MEMBER(msx_cart_korean_90in1_device::banking)
{
m_selected_bank = data;
restore_banks();
@@ -222,12 +215,8 @@ msx_cart_korean_126in1_device::msx_cart_korean_126in1_device(const machine_confi
void msx_cart_korean_126in1_device::device_start()
{
save_item(NAME(m_selected_bank));
-}
-
-void msx_cart_korean_126in1_device::device_post_load()
-{
- restore_banks();
+ machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_korean_126in1_device::restore_banks), this));
}
@@ -277,7 +266,7 @@ void msx_cart_korean_126in1_device::initialize_cartridge()
}
-uint8_t msx_cart_korean_126in1_device::read_cart(offs_t offset)
+READ8_MEMBER(msx_cart_korean_126in1_device::read_cart)
{
if (offset >= 0x4000 && offset < 0xc000)
{
@@ -288,7 +277,7 @@ uint8_t msx_cart_korean_126in1_device::read_cart(offs_t offset)
}
-void msx_cart_korean_126in1_device::write_cart(offs_t offset, uint8_t data)
+WRITE8_MEMBER(msx_cart_korean_126in1_device::write_cart)
{
if (offset >= 0x4000 && offset < 0x4002)
{