Respect the IgnoreBadMemAccess ini option (exit on bad access if set).

Fix ini save/load on SDL build.
This commit is contained in:
Henrik Rydgård committed 2012-11-04 11:54:45 +01:00
1 parent 63beeb5030
commit baebaaddf9
5 files changed
+32 -15

No files matched your search

+10 -1
View File
@@ -19,7 +19,8 @@
#include "Atomic.h"
#include "MemMap.h"
// #include "../Core.h"
#include "Config.h"
#include "MIPS/MIPS.h"
// TODO: Fix this
@@ -82,6 +83,10 @@ inline void ReadFromHardware(T &var, const u32 address)
else
{
WARN_LOG(MEMMAP, "ReadFromHardware: Invalid address %08x PC %08x LR %08x", address, currentMIPS->pc, currentMIPS->r[MIPS_REG_RA]);
if (!g_Config.bIgnoreBadMemAccess) {
// TODO: Not sure what the best way to crash is...
exit(0);
}
var = 0;
}
}
@@ -106,6 +111,10 @@ inline void WriteToHardware(u32 address, const T data)
else
{
WARN_LOG(MEMMAP, "WriteToHardware: Invalid address %08x PC %08x LR %08x", address, currentMIPS->pc, currentMIPS->r[MIPS_REG_RA]);
if (!g_Config.bIgnoreBadMemAccess) {
// TODO: Not sure what the best way to crash is...
exit(0);
}
}
}