From 58da6c4f9d5622886dfac68055be98bee32e77a7 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 4 May 2024 23:36:54 +1000 Subject: [PATCH] Config: Remove unused FrameLimitEnable field --- pcsx2/Config.h | 1 - pcsx2/Pcsx2Config.cpp | 1 - pcsx2/VMManager.cpp | 37 +++++++++++++++---------------------- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/pcsx2/Config.h b/pcsx2/Config.h index c6094bb3267e5c..9245f5921e68c6 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -985,7 +985,6 @@ struct Pcsx2Config struct EmulationSpeedOptions { BITFIELD32() - bool FrameLimitEnable : 1; bool SyncToHostRefreshRate : 1; BITFIELD_END diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index 5ccd801a750403..7f2c93f7d8afec 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -1486,7 +1486,6 @@ Pcsx2Config::EmulationSpeedOptions::EmulationSpeedOptions() { bitset = 0; - FrameLimitEnable = true; SyncToHostRefreshRate = false; } diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index 1c98d52b6e7b23..50a56a4e9206e5 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -133,7 +133,6 @@ namespace VMManager static void SaveSessionTime(const std::string& prev_serial); static void ReloadPINE(); - static LimiterModeType GetInitialLimiterMode(); static float GetTargetSpeedForLimiterMode(LimiterModeType mode); static void ResetFrameLimiter(); static double AdjustToHostRefreshRate(float frame_rate, float target_speed); @@ -1371,7 +1370,7 @@ bool VMManager::Initialize(VMBootParameters boot_params) } } - s_limiter_mode = GetInitialLimiterMode(); + s_limiter_mode = LimiterModeType::Nominal; s_target_speed = GetTargetSpeedForLimiterMode(s_limiter_mode); s_use_vsync_for_timing = false; @@ -1980,11 +1979,6 @@ float VMManager::GetTargetSpeed() return s_target_speed; } -LimiterModeType VMManager::GetInitialLimiterMode() -{ - return EmuConfig.EmulationSpeed.FrameLimitEnable ? LimiterModeType::Nominal : LimiterModeType::Unlimited; -} - double VMManager::AdjustToHostRefreshRate(float frame_rate, float target_speed) { if (!EmuConfig.EmulationSpeed.SyncToHostRefreshRate || target_speed != 1.0f) @@ -2015,27 +2009,26 @@ double VMManager::AdjustToHostRefreshRate(float frame_rate, float target_speed) float VMManager::GetTargetSpeedForLimiterMode(LimiterModeType mode) { - if (EmuConfig.EmulationSpeed.FrameLimitEnable && (!EmuConfig.EnableFastBootFastForward || !VMManager::Internal::IsFastBootInProgress())) + if (EmuConfig.EnableFastBootFastForward && VMManager::Internal::IsFastBootInProgress()) + return 0.0f; + + switch (s_limiter_mode) { - switch (s_limiter_mode) - { - case LimiterModeType::Nominal: - return EmuConfig.EmulationSpeed.NominalScalar; + case LimiterModeType::Nominal: + return EmuConfig.EmulationSpeed.NominalScalar; - case LimiterModeType::Slomo: - return EmuConfig.EmulationSpeed.SlomoScalar; + case LimiterModeType::Slomo: + return EmuConfig.EmulationSpeed.SlomoScalar; - case LimiterModeType::Turbo: - return EmuConfig.EmulationSpeed.TurboScalar; + case LimiterModeType::Turbo: + return EmuConfig.EmulationSpeed.TurboScalar; - case LimiterModeType::Unlimited: - return 0.0f; + case LimiterModeType::Unlimited: + return 0.0f; - jNO_DEFAULT - } + default: + ASSUME(false); } - - return 0.0f; } void VMManager::UpdateTargetSpeed()