Android: Split settings into tabs

This commit is contained in:
Connor McLaughlin 2020-10-14 15:39:01 +10:00
parent 2a824751e7
commit e7945b422f
13 changed files with 517 additions and 390 deletions

View file

@ -41,9 +41,10 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.preference:preference:1.1.0-alpha05' implementation 'androidx.preference:preference:1.1.0-alpha05'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.viewpager2:viewpager2:1.0.0"
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0' androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

View file

@ -26,6 +26,7 @@
</activity> </activity>
<activity <activity
android:name=".SettingsActivity" android:name=".SettingsActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_settings" android:label="@string/title_activity_settings"
android:parentActivityName=".MainActivity"> android:parentActivityName=".MainActivity">
<meta-data <meta-data
@ -34,6 +35,7 @@
</activity> </activity>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"> android:theme="@style/AppTheme.NoActionBar">
<intent-filter> <intent-filter>

View file

@ -1,12 +1,22 @@
package com.github.stenzek.duckstation; package com.github.stenzek.duckstation;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceFragmentCompat;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
public class SettingsActivity extends AppCompatActivity { public class SettingsActivity extends AppCompatActivity {
@ -16,7 +26,7 @@ public class SettingsActivity extends AppCompatActivity {
setContentView(R.layout.settings_activity); setContentView(R.layout.settings_activity);
getSupportFragmentManager() getSupportFragmentManager()
.beginTransaction() .beginTransaction()
.replace(R.id.settings, new SettingsFragment()) .replace(R.id.settings, new SettingsCollectionFragment())
.commit(); .commit();
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
if (actionBar != null) { if (actionBar != null) {
@ -35,9 +45,72 @@ public class SettingsActivity extends AppCompatActivity {
} }
public static class SettingsFragment extends PreferenceFragmentCompat { public static class SettingsFragment extends PreferenceFragmentCompat {
private int resourceId;
public SettingsFragment(int resourceId) {
this.resourceId = resourceId;
}
@Override @Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.root_preferences, rootKey); setPreferencesFromResource(resourceId, rootKey);
}
}
public static class SettingsCollectionFragment extends Fragment {
private SettingsCollectionAdapter adapter;
private ViewPager2 viewPager;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_settings_collection, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
adapter = new SettingsCollectionAdapter(this);
viewPager = view.findViewById(R.id.view_pager);
viewPager.setAdapter(adapter);
TabLayout tabLayout = view.findViewById(R.id.tab_layout);
new TabLayoutMediator(tabLayout, viewPager,
(tab, position) -> tab.setText(getResources().getStringArray(R.array.settings_tabs)[position])
).attach();
}
}
public static class SettingsCollectionAdapter extends FragmentStateAdapter {
public SettingsCollectionAdapter(@NonNull Fragment fragment) {
super(fragment);
}
@NonNull
@Override
public Fragment createFragment(int position) {
switch (position) {
case 0: // General
return new SettingsFragment(R.xml.general_preferences);
case 1: // Console
return new SettingsFragment(R.xml.display_preferences);
case 2: // Enhancements
return new SettingsFragment(R.xml.enhancements_preferences);
case 3: // Controllers
return new SettingsFragment(R.xml.controllers_preferences);
case 4: // Advanced
return new SettingsFragment(R.xml.advanced_preferences);
default:
return new Fragment();
}
}
@Override
public int getItemCount() {
return 5;
} }
} }
} }

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabTextAppearance="@style/TabTextAppearance"
app:tabMinWidth="150dp"
app:tabMode="scrollable" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>

View file

@ -224,4 +224,11 @@
<item>Debug</item> <item>Debug</item>
<item>Trace</item> <item>Trace</item>
</string-array> </string-array>
<string-array name="settings_tabs">
<item>General</item>
<item>Display</item>
<item>Enhancements</item>
<item>Controllers</item>
<item>Advanced</item>
</string-array>
</resources> </resources>

View file

