Panic on invalid reads/writes for non-mmu games.

Previously it would fall through to the mmu code path, and raise a dsi
exception, which it would never check for, so it would continue
executing code silently.
This commit is contained in:
Scott Mansell 2014-09-06 18:57:53 +12:00
parent 96e92d33b7
commit 1963717855

View File

@ -18,6 +18,7 @@
#include "Common/Atomic.h"
#include "Common/Common.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/HW/GPFifo.h"
#include "Core/HW/Memmap.h"
@ -119,7 +120,7 @@ inline void ReadFromHardware(T &_var, const u32 em_address, const u32 effective_
// fake VMEM
_var = bswap((*(const T*)&m_pFakeVMEM[em_address & FAKEVMEM_MASK]));
}
else
else if (SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
{
// MMU
u32 tlb_addr = TranslateAddress(em_address, flag);
@ -135,6 +136,10 @@ inline void ReadFromHardware(T &_var, const u32 em_address, const u32 effective_
_var = bswap((*(const T*)&m_pRAM[tlb_addr & RAM_MASK]));
}
}
else
{
PanicAlertT("Invalid Read at 0x%08x, PC = 0x%08x ", em_address, PC);
}
}
@ -204,7 +209,7 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
// fake VMEM
*(T*)&m_pFakeVMEM[em_address & FAKEVMEM_MASK] = bswap(data);
}
else
else if (SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
{
// MMU
u32 tlb_addr = TranslateAddress(em_address, flag);
@ -220,6 +225,10 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
*(T*)&m_pRAM[tlb_addr & RAM_MASK] = bswap(data);
}
}
else
{
PanicAlertT("Invalid Write to 0x%08x, PC = 0x%08x ", em_address, PC);
}
}
// =====================