From 3c5db2b7a160108b1296e2435944136ee60796f4 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 6 Apr 2015 03:47:42 -0700 Subject: [PATCH] GBA Memory: Ensure changing the timing of a DMA reschedules it --- CHANGES | 1 + src/gba/memory.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index d4c9da571..e24bdfe59 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ Bugfixes: - Qt: Fix .deb dependencies - GBA Audio: FIFOs should not poll DMAs that are not scheduled for audio - Qt: Fix "QOpenGLContext::swapBuffers() called with non-exposed window" warning + - GBA Memory: Ensure changing the timing of a DMA reschedules it 0.2.0: (2015-04-03) Features: diff --git a/src/gba/memory.c b/src/gba/memory.c index 0923edd1e..52795595d 100644 --- a/src/gba/memory.c +++ b/src/gba/memory.c @@ -1252,6 +1252,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); + int oldTiming = GBADMARegisterGetTiming(currentDma->reg); + int newTiming = GBADMARegisterGetTiming(control); + if (oldTiming && oldTiming != newTiming) { + wasEnabled = false; + } currentDma->reg = control; if (GBADMARegisterIsDRQ(currentDma->reg)) {