MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / HotkeyAdjustTargetSpeed

Function HotkeyAdjustTargetSpeed

pcsx2/Hotkeys.cpp:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29static void HotkeyAdjustTargetSpeed(double delta)
30{
31 const double min_speed = Achievements::IsHardcoreModeActive() ? 1.0 : 0.1;
32 EmuConfig.EmulationSpeed.NominalScalar = std::max(min_speed, EmuConfig.EmulationSpeed.NominalScalar + delta);
33 if (VMManager::GetLimiterMode() != LimiterModeType::Nominal)
34 VMManager::SetLimiterMode(LimiterModeType::Nominal);
35 else
36 VMManager::UpdateTargetSpeed();
37
38 Host::AddIconOSDMessage("SpeedChanged", ICON_FA_CLOCK,
39 fmt::format(TRANSLATE_FS("Hotkeys", "Target speed set to {:.0f}%."),
40 std::round(EmuConfig.EmulationSpeed.NominalScalar * 100.0)),
41 Host::OSD_QUICK_DURATION);
42}
43
44static void HotkeyAdjustVolume(const s32 delta)
45{

Callers 1

Hotkeys.cppFile · 0.85

Calls 3

maxFunction · 0.50
formatFunction · 0.50
roundFunction · 0.50

Tested by

no test coverage detected