summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2014-08-12 18:18:51 -0700
committerPierre Bourdon <delroth@gmail.com>2014-08-12 18:18:51 -0700
commite4e44909d5ffa60abf81d4685a156654c463bbf9 (patch)
tree042e2f33dbb4d4ecaa3a89159f0fe1484173abf1 /Source
parent7b9c8da468b2a92aa8ec7677bf7766d7491eb214 (diff)
parentadf2ae2ac912230f5f885d1eae8446c4bcca36c9 (diff)
Merge pull request #762 from booto/dma-audio-3
DSP: DMA behaviour adjustments to fix regressions
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/HW/DSP.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp
index 5cd14885e6..381b4203da 100644
--- a/Source/Core/Core/HW/DSP.cpp
+++ b/Source/Core/Core/HW/DSP.cpp
@@ -406,8 +406,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
// 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);
+ CoreTiming::ScheduleEvent_Threadsafe(80, et_GenerateDSPInterrupt, INT_AID | (1 << 16));
}
})
);
@@ -459,8 +458,7 @@ void GenerateDSPInterrupt(DSPInterruptType type, bool _bSet)
// CALLED FROM DSP EMULATOR, POSSIBLY THREADED
void GenerateDSPInterruptFromDSPEmu(DSPInterruptType type, bool _bSet)
{
- CoreTiming::ScheduleEvent_Threadsafe(
- 0, et_GenerateDSPInterrupt, type | (_bSet<<16));
+ CoreTiming::ScheduleEvent_Threadsafe_Immediate(et_GenerateDSPInterrupt, type | (_bSet<<16));
CoreTiming::ForceExceptionCheck(100);
}
@@ -490,19 +488,19 @@ 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.
- 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)
{
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;
- }
- else
+ if (g_audioDMA.remaining_blocks_count != 0)
{
// We make the samples ready as soon as possible
void *address = Memory::GetPointer(g_audioDMA.SourceAddress);