mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
Move audio handling out of DSP emulation.
This is good for a couple of reasons: one, it gets rid of duplicated code, and two, DSP emulation shouldn't need to interact with audio in the first place.
This commit is contained in:
@ -23,6 +23,8 @@
|
||||
// the just used buffer through the AXList (or whatever it might be called in
|
||||
// Nintendo games).
|
||||
|
||||
#include "AudioCommon/AudioCommon.h"
|
||||
|
||||
#include "Common/MemoryUtil.h"
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
@ -482,7 +484,9 @@ void UpdateAudioDMA()
|
||||
|
||||
if (g_audioDMA.BlocksLeft == 0)
|
||||
{
|
||||
dsp_emulator->DSP_SendAIBuffer(g_audioDMA.SourceAddress, 8*g_audioDMA.AudioDMAControl.NumBlocks);
|
||||
void *address = Memory::GetPointer(g_audioDMA.SourceAddress);
|
||||
unsigned samples = 8 * g_audioDMA.AudioDMAControl.NumBlocks;
|
||||
AudioCommon::SendAIBuffer((short*)address, samples);
|
||||
GenerateDSPInterrupt(DSP::INT_AID);
|
||||
g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks;
|
||||
g_audioDMA.ReadAddress = g_audioDMA.SourceAddress;
|
||||
@ -492,7 +496,7 @@ void UpdateAudioDMA()
|
||||
{
|
||||
// Send silence. Yeah, it's a bit of a waste to sample rate convert
|
||||
// silence. or hm. Maybe we shouldn't do this :)
|
||||
dsp_emulator->DSP_SendAIBuffer(0, AudioInterface::GetAIDSampleRate());
|
||||
AudioCommon::SendAIBuffer(0, AudioInterface::GetAIDSampleRate());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user