Skip to content

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

C++

Prefer 64-bit Windows depots during selection

earthonion28ee689ac86c
diff --git a/src/steam/backend/app_info.cpp b/src/steam/backend/app_info.cpp
index 59a96e9..1b0988c 100644
--- a/src/steam/backend/app_info.cpp
+++ b/src/steam/backend/app_info.cpp
@@ -414,9 +414,17 @@ bool SelectDepots(const AppInfo& app, const std::set<std::uint32_t>& owned_apps,
if (eligible.empty()) {
return Fail(reason, "This game has no downloadable Windows content for English.");
}
+ bool has_win64 = false;
+ for (const DepotInfo& depot : eligible) {
+ if (LowerString(Trim(depot.os_arch)) == "64" && depot.manifest_gid && *depot.manifest_gid != 0) {
+ has_win64 = true;
+ break;
+ }
+ }
std::vector<DepotInfo> result;
std::set<std::uint32_t> ids;
for (const DepotInfo& depot : eligible) {
+ if (has_win64 && LowerString(Trim(depot.os_arch)) == "32") continue;
if (depot.manifest_gid && *depot.manifest_gid != 0) {
result.push_back(depot);
ids.insert(depot.id);
diff --git a/src/steam/backend/app_info.h b/src/steam/backend/app_info.h
index b320879..bacf311 100644
--- a/src/steam/backend/app_info.h
+++ b/src/steam/backend/app_info.h
@@ -89,8 +89,9 @@ std::optional<AppInfo> ParseAppInfo(std::uint32_t app_id, std::string_view buffe
bool OsListMatchesWindows(std::string_view os_list);
// Windows/English depot selection: eligible by OS, language, shared install, access and DLC
-// ownership, then only those with a public manifest, sorted by id. Returns false with a short
-// reason when nothing is eligible or available.
+// ownership, then only those with a public manifest. A usable 64-bit Windows depot excludes
+// 32-bit alternates but not architecture-neutral content. Results are sorted by id. Returns
+// false with a short reason when nothing is eligible or available.
bool SelectDepots(const AppInfo& app, const std::set<std::uint32_t>& owned_apps,
const std::optional<std::set<std::uint32_t>>& owned_depots,
std::vector<DepotInfo>* selected, std::string* reason);
diff --git a/tests/steam_app_info_test.cpp b/tests/steam_app_info_test.cpp
index 37a45ea..eaaecac 100644
--- a/tests/steam_app_info_test.cpp
+++ b/tests/steam_app_info_test.cpp
@@ -288,6 +288,32 @@ void TestSelectDepots() {
from_app.depots[0].depot_from_app = 5;
CHECK(SelectDepots(from_app, {kApp}, std::set<std::uint32_t>{106}, &selected, &reason));
CHECK((Ids(selected) == U32s{101, 106}));
+
+ AppInfo architectures;
+ architectures.app_id = kApp;
+ DepotInfo win64;
+ win64.id = 201;
+ win64.os_list = "windows";
+ win64.os_arch = "64";
+ win64.manifest_gid = 201;
+ DepotInfo win32 = win64;
+ win32.id = 202;
+ win32.os_arch = "32";
+ DepotInfo shared = win64;
+ shared.id = 203;
+ shared.os_arch.clear();
+ architectures.depots = {win32, shared, win64};
+ CHECK(SelectDepots(architectures, {kApp}, std::nullopt, &selected, &reason));
+ CHECK((Ids(selected) == U32s{201, 203}));
+
+ architectures.depots.erase(architectures.depots.begin() + 2);
+ CHECK(SelectDepots(architectures, {kApp}, std::nullopt, &selected, &reason));
+ CHECK((Ids(selected) == U32s{202, 203}));
+
+ architectures.depots.push_back(win64);
+ architectures.depots.back().manifest_gid = 0;
+ CHECK(SelectDepots(architectures, {kApp}, std::nullopt, &selected, &reason));
+ CHECK((Ids(selected) == U32s{202, 203}));
}
// A partial grant must not install as if complete (issue #58): Team Fortress 2's content depot has