Fix app versions over 000000ff

it's actually a big endian u32, and dev consoles use that
This commit is contained in:
Pk11 2022-10-11 23:22:24 -05:00
parent aaced70b6e
commit 8137a76d20

View File

@ -354,16 +354,16 @@ static void backup(Menu* m)
FILE *tmd = fopen(path, "rb");
if (tmd)
{
u8 appVersion;
fseek(tmd, 0x1E7, SEEK_SET);
fread(&appVersion, sizeof(appVersion), 1, tmd);
u8 appVersion[4];
fseek(tmd, 0x1E4, SEEK_SET);
fread(&appVersion, 1, 4, tmd);
fclose(tmd);
iprintf("%s -> \n%s...\n", path, dstpath);
copyFile(path, dstpath);
//app
sprintf(path, "%s/content/000000%02x.app", srcpath, appVersion);
sprintf(path, "%s/content/%02x%02x%02x%02x.app", srcpath, appVersion[0], appVersion[1], appVersion[2], appVersion[3]);
sprintf(dstpath, "%s/%s.nds", BACKUP_PATH, backname);
if (access(path, F_OK) == 0)
{