diff --git a/CHANGES b/CHANGES index 037f18e3d..dd136d854 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ Emulation fixes: - GB Audio: Fix channels 1/2 not playing when resetting volume (fixes mgba.io/i/2614) - GB Audio: Fix channel 3 volume being changed between samples (fixes mgba.io/i/1896) + - GB Memory: Actually, HDMAs should start when LCD is off (fixes mgba.io/i/2662) - GB Serialize: Don't write BGP/OBP when loading SCGB state (fixes mgba.io/i/2694) - GB SIO: Further fix bidirectional transfer starting - GBA: Fix resetting key IRQ state (fixes mgba.io/i/2716) diff --git a/src/gb/memory.c b/src/gb/memory.c index 0c11308fe..c55128405 100644 --- a/src/gb/memory.c +++ b/src/gb/memory.c @@ -558,7 +558,7 @@ uint8_t GBMemoryWriteHDMA5(struct GB* gb, uint8_t value) { gb->memory.hdmaDest |= 0x8000; bool wasHdma = gb->memory.isHdma; gb->memory.isHdma = value & 0x80; - if ((!wasHdma && !gb->memory.isHdma) || (GBRegisterLCDCIsEnable(gb->memory.io[GB_REG_LCDC]) && gb->video.mode == 0)) { + if ((!wasHdma && !gb->memory.isHdma) || gb->video.mode == 0) { if (gb->memory.isHdma) { gb->memory.hdmaRemaining = 0x10; } else { @@ -566,8 +566,6 @@ uint8_t GBMemoryWriteHDMA5(struct GB* gb, uint8_t value) { } gb->cpuBlocked = true; mTimingSchedule(&gb->timing, &gb->memory.hdmaEvent, 0); - } else if (gb->memory.isHdma && !GBRegisterLCDCIsEnable(gb->memory.io[GB_REG_LCDC])) { - return 0x80 | ((value + 1) & 0x7F); } return value & 0x7F; }