summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/msx_cart/majutsushi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/msx_cart/majutsushi.cpp')
-rw-r--r--src/devices/bus/msx_cart/majutsushi.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/devices/bus/msx_cart/majutsushi.cpp b/src/devices/bus/msx_cart/majutsushi.cpp
index 66efee9188f..ef76b62af2a 100644
--- a/src/devices/bus/msx_cart/majutsushi.cpp
+++ b/src/devices/bus/msx_cart/majutsushi.cpp
@@ -26,26 +26,20 @@ msx_cart_majutsushi_device::msx_cart_majutsushi_device(const machine_config &mco
}
-void msx_cart_majutsushi_device::device_add_mconfig(machine_config &config)
-{
+MACHINE_CONFIG_START(msx_cart_majutsushi_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, "speaker").front_center();
- DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.05); // unknown DAC
- voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
- vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
- vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
-}
+ MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.05) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+MACHINE_CONFIG_END
void msx_cart_majutsushi_device::device_start()
{
save_item(NAME(m_selected_bank));
-}
-
-void msx_cart_majutsushi_device::device_post_load()
-{
- restore_banks();
+ machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_majutsushi_device::restore_banks), this));
}
@@ -82,13 +76,13 @@ void msx_cart_majutsushi_device::initialize_cartridge()
}
-uint8_t msx_cart_majutsushi_device::read_cart(offs_t offset)
+READ8_MEMBER(msx_cart_majutsushi_device::read_cart)
{
return m_bank_base[offset >> 13][offset & 0x1fff];
}
-void msx_cart_majutsushi_device::write_cart(offs_t offset, uint8_t data)
+WRITE8_MEMBER(msx_cart_majutsushi_device::write_cart)
{
switch (offset & 0xe000)
{