Reverted the audio streaming tweak from r7a04ec6f9220dd66147c86baaebc2f9e05d65ead as it was causing audio clipping in some Wii games like Fire Emblem: Radiant Dawn.

This commit is contained in:
skidau 2013-03-03 15:20:15 +11:00
parent 6d1a0f5c2a
commit 6dbd80d73e
1 changed files with 4 additions and 5 deletions

View File

@ -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);