From 2190496ce8d3e522f1510af9712bcb0d0b8f40f1 Mon Sep 17 00:00:00 2001 From: sigmabeta Date: Sat, 23 Jan 2016 11:51:24 -0500 Subject: [PATCH] Fix special case for XFB & update EFB to match desktop --- .../ui/settings/SettingsAdapter.java | 43 ++++++++++++++-- .../ui/settings/SettingsFragment.java | 5 +- .../settings/SettingsFragmentPresenter.java | 49 +++---------------- .../ui/settings/SettingsFragmentView.java | 7 ++- .../dolphinemu/utils/SettingsFile.java | 2 +- .../app/src/main/res/values/arrays.xml | 24 ++------- .../app/src/main/res/values/strings.xml | 7 +-- 7 files changed, 59 insertions(+), 78 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsAdapter.java index ca754bb882..c83c578f06 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsAdapter.java @@ -126,7 +126,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter sl) { - int efbCopyMethodValue = getEfbCopyMethodValue(); int xfbValue = getXfbValue(); Setting skipEFB = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_SKIP_EFB); Setting ignoreFormat = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_IGNORE_FORMAT); - IntSetting efbCopyMethod = new IntSetting(SettingsFile.KEY_EFB_COPY_METHOD, null, efbCopyMethodValue); + Setting efbToTexture = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_EFB_TEXTURE); Setting texCacheAccuracy = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_TEXCACHE_ACCURACY); IntSetting xfb = new IntSetting(SettingsFile.KEY_XFB, SettingsFile.SECTION_GFX_HACKS, xfbValue); Setting fastDepth = mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_FAST_DEPTH); @@ -212,62 +211,27 @@ public final class SettingsFragmentPresenter sl.add(new HeaderSetting(null, null, R.string.embedded_frame_buffer, 0)); sl.add(new CheckBoxSetting(SettingsFile.KEY_SKIP_EFB, SettingsFile.SECTION_GFX_HACKS, R.string.skip_efb_access, R.string.skip_efb_access_descrip, false, skipEFB)); sl.add(new CheckBoxSetting(SettingsFile.KEY_IGNORE_FORMAT, SettingsFile.SECTION_GFX_HACKS, R.string.ignore_format_changes, R.string.ignore_format_changes_descrip, false, ignoreFormat)); - sl.add(new SingleChoiceSetting(SettingsFile.KEY_EFB_COPY_METHOD, SettingsFile.SECTION_GFX_HACKS, R.string.efb_copy_method, R.string.efb_copy_method_descrip, R.array.efbCopyMethodEntries, R.array.efbCopyMethodValues, 1, efbCopyMethod)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_EFB_TEXTURE, SettingsFile.SECTION_GFX_HACKS, R.string.efb_copy_method, R.string.efb_copy_method_descrip, true, efbToTexture)); sl.add(new HeaderSetting(null, null, R.string.texture_cache, 0)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_TEXCACHE_ACCURACY, SettingsFile.SECTION_GFX_HACKS, R.string.texture_cache_accuracy, R.string.texture_cache_accuracy_descrip, R.array.textureCacheAccuracyEntries, R.array.textureCacheAccuracyValues, 128, texCacheAccuracy)); sl.add(new HeaderSetting(null, null, R.string.external_frame_buffer, 0)); - sl.add(new SingleChoiceSetting(SettingsFile.KEY_XFB, SettingsFile.SECTION_GFX_HACKS, R.string.external_frame_buffer, R.string.external_frame_buffer_descrip, R.array.externalFrameBufferEntries, R.array.externalFrameBufferValues, 0, xfb)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_XFB_METHOD, SettingsFile.SECTION_GFX_HACKS, R.string.external_frame_buffer, R.string.external_frame_buffer_descrip, R.array.externalFrameBufferEntries, R.array.externalFrameBufferValues, 0, xfb)); sl.add(new HeaderSetting(null, null, R.string.other, 0)); sl.add(new CheckBoxSetting(SettingsFile.KEY_FAST_DEPTH, SettingsFile.SECTION_GFX_HACKS, R.string.fast_depth_calculation, R.string.fast_depth_calculation_descrip, true, fastDepth)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_ASPECT_RATIO, SettingsFile.SECTION_GFX_HACKS, R.string.aspect_ratio, R.string.aspect_ratio_descrip, R.array.aspectRatioEntries, R.array.aspectRatioValues, 0, aspectRatio)); } - private int getEfbCopyMethodValue() - { - int efbCopyMethodValue; - try - { - boolean efbCopyOn = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_EFB_COPY)).getValue(); - boolean efbCopyTexture = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_EFB_TEXTURE)).getValue(); - boolean efbCopyCache = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_EFB_CACHE)).getValue(); - - - if (!efbCopyOn) - { - efbCopyMethodValue = 0; - } - else if (efbCopyTexture) - { - efbCopyMethodValue = 1; - } - else if (!efbCopyCache) - { - efbCopyMethodValue = 2; - } - else - { - efbCopyMethodValue = 3; - } - } - catch (NullPointerException ex) - { - efbCopyMethodValue = 1; - } - - return efbCopyMethodValue; - } - private int getXfbValue() { int xfbValue; try { - boolean usingXFB = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_XFB)).getValue(); - boolean usingRealXFB = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_XFB_REAL)).getValue(); + boolean usingXFB = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_XFB)).getValue(); + boolean usingRealXFB = ((BooleanSetting) mSettings.get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_XFB_REAL)).getValue(); if (!usingXFB) { @@ -290,3 +254,4 @@ public final class SettingsFragmentPresenter return xfbValue; } } + 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 0c0546d490..c437863c94 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 @@ -60,10 +60,9 @@ public interface SettingsFragmentView void showToastMessage(String message); /** - * Have the fragment add a setting to the Hashmap. Useful if the setting - * was missing from the .ini file, but included in the UI. + * Have the fragment add a setting to the Hashmap. * - * @param setting The (possibly missing) new setting. + * @param setting The (possibly previously missing) new setting. */ - void addSetting(Setting setting); + void putSetting(Setting setting); } 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 7f9eb74742..865e3371ae 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 @@ -74,7 +74,7 @@ public final class SettingsFile public static final String KEY_ASPECT_RATIO= "AspectRatio"; // Internal only, not actually found in settings file. - public static final String KEY_EFB_COPY_METHOD = "EFBCopyMethod"; + public static final String KEY_XFB_METHOD = "XFBMethod"; private SettingsFile() { diff --git a/Source/Android/app/src/main/res/values/arrays.xml b/Source/Android/app/src/main/res/values/arrays.xml index d8320239bd..c7299780c6 100644 --- a/Source/Android/app/src/main/res/values/arrays.xml +++ b/Source/Android/app/src/main/res/values/arrays.xml @@ -71,20 +71,6 @@ Turntable - - - @string/disabled - @string/efb_copy_texture - @string/efb_copy_ram_uncached - @string/efb_copy_ram_cached - - - Off - Texture - RAM (cached) - RAM (uncached) - - @string/texture_cache_accuracy_low @@ -103,11 +89,11 @@ @string/external_frame_buffer_virtual @string/external_frame_buffer_real - - Disabled - Virtual - Real - + + 0 + 1 + 2 + diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index ba3982396f..cf98d53bb9 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -286,11 +286,8 @@ Ignore any requests from the CPU to read/write to the EFB. Ignore Format Changes Ignore any changes to the EFB format. - EFB Copy Method - Determines how EFB copies will be emulated. - Texture - RAM (uncached) - RAM (cached) + Store EFB Copies to Texture Only + Stores EFB Copies exclusively on the GPU, bypassing system memory. Causes graphical defects in a small number of games. If unsure, leave this checked. Texture Cache Texture Cache Accuracy The safer the selection, the less likely the emulator will be missing any texture updates from RAM.