Properly reset after loading BIOS
Jeffrey Pfau jeffrey@endrift.com
Sun, 19 Oct 2014 05:41:35 -0700
2 files changed,
4 insertions(+),
3 deletions(-)
M
src/gba/gba-thread.c
→
src/gba/gba-thread.c
@@ -114,7 +114,6 @@
GBACreate(&gba); ARMSetComponents(&cpu, &gba.d, numComponents, components); ARMInit(&cpu); - ARMReset(&cpu); threadContext->gba = &gba; gba.sync = &threadContext->sync; gba.logLevel = threadContext->logLevel;@@ -144,6 +143,8 @@ if (threadContext->patch && loadPatch(threadContext->patch, &patch)) {
GBAApplyPatch(&gba, &patch); } } + + ARMReset(&cpu); if (threadContext->debugger) { threadContext->debugger->log = GBADebuggerLogShim;
M
src/gba/gba.c
→
src/gba/gba.c
@@ -427,8 +427,8 @@ } else {
GBALog(gba, GBA_LOG_WARN, "BIOS checksum incorrect"); } gba->biosChecksum = checksum; - if ((gba->cpu->gprs[ARM_PC] >> BASE_OFFSET) == BASE_BIOS) { - gba->cpu->memory.setActiveRegion(gba->cpu, gba->cpu->gprs[ARM_PC]); + if (gba->memory.activeRegion == REGION_BIOS) { + gba->cpu->memory.activeRegion = gba->memory.bios; } // TODO: error check }