From 21a301b77d01851a9d019b594ff11c547cc6514f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 28 Nov 2018 22:15:11 -0500 Subject: through sub_81436EC --- include/link.h | 5 +++++ include/main.h | 3 +++ include/unk_815c27c.h | 11 +++++++++++ 3 files changed, 19 insertions(+) create mode 100644 include/unk_815c27c.h (limited to 'include') diff --git a/include/link.h b/include/link.h index 239a59b71..d015708b1 100644 --- a/include/link.h +++ b/include/link.h @@ -146,6 +146,10 @@ extern u16 word_3002910[]; extern bool8 gReceivedRemoteLinkPlayers; extern bool8 gLinkVSyncDisabled; +extern u8 gUnknown_3003F84; +extern u64 gUnknown_3003FB4; +extern u16 gUnknown_202271A; + void Task_DestroySelf(u8); void OpenLink(void); void CloseLink(void); @@ -196,5 +200,6 @@ void sub_8011BD0(void); u8 sub_800ABAC(void); u8 sub_800ABBC(void); void sub_800AC34(void); +void sub_8009804(void); #endif // GUARD_LINK_H diff --git a/include/main.h b/include/main.h index 84d356692..0fe138d1f 100644 --- a/include/main.h +++ b/include/main.h @@ -9,6 +9,8 @@ typedef void (*MainCallback)(void); typedef void (*IntrCallback)(void); typedef void (*IntrFunc)(void); +extern IntrFunc gIntrTable[]; + struct Main { /*0x000*/ MainCallback callback1; @@ -62,5 +64,6 @@ void SetSerialCallback(IntrCallback callback); void InitFlashTimer(void); void DoSoftReset(void); void ClearPokemonCrySongs(void); +void RestoreSerialTimer3IntrHandlers(void); #endif // GUARD_MAIN_H diff --git a/include/unk_815c27c.h b/include/unk_815c27c.h new file mode 100644 index 000000000..d5ddc7bdc --- /dev/null +++ b/include/unk_815c27c.h @@ -0,0 +1,11 @@ +#ifndef GUARD_UNK_815C27C_H +#define GUARD_UNK_815C27C_H + +void sub_815C6D4(void); +void sub_815C6C4(void); +void sub_815C8C8(void); +void sub_815C960(void); +void sub_815C91C(void); +u16 sub_815C498(u8, u32, u32, u8); + +#endif //GUARD_UNK_815C27C_H -- cgit v1.2.3 From 2943997dcbab30619e0410b294dc109fd3e08e83 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Nov 2018 09:54:26 -0500 Subject: through sub_81438F0 --- include/link.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/link.h b/include/link.h index d015708b1..92abf6e28 100644 --- a/include/link.h +++ b/include/link.h @@ -146,6 +146,7 @@ extern u16 word_3002910[]; extern bool8 gReceivedRemoteLinkPlayers; extern bool8 gLinkVSyncDisabled; +extern u8 gUnknown_3003F64; extern u8 gUnknown_3003F84; extern u64 gUnknown_3003FB4; extern u16 gUnknown_202271A; @@ -201,5 +202,8 @@ u8 sub_800ABAC(void); u8 sub_800ABBC(void); void sub_800AC34(void); void sub_8009804(void); +bool8 sub_800AA48(void); +void sub_800A5BC(void); +void sub_800AA80(u8); #endif // GUARD_LINK_H -- cgit v1.2.3 From 746006911096730ea6d5f14bfff5957ef9b5bc2c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Nov 2018 11:35:31 -0500 Subject: sub_8143910 --- include/global.h | 12 ++++++++++++ include/link.h | 2 ++ include/link_rfu_4.h | 6 ++++++ include/unk_815c27c.h | 2 +- 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 include/link_rfu_4.h (limited to 'include') diff --git a/include/global.h b/include/global.h index d5bfc5241..899508993 100644 --- a/include/global.h +++ b/include/global.h @@ -591,6 +591,18 @@ struct FameCheckerSaveData #define NUM_EASY_CHAT_EXTRA_PHRASES 33 #define EASY_CHAT_EXTRA_PHRASES_SIZE ((NUM_EASY_CHAT_EXTRA_PHRASES >> 3) + (NUM_EASY_CHAT_EXTRA_PHRASES % 8 ? 1 : 0)) +struct MEventBuffer1 +{ + u32 crc; + u8 data[0x1bc]; +}; + +struct MEventBuffer2 +{ + u32 crc; + u8 data[0x14c]; +}; + struct SaveBlock1 { /*0x0000*/ struct Coords16 pos; diff --git a/include/link.h b/include/link.h index 92abf6e28..321a28d11 100644 --- a/include/link.h +++ b/include/link.h @@ -205,5 +205,7 @@ void sub_8009804(void); bool8 sub_800AA48(void); void sub_800A5BC(void); void sub_800AA80(u8); +void sub_80098D8(void); +void sub_80098B8(void); #endif // GUARD_LINK_H diff --git a/include/link_rfu_4.h b/include/link_rfu_4.h new file mode 100644 index 000000000..08bb3d7c5 --- /dev/null +++ b/include/link_rfu_4.h @@ -0,0 +1,6 @@ +#ifndef GUARD_LINK_RFU_4_H +#define GUARD_LINK_RFU_4_H + +bool32 mevent_0814257C(u8 * cmdPtr, const u8 * src); + +#endif //GUARD_LINK_RFU_4_H diff --git a/include/unk_815c27c.h b/include/unk_815c27c.h index d5ddc7bdc..cc1cbb7ce 100644 --- a/include/unk_815c27c.h +++ b/include/unk_815c27c.h @@ -6,6 +6,6 @@ void sub_815C6C4(void); void sub_815C8C8(void); void sub_815C960(void); void sub_815C91C(void); -u16 sub_815C498(u8, u32, u32, u8); +u16 sub_815C498(u8, size_t, const void *, u8); #endif //GUARD_UNK_815C27C_H -- cgit v1.2.3 From cec95ebfb41f8381feeb87ff889ebc1d89827ec6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Nov 2018 14:02:49 -0500 Subject: through sub_8143DBC --- include/easy_chat.h | 1 + include/global.h | 29 ++++++++++++++++++++++------- include/link_rfu_4.h | 1 + 3 files changed, 24 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/easy_chat.h b/include/easy_chat.h index 2b5664420..78e371cbb 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -37,5 +37,6 @@ bool32 sub_811F8D8(u16 word); void InitializeEasyChatWordArray(u16 *words, u16 length); void ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 length1, u16 length2); bool8 ECWord_CheckIfOutsideOfValidRange(u16 word); +void sub_80BDE28(void); #endif // GUARD_EASYCHAT_H diff --git a/include/global.h b/include/global.h index 899508993..456f2c083 100644 --- a/include/global.h +++ b/include/global.h @@ -591,18 +591,34 @@ struct FameCheckerSaveData #define NUM_EASY_CHAT_EXTRA_PHRASES 33 #define EASY_CHAT_EXTRA_PHRASES_SIZE ((NUM_EASY_CHAT_EXTRA_PHRASES >> 3) + (NUM_EASY_CHAT_EXTRA_PHRASES % 8 ? 1 : 0)) -struct MEventBuffer1 +struct MEventBuffer_3120 { u32 crc; - u8 data[0x1bc]; + u16 data[222]; }; -struct MEventBuffer2 +struct MEventBuffer_32E0 { u32 crc; - u8 data[0x14c]; + u16 data[166]; }; +struct MEventBuffer_3430 +{ + u32 crc; + u16 data[18]; +}; + +struct MEventBuffers +{ + /*0x000 0x3120*/ struct MEventBuffer_3120 buffer_000; + /*0x1c0 0x32e0*/ struct MEventBuffer_32E0 buffer_1c0; + /*0x310 0x3430*/ struct MEventBuffer_3430 buffer_310; + /*0x338 0x3458*/ u16 unk_338[4]; + /*0x340 0x3460*/ struct MysteryEventStruct unk_340; + /*0x344 0x3464*/ u8 filler_344[0x28]; +}; // 0x36C 0x348C + struct SaveBlock1 { /*0x0000*/ struct Coords16 pos; @@ -650,9 +666,8 @@ struct SaveBlock1 /*0x309C*/ u8 giftRibbons[52]; /*0x30D0*/ struct Roamer roamer; /*0x30EC*/ struct EnigmaBerry enigmaBerry; - /*0x3120*/ u8 filler3120[0x340]; - /*0x3460*/ struct MysteryEventStruct unk_3460; - /*0x3464*/ u8 filler_3464[0x1b8]; + /*0x3120*/ struct MEventBuffers unk_3120; + /*0x348C*/ u8 filler_3464[0x190]; /*0x361C*/ struct RamScript ramScript; /*0x3A08*/ u8 filler3A08[12]; /*0x3A14*/ u8 seen2[DEX_FLAGS_NO]; diff --git a/include/link_rfu_4.h b/include/link_rfu_4.h index 08bb3d7c5..91ae86e4c 100644 --- a/include/link_rfu_4.h +++ b/include/link_rfu_4.h @@ -1,6 +1,7 @@ #ifndef GUARD_LINK_RFU_4_H #define GUARD_LINK_RFU_4_H +void sub_8142504(const u8 *str); bool32 mevent_0814257C(u8 * cmdPtr, const u8 * src); #endif //GUARD_LINK_RFU_4_H -- cgit v1.2.3 From 159f242e32532f14496abaa8d2f96e9c3d30d720 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Nov 2018 15:33:58 -0500 Subject: through sub_8144018 --- include/battle_tower.h | 1 + include/event_data.h | 2 ++ include/global.h | 36 ++++++++++++++++++++++++++++++++---- include/script.h | 1 + 4 files changed, 36 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/battle_tower.h b/include/battle_tower.h index 120ab9a99..36d5eb1f7 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -4,5 +4,6 @@ #include "global.h" u16 sub_8164FCC(u8, u8); +void sub_80E7524(u32 *); #endif //GUARD_BATTLE_TOWER_H diff --git a/include/event_data.h b/include/event_data.h index 2e340f073..bced2a88f 100644 --- a/include/event_data.h +++ b/include/event_data.h @@ -34,6 +34,8 @@ bool8 FlagGet(u16 id); u16 * GetVarPointer(u16 id); bool32 sub_806E2BC(void); void sub_806E6FC(void); +void sub_806E2D0(void); +void sub_806E370(void); extern u16 gSpecialVar_0x8000; extern u16 gSpecialVar_0x8001; diff --git a/include/global.h b/include/global.h index 456f2c083..df2926d0b 100644 --- a/include/global.h +++ b/include/global.h @@ -264,7 +264,9 @@ struct SaveBlock2 /*0x098*/ struct Time localTimeOffset; /*0x0A0*/ struct Time lastBerryTreeUpdate; /*0x0A8*/ u32 field_A8; - /*0x0AC*/ u8 filler_AC[0x9ec]; + /*0x0AC*/ u8 filler_AC[0x3F4]; + /*0x4A0*/ u32 unk_4A0[0x2F]; + /*0x55c*/ u8 filler_55C[0x53C]; /*0xA98*/ u8 unk_A98[2][16]; /*0xAB8*/ u8 filler_AB8[0x468]; /*0xF20*/ u32 encryptionKey; @@ -591,22 +593,48 @@ struct FameCheckerSaveData #define NUM_EASY_CHAT_EXTRA_PHRASES 33 #define EASY_CHAT_EXTRA_PHRASES_SIZE ((NUM_EASY_CHAT_EXTRA_PHRASES >> 3) + (NUM_EASY_CHAT_EXTRA_PHRASES % 8 ? 1 : 0)) +struct MEventBuffer_3120_Sub +{ + u16 unk_00; + u8 unk_02; + u16 filler_04[220]; +}; + struct MEventBuffer_3120 { u32 crc; - u16 data[222]; + struct MEventBuffer_3120_Sub data; +}; + +struct MEventBuffer_32E0_Sub +{ + u16 unk_00; + u16 unk_02; + u8 filler_04[4]; + u8 unk_08_0:2; + u8 unk_08_2:4; + u8 unk_08_6:2; + u8 unk_09; + u8 filler_0A[322]; }; struct MEventBuffer_32E0 { u32 crc; - u16 data[166]; + struct MEventBuffer_32E0_Sub data; +}; + +struct MEventBuffer_3430_Sub +{ + u8 filler_00[6]; + u16 unk_06; + u8 filler_08[28]; }; struct MEventBuffer_3430 { u32 crc; - u16 data[18]; + struct MEventBuffer_3430_Sub data; }; struct MEventBuffers diff --git a/include/script.h b/include/script.h index 9e26b8a28..6ed2e8f49 100644 --- a/include/script.h +++ b/include/script.h @@ -62,5 +62,6 @@ u8 *GetRamScript(u8 objectId, u8 *script); bool32 sub_80991F8(void); u8 *sub_8099244(void); void sub_80992A0(u8 *script, u16 scriptSize); +bool32 sub_8069DFC(void); #endif // GUARD_SCRIPT_H -- cgit v1.2.3 From 51622adaec9fd47a8f1be2b61b1f4521cc9d47da Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Nov 2018 18:15:22 -0500 Subject: through sub_8144218 --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index df2926d0b..04f89802c 100644 --- a/include/global.h +++ b/include/global.h @@ -628,7 +628,7 @@ struct MEventBuffer_3430_Sub { u8 filler_00[6]; u16 unk_06; - u8 filler_08[28]; + u16 unk_08[2][7]; }; struct MEventBuffer_3430 -- cgit v1.2.3 From d68f434a527d185e2968d8da418fa74110090c79 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Nov 2018 18:48:06 -0500 Subject: through sub_814449C --- include/main.h | 3 +++ include/mevent.h | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'include') diff --git a/include/main.h b/include/main.h index 0fe138d1f..adbf1fb5d 100644 --- a/include/main.h +++ b/include/main.h @@ -66,4 +66,7 @@ void DoSoftReset(void); void ClearPokemonCrySongs(void); void RestoreSerialTimer3IntrHandlers(void); +extern const char RomHeaderGameCode[4]; +extern const char RomHeaderSoftwareVersion; + #endif // GUARD_MAIN_H diff --git a/include/mevent.h b/include/mevent.h index 7df669da3..ae301263f 100644 --- a/include/mevent.h +++ b/include/mevent.h @@ -3,6 +3,24 @@ #include "global.h" +struct MEventStruct_Unk1442CC +{ + u32 unk_00; + u16 unk_04; + u32 unk_08; + u16 unk_0C; + u32 unk_10; + u16 unk_14; + u16 unk_16[4]; + struct MEventBuffer_3430_Sub unk_20; + u8 unk_44; + u8 unk_45[7]; + u8 unk_4C[4]; + u16 unk_50[6]; + u8 unk_5C[4]; + u8 unk_60; +}; + struct MysteryEventStruct * sub_8143D94(void); bool32 sub_8143E1C(void); -- cgit v1.2.3 From 939ae833c3364d7ea7543c4db56df5c90b4e9d8d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Nov 2018 19:17:38 -0500 Subject: through sub_81445C0 --- include/global.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 04f89802c..92e6b7da1 100644 --- a/include/global.h +++ b/include/global.h @@ -626,7 +626,9 @@ struct MEventBuffer_32E0 struct MEventBuffer_3430_Sub { - u8 filler_00[6]; + u16 unk_00; + u16 unk_02; + u16 unk_04; u16 unk_06; u16 unk_08[2][7]; }; -- cgit v1.2.3 From 9200df7516151a84d0fcdda84259179eafafcabb Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Nov 2018 20:56:53 -0500 Subject: Finish decomp of mevent.s --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 92e6b7da1..b1c6adcf3 100644 --- a/include/global.h +++ b/include/global.h @@ -646,7 +646,7 @@ struct MEventBuffers /*0x310 0x3430*/ struct MEventBuffer_3430 buffer_310; /*0x338 0x3458*/ u16 unk_338[4]; /*0x340 0x3460*/ struct MysteryEventStruct unk_340; - /*0x344 0x3464*/ u8 filler_344[0x28]; + /*0x344 0x3464*/ u32 unk_344[2][5]; }; // 0x36C 0x348C struct SaveBlock1 -- cgit v1.2.3 From 5e98e6b8df930bb386acc5ce21940a122fd497ce Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Nov 2018 21:02:08 -0500 Subject: Fix this field's name to be consistent with offset --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index b1c6adcf3..1dae2f75f 100644 --- a/include/global.h +++ b/include/global.h @@ -697,7 +697,7 @@ struct SaveBlock1 /*0x30D0*/ struct Roamer roamer; /*0x30EC*/ struct EnigmaBerry enigmaBerry; /*0x3120*/ struct MEventBuffers unk_3120; - /*0x348C*/ u8 filler_3464[0x190]; + /*0x348C*/ u8 filler_348C[0x190]; /*0x361C*/ struct RamScript ramScript; /*0x3A08*/ u8 filler3A08[12]; /*0x3A14*/ u8 seen2[DEX_FLAGS_NO]; -- cgit v1.2.3 From 294b150d70385a117e1324fd1e13bab25bfaabc9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Nov 2018 08:47:58 -0500 Subject: Set up to decomp mevent_server --- include/global.h | 2 ++ include/mevent.h | 12 ++++++++++++ 2 files changed, 14 insertions(+) (limited to 'include') diff --git a/include/global.h b/include/global.h index 1dae2f75f..5b07796cc 100644 --- a/include/global.h +++ b/include/global.h @@ -28,6 +28,8 @@ #endif // __APPLE__ #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) +// GF's lingo +#define NELEMS ARRAY_COUNT // useful math macros diff --git a/include/mevent.h b/include/mevent.h index ae301263f..31e1041fe 100644 --- a/include/mevent.h +++ b/include/mevent.h @@ -21,6 +21,18 @@ struct MEventStruct_Unk1442CC u8 unk_60; }; +struct MEvent_Str_1 +{ + u16 unk_000; + size_t unk_004; + const void * unk_008; +}; + +struct MEvent_Str_2 +{ + u8 fill_00[0x40]; +}; + struct MysteryEventStruct * sub_8143D94(void); bool32 sub_8143E1C(void); -- cgit v1.2.3 From 80dbdacaced2e4522f29e6974474103926461161 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Nov 2018 10:27:25 -0500 Subject: through sub_814490C --- include/link.h | 2 +- include/link_rfu.h | 8 ++++++++ include/link_rfu_4.h | 7 ------- include/mevent_server.h | 4 ++++ 4 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 include/link_rfu.h delete mode 100644 include/link_rfu_4.h create mode 100644 include/mevent_server.h (limited to 'include') diff --git a/include/link.h b/include/link.h index 321a28d11..1c13de37e 100644 --- a/include/link.h +++ b/include/link.h @@ -149,7 +149,7 @@ extern bool8 gLinkVSyncDisabled; extern u8 gUnknown_3003F64; extern u8 gUnknown_3003F84; extern u64 gUnknown_3003FB4; -extern u16 gUnknown_202271A; +extern u16 gLinkType; void Task_DestroySelf(u8); void OpenLink(void); diff --git a/include/link_rfu.h b/include/link_rfu.h new file mode 100644 index 000000000..065d23f9f --- /dev/null +++ b/include/link_rfu.h @@ -0,0 +1,8 @@ +#ifndef GUARD_LINK_RFU_H +#define GUARD_LINK_RFU_H + +void sub_8142504(const u8 *str); +bool32 mevent_0814257C(u8 * cmdPtr, const u8 * src); +void sub_80FA190(void); + +#endif //GUARD_LINK_RFU_H diff --git a/include/link_rfu_4.h b/include/link_rfu_4.h deleted file mode 100644 index 91ae86e4c..000000000 --- a/include/link_rfu_4.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef GUARD_LINK_RFU_4_H -#define GUARD_LINK_RFU_4_H - -void sub_8142504(const u8 *str); -bool32 mevent_0814257C(u8 * cmdPtr, const u8 * src); - -#endif //GUARD_LINK_RFU_4_H diff --git a/include/mevent_server.h b/include/mevent_server.h new file mode 100644 index 000000000..0d46d8fc5 --- /dev/null +++ b/include/mevent_server.h @@ -0,0 +1,4 @@ +#ifndef GUARD_MEVENT_SERVER_H +#define GUARD_MEVENT_SERVER_H + +#endif //GUARD_MEVENT_SERVER_H -- cgit v1.2.3 From 5a80a339cd04864f36bae99eb4b35de2f8bbab16 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Nov 2018 10:52:54 -0500 Subject: sub_81449E0 --- include/link.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/link.h b/include/link.h index 1c13de37e..39873ec11 100644 --- a/include/link.h +++ b/include/link.h @@ -207,5 +207,6 @@ void sub_800A5BC(void); void sub_800AA80(u8); void sub_80098D8(void); void sub_80098B8(void); +bool8 sub_800A4BC(void); #endif // GUARD_LINK_H -- cgit v1.2.3 From 7c2517611b83ac9d490a99ec32cf1a4412c05ce0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Nov 2018 12:16:42 -0500 Subject: sub_8144CA0 --- include/battle_tower.h | 1 + include/mevent.h | 5 +++++ include/script.h | 1 + 3 files changed, 7 insertions(+) (limited to 'include') diff --git a/include/battle_tower.h b/include/battle_tower.h index 36d5eb1f7..0782725b6 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -5,5 +5,6 @@ u16 sub_8164FCC(u8, u8); void sub_80E7524(u32 *); +void sub_80E7490(void); #endif //GUARD_BATTLE_TOWER_H diff --git a/include/mevent.h b/include/mevent.h index 31e1041fe..1744bb524 100644 --- a/include/mevent.h +++ b/include/mevent.h @@ -34,6 +34,11 @@ struct MEvent_Str_2 }; struct MysteryEventStruct * sub_8143D94(void); +bool32 sub_8143DC8(const struct MEventBuffer_3120_Sub * src); bool32 sub_8143E1C(void); +bool32 sub_8143EF4(const u8 * src); +bool32 sub_8143F68(const struct MEventBuffer_32E0_Sub * data); +bool32 sub_8144254(const u16 * data); +void sub_81442CC(struct MEventStruct_Unk1442CC * data); #endif //GUARD_MEVENT_H diff --git a/include/script.h b/include/script.h index 6ed2e8f49..b718af4c1 100644 --- a/include/script.h +++ b/include/script.h @@ -63,5 +63,6 @@ bool32 sub_80991F8(void); u8 *sub_8099244(void); void sub_80992A0(u8 *script, u16 scriptSize); bool32 sub_8069DFC(void); +void sub_8069EA4(u8 * script, u16 scriptSize); #endif // GUARD_SCRIPT_H -- cgit v1.2.3 From f178d06946a4debf6a0551094d3ef2f70b7b364c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Nov 2018 12:26:24 -0500 Subject: through mevent_srv_ish_exec --- include/mystery_event_script.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/mystery_event_script.h b/include/mystery_event_script.h index 1ba1464fa..8f90ccf53 100644 --- a/include/mystery_event_script.h +++ b/include/mystery_event_script.h @@ -7,4 +7,7 @@ u32 RunMysteryEventScript(u8 *); void SetMysteryEventScriptStatus(u32 val); u16 GetRecordMixingGift(void); +void sub_80DA89C(void *); +bool32 sub_80DA8B0(u32 *); + #endif // GUARD_MYSTERY_EVENT_SCRIPT_H -- cgit v1.2.3 From 8a8e86fa4fe0a7932f475c7aa8424ea840327e4b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Nov 2018 15:26:16 -0500 Subject: split mevent_server --- include/cereader_tool.h | 9 +++++++++ include/help_system.h | 2 ++ include/mevent_server.h | 36 ++++++++++++++++++++++++++++++++++++ include/mystery_gift_menu.h | 6 ++++++ 4 files changed, 53 insertions(+) create mode 100644 include/cereader_tool.h create mode 100644 include/mystery_gift_menu.h (limited to 'include') diff --git a/include/cereader_tool.h b/include/cereader_tool.h new file mode 100644 index 000000000..28ef526eb --- /dev/null +++ b/include/cereader_tool.h @@ -0,0 +1,9 @@ +#ifndef GUARD_CEREADER_TOOL_H +#define GUARD_CEREADER_TOOL_H + +#include "global.h" + +bool32 sub_815D794(u8 *); +u8 sub_815D6B4(u8 *); + +#endif //GUARD_CEREADER_TOOL_H diff --git a/include/help_system.h b/include/help_system.h index 3f6a741c6..632788148 100644 --- a/include/help_system.h +++ b/include/help_system.h @@ -5,4 +5,6 @@ extern bool8 gUnknown_3005ECC; +void sub_812B484(void); + #endif //GUARD_HELP_SYSTEM_H diff --git a/include/mevent_server.h b/include/mevent_server.h index 0d46d8fc5..d2d7b0687 100644 --- a/include/mevent_server.h +++ b/include/mevent_server.h @@ -1,4 +1,40 @@ #ifndef GUARD_MEVENT_SERVER_H #define GUARD_MEVENT_SERVER_H +#include "global.h" + +#define ME_SEND_BUF_SIZE 0x400 + +struct mevent_srv_sub +{ + s32 unk_00; + u8 unk_04; + u8 unk_05; + u16 unk_06; + u16 unk_08; + u16 unk_0A; + u16 unk_0C; + u16 unk_0E; + u16 unk_10; + u16 unk_12; + u16 unk_14; + void * unk_18; + void * unk_1C; + u32 (*unk_20)(struct mevent_srv_sub *); + u32 (*unk_24)(struct mevent_srv_sub *); +}; + +struct send_recv_buff +{ + u16 unk0; + u16 unk2; + u16 unk4; +}; + +u32 sub_8144844(struct mevent_srv_sub * svr); +u32 sub_8144850(struct mevent_srv_sub * svr); +void sub_814485C(struct mevent_srv_sub * svr, u32 a1, u32 a2); +void sub_8144888(struct mevent_srv_sub * svr, u32 a1, void * a2, u32 size); +void sub_81448AC(struct mevent_srv_sub * svr, u32 a1, void * a2); + #endif //GUARD_MEVENT_SERVER_H diff --git a/include/mystery_gift_menu.h b/include/mystery_gift_menu.h new file mode 100644 index 000000000..17af9ce57 --- /dev/null +++ b/include/mystery_gift_menu.h @@ -0,0 +1,6 @@ +#ifndef GUARD_MYSTERY_GIFT_MENU_H +#define GUARD_MYSTERY_GIFT_MENU_H + +void sub_81422FC(void); + +#endif //GUARD_MYSTERY_GIFT_MENU_H -- cgit v1.2.3 From b9a6cba30a3ee44ccb14548d198accd7f6bbfa8d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Nov 2018 16:51:22 -0500 Subject: Finish decomp of mevent_server --- include/mevent.h | 9 +++++++++ include/script.h | 1 + 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/mevent.h b/include/mevent.h index 1744bb524..d940b212c 100644 --- a/include/mevent.h +++ b/include/mevent.h @@ -33,12 +33,21 @@ struct MEvent_Str_2 u8 fill_00[0x40]; }; +struct MEventBuffer_3120_Sub * sub_8143D58(void); +struct MEventBuffer_32E0_Sub * sav1_get_mevent_buffer_1(void); +struct MEventBuffer_3430_Sub * sav1_get_mevent_buffer_2(void); struct MysteryEventStruct * sub_8143D94(void); bool32 sub_8143DC8(const struct MEventBuffer_3120_Sub * src); bool32 sub_8143E1C(void); bool32 sub_8143EF4(const u8 * src); bool32 sub_8143F68(const struct MEventBuffer_32E0_Sub * data); +void sub_814410C(struct MEventBuffer_32E0_Sub * buffer); bool32 sub_8144254(const u16 * data); void sub_81442CC(struct MEventStruct_Unk1442CC * data); +bool32 sub_81443D4(const struct MEventStruct_Unk1442CC * data); +u32 sub_8144418(const u16 * a0, const struct MEventStruct_Unk1442CC * a1, void * unused); +u32 sub_8144434(const u16 * a0, const struct MEventStruct_Unk1442CC * a1, void * unused); +bool32 sub_8144474(const struct MEventStruct_Unk1442CC * a0, const u16 * a1); +u16 sub_81444B0(const struct MEventStruct_Unk1442CC * a0, u32 command); #endif //GUARD_MEVENT_H diff --git a/include/script.h b/include/script.h index b718af4c1..ebb4caa86 100644 --- a/include/script.h +++ b/include/script.h @@ -64,5 +64,6 @@ u8 *sub_8099244(void); void sub_80992A0(u8 *script, u16 scriptSize); bool32 sub_8069DFC(void); void sub_8069EA4(u8 * script, u16 scriptSize); +u8 * sub_8069E48(void); #endif // GUARD_SCRIPT_H -- cgit v1.2.3 From 01aada9e93b5e132635feb214baa5d302c4f2154 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 1 Dec 2018 11:24:05 -0500 Subject: merge mevent server and document mevent_server_helpers --- include/link.h | 2 +- include/mevent_server.h | 105 +++++++++++++++++++++++++++++++++++++----------- include/util.h | 4 +- 3 files changed, 85 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/link.h b/include/link.h index 39873ec11..ef8776c64 100644 --- a/include/link.h +++ b/include/link.h @@ -169,7 +169,7 @@ void sub_8007E24(void); void sub_8007E4C(void); u8 GetMultiplayerId(void); u8 bitmask_all_link_players_but_self(void); -bool8 SendBlock(u8, void *, u16); +bool8 SendBlock(u8, const void *, u16); u8 GetBlockReceivedStatus(void); void ResetBlockReceivedFlags(void); void ResetBlockReceivedFlag(u8); diff --git a/include/mevent_server.h b/include/mevent_server.h index d2d7b0687..90cb5f35d 100644 --- a/include/mevent_server.h +++ b/include/mevent_server.h @@ -7,34 +7,93 @@ struct mevent_srv_sub { - s32 unk_00; - u8 unk_04; - u8 unk_05; - u16 unk_06; - u16 unk_08; - u16 unk_0A; - u16 unk_0C; - u16 unk_0E; - u16 unk_10; - u16 unk_12; - u16 unk_14; + 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; +}; + +struct mevent_cmd_ish +{ + u32 instr; + u32 parameter; +}; + +struct mevent_srv_ish +{ + u32 unk_00; + u32 unk_04; + u32 mainseqno; + u32 unk_0C; + u32 cmdidx; + void * unk_14; void * unk_18; - void * unk_1C; - u32 (*unk_20)(struct mevent_srv_sub *); - u32 (*unk_24)(struct mevent_srv_sub *); + struct mevent_cmd_ish * cmdBuffer; + void * unk_20; + struct mevent_srv_sub unk_24; }; -struct send_recv_buff +struct mevent_cmd { - u16 unk0; - u16 unk2; - u16 unk4; + u32 instr; + bool32 flag; + void * parameter; }; -u32 sub_8144844(struct mevent_srv_sub * svr); -u32 sub_8144850(struct mevent_srv_sub * svr); -void sub_814485C(struct mevent_srv_sub * svr, u32 a1, u32 a2); -void sub_8144888(struct mevent_srv_sub * svr, u32 a1, void * a2, u32 size); -void sub_81448AC(struct mevent_srv_sub * svr, u32 a1, void * a2); +struct mevent_srv_common +{ + u32 unk_00; + u32 unk_04; + u32 mainseqno; + u32 cmdidx; + const struct mevent_cmd * cmdBuffer; + void * unk_14; + struct MEventBuffer_32E0_Sub * unk_18; + struct MEventBuffer_3120_Sub * unk_1C; + struct MEventStruct_Unk1442CC * unk_20; + void * unk_24; + u32 unk_28; + void * unk_2C; + u32 unk_30; + void * unk_34; + struct mevent_srv_sub unk_38; +}; + +u32 mevent_srv_sub_recv(struct mevent_srv_sub * svr); +u32 mevent_srv_sub_send(struct mevent_srv_sub * svr); +void mevent_srv_sub_init(struct mevent_srv_sub * svr, u32 sendPlayerNo, u32 recvPlayerNo); +void mevent_srv_sub_init_send(struct mevent_srv_sub * svr, u32 ident, const void * src, u32 size); +void mevent_srv_sub_init_recv(struct mevent_srv_sub * svr, u32 ident, void * dest); + +void sub_8144AEC(void); +u32 sub_8144B0C(u16 * a0); +void sub_8144B48(void); +void * sub_8144B58(void); +void sub_8144B64(u32 a0); +void sub_8144F1C(void); +void sub_8144F40(void); +u32 sub_8144F64(u16 * a0); + +extern const u8 gUnknown_84687E0[]; +extern const u8 gUnknown_8468B6C[]; +extern const u8 gUnknown_8468BCC[]; #endif //GUARD_MEVENT_SERVER_H diff --git a/include/util.h b/include/util.h index a22cc77fa..e0034d816 100644 --- a/include/util.h +++ b/include/util.h @@ -12,8 +12,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); #endif // GUARD_UTIL_H -- cgit v1.2.3 From 2fbe528d5e2db723db338cb2d1635f0fa76ac905 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 1 Dec 2018 20:27:35 -0500 Subject: Attempt to give meaningful names to mevent srv fields --- include/mevent_server.h | 54 +++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) (limited to 'include') diff --git a/include/mevent_server.h b/include/mevent_server.h index 90cb5f35d..e593b5dbd 100644 --- a/include/mevent_server.h +++ b/include/mevent_server.h @@ -40,15 +40,15 @@ struct mevent_cmd_ish struct mevent_srv_ish { u32 unk_00; - u32 unk_04; + u32 param; u32 mainseqno; - u32 unk_0C; + u32 flag; u32 cmdidx; - void * unk_14; - void * unk_18; + void * sendBuffer; + void * recvBuffer; struct mevent_cmd_ish * cmdBuffer; - void * unk_20; - struct mevent_srv_sub unk_24; + void * buffer; + struct mevent_srv_sub manager; }; struct mevent_cmd @@ -61,20 +61,20 @@ struct mevent_cmd struct mevent_srv_common { u32 unk_00; - u32 unk_04; + u32 param; u32 mainseqno; u32 cmdidx; const struct mevent_cmd * cmdBuffer; - void * unk_14; - struct MEventBuffer_32E0_Sub * unk_18; - struct MEventBuffer_3120_Sub * unk_1C; - struct MEventStruct_Unk1442CC * unk_20; - void * unk_24; - u32 unk_28; - void * unk_2C; - u32 unk_30; - void * unk_34; - struct mevent_srv_sub unk_38; + void * recvBuffer; + struct MEventBuffer_32E0_Sub * mevent_32e0; + struct MEventBuffer_3120_Sub * mevent_3120; + struct MEventStruct_Unk1442CC * mevent_unk1442cc; + void * sendBuffer1; + u32 sendBuffer1Size; + void * sendBuffer2; + u32 sendBuffer2Size; + u32 sendWord; + struct mevent_srv_sub manager; }; u32 mevent_srv_sub_recv(struct mevent_srv_sub * svr); @@ -83,17 +83,13 @@ void mevent_srv_sub_init(struct mevent_srv_sub * svr, u32 sendPlayerNo, u32 recv void mevent_srv_sub_init_send(struct mevent_srv_sub * svr, u32 ident, const void * src, u32 size); void mevent_srv_sub_init_recv(struct mevent_srv_sub * svr, u32 ident, void * dest); -void sub_8144AEC(void); -u32 sub_8144B0C(u16 * a0); -void sub_8144B48(void); -void * sub_8144B58(void); -void sub_8144B64(u32 a0); -void sub_8144F1C(void); -void sub_8144F40(void); -u32 sub_8144F64(u16 * a0); - -extern const u8 gUnknown_84687E0[]; -extern const u8 gUnknown_8468B6C[]; -extern const u8 gUnknown_8468BCC[]; +void mevent_srv_ish_do_init(void); +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); +void mevent_srv_common_do_init_1(void); +void mevent_srv_common_do_init_2(void); +u32 mevent_srv_init_do_exec(u16 * a0); #endif //GUARD_MEVENT_SERVER_H -- cgit v1.2.3 From 884f1934e8bf34813701f745140f1d8429e8beaf Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 2 Dec 2018 10:02:39 -0500 Subject: start decompiling mevent_8145654 --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 5b07796cc..7c663a813 100644 --- a/include/global.h +++ b/include/global.h @@ -599,7 +599,7 @@ struct MEventBuffer_3120_Sub { u16 unk_00; u8 unk_02; - u16 filler_04[220]; + u8 filler_04[440]; }; struct MEventBuffer_3120 -- cgit v1.2.3 From 8f0f725039e9b0ae9de440df28e1eb4bd7d00dc3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 2 Dec 2018 11:42:45 -0500 Subject: sub_814571C and associated graphics dump --- include/pokemon_icon.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h index da58a2d83..cc6c578fe 100644 --- a/include/pokemon_icon.h +++ b/include/pokemon_icon.h @@ -10,5 +10,6 @@ void sub_80D2F68(u16 iconId); u8 sub_80D2D78(u16 iconId, void callback(struct Sprite *), u16 x, u16 y, u16 a4, u8 a5); void sub_80D2FF0(u16 iconId); void sub_80D2EF8(struct Sprite *sprite); +void sub_809707C(void); #endif // GUARD_POKEMON_ICON_H -- cgit v1.2.3 From 2fb1404613d12e5384c7650ef9d46d2678865544 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 2 Dec 2018 12:09:16 -0500 Subject: sub_814593C and associated ewram --- include/mystery_gift_menu.h | 3 +++ include/pokemon_icon.h | 1 + 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/mystery_gift_menu.h b/include/mystery_gift_menu.h index 17af9ce57..24bf85a13 100644 --- a/include/mystery_gift_menu.h +++ b/include/mystery_gift_menu.h @@ -1,6 +1,9 @@ #ifndef GUARD_MYSTERY_GIFT_MENU_H #define GUARD_MYSTERY_GIFT_MENU_H +extern bool8 gUnknown_203F3B8; + void sub_81422FC(void); +void sub_8142344(bool8, bool32); #endif //GUARD_MYSTERY_GIFT_MENU_H diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h index cc6c578fe..2c2edcc7c 100644 --- a/include/pokemon_icon.h +++ b/include/pokemon_icon.h @@ -11,5 +11,6 @@ u8 sub_80D2D78(u16 iconId, void callback(struct Sprite *), u16 x, u16 y, u16 a4, void sub_80D2FF0(u16 iconId); void sub_80D2EF8(struct Sprite *sprite); void sub_809707C(void); +void FreeMonIconPalettes(void); #endif // GUARD_POKEMON_ICON_H -- cgit v1.2.3 From cd42b22d6b450b1fc1d79b046fe7cd1a0fdcf543 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 2 Dec 2018 13:33:03 -0500 Subject: sub_8145A98 --- include/global.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 7c663a813..783a2c375 100644 --- a/include/global.h +++ b/include/global.h @@ -612,12 +612,16 @@ struct MEventBuffer_32E0_Sub { u16 unk_00; u16 unk_02; - u8 filler_04[4]; + u32 unk_04; u8 unk_08_0:2; u8 unk_08_2:4; u8 unk_08_6:2; u8 unk_09; - u8 filler_0A[322]; + u8 unk_0A[40]; + u8 unk_32[40]; + u8 unk_5A[4][40]; + u8 unk_FA[40]; + u8 unk_122[40]; }; struct MEventBuffer_32E0 -- cgit v1.2.3 From 30d4803a44a8f11ee88c4d4e37cef9f2373b3542 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 2 Dec 2018 16:06:01 -0500 Subject: sub_8145D18 --- include/pokemon_icon.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h index 2c2edcc7c..cef408046 100644 --- a/include/pokemon_icon.h +++ b/include/pokemon_icon.h @@ -12,5 +12,7 @@ void sub_80D2FF0(u16 iconId); void sub_80D2EF8(struct Sprite *sprite); void sub_809707C(void); void FreeMonIconPalettes(void); +u16 sub_8096FD4(u16); +u8 sub_8096ECC(u16, void (*)(struct Sprite *), s16, s16, u8, bool32); #endif // GUARD_POKEMON_ICON_H -- cgit v1.2.3 From 9e34e6b53d8c21c79e67c7b46ac658506abb4ed3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 2 Dec 2018 16:38:07 -0500 Subject: sub_8146060 --- include/decompress.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/decompress.h b/include/decompress.h index 5f3863dc7..36672dcfd 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -32,4 +32,6 @@ void LoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src u32 sub_8034974(const u8 *ptr); +void sub_800F034(const struct CompressedSpriteSheet *src); + #endif // GUARD_DECOMPRESS_H -- cgit v1.2.3 From 60b8858b19f50751d1222abd0c662d1ee938b3ce Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 2 Dec 2018 16:48:04 -0500 Subject: sub_81461D8 --- include/pokemon_icon.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h index cef408046..593715b7d 100644 --- a/include/pokemon_icon.h +++ b/include/pokemon_icon.h @@ -14,5 +14,6 @@ void sub_809707C(void); void FreeMonIconPalettes(void); u16 sub_8096FD4(u16); u8 sub_8096ECC(u16, void (*)(struct Sprite *), s16, s16, u8, bool32); +void sub_8097070(struct Sprite *); #endif // GUARD_POKEMON_ICON_H -- cgit v1.2.3 From 5151db6054d0704584fdf53e55840e262cde32a4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 2 Dec 2018 17:25:59 -0500 Subject: sub_8146288 --- include/global.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/global.h b/include/global.h index 783a2c375..840c90725 100644 --- a/include/global.h +++ b/include/global.h @@ -599,6 +599,7 @@ struct MEventBuffer_3120_Sub { u16 unk_00; u8 unk_02; + u8 unk_03; u8 filler_04[440]; }; -- cgit v1.2.3 From 208c6054475030ce48482c34647bd5728172b074 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 3 Dec 2018 08:41:06 -0500 Subject: sub_8146604 --- include/link_rfu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/link_rfu.h b/include/link_rfu.h index 065d23f9f..6e54fcc6c 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -4,5 +4,6 @@ void sub_8142504(const u8 *str); bool32 mevent_0814257C(u8 * cmdPtr, const u8 * src); void sub_80FA190(void); +void sub_8142420(void); #endif //GUARD_LINK_RFU_H -- cgit v1.2.3 From 59b87e9d2af887401736d8fd06d3a9266e3983e5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 3 Dec 2018 10:09:28 -0500 Subject: sub_8146980 --- include/global.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 840c90725..775b3115e 100644 --- a/include/global.h +++ b/include/global.h @@ -600,7 +600,8 @@ struct MEventBuffer_3120_Sub u16 unk_00; u8 unk_02; u8 unk_03; - u8 filler_04[440]; + u8 unk_04[40]; + u8 unk_2C[10][40]; }; struct MEventBuffer_3120 -- cgit v1.2.3 From 931f19d2ead516a5fb5a2a15784391ea02bdbbc3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 3 Dec 2018 20:21:35 -0500 Subject: Port mystery_event_script --- include/battle_tower.h | 2 +- include/constants/vars.h | 10 +++++----- include/easy_chat.h | 1 + include/global.berry.h | 1 + include/mail_data.h | 1 + include/mystery_event_msg.h | 18 ++++++++++++++++++ include/mystery_event_script.h | 2 +- include/strings.h | 2 ++ 8 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 include/mystery_event_msg.h (limited to 'include') diff --git a/include/battle_tower.h b/include/battle_tower.h index 0782725b6..ec00d1f96 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -5,6 +5,6 @@ u16 sub_8164FCC(u8, u8); void sub_80E7524(u32 *); -void sub_80E7490(void); +void ValidateEReaderTrainer(void); #endif //GUARD_BATTLE_TOWER_H diff --git a/include/constants/vars.h b/include/constants/vars.h index 6dc8d0ccd..c9340a3b4 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -51,12 +51,12 @@ #define VAR_0x402D 0x402D #define VAR_0x402E 0x402E -#define VAR_FRONTIER_MANIAC_FACILITY 0x402F +#define VAR_0x402F 0x402F -#define VAR_FRONTIER_GAMBLER_FACILITY 0x4030 -#define VAR_FRONTIER_GAMBLER_SET_FACILITY_F 0x4031 -#define VAR_FRONTIER_GAMBLER_AMOUNT_BET 0x4032 -#define VAR_FRONTIER_GAMBLER_PLACED_BET_F 0x4033 +#define VAR_0x4030 0x4030 +#define VAR_0x4031 0x4031 +#define VAR_0x4032 0x4032 +#define VAR_ENIGMA_BERRY_AVAILABLE 0x4033 #define VAR_0x4034 0x4034 #define VAR_0x4035 0x4035 diff --git a/include/easy_chat.h b/include/easy_chat.h index 78e371cbb..bd5c9a026 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -38,5 +38,6 @@ void InitializeEasyChatWordArray(u16 *words, u16 length); void ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 length1, u16 length2); bool8 ECWord_CheckIfOutsideOfValidRange(u16 word); void sub_80BDE28(void); +void EnableRareWord(u8); #endif // GUARD_EASYCHAT_H diff --git a/include/global.berry.h b/include/global.berry.h index 5c8a43a02..148bbc957 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -1,6 +1,7 @@ #ifndef GUARD_GLOBAL_BERRY_H #define GUARD_GLOBAL_BERRY_H +#define BERRY_NAME_LENGTH 6 #define BERRY_NAME_COUNT 7 #define BERRY_ITEM_EFFECT_COUNT 18 diff --git a/include/mail_data.h b/include/mail_data.h index bbe695203..0275d8dc6 100644 --- a/include/mail_data.h +++ b/include/mail_data.h @@ -10,5 +10,6 @@ // Exported ROM declarations u16 sub_80D45E8(u16, u16 *); +bool8 itemid_is_mail(u16 itemId); #endif //GUARD_MAIL_DATA_H diff --git a/include/mystery_event_msg.h b/include/mystery_event_msg.h new file mode 100644 index 000000000..e96c3069b --- /dev/null +++ b/include/mystery_event_msg.h @@ -0,0 +1,18 @@ +#ifndef GUARD_MYSTERY_EVENT_MSG_H +#define GUARD_MYSTERY_EVENT_MSG_H + +#include + +extern const u8 gText_MysteryGiftBerry[]; +extern const u8 gText_MysteryGiftBerryTransform[]; +extern const u8 gText_MysteryGiftBerryObtained[]; +extern const u8 gText_MysteryGiftSpecialRibbon[]; +extern const u8 gText_MysteryGiftNationalDex[]; +extern const u8 gText_MysteryGiftRareWord[]; +extern const u8 gText_MysteryGiftSentOver[]; +extern const u8 gText_MysteryGiftFullParty[]; +extern const u8 gText_MysteryGiftNewTrainer[]; +extern const u8 gText_MysteryGiftNewAdversaryInBattleTower[]; +extern const u8 gText_MysteryGiftCantBeUsed[]; + +#endif // GUARD_MYSTERY_EVENT_MSG_H diff --git a/include/mystery_event_script.h b/include/mystery_event_script.h index 8f90ccf53..be64663ed 100644 --- a/include/mystery_event_script.h +++ b/include/mystery_event_script.h @@ -7,7 +7,7 @@ u32 RunMysteryEventScript(u8 *); void SetMysteryEventScriptStatus(u32 val); u16 GetRecordMixingGift(void); -void sub_80DA89C(void *); +void sub_80DA89C(u8 *); bool32 sub_80DA8B0(u32 *); #endif // GUARD_MYSTERY_EVENT_SCRIPT_H diff --git a/include/strings.h b/include/strings.h index 90c84c9b9..40021a01d 100644 --- a/include/strings.h +++ b/include/strings.h @@ -89,5 +89,7 @@ extern const u8 gText_Cancel4[]; extern const u8 gText_IsThisTheCorrectTime[]; extern const u8 gText_PkmnFainted3[]; extern const u8 gText_Coins[]; +extern const u8 gText_EggNickname[]; +extern const u8 gText_Pokemon[]; #endif //GUARD_STRINGS_H -- cgit v1.2.3 From c14c6d36f8a60fd561f7c24339b575807bc6066f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 5 Dec 2018 08:43:55 -0500 Subject: Rename most special vars --- include/event_data.h | 4 ++-- include/item_menu.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/event_data.h b/include/event_data.h index bced2a88f..13e388bf2 100644 --- a/include/event_data.h +++ b/include/event_data.h @@ -56,7 +56,7 @@ extern u16 gSpecialVar_MonBoxId; extern u16 gSpecialVar_MonBoxPos; extern u16 gSpecialVar_0x8014; -extern u16 gUnknown_20370D0; -extern u16 gUnknown_20370C0; +extern u16 gSpecialVar_Result; +extern u16 gSpecialVar_0x8004; #endif // GUARD_EVENT_DATA_H diff --git a/include/item_menu.h b/include/item_menu.h index 2482aa51f..a6128b9fb 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -7,7 +7,7 @@ // Exported RAM declarations -extern u16 gUnknown_203AD30; +extern u16 gSpecialVar_ItemId; // Exported ROM declarations void sub_81AAC50(void); -- cgit v1.2.3