Skip to content

Play your Steam library's Windows games on a jailbroken PS5.

C++

Add PlayStation controller to Game settings

Leonardo Lobato682deafd2d15
diff --git a/README.md b/README.md
index b7cb946..e8204d8 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,8 @@ private Windows environment and its own tile on the PS5 Home screen.
[vkd3d-proton](https://github.com/HansKristian-Work/vkd3d-proton) (kit 0.11 and later), OpenGL through Mesa's Zink, and
Vulkan, all on the PS5 GPU's Vulkan driver.
- **Gamepad support.** XInput, DirectInput, Raw Input, Windows.Gaming.Input and the Windows multimedia joystick API,
- with rumble. Games see the DualSense as an Xbox controller.
+ with rumble. Games see the DualSense as an Xbox controller, or, per game, as a PlayStation controller (a DualShock 4)
+ for games that show PlayStation buttons; that choice needs a runtime kit with it.
- **Local multiplayer.** Each signed-in PS5 user's DualSense is its own controller, up to four, for games with local
co-op or split screen, through XInput and the HID gamepad APIs (a runtime kit newer than 0.18). Player 2 must sign in to the PS5 as another user (or a guest) with their own DualSense.
- **Mouse and keyboard.** Plug a USB mouse and keyboard into the PS5, or use a controller preset: the left stick as a
diff --git a/dependencies.lock.json b/dependencies.lock.json
index 86cd3cc..aed6449 100644
--- a/dependencies.lock.json
+++ b/dependencies.lock.json
@@ -177,7 +177,7 @@
}
},
"prospero_win": {
- "revision": "94222f86a7fed28ab6c901847ef1002cdf2412e2",
+ "revision": "3f1da268d5188852836ae2275643fa17efc4f533",
"url": "https://github.com/leolobato/prospero-win.git",
"default_source": "third_party/prospero-win",
"published": false,
@@ -185,7 +185,7 @@
"retained_runtime_artifact_revision": "bceed2d-kit-h-r1",
"upstream_url": "https://github.com/mpereiraesaa/prospero-win.git",
"branch": "main",
- "note": "Rebased onto upstream b510eb3 on 2026-10-08. Any-title shell on fixed kit B (25a967d). Firmware 13.60 uses the authorized no-drop fallback; games retain root recovery. Runtime remains bea2be5. Same tree as kit C's shell revision 850e62c (history squashed; the old commits are on backup/playden-ps5-850e62c). 33130a9 adds publication metadata schema 3 (game_root.unowned) for game folders on exFAT drives. a9ce0d0 pins the packager to the kit D runtime built from 8ff88bf (rebased forks, direct-memory heap). Kits G to 0.13: see this file's git history. 053bdbf (2026-10-28): rebased onto upstream 404cac6 (33 upstream commits: thread and fiber stacks commit as on Windows (0604), Unix heap headroom (#470), protected-page faults (0974), parked directory descriptors (0871), single-program titles, the in-game menu ([display] menu), frame generation ([display] framegen), the PS5 keyboard on a two-finger click, touchpad Back/Guide halves, L2/R2 vibration, compatible vibration mode, the 3 s close hold, [input] player2, TLS roots 2026-10-20); 10 fork commits dropped as upstreamed; the old tip is on backup/rebase-pre-upstream-2026-10-28. 053bdbf adds [input] rumble = 0-100 (kit capability input-rumble); 54d6889 and 4b38aa5 fix two host tests on Linux (the RADV adapter syntax check and make sanitize). 3e306b5 pins the packager to the kit 0.14 runtime built from 053bdbf. 4f6d38e adds Wine patch 0986 (hot accesses beside an inaccessible page keep their host page whole instead of being single-stepped; Unity's Mono games such as Darkwood ran at 5 fps on 0.14) and 2ffeb6c its test. 28ed795 pins the packager to the kit 0.15 runtime built from 4f6d38e. cbda37d adds Wine patch 0987 (hot writes beside a code page are not reported) and d711a65 its test. 0920845 adds Wine patch 0988 (kernel writes beside a protected page), 4d0d97d 0989 (that report only with PW_SUBPAGE_REPORT=1), 7c6e272 tests. 1bd9163 pins the packager to the kit 0.16 runtime built from 4d0d97d. 3926b27 adds Wine patch 0993 (read-only file descriptors past a budget are parked and opened again by name: a title can hold only about 256 files from open() at once). 8604b97 pins the packager to the kit 0.17 runtime built from 3926b27. 46a3203 moves the Mesa WGL/Zink recipe to PS5_Mesa 4778ff0 (a context destroyed before its end-of-frame flush no longer keeps its swapchain; only libgallium_wgl.dll and opengl32.dll change); kit 0.17 and its runtime are unchanged until a kit is built from it. 44ccf5a to 2b53efa add the exec chain and launcher mode: Wine patches 0994-0997, the profile's [launcher] section (kit capability launcher-mode), the touchpad preset swap, OpenAL Soft from win/openal-soft, and a chained program's own architecture and graphics. 008d3f7 pins the packager to the kit 0.18 runtime built from 2b53efa. d610e32 (Wine 0998) reports video memory above 4 GiB correctly, 24fdf79 adds the driver frame rate counter ([display] fps_counter), c290606 finds the title's sandbox, ba1455c adds the WAV, MP3 and ID3 parsers (Wine 0999), and e7582e9 releases a failed media graph once (Wine 0485). 0036091 pins the packager to the rebuilt kit 0.18. f33828e and a20e7dc take upstream 957d987 and 0e7b6b4 (Wine 0471, the other signed-in users' DualSenses as XInput controllers 1 to 3); 0d5a98d keeps the fork's rumble scaling, launcher presets and device-change notice on them, and 94222f8 adds Wine 0966 (those controllers as HID gamepads while connected, listed after controller 0, asked for when a program opens a HID device, waited for at a hosted start)."
+ "note": "Rebased onto upstream b510eb3 on 2026-10-08. Any-title shell on fixed kit B (25a967d). Firmware 13.60 uses the authorized no-drop fallback; games retain root recovery. Runtime remains bea2be5. Same tree as kit C's shell revision 850e62c (history squashed; the old commits are on backup/playden-ps5-850e62c). 33130a9 adds publication metadata schema 3 (game_root.unowned) for game folders on exFAT drives. a9ce0d0 pins the packager to the kit D runtime built from 8ff88bf (rebased forks, direct-memory heap). Kits G to 0.13: see this file's git history. 053bdbf (2026-10-28): rebased onto upstream 404cac6 (33 upstream commits: thread and fiber stacks commit as on Windows (0604), Unix heap headroom (#470), protected-page faults (0974), parked directory descriptors (0871), single-program titles, the in-game menu ([display] menu), frame generation ([display] framegen), the PS5 keyboard on a two-finger click, touchpad Back/Guide halves, L2/R2 vibration, compatible vibration mode, the 3 s close hold, [input] player2, TLS roots 2026-10-20); 10 fork commits dropped as upstreamed; the old tip is on backup/rebase-pre-upstream-2026-10-28. 053bdbf adds [input] rumble = 0-100 (kit capability input-rumble); 54d6889 and 4b38aa5 fix two host tests on Linux (the RADV adapter syntax check and make sanitize). 3e306b5 pins the packager to the kit 0.14 runtime built from 053bdbf. 4f6d38e adds Wine patch 0986 (hot accesses beside an inaccessible page keep their host page whole instead of being single-stepped; Unity's Mono games such as Darkwood ran at 5 fps on 0.14) and 2ffeb6c its test. 28ed795 pins the packager to the kit 0.15 runtime built from 4f6d38e. cbda37d adds Wine patch 0987 (hot writes beside a code page are not reported) and d711a65 its test. 0920845 adds Wine patch 0988 (kernel writes beside a protected page), 4d0d97d 0989 (that report only with PW_SUBPAGE_REPORT=1), 7c6e272 tests. 1bd9163 pins the packager to the kit 0.16 runtime built from 4d0d97d. 3926b27 adds Wine patch 0993 (read-only file descriptors past a budget are parked and opened again by name: a title can hold only about 256 files from open() at once). 8604b97 pins the packager to the kit 0.17 runtime built from 3926b27. 46a3203 moves the Mesa WGL/Zink recipe to PS5_Mesa 4778ff0 (a context destroyed before its end-of-frame flush no longer keeps its swapchain; only libgallium_wgl.dll and opengl32.dll change); kit 0.17 and its runtime are unchanged until a kit is built from it. 44ccf5a to 2b53efa add the exec chain and launcher mode: Wine patches 0994-0997, the profile's [launcher] section (kit capability launcher-mode), the touchpad preset swap, OpenAL Soft from win/openal-soft, and a chained program's own architecture and graphics. 008d3f7 pins the packager to the kit 0.18 runtime built from 2b53efa. d610e32 (Wine 0998) reports video memory above 4 GiB correctly, 24fdf79 adds the driver frame rate counter ([display] fps_counter), c290606 finds the title's sandbox, ba1455c adds the WAV, MP3 and ID3 parsers (Wine 0999), and e7582e9 releases a failed media graph once (Wine 0485). 0036091 pins the packager to the rebuilt kit 0.18. f33828e and a20e7dc take upstream 957d987 and 0e7b6b4 (Wine 0471, the other signed-in users' DualSenses as XInput controllers 1 to 3); 0d5a98d keeps the fork's rumble scaling, launcher presets and device-change notice on them, and 94222f8 adds Wine 0966 (those controllers as HID gamepads while connected, listed after controller 0, asked for when a program opens a HID device, waited for at a hosted start). c650ce5 adds Wine 0990-0992 and 3f1da26 the title's [input] mode = playstation (kit capability input-playstation): each controller as a DualShock 4 on the HID bus, and no XInput controllers."
},
"prospero_bottle_preparation": {
"hl2-fresh-v16": {
diff --git a/src/homebrew/runtime_host.cpp b/src/homebrew/runtime_host.cpp
index 37903a9..41859a3 100644
--- a/src/homebrew/runtime_host.cpp
+++ b/src/homebrew/runtime_host.cpp
@@ -1539,7 +1539,7 @@ rt::KitCapabilities RuntimeHost::TitleKit(const Composition& c, const rt::Runtim
const auto kit = rt::KitCapabilitiesFromManifest(c.kit->capabilities, true);
// The title's markers are read only when the kit has something an older runtime would refuse.
return kit.display_120hz || kit.profile_version_2 || kit.input_rumble || kit.display_framegen || kit.display_fps_counter ||
- kit.launcher_mode
+ kit.launcher_mode || kit.input_playstation
? rt::KitForTitleRuntime(kit, TitleRuntimeCurrent(c, record))
: kit;
}
diff --git a/src/runtime/game_settings.cpp b/src/runtime/game_settings.cpp
index f7c365f..33fb4f2 100644
--- a/src/runtime/game_settings.cpp
+++ b/src/runtime/game_settings.cpp
@@ -146,6 +146,8 @@ std::vector<SettingDefinition> BuildCatalogue() {
// Controls.
list.push_back(Choice("controller", "Controller", "How the game sees your DualSense.", "[input] mode", G::kControls,
{{"xinput", "Xbox controller", "For games with controller support."},
+ {"playstation", "PlayStation controller",
+ "For games that show PlayStation buttons. Games that only read Xbox controllers see none."},
{"keyboard", "Keyboard and mouse mapping", "Buttons send keys and mouse clicks."}},
"xinput"));
list.push_back(Choice("controller_preset", "Controller preset", "Ready-made button layout for this kind of game.",
@@ -544,7 +546,10 @@ std::string Unavailable(const SettingDefinition& definition, const std::string&
if (id == "stick_deadzone" || id == "rumble" || id == "trigger_deadzone") {
if (!kit.input_tuning && id != "rumble") return "Needs a prospero-win update with controller tuning.";
const auto controller = values.find("controller");
- if (controller == values.end() || controller->second.value != "xinput") return "Only with the Xbox controller.";
+ const std::string mode = controller == values.end() ? std::string() : controller->second.value;
+ // The title scales the game's rumble the same way for both controllers; the dead zones are XInput's.
+ if (id == "rumble" && mode != "xinput" && mode != "playstation") return "Only with a controller.";
+ if (id != "rumble" && mode != "xinput") return "Only with the Xbox controller.";
}
// Rows whose runtime or Playden side is not built yet: listed so players see what is coming.
if (id == "invert_stick") return "Needs a prospero-win update that inverts sticks.";
@@ -654,6 +659,10 @@ bool IsUnlockKey(std::string_view key) {
}
std::string SettingChoiceUnavailable(const EffectiveSettings& settings, std::string_view id, std::string_view value) {
+ if (id == "controller") {
+ if (value != "playstation" || settings.input_playstation || settings.input_playstation_needs_update) return {};
+ return "Needs a runtime kit with the PlayStation controller.";
+ }
if (id != "frame_limit" || value == "off") return {};
const bool high = value == "120" || value == "40";
if (!settings.display_120hz && !settings.display_120hz_needs_update) {
@@ -672,6 +681,7 @@ std::string SettingChoiceUnavailable(const EffectiveSettings& settings, std::str
}
bool SettingChoiceWaitsForUpdate(const EffectiveSettings& settings, std::string_view id, std::string_view value) {
+ if (id == "controller") return value == "playstation" && settings.input_playstation_needs_update;
if (id != "frame_limit" || value == "off" || !settings.display_120hz_needs_update) return false;
// The older runtime's OpenGL has no cap; with DXVK it caps 60 and 30 now, and only the display paces 120 and 40.
return settings.graphics != "dxvk" || value == "120" || value == "40";
@@ -813,6 +823,8 @@ bool BuildEffectiveSettings(const GameRecipe& recipe, const SettingsPreset* pres
out.profile_version = kit.profile_version_2 ? 2 : 1;
out.display_120hz = kit.display_120hz;
out.display_120hz_needs_update = kit.display_120hz_needs_update;
+ out.input_playstation = kit.input_playstation;
+ out.input_playstation_needs_update = kit.input_playstation_needs_update;
// A controller preset (runtime/input/<name>.input) brings its own mode, pointer stick and speed. Rows set less
// deliberately than the preset show the preset's values, so the sheet tells the truth and Pointer speed can be tuned.
@@ -830,6 +842,27 @@ bool BuildEffectiveSettings(const GameRecipe& recipe, const SettingsPreset* pres
}
}
+ // The PlayStation controller needs a kit with it, and a title on that kit's runtime: an older runtime refuses the
+ // profile's mode. Until then the controller preset's mode applies, or the Xbox controller, and a choice that waits
+ // for the update is kept for it. This runs before the rows that depend on the controller (Rumble, the dead zones).
+ {
+ auto& value = out.values["controller"];
+ std::string fallback = FindSetting("controller")->playden_default;
+ // A row the recipe locks takes no preset's mode, as above.
+ if (const auto preset = ControllerPresetInputs().find(out.values["controller_preset"].value);
+ preset != ControllerPresetInputs().end() && !(value.locked && !value.unlocked))
+ fallback = preset->second.at("controller");
+ if (auto reason = SettingChoiceUnavailable(out, "controller", value.value); !reason.empty()) {
+ value.value = fallback;
+ value.reason = std::move(reason);
+ } else if (SettingChoiceWaitsForUpdate(out, "controller", value.value)) {
+ value.after_update = value.value;
+ value.value = fallback;
+ value.reason = kAppliesAfterKitUpdate;
+ value.waits_for_update = true;
+ }
+ }
+
// Availability depends on graphics, kit and other values; unavailable rows fall back to
// the Playden default so a hidden setting never takes effect.
for (const auto& definition : SettingsCatalogue()) {
@@ -1124,12 +1157,14 @@ bool RenderProsperoProfile(const GameRecipe& recipe, const EffectiveSettings& se
text += "\n[input]\n";
if (value("controller_preset") != "none") text += "preset = " + value("controller_preset") + "\n";
// A controller preset brings its own mode, pointer stick and speed. A row overrides them only when it was
- // set at least as deliberately as the preset (player over settings preset over recipe over Playden).
+ // set at least as deliberately as the preset (player over settings preset over recipe over Playden), or when
+ // the recipe locks it: BuildEffectiveSettings keeps a locked row over the preset's value too.
const bool preset = value("controller_preset") != "none";
const auto preset_source = settings.values.at("controller_preset").source;
const auto chosen = [&](const char* id) {
- const auto source = settings.values.at(id).source;
- return !preset || (source != ValueSource::kPlayden && source >= preset_source);
+ const auto& row = settings.values.at(id);
+ return !preset || (row.locked && !row.unlocked) ||
+ (row.source != ValueSource::kPlayden && row.source >= preset_source);
};
if (chosen("controller")) text += "mode = " + value("controller") + "\n";
if (chosen("pointer_stick")) text += "mouse = " + value("pointer_stick") + "\n";
@@ -1268,6 +1303,7 @@ bool RenderProsperoProfile(const GameRecipe& recipe, const EffectiveSettings& se
features.display_frame_rate = frame_rate;
features.display_framegen = display_framegen;
features.display_fps_counter = fps_counter;
+ features.input_playstation = value("controller") == "playstation";
features.runtime_version = settings.profile_version == 2;
features.launcher_section = launcher_section;
if (!CheckProsperoProfile(text, &why, features)) return fail("generated profile is invalid: " + why);
@@ -3168,9 +3204,9 @@ namespace playden::runtime {
const std::vector<std::string>& SettingsKitCapabilityNames() {
// Sorted, as a kit manifest lists them.
static const std::vector<std::string> names = {kKitDisplay120Hz, kKitDisplayFpsCounter, kKitDisplayFramegen,
- kKitInputRumble, kKitLauncherMode, kKitAudioVolume,
- kKitDxvkConfig, kKitDxvkPresent, kKitInputTuning,
- kKitInputWheel, kKitEnvironment};
+ kKitInputPlaystation, kKitInputRumble, kKitLauncherMode,
+ kKitAudioVolume, kKitDxvkConfig, kKitDxvkPresent,
+ kKitInputTuning, kKitInputWheel, kKitEnvironment};
return names;
}
@@ -3200,6 +3236,7 @@ KitCapabilities KitCapabilitiesFromManifest(const std::vector<std::string>& capa
kit.display_framegen = has(kKitDisplayFramegen);
kit.display_fps_counter = has(kKitDisplayFpsCounter);
kit.launcher_mode = has(kKitLauncherMode);
+ kit.input_playstation = has(kKitInputPlaystation);
kit.registry = bottle_access;
return kit;
}
@@ -3229,6 +3266,10 @@ KitCapabilities KitForTitleRuntime(KitCapabilities kit, bool title_runtime_curre
kit.launcher_mode = false;
kit.launcher_mode_needs_update = true;
}
+ if (!title_runtime_current && kit.input_playstation) {
+ kit.input_playstation = false;
+ kit.input_playstation_needs_update = true;
+ }
return kit;
}
@@ -3500,6 +3541,9 @@ bool CommunityPresetSupported(const CommunityPreset& community, const KitCapabil
else if (feature == "display-fps-counter") {
if (!kit.display_fps_counter && !kit.display_fps_counter_needs_update) return false;
}
+ else if (feature == "input-playstation") {
+ if (!kit.input_playstation && !kit.input_playstation_needs_update) return false;
+ }
// Legacy PR references are informational sidecar provenance. Unknown feature
// names or version requirements need verified support before a preset is shown.
else if (feature.size() < 2 || feature.front() != '#' ||
diff --git a/src/runtime/game_settings.h b/src/runtime/game_settings.h
index c499511..6933ed9 100644
--- a/src/runtime/game_settings.h
+++ b/src/runtime/game_settings.h
@@ -83,6 +83,10 @@ struct KitCapabilities {
bool launcher_mode = false; // [launcher]: the game starts through a launcher (kKitLauncherMode)
bool launcher_mode_needs_update = false; // the kit has it, but the game's title still runs an older runtime
bool display_framegen_needs_update = false;
+ // [input] mode = playstation: the game finds the DualSense as a DualShock 4 on its HID bus, and no XInput
+ // controller. Counts only for a title that runs this kit's runtime, like display_120hz.
+ bool input_playstation = false;
+ bool input_playstation_needs_update = false;
};
struct SettingChoice {
@@ -263,6 +267,9 @@ struct EffectiveSettings {
// (KitCapabilities::display_120hz); without it Frame limit is DXVK's maxFrameRate, as before.
bool display_120hz = false;
bool display_120hz_needs_update = false;
+ // The title's runtime takes [input] mode = playstation (KitCapabilities::input_playstation).
+ bool input_playstation = false;
+ bool input_playstation_needs_update = false;
};
// The launch entry id of a program the player chose from the game folder.
@@ -286,8 +293,8 @@ bool BuildEffectiveSettings(const GameRecipe& recipe, const SettingsPreset* pres
const std::map<std::string, std::string>& overrides, const KitCapabilities& kit,
EffectiveSettings* settings, SettingsError* error);
-// Why one choice of a row cannot apply with the other effective values (Frame limit 120 and 40 need 120 Hz output),
-// or empty when it can. BuildEffectiveSettings turns such a saved choice into the Playden default, with this reason.
+// Why one choice of a row cannot apply with the other effective values (Frame limit 120 and 40 need 120 Hz output,
+// Controller PlayStation a kit with input-playstation), or empty when it can. BuildEffectiveSettings turns such a saved choice into the Playden default, with this reason.
// On a title that still runs an older runtime, a choice that needs the kit's (Frame limit 120 with 120 Hz output
// chosen) is not unavailable: it waits for the update (SettingChoiceWaitsForUpdate).
std::string SettingChoiceUnavailable(const EffectiveSettings& settings, std::string_view id, std::string_view value);
@@ -519,8 +526,8 @@ bool ParseCommunityRecipe(std::string_view json, CommunityRecipe* community, std
// Whether the kit's runtime has every newer profile feature the sidecar declares in
// requires.prospero_win: the kit capability names without "settings-" (profile-environment,
-// input-tuning, input-wheel, audio-volume; see prospero-win-profiles SIDECARS.md), and display-120hz, input-rumble and
-// display-framegen, which need the game's own title on such a runtime: pass the kit as KitForTitleRuntime gives it
+// input-tuning, input-wheel, audio-volume; see prospero-win-profiles SIDECARS.md), and display-120hz, input-rumble,
+// display-framegen and input-playstation, which need the game's own title on such a runtime: pass the kit as KitForTitleRuntime gives it
// for the game. Other entries (pull requests, versions) are not checked.
bool CommunityPresetSupported(const CommunityPreset& community, const KitCapabilities& kit);
@@ -574,6 +581,9 @@ inline constexpr const char* kKitDisplayFpsCounter = "display-fps-counter";
// The title reads [launcher]: the exec chain only for a game that asks for it, a second input for the first
// program, and the touchpad hold that swaps them. Runtimes without it refuse a profile with the section.
inline constexpr const char* kKitLauncherMode = "launcher-mode";
+// The title takes [input] mode = playstation: the game's Wine finds the DualSense as a wired DualShock 4 on its HID
+// bus, with the controller's own reports, and XInput reports no controller. Runtimes without it refuse the value.
+inline constexpr const char* kKitInputPlaystation = "input-playstation";
const std::vector<std::string>& SettingsKitCapabilityNames();
// Settings gates from a verified kit's capabilities. bottle_access: the adapter can edit the
@@ -583,8 +593,8 @@ KitCapabilities KitCapabilitiesFromManifest(const std::vector<std::string>& capa
// The installed kit's capabilities for one game's title. A prepared title keeps its own copy of the runtime until
// Update, so a capability that adds profile keys counts only when the title runs this kit's runtime
// (title_runtime_current: the title's owner markers name this kit, PackageInstaller::TitleCurrent). Otherwise
-// display_120hz, profile_version_2, input_rumble, display_framegen and display_fps_counter are off and their
-// _needs_update say why.
+// display_120hz, profile_version_2, input_rumble, display_framegen, display_fps_counter and input_playstation are off
+// and their _needs_update say why.
KitCapabilities KitForTitleRuntime(KitCapabilities kit, bool title_runtime_current);
// Everything one game's settings put on disk for its next launch.
diff --git a/src/runtime/kit_trust.cpp b/src/runtime/kit_trust.cpp
index 47b2116..ca6b7dc 100644
--- a/src/runtime/kit_trust.cpp
+++ b/src/runtime/kit_trust.cpp
@@ -15,7 +15,8 @@ KitAdmissionConfig DevelopmentKitAdmission() {
kKitAudioVolume, kKitDxvkConfig, kKitDxvkPresent, kKitInputTuning,
kKitInputWheel, kKitEnvironment, kKitWineMono, kKitVkd3dProton,
kKitDisplay120Hz, kKitProfileVersion2, kKitInputRumble,
- kKitDisplayFramegen, kKitDisplayFpsCounter, kKitLauncherMode};
+ kKitDisplayFramegen, kKitDisplayFpsCounter, kKitLauncherMode,
+ kKitInputPlaystation};
std::sort(config.known_capabilities.begin(), config.known_capabilities.end());
return config;
}
diff --git a/src/runtime/prospero_profile.cpp b/src/runtime/prospero_profile.cpp
index 25b0d2f..2796ffd 100644
--- a/src/runtime/prospero_profile.cpp
+++ b/src/runtime/prospero_profile.cpp
@@ -342,7 +342,10 @@ bool CheckProsperoProfile(std::string_view text, std::string* reason, ProsperoPr
if (key == "preset") {
if (!IsIdentifier(value)) return bad("not a preset name");
} else if (key == "mode") {
- if (!OneOf(value, {"keyboard", "xinput"})) return bad("not keyboard or xinput");
+ if (features.input_playstation && value == "playstation") {
+ } else if (!OneOf(value, {"keyboard", "xinput"})) {
+ return bad("not keyboard or xinput");
+ }
} else if (key == "mouse") {
if (!OneOf(value, {"none", "left_stick", "right_stick"})) return bad("unknown pointer stick");
} else if (key == "mouse_speed") {
diff --git a/src/runtime/prospero_profile.h b/src/runtime/prospero_profile.h
index cd5dc18..d2a1891 100644
--- a/src/runtime/prospero_profile.h
+++ b/src/runtime/prospero_profile.h
@@ -83,6 +83,7 @@ struct ProsperoProfileFeatures {
bool display_framegen = false; // [display] framegen = off|2|3|4 (kit capability display-framegen)
bool display_fps_counter = false; // [display] fps_counter = true|false (kit capability display-fps-counter)
bool launcher_section = false; // [launcher] (kit launcher-mode)
+ bool input_playstation = false; // [input] mode = playstation (kit capability input-playstation)
bool runtime_version = false; // [runtime] version = 1|2 (kit capability profile-version-2)
};
// A [debug] env variable the runtime takes: PW_, DXVK_, MESA_, GALLIUM_, ZINK_, RADV_ or VK_ names, without the ones
diff --git a/tests/game_settings_test.cpp b/tests/game_settings_test.cpp
index 10c77cd..df59f6a 100644
--- a/tests/game_settings_test.cpp
+++ b/tests/game_settings_test.cpp
@@ -920,7 +920,7 @@ int main(int argc, char** argv) {
CHECK(RenderProsperoProfile(hl2, settings, target, &profile, &reason));
CHECK(profile.text.find("stick_deadzone") == std::string::npos && profile.text.find("rumble") == std::string::npos);
CHECK(BuildEffectiveSettings(hl2, nullptr, {{"controller", "keyboard"}, {"rumble", "0"}}, tuning_kit, &settings, &error));
- CHECK(!settings.values.at("rumble").available && settings.values.at("rumble").reason == "Only with the Xbox controller.");
+ CHECK(!settings.values.at("rumble").available && settings.values.at("rumble").reason == "Only with a controller.");
CHECK(!ValidateSettingValue(hl2, "stick_deadzone", "60", &reason) && ValidateSettingValue(hl2, "rumble", "25", &reason));
// A kit with rumble alone (input-rumble) applies Rumble but not the dead zones, once the title runs its runtime.
{
@@ -946,7 +946,100 @@ int main(int argc, char** argv) {
CHECK(RenderProsperoProfile(hl2, settings, target, &profile, &reason));
CHECK(profile.text.find("rumble") == std::string::npos);
CHECK(BuildEffectiveSettings(hl2, nullptr, {{"controller", "keyboard"}, {"rumble", "0"}}, rumble_kit, &settings, &error));
- CHECK(settings.values.at("rumble").reason == "Only with the Xbox controller.");
+ CHECK(settings.values.at("rumble").reason == "Only with a controller.");
+ }
+ // The PlayStation controller (input-playstation): offered with the capability, waiting for the title's update on an
+ // older runtime, and Xbox controller (no new mode in the profile) until it counts. Rumble applies to it; the dead
+ // zones stay the Xbox controller's.
+ {
+ const auto playstation_kit = KitCapabilitiesFromManifest({kKitInputPlaystation, kKitInputRumble, kKitInputTuning}, false);
+ CHECK(playstation_kit.input_playstation && !KitCapabilitiesFromManifest({kKitInputRumble}, false).input_playstation);
+ CHECK(FindSetting("controller")->choices.size() == 3 && FindSetting("controller")->choices[1].value == "playstation");
+ CHECK(FindSetting("controller")->choices[1].label == "PlayStation controller");
+ CHECK(ValidateSettingValue(hl2, "controller", "playstation", &reason));
+ const std::map<std::string, std::string> chosen = {
+ {"controller", "playstation"}, {"rumble", "50"}, {"stick_deadzone", "10"}};
+ CHECK(BuildEffectiveSettings(hl2, nullptr, chosen, playstation_kit, &settings, &error));
+ CHECK(Value(settings, "controller") == "playstation" && settings.values.at("controller").available);
+ CHECK(SettingChoiceUnavailable(settings, "controller", "playstation").empty());
+ CHECK(!SettingChoiceWaitsForUpdate(settings, "controller", "playstation"));
+ CHECK(settings.values.at("rumble").available);
+ CHECK(!settings.values.at("stick_deadzone").available &&
+ settings.values.at("stick_deadzone").reason == "Only with the Xbox controller.");
+ CHECK(RenderProsperoProfile(hl2, settings, target, &profile, &reason));
+ CHECK(profile.text.find("\nmode = playstation\n") != std::string::npos);
+ CHECK(profile.text.find("\nrumble = 50\n") != std::string::npos && profile.text.find("stick_deadzone") == std::string::npos);
+ CHECK(!CheckProsperoProfile(profile.text, &reason, {.input_tuning = true})); // an older runtime refuses the mode
+ CHECK(CheckProsperoProfile(profile.text, &reason, {.input_tuning = true, .input_playstation = true}));
+ // Without the capability the choice is unavailable: the Xbox controller applies, the record keeps the choice.
+ const auto rumble_kit = KitCapabilitiesFromManifest({kKitInputRumble}, false);
+ CHECK(BuildEffectiveSettings(hl2, nullptr, chosen, rumble_kit, &settings, &error));
+ CHECK(Value(settings, "controller") == "xinput");
+ CHECK(settings.values.at("controller").reason == "Needs a runtime kit with the PlayStation controller.");
+ CHECK(SettingChoiceUnavailable(settings, "controller", "playstation") ==
+ "Needs a runtime kit with the PlayStation controller.");
+ CHECK(SettingChoiceUnavailable(settings, "controller", "xinput").empty() &&
+ SettingChoiceUnavailable(settings, "controller", "keyboard").empty());
+ CHECK(settings.values.at("rumble").available);
+ CHECK(RenderProsperoProfile(hl2, settings, target, &profile, &reason));
+ CHECK(profile.text.find("\nmode = xinput\n") != std::string::npos);
+ CHECK(CheckProsperoProfile(profile.text, &reason, {.input_rumble = true}));
+ // With controller tuning, the dead zones follow the Xbox controller that applies.
+ const auto tuning_only = KitCapabilitiesFromManifest({kKitInputTuning}, false);
+ CHECK(BuildEffectiveSettings(hl2, nullptr, chosen, tuning_only, &settings, &error));
+ CHECK(Value(settings, "controller") == "xinput" && settings.values.at("stick_deadzone").available);
+ // A title on an older runtime keeps the choice for its update; until then it is the Xbox controller.
+ const auto stale = KitForTitleRuntime(playstation_kit, false);
+ CHECK(!stale.input_playstation && stale.input_playstation_needs_update);
+ CHECK(KitForTitleRuntime(playstation_kit, true).input_playstation);
+ CHECK(!KitForTitleRuntime(KitCapabilities{}, false).input_playstation_needs_update);
+ CHECK(BuildEffectiveSettings(hl2, nullptr, {{"controller", "playstation"}}, stale, &settings, &error));
+ const auto& waiting = settings.values.at("controller");
+ CHECK(waiting.value == "xinput" && waiting.waits_for_update && waiting.after_update == "playstation");
+ CHECK(waiting.reason == kAppliesAfterKitUpdate && ChosenValue(waiting) == "playstation");
+ CHECK(SettingChoiceUnavailable(settings, "controller", "playstation").empty());
+ CHECK(SettingChoiceWaitsForUpdate(settings, "controller", "playstation"));
+ CHECK(!SettingChoiceWaitsForUpdate(settings, "controller", "keyboard"));
+ CHECK(RenderProsperoProfile(hl2, settings, target, &profile, &reason));
+ CHECK(profile.text.find("\nmode = xinput\n") != std::string::npos && profile.text.find("playstation") == std::string::npos);
+ CHECK(CheckProsperoProfile(profile.text, &reason));
+ // A controller preset's mode gives way to a player's PlayStation choice.
+ CHECK(BuildEffectiveSettings(hl2, nullptr, {{"controller_preset", "gamepad"}, {"controller", "playstation"}},
+ playstation_kit, &settings, &error));
+ CHECK(RenderProsperoProfile(hl2, settings, target, &profile, &reason));
+ CHECK(profile.text.find("\npreset = gamepad\nmode = playstation\n") != std::string::npos);
+ // And a keyboard preset's: its keys still apply, the DualSense is also the DualShock 4.
+ CHECK(BuildEffectiveSettings(hl2, nullptr, {{"controller_preset", "arrows"}, {"controller", "playstation"}},
+ playstation_kit, &settings, &error));
+ CHECK(RenderProsperoProfile(hl2, settings, target, &profile, &reason));
+ CHECK(profile.text.find("\npreset = arrows\nmode = playstation\n") != std::string::npos);
+ CHECK(CheckProsperoProfile(profile.text, &reason, {.input_playstation = true}));
+ // A recipe that locks the controller keeps it over a player's preset, in the sheet and in the profile.
+ {
+ GameRecipe locked = hl2;
+ locked.defaults["controller"] = "playstation";
+ locked.locked.insert("controller");
+ CHECK(BuildEffectiveSettings(locked, nullptr, {{"controller_preset", "arrows"}}, playstation_kit, &settings, &error));
+ CHECK(Value(settings, "controller") == "playstation" && settings.values.at("controller").locked);
+ CHECK(settings.values.at("rumble").available);
+ CHECK(RenderProsperoProfile(locked, settings, target, &profile, &reason));
+ CHECK(profile.text.find("\npreset = arrows\nmode = playstation\n") != std::string::npos);
+ // Without the capability the lock still decides: the Xbox controller, not the preset's keyboard mode.
+ CHECK(BuildEffectiveSettings(locked, nullptr, {{"controller_preset", "arrows"}}, rumble_kit, &settings, &error));
+ CHECK(Value(settings, "controller") == "xinput");
+ CHECK(RenderProsperoProfile(locked, settings, target, &profile, &reason));
+ CHECK(profile.text.find("\npreset = arrows\nmode = xinput\n") != std::string::npos);
+ }
+ // Without the capability, or before the title's update, the keyboard preset's own mode applies.
+ for (const auto& kit : {rumble_kit, stale}) {
+ CHECK(BuildEffectiveSettings(hl2, nullptr, {{"controller_preset", "arrows"}, {"controller", "playstation"}},
+ kit, &settings, &error));
+ CHECK(Value(settings, "controller") == "keyboard");
+ CHECK(RenderProsperoProfile(hl2, settings, target, &profile, &reason));
+ CHECK(profile.text.find("playstation") == std::string::npos);
+ CHECK(profile.text.find("\npreset = arrows\n") != std::string::npos &&
+ profile.text.find("mode = xinput") == std::string::npos);
+ }
}
// Frame generation (display-framegen) on DXVK and OpenGL, once the title runs the kit's runtime. Its pictures fill
// every vblank, so it takes over Frame limit and VSync, and the overlay is its own counter.
@@ -1286,6 +1379,12 @@ int main(int argc, char** argv) {
CHECK(CommunityPresetSupported(needs_framegen, framegen) &&
CommunityPresetSupported(needs_framegen, KitForTitleRuntime(framegen, false)));
CHECK(!CommunityPresetSupported(needs_framegen, KitCapabilitiesFromManifest({kKitDxvk}, false)));
+ auto needs_playstation = community;
+ needs_playstation.requires_prospero_win.push_back("input-playstation");
+ const auto playstation = KitCapabilitiesFromManifest({kKitInputPlaystation}, false);
+ CHECK(CommunityPresetSupported(needs_playstation, playstation) &&
+ CommunityPresetSupported(needs_playstation, KitForTitleRuntime(playstation, false)));
+ CHECK(!CommunityPresetSupported(needs_playstation, KitCapabilitiesFromManifest({kKitInputRumble}, false)));
}
CHECK(BuildEffectiveSettings(hl2, &community.preset, {}, KitCapabilities{}, &settings, &error));
CHECK(settings.values.at("controller").value == "keyboard");
diff --git a/tests/prospero_profile_test.cpp b/tests/prospero_profile_test.cpp
index 66c882a..99c12f0 100644
--- a/tests/prospero_profile_test.cpp
+++ b/tests/prospero_profile_test.cpp
@@ -180,6 +180,12 @@ int main(int argc, char** argv) {
CHECK(CheckProsperoProfile(base + "[display]\nframegen = " + factor + "\n", &reason, {.display_framegen = true}));
CHECK(!CheckProsperoProfile(base + "[display]\nframegen = 5\n", &reason, {.display_framegen = true}));
CHECK(CheckProsperoProfile(base + "[display]\nopengl_thread = true\n", &reason));
+ // [input] mode = playstation needs an input-playstation runtime.
+ CHECK(!CheckProsperoProfile(base + "[input]\nmode = playstation\n", &reason));
+ CHECK(CheckProsperoProfile(base + "[input]\nmode = playstation\n", &reason, {.input_playstation = true}));
+ CHECK(CheckProsperoProfile(base + "[input]\nmode = xinput\n", &reason, {.input_playstation = true}));
+ CHECK(CheckProsperoProfile(base + "[input]\nmode = keyboard\n", &reason, {.input_playstation = true}));
+ CHECK(!CheckProsperoProfile(base + "[input]\nmode = dualshock4\n", &reason, {.input_playstation = true}));
CHECK(!CheckProsperoProfile(base + "[input]\nmouse_speed = 0\n", &reason));
CHECK(!CheckProsperoProfile(base + "[input]\nrumble = 50\n", &reason)); // released runtimes refuse it
CHECK(CheckProsperoProfile(base + "[input]\nstick_deadzone = 50\nrumble = 0\n", &reason, {.input_tuning = true}));
diff --git a/third_party/prospero-win b/third_party/prospero-win
index 94222f8..3f1da26 160000
--- a/third_party/prospero-win
+++ b/third_party/prospero-win
@@ -1 +1 @@
-Subproject commit 94222f86a7fed28ab6c901847ef1002cdf2412e2
+Subproject commit 3f1da268d5188852836ae2275643fa17efc4f533