Core: Remove FPS, VPS and speed percentage from window title
This commit is contained in:
parent
8d477c65c9
commit
df6f070a55
|
@ -386,7 +386,6 @@ const Info<ShowCursor> MAIN_SHOW_CURSOR{{System::Main, "Interface", "CursorVisib
|
||||||
ShowCursor::OnMovement};
|
ShowCursor::OnMovement};
|
||||||
const Info<bool> MAIN_LOCK_CURSOR{{System::Main, "Interface", "LockCursor"}, false};
|
const Info<bool> MAIN_LOCK_CURSOR{{System::Main, "Interface", "LockCursor"}, false};
|
||||||
const Info<std::string> MAIN_INTERFACE_LANGUAGE{{System::Main, "Interface", "LanguageCode"}, ""};
|
const Info<std::string> MAIN_INTERFACE_LANGUAGE{{System::Main, "Interface", "LanguageCode"}, ""};
|
||||||
const Info<bool> MAIN_EXTENDED_FPS_INFO{{System::Main, "Interface", "ExtendedFPSInfo"}, false};
|
|
||||||
const Info<bool> MAIN_SHOW_ACTIVE_TITLE{{System::Main, "Interface", "ShowActiveTitle"}, true};
|
const Info<bool> MAIN_SHOW_ACTIVE_TITLE{{System::Main, "Interface", "ShowActiveTitle"}, true};
|
||||||
const Info<bool> MAIN_USE_BUILT_IN_TITLE_DATABASE{
|
const Info<bool> MAIN_USE_BUILT_IN_TITLE_DATABASE{
|
||||||
{System::Main, "Interface", "UseBuiltinTitleDatabase"}, true};
|
{System::Main, "Interface", "UseBuiltinTitleDatabase"}, true};
|
||||||
|
|
|
@ -237,7 +237,6 @@ extern const Info<ShowCursor> MAIN_SHOW_CURSOR;
|
||||||
|
|
||||||
extern const Info<bool> MAIN_LOCK_CURSOR;
|
extern const Info<bool> MAIN_LOCK_CURSOR;
|
||||||
extern const Info<std::string> MAIN_INTERFACE_LANGUAGE;
|
extern const Info<std::string> MAIN_INTERFACE_LANGUAGE;
|
||||||
extern const Info<bool> MAIN_EXTENDED_FPS_INFO;
|
|
||||||
extern const Info<bool> MAIN_SHOW_ACTIVE_TITLE;
|
extern const Info<bool> MAIN_SHOW_ACTIVE_TITLE;
|
||||||
extern const Info<bool> MAIN_USE_BUILT_IN_TITLE_DATABASE;
|
extern const Info<bool> MAIN_USE_BUILT_IN_TITLE_DATABASE;
|
||||||
extern const Info<std::string> MAIN_THEME_NAME;
|
extern const Info<std::string> MAIN_THEME_NAME;
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
|
||||||
|
#include <Core/Core.h>
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include "AudioCommon/AudioCommon.h"
|
#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);
|
m_title_description = title_database.Describe(m_gametdb_id, language);
|
||||||
NOTICE_LOG_FMT(CORE, "Active title: {}", m_title_description);
|
NOTICE_LOG_FMT(CORE, "Active title: {}", m_title_description);
|
||||||
Host_TitleChanged();
|
Host_TitleChanged();
|
||||||
|
if (Core::IsRunning())
|
||||||
|
{
|
||||||
|
Core::UpdateTitle();
|
||||||
|
}
|
||||||
|
|
||||||
Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision));
|
Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision));
|
||||||
Config::AddLayer(ConfigLoaders::GenerateLocalGameConfigLoader(game_id, revision));
|
Config::AddLayer(ConfigLoaders::GenerateLocalGameConfigLoader(game_id, revision));
|
||||||
|
|
|
@ -99,9 +99,6 @@ namespace Core
|
||||||
static bool s_wants_determinism;
|
static bool s_wants_determinism;
|
||||||
|
|
||||||
// Declarations and definitions
|
// Declarations and definitions
|
||||||
static Common::Timer s_timer;
|
|
||||||
static u64 s_timer_offset;
|
|
||||||
|
|
||||||
static bool s_is_stopping = false;
|
static bool s_is_stopping = false;
|
||||||
static bool s_hardware_initialized = false;
|
static bool s_hardware_initialized = false;
|
||||||
static bool s_is_started = false;
|
static bool s_is_started = false;
|
||||||
|
@ -612,6 +609,8 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||||
PowerPC::SetMode(PowerPC::CoreMode::Interpreter);
|
PowerPC::SetMode(PowerPC::CoreMode::Interpreter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateTitle();
|
||||||
|
|
||||||
// ENTER THE VIDEO THREAD LOOP
|
// ENTER THE VIDEO THREAD LOOP
|
||||||
if (system.IsDualCoreMode())
|
if (system.IsDualCoreMode())
|
||||||
{
|
{
|
||||||
|
@ -661,16 +660,11 @@ void SetState(State state)
|
||||||
CPU::EnableStepping(true); // Break
|
CPU::EnableStepping(true); // Break
|
||||||
Wiimote::Pause();
|
Wiimote::Pause();
|
||||||
ResetRumble();
|
ResetRumble();
|
||||||
s_timer_offset = s_timer.ElapsedMs();
|
|
||||||
break;
|
break;
|
||||||
case State::Running:
|
case State::Running:
|
||||||
{
|
{
|
||||||
CPU::EnableStepping(false);
|
CPU::EnableStepping(false);
|
||||||
Wiimote::Resume();
|
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;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -840,21 +834,6 @@ void RunOnCPUThread(std::function<void()> 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 ---
|
// --- Callbacks for backends / engine ---
|
||||||
|
|
||||||
// Called from Renderer::Swap (GPU thread) when a new (non-duplicate)
|
// Called from Renderer::Swap (GPU thread) when a new (non-duplicate)
|
||||||
|
@ -890,58 +869,13 @@ void Callback_NewField()
|
||||||
|
|
||||||
void UpdateTitle()
|
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
|
// Settings are shown the same for both extended and summary info
|
||||||
const std::string SSettings = fmt::format(
|
const std::string SSettings = fmt::format(
|
||||||
"{} {} | {} | {}", PowerPC::GetCPUName(),
|
"{} {} | {} | {}", PowerPC::GetCPUName(),
|
||||||
Core::System::GetInstance().IsDualCoreMode() ? "DC" : "SC", g_video_backend->GetDisplayName(),
|
Core::System::GetInstance().IsDualCoreMode() ? "DC" : "SC", g_video_backend->GetDisplayName(),
|
||||||
Config::Get(Config::MAIN_DSP_HLE) ? "HLE" : "LLE");
|
Config::Get(Config::MAIN_DSP_HLE) ? "HLE" : "LLE");
|
||||||
|
|
||||||
std::string SFPS;
|
std::string message = fmt::format("{} | {}", Common::GetScmRevStr(), SSettings);
|
||||||
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);
|
|
||||||
if (Config::Get(Config::MAIN_SHOW_ACTIVE_TITLE))
|
if (Config::Get(Config::MAIN_SHOW_ACTIVE_TITLE))
|
||||||
{
|
{
|
||||||
const std::string& title = SConfig::GetInstance().GetTitleDescription();
|
const std::string& title = SConfig::GetInstance().GetTitleDescription();
|
||||||
|
|
|
@ -124,10 +124,6 @@ void DisplayMessage(std::string message, int time_in_ms);
|
||||||
void FrameUpdateOnCPUThread();
|
void FrameUpdateOnCPUThread();
|
||||||
void OnFrameEnd();
|
void OnFrameEnd();
|
||||||
|
|
||||||
void VideoThrottle();
|
|
||||||
|
|
||||||
void UpdateTitle();
|
|
||||||
|
|
||||||
// Run a function as the CPU thread.
|
// Run a function as the CPU thread.
|
||||||
//
|
//
|
||||||
// If called from the Host thread, the CPU thread is paused and the current thread temporarily
|
// 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 UpdateInputGate(bool require_focus, bool require_full_focus = false);
|
||||||
|
|
||||||
|
void UpdateTitle();
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
#include "Common/Config/Config.h"
|
#include "Common/Config/Config.h"
|
||||||
#include "Common/Logging/Log.h"
|
#include "Common/Logging/Log.h"
|
||||||
|
|
||||||
|
#include "VideoCommon/PerformanceMetrics.h"
|
||||||
|
|
||||||
#include "Core/Config/GraphicsSettings.h"
|
#include "Core/Config/GraphicsSettings.h"
|
||||||
#include "Core/Config/MainSettings.h"
|
#include "Core/Config/MainSettings.h"
|
||||||
#include "Core/Config/SYSCONFSettings.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))
|
if (!Config::Get(Config::GFX_HACK_EARLY_XFB_OUTPUT))
|
||||||
OutputField(field, ticks);
|
OutputField(field, ticks);
|
||||||
|
|
||||||
Core::VideoThrottle();
|
g_perf_metrics.CountVBlank();
|
||||||
Core::OnFrameEnd();
|
Core::OnFrameEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue