From 4783e2eef6008b03516491b88b21724cfeaabd10 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 11 Nov 2015 23:33:46 -0800 Subject: [PATCH] GBA Memory: More DMA register cleanup --- src/gba/memory.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gba/memory.c b/src/gba/memory.c index e67bd66ed..834b54ae8 100644 --- a/src/gba/memory.c +++ b/src/gba/memory.c @@ -1371,7 +1371,11 @@ uint16_t GBAMemoryWriteDMACNT_HI(struct GBA* gba, int dma, uint16_t control) { struct GBAMemory* memory = &gba->memory; struct GBADMA* currentDma = &memory->dma[dma]; int wasEnabled = GBADMARegisterIsEnable(currentDma->reg); - control &= 0xFFE0; + if (dma < 3) { + control &= 0xF7E0; + } else { + control &= 0xFFE0; + } currentDma->reg = control; if (GBADMARegisterIsDRQ(currentDma->reg)) {