android: Add USE_AUTO_STUB setting

Implements the USE_AUTO_STUB setting in the Android frontend:

- Added USE_AUTO_STUB to BooleanSetting enum
- Added UI switch setting with description in SettingsItem
- Added setting to system settings section in SettingsFragmentPresenter
- Added string resources for setting title and description

The setting allows users to toggle automatic stubbing of missing services
and functions, which may improve compatibility at the cost of stability.
This commit is contained in:
Zephyron 2025-01-16 17:05:02 +10:00
parent f560ac024d
commit 3635b6e602
4 changed files with 15 additions and 1 deletions

View file

@ -26,7 +26,8 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
SHOW_PERFORMANCE_OVERLAY("show_performance_overlay"), SHOW_PERFORMANCE_OVERLAY("show_performance_overlay"),
SHOW_INPUT_OVERLAY("show_input_overlay"), SHOW_INPUT_OVERLAY("show_input_overlay"),
TOUCHSCREEN("touchscreen"), TOUCHSCREEN("touchscreen"),
SHOW_THERMAL_OVERLAY("show_thermal_overlay"); SHOW_THERMAL_OVERLAY("show_thermal_overlay"),
USE_AUTO_STUB("use_auto_stub");
override fun getBoolean(needsGlobal: Boolean): Boolean = override fun getBoolean(needsGlobal: Boolean): Boolean =
NativeConfig.getBoolean(key, needsGlobal) NativeConfig.getBoolean(key, needsGlobal)

View file

@ -386,6 +386,14 @@ abstract class SettingsItem(
override fun reset() = setBoolean(defaultValue) override fun reset() = setBoolean(defaultValue)
} }
put(SwitchSetting(fastmem, R.string.fastmem)) put(SwitchSetting(fastmem, R.string.fastmem))
put(
SwitchSetting(
BooleanSetting.USE_AUTO_STUB,
titleId = R.string.use_auto_stub,
descriptionId = R.string.use_auto_stub_description
)
)
} }
} }
} }

View file

@ -158,6 +158,7 @@ class SettingsFragmentPresenter(
add(BooleanSetting.RENDERER_USE_SPEED_LIMIT.key) add(BooleanSetting.RENDERER_USE_SPEED_LIMIT.key)
add(ShortSetting.RENDERER_SPEED_LIMIT.key) add(ShortSetting.RENDERER_SPEED_LIMIT.key)
add(BooleanSetting.USE_DOCKED_MODE.key) add(BooleanSetting.USE_DOCKED_MODE.key)
add(BooleanSetting.USE_AUTO_STUB.key)
add(IntSetting.REGION_INDEX.key) add(IntSetting.REGION_INDEX.key)
add(IntSetting.LANGUAGE_INDEX.key) add(IntSetting.LANGUAGE_INDEX.key)
add(BooleanSetting.USE_CUSTOM_RTC.key) add(BooleanSetting.USE_CUSTOM_RTC.key)

View file

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation"> <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<!-- Settings strings -->
<string name="use_auto_stub">Use Auto Stub</string>
<string name="use_auto_stub_description">Automatically stub missing services and functions. This may improve compatibility but can cause crashes and stability issues.</string>
<!-- General application strings --> <!-- General application strings -->
<string name="app_name" translatable="false">citron</string> <string name="app_name" translatable="false">citron</string>
<string name="app_disclaimer">This software will run games for the Nintendo Switch game console. No game titles or keys are included.&lt;br /&gt;&lt;br /&gt;Before you begin, please locate your <![CDATA[<b> prod.keys </b>]]> file on your device storage.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href="https://citron-emu.org/help/quickstart">Learn more</a>]]></string> <string name="app_disclaimer">This software will run games for the Nintendo Switch game console. No game titles or keys are included.&lt;br /&gt;&lt;br /&gt;Before you begin, please locate your <![CDATA[<b> prod.keys </b>]]> file on your device storage.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href="https://citron-emu.org/help/quickstart">Learn more</a>]]></string>