diff --git a/android/app/src/main/java/com/github/stenzek/duckstation/GamePropertiesActivity.java b/android/app/src/main/java/com/github/stenzek/duckstation/GamePropertiesActivity.java index 9736d40b4..7668903a7 100644 --- a/android/app/src/main/java/com/github/stenzek/duckstation/GamePropertiesActivity.java +++ b/android/app/src/main/java/com/github/stenzek/duckstation/GamePropertiesActivity.java @@ -135,6 +135,11 @@ public class GamePropertiesActivity extends AppCompatActivity { activity.createBooleanGameSetting(ps, "GPUPGXP", R.string.settings_pgxp_geometry_correction); activity.createBooleanGameSetting(ps, "PGXPPreserveProjFP", R.string.settings_pgxp_preserve_projection_precision); activity.createBooleanGameSetting(ps, "GPUPGXPDepthBuffer", R.string.settings_pgxp_depth_buffer); + activity.createBooleanGameSetting(ps, "ForceSoftwareRenderer", R.string.settings_use_software_renderer); + activity.createBooleanGameSetting(ps, "ForceSoftwareRendererForReadbacks", R.string.settings_use_software_renderer_for_readbacks); + activity.createBooleanGameSetting(ps, "DisableWidescreen", R.string.settings_disable_widescreen); + activity.createBooleanGameSetting(ps, "ForcePGXPVertexCache", R.string.settings_pgxp_vertex_cache); + activity.createBooleanGameSetting(ps, "ForcePGXPCPUMode", R.string.settings_pgxp_cpu_mode); setPreferenceScreen(ps); } diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 593dd315b..969ab0183 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -348,4 +348,6 @@ Exit Game Use Software Renderer For Readbacks Runs the software renderer in parallel for VRAM readbacks. On some devices, this may result in greater performance when using graphical enhancements with the hardware renderer. + Use Software Renderer + Disable Widescreen diff --git a/src/frontend-common/game_settings.cpp b/src/frontend-common/game_settings.cpp index c377b6e40..fb6149cdc 100644 --- a/src/frontend-common/game_settings.cpp +++ b/src/frontend-common/game_settings.cpp @@ -728,6 +728,26 @@ static std::optional GetEntryValueForKey(const Entry& entry, const else return entry.input_profile_name; } + else if (key == "ForceSoftwareRenderer") + { + return entry.HasTrait(Trait::ForceSoftwareRenderer) ? "true" : "false"; + } + else if (key == "ForceSoftwareRendererForReadbacks") + { + return entry.HasTrait(Trait::ForceSoftwareRendererForReadbacks) ? "true" : "false"; + } + else if (key == "DisableWidescreen") + { + return entry.HasTrait(Trait::DisableWidescreen) ? "true" : "false"; + } + else if (key == "ForcePGXPVertexCache") + { + return entry.HasTrait(Trait::ForcePGXPVertexCache) ? "true" : "false"; + } + else if (key == "ForcePGXPCPUMode") + { + return entry.HasTrait(Trait::ForcePGXPCPUMode) ? "true" : "false"; + } else { Log_ErrorPrintf("Unknown key: %s", std::string(key).c_str()); @@ -980,6 +1000,41 @@ static void SetEntryValueForKey(Entry& entry, const std::string_view& key, const else entry.input_profile_name = value.value(); } + else if (key == "ForceSoftwareRenderer") + { + if (!value.has_value() || !StringUtil::FromChars(value.value()).value_or(false)) + entry.RemoveTrait(Trait::ForceSoftwareRenderer); + else + entry.AddTrait(Trait::ForceSoftwareRenderer); + } + else if (key == "ForceSoftwareRendererForReadbacks") + { + if (!value.has_value() || !StringUtil::FromChars(value.value()).value_or(false)) + entry.RemoveTrait(Trait::ForceSoftwareRendererForReadbacks); + else + entry.AddTrait(Trait::ForceSoftwareRendererForReadbacks); + } + else if (key == "DisableWidescreen") + { + if (!value.has_value() || !StringUtil::FromChars(value.value()).value_or(false)) + entry.RemoveTrait(Trait::DisableWidescreen); + else + entry.AddTrait(Trait::DisableWidescreen); + } + else if (key == "ForcePGXPVertexCache") + { + if (!value.has_value() || !StringUtil::FromChars(value.value()).value_or(false)) + entry.RemoveTrait(Trait::ForcePGXPVertexCache); + else + entry.AddTrait(Trait::ForcePGXPVertexCache); + } + else if (key == "ForcePGXPCPUMode") + { + if (!value.has_value() || !StringUtil::FromChars(value.value()).value_or(false)) + entry.RemoveTrait(Trait::ForcePGXPCPUMode); + else + entry.AddTrait(Trait::ForcePGXPCPUMode); + } else { Log_ErrorPrintf("Unknown key: %s", std::string(key).c_str());