MMU: allow page-table loads/stores if MMU is off

Fixes regressions in some games that apparently required this to work, but
don't really require full MMU emulation (e.g. with exceptions and all).
This commit is contained in:
Fiora 2014-10-21 05:55:56 -07:00
parent 080883ad9e
commit f4fa8d0b83
1 changed files with 18 additions and 14 deletions

View File

@ -122,7 +122,7 @@ inline void ReadFromHardware(T &_var, const u32 em_address, const u32 effective_
// fake VMEM // fake VMEM
_var = bswap((*(const T*)&m_pFakeVMEM[em_address & FAKEVMEM_MASK])); _var = bswap((*(const T*)&m_pFakeVMEM[em_address & FAKEVMEM_MASK]));
} }
else if (SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU) else
{ {
// MMU // MMU
// Handle loads that cross page boundaries (ewwww) // Handle loads that cross page boundaries (ewwww)
@ -145,6 +145,9 @@ inline void ReadFromHardware(T &_var, const u32 em_address, const u32 effective_
{ {
if (flag == FLAG_READ) if (flag == FLAG_READ)
{ {
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
PanicAlertT("Invalid Read at 0x%08x, PC = 0x%08x ", em_address, PC);
else
GenerateDSIException(addr, false); GenerateDSIException(addr, false);
break; break;
} }
@ -171,6 +174,9 @@ inline void ReadFromHardware(T &_var, const u32 em_address, const u32 effective_
{ {
if (flag == FLAG_READ) if (flag == FLAG_READ)
{ {
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
PanicAlertT("Invalid Read at 0x%08x, PC = 0x%08x ", em_address, PC);
else
GenerateDSIException(em_address, false); GenerateDSIException(em_address, false);
} }
} }
@ -187,10 +193,6 @@ inline void ReadFromHardware(T &_var, const u32 em_address, const u32 effective_
} }
} }
} }
else
{
PanicAlertT("Invalid Read at 0x%08x, PC = 0x%08x ", em_address, PC);
}
} }
@ -260,7 +262,7 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
// fake VMEM // fake VMEM
*(T*)&m_pFakeVMEM[em_address & FAKEVMEM_MASK] = bswap(data); *(T*)&m_pFakeVMEM[em_address & FAKEVMEM_MASK] = bswap(data);
} }
else if (SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU) else
{ {
// MMU // MMU
// Handle stores that cross page boundaries (ewwww) // Handle stores that cross page boundaries (ewwww)
@ -276,6 +278,9 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
{ {
if (flag == FLAG_WRITE) if (flag == FLAG_WRITE)
{ {
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
PanicAlertT("Invalid Write to 0x%08x, PC = 0x%08x ", em_address, PC);
else
GenerateDSIException(addr, true); GenerateDSIException(addr, true);
break; break;
} }
@ -302,6 +307,9 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
{ {
if (flag == FLAG_WRITE) if (flag == FLAG_WRITE)
{ {
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
PanicAlertT("Invalid Write to 0x%08x, PC = 0x%08x ", em_address, PC);
else
GenerateDSIException(em_address, true); GenerateDSIException(em_address, true);
} }
} }
@ -318,10 +326,6 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
} }
} }
} }
else
{
PanicAlertT("Invalid Write to 0x%08x, PC = 0x%08x ", em_address, PC);
}
} }
// ===================== // =====================