From 011a54622945a547525a7946be4f42392ef4c365 Mon Sep 17 00:00:00 2001 From: Zephyron Date: Tue, 5 Aug 2025 17:29:45 +1000 Subject: [PATCH] android: Add applet mode settings to UI Add comprehensive applet mode configuration options to the Android settings interface. This includes settings for all major applets: - Cabinet applet mode - Controller applet mode - Data Erase applet mode - Error applet mode - Network Connect applet mode - Player Select applet mode - Software Keyboard applet mode - Mii Edit applet mode - Web applet mode - Shop applet mode - Photo Viewer applet mode - Offline Web applet mode - Login Share applet mode - WiFi Web Auth applet mode - My Page applet mode Each setting allows users to choose between HLE (High-Level Emulation) and LLE (Low-Level Emulation) modes for individual applets, providing granular control over applet emulation behavior. Changes: - Add applet mode settings to IntSetting enum - Add corresponding string resources for all applet settings - Add applet mode choice arrays (HLE/LLE options) - Add applet settings section to SettingsItem mapping - Add applet settings header and all applet mode settings to SettingsFragmentPresenter Signed-off-by: Zephyron --- .../features/settings/model/IntSetting.kt | 19 ++- .../settings/model/view/SettingsItem.kt | 137 ++++++++++++++++++ .../settings/ui/SettingsFragmentPresenter.kt | 17 +++ .../app/src/main/res/values/arrays.xml | 11 ++ .../app/src/main/res/values/strings.xml | 33 +++++ 5 files changed, 216 insertions(+), 1 deletion(-) diff --git a/src/android/app/src/main/java/org/citron/citron_emu/features/settings/model/IntSetting.kt b/src/android/app/src/main/java/org/citron/citron_emu/features/settings/model/IntSetting.kt index 9aa4b5902..2d8d74f8f 100644 --- a/src/android/app/src/main/java/org/citron/citron_emu/features/settings/model/IntSetting.kt +++ b/src/android/app/src/main/java/org/citron/citron_emu/features/settings/model/IntSetting.kt @@ -35,7 +35,24 @@ enum class IntSetting(override val key: String) : AbstractIntSetting { ASTC_DECODE_MODE("accelerate_astc"), ASTC_RECOMPRESSION("astc_recompression"), SHADER_BACKEND("shader_backend"), - VRAM_USAGE_MODE("vram_usage_mode"); + VRAM_USAGE_MODE("vram_usage_mode"), + + // Applet Mode settings + CABINET_APPLET_MODE("cabinet_applet_mode"), + CONTROLLER_APPLET_MODE("controller_applet_mode"), + DATA_ERASE_APPLET_MODE("data_erase_applet_mode"), + ERROR_APPLET_MODE("error_applet_mode"), + NET_CONNECT_APPLET_MODE("net_connect_applet_mode"), + PLAYER_SELECT_APPLET_MODE("player_select_applet_mode"), + SWKBD_APPLET_MODE("swkbd_applet_mode"), + MII_EDIT_APPLET_MODE("mii_edit_applet_mode"), + WEB_APPLET_MODE("web_applet_mode"), + SHOP_APPLET_MODE("shop_applet_mode"), + PHOTO_VIEWER_APPLET_MODE("photo_viewer_applet_mode"), + OFFLINE_WEB_APPLET_MODE("offline_web_applet_mode"), + LOGIN_SHARE_APPLET_MODE("login_share_applet_mode"), + WIFI_WEB_AUTH_APPLET_MODE("wifi_web_auth_applet_mode"), + MY_PAGE_APPLET_MODE("my_page_applet_mode"); override fun getInt(needsGlobal: Boolean): Int = NativeConfig.getInt(key, needsGlobal) diff --git a/src/android/app/src/main/java/org/citron/citron_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/citron/citron_emu/features/settings/model/view/SettingsItem.kt index 8a5765166..fe5f12d45 100644 --- a/src/android/app/src/main/java/org/citron/citron_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/citron/citron_emu/features/settings/model/view/SettingsItem.kt @@ -443,6 +443,143 @@ abstract class SettingsItem( valuesId = R.array.vramUsageModeValues ) ) + + // Applet Mode Settings + put( + SingleChoiceSetting( + IntSetting.CABINET_APPLET_MODE, + titleId = R.string.cabinet_applet_mode, + descriptionId = R.string.cabinet_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.CONTROLLER_APPLET_MODE, + titleId = R.string.controller_applet_mode, + descriptionId = R.string.controller_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.DATA_ERASE_APPLET_MODE, + titleId = R.string.data_erase_applet_mode, + descriptionId = R.string.data_erase_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.ERROR_APPLET_MODE, + titleId = R.string.error_applet_mode, + descriptionId = R.string.error_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.NET_CONNECT_APPLET_MODE, + titleId = R.string.net_connect_applet_mode, + descriptionId = R.string.net_connect_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.PLAYER_SELECT_APPLET_MODE, + titleId = R.string.player_select_applet_mode, + descriptionId = R.string.player_select_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.SWKBD_APPLET_MODE, + titleId = R.string.swkbd_applet_mode, + descriptionId = R.string.swkbd_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.MII_EDIT_APPLET_MODE, + titleId = R.string.mii_edit_applet_mode, + descriptionId = R.string.mii_edit_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.WEB_APPLET_MODE, + titleId = R.string.web_applet_mode, + descriptionId = R.string.web_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.SHOP_APPLET_MODE, + titleId = R.string.shop_applet_mode, + descriptionId = R.string.shop_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.PHOTO_VIEWER_APPLET_MODE, + titleId = R.string.photo_viewer_applet_mode, + descriptionId = R.string.photo_viewer_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.OFFLINE_WEB_APPLET_MODE, + titleId = R.string.offline_web_applet_mode, + descriptionId = R.string.offline_web_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.LOGIN_SHARE_APPLET_MODE, + titleId = R.string.login_share_applet_mode, + descriptionId = R.string.login_share_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.WIFI_WEB_AUTH_APPLET_MODE, + titleId = R.string.wifi_web_auth_applet_mode, + descriptionId = R.string.wifi_web_auth_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) + put( + SingleChoiceSetting( + IntSetting.MY_PAGE_APPLET_MODE, + titleId = R.string.my_page_applet_mode, + descriptionId = R.string.my_page_applet_mode_description, + choicesId = R.array.appletModeNames, + valuesId = R.array.appletModeValues + ) + ) } } } diff --git a/src/android/app/src/main/java/org/citron/citron_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/citron/citron_emu/features/settings/ui/SettingsFragmentPresenter.kt index 3f8bd9e09..d6936c764 100644 --- a/src/android/app/src/main/java/org/citron/citron_emu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/src/android/app/src/main/java/org/citron/citron_emu/features/settings/ui/SettingsFragmentPresenter.kt @@ -996,6 +996,23 @@ class SettingsFragmentPresenter( add(HeaderSetting(R.string.advanced_graphics_header)) add(IntSetting.SHADER_BACKEND.key) add(IntSetting.VRAM_USAGE_MODE.key) + + add(HeaderSetting(R.string.applet_settings_header)) + add(IntSetting.CABINET_APPLET_MODE.key) + add(IntSetting.CONTROLLER_APPLET_MODE.key) + add(IntSetting.DATA_ERASE_APPLET_MODE.key) + add(IntSetting.ERROR_APPLET_MODE.key) + add(IntSetting.NET_CONNECT_APPLET_MODE.key) + add(IntSetting.PLAYER_SELECT_APPLET_MODE.key) + add(IntSetting.SWKBD_APPLET_MODE.key) + add(IntSetting.MII_EDIT_APPLET_MODE.key) + add(IntSetting.WEB_APPLET_MODE.key) + add(IntSetting.SHOP_APPLET_MODE.key) + add(IntSetting.PHOTO_VIEWER_APPLET_MODE.key) + add(IntSetting.OFFLINE_WEB_APPLET_MODE.key) + add(IntSetting.LOGIN_SHARE_APPLET_MODE.key) + add(IntSetting.WIFI_WEB_AUTH_APPLET_MODE.key) + add(IntSetting.MY_PAGE_APPLET_MODE.key) } } } diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index 62d98fcbc..53ffc7eb1 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -386,4 +386,15 @@ 1 + + + HLE (High-Level Emulation) + LLE (Low-Level Emulation) + + + + 0 + 1 + + diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index df19d9491..24946ddd1 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -423,6 +423,39 @@ Memory Layout ASTC Settings Advanced Graphics + Applet Settings + + + Cabinet Applet Mode + Controls how the Cabinet applet is emulated (HLE/LLE) + Controller Applet Mode + Controls how the Controller applet is emulated (HLE/LLE) + Data Erase Applet Mode + Controls how the Data Erase applet is emulated (HLE/LLE) + Error Applet Mode + Controls how the Error applet is emulated (HLE/LLE) + Network Connect Applet Mode + Controls how the Network Connect applet is emulated (HLE/LLE) + Player Select Applet Mode + Controls how the Player Select applet is emulated (HLE/LLE) + Software Keyboard Applet Mode + Controls how the Software Keyboard applet is emulated (HLE/LLE) + Mii Edit Applet Mode + Controls how the Mii Edit applet is emulated (HLE/LLE) + Web Applet Mode + Controls how the Web applet is emulated (HLE/LLE) + Shop Applet Mode + Controls how the Shop applet is emulated (HLE/LLE) + Photo Viewer Applet Mode + Controls how the Photo Viewer applet is emulated (HLE/LLE) + Offline Web Applet Mode + Controls how the Offline Web applet is emulated (HLE/LLE) + Login Share Applet Mode + Controls how the Login Share applet is emulated (HLE/LLE) + WiFi Web Auth Applet Mode + Controls how the WiFi Web Auth applet is emulated (HLE/LLE) + My Page Applet Mode + Controls how the My Page applet is emulated (HLE/LLE) Info