Fix temporary frame limit

This commit is contained in:
PabloMK7 2025-03-21 23:52:10 +01:00
parent 7920188417
commit 7e9b5743fb
3 changed files with 7 additions and 0 deletions

View File

@ -623,6 +623,10 @@ void RenameCurrentProfile(std::string new_name);
extern bool is_temporary_frame_limit;
extern double temporary_frame_limit;
static inline void ResetTemporaryFrameLimit() {
is_temporary_frame_limit = false;
temporary_frame_limit = 0;
}
static inline double GetFrameLimit() {
return is_temporary_frame_limit ? temporary_frame_limit : values.frame_limit.GetValue();
}

View File

@ -293,6 +293,7 @@ System::ResultStatus System::SingleStep() {
System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath,
Frontend::EmuWindow* secondary_window) {
Settings::ResetTemporaryFrameLimit();
FileUtil::SetCurrentRomPath(filepath);
if (early_app_loader) {
app_loader = std::move(early_app_loader);

View File

@ -1454,7 +1454,9 @@ Result SVC::KernelSetState(u32 kernel_state, u32 varg1, u32 varg2) {
u16 new_value = static_cast<u16>(varg1);
if (new_value == 0xFFFF) {
Settings::is_temporary_frame_limit = false;
Settings::temporary_frame_limit = 0;
} else {
Settings::is_temporary_frame_limit = true;
Settings::temporary_frame_limit = static_cast<double>(new_value);
}
} break;