diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java index b1f3fb0a7b..b33919c491 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java @@ -14,9 +14,9 @@ import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.activities.EmulationActivity; import org.dolphinemu.dolphinemu.model.GameFile; import org.dolphinemu.dolphinemu.services.DirectoryInitializationService; +import org.dolphinemu.dolphinemu.ui.settings.MenuTag; import org.dolphinemu.dolphinemu.ui.settings.SettingsActivity; import org.dolphinemu.dolphinemu.utils.PicassoUtils; -import org.dolphinemu.dolphinemu.utils.SettingsFile; import org.dolphinemu.dolphinemu.viewholders.GameViewHolder; import java.io.File; @@ -156,10 +156,10 @@ public final class GameAdapter extends RecyclerView.Adapter impl public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: - SettingsActivity.launch(activity, SettingsFile.FILE_NAME_DOLPHIN, gameId); + SettingsActivity.launch(activity, MenuTag.CONFIG, gameId); break; case 1: - SettingsActivity.launch(activity, SettingsFile.FILE_NAME_GFX, gameId); + SettingsActivity.launch(activity, MenuTag.GRAPHICS, gameId); break; case 2: String path = DirectoryInitializationService.getUserDirectory() + "/GameSettings/" + gameId + ".ini"; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java index 4928a0b44e..e7c12562cf 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java @@ -17,9 +17,9 @@ import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.model.GameFile; import org.dolphinemu.dolphinemu.services.DirectoryInitializationService; import org.dolphinemu.dolphinemu.ui.platform.Platform; +import org.dolphinemu.dolphinemu.ui.settings.MenuTag; import org.dolphinemu.dolphinemu.ui.settings.SettingsActivity; import org.dolphinemu.dolphinemu.utils.PicassoUtils; -import org.dolphinemu.dolphinemu.utils.SettingsFile; import org.dolphinemu.dolphinemu.viewholders.TvGameViewHolder; import java.io.File; @@ -103,10 +103,10 @@ public final class GameRowPresenter extends Presenter public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: - SettingsActivity.launch(activity, SettingsFile.FILE_NAME_DOLPHIN, gameId); + SettingsActivity.launch(activity, MenuTag.CONFIG, gameId); break; case 1: - SettingsActivity.launch(activity, SettingsFile.FILE_NAME_GFX, gameId); + SettingsActivity.launch(activity, MenuTag.GRAPHICS, gameId); break; case 2: String path = DirectoryInitializationService.getUserDirectory() + "/GameSettings/" + gameId + ".ini"; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/IntSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/IntSetting.java index 145ec9a76f..9f8ae14f95 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/IntSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/IntSetting.java @@ -1,8 +1,11 @@ package org.dolphinemu.dolphinemu.model.settings; +import org.dolphinemu.dolphinemu.ui.settings.MenuTag; + public final class IntSetting extends Setting { private int mValue; + private MenuTag menuTag; public IntSetting(String key, String section, int file, int value) { @@ -10,6 +13,13 @@ public final class IntSetting extends Setting mValue = value; } + public IntSetting(String key, String section, int file, int value, MenuTag menuTag) + { + super(key, section, file); + mValue = value; + this.menuTag = menuTag; + } + public int getValue() { return mValue; @@ -25,4 +35,10 @@ public final class IntSetting extends Setting { return Integer.toString(mValue); } + + public MenuTag getMenuTag() + { + return menuTag; + } + } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SettingsItem.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SettingsItem.java index 094e8be91d..95a926038a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SettingsItem.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SettingsItem.java @@ -17,6 +17,7 @@ public abstract class SettingsItem public static final int TYPE_SLIDER = 3; public static final int TYPE_SUBMENU = 4; public static final int TYPE_INPUT_BINDING = 5; + public static final int TYPE_STRING_SINGLE_CHOICE = 6; private String mKey; private String mSection; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SingleChoiceSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SingleChoiceSetting.java index 4566ddd54a..68d418f096 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SingleChoiceSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SingleChoiceSetting.java @@ -2,6 +2,7 @@ package org.dolphinemu.dolphinemu.model.settings.view; import org.dolphinemu.dolphinemu.model.settings.IntSetting; import org.dolphinemu.dolphinemu.model.settings.Setting; +import org.dolphinemu.dolphinemu.ui.settings.MenuTag; public final class SingleChoiceSetting extends SettingsItem { @@ -9,13 +10,20 @@ public final class SingleChoiceSetting extends SettingsItem private int mChoicesId; private int mValuesId; + private MenuTag menuTag; - public SingleChoiceSetting(String key, String section, int file, int titleId, int descriptionId, int choicesId, int valuesId, int defaultValue, Setting setting) + public SingleChoiceSetting(String key, String section, int file, int titleId, int descriptionId, int choicesId, int valuesId, int defaultValue, Setting setting, MenuTag menuTag) { super(key, section, file, setting, titleId, descriptionId); mValuesId = valuesId; mChoicesId = choicesId; mDefaultValue = defaultValue; + this.menuTag = menuTag; + } + + public SingleChoiceSetting(String key, String section, int file, int titleId, int descriptionId, int choicesId, int valuesId, int defaultValue, Setting setting) + { + this(key, section, file, titleId, descriptionId, choicesId, valuesId, defaultValue, setting, null); } public int getChoicesId() @@ -41,6 +49,11 @@ public final class SingleChoiceSetting extends SettingsItem } } + public MenuTag getMenuTag() + { + return menuTag; + } + /** * Write a value to the backing int. If that int was previously null, * initializes a new one and returns it, so it can be added to the Hashmap. diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SliderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SliderSetting.java index 0d67eaabe4..9ab9edf4a9 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SliderSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/SliderSetting.java @@ -43,7 +43,8 @@ public final class SliderSetting extends SettingsItem else if (setting instanceof FloatSetting) { FloatSetting floatSetting = (FloatSetting) setting; - if (floatSetting.getKey().equals(SettingsFile.KEY_OVERCLOCK_PERCENT)) + if (floatSetting.getKey().equals(SettingsFile.KEY_OVERCLOCK_PERCENT) + || floatSetting.getKey().equals(SettingsFile.KEY_SPEED_LIMIT)) { return Math.round(floatSetting.getValue() * 100); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/StringSingleChoiceSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/StringSingleChoiceSetting.java new file mode 100644 index 0000000000..161ee0f567 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/settings/view/StringSingleChoiceSetting.java @@ -0,0 +1,97 @@ +package org.dolphinemu.dolphinemu.model.settings.view; + +import org.dolphinemu.dolphinemu.model.settings.Setting; +import org.dolphinemu.dolphinemu.model.settings.StringSetting; + +public class StringSingleChoiceSetting extends SettingsItem +{ + private String mDefaultValue; + + private String[] mChoicesId; + private String[] mValuesId; + + public StringSingleChoiceSetting(String key, String section, int file, int titleId, int descriptionId, String[] choicesId, String[] valuesId, String defaultValue, Setting setting) + { + super(key, section, file, setting, titleId, descriptionId); + mValuesId = valuesId; + mChoicesId = choicesId; + mDefaultValue = defaultValue; + } + + public String[] getChoicesId() + { + return mChoicesId; + } + + public String[] getValuesId() + { + return mValuesId; + } + + public String getValueAt(int index) + { + if (mValuesId == null) + return null; + + if (index >= 0 && index < mValuesId.length) + { + return mValuesId[index]; + } + + return ""; + } + + public String getSelectedValue() + { + if (getSetting() != null) + { + StringSetting setting = (StringSetting) getSetting(); + return setting.getValue(); + } + else + { + return mDefaultValue; + } + } + + public int getSelectValueIndex() { + String selectedValue = getSelectedValue(); + for(int i=0;i> mSettings; @@ -40,31 +47,24 @@ public final class SettingsFragmentPresenter mView = view; } - public void onCreate(String menuTag, String gameId) + public void onCreate(MenuTag menuTag, String gameId, Bundle extras) { mGameID = gameId; - if (menuTag.startsWith(SettingsFile.KEY_GCPAD_TYPE)) - { - mMenuTag = SettingsFile.KEY_GCPAD_TYPE; - mControllerNumber = Character.getNumericValue(menuTag.charAt(menuTag.length() - 2)); - mControllerType = Character.getNumericValue(menuTag.charAt(menuTag.length() - 1)); - } - else if (menuTag.startsWith(SettingsFile.SECTION_WIIMOTE) && !menuTag.equals(SettingsFile.FILE_NAME_WIIMOTE)) - { - mMenuTag = SettingsFile.SECTION_WIIMOTE; - mControllerNumber = Character.getNumericValue(menuTag.charAt(menuTag.length() - 1)) + 3; - } - else if (menuTag.startsWith(SettingsFile.KEY_WIIMOTE_EXTENSION)) - { - mMenuTag = SettingsFile.KEY_WIIMOTE_EXTENSION; - mControllerNumber = Character.getNumericValue(menuTag.charAt(menuTag.length() - 2)) + 3; - mControllerType = Character.getNumericValue(menuTag.charAt(menuTag.length() - 1)); - } - else - { - mMenuTag = menuTag; - } + this.mMenuTag = menuTag; + if (menuTag.isGCPadMenu() || menuTag.isWiimoteExtensionMenu()) + { + mControllerNumber = menuTag.getSubType(); + mControllerType = extras.getInt(ARG_CONTROLLER_TYPE); + } + else if (menuTag.isWiimoteMenu()) + { + mControllerNumber = menuTag.getSubType(); + } + else + { + mMenuTag = menuTag; + } } public void onViewCreated(ArrayList> settings) @@ -119,51 +119,68 @@ public final class SettingsFragmentPresenter switch (mMenuTag) { - case SettingsFile.FILE_NAME_DOLPHIN: - addConfigSettings(sl); - break; + case CONFIG: + addConfigSettings(sl); + break; - case SettingsFile.SECTION_CONFIG_GENERAL: + case CONFIG_GENERAL: addGeneralSettings(sl); break; - case SettingsFile.SECTION_CONFIG_INTERFACE: - addInterfaceSettings(sl); + case CONFIG_INTERFACE: + addInterfaceSettings(sl); + break; + + case CONFIG_GAME_CUBE: + addGameCubeSettings(sl); break; - case SettingsFile.FILE_NAME_GFX: + case CONFIG_WII: + addWiiSettings(sl); + break; + + case GRAPHICS: addGraphicsSettings(sl); break; - case SettingsFile.FILE_NAME_GCPAD: + case GCPAD_TYPE: addGcPadSettings(sl); break; - case SettingsFile.FILE_NAME_WIIMOTE: + case WIIMOTE: addWiimoteSettings(sl); break; - case SettingsFile.SECTION_GFX_ENHANCEMENTS: + case ENHANCEMENTS: addEnhanceSettings(sl); break; - case SettingsFile.SECTION_GFX_HACKS: + case HACKS: addHackSettings(sl); break; - case SettingsFile.KEY_GCPAD_TYPE: + case GCPAD_1: + case GCPAD_2: + case GCPAD_3: + case GCPAD_4: addGcPadSubSettings(sl, mControllerNumber, mControllerType); break; - case SettingsFile.SECTION_WIIMOTE: + case WIIMOTE_1: + case WIIMOTE_2: + case WIIMOTE_3: + case WIIMOTE_4: addWiimoteSubSettings(sl, mControllerNumber); break; - case SettingsFile.KEY_WIIMOTE_EXTENSION: + case WIIMOTE_EXTENSION_1: + case WIIMOTE_EXTENSION_2: + case WIIMOTE_EXTENSION_3: + case WIIMOTE_EXTENSION_4: addExtensionTypeSettings(sl, mControllerNumber, mControllerType); break; - case SettingsFile.SECTION_STEREOSCOPY: + case STEREOSCOPY: addStereoSettings(sl); break; @@ -178,8 +195,11 @@ public final class SettingsFragmentPresenter private void addConfigSettings(ArrayList sl) { - sl.add(new SubmenuSetting(null, null, R.string.general_submenu, 0, SettingsFile.SECTION_CONFIG_GENERAL)); - sl.add(new SubmenuSetting(null, null, R.string.interface_submenu, 0, SettingsFile.SECTION_CONFIG_INTERFACE)); + 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.gamecube_submenu, 0, MenuTag.CONFIG_GAME_CUBE)); + sl.add(new SubmenuSetting(null, null, R.string.wii_submenu, 0, MenuTag.CONFIG_WII)); } private void addGeneralSettings(ArrayList sl) @@ -188,10 +208,7 @@ public final class SettingsFragmentPresenter Setting dualCore = null; Setting overclockEnable = null; Setting overclock = null; - Setting slotADevice = null; - Setting slotBDevice = null; - Setting continuousScan = null; - Setting wiimoteSpeaker = null; + Setting speedLimit = null; Setting audioStretch = null; if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty()) @@ -200,10 +217,7 @@ public final class SettingsFragmentPresenter dualCore = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_DUAL_CORE); overclockEnable = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_OVERCLOCK_ENABLE); overclock = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_OVERCLOCK_PERCENT); - slotADevice = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_SLOT_A_DEVICE); - slotBDevice = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_SLOT_B_DEVICE); - continuousScan = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_WIIMOTE_SCAN); - wiimoteSpeaker = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_WIIMOTE_SPEAKER); + speedLimit = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_SPEED_LIMIT); audioStretch = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_AUDIO_STRETCH); } else @@ -236,10 +250,7 @@ public final class SettingsFragmentPresenter sl.add(new CheckBoxSetting(SettingsFile.KEY_DUAL_CORE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.dual_core, R.string.dual_core_description, true, dualCore)); sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERCLOCK_ENABLE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.overclock_enable, R.string.overclock_enable_description, false, overclockEnable)); sl.add(new SliderSetting(SettingsFile.KEY_OVERCLOCK_PERCENT, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.overclock_title, R.string.overclock_title_description, 400, "%", 100, overclock)); - sl.add(new SingleChoiceSetting(SettingsFile.KEY_SLOT_A_DEVICE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.slot_a_device, 0, R.array.slotDeviceEntries, R.array.slotDeviceValues, 8, slotADevice)); - sl.add(new SingleChoiceSetting(SettingsFile.KEY_SLOT_B_DEVICE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.slot_b_device, 0, R.array.slotDeviceEntries, R.array.slotDeviceValues, 255, slotBDevice)); - sl.add(new CheckBoxSetting(SettingsFile.KEY_WIIMOTE_SCAN, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.wiimote_scanning, R.string.wiimote_scanning_description, true, continuousScan)); - sl.add(new CheckBoxSetting(SettingsFile.KEY_WIIMOTE_SPEAKER, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.wiimote_speaker, R.string.wiimote_speaker_description, true, wiimoteSpeaker)); + sl.add(new SliderSetting(SettingsFile.KEY_SPEED_LIMIT, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.speed_limit, 0, 200, "%", 100, speedLimit)); sl.add(new CheckBoxSetting(SettingsFile.KEY_AUDIO_STRETCH, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.audio_stretch, R.string.audio_stretch_description, false, audioStretch)); } @@ -257,6 +268,50 @@ public final class SettingsFragmentPresenter sl.add(new CheckBoxSetting(SettingsFile.KEY_OSD_MESSAGES, SettingsFile.SECTION_INI_INTERFACE, SettingsFile.SETTINGS_DOLPHIN, R.string.osd_messages, R.string.osd_messages_description, true, onScreenDisplayMessages)); } + private void addGameCubeSettings(ArrayList sl) + { + Setting systemLanguage = null; + Setting overrideGCLanguage = null; + Setting slotADevice = null; + Setting slotBDevice = null; + + if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty()) + { + + systemLanguage = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_GAME_CUBE_LANGUAGE); + overrideGCLanguage = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_OVERRIDE_GAME_CUBE_LANGUAGE); + slotADevice = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_SLOT_A_DEVICE); + slotBDevice = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_SLOT_B_DEVICE); + } + else + { + mView.passSettingsToActivity(mSettings); + } + + sl.add(new SingleChoiceSetting(SettingsFile.KEY_GAME_CUBE_LANGUAGE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.gamecube_system_language, 0, R.array.gameCubeSystemLanguageEntries, R.array.gameCubeSystemLanguageValues, 0, systemLanguage)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERRIDE_GAME_CUBE_LANGUAGE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.override_gamecube_language, 0, false, overrideGCLanguage)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_SLOT_A_DEVICE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.slot_a_device, 0, R.array.slotDeviceEntries, R.array.slotDeviceValues, 8, slotADevice)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_SLOT_B_DEVICE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.slot_b_device, 0, R.array.slotDeviceEntries, R.array.slotDeviceValues, 255, slotBDevice)); + } + + private void addWiiSettings(ArrayList sl) + { + Setting continuousScan = null; + Setting wiimoteSpeaker = null; + if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty()) + { + continuousScan = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_WIIMOTE_SCAN); + wiimoteSpeaker = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_WIIMOTE_SPEAKER); + } + else + { + mView.passSettingsToActivity(mSettings); + } + + sl.add(new CheckBoxSetting(SettingsFile.KEY_WIIMOTE_SCAN, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.wiimote_scanning, R.string.wiimote_scanning_description, true, continuousScan)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_WIIMOTE_SPEAKER, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.wiimote_speaker, R.string.wiimote_speaker_description, true, wiimoteSpeaker)); + } + private void addGcPadSettings(ArrayList sl) { if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty()) @@ -265,7 +320,7 @@ public final class SettingsFragmentPresenter { // TODO This controller_0 + i business is quite the hack. It should work, but only if the definitions are kept together and in order. Setting gcPadSetting = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_GCPAD_TYPE + i); - sl.add(new SingleChoiceSetting(SettingsFile.KEY_GCPAD_TYPE + i, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.controller_0 + i, 0, R.array.gcpadTypeEntries, R.array.gcpadTypeValues, 0, gcPadSetting)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_GCPAD_TYPE + i, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.controller_0 + i, 0, R.array.gcpadTypeEntries, R.array.gcpadTypeValues, 0, gcPadSetting, MenuTag.getGCPadMenuTag(i))); } } } @@ -278,7 +333,7 @@ public final class SettingsFragmentPresenter { // TODO This wiimote_0 + i business is quite the hack. It should work, but only if the definitions are kept together and in order. Setting wiimoteSetting = mSettings.get(SettingsFile.SETTINGS_WIIMOTE).get(SettingsFile.SECTION_WIIMOTE + i).getSetting(SettingsFile.KEY_WIIMOTE_TYPE); - sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_TYPE, SettingsFile.SECTION_WIIMOTE + i, SettingsFile.SETTINGS_WIIMOTE, R.string.wiimote_0 + i - 1, 0, R.array.wiimoteTypeEntries, R.array.wiimoteTypeValues, 0, wiimoteSetting)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_TYPE, SettingsFile.SECTION_WIIMOTE + i, SettingsFile.SETTINGS_WIIMOTE, R.string.wiimote_0 + i - 1, 0, R.array.wiimoteTypeEntries, R.array.wiimoteTypeValues, 0, wiimoteSetting, MenuTag.getWiimoteMenuTag(i))); } } } @@ -289,12 +344,14 @@ public final class SettingsFragmentPresenter Setting showFps = null; Setting shaderCompilationMode = null; Setting waitForShaders = null; + Setting aspectRatio = null; if (!mSettings.get(SettingsFile.SETTINGS_GFX).isEmpty()) { showFps = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_SHOW_FPS); shaderCompilationMode = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_SHADER_COMPILATION_MODE); waitForShaders = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_WAIT_FOR_SHADERS); + aspectRatio = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_ASPECT_RATIO); } else { @@ -306,12 +363,16 @@ public final class SettingsFragmentPresenter mView.passSettingsToActivity(mSettings); } + sl.add(new HeaderSetting(null, null, R.string.graphics_general, 0)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_VIDEO_BACKEND_INDEX, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.video_backend, R.string.video_backend_description, R.array.videoBackendEntries, R.array.videoBackendValues, 0, videoBackend)); sl.add(new CheckBoxSetting(SettingsFile.KEY_SHOW_FPS, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.show_fps, R.string.show_fps_description, false, showFps)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_SHADER_COMPILATION_MODE, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.shader_compilation_mode, R.string.shader_compilation_mode_description, R.array.shaderCompilationModeEntries, R.array.shaderCompilationModeValues, 0, shaderCompilationMode)); sl.add(new CheckBoxSetting(SettingsFile.KEY_WAIT_FOR_SHADERS, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.wait_for_shaders, 0, false, waitForShaders)); - sl.add(new SubmenuSetting(null, null, R.string.enhancements_submenu, 0, SettingsFile.SECTION_GFX_ENHANCEMENTS)); - sl.add(new SubmenuSetting(null, null, R.string.hacks_submenu, 0, SettingsFile.SECTION_GFX_HACKS)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_ASPECT_RATIO, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.aspect_ratio, R.string.aspect_ratio_description, R.array.aspectRatioEntries, R.array.aspectRatioValues, 0, aspectRatio)); + + sl.add(new HeaderSetting(null, null, R.string.graphics_enhancements_and_hacks, 0)); + sl.add(new SubmenuSetting(null, null, R.string.enhancements_submenu, 0, MenuTag.ENHANCEMENTS)); + sl.add(new SubmenuSetting(null, null, R.string.hacks_submenu, 0, MenuTag.HACKS)); } private void addEnhanceSettings(ArrayList sl) @@ -319,25 +380,37 @@ public final class SettingsFragmentPresenter Setting resolution = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_INTERNAL_RES); Setting fsaa = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_FSAA); Setting anisotropic = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_ANISOTROPY); + Setting shader = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_POST_SHADER); Setting efbScaledCopy = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_SCALED_EFB); Setting perPixel = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_PER_PIXEL); Setting forceFilter = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_FORCE_FILTERING); Setting disableFog = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_DISABLE_FOG); Setting disableCopyFilter = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_DISABLE_COPY_FILTER); + Setting arbitraryMipmapDetection = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_ARBITRARY_MIPMAP_DETECTION); + Setting wideScreenHack = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_WIDE_SCREEN_HACK); + Setting force24BitColor = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_FORCE_24_BIT_COLOR); sl.add(new SingleChoiceSetting(SettingsFile.KEY_INTERNAL_RES, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.internal_resolution, R.string.internal_resolution_description, R.array.internalResolutionEntries, R.array.internalResolutionValues, 1, resolution)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_FSAA, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.FSAA, R.string.FSAA_description, R.array.FSAAEntries, R.array.FSAAValues, 0, fsaa)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_ANISOTROPY, SettingsFile.SECTION_GFX_ENHANCEMENTS, SettingsFile.SETTINGS_GFX, R.string.anisotropic_filtering, R.string.anisotropic_filtering_description, R.array.anisotropicFilteringEntries, R.array.anisotropicFilteringValues, 0, anisotropic)); - // TODO -// Setting shader = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_POST_SHADER) -// sl.add(new SingleChoiceSetting(.getKey(), , R.string., R.string._description, R.array., R.array.)); + IntSetting stereoModeValue = (IntSetting) mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_MODE); + int anaglyphMode = 3; + String subDir = stereoModeValue != null && stereoModeValue.getValue() == anaglyphMode ? "Anaglyph" : null; + String[] shaderListEntries = getShaderList(subDir); + String[] shaderListValues = new String[shaderListEntries.length]; + System.arraycopy(shaderListEntries, 0, shaderListValues, 0, shaderListEntries.length); + shaderListValues[0] = ""; + sl.add(new StringSingleChoiceSetting(SettingsFile.KEY_POST_SHADER, SettingsFile.SECTION_GFX_ENHANCEMENTS, SettingsFile.SETTINGS_GFX, R.string.post_processing_shader, R.string.post_processing_shader_description, shaderListEntries, shaderListValues, "", shader)); sl.add(new CheckBoxSetting(SettingsFile.KEY_SCALED_EFB, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.scaled_efb_copy, R.string.scaled_efb_copy_description, true, efbScaledCopy)); sl.add(new CheckBoxSetting(SettingsFile.KEY_PER_PIXEL, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.per_pixel_lighting, R.string.per_pixel_lighting_description, false, perPixel)); sl.add(new CheckBoxSetting(SettingsFile.KEY_FORCE_FILTERING, SettingsFile.SECTION_GFX_ENHANCEMENTS, SettingsFile.SETTINGS_GFX, R.string.force_texture_filtering, R.string.force_texture_filtering_description, false, forceFilter)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_FORCE_24_BIT_COLOR, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.force_24bit_color, R.string.force_24bit_color_description, true, force24BitColor)); sl.add(new CheckBoxSetting(SettingsFile.KEY_DISABLE_FOG, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.disable_fog, R.string.disable_fog_description, false, disableFog)); sl.add(new CheckBoxSetting(SettingsFile.KEY_DISABLE_COPY_FILTER, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.disable_copy_filter, R.string.disable_copy_filter_description, false, disableCopyFilter)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_ARBITRARY_MIPMAP_DETECTION, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.arbitrary_mipmap_detection, R.string.arbitrary_mipmap_detection_description, true, arbitraryMipmapDetection)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_WIDE_SCREEN_HACK, SettingsFile.SECTION_GFX_ENHANCEMENTS, SettingsFile.SETTINGS_GFX, R.string.wide_screen_hack, R.string.wide_screen_hack_description, false, wideScreenHack)); /* Check if we support stereo @@ -349,10 +422,48 @@ public final class SettingsFragmentPresenter if ((helper.supportsOpenGL() && helper.GetVersion() >= 320) || (helper.supportsGLES3() && helper.GetVersion() >= 310 && helper.SupportsExtension("GL_ANDROID_extension_pack_es31a"))) { - sl.add(new SubmenuSetting(SettingsFile.KEY_STEREO_MODE, null, R.string.stereoscopy_submenu, R.string.stereoscopy_submenu_description, SettingsFile.SECTION_STEREOSCOPY)); + sl.add(new SubmenuSetting(SettingsFile.KEY_STEREO_MODE, null, R.string.stereoscopy_submenu, R.string.stereoscopy_submenu_description, MenuTag.STEREOSCOPY)); } } + private String[] getShaderList(String subDir) + { + try + { + String shadersPath = DirectoryInitializationService.getDolphinInternalDirectory() + "/Shaders"; + if(!TextUtils.isEmpty(subDir)) { + shadersPath += "/" + subDir; + } + + File file = new File(shadersPath); + File[] shaderFiles = file.listFiles(); + if (shaderFiles != null) + { + String[] result = new String[shaderFiles.length + 1]; + result[0] = "Off"; + for (int i = 0; i < shaderFiles.length; i++) + { + String name = shaderFiles[i].getName(); + int extensionIndex = name.indexOf(".glsl"); + if (extensionIndex > 0) + { + name = name.substring(0, extensionIndex); + } + result[i+1] = name; + } + + return result; + } + } + catch (Exception ex) + { + Log.debug("[Settings] Unable to find shader files"); + // return empty list + } + + return new String[]{}; + } + private void addHackSettings(ArrayList sl) { boolean skipEFBValue = getInvertedBooleanValue(SettingsFile.SETTINGS_GFX, SettingsFile.SECTION_GFX_HACKS, SettingsFile.KEY_SKIP_EFB, false); @@ -366,7 +477,6 @@ public final class SettingsFragmentPresenter Setting xfbToTexture = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_XFB_TEXTURE); Setting immediateXfb = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_IMMEDIATE_XFB); Setting fastDepth = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_FAST_DEPTH); - Setting aspectRatio = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_ASPECT_RATIO); sl.add(new HeaderSetting(null, null, R.string.embedded_frame_buffer, 0)); sl.add(new CheckBoxSetting(SettingsFile.KEY_SKIP_EFB, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.skip_efb_access, R.string.skip_efb_access_description, false, skipEFB)); @@ -383,7 +493,6 @@ public final class SettingsFragmentPresenter sl.add(new HeaderSetting(null, null, R.string.other, 0)); sl.add(new CheckBoxSetting(SettingsFile.KEY_FAST_DEPTH, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.fast_depth_calculation, R.string.fast_depth_calculation_description, true, fastDepth)); - sl.add(new SingleChoiceSetting(SettingsFile.KEY_ASPECT_RATIO, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.aspect_ratio, R.string.aspect_ratio_description, R.array.aspectRatioEntries, R.array.aspectRatioValues, 0, aspectRatio)); } private void addStereoSettings(ArrayList sl) @@ -467,7 +576,7 @@ public final class SettingsFragmentPresenter private void addWiimoteSubSettings(ArrayList sl, int wiimoteNumber) { // Bindings use controller numbers 4-7 (0-3 are GameCube), but the extension setting uses 1-4. - IntSetting extension = new IntSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, SettingsFile.SECTION_WIIMOTE + (wiimoteNumber - 3), SettingsFile.SETTINGS_WIIMOTE, getExtensionValue(wiimoteNumber - 3)); + IntSetting extension = new IntSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, SettingsFile.SECTION_WIIMOTE + wiimoteNumber, SettingsFile.SETTINGS_WIIMOTE, getExtensionValue(wiimoteNumber), MenuTag.getWiimoteExtensionMenuTag(wiimoteNumber)); Setting bindA = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_A + wiimoteNumber); Setting bindB = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_B + wiimoteNumber); Setting bind1 = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_1 + wiimoteNumber); @@ -501,7 +610,7 @@ public final class SettingsFragmentPresenter Setting bindDPadLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DPAD_LEFT + wiimoteNumber); Setting bindDPadRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DPAD_RIGHT + wiimoteNumber); - sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, SettingsFile.SECTION_WIIMOTE + (wiimoteNumber - 3), SettingsFile.SETTINGS_WIIMOTE, R.string.wiimote_extensions, R.string.wiimote_extensions_description, R.array.wiimoteExtensionsEntries, R.array.wiimoteExtensionsValues, 0, extension)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, SettingsFile.SECTION_WIIMOTE + (wiimoteNumber - 3), SettingsFile.SETTINGS_WIIMOTE, R.string.wiimote_extensions, R.string.wiimote_extensions_description, R.array.wiimoteExtensionsEntries, R.array.wiimoteExtensionsValues, 0, extension, MenuTag.getWiimoteExtensionMenuTag(wiimoteNumber))); sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0)); sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_A + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_a, bindA)); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentView.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentView.java index 3029dc2a9d..81c839037c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentView.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentView.java @@ -56,7 +56,7 @@ public interface SettingsFragmentView * * @param menuKey Identifier for the settings group that should be shown. */ - void loadSubMenu(String menuKey); + void loadSubMenu(MenuTag menuKey); /** * Tell the Fragment to tell the containing activity to display a toast message. @@ -80,25 +80,24 @@ public interface SettingsFragmentView /** * Have the fragment tell the containing Activity that a GCPad's setting was modified. * - * @param key Identifier for the GCPad that was modified. + * @param menuTag Identifier for the GCPad that was modified. * @param value New setting for the GCPad. */ - void onGcPadSettingChanged(String key, int value); + void onGcPadSettingChanged(MenuTag menuTag, int value); /** * Have the fragment tell the containing Activity that a Wiimote's setting was modified. * - * @param section Identifier for Wiimote that was modified; Wiimotes are identified by their section, - * not their key. + * @param menuTag Identifier for Wiimote that was modified. * @param value New setting for the Wiimote. */ - void onWiimoteSettingChanged(String section, int value); + void onWiimoteSettingChanged(MenuTag menuTag, int value); /** * Have the fragment tell the containing Activity that an extension setting was modified. * - * @param key Identifier for the extension that was modified. + * @param menuTag Identifier for the extension that was modified. * @param value New setting for the extension. */ - void onExtensionSettingChanged(String key, int value); + void onExtensionSettingChanged(MenuTag menuTag, int value); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/viewholder/SingleChoiceViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/viewholder/SingleChoiceViewHolder.java index add1b76637..c44d64b79b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/viewholder/SingleChoiceViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/viewholder/SingleChoiceViewHolder.java @@ -6,11 +6,12 @@ import android.widget.TextView; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem; import org.dolphinemu.dolphinemu.model.settings.view.SingleChoiceSetting; +import org.dolphinemu.dolphinemu.model.settings.view.StringSingleChoiceSetting; import org.dolphinemu.dolphinemu.ui.settings.SettingsAdapter; public final class SingleChoiceViewHolder extends SettingViewHolder { - private SingleChoiceSetting mItem; + private SettingsItem mItem; private TextView mTextSettingName; private TextView mTextSettingDescription; @@ -30,7 +31,7 @@ public final class SingleChoiceViewHolder extends SettingViewHolder @Override public void bind(SettingsItem item) { - mItem = (SingleChoiceSetting) item; + mItem = item; mTextSettingName.setText(item.getNameId()); @@ -43,6 +44,13 @@ public final class SingleChoiceViewHolder extends SettingViewHolder @Override public void onClick(View clicked) { - getAdapter().onSingleChoiceClick(mItem); + if (mItem instanceof SingleChoiceSetting) + { + getAdapter().onSingleChoiceClick((SingleChoiceSetting) mItem); + } + else if (mItem instanceof StringSingleChoiceSetting) + { + getAdapter().onStringSingleChoiceClick((StringSingleChoiceSetting) mItem); + } } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java index 9667cb88af..1e2084dd57 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java @@ -82,8 +82,11 @@ public final class SettingsFile public static final String KEY_DUAL_CORE = "CPUThread"; public static final String KEY_OVERCLOCK_ENABLE = "OverclockEnable"; public static final String KEY_OVERCLOCK_PERCENT = "Overclock"; + public static final String KEY_SPEED_LIMIT = "EmulationSpeed"; public static final String KEY_VIDEO_BACKEND = "GFXBackend"; public static final String KEY_AUDIO_STRETCH = "AudioStretch"; + public static final String KEY_GAME_CUBE_LANGUAGE = "SelectedLanguage"; + public static final String KEY_OVERRIDE_GAME_CUBE_LANGUAGE = "OverrideGCLang"; public static final String KEY_SLOT_A_DEVICE = "SlotA"; public static final String KEY_SLOT_B_DEVICE = "SlotB"; @@ -100,6 +103,9 @@ public final class SettingsFile public static final String KEY_FORCE_FILTERING = "ForceFiltering"; public static final String KEY_DISABLE_FOG = "DisableFog"; public static final String KEY_DISABLE_COPY_FILTER = "DisableCopyFilter"; + public static final String KEY_ARBITRARY_MIPMAP_DETECTION = "ArbitraryMipmapDetection"; + public static final String KEY_WIDE_SCREEN_HACK = "wideScreenHack"; + public static final String KEY_FORCE_24_BIT_COLOR = "ForceTrueColor"; public static final String KEY_STEREO_MODE = "StereoMode"; public static final String KEY_STEREO_DEPTH = "StereoDepth"; diff --git a/Source/Android/app/src/main/res/layout/list_item_settings_header.xml b/Source/Android/app/src/main/res/layout/list_item_settings_header.xml index 3c72913c93..1c0cd336c3 100644 --- a/Source/Android/app/src/main/res/layout/list_item_settings_header.xml +++ b/Source/Android/app/src/main/res/layout/list_item_settings_header.xml @@ -2,6 +2,7 @@ diff --git a/Source/Android/app/src/main/res/values/arrays.xml b/Source/Android/app/src/main/res/values/arrays.xml index c9d6f9a414..21a5c4f7b3 100644 --- a/Source/Android/app/src/main/res/values/arrays.xml +++ b/Source/Android/app/src/main/res/values/arrays.xml @@ -33,6 +33,24 @@ 5 + + + English + German + French + Spanish + Italian + Dutch + + + 0 + 1 + 2 + 3 + 4 + 5 + + Nothing diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index c3f97ae4de..6d1341edf4 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -118,9 +118,14 @@ 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. Emulated CPU Clock Speed Adjusts the emulated CPU\'s clock rate if \"Override Emulated CPU Clock Speed\" is enabled. + Speed Limit 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 + Override Language on NTSC games GameCube Slot A Device GameCube Slot B Device + Wii Wii Remote Continuous Scanning Leave this on if you are using a DolphinBar for real Wiimote support. Wii Remote Speaker @@ -135,6 +140,10 @@ Show On-Screen Display Messages Display messages over the emulation screen area. These messages include memory card writes, video backend and CPU information, and JIT cache clearing. + + General + Enhancements & Hacks + Video Backend Select the API used for graphics rendering. @@ -148,6 +157,8 @@ Reduces the amount of aliasing caused by rasterizing 3D graphics. This makes the rendered picture look less blocky. Heavily decreases emulation speed and sometimes causes issues. Anisotropic Filtering Enhances visual quality of textures that are at oblique viewing angles. Might cause issues in a small number of games. + Post-Processing Effect + Apply a post-processing effect after finishing a frame Post Processing Shader Apply a post-processing effect after finishing a frame. Scaled EFB Copy @@ -156,12 +167,18 @@ Calculate lighting of 3D graphics per-pixel rather than per vertex. Decreases emulation speed by some percent (depending on your GPU). This usually is a safe enhancement, but might cause issues sometimes. Force Texture Filtering Force texture filtering even if the emulated game explicitly disabled it. Improves texture quality slightly but causes glitches in some games. + Force 24-Bit Color + Forces the game to render the RGB color channels in 24-bit, thereby increasing quality by reducing color banding.\nIt has no impact on performance and causes few graphical issues. If unsure, leave this checked. Disable Fog Makes distant objects more visible by removing fog, thus increasing the overall detail. Disabling fog will break some games which rely on proper fog emulation. Disable Copy Filter Disables the blending of adjacent rows when copying the EFB. This is known in some games as \"deflickering\" or \"smoothing\". Disabling the filter is usually safe, and may result in a sharper image. + Arbitrary Mipmap Detection + Enables detection of arbitrary mipmaps, which some games use for special distance-based effects.\nMay have false positives that result in blurry textures at increased internal resolution, such as in games that use very low resolution mipmaps. Disabling this can also reduce stutter in games that frequently load new textures.\n\nIf unsure, leave this checked. Stereoscopy Stereoscopy allows you to get a better feeling of depth if you have the necessary hardware.\nHeavily decreases emulation speed and sometimes causes issues + Widescreen Hack + Forces the game to output graphics for any aspect ratio. Use with \"Aspect Ratio\" set to \"Force 16:9\" to force 4:3-only games to run at 16:9. Rarely produces good results and often partially breaks graphics and game UIs.\nUnnecessary (and detrimental) if using any AR/Gecko-code widescreen patches. If unsure, leave this unchecked. Stereoscopy Mode Select the stereoscopic 3D mode. Depth @@ -209,8 +226,8 @@ Other - CPU Settings - Video Settings + Config + Graphics Settings GameCube Input Wii Input Refresh Library