Sound System Rework: Phase 2 (cont'ed)

. Fixed super fast refresh rate issue

. Recovered <TAB> shortcut key for ThrottleSkipping

. Removed redundant "soundstream->Update()" in DSPLLE
  (Thanks to LordMark)


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4728 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx
2009-12-25 11:59:04 +00:00
parent eddafd450e
commit 06218e9ebb
20 changed files with 96 additions and 139 deletions

View File

@ -58,10 +58,9 @@ DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wx
m_buttonEnableDTKMusic->SetToolTip(wxT("This is used to play music tracks, like BGM."));
m_buttonEnableThrottle->SetToolTip(wxT("This is used to control game speed by sound throttle.\n")
wxT("Disabling this could cause abnormal game speed, such as too fast.\n")
wxT("But sometimes enabling this causes constant noise."));
wxT("But sometimes enabling this could cause constant noise.\n")
wxT("\nKeyboard Shortcut <TAB>: Hold down to instantly disable Throttle."));
m_buttonEnableRE0Fix->SetToolTip(wxT("This fixes audio in Resident Evil Zero and maybe some other games."));
m_BackendSelection->SetToolTip(wxT("Changing this will have no effect while the emulator is running!"));
// Create sizer and add items to dialog

View File

@ -20,7 +20,7 @@
#include "DSPHandler.h"
#include "HLEMixer.h"
void HLEMixer::Premix(short *samples, unsigned int numSamples, unsigned int sampleRate)
void HLEMixer::Premix(short *samples, unsigned int numSamples)
{
// if this was called directly from the HLE
if (g_Config.m_EnableHLEAudio && IsHLEReady())

View File

@ -6,10 +6,10 @@
class HLEMixer : public CMixer
{
public:
HLEMixer(unsigned int AISampleRate = 48000, unsigned int DSPSampleRate = 48000)
: CMixer(AISampleRate, DSPSampleRate) {};
HLEMixer(unsigned int AISampleRate = 48000, unsigned int DACSampleRate = 48000)
: CMixer(AISampleRate, DACSampleRate) {};
virtual void Premix(short *samples, unsigned int numSamples, unsigned int sampleRate);
virtual void Premix(short *samples, unsigned int numSamples);
};
#endif // HLEMIXER_H

View File

@ -307,9 +307,9 @@ unsigned short DSP_WriteControlRegister(unsigned short _Value)
{
if (!Temp.DSPHalt && Temp.DSPInit)
{
unsigned int AISampleRate, DSPSampleRate;
g_dspInitialize.pGetSampleRate(AISampleRate, DSPSampleRate);
soundStream = AudioCommon::InitSoundStream(new HLEMixer(AISampleRate, DSPSampleRate));
unsigned int AISampleRate, DACSampleRate;
g_dspInitialize.pGetSampleRate(AISampleRate, DACSampleRate);
soundStream = AudioCommon::InitSoundStream(new HLEMixer(AISampleRate, DACSampleRate));
if(!soundStream) PanicAlert("Error starting up sound stream");
// Mixer is initialized
g_InitMixer = true;
@ -334,7 +334,7 @@ void DSP_Update(int cycles)
inside Mixer_PushSamples(), the reason that we don't disable this entire
function when Other Audio is disabled is that then we can't turn it back on
again once the game has started. */
void DSP_SendAIBuffer(unsigned int address, unsigned int num_samples, unsigned int sample_rate)
void DSP_SendAIBuffer(unsigned int address, unsigned int num_samples)
{
if (!soundStream)
return;
@ -344,9 +344,8 @@ void DSP_SendAIBuffer(unsigned int address, unsigned int num_samples, unsigned i
if (pMixer && address)
{
short* samples = (short*)Memory_Get_Pointer(address);
// sample_rate could be 32khz/48khz here,
// see Core/DSP/DSP.cpp for better information
pMixer->PushSamples(samples, num_samples, sample_rate);
// Internal sample rate is always 32khz
pMixer->PushSamples(samples, num_samples);
// FIXME: Write the audio to a file
//if (log_ai)