From e1f641424de268385649be6982d90182a8bfab2f Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 11 Jul 2013 10:18:03 -0500 Subject: [PATCH] [Android] Show JIT cores based on host arch. --- Source/Android/.idea/workspace.xml | 363 +++++++++++------- Source/Android/res/layout/prefs.xml | 9 +- Source/Android/res/values/prefvalues.xml | 10 - .../dolphinemu/dolphinemu/PrefsActivity.java | 45 +++ 4 files changed, 271 insertions(+), 156 deletions(-) diff --git a/Source/Android/.idea/workspace.xml b/Source/Android/.idea/workspace.xml index d3a0e0282d..1272e30c4c 100644 --- a/Source/Android/.idea/workspace.xml +++ b/Source/Android/.idea/workspace.xml @@ -103,7 +103,16 @@ - + + + + + + + + + + @@ -112,7 +121,7 @@ - + @@ -127,19 +136,40 @@ - - + + - + - - + + - + + + + + + + + + + + + + + + + + + + + + + @@ -148,7 +178,7 @@ - + @@ -177,9 +207,6 @@ @@ -246,66 +276,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -345,6 +315,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -365,12 +445,12 @@ - + - - + + @@ -569,6 +649,7 @@ + @@ -584,7 +665,6 @@ - @@ -604,18 +684,18 @@ - + - + - - + + @@ -679,39 +759,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -734,20 +781,6 @@ - - - - - - - - - - - - - - @@ -755,13 +788,6 @@ - - - - - - - @@ -776,20 +802,79 @@ - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Android/res/layout/prefs.xml b/Source/Android/res/layout/prefs.xml index bceb581c36..f98512d087 100644 --- a/Source/Android/res/layout/prefs.xml +++ b/Source/Android/res/layout/prefs.xml @@ -3,13 +3,8 @@ > - + android:title="CPU Settings" + android:key="cpuprefcat"> - - Interpreter - ARM JIT Recompiler - - - - 0 - 3 - - Software Renderer OpenGL ES 3 diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/PrefsActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/PrefsActivity.java index e12e37c10a..a46138a29c 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/PrefsActivity.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/PrefsActivity.java @@ -2,8 +2,11 @@ package org.dolphinemu.dolphinemu; import android.app.Activity; import android.content.Intent; +import android.os.Build; import android.os.Bundle; +import android.preference.ListPreference; import android.preference.PreferenceActivity; +import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; /** @@ -12,6 +15,7 @@ import android.preference.PreferenceFragment; * Refer to the license.txt file included. */ public class PrefsActivity extends PreferenceActivity { + private PrefsActivity m_activity; public class PrefsFragment extends PreferenceFragment { @@ -21,12 +25,53 @@ public class PrefsActivity extends PreferenceActivity { // Load the preferences from an XML resource addPreferencesFromResource(R.layout.prefs); + + final ListPreference etp = new ListPreference(m_activity); + CharSequence[] _entries; + CharSequence[] _entryvalues; + + if (Build.CPU_ABI.contains("x86")) + { + _entries = new CharSequence[] { + "Interpreter", + "JIT64 Recompiler", + "JITIL Recompiler", + }; + _entryvalues = new CharSequence[] {"0", "1", "2"}; + } + else if (Build.CPU_ABI.contains("arm")) + { + _entries = new CharSequence[] { + "Interpreter", + "JIT ARM Recompiler", + }; + _entryvalues = new CharSequence[] {"0", "3"}; + } + else + { + _entries = new CharSequence[] { + "Interpreter", + }; + _entryvalues = new CharSequence[] {"0"}; + } + + etp.setEntries(_entries); + etp.setEntryValues(_entryvalues); + etp.setKey("cpupref"); + etp.setTitle("CPU Core"); + etp.setSummary("Emulation core to use"); + + PreferenceCategory mCategory = (PreferenceCategory) findPreference("cpuprefcat"); + mCategory.addPreference(etp); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + m_activity = this; + getFragmentManager().beginTransaction().replace(android.R.id.content, new PrefsFragment()).commit(); }