Enable compatibility with mGBA RTS savegames

This commit is contained in:
d0k3 2022-11-28 09:11:57 +01:00
parent 9416ec5ac0
commit 3710ed975b

View File

@ -177,7 +177,7 @@ u32 InjectGbaVcSavegameBuffered(const char* path, const char* path_vcsave, void*
char* ext = strrchr(path_vcsave, '.'); char* ext = strrchr(path_vcsave, '.');
if (!ext || ((strncasecmp(ext+1, "sav", 4) != 0) && (strncasecmp(ext+1, "srm", 4) != 0) && if (!ext || ((strncasecmp(ext+1, "sav", 4) != 0) && (strncasecmp(ext+1, "srm", 4) != 0) &&
(strncasecmp(ext+1, "SaveRAM", 8) != 0))) return 1; // bad extension (strncasecmp(ext+1, "SaveRAM", 8) != 0))) return 1; // bad extension
if ((fvx_stat(path_vcsave, &fno) != FR_OK) || !GBASAVE_VALID(fno.fsize)) if ((fvx_stat(path_vcsave, &fno) != FR_OK) || (!GBASAVE_VALID(fno.fsize) && !GBASAVE_VALID(fno.fsize - 16)))
return 1; // bad size return 1; // bad size
// read AGBsave header to memory // read AGBsave header to memory