Skip to content

Commit

Permalink
Config: Remove unused FrameLimitEnable field
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed May 4, 2024
1 parent 1b90a37 commit 58da6c4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
1 change: 0 additions & 1 deletion pcsx2/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,6 @@ struct Pcsx2Config
struct EmulationSpeedOptions
{
BITFIELD32()
bool FrameLimitEnable : 1;
bool SyncToHostRefreshRate : 1;
BITFIELD_END

Expand Down
1 change: 0 additions & 1 deletion pcsx2/Pcsx2Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,6 @@ Pcsx2Config::EmulationSpeedOptions::EmulationSpeedOptions()
{
bitset = 0;

FrameLimitEnable = true;
SyncToHostRefreshRate = false;
}

Expand Down
37 changes: 15 additions & 22 deletions pcsx2/VMManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 58da6c4

Please sign in to comment.