mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 20:04:31 +01:00
MRFIXIT2001: This patch adds a second frameskip setting, one for setting the # of frames to skip, one for setting the % of frames to skip based off fps
This commit is contained in:
1 parent
85d9896603
commit
c19d3fe06a
11 files changed
+72
-3
No files matched your search
+16
-3
@@ -503,6 +503,17 @@ static void DoFrameDropLogging(float scaledTimestep) {
|
||||
}
|
||||
}
|
||||
|
||||
static int CalculateFrameSkip() {
|
||||
// Used to calculate the FPS to skip if the user sets the type to percent of fps
|
||||
int frameSkipNum;
|
||||
if (g_Config.iFrameSkipType == 1) {
|
||||
frameSkipNum = ceil( flips * (static_cast<double>(g_Config.iFrameSkip) / 100.00) );
|
||||
} else {
|
||||
frameSkipNum = g_Config.iFrameSkip;
|
||||
}
|
||||
return frameSkipNum;
|
||||
}
|
||||
|
||||
// Let's collect all the throttling and frameskipping logic here.
|
||||
static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
|
||||
PROFILE_THIS_SCOPE("timing");
|
||||
@@ -553,15 +564,16 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
|
||||
// Auto-frameskip automatically if speed limit is set differently than the default.
|
||||
bool useAutoFrameskip = g_Config.bAutoFrameSkip && g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
|
||||
bool forceFrameskip = (fpsLimiter == FPSLimit::CUSTOM1 && g_Config.iFpsLimit1 > 60) || (fpsLimiter == FPSLimit::CUSTOM2 && g_Config.iFpsLimit2 > 60);
|
||||
int frameSkipNum = CalculateFrameSkip();
|
||||
if (g_Config.bAutoFrameSkip || forceFrameskip) {
|
||||
// autoframeskip
|
||||
// Argh, we are falling behind! Let's skip a frame and see if we catch up.
|
||||
if (curFrameTime > nextFrameTime && doFrameSkip) {
|
||||
skipFrame = true;
|
||||
}
|
||||
} else if (g_Config.iFrameSkip >= 1) {
|
||||
} else if (frameSkipNum >= 1) {
|
||||
// fixed frameskip
|
||||
if (numSkippedFrames >= g_Config.iFrameSkip)
|
||||
if (numSkippedFrames >= frameSkipNum)
|
||||
skipFrame = false;
|
||||
else
|
||||
skipFrame = true;
|
||||
@@ -734,9 +746,10 @@ void __DisplayFlip(int cyclesLate) {
|
||||
DoFrameTiming(throttle, skipFrame, (float)numVBlanksSinceFlip * timePerVblank);
|
||||
|
||||
int maxFrameskip = 8;
|
||||
int frameSkipNum = CalculateFrameSkip();
|
||||
if (throttle) {
|
||||
// 4 here means 1 drawn, 4 skipped - so 12 fps minimum.
|
||||
maxFrameskip = g_Config.iFrameSkip;
|
||||
maxFrameskip = frameSkipNum;
|
||||
}
|
||||
if (numSkippedFrames >= maxFrameskip || GPURecord::IsActivePending()) {
|
||||
skipFrame = false;
|
||||
|
||||
Reference in new issue
Block a user