diff options
| author | ayuanx <ayuanx@gmail.com> | 2009-11-27 20:21:12 +0000 |
|---|---|---|
| committer | ayuanx <ayuanx@gmail.com> | 2009-11-27 20:21:12 +0000 |
| commit | ea732db998be167cce88f9f9ffe747e030521ca1 (patch) | |
| tree | 66be2052ae0f1a0476c0662b62bcecf99105d3ad /Source/Core | |
| parent | 5e31f22e50a2dddc0b0a7e5b2fcb515c4e574e60 (diff) | |
Thanks to Wagnard28 and other lots of people's test, now this will hopefully solve the troubling regression problems between r4616 and r4617.
Sorry about such frequent commits in a short time
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4619 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Src/HW/DSP.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index 6a686c63bc..8d23a5b841 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -139,6 +139,14 @@ struct AudioDMA u32 ReadAddress; UAudioDMAControl AudioDMAControl; int BlocksLeft; + + AudioDMA() + { + SourceAddress = 0; + ReadAddress = 0; + AudioDMAControl.Hex = 0; + BlocksLeft = 0; + } }; // ARDMA @@ -212,6 +220,7 @@ void Init() { g_ARAM = (u8 *)AllocateMemoryPages(ARAM_SIZE); } + g_audioDMA.AudioDMAControl.Hex = 0; g_dspState.DSPControl.Hex = 0; g_dspState.DSPControl.DSPHalt = 1; et_GenerateDSPInterrupt = CoreTiming::RegisterEvent("DSPint", GenerateDSPInterrupt_Wrapper); @@ -408,20 +417,12 @@ void Write16(const u16 _Value, const u32 _Address) break; case AUDIO_DMA_CONTROL_LEN: // called by AIStartDMA() - { - UAudioDMAControl old_control = g_audioDMA.AudioDMAControl; g_audioDMA.AudioDMAControl.Hex = _Value; - - if (!old_control.Enabled && g_audioDMA.AudioDMAControl.Enabled) - { - // Enabled bit was flipped to true, let's latch address & length and call the interrupt. - g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks; - g_audioDMA.ReadAddress = g_audioDMA.SourceAddress; - GenerateDSPInterrupt(DSP::INT_AID); - INFO_LOG(DSPINTERFACE, "AID DMA started - source address %08x, length %i blocks", g_audioDMA.SourceAddress, g_audioDMA.AudioDMAControl.NumBlocks); - } + g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks; + g_audioDMA.ReadAddress = g_audioDMA.SourceAddress; + INFO_LOG(DSPINTERFACE, "AID DMA started - source address %08x, length %i blocks", g_audioDMA.SourceAddress, g_audioDMA.AudioDMAControl.NumBlocks); break; - } + case AUDIO_DMA_BYTES_LEFT: _dbg_assert_(DSPINTERFACE,0); break; @@ -446,9 +447,8 @@ void UpdateAudioDMA() g_audioDMA.ReadAddress += 32; g_audioDMA.BlocksLeft--; if (!g_audioDMA.BlocksLeft) { - // No need to turn off the DMA - we can only get here if we had - // blocks left when we entered this function, and no longer have - // any. Latch new parameters + // Latch new parameters + // This is mainly used by NGC games which do auto loops g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks; g_audioDMA.ReadAddress = g_audioDMA.SourceAddress; // DEBUG_LOG(DSPLLE, "ADMA read addresses: %08x", g_audioDMA.ReadAddress); |
