From d175a0ac8536a18175a1bc53bd1d9ebe80da2095 Mon Sep 17 00:00:00 2001
From: Jeffrey Pfau <jeffrey@endrift.com>
Date: Sat, 23 Jul 2016 00:28:53 -0700
Subject: [PATCH] GBA Audio: Force audio DMAs to not increment destination

---
 CHANGES         | 1 +
 src/gba/audio.c | 7 +------
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/CHANGES b/CHANGES
index 5bc3f6755..adaa582a3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -21,6 +21,7 @@ Misc:
  - Qt: Make -g flag work in Qt build
  - Qt: Simplify OpenGL context creation
  - Debugger: Support register and memory writes via GDB stub
+ - GBA Audio: Force audio DMAs to not increment destination
 
 0.4.1: (2016-07-11)
 Bugfixes:
diff --git a/src/gba/audio.c b/src/gba/audio.c
index 5b2900654..8fb6d9942 100644
--- a/src/gba/audio.c
+++ b/src/gba/audio.c
@@ -126,12 +126,6 @@ void GBAAudioScheduleFifoDma(struct GBAAudio* audio, int number, struct GBADMA*
 		audio->chB.dmaSource = number;
 		break;
 	default:
-		if (audio->chA.dmaSource == number) {
-			audio->chA.dmaSource = -1;
-		}
-		if (audio->chB.dmaSource == number) {
-			audio->chB.dmaSource = -1;
-		}
 		mLOG(GBA_AUDIO, GAME_ERROR, "Invalid FIFO destination: 0x%08X", info->dest);
 		return;
 	}
@@ -262,6 +256,7 @@ void GBAAudioSampleFIFO(struct GBAAudio* audio, int fifoId, int32_t cycles) {
 			dma->nextCount = 4;
 			dma->nextEvent = 0;
 			dma->reg = GBADMARegisterSetWidth(dma->reg, 1);
+			dma->reg = GBADMARegisterSetDestControl(dma->reg, 2);
 			GBAMemoryUpdateDMAs(audio->p, -cycles);
 		} else {
 			channel->dmaSource = 0;