Sound System Rework: Phase 1

. Fixed Sample Rate for DSP
  (Now if your CPU is capable to run game at 100%, you will get pure sound without buzz or static noise)

. Fixed Sample Rate for AI
  (Now if your CPU is capable to run game at 100%, you will get sync'ed video and audio)

. Fixed Backend list for DSPLLE

. Improved Aduio DMA a bit
  (There might be a completely redesign in following phases)

WARNING: The whole rework will take time to complete.
This commit is compilable, but could be unstable.
So you can try it and test it but don't take it as a release rev!

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4717 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx
2009-12-22 07:26:30 +00:00
parent a1fefe870c
commit 24d8839793
11 changed files with 125 additions and 47 deletions

View File

@ -58,3 +58,9 @@ float Memory_Read_Float(u32 _uAddress)
u32 uTemp = Memory_Read_U32(_uAddress);
return *(float*)&uTemp;
}
void* Memory_Get_Pointer(u32 _uAddress)
{
_uAddress &= RAM_MASK;
return &g_pMemory[_uAddress];
}

View File

@ -43,6 +43,7 @@ u8 Memory_Read_U8(u32 _uAddress);
u16 Memory_Read_U16(u32 _uAddress);
u32 Memory_Read_U32(u32 _uAddress);
float Memory_Read_Float(u32 _uAddress);
void* Memory_Get_Pointer(u32 _uAddress);
extern PLUGIN_GLOBALS* globals;

View File

@ -332,8 +332,10 @@ void DSP_SendAIBuffer(unsigned int address, int sample_rate)
}
CMixer* pMixer = soundStream->GetMixer();
if (pMixer)
if (pMixer && address)
{
short* samples = (short*)Memory_Get_Pointer(address);
/*
short samples[16] = {0}; // interleaved stereo
if (address)
{
@ -346,7 +348,7 @@ void DSP_SendAIBuffer(unsigned int address, int sample_rate)
//if (log_ai)
// g_wave_writer.AddStereoSamples(samples, 8);
}
*/
// sample_rate is usually 32k here,
// see Core/DSP/DSP.cpp for better information
pMixer->PushSamples(samples, 32 / 4, sample_rate);

View File

@ -105,6 +105,11 @@ void DSPConfigDialogLLE::AddBackend(const char* backend)
#endif
}
void DSPConfigDialogLLE::ClearBackends()
{
m_BackendSelection->Clear();
}
DSPConfigDialogLLE::~DSPConfigDialogLLE()
{
}

View File

@ -35,6 +35,7 @@ public:
long style = wxDEFAULT_DIALOG_STYLE);
virtual ~DSPConfigDialogLLE();
void AddBackend(const char *backend);
void ClearBackends();
private:
DECLARE_EVENT_TABLE();

View File

@ -145,6 +145,7 @@ void DllConfig(HWND _hParent)
else if (!m_ConfigFrame->GetParent()->IsShown())
m_ConfigFrame->Close(true);
m_ConfigFrame->ClearBackends();
// add backends
std::vector<std::string> backends = AudioCommon::GetSoundBackends();