Skip to content

Commit

Permalink
Change previously added hack.
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaMoo committed Jan 15, 2018
1 parent 867293d commit 2363ca6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Core/CoreTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ u64 GetGlobalTimeUsScaled()
float vps;
__DisplayGetVPS(&vps);
if (vps > 4.0f)
freq *= (vps / 59.94f);
freq *= (vps / (g_Config.bRefreshAt60Hz ? 60.0f : 59.94f));
}
s64 usSinceLast = ticksSinceLast / freq;
return lastGlobalTimeUs + usSinceLast;
Expand Down
10 changes: 3 additions & 7 deletions Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static bool wasPaused;
static bool flippedThisFrame;

// 1.001f to compensate for the classic 59.94 NTSC framerate that the PSP seems to have.
static const double timePerVblank = 1.001f / 60.0f;
static const double timePerVblank = (g_Config.bRefreshAt60Hz ? 1.0f : 1.001f) / 60.0f;

// Don't include this in the state, time increases regardless of state.
static double curFrameTime;
Expand Down Expand Up @@ -528,8 +528,6 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
time_update();

float scaledTimestep = timestep;
if (g_Config.bRefreshAt60Hz)
scaledTimestep = scaledTimestep * 1.001f;
if (fpsLimiter == FPS_LIMIT_CUSTOM && g_Config.iFpsLimit != 0) {
scaledTimestep *= 60.0f / g_Config.iFpsLimit;
}
Expand Down Expand Up @@ -603,8 +601,6 @@ static void DoFrameIdleTiming() {
}

float scaledVblank = timePerVblank;
if (g_Config.bRefreshAt60Hz)
scaledVblank = scaledVblank * 1.001f;
if (PSP_CoreParameter().fpsLimit == FPS_LIMIT_CUSTOM) {
// 0 is handled in FrameTimingThrottled().
scaledVblank *= 60.0f / g_Config.iFpsLimit;
Expand Down Expand Up @@ -932,7 +928,7 @@ u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync)
}

// 1001 to account for NTSC timing (59.94 fps.)
u64 expected = msToCycles(1001) / g_Config.iForceMaxEmulatedFPS - LEEWAY_CYCLES_PER_FLIP;
u64 expected = msToCycles(g_Config.bRefreshAt60Hz ? 1000 : 1001) / g_Config.iForceMaxEmulatedFPS - LEEWAY_CYCLES_PER_FLIP;
lastFlipCycles = now;
nextFlipCycles = std::max(lastFlipCycles, nextFlipCycles) + expected;
}
Expand Down Expand Up @@ -1080,7 +1076,7 @@ static int sceDisplayGetAccumulatedHcount() {
}

static float sceDisplayGetFramePerSec() {
const static float framePerSec = 59.9400599f;
const static float framePerSec = g_Config.bRefreshAt60Hz ? 60.0f : 59.9400599f;
VERBOSE_LOG(SCEDISPLAY,"%f=sceDisplayGetFramePerSec()", framePerSec);
return framePerSec; // (9MHz * 1)/(525 * 286)
}
Expand Down
2 changes: 1 addition & 1 deletion UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ void OtherSettingsScreen::CreateViews() {
emulatedSpeed->SetZeroLabel(gr->T("Disabled"));
list->Add(new CheckBox(&g_Config.bShowFrameProfiler, gr->T("Display frame profiler(heavy!)")));
list->Add(new CheckBox(&g_Config.bSimpleFrameStats, gr->T("Display simple frame stats(heavy!)")));
list->Add(new CheckBox(&g_Config.bRefreshAt60Hz, gr->T("Refresh at 60Hz(might help some gpu's to avoid stutter)")));
list->Add(new CheckBox(&g_Config.bRefreshAt60Hz, gr->T("Refresh at 60Hz(gamebreaking, but might be needed for NVidia stutter)")));
}

void OtherSettingsScreen::onFinish(DialogResult result) {
Expand Down

0 comments on commit 2363ca6

Please sign in to comment.