From af9202ff4e9caf44a1242dadaf620ca8e2ce844e Mon Sep 17 00:00:00 2001 From: Alexandros Mandravillis Date: Wed, 19 Aug 2026 16:46:49 +0300 Subject: [PATCH] runtime: seed launcher initial disc from CLI --disc override Passing --disc suppressed the remembered settings/disc.cfg disc for the launcher's initial state (the has_disc_path gate) without seeding the launcher itself, so the window opened with "No disc selected" and the player had to re-pick the disc on every launch even though a valid disc was named on the command line. Seed resolved_disc from the validated CLI path before the launcher window opens. resolve_disc_for_runtime still applies the override authoritatively for the runtime after the launcher returns, so precedence is unchanged. --- runtime/src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 97c3ab5f..95df89e0 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -11532,6 +11532,19 @@ int main(int argc, char** argv) { std::string assets_dir_str = exe_dir_from_argv(argv[0]).string(); /* Same keybinds.ini / config.ini the runtime reads — never cwd. */ ae_rui_set_sidecar_paths(argv[0]); + /* A CLI --disc must seed the launcher's initial disc. Without this, + * the override suppresses the remembered settings/disc.cfg pick (the + * has_disc_path gate above) while contributing nothing itself, so the + * launcher opens with "No disc selected" and forces a manual pick on + * every launch. resolve_disc_for_runtime still applies the override + * authoritatively after the launcher returns. */ + if (disc_override_path && disc_override_path[0]) { + std::filesystem::path cli_disc = normalize_disc_path_for_launch( + std::filesystem::path(disc_override_path)); + std::error_code cli_ec; + if (std::filesystem::exists(cli_disc, cli_ec)) + resolved_disc = cli_disc; + } std::string rui_initial_disc = resolved_disc.string(); std::string rui_title = (game_name.empty() ? std::string("PSX") : game_name) + " - Launcher";