(MESS) saturn: added default formatting to Backup RAM carts,

so that games can be saved in the expansion without passing 
through the console menu the first time the expansion is used
[Fabio Priuli]
This commit is contained in:
Fabio Priuli 2014-04-03 09:26:27 +00:00
parent dd1e28e513
commit 7f02068f39
3 changed files with 14 additions and 2 deletions

View File

@ -68,6 +68,19 @@ void saturn_bram_device::device_reset()
{
}
void saturn_bram_device::nvram_default()
{
static const UINT8 init[16] =
{ 'B', 'a', 'c', 'k', 'U', 'p', 'R', 'a', 'm', ' ', 'F', 'o', 'r', 'm', 'a', 't' };
memset(m_ext_bram, 0, m_ext_bram_size);
for (int i = 0; i < 32; i++)
{
for (int j = 0; j < 16; j++)
m_ext_bram[i * 16 + j] = init[j];
}
}
/*-------------------------------------------------
IO handlers

View File

@ -19,7 +19,7 @@ public:
virtual void device_reset();
// device_nvram_interface overrides
virtual void nvram_default() { }
virtual void nvram_default();
virtual void nvram_read(emu_file &file) { if (m_ext_bram != NULL) { file.read(m_ext_bram, m_ext_bram_size); } }
virtual void nvram_write(emu_file &file) { if (m_ext_bram != NULL) { file.write(m_ext_bram, m_ext_bram_size); } }

View File

@ -34,7 +34,6 @@ public:
optional_ioport m_fake_comms;
UINT8 *m_backupram;
UINT8 *m_cart_backupram;
UINT32 *m_scu_regs;
UINT16 *m_scsp_regs;
UINT16 *m_vdp2_regs;