summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2013-03-03 15:20:15 +1100
committerskidau <skidau@gmail.com>2013-03-03 15:20:15 +1100
commit6dbd80d73e55f26fb8676b83779dbfb42d434d41 (patch)
treef50c0b41e88ab89ccad97e57ff1cd31a9c15b493 /Source/Core
parent6d1a0f5c2a40f6c9a244264b0ee073405d518e28 (diff)
Reverted the audio streaming tweak from r7a04ec6f9220dd66147c86baaebc2f9e05d65ead as it was causing audio clipping in some Wii games like Fire Emblem: Radiant Dawn.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/HW/DSP.cpp9
1 files changed, 4 insertions, 5 deletions
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);