@ -11,7 +11,7 @@
<string name="settings_gpu_header">GPU</string> <string name="settings_gpu_header">GPU</string>
<!-- Console Preferences --> <!-- Console Preferences -->
<string name="settings_console_region">Region</string> <string name="settings_console_region">Console Region</string>
<string name="settings_console_region_default">Auto</string> <string name="settings_console_region_default">Auto</string>
<string name="settings_console_bios_path">BIOS Path</string> <string name="settings_console_bios_path">BIOS Path</string>
<string name="settings_console_tty_output">Enable TTY Output</string> <string name="settings_console_tty_output">Enable TTY Output</string>

View file

@ -29,4 +29,9 @@
<item name="android:background">@color/black_overlay</item> <item name="android:background">@color/black_overlay</item>
</style> </style>
<style name="TabTextAppearance" parent="TextAppearance.Design.Tab">
<item name="textAllCaps">false</item>
<item name="android:textAllCaps">false</item>
</style>
</resources> </resources>

View file

@ -0,0 +1,69 @@
<!--
~ Copyright 2018 The app Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<SwitchPreferenceCompat
app:key="CDROM/RegionCheck"
app:title="CD-ROM Region Check"
app:defaultValue="false"
app:summary="Prevents discs from incorrect regions being read by the emulator. Usually safe to disable."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPVertexCache"
app:title="PGXP Vertex Cache"
app:defaultValue="false"
app:summary="Uses screen coordinates as a fallback when tracking vertices through memory fails. May improve PGXP compatibility."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPCPU"
app:title="PGXP CPU Mode"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="CPU/RecompilerICache"
app:title="CPU Recompiler ICache"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="BIOS/PatchTTYEnable"
app:title="@string/settings_console_tty_output"
app:defaultValue="false"
app:iconSpaceReserved="false" />
<ListPreference
app:key="Logging/LogLevel"
app:title="Logging Level"
app:defaultValue="Warning"
app:entries="@array/settings_log_level_entries"
app:entryValues="@array/settings_log_level_values"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Logging/LogToFile"
app:title="Log To File"
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:iconSpaceReserved="false"/>
<SwitchPreferenceCompat
app:key="Logging/LogToDebug"
app:title="Log To Logcat"
app:defaultValue="false"
app:summary="Writes log messages to the Android message logger. Only useful when attached to a computer with adb."
app:iconSpaceReserved="false" />
</PreferenceScreen>

View file

@ -0,0 +1,65 @@
<!--
~ Copyright 2018 The app Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
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
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>

View file

@ -0,0 +1,52 @@
<!--
~ Copyright 2018 The app Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference
app:key="Display/CropMode"
app:title="Crop Mode"
app:entries="@array/settings_display_crop_mode_entries"
app:entryValues="@array/settings_display_crop_mode_values"
app:defaultValue="Overscan"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="Display/AspectRatio"
app:title="Aspect Ratio"
app:entries="@array/settings_display_aspect_ratio_names"
app:entryValues="@array/settings_display_aspect_ratio_values"
app:defaultValue="4:3"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/LinearFiltering"
app:title="Linear Upscaling"
app:defaultValue="true"
app:summary="Smooths out the image when upscaling the console to the screen."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/IntegerScaling"
app:title="Integer Upscaling"
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:iconSpaceReserved="false" />
</PreferenceScreen>

View file

