Skip to content

Commit

Permalink
Merge pull request #5208 from unknownbrackets/display-minor
Browse files Browse the repository at this point in the history
Ignore unreasonable timestep values
  • Loading branch information
hrydgard committed Jan 25, 2014
2 parents f660be3 + 1045465 commit 39bfc03
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,10 @@ static float timestepSmooth[8] = {
static int timestepNext = 0;

static float CalculateSmoothTimestep(float lastTimestep) {
timestepSmooth[timestepNext] = lastTimestep;
// Straight up ignore timesteps that would cause sub-10 fps speeds.
if (lastTimestep < 1.001f / 10.0f) {
timestepSmooth[timestepNext] = lastTimestep;
}
timestepNext = (timestepNext + 1) % ARRAY_SIZE(timestepSmooth);

float summed = 0.0f;
Expand Down Expand Up @@ -562,7 +565,8 @@ void hleEnterVblank(u64 userdata, int cyclesLate) {
// We flip only if the framebuffer was dirty. This eliminates flicker when using
// non-buffered rendering. The interaction with frame skipping seems to need
// some work.
if (gpu->FramebufferDirty()) {
// But, let's flip at least once every 10 frames if possible, since there may be sound effects.
if (gpu->FramebufferDirty() || (g_Config.iRenderingMode != 0 && numVBlanksSinceFlip >= 10)) {
if (g_Config.iShowFPSCounter && g_Config.iShowFPSCounter < 4) {
CalculateFPS();
}
Expand Down

0 comments on commit 39bfc03

Please sign in to comment.