mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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:
@ -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
|
||||
|
@ -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())
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -39,7 +39,7 @@ DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wx
|
||||
|
||||
// Create items
|
||||
m_buttonEnableDTKMusic = new wxCheckBox(this, ID_ENABLE_DTK_MUSIC, wxT("Enable DTK Music"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_buttonEnableThrottle = new wxCheckBox(this, ID_ENABLE_THROTTLE, wxT("Enable Other Audio (Throttle)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_buttonEnableThrottle = new wxCheckBox(this, ID_ENABLE_THROTTLE, wxT("Enable Audio Throttle"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
wxStaticText *BackendText = new wxStaticText(this, wxID_ANY, wxT("Audio Backend"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_BackendSelection = new wxComboBox(this, ID_BACKEND, wxEmptyString, wxDefaultPosition, wxSize(90, 20), wxArrayBackends, wxCB_READONLY, wxDefaultValidator);
|
||||
|
||||
@ -51,10 +51,11 @@ DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wx
|
||||
m_buttonEnableThrottle->SetValue(ac_Config.m_EnableThrottle ? true : false);
|
||||
|
||||
// Add tooltips
|
||||
m_buttonEnableDTKMusic->SetToolTip(wxT("This is sometimes used to play music tracks from the disc"));
|
||||
m_buttonEnableThrottle->SetToolTip(wxT("This is sometimes used together with pre-rendered movies.\n")
|
||||
wxT("Disabling this also disables the speed throttle which this causes,\n")
|
||||
wxT("meaning that there will be no upper limit on your FPS."));
|
||||
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 could cause constant noise.\n")
|
||||
wxT("\nKeyboard Shortcut <TAB>: Hold down to instantly disable Throttle."));
|
||||
m_BackendSelection->SetToolTip(wxT("Changing this will have no effect while the emulator is running!"));
|
||||
|
||||
// Create sizer and add items to dialog
|
||||
|
@ -263,9 +263,9 @@ u16 DSP_WriteControlRegister(u16 _uFlag)
|
||||
{
|
||||
if (!Temp.DSPHalt && Temp.DSPInit)
|
||||
{
|
||||
unsigned int AISampleRate, DSPSampleRate;
|
||||
g_dspInitialize.pGetSampleRate(AISampleRate, DSPSampleRate);
|
||||
soundStream = AudioCommon::InitSoundStream(new CMixer(AISampleRate, DSPSampleRate));
|
||||
unsigned int AISampleRate, DACSampleRate;
|
||||
g_dspInitialize.pGetSampleRate(AISampleRate, DACSampleRate);
|
||||
soundStream = AudioCommon::InitSoundStream(new CMixer(AISampleRate, DACSampleRate));
|
||||
if(!soundStream) PanicAlert("Error starting up sound stream");
|
||||
// Mixer is initialized
|
||||
g_InitMixer = true;
|
||||
@ -334,6 +334,8 @@ void DSP_WriteMailboxLow(bool _CPUMailbox, u16 _uLowMail)
|
||||
|
||||
void DSP_Update(int cycles)
|
||||
{
|
||||
// Sound stream update job has been handled by AudioDMA routine, which is more efficient
|
||||
/*
|
||||
// This gets called VERY OFTEN. The soundstream update might be expensive so only do it 200 times per second or something.
|
||||
int cycles_between_ss_update;
|
||||
|
||||
@ -350,7 +352,7 @@ void DSP_Update(int cycles)
|
||||
cycle_count -= cycles_between_ss_update;
|
||||
soundStream->Update();
|
||||
}
|
||||
|
||||
*/
|
||||
// If we're not on a thread, run cycles here.
|
||||
if (!g_dspInitialize.bOnThread)
|
||||
{
|
||||
@ -358,7 +360,7 @@ void DSP_Update(int cycles)
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
@ -369,7 +371,7 @@ void DSP_SendAIBuffer(unsigned int address, unsigned int num_samples, unsigned i
|
||||
{
|
||||
short* samples = (short*)Memory_Get_Pointer(address);
|
||||
|
||||
pMixer->PushSamples(samples, num_samples, sample_rate);
|
||||
pMixer->PushSamples(samples, num_samples);
|
||||
}
|
||||
|
||||
soundStream->Update();
|
||||
|
Reference in New Issue
Block a user