@ -0,0 +1,121 @@
<!--
~ Copyright 2018 The app Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference
app:key="CDROM/ReadSpeedup"
app:title="CD-ROM Read Speedup"
app:entries="@array/settings_cdrom_read_speedup_entries"
app:entryValues="@array/settings_cdrom_read_speedup_values"
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:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="BIOS/PatchFastBoot"
app:title="@string/settings_console_fast_boot"
app:defaultValue="false"
app:summary="Skips the BIOS shell/intro, booting directly into the game. Usually safe to enable, but some games break."
app:iconSpaceReserved="false" />
<ListPreference
app:key="GPU/ResolutionScale"
app:title="@string/settings_gpu_resolution_scale"
app:entries="@array/settings_gpu_resolution_scale_entries"
app:entryValues="@array/settings_gpu_resolution_scale_values"
app:defaultValue="1"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/TrueColor"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/ScaledDithering"
app:title="Scaled Dithering (scale dither pattern to resolution)"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/DisableInterlacing"
app:title="Disable Interlacing (force progressive render/scan)"
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:iconSpaceReserved="false" />
<ListPreference
app:key="GPU/TextureFilter"
app:title="Texture Filtering"
app:entries="@array/settings_gpu_texture_filter_names"
app:entryValues="@array/settings_gpu_texture_filter_values"
app:defaultValue="Nearest"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/ForceNTSCTimings"
app:title="Force NTSC Timings (60hz-on-PAL)"
app:defaultValue="false"
app:summary="Uses NTSC frame timings when the console is in PAL mode, forcing PAL games to run at 60hz."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/WidescreenHack"
app:title="Widescreen Hack"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/Force4_3For24Bit"
app:title="Force 4:3 For 24-Bit Display"
app:defaultValue="false"
app:summary="Switches back to 4:3 display aspect ratio when displaying 24-bit content, usually FMVs."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPEnable"
app:title="PGXP Geometry Correction"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPCulling"
app:title="PGXP Culling Correction"
app:defaultValue="true"
app:summary="Increases the precision of polygon culling, reducing the number of holes in geometry. Requires geometry correction enabled."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPTextureCorrection"
app:title="PGXP Texture Correction"
app:defaultValue="true"
app:summary="Uses perspective-correct interpolation for texture coordinates and colors, straightening out warped textures. Requires geometry correction enabled."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPPreserveProjFP"
app:title="PGXP Preserve Projection Precision"
app:defaultValue="false"
app:summary="Enables additional precision for PGXP. May improve visuals in some games but break others."
app:iconSpaceReserved="false" />
</PreferenceScreen>

View file

@ -0,0 +1,96 @@
<!--
~ Copyright 2018 The app Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<SwitchPreferenceCompat
app:key="Main/SpeedLimiterEnabled"
app:title="@string/settings_behavior_enable_speed_limiter"
app:defaultValue="true"
app:summary="Throttles the emulation speed to the chosen speed above. If unchecked, the emulator will run as fast as possible, which may not be playable."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Main/SaveStateOnExit"
app:title="Save State On Exit"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Main/AutoLoadCheats"
app:title="Load Cheats"
app:defaultValue="false"
app:summary="Loads cheats from cheats/&lt;game name&gt;.cht in PCSXR format. Cheats can be toggled while ingame."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/VSync"
app:title="Video Sync"
app:defaultValue="true"
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" />
<ListPreference
app:key="Console/Region"
app:title="@string/settings_console_region"
app:entries="@array/settings_console_region_entries"
app:entryValues="@array/settings_console_region_values"
app:defaultValue="@string/settings_console_region_default"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="CPU/ExecutionMode"
app:title="@string/settings_cpu_execution_mode"
app:entries="@array/settings_cpu_execution_mode_entries"
app:entryValues="@array/settings_cpu_execution_mode_values"
app:defaultValue="Recompiler"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="GPU/Renderer"
app:title="@string/settings_gpu_renderer"
app:entries="@array/gpu_renderer_entries"
app:entryValues="@array/gpu_renderer_values"
app:defaultValue="OpenGL"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/ShowOSDMessages"
app:title="@string/settings_osd_show_messages"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/ShowSpeed"
app:title="@string/settings_osd_show_speed"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/ShowFPS"
app:title="@string/settings_osd_show_show_fps"
app:defaultValue="false"
app:summary="Shows the internal frame rate of the game in the top-right corner of the display."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/ShowVPS"
app:title="@string/settings_osd_show_show_vps"
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:iconSpaceReserved="false" />
</PreferenceScreen>

View file

