From 005f63d45586e8f786940eeda743a60cd85373ca Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 1 Aug 2016 20:29:49 +0530 Subject: [PATCH] PCSX2-WX: Improve percentage calculation on GSFrame Calculate the percentage value using the vertical frequency fetched from counters. --- pcsx2/gui/FrameForGS.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index 47204707cc..7a9659e5e5 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -18,7 +18,7 @@ #include "GSFrame.h" #include "AppAccelerators.h" #include "AppSaveStates.h" - +#include "Counters.h" #include "GS.h" #include "MSWstuff.h" @@ -591,8 +591,7 @@ void GSFrame::OnUpdateTitle( wxTimerEvent& evt ) AppConfig::UiTemplateOptions& templates = g_Conf->Templates; double fps = wxGetApp().FpsManager.GetFramerate(); - // The "not PAL" case covers both NTSC and Progressive - float per = gsVideoMode == GS_VideoMode::PAL ? (fps * 100) / EmuConfig.GS.FrameratePAL.ToFloat() : (fps * 100) / EmuConfig.GS.FramerateNTSC.ToFloat(); + float percentage = (fps * 100) / GetVerticalFrequency().ToFloat(); char gsDest[128]; gsDest[0] = 0; // No need to set whole array to NULL. @@ -630,7 +629,7 @@ void GSFrame::OnUpdateTitle( wxTimerEvent& evt ) wxString title = templates.TitleTemplate; title.Replace(L"${slot}", pxsFmt(L"%d", States_GetCurrentSlot())); title.Replace(L"${limiter}", limiterStr); - title.Replace(L"${speed}", pxsFmt(L"%3d%%", lround(per))); + title.Replace(L"${speed}", pxsFmt(L"%3d%%", lround(percentage))); title.Replace(L"${vfps}", pxsFmt(L"%.02f", fps)); title.Replace(L"${cpuusage}", cpuUsage); title.Replace(L"${omodef}", omodef);