[Android] Add most of the Dolphin video/gfx settings to the settings menu.

This commit is contained in:
Lioncash 2013-08-20 14:33:30 -04:00
parent 642657d07c
commit 3fdfd75832
6 changed files with 408 additions and 34 deletions

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- CPU Settings -->
<PreferenceScreen
android:title="@string/cpu_settings">
<CheckBoxPreference
android:key="dualCorePref"
android:summary="@string/on_off"
android:title="@string/dual_core" />
<ListPreference
android:key="cpuCorePref"
android:summary="@string/emu_core_to_use"
android:title="@string/cpu_core" />
</PreferenceScreen>
<!-- Video Settings -->
<PreferenceScreen
android:title="@string/video_settings">
<ListPreference
android:key="gpuPref"
android:summary="@string/video_backend_to_use"
android:title="@string/video_backend" />
</PreferenceScreen>
</PreferenceScreen>

View File

@ -73,8 +73,52 @@
<string name="video_backend">ビデオレンダラ</string>
<string name="video_backend_to_use">使用するビデオレンダラー</string>
<string name="enhancements">画質向上の設定</string>
<string name="internal_resolution">内部解像度の変更</string>
<string name="internal_resolution_descrip">内部解像度の計算方式を設定します。高解像度に設定することで大きく 画質が向上します。 しかし、ゲームによっては非常に重くなったり描画バグの原因となります。 【ゲーム解像度の倍数】は【ウィンドウサイズに拡大】より少し重くなり ますが、描画バグは発生しにくくなります。 また一般的に内部解像度が低いほど、動作速度は向上します。</string>
<string name="anisotropic_filtering">異方性フィルタリング</string>
<string name="anisotropic_filtering_descrip">異方性フィルタリングを適用します。 奥行きのあるテクスチャをより精細に描画することが出来ます。 特定のゲームでは描画バグの原因になることがあります。</string>
<string name="scaled_efb_copy">Scaled EFB Copy</string>
<string name="scaled_efb_copy_descrip">テクスチャエフェクトを表示するために作成されたテクスチャの品質を著しく向上させます。 特に高解像度出力時に効果が大きく出ます。 動作速度は少々低下し、まれに描画バグの原因にもなることもあります。</string>
<string name="per_pixel_lighting">Per-Pixel Lighting</string>
<string name="per_pixel_lighting_descrip">ピクセル単位での光源処理を行います。 GPUの性能にもよりますが、数パーセント程度、動作速度が低下します。 このオプションは通常安全ですが、時に描画バグを引き起こすこともあります</string>
<string name="force_texture_filtering">Force Texture Filtering</string>
<string name="force_texture_filtering_descrip">ゲーム側でフィルタ無効を明示している場面でも、強制的にフィルタリングを行います。 特に高解像度出力時にテクスチャが綺麗になりますが、いくつかのゲームで描画バグを引き起こします。</string>
<string name="disable_fog">霧を無効</string>
<string name="disable_fog_descrip">フォグ処理を無効化します。これにより遠景の高精細化が期待できます。いくつかのタイトルではフォグ処理に頼った画面効果が正しく表示 されなくなります。</string>
<string name="hacks">高速化(Hacks)</string>
<string name="embedded_frame_buffer">内蔵フレームバッファ</string>
<string name="skip_efb_access">CPUからEFBアクセスをスキップ</string>
<string name="skip_efb_access_descrip">EFBへの読み取り/書き込みにCPUから作られたすべての要求を無視。</string>
<string name="ignore_format_changes">フォーマットの変更を無視</string>
<string name="ignore_format_changes_descrip">EFB形式への変更を無視。</string>
<string name="efb_copy_method">EFBコピー方法</string>
<string name="efb_copy_method_descrip">EFBコピーをエミュレート方法を決定。</string>
<string name="efb_copy_texture">テクスチャ</string>
<string name="efb_copy_ram_uncached">RAM (キャッシュない)</string>
<string name="efb_copy_ram_cached">RAM (キャッシュ)</string>
<string name="texture_cache">テクスチャキャッシュ</string>
<string name="texture_cache_accuracy"></string>
<string name="texture_cache_accuracy_descrip">この選択をSafe設定しておくと、RAMからのテクスチャ更新に 失敗しにくなります。</string>
<string name="texture_cache_accuracy_low"></string>
<string name="texture_cache_accuracy_medium"></string>
<string name="texture_cache_accuracy_high"></string>
<string name="external_frame_buffer">外部フレームバッファ</string>
<string name="external_frame_buffer_descrip">XFBをエミュレート方法を決定。</string>
<string name="external_frame_buffer_virtual">バーチャル</string>
<string name="external_frame_buffer_real">実機</string>
<string name="cache_display_lists">Cache Display Lists</string>
<string name="cache_display_lists_descrip">ディスプレイリストをキャッシュすることによりエミュレーション速度を向上。</string>
<string name="disable_destination_alpha">Disable Destination Alpha</string>
<string name="disable_destination_alpha_descrip">多くのタイトルで画面効果に使用されている、アルファ透過処理をスキップ 。</string>
<string name="fast_depth_calculation">高速奥行き計算</string>
<string name="fast_depth_calculation_descrip">深度値を計算するために精度の低いアルゴリズムを使用します。</string>
<!-- Miscellaneous -->
<string name="yes">はい</string>
<string name="no">いいえ</string>
<string name="disabled">無効</string>
<string name="other">その他</string>
</resources>

View File

@ -45,11 +45,84 @@
</string-array>
<!-- Video Backend Selection - No OpenGL ES 3 support -->
<string-array name="videoBackendEntriesNoGLES3">
<string-array name="videoBackendEntriesNoGLES3" translatable="false">
<item>@string/software_renderer</item>
</string-array>
<string-array name="videoBackendValuesNoGLES3">
<string-array name="videoBackendValuesNoGLES3" translatable="false">
<item>Software Renderer</item>
</string-array>
<!-- EFB Copy Method Preference -->
<string-array name="efbCopyMethodEntries" translatable="false">
<item>@string/disabled</item>
<item>@string/efb_copy_texture</item>
<item>@string/efb_copy_ram_uncached</item>
<item>@string/efb_copy_ram_cached</item>
</string-array>
<string-array name="efbCopyMethodValues" translatable="false">
<item>Off</item>
<item>Texture</item>
<item>RAM (cached)</item>
<item>RAM (uncached)</item>
</string-array>
<!-- Texture Cache Accuracy Preference -->
<string-array name="textureCacheAccuracyEntries" translatable="false">
<item>@string/texture_cache_accuracy_low</item>
<item>@string/texture_cache_accuracy_medium</item>
<item>@string/texture_cache_accuracy_high</item>
</string-array>
<string-array name="textureCacheAccuracyValues" translatable="false">
<item>128</item>
<item>512</item>
<item>0</item>
</string-array>
<!-- External Frame Buffer Preference -->
<string-array name="externalFrameBufferEntries" translatable="false">
<item>@string/disabled</item>
<item>@string/external_frame_buffer_virtual</item>
<item>@string/external_frame_buffer_real</item>
</string-array>
<string-array name="externalFrameBufferValues" translatable="false">
<item>Disabled</item>
<item>Virtual</item>
<item>Real</item>
</string-array>
<!-- Internal Resolution Preference -->
<string-array name="internalResolutionEntries" translatable="false">
<item>1x Native (640x528)</item>
<item>1.5x Native (960x792)</item>
<item>2x Native (1280x1056)</item>
<item>2.5x Native (1600x1320)</item>
<item>3x Native (1920x1584)</item>
<item>4x Native (2560x2112)</item>
</string-array>
<string-array name="internalResolutionValues" translatable="false">
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
</string-array>
<!-- Anisotropic Filtering Preference -->
<string-array name="anisotropicFilteringEntries" translatable="false">
<item>1x</item>
<item>2x</item>
<item>4x</item>
<item>8x</item>
<item>16x</item>
</string-array>
<string-array name="anisotropicFilteringValues" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
</string-array>
</resources>

View File

@ -73,8 +73,53 @@
<string name="video_backend">Video Backend</string>
<string name="video_backend_to_use">Video backend to use</string>
<string name="enhancements">Enhancements</string>
<string name="internal_resolution">Internal Resolution</string>
<string name="internal_resolution_descrip">Specifies the resolution used to render at. A high resolution will improve visual quality a lot but is also quite heavy on performance and might cause glitches in certain games.</string>
<string name="anisotropic_filtering">Anisotropic Filtering</string>
<string name="anisotropic_filtering_descrip">Enhances visual quality of textures that are at oblique viewing angles. Might cause issues in a small number of games.</string>
<string name="scaled_efb_copy">Scaled EFB Copy</string>
<string name="scaled_efb_copy_descrip">Greatly increases quality of textures generated using render to texture effects. Raising the internal resolution will improve the effect of this setting. Slightly decreases performance and possibly causes issues (although unlikely).</string>
<string name="per_pixel_lighting">Per-Pixel Lighting</string>
<string name="per_pixel_lighting_descrip">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.</string>
<string name="force_texture_filtering">Force Texture Filtering</string>
<string name="force_texture_filtering_descrip">Force texture filtering even if the emulated game explicitly disabled it. Improves texture quality slightly but causes glitches in some games.</string>
<string name="disable_fog">Disable Fog</string>
<string name="disable_fog_descrip">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.</string>
<string name="hacks">Hacks</string>
<string name="embedded_frame_buffer">Embedded Frame Buffer</string>
<string name="skip_efb_access">Skip EFB Access from CPU</string>
<string name="skip_efb_access_descrip">Ignore any requests from the CPU to read/write to the EFB.</string>
<string name="ignore_format_changes">Ignore Format Changes</string>
<string name="ignore_format_changes_descrip">Ignore any changes to the EFB format.</string>
<string name="efb_copy_method">EFB Copy Method</string>
<string name="efb_copy_method_descrip">Determines how EFB copies will be emulated.</string>
<string name="efb_copy_off">Off</string>
<string name="efb_copy_texture">Texture</string>
<string name="efb_copy_ram_uncached">RAM (uncached)</string>
<string name="efb_copy_ram_cached">RAM (cached)</string>
<string name="texture_cache">Texture Cache</string>
<string name="texture_cache_accuracy">Texture Cache Accuracy</string>
<string name="texture_cache_accuracy_descrip">The safer the selection, the less likely the emulator will be missing any texture updates from RAM.</string>
<string name="texture_cache_accuracy_low">Low</string>
<string name="texture_cache_accuracy_medium">Medium</string>
<string name="texture_cache_accuracy_high">High</string>
<string name="external_frame_buffer">External Frame Buffer</string>
<string name="external_frame_buffer_descrip">Determines how the XFB will be emulated.</string>
<string name="external_frame_buffer_virtual">Virtual</string>
<string name="external_frame_buffer_real">Real</string>
<string name="cache_display_lists">Cache Display Lists</string>
<string name="cache_display_lists_descrip">Speeds up emulation a bit by caching display lists.</string>
<string name="disable_destination_alpha">Disable Destination Alpha</string>
<string name="disable_destination_alpha_descrip">Disables emulation of a hardware feature called destination alpha, which is used in many games for various effects.</string>
<string name="fast_depth_calculation">Fast Depth Calculation</string>
<string name="fast_depth_calculation_descrip">Uses a less accurate algorithm to calculate depth values.</string>
<!-- Miscellaneous -->
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="disabled">Disabled</string>
<string name="other">Other</string>
</resources>

