(MESS) better fix for the pmac registers in SVP. thanks Arbee for noticing this veeeeeery

old out-of-bound access. I guess we originally had a single set of 12 registers...
nw.
This commit is contained in:
Fabio Priuli 2013-03-22 05:31:09 +00:00
parent 622cacafa9
commit 368dc3381e
2 changed files with 10 additions and 3 deletions

View File

@ -83,7 +83,11 @@ UINT32 md_rom_svp_device::pm_io(int reg, int write, UINT32 d)
{
if (m_emu_status & SSP_PMC_SET)
{
m_pmac_read[write ? reg + 6 : reg] = m_pmc.d;
if (write)
m_pmac_write[reg] = m_pmc.d;
else
m_pmac_read[reg] = m_pmc.d;
m_emu_status &= ~SSP_PMC_SET;
return 0;
}
@ -155,7 +159,10 @@ UINT32 md_rom_svp_device::pm_io(int reg, int write, UINT32 d)
}
// PMC value corresponds to last PMR accessed (not sure).
m_pmc.d = m_pmac_read[write ? reg + 6 : reg];
if (write)
m_pmc.d = m_pmac_write[reg];
else
m_pmc.d = m_pmac_read[reg];
return d;
}

View File

@ -56,7 +56,7 @@ public:
UINT8 *m_iram; // IRAM (0-0x7ff)
UINT8 *m_dram; // [0x20000];
UINT32 m_pmac_read[12]; // read modes/addrs for PM0-PM5
UINT32 m_pmac_read[6]; // read modes/addrs for PM0-PM5
UINT32 m_pmac_write[6]; // write ...
PAIR m_pmc;
UINT32 m_emu_status;