mirror of https://github.com/mgba-emu/mgba.git
Properly reset after loading BIOS
This commit is contained in:
parent
29337a60b5
commit
f1afeae74c
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue