sysDef refactor, part 2

to @cam900 and @grauw: you may now pull this to your branch.
check out the comments in sysDef.cpp though.
This commit is contained in:
tildearrow 2022-04-27 00:56:15 -05:00
parent 351c22cb77
commit 24d60507e7
15 changed files with 495 additions and 1644 deletions

View file

@ -1101,9 +1101,11 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
return false;
}
logD("systems:");
for (int i=0; i<32; i++) {
unsigned char sysID=reader.readC();
ds.system[i]=systemFromFileFur(sysID);
logD("- %d: %.2x (%s)",i,sysID,getSystemName(ds.system[i]));
if (sysID!=0 && systemToFileFur(ds.system[i])==0) {
logE("unrecognized system ID %.2x",ds.system[i]);
lastError=fmt::sprintf("unrecognized system ID %.2x!",ds.system[i]);
@ -2023,6 +2025,8 @@ bool DivEngine::load(unsigned char* f, size_t slen) {
return false;
}
if (!systemsRegistered) registerSystems();
// step 1: try loading as a zlib-compressed file
logD("trying zlib...");
try {