mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #9088 from JosJuice/android-sysconf
Android: Add Wii SYSCONF settings to GUI
This commit is contained in:
commit
f33767f19c
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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";
|
||||
|
@ -8,10 +8,10 @@ public class FloatSliderSetting extends SliderSetting
|
||||
{
|
||||
protected AbstractFloatSetting mSetting;
|
||||
|
||||
public FloatSliderSetting(AbstractFloatSetting setting, int titleId, int descriptionId, int max,
|
||||
String units)
|
||||
public FloatSliderSetting(AbstractFloatSetting setting, int titleId, int descriptionId, int min,
|
||||
int max, String units)
|
||||
{
|
||||
super(titleId, descriptionId, max, units);
|
||||
super(titleId, descriptionId, min, max, units);
|
||||
mSetting = setting;
|
||||
}
|
||||
|
||||
|
@ -8,10 +8,10 @@ public final class IntSliderSetting extends SliderSetting
|
||||
{
|
||||
private AbstractIntSetting mSetting;
|
||||
|
||||
public IntSliderSetting(AbstractIntSetting setting, int titleId, int descriptionId, int max,
|
||||
String units)
|
||||
public IntSliderSetting(AbstractIntSetting setting, int titleId, int descriptionId, int min,
|
||||
int max, String units)
|
||||
{
|
||||
super(titleId, descriptionId, max, units);
|
||||
super(titleId, descriptionId, min, max, units);
|
||||
mSetting = setting;
|
||||
}
|
||||
|
||||
|
@ -6,10 +6,10 @@ import org.dolphinemu.dolphinemu.features.settings.model.Settings;
|
||||
|
||||
public final class PercentSliderSetting extends FloatSliderSetting
|
||||
{
|
||||
public PercentSliderSetting(AbstractFloatSetting setting, int titleId, int descriptionId, int max,
|
||||
String units)
|
||||
public PercentSliderSetting(AbstractFloatSetting setting, int titleId, int descriptionId, int min,
|
||||
int max, String units)
|
||||
{
|
||||
super(setting, titleId, descriptionId, max, units);
|
||||
super(setting, titleId, descriptionId, min, max, units);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,18 +4,25 @@ import org.dolphinemu.dolphinemu.features.settings.model.Settings;
|
||||
|
||||
public abstract class SliderSetting extends SettingsItem
|
||||
{
|
||||
private int mMin;
|
||||
private int mMax;
|
||||
private String mUnits;
|
||||
|
||||
public SliderSetting(int nameId, int descriptionId, int max, String units)
|
||||
public SliderSetting(int nameId, int descriptionId, int min, int max, String units)
|
||||
{
|
||||
super(nameId, descriptionId);
|
||||
mMin = min;
|
||||
mMax = max;
|
||||
mUnits = units;
|
||||
}
|
||||
|
||||
public abstract int getSelectedValue(Settings settings);
|
||||
|
||||
public int getMin()
|
||||
{
|
||||
return mMin;
|
||||
}
|
||||
|
||||
public int getMax()
|
||||
{
|
||||
return mMax;
|
||||
|
@ -239,6 +239,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||
|
||||
SeekBar seekbar = view.findViewById(R.id.seekbar);
|
||||
|
||||
seekbar.setMin(item.getMin());
|
||||
seekbar.setMax(item.getMax());
|
||||
seekbar.setProgress(mSeekbarProgress);
|
||||
seekbar.setKeyProgressIncrement(5);
|
||||
|
@ -234,8 +234,8 @@ public final class SettingsFragmentPresenter
|
||||
sl.add(new CheckBoxSetting(BooleanSetting.MAIN_OVERRIDE_REGION_SETTINGS,
|
||||
R.string.override_region_settings, 0));
|
||||
sl.add(new CheckBoxSetting(BooleanSetting.MAIN_AUTO_DISC_CHANGE, R.string.auto_disc_change, 0));
|
||||
sl.add(new PercentSliderSetting(FloatSetting.MAIN_EMULATION_SPEED, R.string.speed_limit, 0, 200,
|
||||
"%"));
|
||||
sl.add(new PercentSliderSetting(FloatSetting.MAIN_EMULATION_SPEED, R.string.speed_limit, 0, 0,
|
||||
200, "%"));
|
||||
sl.add(new CheckBoxSetting(BooleanSetting.MAIN_ANALYTICS_ENABLED, R.string.analytics, 0));
|
||||
sl.add(new CheckBoxSetting(BooleanSetting.MAIN_ENABLE_SAVESTATES, R.string.enable_save_states,
|
||||
R.string.enable_save_states_description));
|
||||
@ -334,7 +334,8 @@ public final class SettingsFragmentPresenter
|
||||
dspEngineEntries, dspEngineValues));
|
||||
sl.add(new CheckBoxSetting(BooleanSetting.MAIN_AUDIO_STRETCH, R.string.audio_stretch,
|
||||
R.string.audio_stretch_description));
|
||||
sl.add(new IntSliderSetting(IntSetting.MAIN_AUDIO_VOLUME, R.string.audio_volume, 0, 100, "%"));
|
||||
sl.add(new IntSliderSetting(IntSetting.MAIN_AUDIO_VOLUME, R.string.audio_volume, 0, 0, 100,
|
||||
"%"));
|
||||
}
|
||||
|
||||
private void addPathsSettings(ArrayList<SettingsItem> sl)
|
||||
@ -359,8 +360,8 @@ public final class SettingsFragmentPresenter
|
||||
|
||||
private void addGameCubeSettings(ArrayList<SettingsItem> 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,
|
||||
@ -369,10 +370,28 @@ public final class SettingsFragmentPresenter
|
||||
|
||||
private void addWiiSettings(ArrayList<SettingsItem> 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,
|
||||
@ -407,7 +426,7 @@ public final class SettingsFragmentPresenter
|
||||
sl.add(new CheckBoxSetting(BooleanSetting.MAIN_OVERCLOCK_ENABLE, R.string.overclock_enable,
|
||||
R.string.overclock_enable_description));
|
||||
sl.add(new PercentSliderSetting(FloatSetting.MAIN_OVERCLOCK, R.string.overclock_title,
|
||||
R.string.overclock_title_description, 400, "%"));
|
||||
R.string.overclock_title_description, 0, 400, "%"));
|
||||
}
|
||||
|
||||
private void addGcPadSettings(ArrayList<SettingsItem> sl)
|
||||
@ -649,9 +668,9 @@ public final class SettingsFragmentPresenter
|
||||
sl.add(new SingleChoiceSetting(IntSetting.GFX_STEREO_MODE, R.string.stereoscopy_mode, 0,
|
||||
R.array.stereoscopyEntries, R.array.stereoscopyValues));
|
||||
sl.add(new IntSliderSetting(IntSetting.GFX_STEREO_DEPTH, R.string.stereoscopy_depth,
|
||||
R.string.stereoscopy_depth_description, 100, "%"));
|
||||
R.string.stereoscopy_depth_description, 0, 100, "%"));
|
||||
sl.add(new IntSliderSetting(IntSetting.GFX_STEREO_CONVERGENCE_PERCENTAGE,
|
||||
R.string.stereoscopy_convergence, R.string.stereoscopy_convergence_description, 200,
|
||||
R.string.stereoscopy_convergence, R.string.stereoscopy_convergence_description, 0, 200,
|
||||
"%"));
|
||||
sl.add(new CheckBoxSetting(BooleanSetting.GFX_STEREO_SWAP_EYES, R.string.stereoscopy_swap_eyes,
|
||||
R.string.stereoscopy_swap_eyes_description));
|
||||
|
@ -85,6 +85,54 @@
|
||||
<item>8</item>
|
||||
</integer-array>
|
||||
|
||||
<!-- GameCube System Languages -->
|
||||
<string-array name="wiiSystemLanguageEntries">
|
||||
<item>Japanese</item>
|
||||
<item>English</item>
|
||||
<item>German</item>
|
||||
<item>French</item>
|
||||
<item>Spanish</item>
|
||||
<item>Italian</item>
|
||||
<item>Dutch</item>
|
||||
<item>Simplified Chinese</item>
|
||||
<item>Traditional Chinese</item>
|
||||
<item>Korean</item>
|
||||
</string-array>
|
||||
<integer-array name="wiiSystemLanguageValues" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>6</item>
|
||||
<item>7</item>
|
||||
<item>8</item>
|
||||
<item>9</item>
|
||||
</integer-array>
|
||||
|
||||
<!-- Sound Mode -->
|
||||
<string-array name="soundModeEntries">
|
||||
<item>Mono</item>
|
||||
<item>Stereo</item>
|
||||
<item>Surround</item>
|
||||
</string-array>
|
||||
<integer-array name="soundModeValues" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</integer-array>
|
||||
|
||||
<!-- Sensor Bar Position -->
|
||||
<string-array name="sensorBarPositionEntries">
|
||||
<item>Top</item>
|
||||
<item>Bottom</item>
|
||||
</string-array>
|
||||
<integer-array name="sensorBarPositionValues" translatable="false">
|
||||
<item>1</item>
|
||||
<item>0</item>
|
||||
</integer-array>
|
||||
|
||||
<!-- Log Verbosity selection based on LOG_LEVELS in Common/Logging/Log.h -->
|
||||
<string-array name="logVerbosityEntriesMaxLevelInfo" translatable="false">
|
||||
<item>Notice</item>
|
||||
|
@ -128,13 +128,24 @@
|
||||
<string name="speed_limit">Speed Limit (0% = Unlimited)</string>
|
||||
<string name="overclock_warning">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.</string>
|
||||
<string name="gamecube_submenu">GameCube</string>
|
||||
<string name="gamecube_system_language">System Language</string>
|
||||
<string name="system_language">System Language</string>
|
||||
<string name="slot_a_device">GameCube Slot A Device</string>
|
||||
<string name="slot_b_device">GameCube Slot B Device</string>
|
||||
<string name="wii_submenu">Wii</string>
|
||||
<string name="wii_widescreen">Widescreen</string>
|
||||
<string name="wii_widescreen_description">Changes aspect ratio from 4:3 to 16:9 in games that support it.</string>
|
||||
<string name="wii_pal60">Use PAL60 Mode (EuRGB60)</string>
|
||||
<string name="wii_pal60_description">Changes refresh rate from 50 Hz to 60 Hz in PAL games that support it.</string>
|
||||
<string name="wii_screensaver">Enable Screen Saver</string>
|
||||
<string name="wii_screensaver_description">Dims the screen after five minutes of inactivity.</string>
|
||||
<string name="sound_mode">Sound</string>
|
||||
<string name="insert_sd_card">Insert SD Card</string>
|
||||
<string name="insert_sd_card_description">Supports SD and SDHC. Default size is 128 MB.</string>
|
||||
<string name="wii_sd_card_allow_writes">Allow Writes to SD Card</string>
|
||||
<string name="wiimote_rumble">Wii Remote Rumble</string>
|
||||
<string name="wiimote_volume">Wii Remote Speaker Volume</string>
|
||||
<string name="sensor_bar_sensitivity">Sensor Bar Sensitivity</string>
|
||||
<string name="sensor_bar_position">Sensor Bar Position</string>
|
||||
<string name="wiimote_scanning">Wii Remote Continuous Scanning</string>
|
||||
<string name="wiimote_scanning_description">Leave this on if you are using a DolphinBar for real Wiimote support.</string>
|
||||
<string name="wiimote_speaker">Wii Remote Speaker</string>
|
||||
|
@ -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;
|
||||
|
@ -401,7 +401,8 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
|
||||
{
|
||||
const u32 wii_language =
|
||||
static_cast<u32>(StartUp.GetLanguageAdjustedForRegion(true, StartUp.m_region));
|
||||
Config::SetCurrent(Config::SYSCONF_LANGUAGE, wii_language);
|
||||
if (wii_language != Config::Get(Config::SYSCONF_LANGUAGE))
|
||||
Config::SetCurrent(Config::SYSCONF_LANGUAGE, wii_language);
|
||||
|
||||
const u8 country_code = static_cast<u8>(Config::Get(Config::SYSCONF_COUNTRY));
|
||||
if (StartUp.m_region != DiscIO::SysConfCountryToRegion(country_code))
|
||||
@ -429,7 +430,7 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
|
||||
|
||||
// Some NTSC Wii games such as Doc Louis's Punch-Out!! and
|
||||
// 1942 (Virtual Console) crash if the PAL60 option is enabled
|
||||
if (StartUp.bWii && DiscIO::IsNTSC(StartUp.m_region))
|
||||
if (StartUp.bWii && DiscIO::IsNTSC(StartUp.m_region) && Config::Get(Config::SYSCONF_PAL60))
|
||||
Config::SetCurrent(Config::SYSCONF_PAL60, false);
|
||||
|
||||
// Ensure any new settings are written to the SYSCONF
|
||||
|
@ -16,8 +16,8 @@ namespace ConfigLoaders
|
||||
{
|
||||
bool IsSettingSaveable(const Config::Location& config_location)
|
||||
{
|
||||
for (Config::System system :
|
||||
{Config::System::GFX, Config::System::DualShockUDPClient, Config::System::Logger})
|
||||
for (Config::System system : {Config::System::SYSCONF, Config::System::GFX,
|
||||
Config::System::DualShockUDPClient, Config::System::Logger})
|
||||
{
|
||||
if (config_location.system == system)
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user