mirror of
https://github.com/mandarine3ds/mandarine.git
synced 2024-11-23 06:09:46 +00:00
android: add a listener for custom cpu ticks toggle
This commit is contained in:
parent
5b89098255
commit
33d1a7360a
@ -10,6 +10,7 @@ enum class BooleanSetting(
|
||||
override val defaultValue: Boolean
|
||||
) : AbstractBooleanSetting {
|
||||
EXPAND_TO_CUTOUT_AREA("expand_to_cutout_area", Settings.SECTION_LAYOUT, false),
|
||||
CUSTOM_CPU_TICKS("custom_cpu_ticks", Settings.SECTION_CORE, false),
|
||||
SPIRV_SHADER_GEN("spirv_shader_gen", Settings.SECTION_RENDERER, true),
|
||||
ASYNC_SHADERS("async_shader_compilation", Settings.SECTION_RENDERER, false),
|
||||
ADRENO_GPU_BOOST("adreno_gpu_boost", Settings.SECTION_RENDERER, false),
|
||||
|
@ -62,7 +62,6 @@ enum class IntSetting(
|
||||
DEBUG_RENDERER("renderer_debug", Settings.SECTION_DEBUG, 0),
|
||||
TEXTURE_FILTER("texture_filter", Settings.SECTION_RENDERER, 0),
|
||||
FRAME_SKIP("frame_skip", Settings.SECTION_CORE, 0),
|
||||
CUSTOM_CPU_TICKS("custom_cpu_ticks", Settings.SECTION_CORE, 0),
|
||||
CPU_TICKS("cpu_ticks", Settings.SECTION_CORE, 16000),
|
||||
USE_FRAME_LIMIT("use_frame_limit", Settings.SECTION_RENDERER, 1),
|
||||
DELAY_RENDER_THREAD_US("delay_game_render_thread_us", Settings.SECTION_RENDERER, 0),
|
||||
|
@ -232,27 +232,48 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
||||
IntSetting.FRAME_SKIP.defaultValue
|
||||
)
|
||||
)
|
||||
|
||||
val customCPUTicks: AbstractBooleanSetting = object : AbstractBooleanSetting {
|
||||
override var boolean: Boolean
|
||||
get() = preferences.getBoolean(BooleanSetting.CUSTOM_CPU_TICKS.key, false)
|
||||
set(value) {
|
||||
preferences.edit()
|
||||
.putBoolean(BooleanSetting.CUSTOM_CPU_TICKS.key, value)
|
||||
.apply()
|
||||
settingsActivity.recreate()
|
||||
}
|
||||
override val key: String? = null
|
||||
override val section: String? = null
|
||||
override val isRuntimeEditable: Boolean = true
|
||||
override val valueAsString: String
|
||||
get() = preferences.getBoolean(BooleanSetting.CUSTOM_CPU_TICKS.key, false)
|
||||
.toString()
|
||||
override val defaultValue: Any = false
|
||||
}
|
||||
|
||||
add(
|
||||
SwitchSetting(
|
||||
IntSetting.CUSTOM_CPU_TICKS,
|
||||
customCPUTicks,
|
||||
R.string.custom_cpu_ticks,
|
||||
R.string.custom_cpu_ticks_description,
|
||||
IntSetting.CUSTOM_CPU_TICKS.key,
|
||||
IntSetting.CUSTOM_CPU_TICKS.defaultValue
|
||||
R.string.custom_cpu_ticks_description
|
||||
)
|
||||
)
|
||||
add(
|
||||
SliderSetting(
|
||||
IntSetting.CPU_TICKS,
|
||||
R.string.cpu_ticks,
|
||||
0,
|
||||
77,
|
||||
65535,
|
||||
"",
|
||||
IntSetting.CPU_TICKS.key,
|
||||
IntSetting.CPU_TICKS.defaultValue.toFloat()
|
||||
|
||||
if (BooleanSetting.CUSTOM_CPU_TICKS.boolean) {
|
||||
add(
|
||||
SliderSetting(
|
||||
IntSetting.CPU_TICKS,
|
||||
R.string.cpu_ticks,
|
||||
0,
|
||||
77,
|
||||
65535,
|
||||
"",
|
||||
IntSetting.CPU_TICKS.key,
|
||||
IntSetting.CPU_TICKS.defaultValue.toFloat()
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
add(
|
||||
SwitchSetting(
|
||||
IntSetting.USE_FRAME_LIMIT,
|
||||
|
@ -160,7 +160,9 @@ void LogSettings() {
|
||||
log_setting("System_PluginLoaderAllowed", values.allow_plugin_loader.GetValue());
|
||||
log_setting("Debugging_DelayStartForLLEModules", values.delay_start_for_lle_modules.GetValue());
|
||||
log_setting("Debugging_UseGdbstub", values.use_gdbstub.GetValue());
|
||||
log_setting("Debugging_GdbstubPort", values.gdbstub_port.GetValue());
|
||||
if (values.use_gdbstub) {
|
||||
log_setting("Debugging_GdbstubPort", values.gdbstub_port.GetValue());
|
||||
}
|
||||
log_setting("Debugging_InstantDebugLog", values.instant_debug_log.GetValue());
|
||||
}
|
||||
|
||||
|
@ -550,7 +550,7 @@ struct Values {
|
||||
SwitchableSetting<bool> disable_flush_cpu_write{false, "disable_flush_cpu_write"};
|
||||
SwitchableSetting<bool> priority_boost_starved_threads{true, "priority_boost_starved_threads"};
|
||||
SwitchableSetting<bool> reduce_downcount_slice{false, "reduce_downcount_slice"};
|
||||
// Reimplementation of old (and fixed) citra frameskip
|
||||
// Reimplementation of old citra frameskip
|
||||
// See https://github.com/mandarine3ds/mandarine/commit/e279a6955edf644cf832dd329ac72931aea8add7
|
||||
SwitchableSetting<u64> frame_skip{0, "frame_skip"};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user