Support for TFEv1 files

This commit is contained in:
techmetx11 2024-04-13 06:43:37 +00:00
parent 4bc4bfac32
commit ad160b5d88
No known key found for this signature in database
GPG key ID: 20E0C88A0E7E5AF2
3 changed files with 337 additions and 124 deletions

View file

@ -153,11 +153,13 @@ bool DivEngine::load(unsigned char* f, size_t slen, const char* nameHint) {
} else if (memcmp(file,DIV_FC13_MAGIC,4)==0 || memcmp(file,DIV_FC14_MAGIC,4)==0) {
return loadFC(file,len);
} else if (memcmp(file,DIV_TFM_MAGIC,8)==0) {
return loadTFM(file,len);
return loadTFMv2(file,len);
}
// step 3: try loading as .mod
if (loadMod(file,len)) {
// step 3: try loading as .mod or TFEv1 (if the file extension matches)
if (extS==".tfe") {
return loadTFMv1(file,len);
} else if (loadMod(file,len)) {
delete[] f;
return true;
}