mirror of https://github.com/mgba-emu/mgba.git
GB, GBA Core: Ensure the core is halted even if a state is not loaded
This commit is contained in:
parent
5cda42077c
commit
91491e704e
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue