diff options
Diffstat (limited to '')
| -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 | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_base.h | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 10 | ||||
| -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 |
18 files changed, 80 insertions, 88 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 66268ea0f..996315999 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 df1762d1b..d8730f515 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -331,8 +331,8 @@ struct Values { | |||
| 331 | "fullscreen_mode"}; | 331 | "fullscreen_mode"}; |
| 332 | Setting<int> aspect_ratio{0, "aspect_ratio"}; | 332 | Setting<int> aspect_ratio{0, "aspect_ratio"}; |
| 333 | Setting<int> max_anisotropy{0, "max_anisotropy"}; | 333 | Setting<int> max_anisotropy{0, "max_anisotropy"}; |
| 334 | Setting<bool> use_frame_limit{true, "use_frame_limit"}; | 334 | Setting<bool> use_speed_limit{true, "use_speed_limit"}; |
| 335 | Setting<u16> frame_limit{100, "frame_limit"}; | 335 | Setting<u16> speed_limit{100, "speed_limit"}; |
| 336 | Setting<bool> use_disk_shader_cache{true, "use_disk_shader_cache"}; | 336 | Setting<bool> use_disk_shader_cache{true, "use_disk_shader_cache"}; |
| 337 | Setting<GPUAccuracy> gpu_accuracy{GPUAccuracy::High, "gpu_accuracy"}; | 337 | Setting<GPUAccuracy> gpu_accuracy{GPUAccuracy::High, "gpu_accuracy"}; |
| 338 | Setting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"}; | 338 | 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 422de3a7d..5a8cfd301 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..3ea72fda9 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp | |||
| @@ -19,9 +19,6 @@ RendererBase::~RendererBase() = default; | |||
| 19 | 19 | ||
| 20 | void RendererBase::RefreshBaseSettings() { | 20 | void RendererBase::RefreshBaseSettings() { |
| 21 | UpdateCurrentFramebufferLayout(); | 21 | UpdateCurrentFramebufferLayout(); |
| 22 | |||
| 23 | renderer_settings.use_framelimiter = Settings::values.use_frame_limit.GetValue(); | ||
| 24 | renderer_settings.set_background_color = true; | ||
| 25 | } | 22 | } |
| 26 | 23 | ||
| 27 | void RendererBase::UpdateCurrentFramebufferLayout() { | 24 | void RendererBase::UpdateCurrentFramebufferLayout() { |
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index 63d8ad42a..22b80c328 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h | |||
| @@ -21,9 +21,6 @@ class GraphicsContext; | |||
| 21 | namespace VideoCore { | 21 | namespace VideoCore { |
| 22 | 22 | ||
| 23 | struct RendererSettings { | 23 | struct RendererSettings { |
| 24 | std::atomic_bool use_framelimiter{false}; | ||
| 25 | std::atomic_bool set_background_color{false}; | ||
| 26 | |||
| 27 | // Screenshot | 24 | // Screenshot |
| 28 | std::atomic<bool> screenshot_requested{false}; | 25 | std::atomic<bool> screenshot_requested{false}; |
| 29 | void* screenshot_bits{}; | 26 | void* screenshot_bits{}; |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 285e78384..f1b00c24c 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -328,12 +328,10 @@ void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture, | |||
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) { | 330 | void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) { |
| 331 | if (renderer_settings.set_background_color) { | 331 | // Update background color before drawing |
| 332 | // Update background color before drawing | 332 | glClearColor(Settings::values.bg_red.GetValue() / 255.0f, |
| 333 | glClearColor(Settings::values.bg_red.GetValue() / 255.0f, | 333 | Settings::values.bg_green.GetValue() / 255.0f, |
| 334 | Settings::values.bg_green.GetValue() / 255.0f, | 334 | Settings::values.bg_blue.GetValue() / 255.0f, 1.0f); |
| 335 | Settings::values.bg_blue.GetValue() / 255.0f, 1.0f); | ||
| 336 | } | ||
| 337 | 335 | ||
| 338 | // Set projection matrix | 336 | // Set projection matrix |
| 339 | const std::array ortho_matrix = | 337 | const std::array ortho_matrix = |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 4d89b00e9..72027e773 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); |
| @@ -1335,8 +1335,8 @@ void Config::SaveRendererValues() { | |||
| 1335 | WriteGlobalSetting(Settings::values.fullscreen_mode); | 1335 | WriteGlobalSetting(Settings::values.fullscreen_mode); |
| 1336 | WriteGlobalSetting(Settings::values.aspect_ratio); | 1336 | WriteGlobalSetting(Settings::values.aspect_ratio); |
| 1337 | WriteGlobalSetting(Settings::values.max_anisotropy); | 1337 | WriteGlobalSetting(Settings::values.max_anisotropy); |
| 1338 | WriteGlobalSetting(Settings::values.use_frame_limit); | 1338 | WriteGlobalSetting(Settings::values.use_speed_limit); |
| 1339 | WriteGlobalSetting(Settings::values.frame_limit); | 1339 | WriteGlobalSetting(Settings::values.speed_limit); |
| 1340 | WriteGlobalSetting(Settings::values.use_disk_shader_cache); | 1340 | WriteGlobalSetting(Settings::values.use_disk_shader_cache); |
| 1341 | WriteSetting(QString::fromStdString(Settings::values.gpu_accuracy.GetLabel()), | 1341 | WriteSetting(QString::fromStdString(Settings::values.gpu_accuracy.GetLabel()), |
| 1342 | static_cast<u32>(Settings::values.gpu_accuracy.GetValue(global)), | 1342 | 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 d79d2e23e..1f647a0d1 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,18 +45,18 @@ 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->fps_cap->setValue(Settings::values.fps_cap.GetValue()); | 51 | ui->fps_cap->setValue(Settings::values.fps_cap.GetValue()); |
| 52 | 52 | ||
| 53 | ui->button_reset_defaults->setEnabled(runtime_lock); | 53 | ui->button_reset_defaults->setEnabled(runtime_lock); |
| 54 | 54 | ||
| 55 | if (Settings::IsConfiguringGlobal()) { | 55 | if (Settings::IsConfiguringGlobal()) { |
| 56 | ui->frame_limit->setEnabled(Settings::values.use_frame_limit.GetValue()); | 56 | ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue()); |
| 57 | } else { | 57 | } else { |
| 58 | ui->frame_limit->setEnabled(Settings::values.use_frame_limit.GetValue() && | 58 | ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue() && |
| 59 | use_frame_limit != ConfigurationShared::CheckState::Global); | 59 | use_speed_limit != ConfigurationShared::CheckState::Global); |
| 60 | } | 60 | } |
| 61 | } | 61 | } |
| 62 | 62 | ||
| @@ -92,19 +92,19 @@ void ConfigureGeneral::ApplyConfiguration() { | |||
| 92 | Settings::values.fps_cap.SetValue(ui->fps_cap->value()); | 92 | Settings::values.fps_cap.SetValue(ui->fps_cap->value()); |
| 93 | 93 | ||
| 94 | // Guard if during game and set to game-specific value | 94 | // Guard if during game and set to game-specific value |
| 95 | if (Settings::values.use_frame_limit.UsingGlobal()) { | 95 | if (Settings::values.use_speed_limit.UsingGlobal()) { |
| 96 | Settings::values.use_frame_limit.SetValue(ui->toggle_frame_limit->checkState() == | 96 | Settings::values.use_speed_limit.SetValue(ui->toggle_speed_limit->checkState() == |
| 97 | Qt::Checked); | 97 | Qt::Checked); |
| 98 | Settings::values.frame_limit.SetValue(ui->frame_limit->value()); | 98 | Settings::values.speed_limit.SetValue(ui->speed_limit->value()); |
| 99 | } | 99 | } |
| 100 | } else { | 100 | } else { |
| 101 | bool global_frame_limit = use_frame_limit == ConfigurationShared::CheckState::Global; | 101 | bool global_speed_limit = use_speed_limit == ConfigurationShared::CheckState::Global; |
| 102 | Settings::values.use_frame_limit.SetGlobal(global_frame_limit); | 102 | Settings::values.use_speed_limit.SetGlobal(global_speed_limit); |
| 103 | Settings::values.frame_limit.SetGlobal(global_frame_limit); | 103 | Settings::values.speed_limit.SetGlobal(global_speed_limit); |
| 104 | if (!global_frame_limit) { | 104 | if (!global_speed_limit) { |
| 105 | Settings::values.use_frame_limit.SetValue(ui->toggle_frame_limit->checkState() == | 105 | Settings::values.use_speed_limit.SetValue(ui->toggle_speed_limit->checkState() == |
| 106 | Qt::Checked); | 106 | Qt::Checked); |
| 107 | Settings::values.frame_limit.SetValue(ui->frame_limit->value()); | 107 | Settings::values.speed_limit.SetValue(ui->speed_limit->value()); |
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | } | 110 | } |
| @@ -126,8 +126,8 @@ void ConfigureGeneral::SetupPerGameUI() { | |||
| 126 | // Disables each setting if: | 126 | // Disables each setting if: |
| 127 | // - A game is running (thus settings in use), and | 127 | // - A game is running (thus settings in use), and |
| 128 | // - A non-global setting is applied. | 128 | // - A non-global setting is applied. |
| 129 | ui->toggle_frame_limit->setEnabled(Settings::values.use_frame_limit.UsingGlobal()); | 129 | ui->toggle_speed_limit->setEnabled(Settings::values.use_speed_limit.UsingGlobal()); |
| 130 | ui->frame_limit->setEnabled(Settings::values.frame_limit.UsingGlobal()); | 130 | ui->speed_limit->setEnabled(Settings::values.speed_limit.UsingGlobal()); |
| 131 | 131 | ||
| 132 | return; | 132 | return; |
| 133 | } | 133 | } |
| @@ -139,13 +139,13 @@ void ConfigureGeneral::SetupPerGameUI() { | |||
| 139 | 139 | ||
| 140 | ui->button_reset_defaults->setVisible(false); | 140 | ui->button_reset_defaults->setVisible(false); |
| 141 | 141 | ||
| 142 | ConfigurationShared::SetColoredTristate(ui->toggle_frame_limit, | 142 | ConfigurationShared::SetColoredTristate(ui->toggle_speed_limit, |
| 143 | Settings::values.use_frame_limit, use_frame_limit); | 143 | Settings::values.use_speed_limit, use_speed_limit); |
| 144 | ConfigurationShared::SetColoredTristate(ui->use_multi_core, Settings::values.use_multi_core, | 144 | ConfigurationShared::SetColoredTristate(ui->use_multi_core, Settings::values.use_multi_core, |
| 145 | use_multi_core); | 145 | use_multi_core); |
| 146 | 146 | ||
| 147 | connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit, [this]() { | 147 | connect(ui->toggle_speed_limit, &QCheckBox::clicked, ui->speed_limit, [this]() { |
| 148 | ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked() && | 148 | ui->speed_limit->setEnabled(ui->toggle_speed_limit->isChecked() && |
| 149 | (use_frame_limit != ConfigurationShared::CheckState::Global)); | 149 | (use_speed_limit != ConfigurationShared::CheckState::Global)); |
| 150 | }); | 150 | }); |
| 151 | } | 151 | } |
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 bc3c4b481..8ce97edec 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 3d747e8d9..e172d2ff4 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -972,23 +972,23 @@ void GMainWindow::InitializeHotkeys() { | |||
| 972 | }); | 972 | }); |
| 973 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Speed Limit"), this), | 973 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Speed Limit"), this), |
| 974 | &QShortcut::activated, this, [&] { | 974 | &QShortcut::activated, this, [&] { |
| 975 | Settings::values.use_frame_limit.SetValue( | 975 | Settings::values.use_speed_limit.SetValue( |
| 976 | !Settings::values.use_frame_limit.GetValue()); | 976 | !Settings::values.use_speed_limit.GetValue()); |
| 977 | UpdateStatusBar(); | 977 | UpdateStatusBar(); |
| 978 | }); | 978 | }); |
| 979 | constexpr u16 SPEED_LIMIT_STEP = 5; | 979 | constexpr u16 SPEED_LIMIT_STEP = 5; |
| 980 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Increase Speed Limit"), this), | 980 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Increase Speed Limit"), this), |
| 981 | &QShortcut::activated, this, [&] { | 981 | &QShortcut::activated, this, [&] { |
| 982 | if (Settings::values.frame_limit.GetValue() < 9999 - SPEED_LIMIT_STEP) { | 982 | if (Settings::values.speed_limit.GetValue() < 9999 - SPEED_LIMIT_STEP) { |
| 983 | Settings::values.frame_limit.SetValue(SPEED_LIMIT_STEP + | 983 | Settings::values.speed_limit.SetValue(SPEED_LIMIT_STEP + |
| 984 | Settings::values.frame_limit.GetValue()); | 984 | Settings::values.speed_limit.GetValue()); |
| 985 | UpdateStatusBar(); | 985 | UpdateStatusBar(); |
| 986 | } | 986 | } |
| 987 | }); | 987 | }); |
| 988 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Decrease Speed Limit"), this), | 988 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Decrease Speed Limit"), this), |
| 989 | &QShortcut::activated, this, [&] { | 989 | &QShortcut::activated, this, [&] { |
| 990 | if (Settings::values.frame_limit.GetValue() > SPEED_LIMIT_STEP) { | 990 | if (Settings::values.speed_limit.GetValue() > SPEED_LIMIT_STEP) { |
| 991 | Settings::values.frame_limit.SetValue(Settings::values.frame_limit.GetValue() - | 991 | Settings::values.speed_limit.SetValue(Settings::values.speed_limit.GetValue() - |
| 992 | SPEED_LIMIT_STEP); | 992 | SPEED_LIMIT_STEP); |
| 993 | UpdateStatusBar(); | 993 | UpdateStatusBar(); |
| 994 | } | 994 | } |
| @@ -2910,10 +2910,10 @@ void GMainWindow::UpdateStatusBar() { | |||
| 2910 | shader_building_label->setVisible(false); | 2910 | shader_building_label->setVisible(false); |
| 2911 | } | 2911 | } |
| 2912 | 2912 | ||
| 2913 | if (Settings::values.use_frame_limit.GetValue()) { | 2913 | if (Settings::values.use_speed_limit.GetValue()) { |
| 2914 | emu_speed_label->setText(tr("Speed: %1% / %2%") | 2914 | emu_speed_label->setText(tr("Speed: %1% / %2%") |
| 2915 | .arg(results.emulation_speed * 100.0, 0, 'f', 0) | 2915 | .arg(results.emulation_speed * 100.0, 0, 'f', 0) |
| 2916 | .arg(Settings::values.frame_limit.GetValue())); | 2916 | .arg(Settings::values.speed_limit.GetValue())); |
| 2917 | } else { | 2917 | } else { |
| 2918 | emu_speed_label->setText(tr("Speed: %1%").arg(results.emulation_speed * 100.0, 0, 'f', 0)); | 2918 | emu_speed_label->setText(tr("Speed: %1%").arg(results.emulation_speed * 100.0, 0, 'f', 0)); |
| 2919 | } | 2919 | } |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index d4ca6bb57..5af1ee6a8 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -451,8 +451,8 @@ void Config::ReadValues() { | |||
| 451 | ReadSetting("Renderer", Settings::values.fullscreen_mode); | 451 | ReadSetting("Renderer", Settings::values.fullscreen_mode); |
| 452 | ReadSetting("Renderer", Settings::values.aspect_ratio); | 452 | ReadSetting("Renderer", Settings::values.aspect_ratio); |
| 453 | ReadSetting("Renderer", Settings::values.max_anisotropy); | 453 | ReadSetting("Renderer", Settings::values.max_anisotropy); |
| 454 | ReadSetting("Renderer", Settings::values.use_frame_limit); | 454 | ReadSetting("Renderer", Settings::values.use_speed_limit); |
| 455 | ReadSetting("Renderer", Settings::values.frame_limit); | 455 | ReadSetting("Renderer", Settings::values.speed_limit); |
| 456 | ReadSetting("Renderer", Settings::values.use_disk_shader_cache); | 456 | ReadSetting("Renderer", Settings::values.use_disk_shader_cache); |
| 457 | ReadSetting("Renderer", Settings::values.gpu_accuracy); | 457 | ReadSetting("Renderer", Settings::values.gpu_accuracy); |
| 458 | ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation); | 458 | 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 b2b2095d1..e646e2d2f 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -265,13 +265,13 @@ use_nvdec_emulation = | |||
| 265 | # 0: Off, 1 (default): On | 265 | # 0: Off, 1 (default): On |
| 266 | accelerate_astc = | 266 | accelerate_astc = |
| 267 | 267 | ||
| 268 | # Turns on the frame limiter, which will limit frames output to the target game speed | 268 | # Turns on the speed limiter, which will limit the emulation speed to the desired speed limit value |
| 269 | # 0: Off, 1: On (default) | 269 | # 0: Off, 1: On (default) |
| 270 | use_frame_limit = | 270 | use_speed_limit = |
| 271 | 271 | ||
| 272 | # Limits the speed of the game to run no faster than this value as a percentage of target speed | 272 | # Limits the speed of the game to run no faster than this value as a percentage of target speed |
| 273 | # 1 - 9999: Speed limit as a percentage of target game speed. 100 (default) | 273 | # 1 - 9999: Speed limit as a percentage of target game speed. 100 (default) |
| 274 | frame_limit = | 274 | speed_limit = |
| 275 | 275 | ||
| 276 | # Whether to use disk based shader cache | 276 | # Whether to use disk based shader cache |
| 277 | # 0: Off, 1 (default): On | 277 | # 0: Off, 1 (default): On |