From dbb14d7040e16738d095a25648b53b5bc4dd6b8d Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sun, 30 Jan 2022 20:52:34 +0200 Subject: [PATCH] Minor edge case for HDMA instant start --- Core/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/memory.c b/Core/memory.c index a5646b6..ab3ef5d 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -1561,7 +1561,7 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) } gb->hdma_on = (value & 0x80) == 0; gb->hdma_on_hblank = (value & 0x80) != 0; - if (gb->hdma_on_hblank && (gb->io_registers[GB_IO_STAT] & 3) == 0) { + if (gb->hdma_on_hblank && (gb->io_registers[GB_IO_STAT] & 3) == 0 && gb->display_state != 7) { gb->hdma_on = true; } gb->io_registers[GB_IO_HDMA5] = value;