mirror of https://github.com/mgba-emu/mgba.git
GBA: Add option to not hard-crash when a game crashes
This commit is contained in:
parent
7fb1b90abf
commit
ea91c48d3e
|
@ -94,6 +94,7 @@ static void GBAInit(struct ARMCore* cpu, struct ARMComponent* component) {
|
||||||
gba->idleDetectionFailures = 0;
|
gba->idleDetectionFailures = 0;
|
||||||
|
|
||||||
gba->realisticTiming = true;
|
gba->realisticTiming = true;
|
||||||
|
gba->hardCrash = true;
|
||||||
|
|
||||||
gba->performingDMA = false;
|
gba->performingDMA = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,7 @@ struct GBA {
|
||||||
bool taintedRegisters[16];
|
bool taintedRegisters[16];
|
||||||
|
|
||||||
bool realisticTiming;
|
bool realisticTiming;
|
||||||
|
bool hardCrash;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GBACartridge {
|
struct GBACartridge {
|
||||||
|
|
|
@ -278,9 +278,11 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) {
|
||||||
memory->activeRegion = -1;
|
memory->activeRegion = -1;
|
||||||
cpu->memory.activeRegion = _deadbeef;
|
cpu->memory.activeRegion = _deadbeef;
|
||||||
cpu->memory.activeMask = 0;
|
cpu->memory.activeMask = 0;
|
||||||
if (!gba->yankedRomSize) {
|
enum GBALogLevel errorLevel = GBA_LOG_FATAL;
|
||||||
GBALog(gba, GBA_LOG_FATAL, "Jumped to invalid address");
|
if (gba->yankedRomSize || !gba->hardCrash) {
|
||||||
|
errorLevel = GBA_LOG_GAME_ERROR;
|
||||||
}
|
}
|
||||||
|
GBALog(gba, errorLevel, "Jumped to invalid address: %08X", address);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cpu->memory.activeSeqCycles32 = memory->waitstatesSeq32[memory->activeRegion];
|
cpu->memory.activeSeqCycles32 = memory->waitstatesSeq32[memory->activeRegion];
|
||||||
|
|
Loading…
Reference in New Issue