all repos — mgba @ a260b4cf91649498b32e3d10a06117175c9cb75f

mGBA Game Boy Advance Emulator

GB Memory: Clearing the HDMA bit disabled HDMA
Jeffrey Pfau jeffrey@endrift.com
Sat, 20 Feb 2016 13:57:16 -0800
commit

a260b4cf91649498b32e3d10a06117175c9cb75f

parent

b8ed859c211ed40948c884139d06a3d0ecf213f8

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M src/gb/memory.csrc/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;