diff options
| author | Zephyron <zephyron@citron-emu.org> | 2025-04-16 22:02:10 +1000 |
|---|---|---|
| committer | Mike Lothian <mike@fireburn.co.uk> | 2025-05-12 12:46:19 +0100 |
| commit | ea8bb22148a69ebe19b186073a06b21614913525 (patch) | |
| tree | b344da696dacba2c24921e6965c176015b44dedd /src/core/hle/service/apm/apm_controller.cpp | |
| parent | 6a845fd03bdfcf3435f7da840e6af1be6b74fee3 (diff) | |
feat: add CPU clock rate slider to settings
Implement a slider in the CPU settings tab to adjust the BASE_CLOCK_RATE
up to 1,785 MHz (Switch's official maximum clock rate). Default remains
at 1,020 MHz.
This change:
- Adds UI slider and spinbox to configure_cpu.ui with range 500-1785 MHz
- Makes BASE_CLOCK_RATE dynamic by reading from settings
- Modifies WallClock to handle dynamic clock rate changes
- Updates APM controller to properly set the clock rate
- Changes clock rate settings category from Core to CPU
The user can now easily adjust the CPU clock rate to improve performance
or manage thermals and power consumption.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Diffstat (limited to 'src/core/hle/service/apm/apm_controller.cpp')
| -rw-r--r-- | src/core/hle/service/apm/apm_controller.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/apm/apm_controller.cpp b/src/core/hle/service/apm/apm_controller.cpp index 4f1aa5cc2..abbee804b 100644 --- a/src/core/hle/service/apm/apm_controller.cpp +++ b/src/core/hle/service/apm/apm_controller.cpp @@ -1,4 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include <algorithm> @@ -81,8 +82,8 @@ PerformanceConfiguration Controller::GetCurrentPerformanceConfiguration(Performa void Controller::SetClockSpeed(u32 mhz) { LOG_DEBUG(Service_APM, "called, mhz={:08X}", mhz); - // TODO(DarkLordZach): Actually signal core_timing to change clock speed. - // TODO(Rodrigo): Remove [[maybe_unused]] when core_timing is used. + // Update the clock rate setting with the provided MHz value (convert to Hz) + Settings::values.cpu_clock_rate = mhz * 1'000'000; } } // namespace Service::APM |
