Restore 0th day (#574)

This commit is contained in:
LittleCube 2025-04-29 22:50:20 -04:00 committed by GitHub
parent 2d9dd10ddd
commit aef0bf50ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,7 +11,7 @@ void Sleep_Msec(u32 ms);
extern u16 D_801F6AF0;
extern u8 D_801F6AF2;
// @recomp Patched to not wait a hardcoded amount of time for the save to complete.
// @recomp Patched to wait a much shorter amount of time for the save to complete.
RECOMP_PATCH void Sram_UpdateWriteToFlashDefault(SramContext* sramCtx) {
if (sramCtx->status == 2) {
if (SysFlashrom_IsBusy() != 0) { // if task running
@ -23,13 +23,13 @@ RECOMP_PATCH void Sram_UpdateWriteToFlashDefault(SramContext* sramCtx) {
sramCtx->status = 4;
}
}
} else if (sramCtx->status == 4) {
// @recomp Patched to check status instead of using a hardcoded wait.
} else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER_PRECISE(0, 25)) {
// @recomp Patched to wait a much shorter amount of time.
sramCtx->status = 0;
}
}
// @recomp Patched to not wait a hardcoded amount of time for the save to complete.
// @recomp Patched to wait a much shorter amount of time for the save to complete.
RECOMP_PATCH void Sram_UpdateWriteToFlashOwlSave(SramContext* sramCtx) {
if (sramCtx->status == 7) {
if (SysFlashrom_IsBusy() != 0) { // Is task running
@ -49,8 +49,8 @@ RECOMP_PATCH void Sram_UpdateWriteToFlashOwlSave(SramContext* sramCtx) {
sramCtx->status = 4;
}
}
} else if (sramCtx->status == 4) {
// @recomp Patched to check status instead of using a hardcoded wait.
} else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER_PRECISE(0, 25)) {
// @recomp Patched to wait a much shorter amount of time.
sramCtx->status = 0;
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
gSaveContext.save.isOwlSave = false;