GB Memory: Clearing the HDMA bit disabled HDMA
Jeffrey Pfau jeffrey@endrift.com
Sat, 20 Feb 2016 13:57:16 -0800
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
src/gb/memory.c
→
src/gb/memory.c
@@ -322,8 +322,9 @@ return;
} gb->memory.hdmaDest &= 0x1FF0; gb->memory.hdmaDest |= 0x8000; + bool wasHdma = gb->memory.isHdma; gb->memory.isHdma = value & 0x80; - if (!gb->memory.isHdma) { + if (!wasHdma && !gb->memory.isHdma) { gb->memory.hdmaRemaining = ((value & 0x7F) + 1) * 0x10; gb->memory.hdmaNext = gb->cpu->cycles; gb->cpu->nextEvent = gb->cpu->cycles;