diff options
Diffstat (limited to 'include/global.h')
-rw-r--r-- | include/global.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/global.h b/include/global.h index 2b03ebbe1..9612a25f0 100644 --- a/include/global.h +++ b/include/global.h @@ -6,6 +6,8 @@ #include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines. #include "gba/gba.h" #include "constants/global.h" +#include "constants/flags.h" +#include "constants/vars.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); @@ -109,6 +111,11 @@ f; \ }) +#define ROUND_BITS_TO_BYTES(numBits)(((numBits) / 8) + (((numBits) % 8) ? 1 : 0)) + +#define DEX_FLAGS_NO (ROUND_BITS_TO_BYTES(POKEMON_SLOTS_NUMBER)) +#define NUM_FLAG_BYTES (ROUND_BITS_TO_BYTES(FLAGS_COUNT)) + struct Coords8 { s8 x; @@ -153,8 +160,6 @@ struct Time /*0x04*/ s8 seconds; }; -#define DEX_FLAGS_NO ((POKEMON_SLOTS_NUMBER / 8) + ((POKEMON_SLOTS_NUMBER % 8) ? 1 : 0)) - struct Pokedex { /*0x00*/ u8 order; @@ -923,7 +928,7 @@ struct SaveBlock1 /*0x9CA*/ u8 trainerRematches[MAX_REMATCH_ENTRIES]; /*0xA30*/ struct ObjectEvent objectEvents[OBJECT_EVENTS_COUNT]; /*0xC70*/ struct ObjectEventTemplate objectEventTemplates[OBJECT_EVENT_TEMPLATES_COUNT]; - /*0x1270*/ u8 flags[FLAGS_COUNT]; + /*0x1270*/ u8 flags[NUM_FLAG_BYTES]; /*0x139C*/ u16 vars[VARS_COUNT]; /*0x159C*/ u32 gameStats[NUM_GAME_STATS]; /*0x169C*/ struct BerryTree berryTrees[BERRY_TREES_COUNT]; @@ -960,7 +965,7 @@ struct SaveBlock1 /*0x2E20*/ u8 additionalPhrases[8]; // bitfield for 33 additional phrases in easy chat system /*0x2E28*/ OldMan oldMan; /*0x2e64*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff - /*0x2e90*/ struct ContestWinner contestWinners[13]; // 0 - 5 used in contest hall, 6 - 7 unused?, 8 - 12 museum + /*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_* /*0x3030*/ struct DayCare daycare; /*0x3150*/ struct LinkBattleRecords linkBattleRecords; /*0x31A8*/ u8 giftRibbons[52]; @@ -974,7 +979,7 @@ struct SaveBlock1 /*0x3B24*/ u8 seen2[DEX_FLAGS_NO]; /*0x3B58*/ LilycoveLady lilycoveLady; /*0x3B98*/ struct TrainerNameRecord trainerNameRecords[20]; - /*0x3C88*/ u8 unk3C88[10][21]; + /*0x3C88*/ u8 registeredTexts[UNION_ROOM_KB_ROW_COUNT][21]; /*0x3D5A*/ u8 filler3D5A[0xA]; /*0x3D64*/ struct SaveTrainerHill trainerHill; /*0x3D70*/ struct WaldaPhrase waldaPhrase; |