diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 1 | ||||
-rw-r--r-- | include/constants/pokemon.h | 2 | ||||
-rw-r--r-- | include/daycare.h | 4 | ||||
-rw-r--r-- | include/global.h | 4 | ||||
-rw-r--r-- | include/mail.h | 58 | ||||
-rw-r--r-- | include/pokedex.h | 114 | ||||
-rw-r--r-- | include/pokemon.h | 4 | ||||
-rw-r--r-- | include/seals.h | 15 | ||||
-rw-r--r-- | include/unk_02087A1C.h | 5 |
9 files changed, 127 insertions, 80 deletions
diff --git a/include/config.h b/include/config.h index 7b75cd06..c32220d0 100644 --- a/include/config.h +++ b/include/config.h @@ -16,6 +16,7 @@ #define LANGUAGE_GERMAN 5 #define LANGUAGE_SPANISH 7 #define LANGUAGE_KOREAN 8 +#define LANGUAGE_COUNT LANGUAGE_KOREAN #ifdef DIAMOND #define GAME_VERSION VERSION_DIAMOND diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 123b144b..2c9288f5 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -282,7 +282,7 @@ #define MON_DATA_SPEED 166 #define MON_DATA_SPATK 167 #define MON_DATA_SPDEF 168 -#define MON_DATA_SEAL_STRUCT 169 +#define MON_DATA_MAIL_STRUCT 169 #define MON_DATA_SEAL_COORDS 170 #define MON_DATA_SPECIES_EXISTS 171 #define MON_DATA_SANITY_IS_EGG 172 diff --git a/include/daycare.h b/include/daycare.h index d1026f76..98cf0880 100644 --- a/include/daycare.h +++ b/include/daycare.h @@ -3,7 +3,7 @@ struct DayCareMail { - struct SealStruct seal; + struct Mail seal; u16 ot_name[OT_NAME_LENGTH + 1]; u16 nickname[POKEMON_NAME_LENGTH + 1]; u8 padding_5E[2]; @@ -30,7 +30,7 @@ struct DayCareMon * Sav2_DayCare_GetMonX(struct DayCare * daycare, s32 i); struct BoxPokemon * DayCareMon_GetBoxMon(struct DayCareMon * dcmon); struct DayCareMail * DayCareMon_GetExtras(struct DayCareMon * dcmon); u32 DayCareMon_GetSteps(struct DayCareMon * dcmon); -struct SealStruct * DayCareMail_GetCapsule(struct DayCareMail * dcmail); +struct Mail * DayCareMail_GetCapsule(struct DayCareMail * dcmail); u32 Sav2_DayCare_GetEggPID(struct DayCare * daycare); u8 Sav2_DayCare_GetEggCycleCounter(struct DayCare * daycare); void DayCareMon_SetSteps(struct DayCareMon * dcmon, u32 steps); diff --git a/include/global.h b/include/global.h index 24e4388b..3b377e5e 100644 --- a/include/global.h +++ b/include/global.h @@ -15,7 +15,9 @@ extern void ErrorHandling(void); #define GF_ASSERT(expr) do {if (!(expr)) ErrorHandling();} while (0) -extern const int gGameLanguage; +#ifndef IN_MAIN_C +extern const u8 gGameLanguage; extern const u8 gGameVersion; +#endif //IN_MAIN_C #endif //GUARD_GLOBAL_H diff --git a/include/mail.h b/include/mail.h new file mode 100644 index 00000000..47d8a777 --- /dev/null +++ b/include/mail.h @@ -0,0 +1,58 @@ +#ifndef POKEDIAMOND_SEALS_H +#define POKEDIAMOND_SEALS_H + +#include "save_block_2.h" + +union MailMessage +{ + u16 raw; + struct { + u16 unk_0:12; + u16 unk_C:4; + } bits; +}; + +struct Mail +{ + u32 author_otId; // author otid + u8 author_gender; // author gender + u8 author_language; // language + u8 author_version; // version + u8 mail_type; // mail type + u16 author_name[OT_NAME_LENGTH + 1]; // author name + union MailMessage unk_18[3]; + u8 padding_1E[2]; + u16 unk_20[3][4]; +}; + +struct Mail * Mail_new(u32 heap_id); + +void Mail_init(struct Mail * mail); +BOOL Mail_TypeIsValid(struct Mail * mail); +struct Mail * Mail_new(u32 heap_id); +void Mail_copy(const struct Mail * src, struct Mail * dest); +void Mail_SetNewMessageDetails(struct Mail * mail, u8 type, u8 monIdx, struct SaveBlock2 * sav2); +u32 Mail_GetOTID(struct Mail * mail); +u16 * Mail_GetAuthorNamePtr(struct Mail * mail); +u8 Mail_GetAuthorGender(struct Mail * mail); +u8 Mail_GetType(struct Mail * mail); +void Mail_SetType(struct Mail * mail, u8 type); +u8 Mail_GetLanguage(struct Mail * mail); +u8 Mail_GetVersion(struct Mail * mail); +u16 Mail_GetAttrFromUnk18Array(struct Mail * mail, u32 idx, u32 attr); +u16 * Mail_GetUnk20Array(struct Mail * mail, u32 idx); +void Mail_CopyToUnk20Array(struct Mail * mail, const u16 * src, u32 idx); +struct Mail * Sav2_Mailbox_get(struct SaveBlock2 * sav2); +u32 Sav2_Mailbox_sizeof(void); +void Sav2_Mailbox_init(struct Mail * mail); +s32 Mailbox_GetFirstEmptySlotIdx(struct Mail * mail, BOOL r1); +void Mailbox_DeleteSlotI(struct Mail * mail, BOOL r1, s32 idx); +void Mailbox_CopyMailToSlotI(struct Mail * mail, BOOL r1, s32 idx, const struct Mail * src); +s32 Mailbox_CountMessages(struct Mail * mail, BOOL r1); +struct Mail * Mailbox_AllocAndFetchMailI(struct Mail * mail, BOOL r1, s32 idx, u32 heap_id); +void Mailbox_FetchMailIToBuffer(struct Mail * mail, BOOL r1, s32 idx, struct Mail * dest); +s32 MailArray_GetFirstEmptySlotIdx(struct Mail * mail, s32 count); +s32 MailArray_CountMessages(struct Mail * mail, s32 count); +struct Mail * Mailbox_GetPtrToSlotI(struct Mail * mail, BOOL r1, s32 idx); + +#endif //POKEDIAMOND_SEALS_H diff --git a/include/pokedex.h b/include/pokedex.h index 61c051da..11058569 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -6,81 +6,81 @@ struct Pokedex { /* 0x0000 */ u32 magic; // BEEFCAFE - /* 0x0004 */ u8 field_0004[0x3C]; - /* 0x0040 */ u32 field_0040; // Deoxys forme plus top 13 dex flags - /* 0x0044 */ u8 field_0044[0x3C]; - /* 0x0080 */ u32 field_0080; // Deoxys forme plus top 13 dex flags + /* 0x0004 */ u8 caughtFlags[0x3C]; + /* 0x0040 */ u32 caughtFlagsHi_Deoxys1; // Deoxys forme plus top 13 dex flags + /* 0x0044 */ u8 seenFlags[0x3C]; + /* 0x0080 */ u32 seenFlagsHi_Deoxys2; // Deoxys forme plus top 13 dex flags /* 0x0084 */ u8 field_0084[0x40]; // Genders /* 0x00C4 */ u8 field_00C4[0x40]; // Genders - /* 0x0104 */ u32 field_0104; // spinda personality - /* 0x0108 */ u8 field_0108[2]; // Shellos/Gastrodon - /* 0x0108 */ u8 field_010A[2]; // Burmy/Wormadam - /* 0x010C */ u8 field_010C[28]; // Unown + /* 0x0104 */ u32 spindaPersonality; // spinda personality + /* 0x0108 */ u8 shellosGastrodon[2]; // Shellos/Gastrodon + /* 0x0108 */ u8 burmyWormadam[2]; // Burmy/Wormadam + /* 0x010C */ u8 seenUnown[28]; // Unown /* 0x0128 */ u8 field_0128; - /* 0x0129 */ u8 field_0129[14]; // Meister? + /* 0x0129 */ u8 meister[14]; // Meister? /* 0x0137 */ u8 field_0137; - /* 0x0138 */ u8 field_0138; - /* 0x0139 */ u8 field_0139; + /* 0x0138 */ u8 unlockedSinnohDex; + /* 0x0139 */ u8 unlockedNationalDex; /* 0x013A */ u8 padding_013A[2]; }; u32 Sav2_Pokedex_sizeof(void); struct Pokedex * Sav2_Pokedex_new(u32 heap_id); void Sav2_Pokedex_Copy(const struct Pokedex * src, struct Pokedex * dest); -s32 FUN_02023D8C(struct Pokedex * pokedex, u32 species); -BOOL FUN_02023DEC(struct Pokedex * pokedex, u32 species, u8 state); -void FUN_02023E70(struct Pokedex * pokedex, u32 species, u32 state); -s32 FUN_02023F2C(struct Pokedex * pokedex, u32 species); -BOOL FUN_02023F88(struct Pokedex * pokedex, u32 species, u8 state); -void FUN_02023FEC(struct Pokedex * pokedex, u32 species, s32 state); -void FUN_02024068(struct Pokedex * pokedex, u8 r4, u8 r6); -s32 FUN_020240D0(struct Pokedex * pokedex); -BOOL FUN_02024114(struct Pokedex * pokedex, u32 state); -void FUN_0202415C(struct Pokedex * pokedex, u16 species, struct Pokemon * pokemon); -void FUN_0202419C(struct Pokedex * pokedex); -void FUN_020241B8(struct Pokedex * pokedex, u16 species, struct Pokemon * pokemon); -void FUN_02024294(struct Pokedex * pokedex, u32 species, u32 language); +s32 Pokedex_CountSeenShellosOrGastrodon_Internal(struct Pokedex * pokedex, u32 species); +BOOL Pokedex_HasSeenShellosOrGastrodonForme(struct Pokedex * pokedex, u32 species, u8 state); +void Pokedex_SetSeenShellosOrGastrodonForme(struct Pokedex * pokedex, u32 species, u32 state); +s32 Pokedex_CountSeenBurmyOrWormadam_Internal(struct Pokedex * pokedex, u32 species); +BOOL Pokedex_HasSeenBurmyOrWormadamForme(struct Pokedex * pokedex, u32 species, u8 state); +void Pokedex_SetSeenBurmyOrWormadamForme(struct Pokedex * pokedex, u32 species, s32 state); +void Pokedex_SetSeenDeoxysFormeAt(struct Pokedex * pokedex, u8 r4, u8 r6); +s32 Pokedex_CountSeenDeoxysFormes_Internal(struct Pokedex * pokedex); +BOOL Pokedex_HasSeenDeoxysForme(struct Pokedex * pokedex, u32 state); +void Pokedex_TrySetSeenDeoxysForme(struct Pokedex * pokedex, u16 species, struct Pokemon * pokemon); +void Pokedex_InitSeenDeoxysFormesArray(struct Pokedex * pokedex); +void Pokedex_SetMonSeenForme(struct Pokedex * pokedex, u16 species, struct Pokemon * pokemon); +void Pokedex_SetMeisterFlagBySpeciesAndLanguage(struct Pokedex * pokedex, u32 species, u32 language); s32 FUN_020242C8(struct Pokedex * pokedex, u16 species, s32 r4); -BOOL FUN_02024340(u16 species); -BOOL FUN_02024364(u16 a0); +BOOL Pokedex_SpeciesIsNotMythical(u16 species); +BOOL Pokedex_SpeciesIsNotSinnohMythical(u16 species); void Sav2_Pokedex_init(struct Pokedex * pokedex); -u16 FUN_020243C8(struct Pokedex * pokedex); -u16 FUN_02024404(struct Pokedex * pokedex); -u16 FUN_02024440(struct Pokedex * pokedex); -u16 FUN_0202445C(struct Pokedex * pokedex); -u16 FUN_020244A4(struct Pokedex * pokedex); -BOOL FUN_020244EC(struct Pokedex * pokedex); -BOOL FUN_02024504(struct Pokedex * pokedex); -u16 FUN_02024518(struct Pokedex * pokedex); -u16 FUN_02024550(struct Pokedex * pokedex); -BOOL FUN_02024594(struct Pokedex * pokedex, u16 species); -BOOL FUN_020245F0(struct Pokedex * pokedex, u16 species); -u32 FUN_02024648(struct Pokedex * pokedex, u32 a1); +u16 Pokedex_CountNationalDexCaughtMons(struct Pokedex * pokedex); +u16 Pokedex_CountNationalDexSeenMons(struct Pokedex * pokedex); +u16 Pokedex_CountSeenMons(struct Pokedex * pokedex); +u16 Pokedex_CountSinnohDexCaughtMons(struct Pokedex * pokedex); +u16 Pokedex_CountSinnohDexSeenMons(struct Pokedex * pokedex); +BOOL Pokedex_HasCompletedNationalDex(struct Pokedex * pokedex); +BOOL Pokedex_HasCompletedSinnohDex(struct Pokedex * pokedex); +u16 Pokedex_CountNationalDexCaughtMons_OmitMythicals(struct Pokedex * pokedex); +u16 Pokedex_CountSinnohDexSeenMons_OmitMythicals(struct Pokedex * pokedex); +BOOL Pokedex_CheckMonCaughtFlag(struct Pokedex * pokedex, u16 species); +BOOL Pokedex_CheckMonSeenFlag(struct Pokedex * pokedex, u16 species); +u32 Pokedex_GetSeenSpindaPersonality(struct Pokedex * pokedex, u32 a1); s32 FUN_02024674(struct Pokedex * pokedex, u16 species, s32 r6); -s32 FUN_020246DC(struct Pokedex * pokedex, s32 a1); -s32 FUN_0202471C(struct Pokedex * pokedex); -BOOL FUN_02024748(struct Pokedex * pokedex, s32 a1); -s32 FUN_020247A4(struct Pokedex * pokedex); -BOOL FUN_020247C8(struct Pokedex * pokedex, s32 a1); -s32 FUN_02024828(struct Pokedex * pokedex); -s32 FUN_0202484C(struct Pokedex * pokedex, s32 a1); -s32 FUN_0202489C(struct Pokedex * pokedex); -s32 FUN_020248BC(struct Pokedex * pokedex, s32 a1); -s32 FUN_0202490C(struct Pokedex * pokedex); -s32 FUN_02024930(struct Pokedex * pokedex, s32 a1); -s32 FUN_02024970(struct Pokedex * pokedex); -void FUN_0202498C(struct Pokedex * pokedex, struct Pokemon * pokemon); -void FUN_02024AF0(struct Pokedex * pokedex, struct Pokemon * pokemon); +s32 Pokedex_GetSeenUnownI(struct Pokedex * pokedex, s32 a1); +s32 Pokedex_CountSeenUnown(struct Pokedex * pokedex); +BOOL Pokedex_GetSeenShellosForme(struct Pokedex * pokedex, s32 a1); +s32 Pokedex_CountSeenShellos(struct Pokedex * pokedex); +BOOL Pokedex_GetSeenGastrodonForme(struct Pokedex * pokedex, s32 a1); +s32 Pokedex_CountSeenGastrodon(struct Pokedex * pokedex); +s32 Pokedex_GetSeenBurmyForme(struct Pokedex * pokedex, s32 a1); +s32 Pokedex_CountSeenBurmy(struct Pokedex * pokedex); +s32 Pokedex_GetSeenWormadamForme(struct Pokedex * pokedex, s32 a1); +s32 Pokedex_CountSeenWormadam(struct Pokedex * pokedex); +s32 Pokedex_GetSeenDeoxysForme(struct Pokedex * pokedex, s32 a1); +s32 Pokedex_CountSeenDeoxys(struct Pokedex * pokedex); +void Pokedex_SetMonSeenFlag(struct Pokedex * pokedex, struct Pokemon * pokemon); +void Pokedex_SetMonCaughtFlag(struct Pokedex * pokedex, struct Pokemon * pokemon); void Pokedex_SetNatDexFlag(struct Pokedex * pokedex); BOOL Pokedex_GetNatDexFlag(struct Pokedex * pokedex); BOOL FUN_02024CC4(struct Pokedex * pokedex); void FUN_02024CE0(struct Pokedex * pokedex); -s32 FUN_02024D00(struct Pokedex * pokedex, u32 species, u32 language); +s32 Pokedex_GetMeisterFlagBySpeciesAndLanguage(struct Pokedex * pokedex, u32 species, u32 language); void FUN_02024D4C(struct Pokedex * pokedex); BOOL FUN_02024D58(struct Pokedex * pokedex); -BOOL FUN_02024D64(struct Pokedex * pokedex); -void FUN_02024D80(struct Pokedex * pokedex); -struct Pokedex * FUN_02024DA0(struct SaveBlock2 * sav2); -s32 FUN_02024DAC(struct Pokedex * pokedex, s32 a1, u32 a2); +BOOL Pokedex_GetSinnohDexFlag(struct Pokedex * pokedex); +void Pokedex_SetSinnohDexFlag(struct Pokedex * pokedex); +struct Pokedex * Sav2_Pokedex_get(struct SaveBlock2 * sav2); +s32 Pokedex_GetSeenMonForme(struct Pokedex * pokedex, s32 a1, u32 a2); #endif //POKEDIAMOND_POKEDEX_H diff --git a/include/pokemon.h b/include/pokemon.h index 196343de..097df9e0 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -6,7 +6,7 @@ // Enums #include "constants/species.h" -#include "seals.h" +#include "mail.h" #include "constants/pokemon.h" #include "string16.h" #include "player_data.h" @@ -142,7 +142,7 @@ struct PartyPokemon /* 0x096 */ u16 speed; /* 0x098 */ u16 spatk; /* 0x09A */ u16 spdef; - /* 0x09C */ struct SealStruct seal_something; // a struct? + /* 0x09C */ struct Mail seal_something; // a struct? /* 0x0D4 */ u8 sealCoords[0x18]; // u8 pairs? }; diff --git a/include/seals.h b/include/seals.h deleted file mode 100644 index 8fda23b9..00000000 --- a/include/seals.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef POKEDIAMOND_SEALS_H -#define POKEDIAMOND_SEALS_H - -struct SealStruct -{ - // TODO: define - u8 filler_00[0x38]; -}; - -struct SealStruct * CreateNewSealsObject(u32 heap_id); - -void CopySealsObject(const struct SealStruct *, struct SealStruct *); -void FUN_02029C74(const u8 *, u8 *); - -#endif //POKEDIAMOND_SEALS_H diff --git a/include/unk_02087A1C.h b/include/unk_02087A1C.h index 28155209..f19b3c93 100644 --- a/include/unk_02087A1C.h +++ b/include/unk_02087A1C.h @@ -1,7 +1,8 @@ #ifndef POKEDIAMOND_UNK_02087A1C_H #define POKEDIAMOND_UNK_02087A1C_H -s32 FUN_02087A50(u32 species); -s32 FUN_02087A1C(u32 language); +s32 GetMeisterLanguageIdx(u32 language); +u8 GetMeisterLanguage(s32 idx); +s32 GetMeisterSpeciesIdx(u32 species); #endif //POKEDIAMOND_UNK_02087A1C_H |