GBA: Add option to not hard-crash when a game crashes
Jeffrey Pfau jeffrey@endrift.com
Sun, 02 Aug 2015 11:45:26 -0700
3 files changed,
6 insertions(+),
2 deletions(-)
M
src/gba/gba.c
→
src/gba/gba.c
@@ -94,6 +94,7 @@ gba->idleDetectionStep = 0;
gba->idleDetectionFailures = 0; gba->realisticTiming = true; + gba->hardCrash = true; gba->performingDMA = false; }
M
src/gba/gba.h
→
src/gba/gba.h
@@ -124,6 +124,7 @@ int32_t cachedRegisters[16];
bool taintedRegisters[16]; bool realisticTiming; + bool hardCrash; }; struct GBACartridge {
M
src/gba/memory.c
→
src/gba/memory.c
@@ -278,9 +278,11 @@ default:
memory->activeRegion = -1; cpu->memory.activeRegion = _deadbeef; cpu->memory.activeMask = 0; - if (!gba->yankedRomSize) { - GBALog(gba, GBA_LOG_FATAL, "Jumped to invalid address"); + enum GBALogLevel errorLevel = GBA_LOG_FATAL; + if (gba->yankedRomSize || !gba->hardCrash) { + errorLevel = GBA_LOG_GAME_ERROR; } + GBALog(gba, errorLevel, "Jumped to invalid address: %08X", address); return; } cpu->memory.activeSeqCycles32 = memory->waitstatesSeq32[memory->activeRegion];