From 6e6446be83f6c2bc9f0ce74edf0669d1a7cd63a6 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 16 Sep 2020 11:49:02 +0200 Subject: [PATCH] Android: Add Wii SYSCONF settings to GUI Now that PR 8975 is merged, we can finally add this without hacks. https://bugs.dolphin-emu.org/issues/11605 --- .../settings/model/BooleanSetting.java | 9 ++++ .../features/settings/model/IntSetting.java | 10 ++++ .../features/settings/model/Settings.java | 1 + .../ui/SettingsFragmentPresenter.java | 22 ++++++++- .../app/src/main/res/values/arrays.xml | 48 +++++++++++++++++++ .../app/src/main/res/values/strings.xml | 13 ++++- Source/Android/jni/NativeConfig.cpp | 4 ++ 7 files changed, 104 insertions(+), 3 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java index 29269e40d3..59a7a7161c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java @@ -39,6 +39,12 @@ public enum BooleanSetting implements AbstractBooleanSetting MAIN_RECURSIVE_ISO_PATHS(Settings.FILE_DOLPHIN, Settings.SECTION_INI_GENERAL, "RecursiveISOPaths", false), + SYSCONF_SCREENSAVER(Settings.FILE_SYSCONF, "IPL", "SSV", false), + SYSCONF_WIDESCREEN(Settings.FILE_SYSCONF, "IPL", "AR", true), + SYSCONF_PAL60(Settings.FILE_SYSCONF, "IPL", "E60", true), + + SYSCONF_WIIMOTE_MOTOR(Settings.FILE_SYSCONF, "BT", "MOT", true), + GFX_WIDESCREEN_HACK(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "wideScreenHack", false), GFX_SHOW_FPS(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "ShowFPS", false), GFX_ENABLE_GPU_TEXTURE_DECODING(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, @@ -134,6 +140,9 @@ public enum BooleanSetting implements AbstractBooleanSetting @Override public boolean isRuntimeEditable() { + if (mFile.equals(Settings.FILE_SYSCONF)) + return false; + for (BooleanSetting setting : NOT_RUNTIME_EDITABLE) { if (setting == this) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java index 7fc265d38f..b6e0c6c290 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java @@ -20,6 +20,13 @@ public enum IntSetting implements AbstractIntSetting MAIN_LAST_PLATFORM_TAB(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "LastPlatformTab", 0), + SYSCONF_LANGUAGE(Settings.FILE_SYSCONF, "IPL", "LNG", 0x01), + SYSCONF_SOUND_MODE(Settings.FILE_SYSCONF, "IPL", "SND", 0x01), + + SYSCONF_SENSOR_BAR_POSITION(Settings.FILE_SYSCONF, "BT", "BAR", 0x01), + SYSCONF_SENSOR_BAR_SENSITIVITY(Settings.FILE_SYSCONF, "BT", "SENS", 0x03), + SYSCONF_SPEAKER_VOLUME(Settings.FILE_SYSCONF, "BT", "SPKV", 0x58), + GFX_ASPECT_RATIO(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "AspectRatio", 0), GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "SafeTextureCacheColorSamples", 128), @@ -73,6 +80,9 @@ public enum IntSetting implements AbstractIntSetting @Override public boolean isRuntimeEditable() { + if (mFile.equals(Settings.FILE_SYSCONF)) + return false; + for (IntSetting setting : NOT_RUNTIME_EDITABLE) { if (setting == this) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java index 5d650371c4..46222ed2e6 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java @@ -17,6 +17,7 @@ import java.util.Map; public class Settings implements Closeable { public static final String FILE_DOLPHIN = "Dolphin"; + public static final String FILE_SYSCONF = "SYSCONF"; public static final String FILE_GFX = "GFX"; public static final String FILE_LOGGER = "Logger"; public static final String FILE_GCPAD = "GCPadNew"; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java index fc60ec0ebe..f3855edc84 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java @@ -360,8 +360,8 @@ public final class SettingsFragmentPresenter private void addGameCubeSettings(ArrayList sl) { - sl.add(new SingleChoiceSetting(IntSetting.MAIN_GC_LANGUAGE, R.string.gamecube_system_language, - 0, R.array.gameCubeSystemLanguageEntries, R.array.gameCubeSystemLanguageValues)); + sl.add(new SingleChoiceSetting(IntSetting.MAIN_GC_LANGUAGE, R.string.system_language, 0, + R.array.gameCubeSystemLanguageEntries, R.array.gameCubeSystemLanguageValues)); sl.add(new SingleChoiceSetting(IntSetting.MAIN_SLOT_A, R.string.slot_a_device, 0, R.array.slotDeviceEntries, R.array.slotDeviceValues)); sl.add(new SingleChoiceSetting(IntSetting.MAIN_SLOT_B, R.string.slot_b_device, 0, @@ -370,10 +370,28 @@ public final class SettingsFragmentPresenter private void addWiiSettings(ArrayList sl) { + sl.add(new SingleChoiceSetting(IntSetting.SYSCONF_LANGUAGE, R.string.system_language, 0, + R.array.wiiSystemLanguageEntries, R.array.wiiSystemLanguageValues)); + sl.add(new CheckBoxSetting(BooleanSetting.SYSCONF_WIDESCREEN, R.string.wii_widescreen, + R.string.wii_widescreen_description)); + sl.add(new CheckBoxSetting(BooleanSetting.SYSCONF_PAL60, R.string.wii_pal60, + R.string.wii_pal60_description)); + sl.add(new CheckBoxSetting(BooleanSetting.SYSCONF_SCREENSAVER, R.string.wii_screensaver, + R.string.wii_screensaver_description)); + sl.add(new SingleChoiceSetting(IntSetting.SYSCONF_SOUND_MODE, R.string.sound_mode, 0, + R.array.soundModeEntries, R.array.soundModeValues)); sl.add(new CheckBoxSetting(BooleanSetting.MAIN_WII_SD_CARD, R.string.insert_sd_card, R.string.insert_sd_card_description)); sl.add(new CheckBoxSetting(BooleanSetting.MAIN_ALLOW_SD_WRITES, R.string.wii_sd_card_allow_writes, 0)); + sl.add(new CheckBoxSetting(BooleanSetting.SYSCONF_WIIMOTE_MOTOR, R.string.wiimote_rumble, 0)); + sl.add(new IntSliderSetting(IntSetting.SYSCONF_SPEAKER_VOLUME, R.string.wiimote_volume, 0, 0, + 127, "")); + sl.add(new IntSliderSetting(IntSetting.SYSCONF_SENSOR_BAR_SENSITIVITY, + R.string.sensor_bar_sensitivity, 0, 1, 5, "")); + sl.add(new SingleChoiceSetting(IntSetting.SYSCONF_SENSOR_BAR_POSITION, + R.string.sensor_bar_position, 0, R.array.sensorBarPositionEntries, + R.array.sensorBarPositionValues)); sl.add(new CheckBoxSetting(BooleanSetting.MAIN_WIIMOTE_CONTINUOUS_SCANNING, R.string.wiimote_scanning, R.string.wiimote_scanning_description)); sl.add(new CheckBoxSetting(BooleanSetting.MAIN_WIIMOTE_ENABLE_SPEAKER, R.string.wiimote_speaker, diff --git a/Source/Android/app/src/main/res/values/arrays.xml b/Source/Android/app/src/main/res/values/arrays.xml index 5adc40229d..275f6257a6 100644 --- a/Source/Android/app/src/main/res/values/arrays.xml +++ b/Source/Android/app/src/main/res/values/arrays.xml @@ -85,6 +85,54 @@ 8 + + + Japanese + English + German + French + Spanish + Italian + Dutch + Simplified Chinese + Traditional Chinese + Korean + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + + + + + Mono + Stereo + Surround + + + 0 + 1 + 2 + + + + + Top + Bottom + + + 1 + 0 + + Notice diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index 7ced055909..a600725e6e 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -128,13 +128,24 @@ Speed Limit (0% = Unlimited) WARNING: Changing this from the default (100%) WILL break games and cause glitches. Please do not report bugs that occur with a non-default clock. GameCube - System Language + System Language GameCube Slot A Device GameCube Slot B Device Wii + Widescreen + Changes aspect ratio from 4:3 to 16:9 in games that support it. + Use PAL60 Mode (EuRGB60) + Changes refresh rate from 50 Hz to 60 Hz in PAL games that support it. + Enable Screen Saver + Dims the screen after five minutes of inactivity. + Sound Insert SD Card Supports SD and SDHC. Default size is 128 MB. Allow Writes to SD Card + Wii Remote Rumble + Wii Remote Speaker Volume + Sensor Bar Sensitivity + Sensor Bar Position Wii Remote Continuous Scanning Leave this on if you are using a DolphinBar for real Wiimote support. Wii Remote Speaker diff --git a/Source/Android/jni/NativeConfig.cpp b/Source/Android/jni/NativeConfig.cpp index 3a3a5289c3..dfc90329af 100644 --- a/Source/Android/jni/NativeConfig.cpp +++ b/Source/Android/jni/NativeConfig.cpp @@ -25,6 +25,10 @@ static Config::Location GetLocation(JNIEnv* env, jstring file, jstring section, { system = Config::System::Main; } + else if (decoded_file == "SYSCONF") + { + system = Config::System::SYSCONF; + } else if (decoded_file == "GFX") { system = Config::System::GFX;