From e10d369e53c56eb74039eac65f224b518d51746e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 7 Nov 2017 22:32:59 -0500 Subject: [PATCH] Ensures that execution doesn't proceed if ROMs are missing. --- OSBindings/SDL/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OSBindings/SDL/main.cpp b/OSBindings/SDL/main.cpp index 9a1fb34fb..2363da84b 100644 --- a/OSBindings/SDL/main.cpp +++ b/OSBindings/SDL/main.cpp @@ -179,7 +179,7 @@ int main(int argc, char *argv[]) { // // /usr/local/share/CLK/[system]; or // /usr/share/CLK/[system] - machine->crt_machine()->set_rom_fetcher( [] (const std::string &machine, const std::vector &names) -> std::vector>> { + bool roms_loaded = machine->crt_machine()->set_rom_fetcher( [] (const std::string &machine, const std::vector &names) -> std::vector>> { std::vector>> results; for(auto &name: names) { std::string local_path = "/usr/local/share/CLK/" + machine + "/" + name; @@ -207,6 +207,11 @@ int main(int argc, char *argv[]) { return results; }); + + if(!roms_loaded) { + std::cerr << "Could not find system ROMs; please install to /usr/local/share/CLK/ or /usr/share/CLK/" << std::endl; + return -1; + } machine->configuration_target()->configure_as_target(targets.front());