View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- CPU Settings -->
<PreferenceScreen android:title="@string/cpu_settings">
<CheckBoxPreference
android:key="dualCorePref"
android:summary="@string/on_off"
android:title="@string/dual_core" />
<ListPreference
android:key="cpuCorePref"
android:summary="@string/emu_core_to_use"
android:title="@string/cpu_core" />
</PreferenceScreen>
<!-- Video Settings -->
<PreferenceScreen android:title="@string/video_settings">
<!-- Video Enhancements -->
<PreferenceScreen android:title="@string/enhancements">
<ListPreference
android:entries="@array/internalResolutionEntries"
android:entryValues="@array/internalResolutionValues"
android:key="internalResolution"
android:summary="@string/internal_resolution_descrip"
android:title="@string/internal_resolution"/>
<ListPreference
android:entries="@array/anisotropicFilteringEntries"
android:entryValues="@array/anisotropicFilteringValues"
android:key="anisotropicFiltering"
android:summary="@string/anisotropic_filtering_descrip"
android:title="@string/anisotropic_filtering"/>
<CheckBoxPreference
android:defaultValue="true"
android:key="scaledEFBCopy"
android:summary="@string/scaled_efb_copy_descrip"
android:title="@string/scaled_efb_copy"/>
<CheckBoxPreference
android:defaultValue="false"
android:key="perPixelLighting"
android:summary="@string/per_pixel_lighting_descrip"
android:title="@string/per_pixel_lighting"/>
<CheckBoxPreference
android:defaultValue="false"
android:key="forceTextureFiltering"
android:summary="@string/force_texture_filtering_descrip"
android:title="@string/force_texture_filtering"/>
<CheckBoxPreference
android:defaultValue="false"
android:key="disableFog"
android:summary="@string/disable_fog_descrip"
android:title="@string/disable_fog"/>
</PreferenceScreen>
<!-- Video Hacks -->
<PreferenceScreen android:title="@string/hacks">
<PreferenceCategory android:title="@string/embedded_frame_buffer">
<CheckBoxPreference
android:key="skipEFBAccess"
android:summary="@string/skip_efb_access_descrip"
android:title="@string/skip_efb_access"/>
<CheckBoxPreference
android:key="ignoreFormatChanges"
android:summary="@string/ignore_format_changes_descrip"
android:title="@string/ignore_format_changes"/>
<ListPreference
android:entries="@array/efbCopyMethodEntries"
android:entryValues="@array/efbCopyMethodValues"
android:key="efbCopyMethod"
android:summary="@string/efb_copy_method_descrip"
android:title="@string/efb_copy_method"/>
</PreferenceCategory>
<!-- Texture Cache -->
<PreferenceCategory android:title="@string/texture_cache">
<ListPreference
android:entries="@array/textureCacheAccuracyEntries"
android:entryValues="@array/textureCacheAccuracyValues"
android:key="textureCacheAccuracy"
android:summary="@string/texture_cache_accuracy_descrip"
android:title="@string/texture_cache_accuracy"/>
</PreferenceCategory>
<!-- External Frame Buffer -->
<PreferenceCategory android:title="@string/external_frame_buffer">
<ListPreference
android:entries="@array/externalFrameBufferEntries"
android:entryValues="@array/externalFrameBufferValues"
android:key="externalFrameBuffer"
android:summary="@string/external_frame_buffer_descrip"
android:title="@string/external_frame_buffer"/>
</PreferenceCategory>
<!-- Other Hacks -->
<PreferenceCategory android:title="@string/other">
<CheckBoxPreference
android:defaultValue="false"
android:key="cacheDisplayLists"
android:summary="@string/cache_display_lists_descrip"
android:title="@string/cache_display_lists"/>
<CheckBoxPreference
android:defaultValue="false"
android:key="disableDestinationAlpha"
android:summary="@string/disable_destination_alpha_descrip"
android:title="@string/disable_destination_alpha"/>
<CheckBoxPreference
android:defaultValue="true"
android:key="fastDepthCalculation"
android:summary="@string/fast_depth_calculation_descrip"
android:title="@string/fast_depth_calculation"/>
</PreferenceCategory>
</PreferenceScreen>
<ListPreference
android:key="gpuPref"
android:summary="@string/video_backend_to_use"
android:title="@string/video_backend" />
</PreferenceScreen>
</PreferenceScreen>

View File

