summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2014-08-02 15:13:26 -0700
committerPierre Bourdon <delroth@gmail.com>2014-08-02 15:13:26 -0700
commit9f8e1e2a0dbca38b53ac7d91f5e714baaa72bfa0 (patch)
tree9520c7c17669917df3d929438d2baab766ea5bae /Source
parent1bb7c2791ab2266172d6cd10ca4d93bdf8dd950a (diff)
parent35dfe57bc1aec45b8ced0520b70f6ba5495da12b (diff)
Merge pull request #720 from booto/dma-audio-fix2
DSP: copy audio dma samples as early as possible
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/HW/DSP.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp
index a0d3a35337..5cd14885e6 100644
--- a/Source/Core/Core/HW/DSP.cpp
+++ b/Source/Core/Core/HW/DSP.cpp
@@ -403,10 +403,9 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
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;
- }
+ // We make the samples ready as soon as possible
+ void *address = Memory::GetPointer(g_audioDMA.SourceAddress);
+ AudioCommon::SendAIBuffer((short*)address, g_audioDMA.AudioDMAControl.NumBlocks * 8);
GenerateDSPInterrupt(DSP::INT_AID);
}
@@ -491,9 +490,6 @@ 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.
- void *address = Memory::GetPointer(g_audioDMA.current_source_address);
- AudioCommon::SendAIBuffer((short*)address, 8);
-
g_audioDMA.remaining_blocks_count--;
g_audioDMA.current_source_address += 32;
@@ -506,7 +502,12 @@ void UpdateAudioDMA()
{
g_audioDMA.AudioDMAControl.Enable = 0;
}
-
+ else
+ {
+ // We make the samples ready as soon as possible
+ void *address = Memory::GetPointer(g_audioDMA.SourceAddress);
+ AudioCommon::SendAIBuffer((short*)address, g_audioDMA.AudioDMAControl.NumBlocks * 8);
+ }
GenerateDSPInterrupt(DSP::INT_AID);
}
}