mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Android: Split General settings
This commit is contained in:
parent
1b97f081b8
commit
fba1e3c7ca
@ -5,9 +5,11 @@ public enum MenuTag
|
||||
CONFIG("config"),
|
||||
CONFIG_GENERAL("config_general"),
|
||||
CONFIG_INTERFACE("config_interface"),
|
||||
CONFIG_AUDIO("audio"),
|
||||
CONFIG_PATHS("config_paths"),
|
||||
CONFIG_GAME_CUBE("config_gamecube"),
|
||||
CONFIG_WII("config_wii"),
|
||||
CONFIG_ADVANCED("config_advanced"),
|
||||
WIIMOTE("wiimote"),
|
||||
WIIMOTE_EXTENSION("wiimote_extension"),
|
||||
GCPAD_TYPE("gc_pad_type"),
|
||||
|
@ -38,9 +38,11 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
|
||||
titles.put(MenuTag.CONFIG, R.string.preferences_settings);
|
||||
titles.put(MenuTag.CONFIG_GENERAL, R.string.general_submenu);
|
||||
titles.put(MenuTag.CONFIG_INTERFACE, R.string.interface_submenu);
|
||||
titles.put(MenuTag.CONFIG_AUDIO, R.string.audio_submenu);
|
||||
titles.put(MenuTag.CONFIG_PATHS, R.string.paths_submenu);
|
||||
titles.put(MenuTag.CONFIG_GAME_CUBE, R.string.gamecube_submenu);
|
||||
titles.put(MenuTag.CONFIG_WII, R.string.wii_submenu);
|
||||
titles.put(MenuTag.CONFIG_ADVANCED, R.string.advanced_submenu);
|
||||
titles.put(MenuTag.WIIMOTE, R.string.grid_menu_wiimote_settings);
|
||||
titles.put(MenuTag.WIIMOTE_EXTENSION, R.string.wiimote_extensions);
|
||||
titles.put(MenuTag.GCPAD_TYPE, R.string.grid_menu_gcpad_settings);
|
||||
|
@ -136,6 +136,10 @@ public final class SettingsFragmentPresenter
|
||||
addInterfaceSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_AUDIO:
|
||||
addAudioSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_PATHS:
|
||||
addPathsSettings(sl);
|
||||
break;
|
||||
@ -148,6 +152,10 @@ public final class SettingsFragmentPresenter
|
||||
addWiiSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_ADVANCED:
|
||||
addAdvancedSettings(sl);
|
||||
break;
|
||||
|
||||
case GRAPHICS:
|
||||
addGraphicsSettings(sl);
|
||||
break;
|
||||
@ -210,90 +218,47 @@ public final class SettingsFragmentPresenter
|
||||
{
|
||||
sl.add(new SubmenuSetting(null, null, R.string.general_submenu, 0, MenuTag.CONFIG_GENERAL));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.interface_submenu, 0, MenuTag.CONFIG_INTERFACE));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.audio_submenu, 0, MenuTag.CONFIG_AUDIO));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.paths_submenu, 0, MenuTag.CONFIG_PATHS));
|
||||
|
||||
sl.add(new SubmenuSetting(null, null, R.string.gamecube_submenu, 0, MenuTag.CONFIG_GAME_CUBE));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.wii_submenu, 0, MenuTag.CONFIG_WII));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.advanced_submenu, 0, MenuTag.CONFIG_ADVANCED));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.debug_submenu, 0, MenuTag.DEBUG));
|
||||
sl.add(new HeaderSetting(null, null, R.string.gametdb_thanks, 0));
|
||||
}
|
||||
|
||||
private void addGeneralSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting cpuCore = null;
|
||||
Setting dualCore = null;
|
||||
Setting overclockEnable = null;
|
||||
Setting overclock = null;
|
||||
Setting speedLimit = null;
|
||||
Setting audioStretch = null;
|
||||
Setting audioVolume = null;
|
||||
Setting overrideRegionSettings = null;
|
||||
Setting autoDiscChange = null;
|
||||
Setting speedLimit = null;
|
||||
Setting analytics = null;
|
||||
Setting enableSaveState;
|
||||
Setting enableSaveState = null;
|
||||
|
||||
SettingSection coreSection = mSettings.getSection(Settings.SECTION_INI_CORE);
|
||||
SettingSection dspSection = mSettings.getSection(Settings.SECTION_INI_DSP);
|
||||
SettingSection analyticsSection = mSettings.getSection(Settings.SECTION_ANALYTICS);
|
||||
cpuCore = coreSection.getSetting(SettingsFile.KEY_CPU_CORE);
|
||||
dualCore = coreSection.getSetting(SettingsFile.KEY_DUAL_CORE);
|
||||
overclockEnable = coreSection.getSetting(SettingsFile.KEY_OVERCLOCK_ENABLE);
|
||||
overclock = coreSection.getSetting(SettingsFile.KEY_OVERCLOCK_PERCENT);
|
||||
speedLimit = coreSection.getSetting(SettingsFile.KEY_SPEED_LIMIT);
|
||||
audioStretch = coreSection.getSetting(SettingsFile.KEY_AUDIO_STRETCH);
|
||||
audioVolume = dspSection.getSetting(SettingsFile.KEY_AUDIO_VOLUME);
|
||||
overrideRegionSettings = coreSection.getSetting(SettingsFile.KEY_OVERRIDE_REGION_SETTINGS);
|
||||
autoDiscChange = coreSection.getSetting(SettingsFile.KEY_AUTO_DISC_CHANGE);
|
||||
speedLimit = coreSection.getSetting(SettingsFile.KEY_SPEED_LIMIT);
|
||||
analytics = analyticsSection.getSetting(SettingsFile.KEY_ANALYTICS_ENABLED);
|
||||
enableSaveState = coreSection.getSetting(SettingsFile.KEY_ENABLE_SAVE_STATES);
|
||||
|
||||
// TODO: Having different emuCoresEntries/emuCoresValues for each architecture is annoying.
|
||||
// The proper solution would be to have one emuCoresEntries and one emuCoresValues
|
||||
// and exclude the values that aren't present in PowerPC::AvailableCPUCores().
|
||||
int defaultCpuCore = NativeLibrary.DefaultCPUCore();
|
||||
int emuCoresEntries;
|
||||
int emuCoresValues;
|
||||
if (defaultCpuCore == 1) // x86-64
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesX86_64;
|
||||
emuCoresValues = R.array.emuCoresValuesX86_64;
|
||||
}
|
||||
else if (defaultCpuCore == 4) // AArch64
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesARM64;
|
||||
emuCoresValues = R.array.emuCoresValuesARM64;
|
||||
}
|
||||
else
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesGeneric;
|
||||
emuCoresValues = R.array.emuCoresValuesGeneric;
|
||||
}
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_CPU_CORE, Settings.SECTION_INI_CORE,
|
||||
R.string.cpu_core, 0, emuCoresEntries, emuCoresValues, defaultCpuCore, cpuCore));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_DUAL_CORE, Settings.SECTION_INI_CORE,
|
||||
R.string.dual_core, R.string.dual_core_description, true, dualCore));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERCLOCK_ENABLE, Settings.SECTION_INI_CORE,
|
||||
R.string.overclock_enable, R.string.overclock_enable_description, false,
|
||||
overclockEnable));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_OVERCLOCK_PERCENT, Settings.SECTION_INI_CORE,
|
||||
R.string.overclock_title, R.string.overclock_title_description, 400, "%", 100,
|
||||
overclock));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_SPEED_LIMIT, Settings.SECTION_INI_CORE,
|
||||
R.string.speed_limit, 0, 200, "%", 100, speedLimit));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_AUDIO_STRETCH, Settings.SECTION_INI_CORE,
|
||||
R.string.audio_stretch, R.string.audio_stretch_description, false, audioStretch));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_AUDIO_VOLUME, Settings.SECTION_INI_DSP,
|
||||
R.string.audio_volume, 0, 100, "%", 100, audioVolume));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERRIDE_REGION_SETTINGS,
|
||||
Settings.SECTION_INI_CORE, R.string.override_region_settings, 0, false,
|
||||
overrideRegionSettings));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_AUTO_DISC_CHANGE, Settings.SECTION_INI_CORE,
|
||||
R.string.auto_disc_change, 0, false, autoDiscChange));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_SPEED_LIMIT, Settings.SECTION_INI_CORE,
|
||||
R.string.speed_limit, 0, 200, "%", 100, speedLimit));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_ANALYTICS_ENABLED, Settings.SECTION_ANALYTICS,
|
||||
R.string.analytics, 0, false, analytics));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_ENABLE_SAVE_STATES, Settings.SECTION_INI_CORE,
|
||||
R.string.enable_save_states, R.string.enable_save_states_description, false,
|
||||
enableSaveState));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_ANALYTICS_ENABLED, Settings.SECTION_ANALYTICS,
|
||||
R.string.analytics, 0, false, analytics));
|
||||
}
|
||||
|
||||
private void addInterfaceSettings(ArrayList<SettingsItem> sl)
|
||||
@ -313,6 +278,22 @@ public final class SettingsFragmentPresenter
|
||||
onScreenDisplayMessages));
|
||||
}
|
||||
|
||||
private void addAudioSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting audioStretch = null;
|
||||
Setting audioVolume = null;
|
||||
|
||||
SettingSection coreSection = mSettings.getSection(Settings.SECTION_INI_CORE);
|
||||
SettingSection dspSection = mSettings.getSection(Settings.SECTION_INI_DSP);
|
||||
audioStretch = coreSection.getSetting(SettingsFile.KEY_AUDIO_STRETCH);
|
||||
audioVolume = dspSection.getSetting(SettingsFile.KEY_AUDIO_VOLUME);
|
||||
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_AUDIO_STRETCH, Settings.SECTION_INI_CORE,
|
||||
R.string.audio_stretch, R.string.audio_stretch_description, false, audioStretch));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_AUDIO_VOLUME, Settings.SECTION_INI_DSP,
|
||||
R.string.audio_volume, 0, 100, "%", 100, audioVolume));
|
||||
}
|
||||
|
||||
private void addPathsSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting defaultISO = null;
|
||||
@ -392,6 +373,48 @@ public final class SettingsFragmentPresenter
|
||||
R.string.wiimote_speaker, R.string.wiimote_speaker_description, true, wiimoteSpeaker));
|
||||
}
|
||||
|
||||
private void addAdvancedSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting cpuCore = null;
|
||||
Setting overclockEnable = null;
|
||||
Setting overclock = null;
|
||||
|
||||
SettingSection coreSection = mSettings.getSection(Settings.SECTION_INI_CORE);
|
||||
cpuCore = coreSection.getSetting(SettingsFile.KEY_CPU_CORE);
|
||||
overclockEnable = coreSection.getSetting(SettingsFile.KEY_OVERCLOCK_ENABLE);
|
||||
overclock = coreSection.getSetting(SettingsFile.KEY_OVERCLOCK_PERCENT);
|
||||
|
||||
// TODO: Having different emuCoresEntries/emuCoresValues for each architecture is annoying.
|
||||
// The proper solution would be to have one emuCoresEntries and one emuCoresValues
|
||||
// and exclude the values that aren't present in PowerPC::AvailableCPUCores().
|
||||
int defaultCpuCore = NativeLibrary.DefaultCPUCore();
|
||||
int emuCoresEntries;
|
||||
int emuCoresValues;
|
||||
if (defaultCpuCore == 1) // x86-64
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesX86_64;
|
||||
emuCoresValues = R.array.emuCoresValuesX86_64;
|
||||
}
|
||||
else if (defaultCpuCore == 4) // AArch64
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesARM64;
|
||||
emuCoresValues = R.array.emuCoresValuesARM64;
|
||||
}
|
||||
else
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesGeneric;
|
||||
emuCoresValues = R.array.emuCoresValuesGeneric;
|
||||
}
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_CPU_CORE, Settings.SECTION_INI_CORE,
|
||||
R.string.cpu_core, 0, emuCoresEntries, emuCoresValues, defaultCpuCore, cpuCore));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERCLOCK_ENABLE, Settings.SECTION_INI_CORE,
|
||||
R.string.overclock_enable, R.string.overclock_enable_description, false,
|
||||
overclockEnable));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_OVERCLOCK_PERCENT, Settings.SECTION_INI_CORE,
|
||||
R.string.overclock_title, R.string.overclock_title_description, 400, "%", 100,
|
||||
overclock));
|
||||
}
|
||||
|
||||
private void addGcPadSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
@ -123,14 +123,8 @@
|
||||
|
||||
<!-- General Preference Fragment -->
|
||||
<string name="general_submenu">General</string>
|
||||
<string name="cpu_core">CPU Core</string>
|
||||
<string name="cpu_core_description">%s</string>
|
||||
<string name="dual_core">Dual Core</string>
|
||||
<string name="dual_core_description">Split workload to two CPU cores instead of one. Increases speed.</string>
|
||||
<string name="overclock_enable">Override Emulated CPU Clock Speed</string>
|
||||
<string name="overclock_enable_description">Higher values can make variable-framerate games run at a higher framerate, requiring a powerful device. Lower values make games run at a lower framerate, increasing emulation speed, but reducing the emulated console\'s performance.</string>
|
||||
<string name="overclock_title">Emulated CPU Clock Speed</string>
|
||||
<string name="overclock_title_description">Adjusts the emulated CPU\'s clock rate if \"Override Emulated CPU Clock Speed\" is enabled.</string>
|
||||
<string name="speed_limit">Speed Limit</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>
|
||||
@ -142,8 +136,6 @@
|
||||
<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>
|
||||
<string name="wiimote_speaker_description">Enable sound output through the speaker on a real Wiimote (DolphinBar required).</string>
|
||||
<string name="audio_stretch">Audio Stretching</string>
|
||||
<string name="audio_stretch_description">Stretches audio to reduce stuttering. Increases latency.</string>
|
||||
<string name="override_region_settings">Allow Mismatched Region Settings</string>
|
||||
<string name="auto_disc_change">Change Discs Automatically</string>
|
||||
<string name="enable_save_states">Enable Savestates</string>
|
||||
@ -153,7 +145,6 @@
|
||||
<string name="analytics">Enable usage statistics reporting</string>
|
||||
<string name="analytics_desc">If authorized, Dolphin can collect data on its performance, feature usage, and configuration, as well as data on your system\'s hardware and operating system.\n\nNo private data is ever collected. This data helps us understand how people and emulated games use Dolphin and prioritize our efforts. It also helps us identify rare configurations that are causing bugs, performance and stability issues. This authorization can be revoked at any time through Dolphin\'s settings.</string>
|
||||
<string name="gametdb_thanks">Thanks to GameTDB.com for providing GameCube and Wii covers!</string>
|
||||
<string name="audio_volume">Audio Volume</string>
|
||||
|
||||
<!-- Interface Preference Fragment -->
|
||||
<string name="interface_submenu">Interface</string>
|
||||
@ -162,6 +153,12 @@
|
||||
<string name="osd_messages">Show On-Screen Display Messages</string>
|
||||
<string name="osd_messages_description">Display messages over the emulation screen area. These messages include memory card writes, video backend and CPU information, and JIT cache clearing.</string>
|
||||
|
||||
<!-- Audio Settings -->
|
||||
<string name="audio_submenu">Audio</string>
|
||||
<string name="audio_stretch">Audio Stretching</string>
|
||||
<string name="audio_stretch_description">Stretches audio to reduce stuttering. Increases latency.</string>
|
||||
<string name="audio_volume">Audio Volume</string>
|
||||
|
||||
<!-- Path Settings -->
|
||||
<string name="paths_submenu">Paths</string>
|
||||
<string name="default_ISO">Default ISO</string>
|
||||
@ -255,6 +252,14 @@
|
||||
<string name="wait_for_shaders">Compile Shaders Before Starting</string>
|
||||
<string name="wait_for_shaders_description">This causes a delay when launching games, but will reduce stuttering early on.</string>
|
||||
|
||||
<!-- Advanced Settings -->
|
||||
<string name="advanced_submenu">Advanced</string>
|
||||
<string name="cpu_core">CPU Core</string>
|
||||
<string name="overclock_enable">Override Emulated CPU Clock Speed</string>
|
||||
<string name="overclock_enable_description">Higher values can make variable-framerate games run at a higher framerate, requiring a powerful device. Lower values make games run at a lower framerate, increasing emulation speed, but reducing the emulated console\'s performance.</string>
|
||||
<string name="overclock_title">Emulated CPU Clock Speed</string>
|
||||
<string name="overclock_title_description">Adjusts the emulated CPU\'s clock rate if \"Override Emulated CPU Clock Speed\" is enabled.</string>
|
||||
|
||||
<!-- Debug -->
|
||||
<string name="debug_submenu">Debug</string>
|
||||
<string name="debug_warning">Warning: These settings will slow emulation</string>
|
||||
|
Loading…
Reference in New Issue
Block a user