GB, GBA Core: Ensure the core is halted even if a state is not loaded

This commit is contained in:
Vicki Pfau 2017-04-24 13:14:31 -07:00
parent 5cda42077c
commit 91491e704e
2 changed files with 10 additions and 0 deletions

View File

@ -792,6 +792,11 @@ static void _GBVLPReset(struct mCore* core) {
LR35902Reset(core->cpu);
mVideoLogContextRewind(gbcore->logContext, core);
GBVideoProxyRendererShim(&gb->video, &gbcore->proxyRenderer);
// Make sure CPU loop never spins
GBHalt(gb->cpu);
gb->memory.ie = 0;
gb->memory.ime = false;
}
static bool _GBVLPLoadROM(struct mCore* core, struct VFile* vf) {

View File

@ -811,6 +811,11 @@ static void _GBAVLPReset(struct mCore* core) {
ARMReset(core->cpu);
mVideoLogContextRewind(gbacore->logContext, core);
GBAVideoProxyRendererShim(&gba->video, &gbacore->proxyRenderer);
// Make sure CPU loop never spins
GBAHalt(gba);
gba->cpu->memory.store16(gba->cpu, BASE_IO | REG_IME, 0, NULL);
gba->cpu->memory.store16(gba->cpu, BASE_IO | REG_IE, 0, NULL);
}
static bool _GBAVLPLoadROM(struct mCore* core, struct VFile* vf) {