[Android] Add a fastmem option to the cpu options, default disabled.

This commit is contained in:
Ryan Houdek 2013-09-12 23:08:00 -05:00
parent 1680f27739
commit ba05db7828
3 changed files with 11 additions and 0 deletions
Source/Android
res
src/org/dolphinemu/dolphinemu/settings

View File

@ -72,6 +72,8 @@
<string name="emu_core_to_use">Emulation core to use</string>
<string name="dual_core">Dual Core</string>
<string name="dual_core_descrip">Split workload to two CPU cores instead of one. Increases speed.</string>
<string name="fastmem">Fastmem</string>
<string name="fastmem_desc">Uses potentially unsafe optimizations for memory access.</string>
<string name="video_settings">Video</string>
<string name="software_renderer">Software Renderer</string>
<string name="opengl_es3">OpenGL ES 3</string>

View File

@ -10,5 +10,9 @@
android:key="cpuCorePref"
android:summary="@string/emu_core_to_use"
android:title="@string/cpu_core" />
<CheckBoxPreference
android:key="fastmemPref"
android:summary="@string/fastmem_desc"
android:title="@string/fastmem" />
</PreferenceScreen>

View File

@ -36,6 +36,7 @@ public final class UserPreferences
// Add the settings.
editor.putString("cpuCorePref", getConfig("Dolphin.ini", "Core", "CPUCore", "3"));
editor.putBoolean("dualCorePref", getConfig("Dolphin.ini", "Core", "CPUThread", "False").equals("True"));
editor.putBoolean("fastmemPref", getConfig("Dolphin.ini", "Core", "Fastmem", "False").equals("True"));
editor.putString("gpuPref", getConfig("Dolphin.ini", "Core", "GFXBackend", "Software Renderer"));
editor.putBoolean("showFPS", getConfig("gfx_opengl.ini", "Settings", "ShowFPS", "False").equals("True"));
@ -118,6 +119,9 @@ public final class UserPreferences
// Current CPU core being used. Falls back to interpreter upon error.
String currentEmuCore = prefs.getString("cpuCorePref", "0");
// Fastmem JIT core usage
boolean isUsingFastmem = prefs.getBoolean("fastmemPref", false);
// Current video backend being used. Falls back to software rendering upon error.
String currentVideoBackend = prefs.getString("gpuPref", "Software Rendering");
@ -173,6 +177,7 @@ public final class UserPreferences
// CPU related Settings
NativeLibrary.SetConfig("Dolphin.ini", "Core", "CPUCore", currentEmuCore);
NativeLibrary.SetConfig("Dolphin.ini", "Core", "CPUThread", isUsingDualCore ? "True" : "False");
NativeLibrary.SetConfig("Dolphin.ini", "Core", "Fastmem", isUsingFastmem ? "True" : "False");
// General Video Settings
NativeLibrary.SetConfig("Dolphin.ini", "Core", "GFXBackend", currentVideoBackend);