Android: Implement vibrate-on-press and dualshock vibration

This commit is contained in:
Connor McLaughlin 2020-11-08 15:18:37 +10:00
parent cf2d9b86b0
commit c1c88eb41c
16 changed files with 616 additions and 497 deletions

View File

@ -6,6 +6,7 @@
#include "common/log.h" #include "common/log.h"
#include "common/string.h" #include "common/string.h"
#include "common/string_util.h" #include "common/string_util.h"
#include "common/timer.h"
#include "common/timestamp.h" #include "common/timestamp.h"
#include "core/bios.h" #include "core/bios.h"
#include "core/cheats.h" #include "core/cheats.h"
@ -39,6 +40,7 @@ static jmethodID s_EmulationActivity_method_reportMessage;
static jmethodID s_EmulationActivity_method_onEmulationStarted; static jmethodID s_EmulationActivity_method_onEmulationStarted;
static jmethodID s_EmulationActivity_method_onEmulationStopped; static jmethodID s_EmulationActivity_method_onEmulationStopped;
static jmethodID s_EmulationActivity_method_onGameTitleChanged; static jmethodID s_EmulationActivity_method_onGameTitleChanged;
static jmethodID s_EmulationActivity_method_setVibration;
static jclass s_PatchCode_class; static jclass s_PatchCode_class;
static jmethodID s_PatchCode_constructor; static jmethodID s_PatchCode_constructor;
@ -185,6 +187,8 @@ void AndroidHostInterface::LoadAndConvertSettings()
&g_settings.cpu_overclock_denominator); &g_settings.cpu_overclock_denominator);
g_settings.cpu_overclock_enable = (overclock_percent != 100); g_settings.cpu_overclock_enable = (overclock_percent != 100);
g_settings.UpdateOverclockActive(); g_settings.UpdateOverclockActive();
m_vibration_enabled = m_settings_interface.GetBoolValue("Controller1", "Vibration", false);
} }
void AndroidHostInterface::UpdateInputMap() void AndroidHostInterface::UpdateInputMap()
@ -353,8 +357,13 @@ void AndroidHostInterface::EmulationThreadLoop()
// simulate the system if not paused // simulate the system if not paused
if (System::IsRunning()) if (System::IsRunning())
{
System::RunFrame(); System::RunFrame();
if (m_vibration_enabled)
UpdateVibration();
}
// rendering // rendering
{ {
DrawImGuiWindows(); DrawImGuiWindows();
@ -432,10 +441,21 @@ std::unique_ptr<AudioStream> AndroidHostInterface::CreateAudioStream(AudioBacken
return CommonHostInterface::CreateAudioStream(backend); return CommonHostInterface::CreateAudioStream(backend);
} }
void AndroidHostInterface::OnSystemPaused(bool paused)
{
CommonHostInterface::OnSystemPaused(paused);
if (m_vibration_enabled)
SetVibration(false);
}
void AndroidHostInterface::OnSystemDestroyed() void AndroidHostInterface::OnSystemDestroyed()
{ {
CommonHostInterface::OnSystemDestroyed(); CommonHostInterface::OnSystemDestroyed();
ClearOSDMessages(); ClearOSDMessages();
if (m_vibration_enabled)
SetVibration(false);
} }
void AndroidHostInterface::OnRunningGameChanged() void AndroidHostInterface::OnRunningGameChanged()
@ -612,6 +632,51 @@ bool AndroidHostInterface::ImportPatchCodesFromString(const std::string& str)
return true; return true;
} }
void AndroidHostInterface::SetVibration(bool enabled)
{
const u64 current_time = Common::Timer::GetValue();
if (Common::Timer::ConvertValueToSeconds(current_time - m_last_vibration_update_time) < 0.1f &&
m_last_vibration_state == enabled)
{
return;
}
m_last_vibration_state = enabled;
m_last_vibration_update_time = current_time;
JNIEnv* env = AndroidHelpers::GetJNIEnv();
if (m_emulation_activity_object) {
env->CallVoidMethod(m_emulation_activity_object, s_EmulationActivity_method_setVibration,
static_cast<jboolean>(enabled));
}
}
void AndroidHostInterface::UpdateVibration()
{
static constexpr float THRESHOLD = 0.5f;
bool vibration_state = false;
for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++)
{
Controller* controller = System::GetController(i);
if (!controller)
continue;
const u32 motors = controller->GetVibrationMotorCount();
for (u32 j = 0; j < motors; j++)
{
if (controller->GetVibrationMotorStrength(j) >= THRESHOLD)
{
vibration_state = true;
break;
}
}
}
SetVibration(vibration_state);
}
extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
{ {
Log::SetDebugOutputParams(true, nullptr, LOGLEVEL_DEV); Log::SetDebugOutputParams(true, nullptr, LOGLEVEL_DEV);
@ -653,6 +718,8 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
env->GetMethodID(emulation_activity_class, "onEmulationStopped", "()V")) == nullptr || env->GetMethodID(emulation_activity_class, "onEmulationStopped", "()V")) == nullptr ||
(s_EmulationActivity_method_onGameTitleChanged = (s_EmulationActivity_method_onGameTitleChanged =
env->GetMethodID(emulation_activity_class, "onGameTitleChanged", "(Ljava/lang/String;)V")) == nullptr || env->GetMethodID(emulation_activity_class, "onGameTitleChanged", "(Ljava/lang/String;)V")) == nullptr ||
(s_EmulationActivity_method_setVibration =
env->GetMethodID(emulation_activity_class, "setVibration", "(Z)V")) == nullptr ||
(s_PatchCode_constructor = env->GetMethodID(s_PatchCode_class, "<init>", "(ILjava/lang/String;Z)V")) == nullptr) (s_PatchCode_constructor = env->GetMethodID(s_PatchCode_class, "<init>", "(ILjava/lang/String;Z)V")) == nullptr)
{ {
Log_ErrorPrint("AndroidHostInterface lookups failed"); Log_ErrorPrint("AndroidHostInterface lookups failed");

View File

@ -65,6 +65,7 @@ protected:
void ReleaseHostDisplay() override; void ReleaseHostDisplay() override;
std::unique_ptr<AudioStream> CreateAudioStream(AudioBackend backend) override; std::unique_ptr<AudioStream> CreateAudioStream(AudioBackend backend) override;
void OnSystemPaused(bool paused) override;
void OnSystemDestroyed() override; void OnSystemDestroyed() override;
void OnRunningGameChanged() override; void OnRunningGameChanged() override;
@ -77,6 +78,8 @@ private:
void DestroyImGuiContext(); void DestroyImGuiContext();
void LoadAndConvertSettings(); void LoadAndConvertSettings();
void SetVibration(bool enabled);
void UpdateVibration();
jobject m_java_object = {}; jobject m_java_object = {};
jobject m_emulation_activity_object = {}; jobject m_emulation_activity_object = {};
@ -92,6 +95,10 @@ private:
std::thread m_emulation_thread; std::thread m_emulation_thread;
std::atomic_bool m_emulation_thread_stop_request{false}; std::atomic_bool m_emulation_thread_stop_request{false};
u64 m_last_vibration_update_time = 0;
bool m_last_vibration_state = false;
bool m_vibration_enabled = false;
}; };
namespace AndroidHelpers { namespace AndroidHelpers {

View File

@ -3,6 +3,7 @@
package="com.github.stenzek.duckstation"> package="com.github.stenzek.duckstation">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application <application

View File

@ -15,6 +15,7 @@ public class AndroidHostInterface {
private Context mContext; private Context mContext;
static public native String getScmVersion(); static public native String getScmVersion();
static public native AndroidHostInterface create(Context context, String userDirectory); static public native AndroidHostInterface create(Context context, String userDirectory);
public AndroidHostInterface(Context context) { public AndroidHostInterface(Context context) {
@ -71,7 +72,9 @@ public class AndroidHostInterface {
public native void setDisplayAlignment(int alignment); public native void setDisplayAlignment(int alignment);
public native PatchCode[] getPatchCodeList(); public native PatchCode[] getPatchCodeList();
public native void setPatchCodeEnabled(int index, boolean enabled); public native void setPatchCodeEnabled(int index, boolean enabled);
public native boolean importPatchCodesFromString(String str); public native boolean importPatchCodesFromString(String str);
public native void addOSDMessage(String message, float duration); public native void addOSDMessage(String message, float duration);
@ -81,10 +84,13 @@ public class AndroidHostInterface {
public native String importBIOSImage(byte[] data); public native String importBIOSImage(byte[] data);
public native boolean isFastForwardEnabled(); public native boolean isFastForwardEnabled();
public native void setFastForwardEnabled(boolean enabled); public native void setFastForwardEnabled(boolean enabled);
public native String[] getMediaPlaylistPaths(); public native String[] getMediaPlaylistPaths();
public native int getMediaPlaylistIndex(); public native int getMediaPlaylistIndex();
public native boolean setMediaPlaylistIndex(int index); public native boolean setMediaPlaylistIndex(int index);
static { static {

View File

@ -8,6 +8,7 @@ import android.content.res.Configuration;
import android.hardware.input.InputManager; import android.hardware.input.InputManager;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Vibrator;
import android.util.Log; import android.util.Log;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
import android.view.View; import android.view.View;
@ -124,6 +125,7 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
private void doApplySettings() { private void doApplySettings() {
AndroidHostInterface.getInstance().applySettings(); AndroidHostInterface.getInstance().applySettings();
updateRequestedOrientation(); updateRequestedOrientation();
updateControllers();
} }
private void applySettings() { private void applySettings() {
@ -163,9 +165,6 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
doApplySettings(); doApplySettings();
} }
if (AndroidHostInterface.getInstance().isEmulationThreadPaused())
AndroidHostInterface.getInstance().pauseEmulationThread(false);
return; return;
} }
@ -323,8 +322,7 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
private void showMenu() { private void showMenu() {
if (getBooleanSetting("Main/PauseOnMenu", false) && if (getBooleanSetting("Main/PauseOnMenu", false) &&
!AndroidHostInterface.getInstance().isEmulationThreadPaused()) !AndroidHostInterface.getInstance().isEmulationThreadPaused()) {
{
AndroidHostInterface.getInstance().pauseEmulationThread(true); AndroidHostInterface.getInstance().pauseEmulationThread(true);
} }
@ -485,8 +483,7 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
private void showDiscChangeMenu() { private void showDiscChangeMenu() {
final String[] paths = AndroidHostInterface.getInstance().getMediaPlaylistPaths(); final String[] paths = AndroidHostInterface.getInstance().getMediaPlaylistPaths();
final int currentPath = AndroidHostInterface.getInstance().getMediaPlaylistIndex(); final int currentPath = AndroidHostInterface.getInstance().getMediaPlaylistIndex();
if (paths == null) if (paths == null) {
{
onMenuClosed(); onMenuClosed();
return; return;
} }
@ -515,6 +512,8 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
final String controllerType = getStringSetting("Controller1/Type", "DigitalController"); final String controllerType = getStringSetting("Controller1/Type", "DigitalController");
final String viewType = getStringSetting("Controller1/TouchscreenControllerView", "digital"); final String viewType = getStringSetting("Controller1/TouchscreenControllerView", "digital");
final boolean autoHideTouchscreenController = getBooleanSetting("Controller1/AutoHideTouchscreenController", false); final boolean autoHideTouchscreenController = getBooleanSetting("Controller1/AutoHideTouchscreenController", false);
final boolean hapticFeedback = getBooleanSetting("Controller1/HapticFeedback", false);
final boolean vibration = getBooleanSetting("Controller1/Vibration", false);
final FrameLayout activityLayout = findViewById(R.id.frameLayout); final FrameLayout activityLayout = findViewById(R.id.frameLayout);
Log.i("EmulationActivity", "Controller type: " + controllerType); Log.i("EmulationActivity", "Controller type: " + controllerType);
@ -526,14 +525,18 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
if (mTouchscreenController != null) { if (mTouchscreenController != null) {
activityLayout.removeView(mTouchscreenController); activityLayout.removeView(mTouchscreenController);
mTouchscreenController = null; mTouchscreenController = null;
mVibratorService = null;
} }
} else { } else {
if (mTouchscreenController == null) { if (mTouchscreenController == null) {
mTouchscreenController = new TouchscreenControllerView(this); mTouchscreenController = new TouchscreenControllerView(this);
if (vibration)
mVibratorService = (Vibrator) getSystemService(VIBRATOR_SERVICE);
activityLayout.addView(mTouchscreenController); activityLayout.addView(mTouchscreenController);
} }
mTouchscreenController.init(0, controllerType, viewType); mTouchscreenController.init(0, controllerType, viewType, hapticFeedback);
} }
} }
@ -578,4 +581,21 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
mInputDeviceListener = null; mInputDeviceListener = null;
} }
private Vibrator mVibratorService;
public void setVibration(boolean enabled) {
if (mVibratorService == null)
return;
runOnUiThread(() -> {
if (mVibratorService == null)
return;
if (enabled)
mVibratorService.vibrate(1000);
else
mVibratorService.cancel();
});
}
} }

View File

@ -9,19 +9,14 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.storage.StorageManager; import android.os.storage.StorageManager;
import android.provider.DocumentsContract; import android.provider.DocumentsContract;
import android.widget.Toast;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.StringWriter;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.nio.charset.Charset; import java.nio.charset.Charset;

View File

@ -73,7 +73,9 @@ public class GameListEntry {
return mTitle; return mTitle;
} }
public String getFileTitle() { return mFileTitle; } public String getFileTitle() {
return mFileTitle;
}
public String getModifiedTime() { public String getModifiedTime() {
return mModifiedTime; return mModifiedTime;

View File

@ -5,6 +5,7 @@ import android.content.res.TypedArray;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.HapticFeedbackConstants;
import android.view.View; import android.view.View;
/** /**
@ -14,6 +15,7 @@ public class TouchscreenControllerButtonView extends View {
private Drawable mUnpressedDrawable; private Drawable mUnpressedDrawable;
private Drawable mPressedDrawable; private Drawable mPressedDrawable;
private boolean mPressed = false; private boolean mPressed = false;
private boolean mHapticFeedback = false;
private int mControllerIndex = -1; private int mControllerIndex = -1;
private int mButtonCode = -1; private int mButtonCode = -1;
@ -81,6 +83,10 @@ public class TouchscreenControllerButtonView extends View {
mPressed = pressed; mPressed = pressed;
invalidate(); invalidate();
updateControllerState(); updateControllerState();
if (mHapticFeedback) {
performHapticFeedback(pressed ? HapticFeedbackConstants.VIRTUAL_KEY : HapticFeedbackConstants.VIRTUAL_KEY_RELEASE);
}
} }
public void setButtonCode(int controllerIndex, int code) { public void setButtonCode(int controllerIndex, int code) {
@ -88,6 +94,10 @@ public class TouchscreenControllerButtonView extends View {
mButtonCode = code; mButtonCode = code;
} }
public void setHapticFeedback(boolean enabled) {
mHapticFeedback = enabled;
}
private void updateControllerState() { private void updateControllerState() {
if (mButtonCode >= 0) if (mButtonCode >= 0)
AndroidHostInterface.getInstance().setControllerButtonState(mControllerIndex, mButtonCode, mPressed); AndroidHostInterface.getInstance().setControllerButtonState(mControllerIndex, mButtonCode, mPressed);

View File

@ -20,6 +20,7 @@ public class TouchscreenControllerView extends FrameLayout {
private View mMainView; private View mMainView;
private ArrayList<TouchscreenControllerButtonView> mButtonViews = new ArrayList<>(); private ArrayList<TouchscreenControllerButtonView> mButtonViews = new ArrayList<>();
private ArrayList<TouchscreenControllerAxisView> mAxisViews = new ArrayList<>(); private ArrayList<TouchscreenControllerAxisView> mAxisViews = new ArrayList<>();
private boolean mHapticFeedback;
public TouchscreenControllerView(Context context) { public TouchscreenControllerView(Context context) {
super(context); super(context);
@ -33,9 +34,10 @@ public class TouchscreenControllerView extends FrameLayout {
super(context, attrs, defStyle); super(context, attrs, defStyle);
} }
public void init(int controllerIndex, String controllerType, String viewType) { public void init(int controllerIndex, String controllerType, String viewType, boolean hapticFeedback) {
mControllerIndex = controllerIndex; mControllerIndex = controllerIndex;
mControllerType = controllerType; mControllerType = controllerType;
mHapticFeedback = hapticFeedback;
mButtonViews.clear(); mButtonViews.clear();
mAxisViews.clear(); mAxisViews.clear();
@ -99,6 +101,7 @@ public class TouchscreenControllerView extends FrameLayout {
if (code >= 0) { if (code >= 0) {
buttonView.setButtonCode(mControllerIndex, code); buttonView.setButtonCode(mControllerIndex, code);
buttonView.setHapticFeedback(mHapticFeedback);
mButtonViews.add(buttonView); mButtonViews.add(buttonView);
} else { } else {
Log.e("TouchscreenController", String.format("Unknown button name '%s' " + Log.e("TouchscreenController", String.format("Unknown button name '%s' " +

View File

@ -318,89 +318,89 @@
<item>1000% [600 FPS (NTSC) / 500 FPS (PAL)]</item> <item>1000% [600 FPS (NTSC) / 500 FPS (PAL)]</item>
</string-array> </string-array>
<string-array name="settings_emulation_speed_values"> <string-array name="settings_emulation_speed_values">
<item>0.0</item> <item>0.0</item>
<item>0.1</item> <item>0.1</item>
<item>0.2</item> <item>0.2</item>
<item>0.3</item> <item>0.3</item>
<item>0.4</item> <item>0.4</item>
<item>0.5</item> <item>0.5</item>
<item>0.6</item> <item>0.6</item>
<item>0.7</item> <item>0.7</item>
<item>0.8</item> <item>0.8</item>
<item>0.9</item> <item>0.9</item>
<item>1.0</item> <item>1.0</item>
<item>1.25</item> <item>1.25</item>
<item>1.5</item> <item>1.5</item>
<item>1.75</item> <item>1.75</item>
<item>2.0</item> <item>2.0</item>
<item>2.5</item> <item>2.5</item>
<item>3.0</item> <item>3.0</item>
<item>3.5</item> <item>3.5</item>
<item>4.0</item> <item>4.0</item>
<item>4.5</item> <item>4.5</item>
<item>5.0</item> <item>5.0</item>
<item>6.0</item> <item>6.0</item>
<item>7.0</item> <item>7.0</item>
<item>8.0</item> <item>8.0</item>
<item>9.0</item> <item>9.0</item>
<item>10.0</item> <item>10.0</item>
</string-array> </string-array>
<string-array name="settings_advanced_cpu_overclock_entries"> <string-array name="settings_advanced_cpu_overclock_entries">
<item>25% (8MHz)</item> <item>25% (8MHz)</item>
<item>50% (16MHz)</item> <item>50% (16MHz)</item>
<item>75% (24MHz)</item> <item>75% (24MHz)</item>
<item>100% (33MHz, Default)</item> <item>100% (33MHz, Default)</item>
<item>125% (41MHz)</item> <item>125% (41MHz)</item>
<item>150% (49MHz)</item> <item>150% (49MHz)</item>
<item>175% (57MHz)</item> <item>175% (57MHz)</item>
<item>200% (66MHz)</item> <item>200% (66MHz)</item>
<item>225% (74MHz)</item> <item>225% (74MHz)</item>
<item>250% (82MHz)</item> <item>250% (82MHz)</item>
<item>275% (90MHz)</item> <item>275% (90MHz)</item>
<item>300% (99MHz)</item> <item>300% (99MHz)</item>
<item>350% (115MHz)</item> <item>350% (115MHz)</item>
<item>400% (132MHz)</item> <item>400% (132MHz)</item>
<item>450% (148MHz)</item> <item>450% (148MHz)</item>
<item>500% (165MHz)</item> <item>500% (165MHz)</item>
<item>500% (165MHz)</item> <item>500% (165MHz)</item>
<item>600% (198MHz)</item> <item>600% (198MHz)</item>
<item>700% (231MHz)</item> <item>700% (231MHz)</item>
<item>800% (264MHz)</item> <item>800% (264MHz)</item>
<item>900% (297MHz)</item> <item>900% (297MHz)</item>
<item>1000% (330MHz)</item> <item>1000% (330MHz)</item>
</string-array> </string-array>
<string-array name="settings_advanced_cpu_overclock_values"> <string-array name="settings_advanced_cpu_overclock_values">
<item>25</item> <item>25</item>
<item>50</item> <item>50</item>
<item>75</item> <item>75</item>
<item>100</item> <item>100</item>
<item>125</item> <item>125</item>
<item>150</item> <item>150</item>
<item>175</item> <item>175</item>
<item>200</item> <item>200</item>
<item>225</item> <item>225</item>
<item>250</item> <item>250</item>
<item>275</item> <item>275</item>
<item>300</item> <item>300</item>
<item>350</item> <item>350</item>
<item>400</item> <item>400</item>
<item>450</item> <item>450</item>
<item>500</item> <item>500</item>
<item>500</item> <item>500</item>
<item>600</item> <item>600</item>
<item>700</item> <item>700</item>
<item>800</item> <item>800</item>
<item>900</item> <item>900</item>
<item>1000</item> <item>1000</item>
</string-array> </string-array>
<string-array name="settings_emulation_screen_orientation_entries"> <string-array name="settings_emulation_screen_orientation_entries">
<item>Use Device Setting</item> <item>Use Device Setting</item>
<item>Portrait</item> <item>Portrait</item>
<item>Landscape</item> <item>Landscape</item>
</string-array> </string-array>
<string-array name="settings_emulation_screen_orientation_values"> <string-array name="settings_emulation_screen_orientation_values">
<item>unspecified</item> <item>unspecified</item>
<item>portrait</item> <item>portrait</item>
<item>landscape</item> <item>landscape</item>
</string-array> </string-array>
</resources> </resources>

View File

@ -14,78 +14,77 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"> <ListPreference
<ListPreference app:key="CPU/Overclock"
app:key="CPU/Overclock" app:title="CPU Overclocking"
app:title="CPU Overclocking" app:defaultValue="100"
app:defaultValue="100" app:entries="@array/settings_advanced_cpu_overclock_entries"
app:entries="@array/settings_advanced_cpu_overclock_entries" app:entryValues="@array/settings_advanced_cpu_overclock_values"
app:entryValues="@array/settings_advanced_cpu_overclock_values" app:useSimpleSummaryProvider="true"
app:useSimpleSummaryProvider="true" app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="CDROM/RegionCheck"
app:key="CDROM/RegionCheck" app:title="CD-ROM Region Check"
app:title="CD-ROM Region Check" app:defaultValue="false"
app:defaultValue="false" app:summary="Prevents discs from incorrect regions being read by the emulator. Usually safe to disable."
app:summary="Prevents discs from incorrect regions being read by the emulator. Usually safe to disable." app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="GPU/PGXPVertexCache"
app:key="GPU/PGXPVertexCache" app:title="PGXP Vertex Cache"
app:title="PGXP Vertex Cache" app:defaultValue="false"
app:defaultValue="false" app:summary="Uses screen coordinates as a fallback when tracking vertices through memory fails. May improve PGXP compatibility."
app:summary="Uses screen coordinates as a fallback when tracking vertices through memory fails. May improve PGXP compatibility." app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="GPU/PGXPCPU"
app:key="GPU/PGXPCPU" app:title="PGXP CPU Mode"
app:title="PGXP CPU Mode" app:defaultValue="false"
app:defaultValue="false" app:summary="Tries to track vertex manipulation through the CPU. Some games require this option for PGXP to be effective. Very slow, and incompatible with the recompiler."
app:summary="Tries to track vertex manipulation through the CPU. Some games require this option for PGXP to be effective. Very slow, and incompatible with the recompiler." app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="CPU/RecompilerICache"
app:key="CPU/RecompilerICache" app:title="CPU Recompiler ICache"
app:title="CPU Recompiler ICache" app:defaultValue="false"
app:defaultValue="false" app:summary="Determines whether the CPU's instruction cache is simulated in the recompiler. Improves accuracy at a small cost to performance. If games are running too fast, try enabling this option."
app:summary="Determines whether the CPU's instruction cache is simulated in the recompiler. Improves accuracy at a small cost to performance. If games are running too fast, try enabling this option." app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="CPU/Fastmem"
app:key="CPU/Fastmem" app:title="CPU Recompiler Fast Memory Access"
app:title="CPU Recompiler Fast Memory Access" app:defaultValue="true"
app:defaultValue="true" app:summary="Makes guest memory access more efficient by using page faults and backpatching. Disable if it is unstable on your device."
app:summary="Makes guest memory access more efficient by using page faults and backpatching. Disable if it is unstable on your device." app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <ListPreference
<ListPreference app:key="Display/MaxFPS"
app:key="Display/MaxFPS" app:title="Presented Frame Limit"
app:title="Presented Frame Limit" app:defaultValue="60"
app:defaultValue="60" app:entries="@array/settings_advanced_display_fps_limit_entries"
app:entries="@array/settings_advanced_display_fps_limit_entries" app:entryValues="@array/settings_advanced_display_fps_limit_values"
app:entryValues="@array/settings_advanced_display_fps_limit_values" app:useSimpleSummaryProvider="true"
app:useSimpleSummaryProvider="true" app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="BIOS/PatchTTYEnable"
app:key="BIOS/PatchTTYEnable" app:title="@string/settings_console_tty_output"
app:title="@string/settings_console_tty_output" app:defaultValue="false"
app:defaultValue="false" app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <ListPreference
<ListPreference app:key="Logging/LogLevel"
app:key="Logging/LogLevel" app:title="Logging Level"
app:title="Logging Level" app:defaultValue="Warning"
app:defaultValue="Warning" app:entries="@array/settings_log_level_entries"
app:entries="@array/settings_log_level_entries" app:entryValues="@array/settings_log_level_values"
app:entryValues="@array/settings_log_level_values" app:useSimpleSummaryProvider="true"
app:useSimpleSummaryProvider="true" app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="Logging/LogToFile"
app:key="Logging/LogToFile" app:title="Log To File"
app:title="Log To File" app:defaultValue="false"
app:defaultValue="false" app:summary="Writes log messages to duckstation.log in your user directory. Only use for debugging as it slows down emulation."
app:summary="Writes log messages to duckstation.log in your user directory. Only use for debugging as it slows down emulation." app:iconSpaceReserved="false" />
app:iconSpaceReserved="false"/> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="Logging/LogToDebug"
app:key="Logging/LogToDebug" app:title="Log To Logcat"
app:title="Log To Logcat" app:defaultValue="false"
app:defaultValue="false" app:summary="Writes log messages to the Android message logger. Only useful when attached to a computer with adb."
app:summary="Writes log messages to the Android message logger. Only useful when attached to a computer with adb." app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" />
</PreferenceScreen> </PreferenceScreen>

View File

@ -17,49 +17,49 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<SeekBarPreference <SeekBarPreference
app:key="Audio/OutputVolume" app:key="Audio/OutputVolume"
app:title="Volume" app:title="Volume"
app:summary="Controls the volume of the emulator's sound output." app:summary="Controls the volume of the emulator's sound output."
app:defaultValue="100" app:defaultValue="100"
android:max="100" android:max="100"
app:min="0" app:min="0"
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
app:showSeekBarValue="true" /> app:showSeekBarValue="true" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Audio/OutputMuted" app:key="Audio/OutputMuted"
app:title="Mute All Sound" app:title="Mute All Sound"
app:defaultValue="false" app:defaultValue="false"
app:summary="Prevents the emulator from emitting any sound." app:summary="Prevents the emulator from emitting any sound."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="CDROM/MuteCDAudio" app:key="CDROM/MuteCDAudio"
app:title="Mute CD Audio" app:title="Mute CD Audio"
app:defaultValue="false" app:defaultValue="false"
app:summary="Forcibly mutes both CD-DA and XA audio from the CD-ROM. Can be used to disable background music in some games." app:summary="Forcibly mutes both CD-DA and XA audio from the CD-ROM. Can be used to disable background music in some games."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<ListPreference <ListPreference
app:key="Audio/Backend" app:key="Audio/Backend"
app:title="Audio Backend" app:title="Audio Backend"
app:entries="@array/settings_audio_backend_entries" app:entries="@array/settings_audio_backend_entries"
app:entryValues="@array/settings_audio_backend_values" app:entryValues="@array/settings_audio_backend_values"
app:defaultValue="OpenSLES" app:defaultValue="OpenSLES"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false"/> app:iconSpaceReserved="false" />
<ListPreference <ListPreference
app:key="Audio/BufferSize" app:key="Audio/BufferSize"
app:title="Audio Buffer Size" app:title="Audio Buffer Size"
app:entries="@array/settings_audio_buffer_size_entries" app:entries="@array/settings_audio_buffer_size_entries"
app:entryValues="@array/settings_audio_buffer_size_values" app:entryValues="@array/settings_audio_buffer_size_values"
app:defaultValue="2048" app:defaultValue="2048"
app:summary="Determines the latency between audio being generated and output to speakers. Smaller values reduce latency, but variations in emulation speed will cause hitches." app:summary="Determines the latency between audio being generated and output to speakers. Smaller values reduce latency, but variations in emulation speed will cause hitches."
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Audio/Sync" app:key="Audio/Sync"
app:title="Audio Sync" app:title="Audio Sync"
app:defaultValue="true" app:defaultValue="true"
app:summary="Throttles the emulation speed based on the audio backend pulling audio frames. This helps to remove noises or crackling if emulation is too fast. Sync will automatically be disabled if not running at 100% speed." app:summary="Throttles the emulation speed based on the audio backend pulling audio frames. This helps to remove noises or crackling if emulation is too fast. Sync will automatically be disabled if not running at 100% speed."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
</PreferenceScreen> </PreferenceScreen>

View File

@ -14,52 +14,64 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference
app:key="Controller1/Type"
app:title="Controller Type"
app:entries="@array/settings_controller_type_entries"
app:entryValues="@array/settings_controller_type_values"
app:defaultValue="DigitalController"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Controller1/AutoEnableAnalog"
app:title="Enable Analog Mode On Reset"
app:defaultValue="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="Controller1/TouchscreenControllerView"
app:title="Touchscreen Controller View"
app:entries="@array/settings_touchscreen_controller_view_entries"
app:entryValues="@array/settings_touchscreen_controller_view_values"
app:defaultValue="digital"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Controller1/AutoHideTouchscreenController"
app:title="Auto-Hide Touchscreen Controller"
app:defaultValue="false"
app:summary="Hides the touchscreen controller when an external controller is detected."
app:iconSpaceReserved="false"/>
<ListPreference <ListPreference
app:key="MemoryCards/Card1Type" app:key="Controller1/Type"
app:title="Memory Card 1 Type" app:title="Controller Type"
app:entries="@array/settings_memory_card_mode_entries" app:entries="@array/settings_controller_type_entries"
app:entryValues="@array/settings_memory_card_mode_values" app:entryValues="@array/settings_controller_type_values"
app:defaultValue="PerGameTitle" app:defaultValue="DigitalController"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<ListPreference <SwitchPreferenceCompat
app:key="MemoryCards/Card2Type" app:key="Controller1/AutoEnableAnalog"
app:title="Memory Card 2 Type" app:title="Enable Analog Mode On Reset"
app:entries="@array/settings_memory_card_mode_entries" app:defaultValue="true"
app:entryValues="@array/settings_memory_card_mode_values" app:iconSpaceReserved="false" />
app:defaultValue="None" <ListPreference
app:useSimpleSummaryProvider="true" app:key="Controller1/TouchscreenControllerView"
app:iconSpaceReserved="false" /> app:title="Touchscreen Controller View"
app:entries="@array/settings_touchscreen_controller_view_entries"
app:entryValues="@array/settings_touchscreen_controller_view_values"
app:defaultValue="digital"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Controller1/AutoHideTouchscreenController"
app:title="Auto-Hide Touchscreen Controller"
app:defaultValue="false"
app:summary="Hides the touchscreen controller when an external controller is detected."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Controller1/HapticFeedback"
app:title="Vibrate On Press"
app:defaultValue="false"
app:summary="Enables a short vibration when a touchscreen button is pressed. Requires &quot;Vibrate on Touch&quot; to be enabled on your device."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Controller1/Vibration"
app:title="Enable Vibration"
app:defaultValue="false"
app:summary="Forwards rumble from the game to the phone's vibration motor."
app:iconSpaceReserved="false" />
<ListPreference
app:key="MemoryCards/Card1Type"
app:title="Memory Card 1 Type"
app:entries="@array/settings_memory_card_mode_entries"
app:entryValues="@array/settings_memory_card_mode_values"
app:defaultValue="PerGameTitle"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="MemoryCards/Card2Type"
app:title="Memory Card 2 Type"
app:entries="@array/settings_memory_card_mode_entries"
app:entryValues="@array/settings_memory_card_mode_values"
app:defaultValue="None"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
</PreferenceScreen> </PreferenceScreen>

View File

@ -14,64 +14,63 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference <ListPreference
app:key="Display/CropMode" app:key="Display/CropMode"
app:title="Crop Mode" app:title="Crop Mode"
app:entries="@array/settings_display_crop_mode_entries" app:entries="@array/settings_display_crop_mode_entries"
app:entryValues="@array/settings_display_crop_mode_values" app:entryValues="@array/settings_display_crop_mode_values"
app:defaultValue="Overscan" app:defaultValue="Overscan"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<ListPreference <ListPreference
app:key="Display/AspectRatio" app:key="Display/AspectRatio"
app:title="Aspect Ratio" app:title="Aspect Ratio"
app:entries="@array/settings_display_aspect_ratio_names" app:entries="@array/settings_display_aspect_ratio_names"
app:entryValues="@array/settings_display_aspect_ratio_values" app:entryValues="@array/settings_display_aspect_ratio_values"
app:defaultValue="4:3" app:defaultValue="4:3"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Display/LinearFiltering" app:key="Display/LinearFiltering"
app:title="Linear Upscaling" app:title="Linear Upscaling"
app:defaultValue="true" app:defaultValue="true"
app:summary="Smooths out the image when upscaling the console to the screen." app:summary="Smooths out the image when upscaling the console to the screen."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Display/IntegerScaling" app:key="Display/IntegerScaling"
app:title="Integer Upscaling" app:title="Integer Upscaling"
app:defaultValue="false" app:defaultValue="false"
app:summary="Adds padding to the display area to ensure that the ratio between pixels on the host to pixels in the console is an integer number. May result in a sharper image in some 2D games." app:summary="Adds padding to the display area to ensure that the ratio between pixels on the host to pixels in the console is an integer number. May result in a sharper image in some 2D games."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Display/ShowOSDMessages" app:key="Display/ShowOSDMessages"
app:title="@string/settings_osd_show_messages" app:title="@string/settings_osd_show_messages"
app:defaultValue="true" app:defaultValue="true"
app:summary="Shows on-screen-display messages when events occur such as save states being created/loaded, screenshots being taken, etc." app:summary="Shows on-screen-display messages when events occur such as save states being created/loaded, screenshots being taken, etc."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Display/ShowSpeed" app:key="Display/ShowSpeed"
app:title="@string/settings_osd_show_speed" app:title="@string/settings_osd_show_speed"
app:defaultValue="false" app:defaultValue="false"
app:summary="Sets the target emulation speed. It is not guaranteed that this speed will be reached, and if not, the emulator will run as fast as it can manage." app:summary="Sets the target emulation speed. It is not guaranteed that this speed will be reached, and if not, the emulator will run as fast as it can manage."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Display/ShowFPS" app:key="Display/ShowFPS"
app:title="@string/settings_osd_show_show_fps" app:title="@string/settings_osd_show_show_fps"
app:defaultValue="false" app:defaultValue="false"
app:summary="Shows the internal frame rate of the game in the top-right corner of the display." app:summary="Shows the internal frame rate of the game in the top-right corner of the display."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Display/ShowVPS" app:key="Display/ShowVPS"
app:title="@string/settings_osd_show_show_vps" app:title="@string/settings_osd_show_show_vps"
app:defaultValue="false" app:defaultValue="false"
app:summary="Shows the number of frames (or v-syncs) displayed per second by the system in the top-right corner of the display." app:summary="Shows the number of frames (or v-syncs) displayed per second by the system in the top-right corner of the display."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
</PreferenceScreen> </PreferenceScreen>

View File

@ -14,122 +14,121 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"> <ListPreference
<ListPreference app:key="CDROM/ReadSpeedup"
app:key="CDROM/ReadSpeedup" app:title="CD-ROM Read Speedup"
app:title="CD-ROM Read Speedup" app:entries="@array/settings_cdrom_read_speedup_entries"
app:entries="@array/settings_cdrom_read_speedup_entries" app:entryValues="@array/settings_cdrom_read_speedup_values"
app:entryValues="@array/settings_cdrom_read_speedup_values" app:defaultValue="1"
app:defaultValue="1" app:summary="Speeds up CD-ROM reads by the specified factor. Only applies to double-speed reads, and is ignored when audio is playing. May improve loading speeds in some games, at the cost of breaking others."
app:summary="Speeds up CD-ROM reads by the specified factor. Only applies to double-speed reads, and is ignored when audio is playing. May improve loading speeds in some games, at the cost of breaking others." app:useSimpleSummaryProvider="true"
app:useSimpleSummaryProvider="true" app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="BIOS/PatchFastBoot"
app:key="BIOS/PatchFastBoot" app:title="@string/settings_console_fast_boot"
app:title="@string/settings_console_fast_boot" app:defaultValue="false"
app:defaultValue="false" app:summary="Skips the BIOS shell/intro, booting directly into the game. Usually safe to enable, but some games break."
app:summary="Skips the BIOS shell/intro, booting directly into the game. Usually safe to enable, but some games break." app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <ListPreference
<ListPreference app:key="GPU/ResolutionScale"
app:key="GPU/ResolutionScale" app:title="@string/settings_gpu_resolution_scale"
app:title="@string/settings_gpu_resolution_scale" app:entries="@array/settings_gpu_resolution_scale_entries"
app:entries="@array/settings_gpu_resolution_scale_entries" app:entryValues="@array/settings_gpu_resolution_scale_values"
app:entryValues="@array/settings_gpu_resolution_scale_values" app:defaultValue="1"
app:defaultValue="1" app:useSimpleSummaryProvider="true"
app:useSimpleSummaryProvider="true" app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <ListPreference
<ListPreference app:key="GPU/MSAA"
app:key="GPU/MSAA" app:title="Multisample Antialiasing"
app:title="Multisample Antialiasing" app:entries="@array/settings_gpu_msaa_entries"
app:entries="@array/settings_gpu_msaa_entries" app:entryValues="@array/settings_gpu_msaa_values"
app:entryValues="@array/settings_gpu_msaa_values" app:defaultValue="1"
app:defaultValue="1" app:useSimpleSummaryProvider="true"
app:useSimpleSummaryProvider="true" app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" /> <SwitchPreferenceCompat
<SwitchPreferenceCompat app:key="GPU/TrueColor"
app:key="GPU/TrueColor" app:title="True Color Rendering (24-bit, disables dithering)"
app:title="True Color Rendering (24-bit, disables dithering)" app:summary="This produces nicer looking gradients at the cost of making some colours look slightly different. Disabling the option also enables dithering. Most games are compatible with this option."
app:summary="This produces nicer looking gradients at the cost of making some colours look slightly different. Disabling the option also enables dithering. Most games are compatible with this option." app:iconSpaceReserved="false" />
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="GPU/ScaledDithering" app:key="GPU/ScaledDithering"
app:title="Scaled Dithering (scale dither pattern to resolution)" app:title="Scaled Dithering (scale dither pattern to resolution)"
app:defaultValue="true" app:defaultValue="true"
app:summary="Scales the dither pattern to the resolution scale of the emulated GPU. This makes the dither pattern much less obvious at higher resolutions. Usually safe to enable, and only supported by the hardware renderers." app:summary="Scales the dither pattern to the resolution scale of the emulated GPU. This makes the dither pattern much less obvious at higher resolutions. Usually safe to enable, and only supported by the hardware renderers."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="GPU/DisableInterlacing" app:key="GPU/DisableInterlacing"
app:title="Disable Interlacing (force progressive render/scan)" app:title="Disable Interlacing (force progressive render/scan)"
app:defaultValue="true" app:defaultValue="true"
app:summary="Forces the rendering and display of frames to progressive mode. This removes the &quot;combing&quot; effect seen in 480i games by rendering them in 480p. Usually safe to enable." app:summary="Forces the rendering and display of frames to progressive mode. This removes the &quot;combing&quot; effect seen in 480i games by rendering them in 480p. Usually safe to enable."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<ListPreference <ListPreference
app:key="GPU/TextureFilter" app:key="GPU/TextureFilter"
app:title="Texture Filtering" app:title="Texture Filtering"
app:entries="@array/settings_gpu_texture_filter_names" app:entries="@array/settings_gpu_texture_filter_names"
app:entryValues="@array/settings_gpu_texture_filter_values" app:entryValues="@array/settings_gpu_texture_filter_values"
app:defaultValue="Nearest" app:defaultValue="Nearest"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="GPU/ForceNTSCTimings" app:key="GPU/ForceNTSCTimings"
app:title="Force NTSC Timings (60hz-on-PAL)" app:title="Force NTSC Timings (60hz-on-PAL)"
app:defaultValue="false" app:defaultValue="false"
app:summary="Uses NTSC frame timings when the console is in PAL mode, forcing PAL games to run at 60hz." app:summary="Uses NTSC frame timings when the console is in PAL mode, forcing PAL games to run at 60hz."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="GPU/WidescreenHack" app:key="GPU/WidescreenHack"
app:title="Widescreen Hack" app:title="Widescreen Hack"
app:defaultValue="false" app:defaultValue="false"
app:summary="Scales vertex positions in screen-space to a widescreen aspect ratio, essentially increasing the field of view from 4:3 to 16:9 in 3D games. Not be compatible with all games." app:summary="Scales vertex positions in screen-space to a widescreen aspect ratio, essentially increasing the field of view from 4:3 to 16:9 in 3D games. Not be compatible with all games."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Display/Force4_3For24Bit" app:key="Display/Force4_3For24Bit"
app:title="Force 4:3 For 24-Bit Display" app:title="Force 4:3 For 24-Bit Display"
app:defaultValue="false" app:defaultValue="false"
app:summary="Switches back to 4:3 display aspect ratio when displaying 24-bit content, usually FMVs." app:summary="Switches back to 4:3 display aspect ratio when displaying 24-bit content, usually FMVs."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="GPU/ChromaSmoothing24Bit" app:key="GPU/ChromaSmoothing24Bit"
app:title="Chroma Smoothing For 24-Bit Display" app:title="Chroma Smoothing For 24-Bit Display"
app:defaultValue="false" app:defaultValue="false"
app:summary="Smooths out blockyness between colour transitions in 24-bit content, usually FMVs. Only applies to the hardware renderers." app:summary="Smooths out blockyness between colour transitions in 24-bit content, usually FMVs. Only applies to the hardware renderers."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="GPU/PGXPEnable" app:key="GPU/PGXPEnable"
app:title="PGXP Geometry Correction" app:title="PGXP Geometry Correction"
app:defaultValue="false" app:defaultValue="false"
app:summary="Reduces &quot;wobbly&quot; polygons and &quot;warping&quot; textures that are common in PS1 games. >Only works with the hardware renderers. May not be compatible with all games." app:summary="Reduces &quot;wobbly&quot; polygons and &quot;warping&quot; textures that are common in PS1 games. >Only works with the hardware renderers. May not be compatible with all games."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="GPU/PGXPCulling" app:key="GPU/PGXPCulling"
app:title="PGXP Culling Correction" app:title="PGXP Culling Correction"
app:defaultValue="true" app:defaultValue="true"
app:summary="Increases the precision of polygon culling, reducing the number of holes in geometry. Requires geometry correction enabled." app:summary="Increases the precision of polygon culling, reducing the number of holes in geometry. Requires geometry correction enabled."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="GPU/PGXPTextureCorrection" app:key="GPU/PGXPTextureCorrection"
app:title="PGXP Texture Correction" app:title="PGXP Texture Correction"
app:defaultValue="true" app:defaultValue="true"
app:summary="Uses perspective-correct interpolation for texture coordinates and colors, straightening out warped textures. Requires geometry correction enabled." app:summary="Uses perspective-correct interpolation for texture coordinates and colors, straightening out warped textures. Requires geometry correction enabled."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="GPU/PGXPPreserveProjFP" app:key="GPU/PGXPPreserveProjFP"
app:title="PGXP Preserve Projection Precision" app:title="PGXP Preserve Projection Precision"
app:defaultValue="false" app:defaultValue="false"
app:summary="Enables additional precision for PGXP. May improve visuals in some games but break others." app:summary="Enables additional precision for PGXP. May improve visuals in some games but break others."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
</PreferenceScreen> </PreferenceScreen>

View File

@ -14,82 +14,81 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference <ListPreference
app:key="Main/EmulationSpeed" app:key="Main/EmulationSpeed"
app:title="Emulation Speed" app:title="Emulation Speed"
app:entries="@array/settings_emulation_speed_entries" app:entries="@array/settings_emulation_speed_entries"
app:entryValues="@array/settings_emulation_speed_values" app:entryValues="@array/settings_emulation_speed_values"
app:defaultValue="1.0" app:defaultValue="1.0"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<ListPreference <ListPreference
app:key="Main/FastForwardSpeed" app:key="Main/FastForwardSpeed"
app:title="Fast Forward Speed" app:title="Fast Forward Speed"
app:entries="@array/settings_emulation_speed_entries" app:entries="@array/settings_emulation_speed_entries"
app:entryValues="@array/settings_emulation_speed_values" app:entryValues="@array/settings_emulation_speed_values"
app:defaultValue="0.0" app:defaultValue="0.0"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Main/SaveStateOnExit" app:key="Main/SaveStateOnExit"
app:title="Save State On Exit" app:title="Save State On Exit"
app:defaultValue="true" app:defaultValue="true"
app:summary="Automatically saves the emulator state when powering down or exiting. You can then resume directly from where you left off next time." app:summary="Automatically saves the emulator state when powering down or exiting. You can then resume directly from where you left off next time."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Main/PauseOnMenu" app:key="Main/PauseOnMenu"
app:title="Pause When Menu Opened" app:title="Pause When Menu Opened"
app:defaultValue="false" app:defaultValue="false"
app:summary="Pauses emulation when ingame and the menu is opened." app:summary="Pauses emulation when ingame and the menu is opened."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<ListPreference <ListPreference
app:key="Main/EmulationScreenOrientation" app:key="Main/EmulationScreenOrientation"
app:title="Emulation Screen Orientation" app:title="Emulation Screen Orientation"
app:entries="@array/settings_emulation_screen_orientation_entries" app:entries="@array/settings_emulation_screen_orientation_entries"
app:entryValues="@array/settings_emulation_screen_orientation_values" app:entryValues="@array/settings_emulation_screen_orientation_values"
app:defaultValue="unspecified" app:defaultValue="unspecified"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Main/AutoLoadCheats" app:key="Main/AutoLoadCheats"
app:title="Load Patch Codes" app:title="Load Patch Codes"
app:defaultValue="false" app:defaultValue="false"
app:summary="Loads patch codes from cheats/&lt;game name&gt;.cht in PCSXR format. Codes can be toggled while ingame." app:summary="Loads patch codes from cheats/&lt;game name&gt;.cht in PCSXR format. Codes can be toggled while ingame."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:key="Display/VSync" app:key="Display/VSync"
app:title="Video Sync" app:title="Video Sync"
app:defaultValue="false" app:defaultValue="false"
app:summary="Enable this option to match DuckStation's refresh rate with your current monitor or screen. VSync is automatically disabled when it is not possible (e.g. running at non-100% speed)." app:summary="Enable this option to match DuckStation's refresh rate with your current monitor or screen. VSync is automatically disabled when it is not possible (e.g. running at non-100% speed)."
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<ListPreference <ListPreference
app:key="Console/Region" app:key="Console/Region"
app:title="@string/settings_console_region" app:title="@string/settings_console_region"
app:entries="@array/settings_console_region_entries" app:entries="@array/settings_console_region_entries"
app:entryValues="@array/settings_console_region_values" app:entryValues="@array/settings_console_region_values"
app:defaultValue="@string/settings_console_region_default" app:defaultValue="@string/settings_console_region_default"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<ListPreference <ListPreference
app:key="CPU/ExecutionMode" app:key="CPU/ExecutionMode"
app:title="@string/settings_cpu_execution_mode" app:title="@string/settings_cpu_execution_mode"
app:entries="@array/settings_cpu_execution_mode_entries" app:entries="@array/settings_cpu_execution_mode_entries"
app:entryValues="@array/settings_cpu_execution_mode_values" app:entryValues="@array/settings_cpu_execution_mode_values"
app:defaultValue="Recompiler" app:defaultValue="Recompiler"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<ListPreference <ListPreference
app:key="GPU/Renderer" app:key="GPU/Renderer"
app:title="@string/settings_gpu_renderer" app:title="@string/settings_gpu_renderer"
app:entries="@array/gpu_renderer_entries" app:entries="@array/gpu_renderer_entries"
app:entryValues="@array/gpu_renderer_values" app:entryValues="@array/gpu_renderer_values"
app:defaultValue="OpenGL" app:defaultValue="OpenGL"
app:useSimpleSummaryProvider="true" app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
</PreferenceScreen> </PreferenceScreen>