Stabilized the framelimiting part of the frameskipper.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@386 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
Jake.Stine 2008-12-04 14:26:54 +00:00 committed by Gregory Hainaut
parent 233559de5c
commit 9f70fb2612
2 changed files with 11 additions and 11 deletions

View File

@ -115,7 +115,7 @@ void rcntInit() {
// debug code, used for stats // debug code, used for stats
int g_nCounters[4]; int g_nCounters[4];
static int iFrame = 0; static int iFrame = 0;
long iFrameLimitEnable = 1; //long iFrameLimitEnable = 1;
#ifndef _WIN32 #ifndef _WIN32
#include <sys/time.h> #include <sys/time.h>
@ -236,7 +236,7 @@ u32 UpdateVSyncRate()
} }
m_iStart = GetCPUTicks(); m_iStart = GetCPUTicks();
iFrameLimitEnable = 1; //iFrameLimitEnable = 1;
cpuRcntSet(); cpuRcntSet();
@ -340,11 +340,11 @@ static __forceinline void frameLimit()
if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_NORMAL ) return; if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_NORMAL ) return;
if( Config.CustomFps >= 999 ) return; // means the user would rather just have framelimiting turned off... if( Config.CustomFps >= 999 ) return; // means the user would rather just have framelimiting turned off...
if( !iFrameLimitEnable ) // Frameskipper disabled the limiter /*if( !iFrameLimitEnable ) // Frameskipper disabled the limiter
{ {
m_iStart = GetCPUTicks(); m_iStart = GetCPUTicks();
return; return;
} }*/
uExpectedEnd = m_iStart + m_iTicks; uExpectedEnd = m_iStart + m_iTicks;
iEnd = GetCPUTicks(); iEnd = GetCPUTicks();
@ -373,12 +373,12 @@ static __forceinline void frameLimit()
_TIMESLICE(); _TIMESLICE();
iEnd = GetCPUTicks(); iEnd = GetCPUTicks();
if( !(*(volatile long*)&iFrameLimitEnable) ) /*if( !(*(volatile long*)&iFrameLimitEnable) )
{ {
// Frameskipper turned us off // Frameskipper turned us off
m_iStart = iEnd; m_iStart = iEnd;
break; break;
} }*/
sDeltaTime = iEnd - uExpectedEnd; sDeltaTime = iEnd - uExpectedEnd;
} }

View File

@ -1646,7 +1646,7 @@ void gifMFIFOInterrupt()
cpuRegs.interrupt &= ~(1 << 11); cpuRegs.interrupt &= ~(1 << 11);
} }
extern "C" long iFrameLimitEnable; // used to enable/disable the EE framelimiter. //extern "C" long iFrameLimitEnable; // used to enable/disable the EE framelimiter.
// FrameSkipper - Measures delta time between calls and issues frameskips // FrameSkipper - Measures delta time between calls and issues frameskips
// it the time is too long. Also regulates the status of the EE's framelimiter. // it the time is too long. Also regulates the status of the EE's framelimiter.
@ -1703,7 +1703,7 @@ static __forceinline void frameSkip()
{ {
//SysPrintf( "Frameskip Initiated! Lateness: %d\n", (int)( sSlowDeltaTime / m_iSlowTicks ) ); //SysPrintf( "Frameskip Initiated! Lateness: %d\n", (int)( sSlowDeltaTime / m_iSlowTicks ) );
InterlockedExchange( &iFrameLimitEnable, 0 ); //InterlockedExchange( &iFrameLimitEnable, 0 );
GSsetFrameSkip(1); GSsetFrameSkip(1);
if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP ) if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP )
@ -1717,7 +1717,7 @@ static __forceinline void frameSkip()
{ {
// Running at or above full speed, so reset the StartTime // Running at or above full speed, so reset the StartTime
InterlockedExchange( &iFrameLimitEnable, 1 ); //InterlockedExchange( &iFrameLimitEnable, 1 );
m_iSlowStart = iEnd; m_iSlowStart = iEnd;
} }
justSkipped = false; justSkipped = false;
@ -1763,7 +1763,7 @@ static __forceinline void frameSkip()
if( sSlowDeltaTime < 0 ) if( sSlowDeltaTime < 0 )
{ {
InterlockedExchange( &iFrameLimitEnable, 1 ); //InterlockedExchange( &iFrameLimitEnable, 1 );
m_iSlowStart = iEnd; m_iSlowStart = iEnd;
} }
} }
@ -1796,7 +1796,7 @@ extern "C" void GSPostVsyncEnd()
static void _resetFrameskip() static void _resetFrameskip()
{ {
InterlockedExchangePointer( &Cpu->ExecuteVU1Block, s_prevExecuteVU1Block ); InterlockedExchangePointer( &Cpu->ExecuteVU1Block, s_prevExecuteVU1Block );
InterlockedExchange( &iFrameLimitEnable, 1 ); //InterlockedExchange( &iFrameLimitEnable, 1 );
GSsetFrameSkip( 0 ); GSsetFrameSkip( 0 );
} }