diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-11-13 23:19:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-13 23:19:57 -0500 |
commit | 159bb37bbe9d960f0d2a3da9736e1be5eefb8290 (patch) | |
tree | 44e6d447e57941a77623253884304c3174b72886 /src/recorded_battle.c | |
parent | 9d3345a6d69c38bf31014df69c52583c877eed24 (diff) | |
parent | 9a932cd9c3089c03adada30ace4c79a84bf73cf0 (diff) |
Merge branch 'master' into fix_saveblock_reorder
Diffstat (limited to 'src/recorded_battle.c')
-rw-r--r-- | src/recorded_battle.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/recorded_battle.c b/src/recorded_battle.c index e6d5b165b..fd2b3a06b 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -306,14 +306,14 @@ static bool32 IsRecordedBattleSaveValid(struct RecordedBattleSave *save) return TRUE; } -static bool32 RecordedBattleToSave(struct RecordedBattleSave *battleSave, struct RecordedBattleSave *saveSection) +static bool32 RecordedBattleToSave(struct RecordedBattleSave *battleSave, struct RecordedBattleSave *saveSector) { - memset(saveSection, 0, SECTOR_SIZE); - memcpy(saveSection, battleSave, sizeof(*battleSave)); + memset(saveSector, 0, SECTOR_SIZE); + memcpy(saveSector, battleSave, sizeof(*battleSave)); - saveSection->checksum = CalcByteArraySum((void*)(saveSection), sizeof(*saveSection) - 4); + saveSector->checksum = CalcByteArraySum((void*)(saveSector), sizeof(*saveSector) - 4); - if (TryWriteSpecialSaveSection(SECTOR_ID_RECORDED_BATTLE, (void*)(saveSection)) != SAVE_STATUS_OK) + if (TryWriteSpecialSaveSector(SECTOR_ID_RECORDED_BATTLE, (void*)(saveSector)) != SAVE_STATUS_OK) return FALSE; else return TRUE; @@ -477,9 +477,9 @@ bool32 MoveRecordedBattleToSaveData(void) return ret; } -static bool32 TryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst, struct SaveSection *saveBuffer) +static bool32 TryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst, struct SaveSector *saveBuffer) { - if (TryReadSpecialSaveSection(SECTOR_ID_RECORDED_BATTLE, (void*)(saveBuffer)) != SAVE_STATUS_OK) + if (TryReadSpecialSaveSector(SECTOR_ID_RECORDED_BATTLE, (void*)(saveBuffer)) != SAVE_STATUS_OK) return FALSE; memcpy(dst, saveBuffer, sizeof(struct RecordedBattleSave)); @@ -492,7 +492,7 @@ static bool32 TryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst, stru static bool32 CopyRecordedBattleFromSave(struct RecordedBattleSave *dst) { - struct SaveSection *savBuffer = AllocZeroed(sizeof(struct SaveSection)); + struct SaveSector *savBuffer = AllocZeroed(SECTOR_SIZE); bool32 ret = TryCopyRecordedBattleSaveData(dst, savBuffer); Free(savBuffer); |