GB: Fix HALT when IE and IF unused bits are set (fixes #1349)

This commit is contained in:
Vicki Pfau 2019-05-20 23:57:48 -07:00
parent fd6948da4d
commit 35200b6c7a
2 changed files with 2 additions and 1 deletions

View File

@ -26,6 +26,7 @@ Emulation fixes:
- GBA: Fix RTC on non-standard sized ROMs (fixes mgba.io/i/1400) - GBA: Fix RTC on non-standard sized ROMs (fixes mgba.io/i/1400)
- GBA Memory: Prevent writing to mirrored BG VRAM (fixes mgba.io/i/743) - GBA Memory: Prevent writing to mirrored BG VRAM (fixes mgba.io/i/743)
- GBA Video: Fix sprite mosaic clamping (fixes mgba.io/i/1008) - GBA Video: Fix sprite mosaic clamping (fixes mgba.io/i/1008)
- GB: Fix HALT when IE and IF unused bits are set (fixes mgba.io/i/1349)
Other fixes: Other fixes:
- Qt: More app metadata fixes - Qt: More app metadata fixes
- Qt: Fix load recent from archive (fixes mgba.io/i/1325) - Qt: Fix load recent from archive (fixes mgba.io/i/1325)

View File

@ -723,7 +723,7 @@ static void _enableInterrupts(struct mTiming* timing, void* user, uint32_t cycle
void GBHalt(struct LR35902Core* cpu) { void GBHalt(struct LR35902Core* cpu) {
struct GB* gb = (struct GB*) cpu->master; struct GB* gb = (struct GB*) cpu->master;
if (!(gb->memory.ie & gb->memory.io[REG_IF])) { if (!(gb->memory.ie & gb->memory.io[REG_IF] & 0x1F)) {
cpu->cycles = cpu->nextEvent; cpu->cycles = cpu->nextEvent;
cpu->halted = true; cpu->halted = true;
} else if (gb->model < GB_MODEL_CGB) { } else if (gb->model < GB_MODEL_CGB) {