@ -12,7 +12,7 @@ import android.preference.PreferenceManager;
* aren't made necessary.
*/
public final class UserPreferences
{
{
/**
* Writes the config to the Dolphin ini file.
*
@ -28,12 +28,115 @@ public final class UserPreferences
// Current CPU core being used. Falls back to interpreter upon error.
String currentEmuCore = prefs.getString("cpuCorePref", "0");
// Current video backend being used. Falls back to software rendering upon error
// Current video backend being used. Falls back to software rendering upon error.
String currentVideoBackend = prefs.getString("gpuPref", "Software Rendering");
// Whether or not to ignore all EFB access requests from the CPU.
boolean skipEFBAccess = prefs.getBoolean("skipEFBAccess", false);
// Whether or not to ignore changes to the EFB format.
boolean ignoreFormatChanges = prefs.getBoolean("ignoreFormatChanges", false);
// EFB copy method to use.
String efbCopyMethod = prefs.getString("efbCopyMethod", "Off");
// Texture cache accuracy. Falls back to "Fast" up error.
String textureCacheAccuracy = prefs.getString("textureCacheAccuracy", "128");
// External frame buffer emulation. Falls back to disabled upon error.
String externalFrameBuffer = prefs.getString("externalFrameBuffer", "Disabled");
// Whether or not display list caching is enabled.
boolean dlistCachingEnabled = prefs.getBoolean("cacheDisplayLists", false);
// Whether or not to disable destination alpha.
boolean disableDstAlphaPass = prefs.getBoolean("disableDestinationAlpha", false);
// Whether or not to use fast depth calculation.
boolean useFastDepthCalc = prefs.getBoolean("fastDepthCalculation", true);
// Internal resolution. Falls back to 1x Native upon error.
String internalResolution = prefs.getString("internalResolution", "2");
// Anisotropic Filtering Level. Falls back to 1x upon error.
String anisotropicFiltLevel = prefs.getString("anisotropicFiltering", "0");
// Whether or not Scaled EFB copies are used.
boolean usingScaledEFBCopy = prefs.getBoolean("scaledEFBCopy", true);
// Whether or not per-pixel lighting is used.
boolean usingPerPixelLighting = prefs.getBoolean("perPixelLighting", false);
// Whether or not texture filtering is being forced.
boolean isForcingTextureFiltering = prefs.getBoolean("forceTextureFiltering", false);
// Whether or not fog is disabled.
boolean fogIsDisabled = prefs.getBoolean("disableFog", false);
// CPU related Settings
NativeLibrary.SetConfig("Dolphin.ini", "Core", "CPUCore", currentEmuCore);
NativeLibrary.SetConfig("Dolphin.ini", "Core", "CPUThread", isUsingDualCore ? "True" : "False");
// General Video Settings
NativeLibrary.SetConfig("Dolphin.ini", "Core", "GFXBackend", currentVideoBackend);
// Video Hack Settings
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBAccessEnable", skipEFBAccess ? "False" : "True");
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBEmulateFormatChanges", ignoreFormatChanges ? "True" : "False");
// Set EFB Copy Method
if (efbCopyMethod.equals("Off"))
{
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBCopyEnable", "False");
}
else if (efbCopyMethod.equals("Texture"))
{
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBCopyEnable", "True");
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBToTextureEnable", "True");
}
else if (efbCopyMethod.equals("RAM (uncached)"))
{
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBCopyEnable", "True");
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBToTextureEnable", "False");
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBCopyCacheEnable", "False");
}
else if (efbCopyMethod.equals("RAM (cached)"))
{
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBCopyEnable", "True");
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBToTextureEnable", "False");
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "EFBCopyCacheEnable", "True");
}
// Set texture cache accuracy
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "SafeTextureCacheColorSamples", textureCacheAccuracy);
// Set external frame buffer.
if (externalFrameBuffer.equals("Disabled"))
{
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "UseXFB", "False");
}
else if (externalFrameBuffer.equals("Virtual"))
{
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "UseXFB", "True");
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "UseRealXFB", "False");
}
else if (externalFrameBuffer.equals("Real"))
{
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "UseXFB", "True");
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "UseRealXFB", "True");
}
NativeLibrary.SetConfig("gfx_opengl.ini", "Hacks", "DlistCachingEnable", dlistCachingEnabled ? "True" : "False");
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "DstAlphaPass", disableDstAlphaPass ? "True" : "False");
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "FastDepthCalc", useFastDepthCalc ? "True" : "False");
//-- Enhancement Settings --//
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "EFBScale", internalResolution);
NativeLibrary.SetConfig("gfx_opengl.ini", "Enhancements", "MaxAnisotropy", anisotropicFiltLevel);
NativeLibrary.SetConfig("gfx.opengl.ini", "Hacks", "EFBScaledCopy", usingScaledEFBCopy ? "True" : "False");
NativeLibrary.SetConfig("gfx.opengl.ini", "Settings", "EnablePixelLighting", usingPerPixelLighting ? "True" : "False");
NativeLibrary.SetConfig("gfx.opengl.ini", "Enhancements", "ForceFiltering", isForcingTextureFiltering ? "True" : "False");
NativeLibrary.SetConfig("gfx.opengl.ini", "Settings", "DisableFog", fogIsDisabled ? "True" : "False");
}
}