all repos — mgba @ ea91c48d3e75f72577ef8cd00276819e4c3aa07e

mGBA Game Boy Advance Emulator

GBA: Add option to not hard-crash when a game crashes
Jeffrey Pfau jeffrey@endrift.com
Sun, 02 Aug 2015 11:45:26 -0700
commit

ea91c48d3e75f72577ef8cd00276819e4c3aa07e

parent

7fb1b90abfc657c854463c0c7568206171fb0304

3 files changed, 6 insertions(+), 2 deletions(-)

jump to
M src/gba/gba.csrc/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.hsrc/gba/gba.h

@@ -124,6 +124,7 @@ int32_t cachedRegisters[16];

bool taintedRegisters[16]; bool realisticTiming; + bool hardCrash; }; struct GBACartridge {
M src/gba/memory.csrc/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];