@ -1,386 +0,0 @@
<!--
~ Copyright 2018 The app Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory app:title="General" app:iconSpaceReserved="false">
<SwitchPreferenceCompat
app:key="Main/SpeedLimiterEnabled"
app:title="@string/settings_behavior_enable_speed_limiter"
app:defaultValue="true"
app:summary="Throttles the emulation speed to the chosen speed above. If unchecked, the emulator will run as fast as possible, which may not be playable."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Main/SaveStateOnExit"
app:title="Save State On Exit"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Main/AutoLoadCheats"
app:title="Load Cheats"
app:defaultValue="false"
app:summary="Loads cheats from cheats/&lt;game name&gt;.cht in PCSXR format. Cheats can be toggled while ingame."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/VSync"
app:title="Video Sync"
app:defaultValue="true"
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" />
<ListPreference
app:key="CPU/ExecutionMode"
app:title="@string/settings_cpu_execution_mode"
app:entries="@array/settings_cpu_execution_mode_entries"
app:entryValues="@array/settings_cpu_execution_mode_values"
app:defaultValue="Recompiler"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="GPU/Renderer"
app:title="@string/settings_gpu_renderer"
app:entries="@array/gpu_renderer_entries"
app:entryValues="@array/gpu_renderer_values"
app:defaultValue="OpenGL"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/settings_osd_header" app:iconSpaceReserved="false">
<SwitchPreferenceCompat
app:key="Display/ShowOSDMessages"
app:title="@string/settings_osd_show_messages"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/ShowSpeed"
app:title="@string/settings_osd_show_speed"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/ShowFPS"
app:title="@string/settings_osd_show_show_fps"
app:defaultValue="false"
app:summary="Shows the internal frame rate of the game in the top-right corner of the display."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/ShowVPS"
app:title="@string/settings_osd_show_show_vps"
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:iconSpaceReserved="false" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/settings_console_header" app:iconSpaceReserved="false">
<ListPreference
app:key="Console/Region"
app:title="@string/settings_console_region"
app:entries="@array/settings_console_region_entries"
app:entryValues="@array/settings_console_region_values"
app:defaultValue="@string/settings_console_region_default"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="CDROM/RegionCheck"
app:title="CD-ROM Region Check"
app:defaultValue="false"
app:summary="Prevents discs from incorrect regions being read by the emulator. Usually safe to disable."
app:iconSpaceReserved="false" />
<ListPreference
app:key="CDROM/ReadSpeedup"
app:title="CD-ROM Read Speedup"
app:entries="@array/settings_cdrom_read_speedup_entries"
app:entryValues="@array/settings_cdrom_read_speedup_values"
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:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="BIOS/PatchFastBoot"
app:title="@string/settings_console_fast_boot"
app:defaultValue="false"
app:summary="Skips the BIOS shell/intro, booting directly into the game. Usually safe to enable, but some games break."
app:iconSpaceReserved="false" />
</PreferenceCategory>
<PreferenceCategory app:title="Enhancements" app:iconSpaceReserved="false">
<ListPreference
app:key="GPU/ResolutionScale"
app:title="@string/settings_gpu_resolution_scale"
app:entries="@array/settings_gpu_resolution_scale_entries"
app:entryValues="@array/settings_gpu_resolution_scale_values"
app:defaultValue="1"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/TrueColor"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/ScaledDithering"
app:title="Scaled Dithering (scale dither pattern to resolution)"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/DisableInterlacing"
app:title="Disable Interlacing (force progressive render/scan)"
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:iconSpaceReserved="false" />
<ListPreference
app:key="GPU/TextureFilter"
app:title="Texture Filtering"
app:entries="@array/settings_gpu_texture_filter_names"
app:entryValues="@array/settings_gpu_texture_filter_values"
app:defaultValue="Nearest"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/ForceNTSCTimings"
app:title="Force NTSC Timings (60hz-on-PAL)"
app:defaultValue="false"
app:summary="Uses NTSC frame timings when the console is in PAL mode, forcing PAL games to run at 60hz."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/WidescreenHack"
app:title="Widescreen Hack"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/Force4_3For24Bit"
app:title="Force 4:3 For 24-Bit Display"
app:defaultValue="false"
app:summary="Switches back to 4:3 display aspect ratio when displaying 24-bit content, usually FMVs."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPEnable"
app:title="PGXP Geometry Correction"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPCulling"
app:title="PGXP Culling Correction"
app:defaultValue="true"
app:summary="Increases the precision of polygon culling, reducing the number of holes in geometry. Requires geometry correction enabled."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPTextureCorrection"
app:title="PGXP Texture Correction"
app:defaultValue="true"
app:summary="Uses perspective-correct interpolation for texture coordinates and colors, straightening out warped textures. Requires geometry correction enabled."
app:iconSpaceReserved="false" />
</PreferenceCategory>
<PreferenceCategory app:title="Display" app:iconSpaceReserved="false">
<ListPreference
app:key="Display/CropMode"
app:title="Crop Mode"
app:entries="@array/settings_display_crop_mode_entries"
app:entryValues="@array/settings_display_crop_mode_values"
app:defaultValue="Overscan"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="Display/AspectRatio"
app:title="Aspect Ratio"
app:entries="@array/settings_display_aspect_ratio_names"
app:entryValues="@array/settings_display_aspect_ratio_values"
app:defaultValue="4:3"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/LinearFiltering"
app:title="Linear Upscaling"
app:defaultValue="true"
app:summary="Smooths out the image when upscaling the console to the screen."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Display/IntegerScaling"
app:title="Integer Upscaling"
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:iconSpaceReserved="false" />
</PreferenceCategory>
<PreferenceCategory app:title="Controller" app:iconSpaceReserved="false">
<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"/>
</PreferenceCategory>
<PreferenceCategory app:title="Memory Cards" 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" />
</PreferenceCategory>
<PreferenceCategory app:title="Audio Settings" app:iconSpaceReserved="false">
<SwitchPreferenceCompat
app:key="Audio/OutputMuted"
app:title="Mute All Sound"
app:defaultValue="false"
app:summary="Prevents the emulator from emitting any sound."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="CDROM/MuteCDAudio"
app:title="Mute CD Audio"
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:iconSpaceReserved="false" />
<ListPreference
app:key="Audio/Backend"
app:title="Audio Backend"
app:entries="@array/settings_audio_backend_entries"
app:entryValues="@array/settings_audio_backend_values"
app:defaultValue="OpenSLES"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false"/>
<ListPreference
app:key="Audio/BufferSize"
app:title="Audio Buffer Size"
app:entries="@array/settings_audio_buffer_size_entries"
app:entryValues="@array/settings_audio_buffer_size_values"
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:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Audio/Sync"
app:title="Audio Sync"
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:iconSpaceReserved="false" />
</PreferenceCategory>
<PreferenceCategory app:title="Advanced Settings" app:iconSpaceReserved="false">
<SwitchPreferenceCompat
app:key="GPU/PGXPVertexCache"
app:title="PGXP Vertex Cache"
app:defaultValue="false"
app:summary="Uses screen coordinates as a fallback when tracking vertices through memory fails. May improve PGXP compatibility."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPCPU"
app:title="PGXP CPU Mode"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/PGXPPreserveProjFP"
app:title="PGXP Preserve Projection Precision"
app:defaultValue="false"
app:summary="Enables additional precision for PGXP. May improve visuals in some games but break others."
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="CPU/RecompilerICache"
app:title="CPU Recompiler ICache"
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:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="BIOS/PatchTTYEnable"
app:title="@string/settings_console_tty_output"
app:defaultValue="false"
app:iconSpaceReserved="false" />
<ListPreference
app:key="Logging/LogLevel"
app:title="Logging Level"
app:defaultValue="Warning"
app:entries="@array/settings_log_level_entries"
app:entryValues="@array/settings_log_level_values"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Logging/LogToFile"
app:title="Log To File"
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:iconSpaceReserved="false"/>
<SwitchPreferenceCompat
app:key="Logging/LogToDebug"
app:title="Log To Logcat"
app:defaultValue="false"
app:summary="Writes log messages to the Android message logger. Only useful when attached to a computer with adb."
app:iconSpaceReserved="false" />
</PreferenceCategory>
</PreferenceScreen>