Added an optional "Enable / Disable timestretching" plugin interface. If used correctly on a SPU2 plugin, helps to improve audio quality. (At fullspeed the game shouldn't require timestretching)

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@52 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
ramapcsx2 2008-08-18 16:35:49 +00:00 committed by Gregory Hainaut
parent f70e12c662
commit a4bbf35e6e
3 changed files with 18 additions and 5 deletions

View File

@ -931,22 +931,31 @@ void ProcessFKeys(int fkey, int shift)
switch(CHECK_FRAMELIMIT) {
case PCSX2_FRAMELIMIT_NORMAL:
if( CHECK_MULTIGS ) GSRingBufSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0);
/*if( CHECK_MULTIGS ) GSRingBufSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0);
else GSsetFrameSkip(0);
Cpu->ExecuteVU1Block = recExecuteVU1Block;
Cpu->ExecuteVU1Block = recExecuteVU1Block;*/
if(SPU2setTimeStretcher != NULL)
SPU2setTimeStretcher(1);
SysPrintf("Normal - Frame Limit Mode Changed\n");
break;
case PCSX2_FRAMELIMIT_LIMIT:
if( CHECK_MULTIGS ) GSRingBufSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0);
/*if( CHECK_MULTIGS ) GSRingBufSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0);
else GSsetFrameSkip(0);
Cpu->ExecuteVU1Block = recExecuteVU1Block;
Cpu->ExecuteVU1Block = recExecuteVU1Block;*/
//Quality option, turn off timestretching on the SPU2 plugin
if(SPU2setTimeStretcher != NULL)
SPU2setTimeStretcher(0);
SysPrintf("Limit - Frame Limit Mode Changed\n");
break;
case PCSX2_FRAMELIMIT_SKIP:
Cpu->ExecuteVU1Block = recExecuteVU1Block;
//Cpu->ExecuteVU1Block = recExecuteVU1Block;
if(SPU2setTimeStretcher != NULL)
SPU2setTimeStretcher(1);
SysPrintf("Frame Skip - Frame Limit Mode Changed\n");
break;
case PCSX2_FRAMELIMIT_VUSKIP:
if(SPU2setTimeStretcher != NULL)
SPU2setTimeStretcher(1);
SysPrintf("VU Skip - Frame Limit Mode Changed\n");
break;
}

View File

@ -359,6 +359,7 @@ void CALLBACK SPU2irqCallback(void (*SPU2callback)(),void (*DMA4callback)(),void
int CALLBACK SPU2setupRecording(int start, void* pData);
void CALLBACK SPU2setClockPtr(u32* ptr);
void CALLBACK SPU2setTimeStretcher(short int enable);
void CALLBACK SPU2async(u32 cycles);
s32 CALLBACK SPU2freeze(int mode, freezeData *data);
@ -592,6 +593,7 @@ typedef void (CALLBACK* _SPU2irqCallback)(void (*SPU2callback)(),void (*DMA4call
typedef int (CALLBACK* _SPU2setupRecording)(int, void*);
typedef void (CALLBACK* _SPU2setClockPtr)(u32*ptr);
typedef void (CALLBACK* _SPU2setTimeStretcher)(short int enable);
typedef u32 (CALLBACK* _SPU2ReadMemAddr)(int core);
typedef void (CALLBACK* _SPU2WriteMemAddr)(int core,u32 value);
@ -791,6 +793,7 @@ _SPU2WriteMemAddr SPU2WriteMemAddr;
_SPU2irqCallback SPU2irqCallback;
_SPU2setClockPtr SPU2setClockPtr;
_SPU2setTimeStretcher SPU2setTimeStretcher;
_SPU2async SPU2async;
_SPU2freeze SPU2freeze;

View File

@ -251,6 +251,7 @@ int LoadSPU2plugin(char *filename) {
LoadSPU2sym1(irqCallback, "SPU2irqCallback");
LoadSPU2symN(setClockPtr, "SPU2setClockPtr");
LoadSPU2symN(setTimeStretcher, "SPU2setTimeStretcher");
LoadSPU2symN(setupRecording, "SPU2setupRecording");