Compare commits

...

14 Commits

Author SHA1 Message Date
Gamer64
d1e0df68ed Revert some unused stuff 2025-06-27 09:05:45 +02:00
crueter
accf4cda38 fix translation and display
Signed-off-by: crueter <swurl@swurl.xyz>
2025-06-26 18:38:06 -04:00
Gamer64
3dd6eced05 settings.h: Attemp to fix android slider 2025-06-26 22:07:00 +02:00
Gamer64
8c173242cf settings.h: Pair use_custom_cpu_ticks with cpu_ticks 2025-06-26 19:10:26 +02:00
Gamer64
334d998e63 Update configure_cpu.h 2025-06-26 18:36:07 +02:00
Gamer64
cbf5f4b8c9 Fix include 2025-06-26 18:20:16 +02:00
Gamer64
617d4c5b1a PC: Add Custom CPU Ticks to UI, simplify core timing 2025-06-26 17:54:06 +02:00
Gamer64
05fb5743da vscode, its GetValue(), not get() lol 2025-06-26 17:03:29 +02:00
Gamer64
d921d668ec Fix parameter again 2025-06-26 16:46:21 +02:00
Gamer64
d69f3abd52 Fix incorrect assigment type 2025-06-26 16:08:57 +02:00
Gamer64
69026faa88 Android: Add min & max 2025-06-26 15:54:29 +02:00
Gamer64
f4cb591578 Add Custom CPU Ticks to Android UI 2025-06-26 15:45:50 +02:00
Gamer64
7e4a804e6c more testing 2025-06-26 13:39:20 +02:00
Gamer64
6bc212e4cb small test to see how it works 2025-06-26 12:12:09 +02:00
9 changed files with 55 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
CORE_SYNC_CORE_SPEED("sync_core_speed"),
RENDERER_USE_SPEED_LIMIT("use_speed_limit"),
USE_FAST_CPU_TIME("use_fast_cpu_time"),
USE_CUSTOM_CPU_TICKS("use_custom_cpu_ticks"),
USE_DOCKED_MODE("use_docked_mode"),
USE_AUTO_STUB("use_auto_stub"),
RENDERER_USE_DISK_SHADER_CACHE("use_disk_shader_cache"),

View File

@@ -37,6 +37,7 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
MEMORY_LAYOUT("memory_layout_mode"),
FSR_SHARPENING_SLIDER("fsr_sharpening_slider"),
FAST_CPU_TIME("fast_cpu_time"),
CPU_TICKS("cpu_ticks"),
FAST_GPU_TIME("fast_gpu_time"),
CABINET_APPLET("cabinet_applet_mode"),

View File

@@ -577,6 +577,22 @@ abstract class SettingsItem(
valuesId = R.array.clockValues
)
)
put(
SwitchSetting(
BooleanSetting.USE_CUSTOM_CPU_TICKS,
titleId = R.string.custom_cpu_ticks,
descriptionId = R.string.custom_cpu_ticks_description
)
)
put(
SliderSetting(
IntSetting.CPU_TICKS,
titleId = R.string.cpu_ticks,
descriptionId = 0,
min = 77,
max = 65535
)
)
put(
SwitchSetting(
BooleanSetting.RENDERER_REACTIVE_FLUSHING,

View File

@@ -448,6 +448,8 @@ class SettingsFragmentPresenter(
add(HeaderSetting(R.string.veil_misc))
add(BooleanSetting.USE_FAST_CPU_TIME.key)
add(IntSetting.FAST_CPU_TIME.key)
add(BooleanSetting.USE_CUSTOM_CPU_TICKS.key)
add(IntSetting.CPU_TICKS.key)
add(BooleanSetting.USE_LRU_CACHE.key)
add(BooleanSetting.CORE_SYNC_CORE_SPEED.key)
add(IntSetting.MEMORY_LAYOUT.key)

View File

@@ -90,6 +90,9 @@
<string name="use_lru_cache_description">Enable or disable the Least Recently Used (LRU) cache, increasing performance by saving CPU process usage. Some games have issue with it, notably TotK 1.2.1, so disable if the game doesn\'t boot or crashes randomly.</string>
<string name="use_fast_cpu_time">Fast CPU Time</string>
<string name="use_fast_cpu_time_description">Forces the emulated CPU to run at a higher clock, reducing certain FPS limiters. This option is hacky and may cause issues, and weaker CPUs may see reduced performance.</string>
<string name="custom_cpu_ticks">Custom CPU Ticks</string>
<string name="custom_cpu_ticks_description">Set a custom value of CPU ticks. Higher values can increase performance, but may also cause the game to freeze. A range of 7721000 is recommended.</string>
<string name="cpu_ticks">Ticks</string>
<string name="fast_cpu_time">CPU Clock</string>
<string name="fast_cpu_time_description">Use Boost (1700MHz) to run at the Switch\'s highest native clock, or Fast (2000MHz) to run at 2x clock.</string>
<string name="memory_layout">Memory Layout</string>

View File

@@ -259,6 +259,25 @@ struct Values {
true,
&use_fast_cpu_time};
SwitchableSetting<bool> use_custom_cpu_ticks{linkage,
false,
"use_custom_cpu_ticks",
Category::Cpu,
Specialization::Paired,
true,
true};
SwitchableSetting<u32, true> cpu_ticks{linkage,
16000,
77,
65535,
"cpu_ticks",
Category::Cpu,
Specialization::Countable,
true,
true,
&use_custom_cpu_ticks};
SwitchableSetting<bool> cpu_debug_mode{linkage, false, "cpu_debug_mode", Category::CpuDebug};
Setting<bool> cpuopt_page_tables{linkage, true, "cpuopt_page_tables", Category::CpuDebug};

View File

@@ -172,7 +172,9 @@ void CoreTiming::UnscheduleEvent(const std::shared_ptr<EventType>& event_type,
}
void CoreTiming::AddTicks(u64 ticks_to_add) {
cpu_ticks += ticks_to_add;
cpu_ticks = Settings::values.use_custom_cpu_ticks.GetValue()
? Settings::values.cpu_ticks.GetValue()
: cpu_ticks + ticks_to_add;
downcount -= static_cast<s64>(cpu_ticks);
}

View File

@@ -73,8 +73,9 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
} else if (setting->Id() == Settings::values.cpu_backend.Id()) {
backend_layout->addWidget(widget);
backend_combobox = widget->combobox;
} else if (setting->Id() == Settings::values.fast_cpu_time.Id()
|| setting->Id() == Settings::values.use_fast_cpu_time.Id()) {
} else if (setting->Id() == Settings::values.fast_cpu_time.Id()) {
ui->general_layout->addWidget(widget);
} else if (setting->Id() == Settings::values.cpu_ticks.Id()) {
ui->general_layout->addWidget(widget);
} else {
// Presently, all other settings here are unsafe checkboxes

View File

@@ -106,6 +106,13 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent)
tr("Overclocks the emulated CPU to remove some FPS limiters. Weaker CPUs may see reduced performance, "
"and certain games may behave improperly.\nUse Boost (1700MHz) to run at the Switch's highest native "
"clock, or Fast (2000MHz) to run at 2x clock."));
INSERT(Settings, use_custom_cpu_ticks, QString(), QString());
INSERT(Settings,
cpu_ticks,
tr("Custom CPU Ticks"),
tr("Set a custom value of CPU ticks. Higher values can increase performance, but may "
"also cause the game to freeze. A range of 7721000 is recommended."));
INSERT(Settings, cpu_backend, tr("Backend:"), QString());
// Cpu Debug