Fix owl save crash by adjusting save buffer size (#141)

This commit is contained in:
Garrett Cox
2024-05-22 09:04:59 -05:00
parent f4aec1ed0a
commit 683820632a
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ typedef enum RespawnMode {
/* 8 */ RESPAWN_MODE_MAX
} RespawnMode;
#define SAVE_BUFFER_SIZE 0x4000
#define SAVE_BUFFER_SIZE 0x8000 // 2S2H [Port] Double the original size of 0x4000 for 64 bit support
typedef enum {
/* 0 */ MAGIC_STATE_IDLE, // Regular gameplay
+2 -2
View File
@@ -1937,7 +1937,7 @@ void Sram_UpdateWriteToFlashDefault(SramContext* sramCtx) {
sramCtx->status = 4;
}
}
} else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER(2)) {
} else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER(0 /*2*/)) { // 2S2H [Port] Remove arbitrary 2 second delay
// Finished status is hardcoded to 2 seconds instead of when the task finishes
sramCtx->status = 0;
}
@@ -1975,7 +1975,7 @@ void Sram_UpdateWriteToFlashOwlSave(SramContext* sramCtx) {
sramCtx->status = 4;
}
}
} else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER(2)) {
} else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER(0 /*2*/)) { // 2S2H [Port] Remove arbitrary 2 second delay
// Finished status is hardcoded to 2 seconds instead of when the task finishes
sramCtx->status = 0;
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);