Reorganize initialization error reporting

- Invalid game id -> sys_error() in GameId::GameId()
- Unknown crc32 -> SDL_ShowSimpleMessageBox() in GameId::GameId()
- Cannot open ADISK.DAT -> sys_error() in NACT::NACT()
This commit is contained in:
kichikuou
2025-01-03 12:36:27 +09:00
parent a7dbdd0510
commit ffe11c695e
5 changed files with 14 additions and 11 deletions
+10 -1
View File
@@ -197,12 +197,21 @@ GameId::GameId(const Config& config)
break;
}
}
if (!entry)
sys_error("Unknown game ID: %s", config.game_id.c_str());
} else {
uint32_t crc32_a = calc_crc32("ADISK.DAT");
uint32_t crc32_b = calc_crc32("BDISK.DAT");
entry = lookup(crc32_a, crc32_b);
if (!entry)
if (crc32_a && !entry) {
WARNING("Cannot determine game id. crc32_a: %08x, crc32_b: %08x", crc32_a, crc32_b);
SDL_ShowSimpleMessageBox(
SDL_MESSAGEBOX_WARNING, "system3",
"Unable to determine game ID.\n"
"If you are running a modified game, please specify 'game = <original-game-id>' in system3.ini.\n"
"See README.md for more information.",
NULL);
}
}
if (entry) {
game = entry->game;