mirror of https://github.com/PCSX2/pcsx2.git
SPU2Ghz: More improvements and cleanup
git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@233 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
parent
ef6b4d136f
commit
e76b830d8c
|
@ -61,7 +61,7 @@ BEGIN
|
|||
PUSHBUTTON "Cancel",IDCANCEL,354,198,54,15,NOT WS_TABSTOP
|
||||
GROUPBOX "Effects (Reverb) Settings",IDC_STATIC,6,156,119,30
|
||||
CHECKBOX "Enable Effect Processing",IDC_EFFECTS,12,168,95,10,NOT WS_TABSTOP
|
||||
GROUPBOX "Output Settings",IDC_STATIC,132,6,119,111
|
||||
GROUPBOX "Output Settings",IDC_STATIC,132,6,119,103
|
||||
LTEXT "Buffer Size",IDC_STATIC,138,35,35,8,NOT WS_GROUP
|
||||
LTEXT "Sample Rate",IDC_STATIC,139,19,42,8,NOT WS_GROUP
|
||||
GROUPBOX "Mixing Settings",IDC_STATIC,6,6,119,80
|
||||
|
@ -90,16 +90,13 @@ BEGIN
|
|||
CONTROL "AutoDMA Operations",IDC_MSGADMA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,282,66,83,10
|
||||
CONTROL "Voice Stop Events",IDC_MSGVOICE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,276,42,75,10
|
||||
CONTROL "Show In Console",IDC_MSGSHOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,270,18,69,10
|
||||
GROUPBOX "Speed Limiter",IDC_STATIC,132,119,120,68
|
||||
LTEXT "The number value works better if it's in the 5-20 range. The buffer size works better in powers of 2 (1024/2048) specially in Vista.",IDC_STATIC,138,75,108,35
|
||||
CONTROL "Limit speed to output speed.",IDC_SPEEDLIMIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,132,108,12
|
||||
LTEXT "Size = 1024, Numbers = 10",IDC_STATIC,137,94,108,12
|
||||
PUSHBUTTON "Configure...",IDC_OUTCONF,72,42,48,12
|
||||
LTEXT "WARNING: The effects processing is experimental and _could_ hurt your ears .\n If that happens, tell me about what game, so I can fix it!",IDC_STATIC,20,191,255,21
|
||||
GROUPBOX "DSP && Stretching",IDC_STATIC,6,87,119,68
|
||||
GROUPBOX "DSP",IDC_STATIC,6,87,119,68
|
||||
CONTROL "Enable Winamp DSP plugin",IDC_DSP_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,100,103,10
|
||||
LTEXT "(configure in the .ini)",IDC_STATIC,41,116,64,8
|
||||
CONTROL "Enable Timestretcher",IDC_TS_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,137,83,10
|
||||
LTEXT "Use this to time the FPS to SPU2. Makes the audio play at best speed when your games allow it.",IDC_STATIC,138,149,108,31
|
||||
LTEXT "(configure in the .ini)",IDC_STATIC,43,110,64,8
|
||||
LTEXT "Recommended:",IDC_STATIC,137,80,108,9
|
||||
END
|
||||
|
||||
IDD_DEBUG DIALOGEX 0, 0, 326, 525
|
||||
|
|
|
@ -229,7 +229,7 @@ void ReadSettings()
|
|||
SampleRate=CfgReadInt("OUTPUT","Sample_Rate",48000);
|
||||
|
||||
CurBufferSize=CfgReadInt("OUTPUT","Buffer_Size",1024);
|
||||
MaxBufferCount=CfgReadInt("OUTPUT","Buffer_Count",8);
|
||||
MaxBufferCount=CfgReadInt("OUTPUT","Buffer_Count",10);
|
||||
if(MaxBufferCount<3) MaxBufferCount=3;
|
||||
CurBufferCount=MaxBufferCount;
|
||||
|
||||
|
@ -255,9 +255,9 @@ void ReadSettings()
|
|||
dspPluginModule = CfgReadInt("DSP PLUGIN","ModuleNum",0);
|
||||
dspPluginEnabled= CfgReadBool("DSP PLUGIN","Enabled",false);
|
||||
|
||||
timeStretchEnabled = CfgReadBool("DSP","Timestretch_Enable",false);
|
||||
timeStretchEnabled = false; /*CfgReadBool("DSP","Timestretch_Enable",false);*/ //has to be false at init
|
||||
|
||||
LimiterToggleEnabled = CfgReadBool("KEYS","Limiter_Toggle_Enabled",true);
|
||||
LimiterToggleEnabled = CfgReadBool("KEYS","Limiter_Toggle_Enabled",false);
|
||||
LimiterToggle = CfgReadInt ("KEYS","Limiter_Toggle",VK_SUBTRACT);
|
||||
|
||||
CfgReadStr("DirectSound Output (Stereo)","Device",DSoundDevice,255,"");
|
||||
|
|
|
@ -156,7 +156,7 @@ public:
|
|||
|
||||
#ifndef DYNAMIC_BUFFER_LIMITING
|
||||
|
||||
if( data+nSamples > size )
|
||||
if((data+nSamples > size) && !timeStretchEnabled)
|
||||
{
|
||||
// Buffer overrun!
|
||||
// Dump samples from the read portion of the buffer instead of dropping
|
||||
|
@ -171,6 +171,7 @@ public:
|
|||
rpos=(rpos+comp)%size;
|
||||
timeStretchEnabled = true;
|
||||
ConLog(" * SPU2 > Overrun Compensation (%d samples tossed)\n", size );
|
||||
ConLog(" * SPU2 Timestretch: ENABLED\n");
|
||||
}
|
||||
|
||||
while(data<size && nSamples>0)
|
||||
|
@ -226,7 +227,7 @@ public:
|
|||
// set buffer length in duration.
|
||||
|
||||
#ifndef DYNAMIC_BUFFER_LIMITING
|
||||
if( underrun_freeze )
|
||||
if( underrun_freeze && !timeStretchEnabled)
|
||||
{
|
||||
// Let's fill up 80% of our buffer.
|
||||
// (I just picked 80% arbitrarily.. there might be a better value)
|
||||
|
@ -247,8 +248,10 @@ public:
|
|||
|
||||
underrun_freeze = false;
|
||||
timeStretchEnabled = true;
|
||||
ConLog( " * SPU2 > Underrun compensation (%d samples buffered)\n", toFill );
|
||||
ConLog(" * SPU2 > Underrun compensation (%d samples buffered)\n", toFill );
|
||||
ConLog(" * SPU2 Timestretch: ENABLED\n");
|
||||
}
|
||||
else underrun_freeze = false;
|
||||
|
||||
while(data>0 && nSamples>0)
|
||||
{
|
||||
|
@ -457,22 +460,18 @@ void UpdateTempoChange()
|
|||
float valAccum = 1.0f;
|
||||
|
||||
valAccum = valAccum2 / valAccum1;
|
||||
|
||||
ConLog( " * SPU2 Timestretch: ENABLED > tempo = %f\n",lastTempo);
|
||||
|
||||
if((valAccum < 1.04f) && (valAccum > 0.96f) /*&& (valAccum != 1)*/)
|
||||
{
|
||||
// printf("Timestretch Debug > Playbackpeed: %f (difference disregarded, using 1.0).\n",valAccum);
|
||||
valAccum = 1.0f;
|
||||
}
|
||||
/*else
|
||||
{
|
||||
printf("Timestretch Debug > Playbackpeed: %f\n",valAccum);
|
||||
}*/
|
||||
|
||||
if (valAccum != lastTempo) //only update soundtouch object when needed
|
||||
pSoundTouch->setTempo(valAccum);
|
||||
|
||||
lastTempo = valAccum;
|
||||
cTempo = valAccum;
|
||||
|
||||
if (lastTempo == 1) {
|
||||
runs++;
|
||||
if (runs == 5) {
|
||||
|
@ -483,10 +482,6 @@ void UpdateTempoChange()
|
|||
}
|
||||
else runs = 0;
|
||||
|
||||
lastTempo = valAccum;
|
||||
cTempo = valAccum;
|
||||
|
||||
|
||||
valAccum1 = 1.0f;
|
||||
valAccum2 = 1.0f;
|
||||
numAccum = 0;
|
||||
|
|
Loading…
Reference in New Issue