diff options
| author | Archez <Archez@users.noreply.github.com> | 2025-02-21 10:26:19 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-21 09:26:19 -0600 |
| commit | 16b0090c319b540cfb0bd7b60cd3c577453c3f5b (patch) | |
| tree | 947a92043e2a92e4f60dad8db29957b511662f18 /mm/src/code | |
| parent | f6709ed7593b09bcff78e1104cbb796dfc811b1d (diff) | |
Execute saveLoad hook for non-fileselect loads and reset shipSaveInfo (#233)
* Execute save load hook for non-fileselect scenarios and reset shipSaveInfo
* avoid debug hook execute
Diffstat (limited to 'mm/src/code')
| -rw-r--r-- | mm/src/code/z_sram_NES.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/src/code/z_sram_NES.c b/mm/src/code/z_sram_NES.c index 2c3c0d5cd..83076e875 100644 --- a/mm/src/code/z_sram_NES.c +++ b/mm/src/code/z_sram_NES.c @@ -741,6 +741,8 @@ void Sram_ResetSave(void) { gSaveContext.save.isOwlSave = false; memset(&gSaveContext.save.saveInfo, 0, sizeof(SaveInfo)); + // 2S2H + memset(&gSaveContext.save.shipSaveInfo, 0, sizeof(ShipSaveInfo)); } /** @@ -1008,9 +1010,9 @@ void Sram_InitNewSave(void) { // #region 2S2H memcpy(&gSaveContext.save.shipSaveInfo.dpadEquips, &sSaveDefaultDpadItemEquips, sizeof(DpadSaveInfo)); - gSaveContext.save.shipSaveInfo.pauseSaveEntrance = -1; memcpy(&gSaveContext.save.shipSaveInfo.commitHash, &gGitCommitHash, sizeof(gSaveContext.save.shipSaveInfo.commitHash)); + gSaveContext.save.shipSaveInfo.pauseSaveEntrance = -1; gSaveContext.save.shipSaveInfo.saveType = SAVETYPE_VANILLA; gSaveContext.save.shipSaveInfo.fileCreatedAt = 0; // #endregion @@ -1237,8 +1239,11 @@ void Sram_InitDebugSave(void) { // #region 2S2H memcpy(&gSaveContext.save.shipSaveInfo.dpadEquips, &sSaveDefaultDpadItemEquips, sizeof(DpadSaveInfo)); + memcpy(&gSaveContext.save.shipSaveInfo.commitHash, &gGitCommitHash, + sizeof(gSaveContext.save.shipSaveInfo.commitHash)); gSaveContext.save.shipSaveInfo.pauseSaveEntrance = -1; gSaveContext.save.shipSaveInfo.saveType = SAVETYPE_VANILLA; + gSaveContext.save.shipSaveInfo.fileCreatedAt = 0; // #endregion Sram_GenerateRandomSaveFields(); |
