From 7a2f98d474032c6e41d1847d6a37171310e39dd5 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 3 Nov 2016 13:26:33 -0700 Subject: [PATCH] GB Memory: Fix starting HDMAs during mode 0 --- CHANGES | 1 + src/gb/memory.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 5390cc7cb..d0659b351 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,7 @@ Bugfixes: - GB: Fix audio not being deinitialized - GBA Memory: Fix VCOUNT being writable - Qt: Only reset window dimensions when first shown + - GB Memory: Fix starting HDMAs during mode 0 Misc: - PSP2: Improved controller rumble - GB, GBA: Prevent loading null ROMs diff --git a/src/gb/memory.c b/src/gb/memory.c index fa630994c..019fc93f6 100644 --- a/src/gb/memory.c +++ b/src/gb/memory.c @@ -394,7 +394,7 @@ void 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) { + if ((!wasHdma && !gb->memory.isHdma) || gb->video.mode == 0) { gb->memory.hdmaRemaining = ((value & 0x7F) + 1) * 0x10; gb->memory.hdmaNext = gb->cpu->cycles; gb->cpu->nextEvent = gb->cpu->cycles;