DSP: Fixes behaviour for audio dmas of length 0

This behaviour was tested on a real (wii) console.
This commit is contained in:
booto 2014-08-11 02:02:18 +08:00
parent b38022df43
commit 92064d1025
1 changed files with 7 additions and 7 deletions

View File

@ -490,19 +490,19 @@ void UpdateAudioDMA()
// Read audio at g_audioDMA.current_source_address in RAM and push onto an // 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 // external audio fifo in the emulator, to be mixed with the disc
// streaming output. // 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) if (g_audioDMA.remaining_blocks_count == 0)
{ {
g_audioDMA.current_source_address = g_audioDMA.SourceAddress; g_audioDMA.current_source_address = g_audioDMA.SourceAddress;
g_audioDMA.remaining_blocks_count = g_audioDMA.AudioDMAControl.NumBlocks; g_audioDMA.remaining_blocks_count = g_audioDMA.AudioDMAControl.NumBlocks;
if (g_audioDMA.AudioDMAControl.NumBlocks == 0) if (g_audioDMA.remaining_blocks_count != 0)
{
g_audioDMA.AudioDMAControl.Enable = 0;
}
else
{ {
// We make the samples ready as soon as possible // We make the samples ready as soon as possible
void *address = Memory::GetPointer(g_audioDMA.SourceAddress); void *address = Memory::GetPointer(g_audioDMA.SourceAddress);