diff options
Diffstat (limited to 'include')
-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/pokemon.h | 4 | ||||
-rw-r--r-- | include/seals.h | 15 |
6 files changed, 66 insertions, 21 deletions
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/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 |