diff --git a/include/config/save.h b/include/config/save.h index fee8f84607..715b58da0c 100644 --- a/include/config/save.h +++ b/include/config/save.h @@ -15,7 +15,7 @@ #define FREE_POKEMON_JUMP FALSE //frees up pokemon jump data. 16 bytes #define FREE_RECORD_MIXING_HALL_RECORDS FALSE //frees up hall records for record mixing. 1032 bytes // saveblock2 total: 1236 bytes - + //grand total: 3082 #endif // GUARD_CONFIG_DECAP_H diff --git a/include/global.h b/include/global.h index 0a527489ab..e3c89f8eb3 100644 --- a/include/global.h +++ b/include/global.h @@ -523,10 +523,10 @@ struct SaveBlock2 /*0xA8*/ u32 gcnLinkFlags; // Read by Pokémon Colosseum/XD /*0xAC*/ u32 encryptionKey; /*0xB0*/ struct PlayersApprentice playerApprentice; - /*0xDC*/ struct Apprentice apprentices[APPRENTICE_COUNT]; //272 bytes + /*0xDC*/ struct Apprentice apprentices[APPRENTICE_COUNT]; /*0x1EC*/ struct BerryCrush berryCrush; #if FREE_POKEMON_JUMP == FALSE - /*0x1FC*/ struct PokemonJumpRecords pokeJump; //16 bytes + /*0x1FC*/ struct PokemonJumpRecords pokeJump; #endif //FREE_POKEMON_JUMP /*0x20C*/ struct BerryPickingResults berryPick; #if FREE_RECORD_MIXING_HALL_RECORDS == FALSE @@ -1012,7 +1012,7 @@ struct SaveBlock1 /*0x9BC*/ u16 berryBlenderRecords[3]; /*0x9C2*/ u8 unused_9C2[6]; #if FREE_MATCH_CALL == FALSE - /*0x9C8*/ u16 trainerRematchStepCounter; //104 bytes + /*0x9C8*/ u16 trainerRematchStepCounter; /*0x9CA*/ u8 trainerRematches[MAX_REMATCH_ENTRIES]; #endif //FREE_MATCH_CALL /*0xA2E*/ //u8 padding3[2]; @@ -1033,7 +1033,7 @@ struct SaveBlock1 /*0x278E*/ u8 decorationPosters[10]; /*0x2798*/ u8 decorationDolls[40]; /*0x27C0*/ u8 decorationCushions[10]; - /*0x27CC*/ TVShow tvShows[TV_SHOWS_COUNT]; //900 bytes + /*0x27CC*/ TVShow tvShows[TV_SHOWS_COUNT]; /*0x27CA*/ //u8 padding4[2]; /*0x2B50*/ PokeNews pokeNews[POKE_NEWS_COUNT]; /*0x2B90*/ u16 outbreakPokemonSpecies; diff --git a/src/battle_records.c b/src/battle_records.c index b0ea66f2f4..10e2455a39 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -338,6 +338,7 @@ void ShowLinkBattleRecords(void) PrintLinkBattleRecord(&gSaveBlock1Ptr->linkBattleRecords.entries[i], 7 + (i * 2), gSaveBlock1Ptr->linkBattleRecords.languages[i]); } #endif //FREE_LINK_BATTLE_RECORDS + PutWindowTilemap(gRecordsWindowId); CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } diff --git a/src/battle_setup.c b/src/battle_setup.c index 8839ba13dc..e05dc551a6 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -1680,7 +1680,7 @@ static bool32 IsRematchForbidden(s32 rematchTableId) static void SetRematchIdForTrainer(const struct RematchTrainer *table, u32 tableId) { s32 i; - + #if FREE_MATCH_CALL == FALSE for (i = 1; i < REMATCHES_COUNT; i++) { @@ -1745,7 +1745,7 @@ void UpdateRematchIfDefeated(s32 rematchTableId) static bool32 DoesSomeoneWantRematchIn_(const struct RematchTrainer *table, u16 mapGroup, u16 mapNum) { s32 i; - + #if FREE_MATCH_CALL == FALSE for (i = 0; i < REMATCH_TABLE_ENTRIES; i++) { @@ -1753,6 +1753,7 @@ static bool32 DoesSomeoneWantRematchIn_(const struct RematchTrainer *table, u16 return TRUE; } #endif //FREE_MATCH_CALL + return FALSE; } @@ -1781,6 +1782,7 @@ static bool8 IsFirstTrainerIdReadyForRematch(const struct RematchTrainer *table, if (gSaveBlock1Ptr->trainerRematches[tableId] == 0) return FALSE; #endif //FREE_MATCH_CALL + return TRUE; } @@ -1796,6 +1798,7 @@ static bool8 IsTrainerReadyForRematch_(const struct RematchTrainer *table, u16 t if (gSaveBlock1Ptr->trainerRematches[tableId] == 0) return FALSE; #endif //FREE_MATCH_CALL + return TRUE; } diff --git a/src/battle_tower.c b/src/battle_tower.c index e190430127..d8f65786ed 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -939,7 +939,7 @@ static void SetTowerBattleWon(void) if (gTrainerBattleOpponent_A == TRAINER_EREADER) ClearEReaderTrainer(&gSaveBlock2Ptr->frontier.ereaderTrainer); #endif //FREE_BATTLE_TOWER_E_READER - + // towerNumWins is never read outside this conditional if (gSaveBlock2Ptr->frontier.towerNumWins < MAX_STREAK) gSaveBlock2Ptr->frontier.towerNumWins++; @@ -2915,6 +2915,7 @@ void GetEreaderTrainerName(u8 *dst) for (i = 0; i < 5; i++) dst[i] = gSaveBlock2Ptr->frontier.ereaderTrainer.name[i]; + dst[i] = EOS; #else dst[0] = EOS; diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index ea49817e8c..8ef53351f8 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -260,6 +260,7 @@ bool8 MEScrCmd_setenigmaberry(struct ScriptContext *ctx) else ctx->mStatus = MEVENT_STATUS_LOAD_ERROR; #endif //FREE_ENIGMA_BERRY + return FALSE; } diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 3e95234b3c..504059ec9c 100755 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -260,7 +260,7 @@ u16 GetWonderCardFlagID(void) if (ValidateSavedWonderCard()) return gSaveBlock1Ptr->mysteryGift.card.flagId; #endif //FREE_BATTLE_TOWER_E_READER - + return 0; } @@ -393,6 +393,7 @@ bool32 MysteryGift_TrySaveStamp(const u16 *stamp) } } #endif //FREE_BATTLE_TOWER_E_READER + return FALSE; } @@ -628,6 +629,7 @@ u16 MysteryGift_GetCardStat(u32 stat) } } #endif //FREE_BATTLE_TOWER_E_READER + AGB_ASSERT(0); return 0; } diff --git a/src/pokenav_match_call_list.c b/src/pokenav_match_call_list.c index 37f3352148..f0098e546d 100755 --- a/src/pokenav_match_call_list.c +++ b/src/pokenav_match_call_list.c @@ -490,6 +490,7 @@ static bool32 UNUSED HasRematchEntry(void) } } #endif //FREE_MATCH_CALL + return FALSE; } diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 53c4172bc2..3a523e6a2d 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -527,6 +527,7 @@ static void TrainerHillGetChallengeStatus(void) static void BufferChallengeTime(void) { s32 total, minutes, secondsWhole, secondsFraction; + #if FREE_TRAINER_HILL == FALSE total = gSaveBlock1Ptr->trainerHill.timer; if (total >= HILL_MAX_TIME) @@ -608,6 +609,7 @@ void PrintOnTrainerHillRecordsWindow(void) { s32 i, x, y; u32 total, minutes, secondsWhole, secondsFraction; + #if FREE_TRAINER_HILL == FALSE SetUpDataStruct(); FillWindowPixelBuffer(0, PIXEL_FILL(0));