mirror of
https://github.com/holub/mame
synced 2025-05-21 21:29:15 +03:00
(MESS) megadriv.c: fixed FRAM saving in Sonic 3 (got lost in some copy&paste I did before the commit :( ).
also fixed access to last byte of SRAM. no whatsnew.
This commit is contained in:
parent
497661c016
commit
da5163f0a7
@ -285,7 +285,7 @@ READ16_MEMBER(md_rom_sram_device::read)
|
||||
// we access nvram only if m_nvram_handlers_installed has been turned on
|
||||
if (m_nvram_handlers_installed)
|
||||
{
|
||||
if (offset >= m_nvram_start/2 && offset < m_nvram_end/2 && m_nvram_active)
|
||||
if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active)
|
||||
return m_nvram[offset - m_nvram_start/2];
|
||||
}
|
||||
if (offset < 0x400000/2)
|
||||
@ -326,7 +326,7 @@ WRITE16_MEMBER(md_rom_sram_device::write_a13)
|
||||
|
||||
READ16_MEMBER(md_rom_fram_device::read)
|
||||
{
|
||||
if (offset >= m_nvram_start/2 && offset < m_nvram_end/2 && m_nvram_active)
|
||||
if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active)
|
||||
return m_nvram[offset - m_nvram_start/2];
|
||||
if (offset < 0x400000/2)
|
||||
return m_rom[MD_ADDR(offset)];
|
||||
@ -334,6 +334,12 @@ READ16_MEMBER(md_rom_fram_device::read)
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(md_rom_fram_device::write)
|
||||
{
|
||||
if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active)
|
||||
m_nvram[offset - m_nvram_start/2] = data;
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(md_rom_fram_device::write_a13)
|
||||
{
|
||||
if (offset == 0xf0/2)
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ16_MEMBER(read);
|
||||
virtual DECLARE_WRITE16_MEMBER(write);
|
||||
virtual DECLARE_READ16_MEMBER(read_a13);
|
||||
virtual DECLARE_WRITE16_MEMBER(write_a13);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user