diff options
| -rw-r--r-- | src/common/settings.cpp | 8 | ||||
| -rw-r--r-- | src/common/settings.h | 4 | ||||
| -rw-r--r-- | src/core/core.cpp | 10 | ||||
| -rw-r--r-- | src/core/core.h | 10 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | 2 | ||||
| -rw-r--r-- | src/core/perf_stats.cpp | 20 | ||||
| -rw-r--r-- | src/core/perf_stats.h | 6 | ||||
| -rw-r--r-- | src/core/telemetry_session.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_base.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 46 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.ui | 4 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 18 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 6 |
16 files changed, 77 insertions, 77 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index bf5514386..b880e1f9a 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -48,8 +48,8 @@ void LogSettings() { | |||
| 48 | log_setting("Core_UseMultiCore", values.use_multi_core.GetValue()); | 48 | log_setting("Core_UseMultiCore", values.use_multi_core.GetValue()); |
| 49 | log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue()); | 49 | log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue()); |
| 50 | log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue()); | 50 | log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue()); |
| 51 | log_setting("Renderer_UseFrameLimit", values.use_frame_limit.GetValue()); | 51 | log_setting("Renderer_UseSpeedLimit", values.use_speed_limit.GetValue()); |
| 52 | log_setting("Renderer_FrameLimit", values.frame_limit.GetValue()); | 52 | log_setting("Renderer_SpeedLimit", values.speed_limit.GetValue()); |
| 53 | log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue()); | 53 | log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue()); |
| 54 | log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue()); | 54 | log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue()); |
| 55 | log_setting("Renderer_UseAsynchronousGpuEmulation", | 55 | log_setting("Renderer_UseAsynchronousGpuEmulation", |
| @@ -132,8 +132,8 @@ void RestoreGlobalState(bool is_powered_on) { | |||
| 132 | values.vulkan_device.SetGlobal(true); | 132 | values.vulkan_device.SetGlobal(true); |
| 133 | values.aspect_ratio.SetGlobal(true); | 133 | values.aspect_ratio.SetGlobal(true); |
| 134 | values.max_anisotropy.SetGlobal(true); | 134 | values.max_anisotropy.SetGlobal(true); |
| 135 | values.use_frame_limit.SetGlobal(true); | 135 | values.use_speed_limit.SetGlobal(true); |
| 136 | values.frame_limit.SetGlobal(true); | 136 | values.speed_limit.SetGlobal(true); |
| 137 | values.use_disk_shader_cache.SetGlobal(true); | 137 | values.use_disk_shader_cache.SetGlobal(true); |
| 138 | values.gpu_accuracy.SetGlobal(true); | 138 | values.gpu_accuracy.SetGlobal(true); |
| 139 | values.use_asynchronous_gpu_emulation.SetGlobal(true); | 139 | values.use_asynchronous_gpu_emulation.SetGlobal(true); |
diff --git a/src/common/settings.h b/src/common/settings.h index ce1bc647d..7f649fdc6 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -322,8 +322,8 @@ struct Values { | |||
| 322 | "fullscreen_mode"}; | 322 | "fullscreen_mode"}; |
| 323 | Setting<int> aspect_ratio{0, "aspect_ratio"}; | 323 | Setting<int> aspect_ratio{0, "aspect_ratio"}; |
| 324 | Setting<int> max_anisotropy{0, "max_anisotropy"}; | 324 | Setting<int> max_anisotropy{0, "max_anisotropy"}; |
| 325 | Setting<bool> use_frame_limit{true, "use_frame_limit"}; | 325 | Setting<bool> use_speed_limit{true, "use_speed_limit"}; |
| 326 | Setting<u16> frame_limit{100, "frame_limit"}; | 326 | Setting<u16> speed_limit{100, "speed_limit"}; |
| 327 | Setting<bool> use_disk_shader_cache{true, "use_disk_shader_cache"}; | 327 | Setting<bool> use_disk_shader_cache{true, "use_disk_shader_cache"}; |
| 328 | Setting<GPUAccuracy> gpu_accuracy{GPUAccuracy::High, "gpu_accuracy"}; | 328 | Setting<GPUAccuracy> gpu_accuracy{GPUAccuracy::High, "gpu_accuracy"}; |
| 329 | Setting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"}; | 329 | Setting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"}; |
diff --git a/src/core/core.cpp b/src/core/core.cpp index 15226cf41..d3e84c4ef 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -411,7 +411,7 @@ struct System::Impl { | |||
| 411 | std::string status_details = ""; | 411 | std::string status_details = ""; |
| 412 | 412 | ||
| 413 | std::unique_ptr<Core::PerfStats> perf_stats; | 413 | std::unique_ptr<Core::PerfStats> perf_stats; |
| 414 | Core::FrameLimiter frame_limiter; | 414 | Core::SpeedLimiter speed_limiter; |
| 415 | 415 | ||
| 416 | bool is_multicore{}; | 416 | bool is_multicore{}; |
| 417 | bool is_async_gpu{}; | 417 | bool is_async_gpu{}; |
| @@ -606,12 +606,12 @@ const Core::PerfStats& System::GetPerfStats() const { | |||
| 606 | return *impl->perf_stats; | 606 | return *impl->perf_stats; |
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | Core::FrameLimiter& System::FrameLimiter() { | 609 | Core::SpeedLimiter& System::SpeedLimiter() { |
| 610 | return impl->frame_limiter; | 610 | return impl->speed_limiter; |
| 611 | } | 611 | } |
| 612 | 612 | ||
| 613 | const Core::FrameLimiter& System::FrameLimiter() const { | 613 | const Core::SpeedLimiter& System::SpeedLimiter() const { |
| 614 | return impl->frame_limiter; | 614 | return impl->speed_limiter; |
| 615 | } | 615 | } |
| 616 | 616 | ||
| 617 | Loader::ResultStatus System::GetGameName(std::string& out) const { | 617 | Loader::ResultStatus System::GetGameName(std::string& out) const { |
diff --git a/src/core/core.h b/src/core/core.h index b93c32e60..ea143043c 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -94,7 +94,7 @@ class ARM_Interface; | |||
| 94 | class CpuManager; | 94 | class CpuManager; |
| 95 | class DeviceMemory; | 95 | class DeviceMemory; |
| 96 | class ExclusiveMonitor; | 96 | class ExclusiveMonitor; |
| 97 | class FrameLimiter; | 97 | class SpeedLimiter; |
| 98 | class PerfStats; | 98 | class PerfStats; |
| 99 | class Reporter; | 99 | class Reporter; |
| 100 | class TelemetrySession; | 100 | class TelemetrySession; |
| @@ -292,11 +292,11 @@ public: | |||
| 292 | /// Provides a constant reference to the internal PerfStats instance. | 292 | /// Provides a constant reference to the internal PerfStats instance. |
| 293 | [[nodiscard]] const Core::PerfStats& GetPerfStats() const; | 293 | [[nodiscard]] const Core::PerfStats& GetPerfStats() const; |
| 294 | 294 | ||
| 295 | /// Provides a reference to the frame limiter; | 295 | /// Provides a reference to the speed limiter; |
| 296 | [[nodiscard]] Core::FrameLimiter& FrameLimiter(); | 296 | [[nodiscard]] Core::SpeedLimiter& SpeedLimiter(); |
| 297 | 297 | ||
| 298 | /// Provides a constant referent to the frame limiter | 298 | /// Provides a constant reference to the speed limiter |
| 299 | [[nodiscard]] const Core::FrameLimiter& FrameLimiter() const; | 299 | [[nodiscard]] const Core::SpeedLimiter& SpeedLimiter() const; |
| 300 | 300 | ||
| 301 | /// Gets the name of the current game | 301 | /// Gets the name of the current game |
| 302 | [[nodiscard]] Loader::ResultStatus GetGameName(std::string& out) const; | 302 | [[nodiscard]] Loader::ResultStatus GetGameName(std::string& out) const; |
diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp index 2cc0da124..ce6065db2 100644 --- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp +++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | |||
| @@ -54,7 +54,7 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u3 | |||
| 54 | 54 | ||
| 55 | system.GetPerfStats().EndSystemFrame(); | 55 | system.GetPerfStats().EndSystemFrame(); |
| 56 | system.GPU().SwapBuffers(&framebuffer); | 56 | system.GPU().SwapBuffers(&framebuffer); |
| 57 | system.FrameLimiter().DoFrameLimiting(system.CoreTiming().GetGlobalTimeUs()); | 57 | system.SpeedLimiter().DoSpeedLimiting(system.CoreTiming().GetGlobalTimeUs()); |
| 58 | system.GetPerfStats().BeginSystemFrame(); | 58 | system.GetPerfStats().BeginSystemFrame(); |
| 59 | } | 59 | } |
| 60 | 60 | ||
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index 6635a1339..c9ded49d0 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp | |||
| @@ -127,15 +127,15 @@ double PerfStats::GetLastFrameTimeScale() const { | |||
| 127 | return duration_cast<DoubleSecs>(previous_frame_length).count() / FRAME_LENGTH; | 127 | return duration_cast<DoubleSecs>(previous_frame_length).count() / FRAME_LENGTH; |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) { | 130 | void SpeedLimiter::DoSpeedLimiting(microseconds current_system_time_us) { |
| 131 | if (!Settings::values.use_frame_limit.GetValue() || | 131 | if (!Settings::values.use_speed_limit.GetValue() || |
| 132 | Settings::values.use_multi_core.GetValue()) { | 132 | Settings::values.use_multi_core.GetValue()) { |
| 133 | return; | 133 | return; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | auto now = Clock::now(); | 136 | auto now = Clock::now(); |
| 137 | 137 | ||
| 138 | const double sleep_scale = Settings::values.frame_limit.GetValue() / 100.0; | 138 | const double sleep_scale = Settings::values.speed_limit.GetValue() / 100.0; |
| 139 | 139 | ||
| 140 | // Max lag caused by slow frames. Shouldn't be more than the length of a frame at the current | 140 | // Max lag caused by slow frames. Shouldn't be more than the length of a frame at the current |
| 141 | // speed percent or it will clamp too much and prevent this from properly limiting to that | 141 | // speed percent or it will clamp too much and prevent this from properly limiting to that |
| @@ -143,17 +143,17 @@ void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) { | |||
| 143 | // limiting | 143 | // limiting |
| 144 | const microseconds max_lag_time_us = duration_cast<microseconds>( | 144 | const microseconds max_lag_time_us = duration_cast<microseconds>( |
| 145 | std::chrono::duration<double, std::chrono::microseconds::period>(25ms / sleep_scale)); | 145 | std::chrono::duration<double, std::chrono::microseconds::period>(25ms / sleep_scale)); |
| 146 | frame_limiting_delta_err += duration_cast<microseconds>( | 146 | speed_limiting_delta_err += duration_cast<microseconds>( |
| 147 | std::chrono::duration<double, std::chrono::microseconds::period>( | 147 | std::chrono::duration<double, std::chrono::microseconds::period>( |
| 148 | (current_system_time_us - previous_system_time_us) / sleep_scale)); | 148 | (current_system_time_us - previous_system_time_us) / sleep_scale)); |
| 149 | frame_limiting_delta_err -= duration_cast<microseconds>(now - previous_walltime); | 149 | speed_limiting_delta_err -= duration_cast<microseconds>(now - previous_walltime); |
| 150 | frame_limiting_delta_err = | 150 | speed_limiting_delta_err = |
| 151 | std::clamp(frame_limiting_delta_err, -max_lag_time_us, max_lag_time_us); | 151 | std::clamp(speed_limiting_delta_err, -max_lag_time_us, max_lag_time_us); |
| 152 | 152 | ||
| 153 | if (frame_limiting_delta_err > microseconds::zero()) { | 153 | if (speed_limiting_delta_err > microseconds::zero()) { |
| 154 | std::this_thread::sleep_for(frame_limiting_delta_err); | 154 | std::this_thread::sleep_for(speed_limiting_delta_err); |
| 155 | auto now_after_sleep = Clock::now(); | 155 | auto now_after_sleep = Clock::now(); |
| 156 | frame_limiting_delta_err -= duration_cast<microseconds>(now_after_sleep - now); | 156 | speed_limiting_delta_err -= duration_cast<microseconds>(now_after_sleep - now); |
| 157 | now = now_after_sleep; | 157 | now = now_after_sleep; |
| 158 | } | 158 | } |
| 159 | 159 | ||
diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h index e5d603717..a2541906f 100644 --- a/src/core/perf_stats.h +++ b/src/core/perf_stats.h | |||
| @@ -85,11 +85,11 @@ private: | |||
| 85 | double previous_fps = 0; | 85 | double previous_fps = 0; |
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | class FrameLimiter { | 88 | class SpeedLimiter { |
| 89 | public: | 89 | public: |
| 90 | using Clock = std::chrono::high_resolution_clock; | 90 | using Clock = std::chrono::high_resolution_clock; |
| 91 | 91 | ||
| 92 | void DoFrameLimiting(std::chrono::microseconds current_system_time_us); | 92 | void DoSpeedLimiting(std::chrono::microseconds current_system_time_us); |
| 93 | 93 | ||
| 94 | private: | 94 | private: |
| 95 | /// Emulated system time (in microseconds) at the last limiter invocation | 95 | /// Emulated system time (in microseconds) at the last limiter invocation |
| @@ -98,7 +98,7 @@ private: | |||
| 98 | Clock::time_point previous_walltime = Clock::now(); | 98 | Clock::time_point previous_walltime = Clock::now(); |
| 99 | 99 | ||
| 100 | /// Accumulated difference between walltime and emulated time | 100 | /// Accumulated difference between walltime and emulated time |
| 101 | std::chrono::microseconds frame_limiting_delta_err{0}; | 101 | std::chrono::microseconds speed_limiting_delta_err{0}; |
| 102 | }; | 102 | }; |
| 103 | 103 | ||
| 104 | } // namespace Core | 104 | } // namespace Core |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 066cb23e4..d81f6ddbd 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -221,8 +221,8 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader, | |||
| 221 | TranslateRenderer(Settings::values.renderer_backend.GetValue())); | 221 | TranslateRenderer(Settings::values.renderer_backend.GetValue())); |
| 222 | AddField(field_type, "Renderer_ResolutionFactor", | 222 | AddField(field_type, "Renderer_ResolutionFactor", |
| 223 | Settings::values.resolution_factor.GetValue()); | 223 | Settings::values.resolution_factor.GetValue()); |
| 224 | AddField(field_type, "Renderer_UseFrameLimit", Settings::values.use_frame_limit.GetValue()); | 224 | AddField(field_type, "Renderer_UseSpeedLimit", Settings::values.use_speed_limit.GetValue()); |
| 225 | AddField(field_type, "Renderer_FrameLimit", Settings::values.frame_limit.GetValue()); | 225 | AddField(field_type, "Renderer_SpeedLimit", Settings::values.speed_limit.GetValue()); |
| 226 | AddField(field_type, "Renderer_UseDiskShaderCache", | 226 | AddField(field_type, "Renderer_UseDiskShaderCache", |
| 227 | Settings::values.use_disk_shader_cache.GetValue()); | 227 | Settings::values.use_disk_shader_cache.GetValue()); |
| 228 | AddField(field_type, "Renderer_GPUAccuracyLevel", | 228 | AddField(field_type, "Renderer_GPUAccuracyLevel", |
diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index c9a360aaf..6fe68141f 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp | |||
| @@ -20,7 +20,7 @@ RendererBase::~RendererBase() = default; | |||
| 20 | void RendererBase::RefreshBaseSettings() { | 20 | void RendererBase::RefreshBaseSettings() { |
| 21 | UpdateCurrentFramebufferLayout(); | 21 | UpdateCurrentFramebufferLayout(); |
| 22 | 22 | ||
| 23 | renderer_settings.use_framelimiter = Settings::values.use_frame_limit.GetValue(); | 23 | renderer_settings.use_framelimiter = Settings::values.use_speed_limit.GetValue(); |
| 24 | renderer_settings.set_background_color = true; | 24 | renderer_settings.set_background_color = true; |
| 25 | } | 25 | } |
| 26 | 26 | ||
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index a5e032959..1423dfa90 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -806,8 +806,8 @@ void Config::ReadRendererValues() { | |||
| 806 | ReadGlobalSetting(Settings::values.fullscreen_mode); | 806 | ReadGlobalSetting(Settings::values.fullscreen_mode); |
| 807 | ReadGlobalSetting(Settings::values.aspect_ratio); | 807 | ReadGlobalSetting(Settings::values.aspect_ratio); |
| 808 | ReadGlobalSetting(Settings::values.max_anisotropy); | 808 | ReadGlobalSetting(Settings::values.max_anisotropy); |
| 809 | ReadGlobalSetting(Settings::values.use_frame_limit); | 809 | ReadGlobalSetting(Settings::values.use_speed_limit); |
| 810 | ReadGlobalSetting(Settings::values.frame_limit); | 810 | ReadGlobalSetting(Settings::values.speed_limit); |
| 811 | ReadGlobalSetting(Settings::values.use_disk_shader_cache); | 811 | ReadGlobalSetting(Settings::values.use_disk_shader_cache); |
| 812 | ReadGlobalSetting(Settings::values.gpu_accuracy); | 812 | ReadGlobalSetting(Settings::values.gpu_accuracy); |
| 813 | ReadGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); | 813 | ReadGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); |
| @@ -1332,8 +1332,8 @@ void Config::SaveRendererValues() { | |||
| 1332 | WriteGlobalSetting(Settings::values.fullscreen_mode); | 1332 | WriteGlobalSetting(Settings::values.fullscreen_mode); |
| 1333 | WriteGlobalSetting(Settings::values.aspect_ratio); | 1333 | WriteGlobalSetting(Settings::values.aspect_ratio); |
| 1334 | WriteGlobalSetting(Settings::values.max_anisotropy); | 1334 | WriteGlobalSetting(Settings::values.max_anisotropy); |
| 1335 | WriteGlobalSetting(Settings::values.use_frame_limit); | 1335 | WriteGlobalSetting(Settings::values.use_speed_limit); |
| 1336 | WriteGlobalSetting(Settings::values.frame_limit); | 1336 | WriteGlobalSetting(Settings::values.speed_limit); |
| 1337 | WriteGlobalSetting(Settings::values.use_disk_shader_cache); | 1337 | WriteGlobalSetting(Settings::values.use_disk_shader_cache); |
| 1338 | WriteSetting(QString::fromStdString(Settings::values.gpu_accuracy.GetLabel()), | 1338 | WriteSetting(QString::fromStdString(Settings::values.gpu_accuracy.GetLabel()), |
| 1339 | static_cast<u32>(Settings::values.gpu_accuracy.GetValue(global)), | 1339 | static_cast<u32>(Settings::values.gpu_accuracy.GetValue(global)), |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 18f25def6..6e5d2d981 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -24,8 +24,8 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) | |||
| 24 | SetConfiguration(); | 24 | SetConfiguration(); |
| 25 | 25 | ||
| 26 | if (Settings::IsConfiguringGlobal()) { | 26 | if (Settings::IsConfiguringGlobal()) { |
| 27 | connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit, | 27 | connect(ui->toggle_speed_limit, &QCheckBox::clicked, ui->speed_limit, |
| 28 | [this]() { ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked()); }); | 28 | [this]() { ui->speed_limit->setEnabled(ui->toggle_speed_limit->isChecked()); }); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | connect(ui->button_reset_defaults, &QPushButton::clicked, this, | 31 | connect(ui->button_reset_defaults, &QPushButton::clicked, this, |
| @@ -45,16 +45,16 @@ void ConfigureGeneral::SetConfiguration() { | |||
| 45 | ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue()); | 45 | ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue()); |
| 46 | ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue()); | 46 | ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue()); |
| 47 | 47 | ||
| 48 | ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit.GetValue()); | 48 | ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue()); |
| 49 | ui->frame_limit->setValue(Settings::values.frame_limit.GetValue()); | 49 | ui->speed_limit->setValue(Settings::values.speed_limit.GetValue()); |
| 50 | 50 | ||
| 51 | ui->button_reset_defaults->setEnabled(runtime_lock); | 51 | ui->button_reset_defaults->setEnabled(runtime_lock); |
| 52 | 52 | ||
| 53 | if (Settings::IsConfiguringGlobal()) { | 53 | if (Settings::IsConfiguringGlobal()) { |
| 54 | ui->frame_limit->setEnabled(Settings::values.use_frame_limit.GetValue()); | 54 | ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue()); |
| 55 | } else { | 55 | } else { |
| 56 | ui->frame_limit->setEnabled(Settings::values.use_frame_limit.GetValue() && | 56 | ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue() && |
| 57 | use_frame_limit != ConfigurationShared::CheckState::Global); | 57 | use_speed_limit != ConfigurationShared::CheckState::Global); |
| 58 | } | 58 | } |
| 59 | } | 59 | } |
| 60 | 60 | ||
| @@ -88,19 +88,19 @@ void ConfigureGeneral::ApplyConfiguration() { | |||
| 88 | UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked(); | 88 | UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked(); |
| 89 | 89 | ||
| 90 | // Guard if during game and set to game-specific value | 90 | // Guard if during game and set to game-specific value |
| 91 | if (Settings::values.use_frame_limit.UsingGlobal()) { | 91 | if (Settings::values.use_speed_limit.UsingGlobal()) { |
| 92 | Settings::values.use_frame_limit.SetValue(ui->toggle_frame_limit->checkState() == | 92 | Settings::values.use_speed_limit.SetValue(ui->toggle_speed_limit->checkState() == |
| 93 | Qt::Checked); | 93 | Qt::Checked); |
| 94 | Settings::values.frame_limit.SetValue(ui->frame_limit->value()); | 94 | Settings::values.speed_limit.SetValue(ui->speed_limit->value()); |
| 95 | } | 95 | } |
| 96 | } else { | 96 | } else { |
| 97 | bool global_frame_limit = use_frame_limit == ConfigurationShared::CheckState::Global; | 97 | bool global_speed_limit = use_speed_limit == ConfigurationShared::CheckState::Global; |
| 98 | Settings::values.use_frame_limit.SetGlobal(global_frame_limit); | 98 | Settings::values.use_speed_limit.SetGlobal(global_speed_limit); |
| 99 | Settings::values.frame_limit.SetGlobal(global_frame_limit); | 99 | Settings::values.speed_limit.SetGlobal(global_speed_limit); |
| 100 | if (!global_frame_limit) { | 100 | if (!global_speed_limit) { |
| 101 | Settings::values.use_frame_limit.SetValue(ui->toggle_frame_limit->checkState() == | 101 | Settings::values.use_speed_limit.SetValue(ui->toggle_speed_limit->checkState() == |
| 102 | Qt::Checked); | 102 | Qt::Checked); |
| 103 | Settings::values.frame_limit.SetValue(ui->frame_limit->value()); | 103 | Settings::values.speed_limit.SetValue(ui->speed_limit->value()); |
| 104 | } | 104 | } |
| 105 | } | 105 | } |
| 106 | } | 106 | } |
| @@ -122,8 +122,8 @@ void ConfigureGeneral::SetupPerGameUI() { | |||
| 122 | // Disables each setting if: | 122 | // Disables each setting if: |
| 123 | // - A game is running (thus settings in use), and | 123 | // - A game is running (thus settings in use), and |
| 124 | // - A non-global setting is applied. | 124 | // - A non-global setting is applied. |
| 125 | ui->toggle_frame_limit->setEnabled(Settings::values.use_frame_limit.UsingGlobal()); | 125 | ui->toggle_speed_limit->setEnabled(Settings::values.use_speed_limit.UsingGlobal()); |
| 126 | ui->frame_limit->setEnabled(Settings::values.frame_limit.UsingGlobal()); | 126 | ui->speed_limit->setEnabled(Settings::values.speed_limit.UsingGlobal()); |
| 127 | 127 | ||
| 128 | return; | 128 | return; |
| 129 | } | 129 | } |
| @@ -135,13 +135,13 @@ void ConfigureGeneral::SetupPerGameUI() { | |||
| 135 | 135 | ||
| 136 | ui->button_reset_defaults->setVisible(false); | 136 | ui->button_reset_defaults->setVisible(false); |
| 137 | 137 | ||
| 138 | ConfigurationShared::SetColoredTristate(ui->toggle_frame_limit, | 138 | ConfigurationShared::SetColoredTristate(ui->toggle_speed_limit, |
| 139 | Settings::values.use_frame_limit, use_frame_limit); | 139 | Settings::values.use_speed_limit, use_speed_limit); |
| 140 | ConfigurationShared::SetColoredTristate(ui->use_multi_core, Settings::values.use_multi_core, | 140 | ConfigurationShared::SetColoredTristate(ui->use_multi_core, Settings::values.use_multi_core, |
| 141 | use_multi_core); | 141 | use_multi_core); |
| 142 | 142 | ||
| 143 | connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit, [this]() { | 143 | connect(ui->toggle_speed_limit, &QCheckBox::clicked, ui->speed_limit, [this]() { |
| 144 | ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked() && | 144 | ui->speed_limit->setEnabled(ui->toggle_speed_limit->isChecked() && |
| 145 | (use_frame_limit != ConfigurationShared::CheckState::Global)); | 145 | (use_speed_limit != ConfigurationShared::CheckState::Global)); |
| 146 | }); | 146 | }); |
| 147 | } | 147 | } |
diff --git a/src/yuzu/configuration/configure_general.h b/src/yuzu/configuration/configure_general.h index a0fd52492..c9df37d73 100644 --- a/src/yuzu/configuration/configure_general.h +++ b/src/yuzu/configuration/configure_general.h | |||
| @@ -43,6 +43,6 @@ private: | |||
| 43 | 43 | ||
| 44 | std::unique_ptr<Ui::ConfigureGeneral> ui; | 44 | std::unique_ptr<Ui::ConfigureGeneral> ui; |
| 45 | 45 | ||
| 46 | ConfigurationShared::CheckState use_frame_limit; | 46 | ConfigurationShared::CheckState use_speed_limit; |
| 47 | ConfigurationShared::CheckState use_multi_core; | 47 | ConfigurationShared::CheckState use_multi_core; |
| 48 | }; | 48 | }; |
diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index bc7041090..afe8c6573 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui | |||
| @@ -27,14 +27,14 @@ | |||
| 27 | <item> | 27 | <item> |
| 28 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | 28 | <layout class="QHBoxLayout" name="horizontalLayout_2"> |
| 29 | <item> | 29 | <item> |
| 30 | <widget class="QCheckBox" name="toggle_frame_limit"> | 30 | <widget class="QCheckBox" name="toggle_speed_limit"> |
| 31 | <property name="text"> | 31 | <property name="text"> |
| 32 | <string>Limit Speed Percent</string> | 32 | <string>Limit Speed Percent</string> |
| 33 | </property> | 33 | </property> |
| 34 | </widget> | 34 | </widget> |
| 35 | </item> | 35 | </item> |
| 36 | <item> | 36 | <item> |
| 37 | <widget class="QSpinBox" name="frame_limit"> | 37 | <widget class="QSpinBox" name="speed_limit"> |
| 38 | <property name="suffix"> | 38 | <property name="suffix"> |
| 39 | <string>%</string> | 39 | <string>%</string> |
| 40 | </property> | 40 | </property> |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 03a909d17..aa5ff3a31 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -985,23 +985,23 @@ void GMainWindow::InitializeHotkeys() { | |||
| 985 | }); | 985 | }); |
| 986 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Speed Limit"), this), | 986 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Speed Limit"), this), |
| 987 | &QShortcut::activated, this, [&] { | 987 | &QShortcut::activated, this, [&] { |
| 988 | Settings::values.use_frame_limit.SetValue( | 988 | Settings::values.use_speed_limit.SetValue( |
| 989 | !Settings::values.use_frame_limit.GetValue()); | 989 | !Settings::values.use_speed_limit.GetValue()); |
| 990 | UpdateStatusBar(); | 990 | UpdateStatusBar(); |
| 991 | }); | 991 | }); |
| 992 | constexpr u16 SPEED_LIMIT_STEP = 5; | 992 | constexpr u16 SPEED_LIMIT_STEP = 5; |
| 993 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Increase Speed Limit"), this), | 993 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Increase Speed Limit"), this), |
| 994 | &QShortcut::activated, this, [&] { | 994 | &QShortcut::activated, this, [&] { |
| 995 | if (Settings::values.frame_limit.GetValue() < 9999 - SPEED_LIMIT_STEP) { | 995 | if (Settings::values.speed_limit.GetValue() < 9999 - SPEED_LIMIT_STEP) { |
| 996 | Settings::values.frame_limit.SetValue(SPEED_LIMIT_STEP + | 996 | Settings::values.speed_limit.SetValue(SPEED_LIMIT_STEP + |
| 997 | Settings::values.frame_limit.GetValue()); | 997 | Settings::values.speed_limit.GetValue()); |
| 998 | UpdateStatusBar(); | 998 | UpdateStatusBar(); |
| 999 | } | 999 | } |
| 1000 | }); | 1000 | }); |
| 1001 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Decrease Speed Limit"), this), | 1001 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Decrease Speed Limit"), this), |
| 1002 | &QShortcut::activated, this, [&] { | 1002 | &QShortcut::activated, this, [&] { |
| 1003 | if (Settings::values.frame_limit.GetValue() > SPEED_LIMIT_STEP) { | 1003 | if (Settings::values.speed_limit.GetValue() > SPEED_LIMIT_STEP) { |
| 1004 | Settings::values.frame_limit.SetValue(Settings::values.frame_limit.GetValue() - | 1004 | Settings::values.speed_limit.SetValue(Settings::values.speed_limit.GetValue() - |
| 1005 | SPEED_LIMIT_STEP); | 1005 | SPEED_LIMIT_STEP); |
| 1006 | UpdateStatusBar(); | 1006 | UpdateStatusBar(); |
| 1007 | } | 1007 | } |
| @@ -2912,10 +2912,10 @@ void GMainWindow::UpdateStatusBar() { | |||
| 2912 | shader_building_label->setVisible(false); | 2912 | shader_building_label->setVisible(false); |
| 2913 | } | 2913 | } |
| 2914 | 2914 | ||
| 2915 | if (Settings::values.use_frame_limit.GetValue()) { | 2915 | if (Settings::values.use_speed_limit.GetValue()) { |
| 2916 | emu_speed_label->setText(tr("Speed: %1% / %2%") | 2916 | emu_speed_label->setText(tr("Speed: %1% / %2%") |
| 2917 | .arg(results.emulation_speed * 100.0, 0, 'f', 0) | 2917 | .arg(results.emulation_speed * 100.0, 0, 'f', 0) |
| 2918 | .arg(Settings::values.frame_limit.GetValue())); | 2918 | .arg(Settings::values.speed_limit.GetValue())); |
| 2919 | } else { | 2919 | } else { |
| 2920 | emu_speed_label->setText(tr("Speed: %1%").arg(results.emulation_speed * 100.0, 0, 'f', 0)); | 2920 | emu_speed_label->setText(tr("Speed: %1%").arg(results.emulation_speed * 100.0, 0, 'f', 0)); |
| 2921 | } | 2921 | } |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 3e22fee37..47244c959 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -449,8 +449,8 @@ void Config::ReadValues() { | |||
| 449 | ReadSetting("Renderer", Settings::values.fullscreen_mode); | 449 | ReadSetting("Renderer", Settings::values.fullscreen_mode); |
| 450 | ReadSetting("Renderer", Settings::values.aspect_ratio); | 450 | ReadSetting("Renderer", Settings::values.aspect_ratio); |
| 451 | ReadSetting("Renderer", Settings::values.max_anisotropy); | 451 | ReadSetting("Renderer", Settings::values.max_anisotropy); |
| 452 | ReadSetting("Renderer", Settings::values.use_frame_limit); | 452 | ReadSetting("Renderer", Settings::values.use_speed_limit); |
| 453 | ReadSetting("Renderer", Settings::values.frame_limit); | 453 | ReadSetting("Renderer", Settings::values.speed_limit); |
| 454 | ReadSetting("Renderer", Settings::values.use_disk_shader_cache); | 454 | ReadSetting("Renderer", Settings::values.use_disk_shader_cache); |
| 455 | ReadSetting("Renderer", Settings::values.gpu_accuracy); | 455 | ReadSetting("Renderer", Settings::values.gpu_accuracy); |
| 456 | ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation); | 456 | ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation); |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 88d33ecab..b32adbbde 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -256,13 +256,13 @@ use_nvdec_emulation = | |||
| 256 | # 0: Off, 1 (default): On | 256 | # 0: Off, 1 (default): On |
| 257 | accelerate_astc = | 257 | accelerate_astc = |
| 258 | 258 | ||
| 259 | # Turns on the frame limiter, which will limit frames output to the target game speed | 259 | # Turns on the speed limiter, which will limit the emulation speed to the desired speed limit value |
| 260 | # 0: Off, 1: On (default) | 260 | # 0: Off, 1: On (default) |
| 261 | use_frame_limit = | 261 | use_speed_limit = |
| 262 | 262 | ||
| 263 | # Limits the speed of the game to run no faster than this value as a percentage of target speed | 263 | # Limits the speed of the game to run no faster than this value as a percentage of target speed |
| 264 | # 1 - 9999: Speed limit as a percentage of target game speed. 100 (default) | 264 | # 1 - 9999: Speed limit as a percentage of target game speed. 100 (default) |
| 265 | frame_limit = | 265 | speed_limit = |
| 266 | 266 | ||
| 267 | # Whether to use disk based shader cache | 267 | # Whether to use disk based shader cache |
| 268 | # 0: Off, 1 (default): On | 268 | # 0: Off, 1 (default): On |