From f9155e5ce7203ce80aaf8f510e7874c7aba59cdb Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 7 Dec 2024 16:44:44 +1000 Subject: [PATCH] Settings: Fix incorrect data type for rewind slots --- src/core/settings.cpp | 4 ++-- src/core/settings.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 486203160..a5e8bb012 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -171,8 +171,8 @@ void Settings::Load(const SettingsInterface& si, const SettingsInterface& contro enable_discord_presence = si.GetBoolValue("Main", "EnableDiscordPresence", false); rewind_enable = si.GetBoolValue("Main", "RewindEnable", false); rewind_save_frequency = si.GetFloatValue("Main", "RewindFrequency", 10.0f); - rewind_save_slots = static_cast(si.GetUIntValue("Main", "RewindSaveSlots", 10u)); - runahead_frames = static_cast(si.GetUIntValue("Main", "RunaheadFrameCount", 0u)); + rewind_save_slots = static_cast(std::min(si.GetUIntValue("Main", "RewindSaveSlots", 10u), 65535u)); + runahead_frames = static_cast(std::min(si.GetUIntValue("Main", "RunaheadFrameCount", 0u), 255u)); cpu_execution_mode = ParseCPUExecutionMode( diff --git a/src/core/settings.h b/src/core/settings.h index 2640cbc0e..418bacc25 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -91,7 +91,7 @@ struct Settings bool rewind_enable : 1 = false; float rewind_save_frequency = 10.0f; - u8 rewind_save_slots = 10; + u16 rewind_save_slots = 10; u8 runahead_frames = 0; GPURenderer gpu_renderer = DEFAULT_GPU_RENDERER;