mirror of
https://github.com/holub/mame
synced 2025-07-01 08:18:59 +03:00
(MESS) msx.c: Some small fixes to the banking for the firmware in the fsa1wsx. (nw)
This commit is contained in:
parent
d7433ea89f
commit
1ec4181f33
@ -17,6 +17,7 @@ const device_type MSX_SLOT_PANASONIC08 = &device_creator<msx_slot_panasonic08_de
|
|||||||
msx_slot_panasonic08_device::msx_slot_panasonic08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
msx_slot_panasonic08_device::msx_slot_panasonic08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||||
: device_t(mconfig, MSX_SLOT_PANASONIC08, "MSX Internal Panasonic08", tag, owner, clock, "msx_slot_panasonic08", __FILE__)
|
: device_t(mconfig, MSX_SLOT_PANASONIC08, "MSX Internal Panasonic08", tag, owner, clock, "msx_slot_panasonic08", __FILE__)
|
||||||
, msx_internal_slot_interface()
|
, msx_internal_slot_interface()
|
||||||
|
, m_nvram(*this, "nvram")
|
||||||
, m_region(NULL)
|
, m_region(NULL)
|
||||||
, m_region_offset(0)
|
, m_region_offset(0)
|
||||||
, m_rom(NULL)
|
, m_rom(NULL)
|
||||||
@ -27,11 +28,11 @@ msx_slot_panasonic08_device::msx_slot_panasonic08_device(const machine_config &m
|
|||||||
m_selected_bank[i] = 0;
|
m_selected_bank[i] = 0;
|
||||||
m_bank_base[i] = 0;
|
m_bank_base[i] = 0;
|
||||||
}
|
}
|
||||||
memset(m_sram, 0, sizeof(m_sram));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static MACHINE_CONFIG_FRAGMENT( panasonic08 )
|
static MACHINE_CONFIG_FRAGMENT( panasonic08 )
|
||||||
|
MCFG_NVRAM_ADD_0FILL("nvram")
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
|
|
||||||
@ -66,11 +67,14 @@ void msx_slot_panasonic08_device::device_start()
|
|||||||
fatalerror("Memory region '%s' is too small for the FS4600 firmware\n", m_region);
|
fatalerror("Memory region '%s' is too small for the FS4600 firmware\n", m_region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_sram.resize(0x4000);
|
||||||
|
|
||||||
|
m_nvram->set_base((UINT8*)m_sram, 0x4000);
|
||||||
|
|
||||||
m_rom = m_rom_region->base() + m_region_offset;
|
m_rom = m_rom_region->base() + m_region_offset;
|
||||||
|
|
||||||
save_item(NAME(m_selected_bank));
|
save_item(NAME(m_selected_bank));
|
||||||
save_item(NAME(m_control));
|
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));
|
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?
|
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);
|
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
|
else
|
||||||
{
|
{
|
||||||
@ -127,9 +131,10 @@ WRITE8_MEMBER(msx_slot_panasonic08_device::write)
|
|||||||
UINT8 bank = m_selected_bank[offset >> 13];
|
UINT8 bank = m_selected_bank[offset >> 13];
|
||||||
if (bank >= 0x80 && bank < 0x84) // Are these banks were sram is present? Mirroring?
|
if (bank >= 0x80 && bank < 0x84) // Are these banks were sram is present? Mirroring?
|
||||||
{
|
{
|
||||||
logerror("panasonic08: writing %02x to sram %04x\n", data, offset & 0x1fff);
|
logerror("msx_slot_panasonic08: writing %02x to sram %04x, bank = %02x\n", data, offset & 0x1fff, bank);
|
||||||
m_sram[offset & 0x1fff] = data;
|
m_sram[((bank & 0x01) * 0x2000) + (offset & 0x1fff)] = data;
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (offset)
|
switch (offset)
|
||||||
@ -149,7 +154,7 @@ WRITE8_MEMBER(msx_slot_panasonic08_device::write)
|
|||||||
map_bank(2);
|
map_bank(2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x6c00:
|
case 0x6c00: /* Switches 0x6000-0x7FFF */
|
||||||
m_selected_bank[3] = data;
|
m_selected_bank[3] = data;
|
||||||
map_bank(3);
|
map_bank(3);
|
||||||
break;
|
break;
|
||||||
@ -159,7 +164,7 @@ WRITE8_MEMBER(msx_slot_panasonic08_device::write)
|
|||||||
map_bank(4);
|
map_bank(4);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x7800:
|
case 0x7800: /* Switches 0xA000-0xBFFF */
|
||||||
m_selected_bank[5] = data;
|
m_selected_bank[5] = data;
|
||||||
map_bank(5);
|
map_bank(5);
|
||||||
break;
|
break;
|
||||||
@ -169,7 +174,7 @@ WRITE8_MEMBER(msx_slot_panasonic08_device::write)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("Unhandled write %02x to %04x\n", data, offset);
|
logerror("msx_slot_panasonic08: Unhandled write %02x to %04x\n", data, offset);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define __MSX_SLOT_PANASONIC08_H
|
#define __MSX_SLOT_PANASONIC08_H
|
||||||
|
|
||||||
#include "slot.h"
|
#include "slot.h"
|
||||||
|
#include "machine/nvram.h"
|
||||||
|
|
||||||
|
|
||||||
extern const device_type MSX_SLOT_PANASONIC08;
|
extern const device_type MSX_SLOT_PANASONIC08;
|
||||||
@ -29,13 +30,14 @@ public:
|
|||||||
void restore_banks();
|
void restore_banks();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
required_device<nvram_device> m_nvram;
|
||||||
const char *m_region;
|
const char *m_region;
|
||||||
UINT32 m_region_offset;
|
UINT32 m_region_offset;
|
||||||
const UINT8 *m_rom;
|
const UINT8 *m_rom;
|
||||||
UINT8 m_selected_bank[8];
|
UINT8 m_selected_bank[8];
|
||||||
const UINT8 *m_bank_base[8];
|
const UINT8 *m_bank_base[8];
|
||||||
UINT8 m_control;
|
UINT8 m_control;
|
||||||
UINT8 m_sram[0x2000];
|
dynamic_buffer m_sram;
|
||||||
|
|
||||||
void map_bank(int bank);
|
void map_bank(int bank);
|
||||||
};
|
};
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
** - expert3i: IDE not emulated
|
** - expert3i: IDE not emulated
|
||||||
** - expert3t: Turbo not emulated
|
** - expert3t: Turbo not emulated
|
||||||
** - expertac: Does not boot
|
** - expertac: Does not boot
|
||||||
** - fsa1wsx: Firmware not emulated
|
|
||||||
** - fsa1wx: Firmware not emulated
|
** - fsa1wx: Firmware not emulated
|
||||||
** - fsa1wx: Floppy not emulated
|
** - fsa1wx: Floppy not emulated
|
||||||
** - fsa1wxa: Firmware not emulated
|
** - fsa1wxa: Firmware not emulated
|
||||||
|
Loading…
Reference in New Issue
Block a user