From 92064d1025c04765946d0038a021c9f22b215dc7 Mon Sep 17 00:00:00 2001 From: booto Date: Mon, 11 Aug 2014 02:02:18 +0800 Subject: [PATCH] DSP: Fixes behaviour for audio dmas of length 0 This behaviour was tested on a real (wii) console. --- Source/Core/Core/HW/DSP.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp index 5cd14885e6..273e7ec76f 100644 --- a/Source/Core/Core/HW/DSP.cpp +++ b/Source/Core/Core/HW/DSP.cpp @@ -490,19 +490,19 @@ void UpdateAudioDMA() // Read audio at g_audioDMA.current_source_address in RAM and push onto an // external audio fifo in the emulator, to be mixed with the disc // streaming output. - g_audioDMA.remaining_blocks_count--; - g_audioDMA.current_source_address += 32; + + if (g_audioDMA.remaining_blocks_count != 0) + { + g_audioDMA.remaining_blocks_count--; + g_audioDMA.current_source_address += 32; + } if (g_audioDMA.remaining_blocks_count == 0) { g_audioDMA.current_source_address = g_audioDMA.SourceAddress; g_audioDMA.remaining_blocks_count = g_audioDMA.AudioDMAControl.NumBlocks; - if (g_audioDMA.AudioDMAControl.NumBlocks == 0) - { - g_audioDMA.AudioDMAControl.Enable = 0; - } - else + if (g_audioDMA.remaining_blocks_count != 0) { // We make the samples ready as soon as possible void *address = Memory::GetPointer(g_audioDMA.SourceAddress);