summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/msx_cart/fmpac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/msx_cart/fmpac.cpp')
-rw-r--r--src/devices/bus/msx_cart/fmpac.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/devices/bus/msx_cart/fmpac.cpp b/src/devices/bus/msx_cart/fmpac.cpp
index a5229a6c61e..7054c8c366a 100644
--- a/src/devices/bus/msx_cart/fmpac.cpp
+++ b/src/devices/bus/msx_cart/fmpac.cpp
@@ -29,12 +29,12 @@ msx_cart_fmpac_device::msx_cart_fmpac_device(const machine_config &mconfig, cons
}
-void msx_cart_fmpac_device::device_add_mconfig(machine_config &config)
-{
+MACHINE_CONFIG_START(msx_cart_fmpac_device::device_add_mconfig)
// This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'.
SPEAKER(config, "mono").front_center();
- YM2413(config, m_ym2413, XTAL(10'738'635)/3).add_route(ALL_OUTPUTS, "mono", 0.40);
-}
+ MCFG_DEVICE_ADD("ym2413", YM2413, XTAL(10'738'635)/3)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+MACHINE_CONFIG_END
void msx_cart_fmpac_device::device_start()
@@ -46,14 +46,11 @@ void msx_cart_fmpac_device::device_start()
save_item(NAME(m_1fff));
save_item(NAME(m_7ff6));
- // Install IO read/write handlers
- io_space().install_write_handler(0x7c, 0x7d, write8sm_delegate(FUNC(msx_cart_fmpac_device::write_ym2413), this));
-}
-
+ machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_fmpac_device::restore_banks), this));
-void msx_cart_fmpac_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(0x7c, 0x7d, write8_delegate(FUNC(msx_cart_fmpac_device::write_ym2413), this));
}
@@ -90,7 +87,7 @@ void msx_cart_fmpac_device::initialize_cartridge()
}
-uint8_t msx_cart_fmpac_device::read_cart(offs_t offset)
+READ8_MEMBER(msx_cart_fmpac_device::read_cart)
{
if (offset >= 0x4000 && offset < 0x8000)
{
@@ -119,7 +116,7 @@ uint8_t msx_cart_fmpac_device::read_cart(offs_t offset)
}
-void msx_cart_fmpac_device::write_cart(offs_t offset, uint8_t data)
+WRITE8_MEMBER(msx_cart_fmpac_device::write_cart)
{
if (offset >= 0x4000 && offset < 0x6000)
{
@@ -144,7 +141,7 @@ void msx_cart_fmpac_device::write_cart(offs_t offset, uint8_t data)
case 0x7ff5:
if (m_opll_active)
{
- m_ym2413->write(offset & 1, data);
+ m_ym2413->write(space, offset & 1, data);
}
break;
@@ -162,10 +159,10 @@ void msx_cart_fmpac_device::write_cart(offs_t offset, uint8_t data)
}
-void msx_cart_fmpac_device::write_ym2413(offs_t offset, uint8_t data)
+WRITE8_MEMBER(msx_cart_fmpac_device::write_ym2413)
{
if (m_opll_active)
{
- m_ym2413->write(offset & 1, data);
+ m_ym2413->write(space, offset & 1, data);
}
}