Merge pull request #762 from booto/dma-audio-3

DSP: DMA behaviour adjustments to fix regressions
This commit is contained in:
Pierre Bourdon 2014-08-12 18:18:51 -07:00
commit e4e44909d5
1 changed files with 9 additions and 11 deletions

View File

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