diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index c457dbddd2..a3f27ea015 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -142,6 +142,7 @@ set(pcsx2Sources Patch.cpp Patch_Memory.cpp Pcsx2Config.cpp + PerformanceMetrics.cpp PrecompiledHeader.cpp R3000A.cpp R3000AInterpreter.cpp @@ -214,6 +215,7 @@ set(pcsx2Headers Patch.h PathDefs.h PCSX2Base.h + PerformanceMetrics.h PrecompiledHeader.h R3000A.h R5900Exceptions.h @@ -907,7 +909,6 @@ set(pcsx2GuiSources gui/AppRes.cpp gui/CheckedStaticBox.cpp gui/ConsoleLogger.cpp - gui/CpuUsageProvider.cpp gui/Dialogs/AboutBoxDialog.cpp gui/Dialogs/GSDumpDialog.cpp gui/Dialogs/AssertionDialog.cpp @@ -981,7 +982,6 @@ set(pcsx2GuiHeaders gui/AppSaveStates.h gui/CheckedStaticBox.h gui/ConsoleLogger.h - gui/CpuUsageProvider.h gui/Debugger/BreakpointWindow.h gui/Debugger/CtrlDisassemblyView.h gui/Debugger/CtrlMemView.h diff --git a/pcsx2/Counters.cpp b/pcsx2/Counters.cpp index 44ff9f2c76..b643319561 100644 --- a/pcsx2/Counters.cpp +++ b/pcsx2/Counters.cpp @@ -27,6 +27,7 @@ #include "GS.h" #include "VUmicro.h" +#include "PerformanceMetrics.h" #include "ps2/HwInternal.h" #include "Sio.h" @@ -400,6 +401,8 @@ u32 UpdateVSyncRate() cpuRcntSet(); } + PerformanceMetrics::SetVerticalFrequency(vertical_frequency); + if (m_iTicks != ticks) m_iTicks = ticks; diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 9f20fd02e9..79c4451236 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -23,6 +23,7 @@ #include "Gif_Unit.h" #include "MTVU.h" #include "Elfheader.h" +#include "PerformanceMetrics.h" #include "gui/Dialogs/ModalPopups.h" #include "common/WindowInfo.h" @@ -134,6 +135,7 @@ SysMtgsThread::~SysMtgsThread() void SysMtgsThread::OnResumeReady() { + PerformanceMetrics::Reset(); m_sem_OpenDone.Reset(); } @@ -478,6 +480,8 @@ void SysMtgsThread::ExecuteTaskInThread() if (m_VsyncSignalListener.exchange(false)) m_sem_Vsync.Post(); + PerformanceMetrics::Update(); + // Do not StateCheckInThread() here // Otherwise we could pause while there's still data in the queue // Which could make the MTVU thread wait forever for it to empty diff --git a/pcsx2/PerformanceMetrics.cpp b/pcsx2/PerformanceMetrics.cpp new file mode 100644 index 0000000000..718285a320 --- /dev/null +++ b/pcsx2/PerformanceMetrics.cpp @@ -0,0 +1,188 @@ +/* PCSX2 - PS2 Emulator for PCs + * Copyright (C) 2002-2021 PCSX2 Dev Team + * + * PCSX2 is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with PCSX2. + * If not, see . + */ + +#include "PrecompiledHeader.h" + +#include + +#include "PerformanceMetrics.h" +#include "System.h" +#include "System/SysThreads.h" + +#include "GS.h" +#include "MTVU.h" + +static const float UPDATE_INTERVAL = 0.5f; + +static float s_vertical_frequency = 0.0f; +static float s_fps = 0.0f; +static float s_worst_frame_time = 0.0f; +static float s_average_frame_time = 0.0f; +static float s_average_frame_time_accumulator = 0.0f; +static float s_worst_frame_time_accumulator = 0.0f; +static u32 s_frames_since_last_update = 0; +static Common::Timer s_last_update_time; +static Common::Timer s_last_frame_time; + +static Common::ThreadCPUTimer s_cpu_thread_timer; +static u64 s_last_gs_time = 0; +static u64 s_last_vu_time = 0; +static u64 s_last_ticks = 0; + +static double s_cpu_thread_usage = 0.0f; +static double s_cpu_thread_time = 0.0f; +static float s_gs_thread_usage = 0.0f; +static float s_gs_thread_time = 0.0f; +static float s_vu_thread_usage = 0.0f; +static float s_vu_thread_time = 0.0f; + +void PerformanceMetrics::Clear() +{ + Reset(); + + s_fps = 0.0f; + s_worst_frame_time = 0.0f; + s_average_frame_time = 0.0f; + + s_cpu_thread_usage = 0.0f; + s_cpu_thread_time = 0.0f; + s_gs_thread_usage = 0.0f; + s_gs_thread_time = 0.0f; + s_vu_thread_usage = 0.0f; + s_vu_thread_time = 0.0f; +} + +void PerformanceMetrics::Reset() +{ + s_average_frame_time_accumulator = 0.0f; + s_worst_frame_time_accumulator = 0.0f; + + s_last_update_time.Reset(); + s_last_frame_time.Reset(); + + s_cpu_thread_timer.Reset(); + s_last_gs_time = GetMTGS().GetCpuTime(); + s_last_vu_time = THREAD_VU1 ? vu1Thread.GetCpuTime() : 0; + s_last_ticks = GetCPUTicks(); +} + +void PerformanceMetrics::Update() +{ + const float frame_time = s_last_frame_time.GetTimeMillisecondsAndReset(); + s_average_frame_time_accumulator += frame_time; + s_worst_frame_time_accumulator = std::max(s_worst_frame_time_accumulator, frame_time); + s_frames_since_last_update++; + + const Common::Timer::Value now_ticks = Common::Timer::GetCurrentValue(); + const Common::Timer::Value ticks_diff = now_ticks - s_last_update_time.GetStartValue(); + const float time = Common::Timer::ConvertValueToSeconds(ticks_diff); + if (time < UPDATE_INTERVAL) + return; + + s_worst_frame_time = s_worst_frame_time_accumulator; + s_worst_frame_time_accumulator = 0.0f; + s_average_frame_time = s_average_frame_time_accumulator / static_cast(s_frames_since_last_update); + s_average_frame_time_accumulator = 0.0f; + s_fps = static_cast(s_frames_since_last_update) / time; + + s_cpu_thread_timer.GetUsageInMillisecondsAndReset(ticks_diff, &s_cpu_thread_time, &s_cpu_thread_usage); + s_cpu_thread_time /= static_cast(s_frames_since_last_update); + + const u64 gs_time = GetMTGS().GetCpuTime(); + const u64 vu_time = THREAD_VU1 ? vu1Thread.GetCpuTime() : 0; + const u64 ticks = GetCPUTicks(); + + const u64 gs_delta = gs_time - s_last_gs_time; + const u64 vu_delta = vu_time - s_last_vu_time; + const u64 ticks_delta = ticks - s_last_ticks; + + const double pct_divider = + 100.0 * (1.0 / ((static_cast(ticks_delta) * static_cast(GetThreadTicksPerSecond())) / + static_cast(GetTickFrequency()))); + const double time_divider = 1000.0 * (1.0 / static_cast(GetThreadTicksPerSecond())) * + (1.0 / static_cast(s_frames_since_last_update)); + + s_gs_thread_usage = static_cast(gs_delta) * pct_divider; + s_vu_thread_usage = static_cast(vu_delta) * pct_divider; + s_gs_thread_time = static_cast(gs_delta) * time_divider; + s_vu_thread_time = static_cast(vu_delta) * time_divider; + + s_last_gs_time = gs_time; + s_last_vu_time = vu_time; + s_last_ticks = ticks; + + s_last_update_time.ResetTo(now_ticks); + s_frames_since_last_update = 0; +} + +void PerformanceMetrics::SetCPUThreadTimer(Common::ThreadCPUTimer timer) +{ + s_cpu_thread_timer = std::move(timer); +} + +void PerformanceMetrics::SetVerticalFrequency(float rate) +{ + s_vertical_frequency = rate; +} + +float PerformanceMetrics::GetFPS() +{ + return s_fps; +} + +float PerformanceMetrics::GetSpeed() +{ + return (s_fps / s_vertical_frequency) * 100.0; +} + +float PerformanceMetrics::GetAverageFrameTime() +{ + return s_average_frame_time; +} + +float PerformanceMetrics::GetWorstFrameTime() +{ + return s_worst_frame_time; +} + +double PerformanceMetrics::GetCPUThreadUsage() +{ + return s_cpu_thread_usage; +} + +double PerformanceMetrics::GetCPUThreadAverageTime() +{ + return s_cpu_thread_time; +} + +float PerformanceMetrics::GetGSThreadUsage() +{ + return s_gs_thread_usage; +} + +float PerformanceMetrics::GetGSThreadAverageTime() +{ + return s_gs_thread_time; +} + +float PerformanceMetrics::GetVUThreadUsage() +{ + return s_vu_thread_usage; +} + +float PerformanceMetrics::GetVUThreadAverageTime() +{ + return s_vu_thread_time; +} diff --git a/pcsx2/PerformanceMetrics.h b/pcsx2/PerformanceMetrics.h new file mode 100644 index 0000000000..1500a70370 --- /dev/null +++ b/pcsx2/PerformanceMetrics.h @@ -0,0 +1,42 @@ +/* PCSX2 - PS2 Emulator for PCs + * Copyright (C) 2002-2021 PCSX2 Dev Team + * + * PCSX2 is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with PCSX2. + * If not, see . + */ + +#pragma once +#include "common/Timer.h" + +namespace PerformanceMetrics +{ + void Clear(); + void Reset(); + void Update(); + + /// Sets the EE thread for CPU usage calculations. + void SetCPUThreadTimer(Common::ThreadCPUTimer timer); + + /// Sets the vertical frequency, used in speed calculations. + void SetVerticalFrequency(float rate); + + float GetFPS(); + float GetSpeed(); + float GetAverageFrameTime(); + float GetWorstFrameTime(); + + double GetCPUThreadUsage(); + double GetCPUThreadAverageTime(); + float GetGSThreadUsage(); + float GetGSThreadAverageTime(); + float GetVUThreadUsage(); + float GetVUThreadAverageTime(); +} // namespace PerformanceMetrics \ No newline at end of file diff --git a/pcsx2/System/SysCoreThread.cpp b/pcsx2/System/SysCoreThread.cpp index 3d89e1c2e3..3f4a93c253 100644 --- a/pcsx2/System/SysCoreThread.cpp +++ b/pcsx2/System/SysCoreThread.cpp @@ -19,6 +19,7 @@ #include "IopBios.h" #include "R5900.h" +#include "common/Timer.h" #include "common/WindowInfo.h" extern WindowInfo g_gs_window_info; @@ -35,6 +36,7 @@ extern WindowInfo g_gs_window_info; #include "USB/USB.h" #include "MemoryCardFile.h" #include "PAD/Gamepad.h" +#include "PerformanceMetrics.h" #include "DebugTools/MIPSAnalyst.h" #include "DebugTools/SymbolMap.h" @@ -317,10 +319,14 @@ void SysCoreThread::TearDownSystems(SystemsMask systemsToTearDown) if (systemsToTearDown & System_PAD) PADclose(); if (systemsToTearDown & System_SPU2) SPU2close(); if (systemsToTearDown & System_MCD) FileMcd_EmuClose(); + + PerformanceMetrics::SetCPUThreadTimer(Common::ThreadCPUTimer()); } void SysCoreThread::OnResumeInThread(SystemsMask systemsToReinstate) { + PerformanceMetrics::SetCPUThreadTimer(Common::ThreadCPUTimer::GetForCallingThread()); + GetMTGS().WaitForOpen(); if (systemsToReinstate & System_DEV9) DEV9open(); if (systemsToReinstate & System_USB) USBopen(g_gs_window_info); diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index ea4b5625e9..ff2a620b47 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -284,29 +284,6 @@ public: virtual ~pxAppResources(); }; -// -------------------------------------------------------------------------------------- -// FramerateManager -// -------------------------------------------------------------------------------------- -class FramerateManager -{ -public: - static const uint FramerateQueueDepth = 64; - -protected: - u64 m_fpsqueue[FramerateQueueDepth]; - int m_fpsqueue_writepos; - uint m_initpause; - -public: - FramerateManager() { Reset(); } - virtual ~FramerateManager() = default; - - void Reset(); - void Resume(); - void DoFrame(); - double GetFramerate() const; -}; - class StartupOptions { public: @@ -474,7 +451,6 @@ protected: Threading::Mutex m_mtx_LoadingGameDB; public: - FramerateManager FpsManager; std::unique_ptr GlobalCommands; std::unique_ptr GlobalAccels; diff --git a/pcsx2/gui/AppEventSources.cpp b/pcsx2/gui/AppEventSources.cpp index 1ec397eb77..ae59314381 100644 --- a/pcsx2/gui/AppEventSources.cpp +++ b/pcsx2/gui/AppEventSources.cpp @@ -95,23 +95,6 @@ void Pcsx2App::DispatchEvent( AppEventType evt ) void Pcsx2App::DispatchEvent( CoreThreadStatus evt ) { - switch( evt ) - { - case CoreThread_Indeterminate: - break; - - case CoreThread_Started: - case CoreThread_Reset: - case CoreThread_Stopped: - FpsManager.Reset(); - break; - - case CoreThread_Resumed: - case CoreThread_Suspended: - FpsManager.Resume(); - break; - } - // Clear the sticky key statuses, because hell knows what'll change while PAD // is suspended. diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 7657bd256a..1e3a904e35 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -354,44 +354,6 @@ wxAppTraits* Pcsx2App::CreateTraits() return new Pcsx2AppTraits; } -// -------------------------------------------------------------------------------------- -// FramerateManager (implementations) -// -------------------------------------------------------------------------------------- -void FramerateManager::Reset() -{ - //memzero( m_fpsqueue ); - m_initpause = FramerateQueueDepth; - m_fpsqueue_writepos = 0; - - for( uint i=0; i 1 ) --m_initpause; -} - -double FramerateManager::GetFramerate() const -{ - if( m_initpause > (FramerateQueueDepth/2) ) return 0.0; - const u64 delta = m_fpsqueue[m_fpsqueue_writepos] - m_fpsqueue[(m_fpsqueue_writepos + 1) % FramerateQueueDepth]; - const u32 ticks_per_frame = (u32)(delta / (FramerateQueueDepth-m_initpause)); - return (double)GetTickFrequency() / (double)ticks_per_frame; -} - // ---------------------------------------------------------------------------- // Pcsx2App Event Handlers // ---------------------------------------------------------------------------- @@ -412,8 +374,6 @@ void Pcsx2App::LogicalVsync() // Update / Calculate framerate! - FpsManager.DoFrame(); - if (EmuConfig.GS.FMVAspectRatioSwitch != FMVAspectRatioSwitchType::Off) { if (EnableFMV) { DevCon.Warning("FMV on"); diff --git a/pcsx2/gui/CpuUsageProvider.cpp b/pcsx2/gui/CpuUsageProvider.cpp deleted file mode 100644 index d5db2b1dbd..0000000000 --- a/pcsx2/gui/CpuUsageProvider.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2021 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#include "PrecompiledHeader.h" - -#include "CpuUsageProvider.h" -#include "System.h" - -#ifndef __POSIX__ -#include "System/SysThreads.h" -#endif - -#include "GS.h" -#include "MTVU.h" - -void AllPCSX2Threads::LoadWithCurrentTimes() -{ - ee = GetCoreThread().GetCpuTime(); - gs = GetMTGS().GetCpuTime(); - vu = vu1Thread.GetCpuTime(); - ui = GetThreadCpuTime(); - update = GetCPUTicks(); -} - -AllPCSX2Threads AllPCSX2Threads::operator-( const AllPCSX2Threads& right ) const -{ - AllPCSX2Threads retval; - - retval.ee = ee - right.ee; - retval.gs = gs - right.gs; - retval.vu = vu - right.vu; - retval.ui = ui - right.ui; - retval.update = update - right.update; - - return retval; -} - -CpuUsageProvider::CpuUsageProvider() -{ - m_pct_ee = 0; - m_pct_gs = 0; - m_pct_vu = 0; - m_pct_ui = 0; - m_writepos = 0; - - Reset(); -} - -void CpuUsageProvider::Reset() -{ - for( uint i=0; i. - */ - -#pragma once - -#include "AppEventListeners.h" -#include - -class BaseCpuUsageProvider -{ -public: - BaseCpuUsageProvider() {} - virtual ~BaseCpuUsageProvider() = default; - - virtual bool IsImplemented() const=0; - virtual void UpdateStats()=0; - virtual int GetEEcorePct() const=0; - virtual int GetGsPct() const=0; - virtual int GetVUPct() const=0; - virtual int GetGuiPct() const=0; -}; - -struct AllPCSX2Threads -{ - u64 ee, gs, vu, ui; - u64 update; - - void LoadWithCurrentTimes(); - AllPCSX2Threads operator-( const AllPCSX2Threads& right ) const; -}; - -class CpuUsageProvider : - public BaseCpuUsageProvider, - public EventListener_CoreThread -{ -public: - static const uint QueueDepth = 4; - -protected: - AllPCSX2Threads m_queue[QueueDepth]; - - uint m_writepos; - u32 m_pct_ee; - u32 m_pct_gs; - u32 m_pct_vu; - u32 m_pct_ui; - -public: - CpuUsageProvider(); - virtual ~CpuUsageProvider() = default; - - bool IsImplemented() const; - void Reset(); - void UpdateStats(); - int GetEEcorePct() const; - int GetGsPct() const; - int GetVUPct() const; - int GetGuiPct() const; - -protected: - void CoreThread_OnResumed() { Reset(); } -}; diff --git a/pcsx2/gui/Dialogs/GSDumpDialog.cpp b/pcsx2/gui/Dialogs/GSDumpDialog.cpp index 13e7f1682b..7cfe813843 100644 --- a/pcsx2/gui/Dialogs/GSDumpDialog.cpp +++ b/pcsx2/gui/Dialogs/GSDumpDialog.cpp @@ -29,6 +29,7 @@ #include "gui/AppConfig.h" #include "gui/GSFrame.h" #include "Counters.h" +#include "PerformanceMetrics.h" #include #include @@ -656,7 +657,7 @@ void Dialogs::GSDumpDialog::ProcessDumpEvent(const GSData& event, char* regs) g_FrameCount++; Pcsx2App* app = (Pcsx2App*)wxApp::GetInstance(); if (app) - app->FpsManager.DoFrame(); + PerformanceMetrics::Update(); break; } case ReadFIFO2: @@ -769,7 +770,7 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() GSFrame* window = nullptr; if (app) { - app->FpsManager.Reset(); + PerformanceMetrics::Reset(); window = app->GetGsFramePtr(); g_FrameCount = 0; } diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index 8b3955d0b5..3d1638ca2b 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -24,6 +24,7 @@ #include "MainFrame.h" #include "MSWstuff.h" #include "PAD/Gamepad.h" +#include "PerformanceMetrics.h" #include "gui/Dialogs/ModalPopups.h" @@ -859,32 +860,23 @@ void GSFrame::OnUpdateTitle( wxTimerEvent& evt ) if (g_FrameCount == 0) return; - double fps = wxGetApp().FpsManager.GetFramerate(); - FastFormatUnicode cpuUsage; - if (m_CpuUsage.IsImplemented()) { - m_CpuUsage.UpdateStats(); - - if (!IsFullScreen()) { - cpuUsage.Write(L"EE: %3d%%", m_CpuUsage.GetEEcorePct()); - cpuUsage.Write(L" | GS: %3d%%", m_CpuUsage.GetGsPct()); - - if (THREAD_VU1) - cpuUsage.Write(L" | VU: %3d%%", m_CpuUsage.GetVUPct()); - - pxNonReleaseCode(cpuUsage.Write(L" | UI: %3d%%", m_CpuUsage.GetGuiPct())); - } + if (!IsFullScreen()) { + cpuUsage.Write(L"EE: %3.0f%%", PerformanceMetrics::GetCPUThreadUsage()); + cpuUsage.Write(L" | GS: %3.0f%%", PerformanceMetrics::GetGSThreadUsage()); if (THREAD_VU1) - OSDmonitor(Color_StrongGreen, "VU:", std::to_string(m_CpuUsage.GetVUPct()).c_str()); - - OSDmonitor(Color_StrongGreen, "EE:", std::to_string(m_CpuUsage.GetEEcorePct()).c_str()); - OSDmonitor(Color_StrongGreen, "GS:", std::to_string(m_CpuUsage.GetGsPct()).c_str()); - pxNonReleaseCode(OSDmonitor(Color_StrongGreen, "UI:", std::to_string(m_CpuUsage.GetGuiPct()).c_str())); + { + cpuUsage.Write(L" | VU: %3.0f%%", PerformanceMetrics::GetVUThreadUsage()); + OSDmonitor(Color_StrongGreen, "VU:", std::to_string(lround(PerformanceMetrics::GetVUThreadUsage())).c_str()); + } + + OSDmonitor(Color_StrongGreen, "EE:", std::to_string(lround(PerformanceMetrics::GetCPUThreadUsage())).c_str()); + OSDmonitor(Color_StrongGreen, "GS:", std::to_string(lround(PerformanceMetrics::GetGSThreadUsage())).c_str()); } std::ostringstream out; - out << std::fixed << std::setprecision(2) << fps; + out << std::fixed << std::setprecision(2) << PerformanceMetrics::GetFPS(); OSDmonitor(Color_StrongGreen, "FPS:", out.str()); #ifdef __linux__ @@ -895,8 +887,6 @@ void GSFrame::OnUpdateTitle( wxTimerEvent& evt ) AppConfig::UiTemplateOptions& templates = g_Conf->Templates; - const float percentage = (fps * 100) / GetVerticalFrequency(); - char gsDest[128]; gsDest[0] = 0; // No need to set whole array to NULL. GSgetTitleInfo2( gsDest, sizeof(gsDest) ); @@ -934,8 +924,8 @@ void GSFrame::OnUpdateTitle( wxTimerEvent& evt ) title.Replace(L"${slot}", pxsFmt(L"%d", States_GetCurrentSlot())); title.Replace(L"${limiter}", limiterStr); - title.Replace(L"${speed}", pxsFmt(L"%3d%%", lround(percentage))); - title.Replace(L"${vfps}", pxsFmt(L"%.02f", fps)); + title.Replace(L"${speed}", pxsFmt(L"%3d%%", lround(PerformanceMetrics::GetSpeed()))); + title.Replace(L"${vfps}", pxsFmt(L"%.02f", PerformanceMetrics::GetFPS())); title.Replace(L"${cpuusage}", cpuUsage); title.Replace(L"${omodef}", omodef); title.Replace(L"${omodei}", omodei); diff --git a/pcsx2/gui/GSFrame.h b/pcsx2/gui/GSFrame.h index e141f53d15..c7d87a6899 100644 --- a/pcsx2/gui/GSFrame.h +++ b/pcsx2/gui/GSFrame.h @@ -17,7 +17,6 @@ #pragma once #include "AppCommon.h" -#include "CpuUsageProvider.h" #include "common/WindowInfo.h" #include #include @@ -106,8 +105,6 @@ protected: wxWindowID m_id_gspanel; wxStatusBar* m_statusbar; - CpuUsageProvider m_CpuUsage; - public: GSFrame( const wxString& title); virtual ~GSFrame() = default; diff --git a/pcsx2/pcsx2.vcxproj b/pcsx2/pcsx2.vcxproj index 6600f4ddf5..6c3b758a76 100644 --- a/pcsx2/pcsx2.vcxproj +++ b/pcsx2/pcsx2.vcxproj @@ -352,6 +352,7 @@ + @@ -647,7 +648,6 @@ - @@ -791,6 +791,7 @@ + @@ -1076,7 +1077,6 @@ - @@ -1169,4 +1169,4 @@ - + \ No newline at end of file diff --git a/pcsx2/pcsx2.vcxproj.filters b/pcsx2/pcsx2.vcxproj.filters index 9eddddb008..800b5269c8 100644 --- a/pcsx2/pcsx2.vcxproj.filters +++ b/pcsx2/pcsx2.vcxproj.filters @@ -746,9 +746,6 @@ AppHost - - AppHost - AppHost @@ -1646,6 +1643,10 @@ AppHost + + + System + @@ -1966,9 +1967,6 @@ AppHost\Include - - AppHost\Include - AppHost\Include @@ -2752,6 +2750,9 @@ System\Ps2\PAD + + System +