mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Don't overwrite existing saves when installing
thanks @aspargas2
This commit is contained in:
parent
6116545fef
commit
e568348086
@ -1436,12 +1436,13 @@ u32 InstallCiaSystemData(CiaStub* cia, const char* drv) {
|
|||||||
drv, tid_high, tid_low);
|
drv, tid_high, tid_low);
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate the save file
|
// generate the save file, first check if it already exists
|
||||||
|
if (fvx_qsize(path_save) != exthdr->savedata_size) {
|
||||||
static const u8 zeroes[0x20] = { 0x00 };
|
static const u8 zeroes[0x20] = { 0x00 };
|
||||||
UINT bw;
|
UINT bw;
|
||||||
FIL save;
|
FIL save;
|
||||||
fvx_rmkpath(path_save);
|
fvx_rmkpath(path_save);
|
||||||
if (fvx_open(&save, path_save, FA_WRITE | FA_CREATE_NEW) != FR_OK)
|
if (fvx_open(&save, path_save, FA_WRITE | FA_CREATE_ALWAYS) != FR_OK)
|
||||||
return 1;
|
return 1;
|
||||||
if ((fvx_write(&save, zeroes, 0x20, &bw) != FR_OK) || (bw != 0x20))
|
if ((fvx_write(&save, zeroes, 0x20, &bw) != FR_OK) || (bw != 0x20))
|
||||||
bw = 0;
|
bw = 0;
|
||||||
@ -1450,6 +1451,7 @@ u32 InstallCiaSystemData(CiaStub* cia, const char* drv) {
|
|||||||
fvx_close(&save);
|
fvx_close(&save);
|
||||||
if (bw != 0x20) return 1;
|
if (bw != 0x20) return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// progress update
|
// progress update
|
||||||
if (!ShowProgress(3, 5, "TMD/CMD/TiE/Ticket/Save")) return 1;
|
if (!ShowProgress(3, 5, "TMD/CMD/TiE/Ticket/Save")) return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user