diff --git a/src/emu/bus/msx_slot/panasonic08.c b/src/emu/bus/msx_slot/panasonic08.c index af762c32cfa..f2c95c85c5f 100644 --- a/src/emu/bus/msx_slot/panasonic08.c +++ b/src/emu/bus/msx_slot/panasonic08.c @@ -17,6 +17,7 @@ const device_type MSX_SLOT_PANASONIC08 = &device_creatorset_base((UINT8*)m_sram, 0x4000); + m_rom = m_rom_region->base() + m_region_offset; save_item(NAME(m_selected_bank)); save_item(NAME(m_control)); - save_item(NAME(m_sram)); machine().save().register_postload(save_prepost_delegate(FUNC(msx_slot_panasonic08_device::restore_banks), this)); @@ -83,7 +87,7 @@ void msx_slot_panasonic08_device::map_bank(int bank) if (m_selected_bank[bank] >= 0x80 && m_selected_bank[bank] < 0x84) // Are these banks were sram is present? Mirroring? { logerror("panasonic08: mapping bank %d to sram\n", bank); - m_bank_base[bank] = m_sram; + m_bank_base[bank] = m_sram + (((m_selected_bank[bank] & 0x7f) * 0x2000) & 0x3fff); } else { @@ -127,9 +131,10 @@ WRITE8_MEMBER(msx_slot_panasonic08_device::write) UINT8 bank = m_selected_bank[offset >> 13]; if (bank >= 0x80 && bank < 0x84) // Are these banks were sram is present? Mirroring? { - logerror("panasonic08: writing %02x to sram %04x\n", data, offset & 0x1fff); - m_sram[offset & 0x1fff] = data; + logerror("msx_slot_panasonic08: writing %02x to sram %04x, bank = %02x\n", data, offset & 0x1fff, bank); + m_sram[((bank & 0x01) * 0x2000) + (offset & 0x1fff)] = data; } + return; } switch (offset) @@ -149,7 +154,7 @@ WRITE8_MEMBER(msx_slot_panasonic08_device::write) map_bank(2); break; - case 0x6c00: + case 0x6c00: /* Switches 0x6000-0x7FFF */ m_selected_bank[3] = data; map_bank(3); break; @@ -159,7 +164,7 @@ WRITE8_MEMBER(msx_slot_panasonic08_device::write) map_bank(4); break; - case 0x7800: + case 0x7800: /* Switches 0xA000-0xBFFF */ m_selected_bank[5] = data; map_bank(5); break; @@ -169,7 +174,7 @@ WRITE8_MEMBER(msx_slot_panasonic08_device::write) break; default: - logerror("Unhandled write %02x to %04x\n", data, offset); + logerror("msx_slot_panasonic08: Unhandled write %02x to %04x\n", data, offset); break; } } diff --git a/src/emu/bus/msx_slot/panasonic08.h b/src/emu/bus/msx_slot/panasonic08.h index 6eedae2d505..2f97aa537bd 100644 --- a/src/emu/bus/msx_slot/panasonic08.h +++ b/src/emu/bus/msx_slot/panasonic08.h @@ -2,6 +2,7 @@ #define __MSX_SLOT_PANASONIC08_H #include "slot.h" +#include "machine/nvram.h" extern const device_type MSX_SLOT_PANASONIC08; @@ -29,13 +30,14 @@ public: void restore_banks(); private: + required_device m_nvram; const char *m_region; UINT32 m_region_offset; const UINT8 *m_rom; UINT8 m_selected_bank[8]; const UINT8 *m_bank_base[8]; UINT8 m_control; - UINT8 m_sram[0x2000]; + dynamic_buffer m_sram; void map_bank(int bank); }; diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c index af2bdf00390..27a659e7956 100644 --- a/src/mess/drivers/msx.c +++ b/src/mess/drivers/msx.c @@ -47,7 +47,6 @@ ** - expert3i: IDE not emulated ** - expert3t: Turbo not emulated ** - expertac: Does not boot -** - fsa1wsx: Firmware not emulated ** - fsa1wx: Firmware not emulated ** - fsa1wx: Floppy not emulated ** - fsa1wxa: Firmware not emulated