android: Expose CPU debugging option

This commit is contained in:
Charles Lombardo 2023-06-15 17:05:17 -04:00
parent 3ac2c74e85
commit 13a4de647d
5 changed files with 30 additions and 23 deletions

View file

@ -8,6 +8,7 @@ enum class BooleanSetting(
override val section: String, override val section: String,
override val defaultValue: Boolean override val defaultValue: Boolean
) : AbstractBooleanSetting { ) : AbstractBooleanSetting {
CPU_DEBUG_MODE("cpu_debug_mode", Settings.SECTION_CPU, false),
FASTMEM("cpuopt_fastmem", Settings.SECTION_CPU, true), FASTMEM("cpuopt_fastmem", Settings.SECTION_CPU, true),
FASTMEM_EXCLUSIVES("cpuopt_fastmem_exclusives", Settings.SECTION_CPU, true), FASTMEM_EXCLUSIVES("cpuopt_fastmem_exclusives", Settings.SECTION_CPU, true),
PICTURE_IN_PICTURE("picture_in_picture", Settings.SECTION_GENERAL, true), PICTURE_IN_PICTURE("picture_in_picture", Settings.SECTION_GENERAL, true),

View file

@ -3,12 +3,8 @@
package org.yuzu.yuzu_emu.features.settings.model.view package org.yuzu.yuzu_emu.features.settings.model.view
import org.yuzu.yuzu_emu.features.settings.model.AbstractSetting
class HeaderSetting( class HeaderSetting(
setting: AbstractSetting?, titleId: Int
titleId: Int, ) : SettingsItem(null, titleId, 0) {
descriptionId: Int
) : SettingsItem(setting, titleId, descriptionId) {
override val type = TYPE_HEADER override val type = TYPE_HEADER
} }

View file

@ -467,6 +467,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
private fun addDebugSettings(sl: ArrayList<SettingsItem>) { private fun addDebugSettings(sl: ArrayList<SettingsItem>) {
settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_debug)) settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_debug))
sl.apply { sl.apply {
add(HeaderSetting(R.string.gpu))
add( add(
SingleChoiceSetting( SingleChoiceSetting(
IntSetting.RENDERER_BACKEND, IntSetting.RENDERER_BACKEND,
@ -488,6 +489,17 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
) )
) )
add(HeaderSetting(R.string.cpu))
add(
SwitchSetting(
BooleanSetting.CPU_DEBUG_MODE,
R.string.cpu_debug_mode,
R.string.cpu_debug_mode_description,
BooleanSetting.CPU_DEBUG_MODE.key,
BooleanSetting.CPU_DEBUG_MODE.defaultValue
)
)
val fastmem = object : AbstractBooleanSetting { val fastmem = object : AbstractBooleanSetting {
override var boolean: Boolean override var boolean: Boolean
get() = get() =

View file

@ -1,20 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.google.android.material.textview.MaterialTextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/text_header_name"
style="@style/TextAppearance.Material3.TitleSmall"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="wrap_content"
android:paddingVertical="4dp" android:layout_gravity="start|center_vertical"
android:paddingHorizontal="@dimen/spacing_large"> android:paddingHorizontal="@dimen/spacing_large"
android:paddingVertical="16dp"
<com.google.android.material.textview.MaterialTextView android:textAlignment="viewStart"
style="@style/TextAppearance.Material3.TitleSmall" android:textColor="?attr/colorPrimary"
android:id="@+id/text_header_name" android:textStyle="bold"
android:layout_width="match_parent" tools:text="CPU Settings" />
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:textColor="?attr/colorPrimary"
android:textAlignment="viewStart"
android:textStyle="bold"
tools:text="CPU Settings" />
</FrameLayout>

View file

@ -175,6 +175,10 @@
<string name="use_disk_shader_cache_description">Reduces stuttering by locally storing and loading generated shaders.</string> <string name="use_disk_shader_cache_description">Reduces stuttering by locally storing and loading generated shaders.</string>
<!-- Debug settings strings --> <!-- Debug settings strings -->
<string name="cpu">CPU</string>
<string name="cpu_debug_mode">CPU Debugging</string>
<string name="cpu_debug_mode_description">Puts the CPU in a slow debugging mode.</string>
<string name="gpu">GPU</string>
<string name="renderer_api">API</string> <string name="renderer_api">API</string>
<string name="renderer_debug">Graphics debugging</string> <string name="renderer_debug">Graphics debugging</string>
<string name="renderer_debug_description">Sets the graphics API to a slow debugging mode.</string> <string name="renderer_debug_description">Sets the graphics API to a slow debugging mode.</string>