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