tools: probe falls back to PSX.EXE boot when SYSTEM.CNF is absent

This commit is contained in:
Alexandros Mandravillis
2026-08-29 18:56:46 +03:00
committed by Alexandros Mandravillis
parent 47bda8172e
commit cabe566d01
+17 -5
View File
@@ -412,12 +412,24 @@ def probe(cue_path: Path, *, identity_only: bool = False) -> DiscProbe:
entries = parse_root_entries(bytes(root[:root_size]))
if "SYSTEM.CNF" not in entries:
raise SystemExit(
f"SYSTEM.CNF missing on disc (found {sorted(entries)[:24]})"
# Very early titles (e.g. King's Field, Dec 1994) ship no SYSTEM.CNF;
# the BIOS falls back to booting PSX.EXE from the root directory.
psx_exe = next((k for k in entries if k.upper() == "PSX.EXE"), None)
if psx_exe is None:
raise SystemExit(
f"SYSTEM.CNF missing on disc and no PSX.EXE fallback "
f"(found {sorted(entries)[:24]})"
)
boot_token = psx_exe
warnings.append(
"SYSTEM.CNF missing; using the BIOS PSX.EXE fallback boot path. "
"No serial is recoverable from the filesystem — set game_id "
"manually in catalog_identity.json / game.toml."
)
extent, fsize = entries["SYSTEM.CNF"]
cnf = read_file(read_user, data, extent, fsize)
boot_token = parse_system_cnf(cnf)
else:
extent, fsize = entries["SYSTEM.CNF"]
cnf = read_file(read_user, data, extent, fsize)
boot_token = parse_system_cnf(cnf)
serial, boot_exe = normalize_serial(boot_token)
disc_boot = boot_token