diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index 9d5211bcfa..9dfaf35a55 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -47,7 +47,6 @@ #include "../PowerPC/PowerPC.h" #include "../ConfigManager.h" #include "../DSPEmulator.h" -#include "SystemTimers.h" namespace DSP { @@ -153,7 +152,7 @@ struct AudioDMA SourceAddress = 0; ReadAddress = 0; AudioDMAControl.Hex = 0; - BlocksLeft = 1; + BlocksLeft = 0; } }; @@ -356,7 +355,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress) // AI case AUDIO_DMA_BLOCKS_LEFT: - _uReturnValue = g_audioDMA.BlocksLeft; + _uReturnValue = g_audioDMA.BlocksLeft > 0 ? g_audioDMA.BlocksLeft - 1 : 0; // AUDIO_DMA_BLOCKS_LEFT is zero based break; case AUDIO_DMA_START_LO: @@ -666,7 +665,7 @@ void UpdateDSPSlice(int cycles) { // This happens at 4 khz, since 32 bytes at 4khz = 4 bytes at 32 khz (16bit stereo pcm) void UpdateAudioDMA() { - if (g_audioDMA.AudioDMAControl.Enable && g_audioDMA.BlocksLeft > -1) + if (g_audioDMA.AudioDMAControl.Enable && g_audioDMA.BlocksLeft) { // Read audio at g_audioDMA.ReadAddress in RAM and push onto an // external audio fifo in the emulator, to be mixed with the disc @@ -676,7 +675,7 @@ void UpdateAudioDMA() g_audioDMA.BlocksLeft--; g_audioDMA.ReadAddress += 32; - if (g_audioDMA.BlocksLeft == -1) + if (g_audioDMA.BlocksLeft == 0) { dsp_emulator->DSP_SendAIBuffer(g_audioDMA.SourceAddress, 8*g_audioDMA.AudioDMAControl.NumBlocks); GenerateDSPInterrupt(DSP::INT_AID);