1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-24 12:30:17 +00:00

Ensures that execution doesn't proceed if ROMs are missing.

This commit is contained in:
Thomas Harte 2017-11-07 22:32:59 -05:00
parent 0d1b63a8c5
commit e10d369e53

View File

@ -179,7 +179,7 @@ int main(int argc, char *argv[]) {
// //
// /usr/local/share/CLK/[system]; or // /usr/local/share/CLK/[system]; or
// /usr/share/CLK/[system] // /usr/share/CLK/[system]
machine->crt_machine()->set_rom_fetcher( [] (const std::string &machine, const std::vector<std::string> &names) -> std::vector<std::unique_ptr<std::vector<uint8_t>>> { bool roms_loaded = machine->crt_machine()->set_rom_fetcher( [] (const std::string &machine, const std::vector<std::string> &names) -> std::vector<std::unique_ptr<std::vector<uint8_t>>> {
std::vector<std::unique_ptr<std::vector<uint8_t>>> results; std::vector<std::unique_ptr<std::vector<uint8_t>>> results;
for(auto &name: names) { for(auto &name: names) {
std::string local_path = "/usr/local/share/CLK/" + machine + "/" + name; std::string local_path = "/usr/local/share/CLK/" + machine + "/" + name;
@ -207,6 +207,11 @@ int main(int argc, char *argv[]) {
return results; 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()); machine->configuration_target()->configure_as_target(targets.front());