From 209f3e0cfbccd2bb3bb6e17d05480ff283a28d28 Mon Sep 17 00:00:00 2001 From: Alex Vanderveen Date: Thu, 6 Aug 2026 22:55:43 -0400 Subject: [PATCH] fix merge: wire mod APIs and pick_runtime_file cli flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include mod_plugins/mod_runtime and restore master’s four-arg file picker so the integrate←master merge builds. Co-authored-by: Cursor --- runtime/src/main.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index bf46e832..458ccafd 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -63,6 +63,8 @@ extern "C" void psx_event_step_conservative_env_init(void); #include "freeze_heartbeat.h" #include "config_loader.h" #include "game_options.h" +#include "mod_plugins.h" +#include "mod_runtime.h" #include "crc32.h" #include "disc_identity.h" #include "iso_reader.h" /* text-image guard: extract the boot EXE from the disc */ @@ -1797,12 +1799,14 @@ static void launcher_info(const char* title, const std::string& msg) { static std::string s_picker_game_name = "PSXRecomp"; static bool pick_runtime_file(const char* title, const char* filter, - std::filesystem::path& out) { + std::filesystem::path& out, const char* cli_flag) { // Headless: never open an interactive file dialog (it blocks). Fail the // resolve so boot aborts cleanly with the stderr message the caller printed. if (g_headless) { - std::fprintf(stderr, "psxrecomp: headless — cannot prompt for '%s'; " - "supply it via game.toml / --disc / --bios.\n", title); + std::fprintf(stderr, + "psxrecomp: headless — cannot prompt for '%s'.\n" + " Supply it on the command line: %s (or set it in game.toml).\n", + title, cli_flag); return false; } #ifdef _WIN32 @@ -1825,7 +1829,16 @@ static bool pick_runtime_file(const char* title, const char* filter, #else (void)filter; (void)out; - std::fprintf(stderr, "psxrecomp: %s requires a command-line path on this platform.\n", title); + // No native GUI file picker on this platform (macOS/Linux): the file must be + // named on the command line. Tell the user the exact flag + a full example + // instead of a dead-end "requires a command-line path". + std::fprintf(stderr, + "psxrecomp: no graphical file picker on this platform — '%s'\n" + " must be supplied on the command line: %s \n" + " Example: ./ --game game.toml " + "--bios /path/to/SCPH1001.BIN --disc /path/to/game.cue\n" + " (or set the path in game.toml). See the game's README, \"Building From Source\".\n", + title, cli_flag); return false; #endif } @@ -2058,7 +2071,7 @@ static std::filesystem::path resolve_bios_for_runtime(const char* requested, if (!pick_runtime_file( bios_title.c_str(), "PlayStation BIOS (*.bin)\0*.bin\0All Files (*.*)\0*.*\0", - picked)) { + picked, "--bios")) { return {}; } if (validate_bios_for_launch(picked)) {