diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/global.h | 16 | ||||
-rw-r--r-- | include/link_rfu.h | 2 | ||||
-rw-r--r-- | include/menu_specialized.h | 6 | ||||
-rwxr-xr-x | include/mevent.h | 18 | ||||
-rw-r--r-- | include/mevent_801BAAC.h | 4 | ||||
-rw-r--r-- | include/mevent_client.h | 33 | ||||
-rw-r--r-- | include/mevent_server.h | 28 | ||||
-rw-r--r-- | include/mevent_server_helpers.h | 38 | ||||
-rw-r--r-- | include/mevent_server_ish.h | 10 | ||||
-rw-r--r-- | include/naming_screen.h | 2 | ||||
-rw-r--r-- | include/script.h | 6 | ||||
-rw-r--r-- | include/strings.h | 2 | ||||
-rw-r--r-- | include/util.h | 4 |
13 files changed, 130 insertions, 39 deletions
diff --git a/include/global.h b/include/global.h index 0506c036e..7b570d72e 100644 --- a/include/global.h +++ b/include/global.h @@ -816,7 +816,7 @@ struct MysteryEventStruct u8 unk_1; }; - struct MEventBuffer_3120_Sub + struct WonderNews { u16 unk_00; u8 unk_02; @@ -825,13 +825,13 @@ struct MysteryEventStruct u8 unk_2C[10][40]; }; - struct MEventBuffer_3120 + struct WonderNewsSaveStruct { u32 crc; - struct MEventBuffer_3120_Sub data; + struct WonderNews data; }; - struct MEventBuffer_32E0_Sub + struct WonderCard { u16 unk_00; u16 unk_02; @@ -847,10 +847,10 @@ struct MysteryEventStruct u8 unk_122[40]; }; - struct MEventBuffer_32E0 + struct WonderCardSaveStruct { u32 crc; - struct MEventBuffer_32E0_Sub data; + struct WonderCard data; }; struct MEventBuffer_3430_Sub @@ -870,8 +870,8 @@ struct MysteryEventStruct struct MEventBuffers { - /*0x000 0x322C*/ struct MEventBuffer_3120 buffer_000; - /*0x1c0 0x33EC*/ struct MEventBuffer_32E0 buffer_1c0; + /*0x000 0x322C*/ struct WonderNewsSaveStruct wonderNews; + /*0x1c0 0x33EC*/ struct WonderCardSaveStruct wonderCard; /*0x310 0x353C*/ struct MEventBuffer_3430 buffer_310; /*0x338 0x3564*/ u16 unk_338[4]; /*0x340 0x356C*/ struct MysteryEventStruct unk_340; diff --git a/include/link_rfu.h b/include/link_rfu.h index b8ba1a927..edfd0ed20 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -284,7 +284,7 @@ bool8 sub_800DE7C(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx); bool8 sub_800DF34(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx); s32 sub_800E87C(u8 idx); void sub_8011BA4(void); -void sub_8010198(void); +void LinkRfu_FatalError(void); bool32 sub_8011A9C(void); void sub_80104B0(void); void sub_8011A50(void); diff --git a/include/menu_specialized.h b/include/menu_specialized.h index d29ac5751..405d78830 100644 --- a/include/menu_specialized.h +++ b/include/menu_specialized.h @@ -32,8 +32,8 @@ u8 sub_81D1DC0(struct PlayerPCItemPageStruct *page); void sub_81D1E90(struct PlayerPCItemPageStruct *page); void sub_81D1EC0(void); void sub_81D1D04(u8 a0); -void DrawLevelUpWindowPg1(u16 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5); -void DrawLevelUpWindowPg2(u16 arg0, void* statStoreLocation1, u8 arg2, u8 arg3, u8 arg4); +void DrawLevelUpWindowPg1(u16 arg0, u16 *statStoreLocation1, u16 *statStoreLocation2, u8 arg3, u8 arg4, u8 arg5); +void DrawLevelUpWindowPg2(u16 arg0, u16 *statStoreLocation1, u8 arg2, u8 arg3, u8 arg4); void sub_81D1ED4(struct UnknownStruct_81D1ED4 *a0); void sub_81D2108(struct UnknownStruct_81D1ED4 *arg0); void sub_81D20AC(struct UnknownStruct_81D1ED4 *arg0); @@ -47,7 +47,7 @@ bool16 MoveRelearnerRunTextPrinters(void); void MoveRelearnerCreateYesNoMenu(void); u8 LoadMoveRelearnerMovesList(const struct ListMenuItem *items, u16 numChoices); void InitMoveRelearnerWindows(bool8 useContextWindow); -void GetMonLevelUpWindowStats(struct Pokemon* mon, void* statStoreLocation); +void GetMonLevelUpWindowStats(struct Pokemon *mon, u16 *statStoreLocation); s32 GetBoxOrPartyMonData(u16 boxId, u16 monId, s32 request, u8 *dst); void sub_81D2ED4(u8 *dst, u8 *nameDst, u16 boxId, u16 monId, u16 arg5, u16 arg6, bool8 arg7); void sub_81D2F78(struct UnknownStruct_81D1ED4 *arg0, u8 *sheen, u16 boxId, u16 monId, u16 arg5, u16 id, u16 arg7, bool8 arg8); diff --git a/include/mevent.h b/include/mevent.h index 9c5d559bf..a34ca355c 100755 --- a/include/mevent.h +++ b/include/mevent.h @@ -32,30 +32,30 @@ struct MEventStruct_Unk1442CC }; void sub_801AFD8(void); -struct MEventBuffer_3120_Sub *sav1_get_mevent_buffer_0(void); -struct MEventBuffer_32E0_Sub *sav1_get_mevent_buffer_1(void); +struct WonderNews *GetSavedWonderNews(void); +struct WonderCard *GetSavedWonderCard(void); struct MEventBuffer_3430_Sub *sav1_get_mevent_buffer_2(void); struct MysteryEventStruct *sub_801B044(void); u16 *sub_801B058(void); void DestroyWonderNews(void); -bool32 sub_801B078(const struct MEventBuffer_3120_Sub *src); +bool32 sub_801B078(const struct WonderNews *src); bool32 ValidateReceivedWonderNews(void); bool32 WonderNews_Test_Unk_02(void); bool32 sub_801B1A4(const u8 *src); void DestroyWonderCard(void); -bool32 sub_801B21C(const struct MEventBuffer_32E0_Sub *data); +bool32 sub_801B21C(const struct WonderCard *data); bool32 ValidateReceivedWonderCard(void); bool32 WonderCard_Test_Unk_08_6(void); u16 GetWonderCardFlagID(void); -void sub_801B3C0(struct MEventBuffer_32E0_Sub *buffer); +void WonderCard_ResetInternalReceivedFlag(struct WonderCard *buffer); bool32 CheckReceivedGiftFromWonderCard(void); bool32 sub_801B508(const u16 *data); void sub_801B580(struct MEventStruct_Unk1442CC *data, bool32 a1); bool32 sub_801B6A0(const struct MEventStruct_Unk1442CC *data, bool32 a1); -u32 sub_801B6EC(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, void *unused); -u32 sub_801B708(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, void *unused); -bool32 sub_801B748(const struct MEventStruct_Unk1442CC *a0, const u16 *a1); -u16 sub_801B784(const struct MEventStruct_Unk1442CC *a0, u32 command); +u32 sub_801B6EC(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, const void *unused); +u32 sub_801B708(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, const void *unused); +bool32 MEventStruct_Unk1442CC_CompareField_unk_16(const struct MEventStruct_Unk1442CC *a0, const u16 *a1); +u16 MEventStruct_Unk1442CC_GetValueNFrom_unk_20(const struct MEventStruct_Unk1442CC *a0, u32 command); u16 mevent_081445C0(u32 command); void sub_801B940(void); bool32 sub_801B94C(u16 a0); diff --git a/include/mevent_801BAAC.h b/include/mevent_801BAAC.h index 547d5237b..d76bc92c2 100644 --- a/include/mevent_801BAAC.h +++ b/include/mevent_801BAAC.h @@ -1,8 +1,8 @@ #ifndef GUARD_MEVENT_801BAAC_H #define GUARD_MEVENT_801BAAC_H -bool32 InitWonderCardResources(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6); -bool32 InitWonderNewsResources(const struct MEventBuffer_3120_Sub * a0); +bool32 InitWonderCardResources(struct WonderCard * r5, struct MEventBuffer_3430_Sub * r6); +bool32 InitWonderNewsResources(const struct WonderNews * a0); s32 FadeToWonderCardMenu(void); s32 FadeToWonderNewsMenu(void); s32 FadeOutFromWonderCard(bool32 flag); diff --git a/include/mevent_client.h b/include/mevent_client.h new file mode 100644 index 000000000..c32d14d7a --- /dev/null +++ b/include/mevent_client.h @@ -0,0 +1,33 @@ +#ifndef GUARD_MEVENT_CLIENT_H +#define GUARD_MEVENT_CLIENT_H + +#include "mevent_server_helpers.h" + +struct mevent_client_cmd +{ + u32 instr; + u32 parameter; +}; + +struct mevent_client +{ + u32 unk_00; + u32 param; + u32 mainseqno; + u32 flag; + u32 cmdidx; + void * sendBuffer; + void * recvBuffer; + struct mevent_client_cmd * cmdBuffer; + void * buffer; + struct mevent_srv_sub manager; + u32 unk_4C; +}; + +void mevent_client_do_init(u32 arg); +u32 mevent_client_do_exec(u16 * a0); +void mevent_client_inc_flag(void); +void * mevent_client_get_buffer(void); +void mevent_client_set_param(u32 a0); + +#endif //GUARD_MEVENT_CLIENT_H diff --git a/include/mevent_server.h b/include/mevent_server.h index d7657b270..e74337cf6 100644 --- a/include/mevent_server.h +++ b/include/mevent_server.h @@ -1,6 +1,34 @@ #ifndef GUARD_MEVENT_SERVER_H #define GUARD_MEVENT_SERVER_H +#include "mevent_server_helpers.h" + +struct mevent_cmd +{ + u32 instr; + bool32 flag; + const void * parameter; +}; + +struct mevent_srv_common +{ + u32 unk_00; + u32 param; + u32 mainseqno; + u32 cmdidx; + const struct mevent_cmd * cmdBuffer; + void * recvBuffer; + struct WonderCard * wonder_card; + struct WonderNews * wonder_news; + struct MEventStruct_Unk1442CC * mevent_unk1442cc; + const void * sendBuffer1; + u32 sendBuffer1Size; + const void * sendBuffer2; + u32 sendBuffer2Size; + u32 sendWord; + struct mevent_srv_sub manager; +}; + void mevent_srv_new_wcard(); void mevent_srv_init_wnews(); u32 mevent_srv_common_do_exec(u16 * a0); diff --git a/include/mevent_server_helpers.h b/include/mevent_server_helpers.h new file mode 100644 index 000000000..e4e409862 --- /dev/null +++ b/include/mevent_server_helpers.h @@ -0,0 +1,38 @@ +#ifndef GUARD_MEVENT_SERVER_HELPERS_H +#define GUARD_MEVENT_SERVER_HELPERS_H + +#define ME_SEND_BUF_SIZE 0x400 + +struct mevent_srv_sub +{ + s32 seqno; + u8 sendPlayerNo; + u8 recvPlayerNo; + u16 recvIdent; + u16 recvCounter; + u16 recvCRC; + u16 recvSize; + u16 sendIdent; + u16 sendCounter; + u16 sendCRC; + u16 sendSize; + void * recvBfr; + const void * sendBfr; + u32 (*recvFunc)(struct mevent_srv_sub *); + u32 (*sendFunc)(struct mevent_srv_sub *); +}; + +struct send_recv_header +{ + u16 ident; + u16 crc; + u16 size; +}; + +void mevent_srv_sub_init(struct mevent_srv_sub *, u32, u32); +void mevent_srv_sub_init_send(struct mevent_srv_sub * manager, u32 ident, const void * src, u32 size); +bool32 mevent_srv_sub_recv(struct mevent_srv_sub * manager); +bool32 mevent_srv_sub_send(struct mevent_srv_sub * manager); +void mevent_srv_sub_init_recv(struct mevent_srv_sub *, u32, void *); + +#endif //GUARD_MEVENT_SERVER_HELPERS_H diff --git a/include/mevent_server_ish.h b/include/mevent_server_ish.h deleted file mode 100644 index 31f98ed52..000000000 --- a/include/mevent_server_ish.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GUARD_MEVENT_SERVER_ISH_H -#define GUARD_MEVENT_SERVER_ISH_H - -void mevent_srv_ish_do_init(u32 arg); -u32 mevent_srv_ish_do_exec(u16 * a0); -void mevent_srv_ish_inc_flag(void); -void * mevent_srv_ish_get_buffer(void); -void mevent_srv_ish_set_param(u32 a0); - -#endif //GUARD_MEVENT_SERVER_ISH_H diff --git a/include/naming_screen.h b/include/naming_screen.h index b04cb19b6..611f53ef2 100644 --- a/include/naming_screen.h +++ b/include/naming_screen.h @@ -59,9 +59,9 @@ struct NamingScreenData { enum { + PAGE_OTHERS, PAGE_UPPER, PAGE_LOWER, - PAGE_OTHERS, }; enum diff --git a/include/script.h b/include/script.h index 34f4635bb..cfe493479 100644 --- a/include/script.h +++ b/include/script.h @@ -57,9 +57,9 @@ u32 CalculateRamScriptChecksum(void); void ClearRamScript(void); bool8 InitRamScript(const u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 objectId); const u8 *GetRamScript(u8 objectId, const u8 *script); -bool32 sub_80991F8(void); -u8 *sub_8099244(void); -void sub_80992A0(u8 *script, u16 scriptSize); +bool32 ValidateSavedRamScript(void); +u8 *GetSavedRamScriptIfValid(void); +void InitRamScript_NoEventObject(u8 *script, u16 scriptSize); // srccmd.h void sub_809BE48(u16 npcId); diff --git a/include/strings.h b/include/strings.h index 8aa296eb1..fc5724af3 100644 --- a/include/strings.h +++ b/include/strings.h @@ -471,6 +471,8 @@ extern const u8 gText_EggCantBattle[]; extern const u8 gText_PkmnAlreadySelected[]; extern const u8 gText_PkmnAlreadyInBattle[]; extern const u8 gText_PkmnCantSwitchOut[]; +extern const u8 gText_Dash[]; +extern const u8 gText_UnkCtrlF904[]; //pokedex text extern const u8 gText_CryOf[]; diff --git a/include/util.h b/include/util.h index 56c89359a..77062de96 100644 --- a/include/util.h +++ b/include/util.h @@ -10,8 +10,8 @@ u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *)); void StoreWordInTwoHalfwords(u16 *, u32); void LoadWordFromTwoHalfwords(u16 *, u32 *); int CountTrailingZeroBits(u32 value); -u16 CalcCRC16(u8 *data, s32 length); -u16 CalcCRC16WithTable(u8 *data, u32 length); +u16 CalcCRC16(const u8 *data, s32 length); +u16 CalcCRC16WithTable(const u8 *data, u32 length); u32 CalcByteArraySum(const u8* data, u32 length); void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); void DoBgAffineSet(struct BgAffineDstData *dest, u32 texX, u32 texY, s16 scrX, s16 scrY, s16 sx, s16 sy, u16 alpha); |