From 079b1762ac666ceff38297c5e38c7eedabb35eae Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 5 Aug 2022 12:11:33 -0400 Subject: [PATCH] Update special save sector size checks --- src/ereader_helpers.c | 3 ++- src/recorded_battle.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c index cf3ca16c3..894ad0012 100755 --- a/src/ereader_helpers.c +++ b/src/ereader_helpers.c @@ -15,7 +15,8 @@ #include "constants/items.h" #include "constants/trainer_hill.h" -STATIC_ASSERT(sizeof(struct TrainerHillChallenge) <= SECTOR_DATA_SIZE, TrainerHillChallengeFreeSpace); +// Save data using TryWriteSpecialSaveSector is allowed to exceed SECTOR_DATA_SIZE (up to the counter field) +STATIC_ASSERT(sizeof(struct TrainerHillChallenge) <= SECTOR_COUNTER_OFFSET, TrainerHillChallengeFreeSpace); struct SendRecvMgr { diff --git a/src/recorded_battle.c b/src/recorded_battle.c index 8256ce1fc..e8785b5f8 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -67,7 +67,8 @@ struct RecordedBattleSave u32 checksum; }; -STATIC_ASSERT(sizeof(struct RecordedBattleSave) <= SECTOR_DATA_SIZE, RecordedBattleSaveFreeSpace); +// Save data using TryWriteSpecialSaveSector is allowed to exceed SECTOR_DATA_SIZE (up to the counter field) +STATIC_ASSERT(sizeof(struct RecordedBattleSave) <= SECTOR_COUNTER_OFFSET, RecordedBattleSaveFreeSpace); EWRAM_DATA u32 gRecordedBattleRngSeed = 0; EWRAM_DATA u32 gBattlePalaceMoveSelectionRngValue = 0;