diff --git a/src/gba/gba-thread.c b/src/gba/gba-thread.c index 446d35ded..e0ac4084a 100644 --- a/src/gba/gba-thread.c +++ b/src/gba/gba-thread.c @@ -114,7 +114,6 @@ static THREAD_ENTRY _GBAThreadRun(void* context) { GBACreate(&gba); ARMSetComponents(&cpu, &gba.d, numComponents, components); ARMInit(&cpu); - ARMReset(&cpu); threadContext->gba = &gba; gba.sync = &threadContext->sync; gba.logLevel = threadContext->logLevel; @@ -145,6 +144,8 @@ static THREAD_ENTRY _GBAThreadRun(void* context) { } } + ARMReset(&cpu); + if (threadContext->debugger) { threadContext->debugger->log = GBADebuggerLogShim; GBAAttachDebugger(&gba, threadContext->debugger); diff --git a/src/gba/gba.c b/src/gba/gba.c index e4d2793f4..fe1c71913 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -427,8 +427,8 @@ void GBALoadBIOS(struct GBA* gba, struct VFile* vf) { 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 }