From cf27d88696eb3b889e0cb40709e572a7c4036283 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 21 Feb 2016 02:48:34 -0800 Subject: [PATCH] GB: Ending HDMAs should clear isHdma bit --- src/gb/memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gb/memory.c b/src/gb/memory.c index a11d982d5..cddd8fa63 100644 --- a/src/gb/memory.c +++ b/src/gb/memory.c @@ -366,6 +366,9 @@ void _GBMemoryHDMAService(struct GB* gb) { gb->memory.io[REG_HDMA4] = gb->memory.hdmaDest; if (gb->memory.isHdma) { --gb->memory.io[REG_HDMA5]; + if (gb->memory.io[REG_HDMA5] == 0xFF) { + gb->memory.isHdma = false; + } } else { gb->memory.io[REG_HDMA5] |= 0x80; }