mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-09 05:25:01 +00:00
Adds user-facing information about which ROMs a machine attempted to load if it fails.
This commit is contained in:
@@ -280,7 +280,13 @@ int main(int argc, char *argv[]) {
|
||||
//
|
||||
// /usr/local/share/CLK/[system]; or
|
||||
// /usr/share/CLK/[system]
|
||||
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::string> rom_names;
|
||||
std::string machine_name;
|
||||
bool roms_loaded = machine->crt_machine()->set_rom_fetcher( [&rom_names, &machine_name]
|
||||
(const std::string &machine, const std::vector<std::string> &names) -> std::vector<std::unique_ptr<std::vector<uint8_t>>> {
|
||||
rom_names.insert(rom_names.end(), names.begin(), names.end());
|
||||
machine_name = machine;
|
||||
|
||||
std::vector<std::unique_ptr<std::vector<uint8_t>>> results;
|
||||
for(auto &name: names) {
|
||||
std::string local_path = "/usr/local/share/CLK/" + machine + "/" + name;
|
||||
@@ -313,7 +319,11 @@ int main(int argc, char *argv[]) {
|
||||
});
|
||||
|
||||
if(!roms_loaded) {
|
||||
std::cerr << "Could not find system ROMs; please install to /usr/local/share/CLK/ or /usr/share/CLK/" << std::endl;
|
||||
std::cerr << "Could not find system ROMs; please install to /usr/local/share/CLK/ or /usr/share/CLK/." << std::endl;
|
||||
std::cerr << "One or more of the following were needed but not found:" << std::endl;
|
||||
for(auto &name: rom_names) {
|
||||
std::cerr << machine_name << '/' << name << std::endl;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user