diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 251ef7cfb6..974096d296 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -111,6 +111,9 @@ static size_t fpsHistoryPos = 0; static size_t fpsHistoryValid = 0; static int lastNumFlips = 0; static float flips = 0.0f; +static int actualFlips = 0; // taking frameskip into account +static int lastActualFlips = 0; +static float actualFps = 0; static u64 lastFlipCycles = 0; void hleEnterVblank(u64 userdata, int cyclesLate); @@ -143,6 +146,12 @@ void __DisplayInit() { curFrameTime = 0.0; nextFrameTime = 0.0; + flips = 0; + fps = 0.0; + actualFlips = 0; + lastActualFlips = 0; + lastNumFlips = 0; + fpsHistoryValid = 0; fpsHistoryPos = 0; fpsHistoryValid = 0; @@ -206,9 +215,10 @@ void __DisplayFireVblank() { } } -void __DisplayGetFPS(float *out_vps, float *out_fps) { +void __DisplayGetFPS(float *out_vps, float *out_fps, float *out_actual_fps) { *out_vps = fps; *out_fps = flips; + *out_actual_fps = actualFps; } void __DisplayGetAveragedFPS(float *out_vps, float *out_fps) { @@ -226,19 +236,21 @@ void __DisplayGetAveragedFPS(float *out_vps, float *out_fps) { *out_vps = *out_fps = avg; } -void CalculateFPS() -{ +void CalculateFPS() { time_update(); double now = time_now_d(); if (now >= lastFpsTime + 1.0) { double frames = (gpuStats.numVBlanks - lastFpsFrame); + actualFps = (actualFlips - lastActualFlips); + fps = frames / (now - lastFpsTime); flips = 60.0 * (double) (gpuStats.numFlips - lastNumFlips) / frames; lastFpsFrame = gpuStats.numVBlanks; lastNumFlips = gpuStats.numFlips; + lastActualFlips = actualFlips; lastFpsTime = now; fpsHistory[fpsHistoryPos++] = fps; @@ -427,6 +439,7 @@ void hleEnterVblank(u64 userdata, int cyclesLate) { if (coreState == CORE_RUNNING) { coreState = CORE_NEXTFRAME; gpu->CopyDisplayToOutput(); + actualFlips++; } } diff --git a/Core/HLE/sceDisplay.h b/Core/HLE/sceDisplay.h index c6d784eef0..2bec04537c 100644 --- a/Core/HLE/sceDisplay.h +++ b/Core/HLE/sceDisplay.h @@ -34,5 +34,5 @@ typedef void (*VblankCallback)(); void __DisplayListenVblank(VblankCallback callback); void __DisplayGetDebugStats(char stats[2048]); -void __DisplayGetFPS(float *out_vps, float *out_fps); +void __DisplayGetFPS(float *out_vps, float *out_fps, float *out_actual_fps); void __DisplayGetAveragedFPS(float *out_vps, float *out_fps); diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 6f38f255ac..9c7c8f82c3 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -179,6 +179,7 @@ void ControlMappingScreen::CreateViews() { mode->AddChoice("Add"); */ ScrollView *rightScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)); + rightScroll->SetScrollToTop(false); LinearLayout *rightColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)); rightScroll->Add(rightColumn); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index b3409d7e97..64bad9f6c9 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -501,17 +501,18 @@ void EmuScreen::render() { } if (g_Config.iShowFPSCounter) { - float vps, fps; - __DisplayGetFPS(&vps, &fps); + float vps, fps, actual_fps; + __DisplayGetFPS(&vps, &fps, &actual_fps); char fpsbuf[256]; switch (g_Config.iShowFPSCounter) { case 1: sprintf(fpsbuf, "Speed: %0.1f%%", vps / 60.0f * 100.0f); break; case 2: - sprintf(fpsbuf, "FPS: %0.1f", fps); break; + sprintf(fpsbuf, "FPS: %0.1f", actual_fps); break; case 3: - sprintf(fpsbuf, "Speed: %0.1f%%\nFPS: %0.1f", vps / 60.0f * 100.0f, fps); break; + sprintf(fpsbuf, "%0.1f/%0.0f (%0.1f%%)", actual_fps, fps, vps / 60.0f * 100.0f); break; } + ui_draw2d.SetFontScale(0.6f, 0.6f); ui_draw2d.DrawText(UBUNTU24, fpsbuf, dp_xres - 8, 12, 0xc0000000, ALIGN_TOPRIGHT); ui_draw2d.DrawText(UBUNTU24, fpsbuf, dp_xres - 10, 10, 0xFF3fFF3f, ALIGN_TOPRIGHT); } diff --git a/native b/native index 85d0fc61c5..ddf5c379c3 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 85d0fc61c546fc28ab351b7be18e96dbe9fc6a3e +Subproject commit ddf5c379c3b2d368031990c81f96a062dc46bee4