all repos — mgba @ f1afeae74c64f2e1d1ffd43cf964e574bd97cc46

mGBA Game Boy Advance Emulator

Properly reset after loading BIOS
Jeffrey Pfau jeffrey@endrift.com
Sun, 19 Oct 2014 05:41:35 -0700
commit

f1afeae74c64f2e1d1ffd43cf964e574bd97cc46

parent

29337a60b52529a942912a6b4595f9d3092df08b

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

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