diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2021-12-01 16:33:06 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-01 14:33:06 -0800 |
commit | 4fc272fea6bc7332fae031ebeb12362cff1c35de (patch) | |
tree | 88092c6da3a6bb741caceab54f5372aee4ad5bae /include | |
parent | fd8720b75c56ef3f641e6c5abf6c446929c824b9 (diff) |
No wifi + 2 days on train = more decomp (#80)
* No wifi + 2 days on train = more decomp
* layin some more
* one func, one file
Diffstat (limited to 'include')
-rw-r--r-- | include/constants/iq_skill.h | 1 | ||||
-rw-r--r-- | include/constants/wonder_mail.h | 9 | ||||
-rw-r--r-- | include/dungeon_entity.h | 3 | ||||
-rw-r--r-- | include/dungeon_global_data.h | 3 | ||||
-rw-r--r-- | include/exclusive_pokemon.h | 3 | ||||
-rw-r--r-- | include/item.h | 1 | ||||
-rw-r--r-- | include/map.h | 17 | ||||
-rw-r--r-- | include/memory.h | 30 | ||||
-rw-r--r-- | include/wonder_mail.h | 62 |
9 files changed, 81 insertions, 48 deletions
diff --git a/include/constants/iq_skill.h b/include/constants/iq_skill.h index f36cee0..8e5809c 100644 --- a/include/constants/iq_skill.h +++ b/include/constants/iq_skill.h @@ -3,6 +3,7 @@ enum IQSkill { + IQ_SKILL_NONE = 0x0, IQ_SKILL_TYPE_ADVANTAGE_MASTER = 0x1, IQ_SKILL_ITEM_CATCHER = 0x2, IQ_SKILL_COURSE_CHECKER = 0x3, diff --git a/include/constants/wonder_mail.h b/include/constants/wonder_mail.h index 7ddaac7..c9626ae 100644 --- a/include/constants/wonder_mail.h +++ b/include/constants/wonder_mail.h @@ -1,15 +1,6 @@ #ifndef GUARD_CONSTANTS_WONDER_MAIL_H #define GUARD_CONSTANTS_WONDER_MAIL_H -enum MissionType -{ - HELP_POKE, - FIND_POKE, - ESCORT, - FIND_ITEM, - DELIVER_ITEM -}; - enum RewardType { MONEY, diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index 7b56fd8..63c85d6 100644 --- a/include/dungeon_entity.h +++ b/include/dungeon_entity.h @@ -187,7 +187,8 @@ struct DungeonEntityData u8 fill149[0x14E - 0x149]; /* 0x14E */ u16 visualFlags; /* 0x150 */ u16 previousVisualFlags; - u8 fill152[0x15C - 0x152]; + /* 0x152 */ u8 unk152; + u8 fill153[0x15C - 0x153]; u8 unk15C; u8 unk15D; u8 unk15E; diff --git a/include/dungeon_global_data.h b/include/dungeon_global_data.h index 4d8883f..254a195 100644 --- a/include/dungeon_global_data.h +++ b/include/dungeon_global_data.h @@ -40,7 +40,8 @@ struct DungeonGlobalData u16 unk66A; u8 fill66C[0x671 - 0x66C]; /* 0x671 */ bool8 monsterHouseActive; - u8 fill672[0x363C - 0x672]; + /* 0x672 */ u8 unk672; + u8 fill673[0x363C - 0x673]; /* 0x363C */ u8 expYieldRankings[NUM_SPECIES]; u8 fill37E3[0x37FC - 0x37D9]; /* 0x37FC */ bool8 decoyActive; diff --git a/include/exclusive_pokemon.h b/include/exclusive_pokemon.h index 3fd09ea..17bb8ef 100644 --- a/include/exclusive_pokemon.h +++ b/include/exclusive_pokemon.h @@ -14,7 +14,7 @@ struct ExclusivePokemonData { u8 fill0[0x48]; u32 unk48[4]; - bool8 Exclusives[NUM_EXCLUSIVE_POKEMON]; + /* 0x58 */ bool8 Exclusives[NUM_EXCLUSIVE_POKEMON]; }; #define RED_EXCLUSIVE(species) \ @@ -36,5 +36,6 @@ extern struct ExclusivePokemonData *gUnknown_203B498; void LoadExclusivePokemon(void); struct ExclusivePokemonData *GetExclusivePokemon(void); void InitializeExclusivePokemon(void); +void UnlockExclusivePokemon(s16 pokeID); #endif // GUARD_EXCLUSIVE_POKEMON_H diff --git a/include/item.h b/include/item.h index 60a9014..5da4c67 100644 --- a/include/item.h +++ b/include/item.h @@ -114,6 +114,7 @@ void MoveToStorage(struct ItemSlot* slot); void FillInventoryGaps(); bool8 sub_8091274(struct HeldItem* slot); bool8 IsNotMoneyOrUsedTMItem(u8 id); +s32 FindItemInInventory(u8 itemIndex); void RestoreHeldItem(struct unkStruct_8094924*, struct HeldItem*); diff --git a/include/map.h b/include/map.h index d3d1ed9..a0a5660 100644 --- a/include/map.h +++ b/include/map.h @@ -5,11 +5,24 @@ #define MAX_ROOM_COUNT 24 // Empirical max, not sure if the code supports any more. -struct MapTile + +struct MapTileBitFlagStair { /* 0x0 */ u8 tileFlags; /* 0x1 */ bool8 stairs; - u8 fill2[0x9 - 0x2]; +}; + +struct MapTile +{ + // TODO: can we get rid of the union... is tileFlags a u16 only? + union MapTileUnion + { + struct MapTileBitFlagStair unk0; + u16 tileFlags_u16; + } MapTileUnion; + u16 unk4; + u16 unk6; + u8 unk8; /* 0x9 */ u8 roomIndex; // Bitwise flags for whether Pokémon can move to an adjacent tile. Bits correspond to directions in direction.h. // Different sets of flags are used for Pokémon that can cross special terrain. diff --git a/include/memory.h b/include/memory.h index ef99757..1c8a61b 100644 --- a/include/memory.h +++ b/include/memory.h @@ -5,33 +5,33 @@ struct HeapSettings { - u8 *start; - u32 size; + /* 0x0 */ u8 *start; + /* 0x4 */ u32 size; }; struct HeapMemoryBlock { - u8 *start; - s32 size; - s32 allocatedSize; + /* 0x0 */ u8 *start; + /* 0x4 */ s32 size; + /* 0x8 */ s32 allocatedSize; }; struct HeapFreeListElement { - u32 unk_atb; - u32 atb; - u32 grp; - struct HeapMemoryBlock block; + /* 0x0 */ u32 unk_atb; + /* 0x4 */ u32 atb; + /* 0x8 */ u32 grp; + /* 0xC */ struct HeapMemoryBlock block; }; struct HeapDescriptor { u32 unk0; - struct HeapDescriptor *parentHeap; - struct HeapFreeListElement *freeList; - s32 freeCount; - u32 freeListLength; - u8 *start; - u32 size; + /* 0x4 */ struct HeapDescriptor *parentHeap; + /* 0x8 */ struct HeapFreeListElement *freeList; + /* 0xC */ s32 freeCount; + /* 0x10 */ u32 freeListLength; + /* 0x14 */ u8 *start; + /* 0x18 */ u32 size; }; void InitHeap(void); diff --git a/include/wonder_mail.h b/include/wonder_mail.h index b89ce6e..155c780 100644 --- a/include/wonder_mail.h +++ b/include/wonder_mail.h @@ -44,9 +44,9 @@ struct WonderMail struct WonderMailStruct_203B2C0 { // size: 0x548 - u32 unk0; - u32 state; - u8 passwordBuffer[PASSWORD_BUFFER_SIZE]; + /* 0x0 */ u32 fallbackState; + /* 0x4 */ u32 state; + /* 0x8 */ u8 passwordBuffer[PASSWORD_BUFFER_SIZE]; u8 unk3E; u32 unk40; u32 linkError; @@ -67,9 +67,9 @@ struct WonderMailStruct_203B2C0 u8 padding8[0x4C]; struct UnkTextStruct2 unk35C[4]; struct UnkTextStruct2 unk3BC[4]; - u32 unkfill; // unkStruct_41C? - struct OpenedFile *faceFile; - u8 *faceData; + /* 0x41C */ u32 unkfill; // ItemSlot? + /* 0x420 */ struct OpenedFile *faceFile; + /* 0x424 */ u8 *faceData; u16 unk428; u16 unk42A; u8 unk42C; @@ -87,12 +87,12 @@ struct WonderMailStruct_203B2C0 struct WonderMailStruct_203B2C4 { // size: 0x564 - u8 state; - u32 unk4; // wonder mail link status?? - u8 passwordBuffer[PASSWORD_BUFFER_SIZE]; // Probably a buffer for entry + /* 0x0 */ u8 state; + /* 0x4 */ u32 fallbackState; // wonder mail link status?? + /* 0x8 */ u8 passwordBuffer[PASSWORD_BUFFER_SIZE]; // Probably a buffer for entry u8 unk3E; u32 unk40; - u32 linkError; // another link status + /* 0x44 */ u32 linkError; // another link status u8 filler48[0x1B8 - 0x48]; struct unkStruct_8095228 unk1B8; struct unkStruct_8095228 unk1E8; @@ -112,9 +112,9 @@ struct WonderMailStruct_203B2C4 u8 unk42D; u8 unk42E; u32 unk430; - u8 formattedString[0x100]; - s32 wonderMailMethod; - u32 wonderMailMode; + /* 0x434 */ u8 formattedString[0x100]; + /* 0x534 */ s32 wonderMailMethod; + /* 0x538 */ u32 wonderMailMode; struct unkStruct_802F204 unk53C; }; @@ -126,17 +126,41 @@ enum WonderMailMode { }; enum WonderMailMethod { - WONDER_MAIL_GAME_LINK = 3, - WONDER_MAIL_PASSWORD = 5, + WONDER_MAIL_GAME_LINK = 3, + WONDER_MAIL_PASSWORD = 5, }; enum WonderMailTypes { - WONDER_MAIL_TYPE_SOS = 1, - WONDER_MAIL_TYPE_AOK = 4, - WONDER_MAIL_TYPE_THANK_YOU = 5, - WONDER_MAIL_TYPE_WONDER = 5, + WONDER_MAIL_TYPE_SOS = 1, + WONDER_MAIL_TYPE_AOK = 4, + WONDER_MAIL_TYPE_THANK_YOU = 5, + WONDER_MAIL_TYPE_WONDER = 5, + // TODO: document 7 }; +enum WonderMailMissionTypes +{ + WONDER_MAIL_MISSION_TYPE_RESCUE_CLIENT = 0, + WONDER_MAIL_MISSION_TYPE_RESCUE_TARGET = 1, + WONDER_MAIL_MISSION_TYPE_ESCORT_CLIENT = 2, + WONDER_MAIL_MISSION_TYPE_FIND_ITEM = 3, + WONDER_MAIL_MISSION_TYPE_DELIVER_ITEM = 4, +}; +enum WonderMailErrorMode { + WONDER_MAIL_GOOD = 0, + // TODO: document 1 + WONDER_MAIL_NO_RESPONSE = 2, + WONDER_MAIL_INCORRECT_NUM_SYSTEMS = 3, + WONDER_MAIL_DIFFERENT_MODES = 4, + // TODO: document 5 + WONDER_MAIL_NO_ROOM_STORAGE = 6, + WONDER_MAIL_DUPLICATE_MAIL = 7, + WONDER_MAIL_NOT_ELIGIBLE_1 = 9, + WONDER_MAIL_NOT_ELIGIBLE_2 = 11, + WONDER_MAIL_NO_ROOM_MAIL = 13, + // TODO: document 14 + WONDER_MAIL_NOT_READY = 15, +}; #endif |