Play your Steam library's Windows games on a jailbroken PS5.
C++
Ship a Batman: Arkham Asylum recipe with its language
Leonardo Lobato8cd10093b737
diff --git a/runtime/recipes/recipes.lst b/runtime/recipes/recipes.lstindex ba58295..18d3596 100644--- a/runtime/recipes/recipes.lst+++ b/runtime/recipes/recipes.lst@@ -1,5 +1,6 @@# Recipes Playden ships, one file per line (the console title cannot list folders).steam-220-hl2-v1.jsonsteam-292120-ffxiii-v1.json+steam-35140-arkhamasylum-v1.jsonsteam-2640950-scottpilgrimex-v1.jsonsteam-4241920-braziliandrugdealer4-v1.jsondiff --git a/runtime/recipes/steam-35140-arkhamasylum-v1.json b/runtime/recipes/steam-35140-arkhamasylum-v1.jsonnew file mode 100644index 0000000..2b8367b--- /dev/null+++ b/runtime/recipes/steam-35140-arkhamasylum-v1.json@@ -0,0 +1,22 @@+{+ "recipe_id": "steam-35140-arkhamasylum-v1",+ "recipe_version": 1,+ "app_id": 35140,+ "name": "Batman: Arkham Asylum GOTY Edition",+ "launch_entries": [+ {"id": "game", "label": "Batman: Arkham Asylum", "executable": "Binaries/ShippingPC-BmGame.exe"}+ ],+ "arguments": "",+ "dll_overrides": "d3d8,d3d9,d3d10core,d3d11,dxgi=n",+ "architecture": "pe32",+ "runtime": "wine-wow64",+ "prefix": "game",+ "graphics": "dxvk",+ "defaults": {+ "steam_features": "emulate"+ },+ "ini": {+ "BmGame/Config/UserEngine.ini": {"Engine.Engine": {"Language": "int"}}+ },+ "locked": []+}diff --git a/tests/game_settings_test.cpp b/tests/game_settings_test.cppindex c45e9d5..cbd66ec 100644--- a/tests/game_settings_test.cpp+++ b/tests/game_settings_test.cpp@@ -1378,6 +1378,22 @@ int main(int argc, char** argv) {CHECK(settings.graphics == "opengl" && settings.dll_overrides.empty());CHECK(settings.values.at("steam_features").value == "emulate" && !settings.values.at("graphics").locked);}+ // Batman: Arkham Asylum starts BmLauncher.exe, which can't start the game on the console, while UserEngine.ini has+ // no [Engine.Engine] Language, so its recipe writes Language=int (English). Otherwise it is what Playden made from+ // the game's files: DXVK for its Direct3D 9 and the Steam emulator.+ {+ GameRecipe asylum;+ CHECK(ParseGameRecipe(ReadText(source / "runtime/recipes/steam-35140-arkhamasylum-v1.json"), &asylum, &reason));+ CHECK(asylum.app_id == 35140 && asylum.launch_entries.size() == 1 &&+ asylum.launch_entries[0].executable == "Binaries/ShippingPC-BmGame.exe");+ CHECK(asylum.ini == (std::vector<IniValue>{{"BmGame/Config/UserEngine.ini", "Engine.Engine", "Language", "int"}}));+ EffectiveSettings settings;+ SettingsError error;+ CHECK(BuildEffectiveSettings(asylum, nullptr, {}, KitCapabilities{}, &settings, &error));+ CHECK(settings.graphics == "dxvk" && settings.dll_overrides == kDxvkOverrides && settings.architecture == "pe32");+ CHECK(settings.values.at("steam_features").value == "emulate" && !settings.values.at("graphics").locked);+ CHECK(settings.launch && settings.launch->executable == "Binaries/ShippingPC-BmGame.exe" && settings.arguments.empty());+ }CHECK(!ParseSettingsPresets(R"({"presets":[{"id":"x","name":"X","settings":{"graphics":"gdi"}}]})", &presets, &reason));CHECK(!ParseSettingsPresets(R"({"presets":[{"id":"x","name":"X","settings":{"extra_arguments":"-a"}}]})", &presets, &reason));@@ -1411,7 +1427,7 @@ int main(int argc, char** argv) {std::vector<SettingsPreset> loaded_presets;std::vector<GameRecipe> loaded_recipes;CHECK(LoadSettingsData((source / "runtime").string(), &loaded_presets, &loaded_recipes, &reason));- CHECK(loaded_presets.size() == 4 && loaded_recipes.size() == 4 && loaded_recipes.front().app_id == 220 &&+ CHECK(loaded_presets.size() == 4 && loaded_recipes.size() == 5 && loaded_recipes.front().app_id == 220 &&loaded_recipes.back().id == "steam-4241920-braziliandrugdealer4-v1");CHECK(!LoadSettingsData((source / "missing").string(), &loaded_presets, &loaded_recipes, &reason));diff --git a/tests/homebrew_runtime_host_test.cpp b/tests/homebrew_runtime_host_test.cppindex 4503c39..63057bd 100644--- a/tests/homebrew_runtime_host_test.cpp+++ b/tests/homebrew_runtime_host_test.cpp@@ -3736,6 +3736,47 @@ void ShippedRecipePreparesWithAnotherKitsRecipe() {restarted.Shutdown();}+// Batman: Arkham Asylum's shipped recipe writes Language into the game folder's UserEngine.ini at preparation, so+// the game does not start its launcher; a language already there stays.+void ShippedRecipeWritesGameIni(bool language_chosen) {+ Fixture fixture;+ auto config = fixture.Config();+ config.host_namespace_prefix = fixture.root;+ config.package_paths.console_data_root = "/data";+ config.package_paths.host_data_root = fixture.root / "data";+ config.package_operations.hash_file = HashArtifactFile;+ config.package_operations.hash_bytes = HashArtifactBytes;+ config.package_operations.free_space_unverifiable = true;+ config.package_operations.validate_bottle = [](const fs::path& bottle) {+ return fs::is_regular_file(bottle / "system.reg") && fs::is_regular_file(bottle / "user.reg");+ };+ const auto kit = SyntheticKit(fixture.root / "kit");+ config.admit_kit = [&kit](std::string*) { return std::optional<RuntimeKit>(kit); };+ unsigned uuids = 0;+ config.uuid = [&uuids]() -> std::optional<std::string> {+ ++uuids; return std::string("00000000-0000-4000-8000-00000000000") + std::to_string(uuids);+ };+ config.unix_time = [] { return std::int64_t{1760000000}; };+ const auto game = fixture.root / "data/homebrew/FAKE77031/games/35140";+ Write(game / "Binaries/ShippingPC-BmGame.exe", "existing-game", 0644);+ const std::string shipped = "[Configuration]\r\nBasedOn=..\\BmGame\\Config\\DefaultEngine.ini\r\n\r\n"+ "[Engine.Engine]\r\nbSubtitlesEnabled=FALSE\r\n";+ const auto ini = shipped + (language_chosen ? "Language=deu\r\n" : "");+ Write(game / "BmGame/Config/UserEngine.ini", ini, 0644);+ RuntimeHost host(config);+ CHECK(host.Start());+ CHECK(WaitFor(host, Started).kit_available);+ host.Prepare({35140, "/data/homebrew/FAKE77031/games/35140", "internal", "Batman: Arkham Asylum GOTY Edition"});+ const auto done = WaitFor(host, [](const RuntimeSnapshot& s) {+ return !s.preparing_app && (s.refusals.count(35140) || (!s.installs.empty() && s.installs[0].state == PreparationState::kReady));+ }, 60);+ if (done.refusals.count(35140)) std::fprintf(stderr, "Prepare refused: %s\n", done.refusals.at(35140).c_str());+ CHECK(!done.refusals.count(35140) && done.installs.size() == 1);+ CHECK(Read(config.state_root / "installs.json").find("\"recipe_id\":\"steam-35140-arkhamasylum-v1\"") != std::string::npos);+ CHECK(Read(game / "BmGame/Config/UserEngine.ini") == (language_chosen ? ini : shipped + "Language=int\r\n"));+ host.Shutdown();+}+// A shipped recipe's requirements are checked against the kit's template, as the kit's packager// checks the kit's own recipe: without PS5 audio in the template, a recipe that needs it is refused.void ShippedRecipeRequirementsFollowTheKit(bool template_audio_ps5) {@@ -5803,6 +5844,8 @@ int main(int argc, char** argv) {ExistingBottleOpensWithSharedKit();KitWithoutSharedProfileKeepsBottlePrivate();ShippedRecipePreparesWithAnotherKitsRecipe();+ ShippedRecipeWritesGameIni(false);+ ShippedRecipeWritesGameIni(true);ShippedRecipeRequirementsFollowTheKit(false);ShippedRecipeRequirementsFollowTheKit(true);MigrationRewritesInstallPathsAndRepublishes();