diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp index c3f1456f60..7e64329ee9 100644 --- a/Source/Core/Core/Config/MainSettings.cpp +++ b/Source/Core/Core/Config/MainSettings.cpp @@ -386,7 +386,6 @@ const Info MAIN_SHOW_CURSOR{{System::Main, "Interface", "CursorVisib ShowCursor::OnMovement}; const Info MAIN_LOCK_CURSOR{{System::Main, "Interface", "LockCursor"}, false}; const Info MAIN_INTERFACE_LANGUAGE{{System::Main, "Interface", "LanguageCode"}, ""}; -const Info MAIN_EXTENDED_FPS_INFO{{System::Main, "Interface", "ExtendedFPSInfo"}, false}; const Info MAIN_SHOW_ACTIVE_TITLE{{System::Main, "Interface", "ShowActiveTitle"}, true}; const Info MAIN_USE_BUILT_IN_TITLE_DATABASE{ {System::Main, "Interface", "UseBuiltinTitleDatabase"}, true}; diff --git a/Source/Core/Core/Config/MainSettings.h b/Source/Core/Core/Config/MainSettings.h index d6a8d058f5..1ace1fa95c 100644 --- a/Source/Core/Core/Config/MainSettings.h +++ b/Source/Core/Core/Config/MainSettings.h @@ -237,7 +237,6 @@ extern const Info MAIN_SHOW_CURSOR; extern const Info MAIN_LOCK_CURSOR; extern const Info MAIN_INTERFACE_LANGUAGE; -extern const Info MAIN_EXTENDED_FPS_INFO; extern const Info MAIN_SHOW_ACTIVE_TITLE; extern const Info MAIN_USE_BUILT_IN_TITLE_DATABASE; extern const Info MAIN_THEME_NAME; diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 497d938f76..564054a998 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -12,6 +12,8 @@ #include #include +#include + #include #include "AudioCommon/AudioCommon.h" @@ -177,6 +179,10 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::stri m_title_description = title_database.Describe(m_gametdb_id, language); NOTICE_LOG_FMT(CORE, "Active title: {}", m_title_description); Host_TitleChanged(); + if (Core::IsRunning()) + { + Core::UpdateTitle(); + } Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision)); Config::AddLayer(ConfigLoaders::GenerateLocalGameConfigLoader(game_id, revision)); diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 176e6ed2d5..7757414834 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -99,9 +99,6 @@ namespace Core static bool s_wants_determinism; // Declarations and definitions -static Common::Timer s_timer; -static u64 s_timer_offset; - static bool s_is_stopping = false; static bool s_hardware_initialized = false; static bool s_is_started = false; @@ -612,6 +609,8 @@ static void EmuThread(std::unique_ptr boot, WindowSystemInfo wsi PowerPC::SetMode(PowerPC::CoreMode::Interpreter); } + UpdateTitle(); + // ENTER THE VIDEO THREAD LOOP if (system.IsDualCoreMode()) { @@ -661,16 +660,11 @@ void SetState(State state) CPU::EnableStepping(true); // Break Wiimote::Pause(); ResetRumble(); - s_timer_offset = s_timer.ElapsedMs(); break; case State::Running: { CPU::EnableStepping(false); Wiimote::Resume(); - // Restart timer, accounting for time that had elapsed between previous s_timer.Start() and - // emulator pause - s_timer.StartWithOffset(s_timer_offset); - s_timer_offset = 0; break; } default: @@ -840,21 +834,6 @@ void RunOnCPUThread(std::function function, bool wait_for_completion) } } -// Display FPS info -// This should only be called from VI -void VideoThrottle() -{ - g_perf_metrics.CountVBlank(); - - // Update info per second - u64 elapsed_ms = s_timer.ElapsedMs(); - if ((elapsed_ms >= 500) || s_frame_step) - { - s_timer.Start(); - UpdateTitle(); - } -} - // --- Callbacks for backends / engine --- // Called from Renderer::Swap (GPU thread) when a new (non-duplicate) @@ -890,58 +869,13 @@ void Callback_NewField() void UpdateTitle() { - const double FPS = g_perf_metrics.GetFPS(); - const double VPS = g_perf_metrics.GetVPS(); - const double Speed = 100.0 * g_perf_metrics.GetSpeed(); - // Settings are shown the same for both extended and summary info const std::string SSettings = fmt::format( "{} {} | {} | {}", PowerPC::GetCPUName(), Core::System::GetInstance().IsDualCoreMode() ? "DC" : "SC", g_video_backend->GetDisplayName(), Config::Get(Config::MAIN_DSP_HLE) ? "HLE" : "LLE"); - std::string SFPS; - if (Movie::IsPlayingInput()) - { - SFPS = fmt::format("Input: {}/{} - VI: {}/{} - FPS: {:.0f} - VPS: {:.0f} - {:.0f}%", - Movie::GetCurrentInputCount(), Movie::GetTotalInputCount(), - Movie::GetCurrentFrame(), Movie::GetTotalFrames(), FPS, VPS, Speed); - } - else if (Movie::IsRecordingInput()) - { - SFPS = fmt::format("Input: {} - VI: {} - FPS: {:.0f} - VPS: {:.0f} - {:.0f}%", - Movie::GetCurrentInputCount(), Movie::GetCurrentFrame(), FPS, VPS, Speed); - } - else - { - SFPS = fmt::format("FPS: {:.0f} - VPS: {:.0f} - {:.0f}%", FPS, VPS, Speed); - if (Config::Get(Config::MAIN_EXTENDED_FPS_INFO)) - { - // Use extended or summary information. The summary information does not print the ticks data, - // that's more of a debugging interest, it can always be optional of course if someone is - // interested. - static u64 ticks = 0; - static u64 idleTicks = 0; - auto& core_timing = Core::System::GetInstance().GetCoreTiming(); - u64 newTicks = core_timing.GetTicks(); - u64 newIdleTicks = core_timing.GetIdleTicks(); - - u64 diff = (newTicks - ticks) / 1000000; - u64 idleDiff = (newIdleTicks - idleTicks) / 1000000; - - ticks = newTicks; - idleTicks = newIdleTicks; - - float TicksPercentage = - (float)diff / (float)(SystemTimers::GetTicksPerSecond() / 1000000) * 100; - - SFPS += fmt::format(" | CPU: ~{} MHz [Real: {} + IdleSkip: {}] / {} MHz (~{:3.0f}%)", diff, - diff - idleDiff, idleDiff, SystemTimers::GetTicksPerSecond() / 1000000, - TicksPercentage); - } - } - - std::string message = fmt::format("{} | {} | {}", Common::GetScmRevStr(), SSettings, SFPS); + std::string message = fmt::format("{} | {}", Common::GetScmRevStr(), SSettings); if (Config::Get(Config::MAIN_SHOW_ACTIVE_TITLE)) { const std::string& title = SConfig::GetInstance().GetTitleDescription(); diff --git a/Source/Core/Core/Core.h b/Source/Core/Core/Core.h index 89aad7d2de..9c01145e39 100644 --- a/Source/Core/Core/Core.h +++ b/Source/Core/Core/Core.h @@ -124,10 +124,6 @@ void DisplayMessage(std::string message, int time_in_ms); void FrameUpdateOnCPUThread(); void OnFrameEnd(); -void VideoThrottle(); - -void UpdateTitle(); - // Run a function as the CPU thread. // // If called from the Host thread, the CPU thread is paused and the current thread temporarily @@ -171,4 +167,6 @@ void DoFrameStep(); void UpdateInputGate(bool require_focus, bool require_full_focus = false); +void UpdateTitle(); + } // namespace Core diff --git a/Source/Core/Core/HW/VideoInterface.cpp b/Source/Core/Core/HW/VideoInterface.cpp index cb5b6bcfa2..8aa9c2b542 100644 --- a/Source/Core/Core/HW/VideoInterface.cpp +++ b/Source/Core/Core/HW/VideoInterface.cpp @@ -13,6 +13,8 @@ #include "Common/Config/Config.h" #include "Common/Logging/Log.h" +#include "VideoCommon/PerformanceMetrics.h" + #include "Core/Config/GraphicsSettings.h" #include "Core/Config/MainSettings.h" #include "Core/Config/SYSCONFSettings.h" @@ -872,7 +874,7 @@ static void EndField(FieldType field, u64 ticks) if (!Config::Get(Config::GFX_HACK_EARLY_XFB_OUTPUT)) OutputField(field, ticks); - Core::VideoThrottle(); + g_perf_metrics.CountVBlank(); Core::OnFrameEnd(); }