From 368dc3381e6fd7a21e70599211be553dbc0ad5a0 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Fri, 22 Mar 2013 05:31:09 +0000 Subject: [PATCH] (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. --- src/mess/machine/md_svp.c | 11 +++++++++-- src/mess/machine/md_svp.h | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mess/machine/md_svp.c b/src/mess/machine/md_svp.c index 67129252819..8340ea2720e 100644 --- a/src/mess/machine/md_svp.c +++ b/src/mess/machine/md_svp.c @@ -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; } diff --git a/src/mess/machine/md_svp.h b/src/mess/machine/md_svp.h index 116c2cf7b94..f60e53ec0ea 100644 --- a/src/mess/machine/md_svp.h +++ b/src/mess/machine/md_svp.h @@ -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;