diff options
Diffstat (limited to 'include/global.h')
-rw-r--r-- | include/global.h | 80 |
1 files changed, 56 insertions, 24 deletions
diff --git a/include/global.h b/include/global.h index b35008550..b92f1097f 100644 --- a/include/global.h +++ b/include/global.h @@ -61,8 +61,6 @@ #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) >= (b) ? (a) : (b)) -#define HEAP_SIZE 0x1C000 - extern u8 gStringVar1[]; extern u8 gStringVar2[]; extern u8 gStringVar3[]; @@ -86,6 +84,11 @@ extern u8 gStringVar4[]; #define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) +// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. +// In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen. +// In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------". +// Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh". +// In Gen 4 and up, migrated Pokemon with HeartGold or SoulSilver's ID show the otherwise unused "Johto" string. enum { VERSION_SAPPHIRE = 1, @@ -93,6 +96,12 @@ enum VERSION_EMERALD = 3, VERSION_FIRE_RED = 4, VERSION_LEAF_GREEN = 5, + VERSION_HEART_GOLD = 7, + VERSION_SOUL_SILVER = 8, + VERSION_DIAMOND = 10, + VERSION_PEARL = 11, + VERSION_PLATINUM = 12, + VERSION_GAMECUBE = 15, }; enum LanguageId @@ -167,12 +176,14 @@ enum OPTIONS_BATTLE_STYLE_SET }; -struct Coords8 { +struct Coords8 +{ s8 x; s8 y; }; -struct UCoords8 { +struct UCoords8 +{ u8 x; u8 y; }; @@ -284,11 +295,25 @@ struct UnknownSaveBlock2Struct u8 field_EB; }; // sizeof = 0xEC -struct UnkRecordMixingStruct +struct ApprenticeMon { - u8 field_0[0x34]; + u16 species; + u16 moves[4]; + u16 item; +}; + +struct Apprentice +{ + u8 id:5; + u8 lvlMode:2; // + 1 + u8 field_1; + u8 number; + struct ApprenticeMon monData[3]; + u16 easyChatWords[6]; u8 playerId[4]; - u8 field_38[10]; + u8 playerName[PLAYER_NAME_LENGTH]; + u8 language; + u32 unk40; }; struct UnknownPokemonStruct @@ -455,6 +480,28 @@ struct BattleFrontier /*0xEFC*/ struct FrontierMonData field_EFC[3]; }; +struct Sav2_B8 +{ + u8 unk0_0:2; + u8 unk0_1:2; + u8 unk0_2:2; + u8 unk0_3:2; + u16 unk2; +}; + +struct PlayersApprentice +{ + /*0xB0*/ u8 id; + /*0xB1*/ u8 activeLvlMode:2; // +1, 0 means not active + /*0xB1*/ u8 field_B1_1:4; + /*0xB1*/ u8 field_B1_2:2; + /*0xB2*/ u8 field_B2_0:3; + /*0xB2*/ u8 field_B2_1:2; + /*0xB3*/ u8 field_B3; + /*0xB4*/ u8 monIds[3]; + /*0xB8*/ struct Sav2_B8 field_B8[9]; +}; + struct SaveBlock2 { /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; @@ -478,14 +525,8 @@ struct SaveBlock2 /*0xA0*/ struct Time lastBerryTreeUpdate; /*0xA8*/ u32 field_A8; /*0xAC*/ u32 encryptionKey; - - // TODO: fix and verify labels - /*0xB0*/ u8 field_B0; - /*0xB1*/ u8 field_B1; - /*0xB2*/ u8 field_B2_0:3; - /*0xB2*/ u8 field_B2_1:2; - /*0xB3*/ u8 field_B3[0x29]; - /*0xDC*/ struct UnkRecordMixingStruct field_DC[4]; + /*0xB0*/ struct PlayersApprentice playerApprentice; + /*0xDC*/ struct Apprentice apprentices[4]; /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpResults pokeJump; /*0x20C*/ struct BerryPickingResults berryPick; @@ -935,13 +976,4 @@ struct UnkStruct_8054FF8 u16 field_C; }; -struct Bitmap // TODO: Find a better spot for this -{ - u8* pixels; - u32 width:16; - u32 height:16; -}; - -extern u8 gReservedSpritePaletteCount; - #endif // GUARD_GLOBAL_H |