summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle_tower.h2
-rw-r--r--include/cereader_tool.h9
-rw-r--r--include/constants/vars.h10
-rw-r--r--include/decompress.h2
-rw-r--r--include/easy_chat.h2
-rw-r--r--include/event_data.h6
-rw-r--r--include/global.berry.h1
-rw-r--r--include/global.h73
-rw-r--r--include/help_system.h2
-rw-r--r--include/item_menu.h2
-rw-r--r--include/link.h14
-rw-r--r--include/link_rfu.h9
-rw-r--r--include/mail_data.h1
-rw-r--r--include/main.h6
-rw-r--r--include/mevent.h44
-rw-r--r--include/mevent_server.h95
-rw-r--r--include/mystery_event_msg.h18
-rw-r--r--include/mystery_event_script.h3
-rw-r--r--include/mystery_gift_menu.h9
-rw-r--r--include/pokemon_icon.h5
-rw-r--r--include/script.h3
-rw-r--r--include/strings.h2
-rw-r--r--include/unk_815c27c.h11
-rw-r--r--include/util.h4
24 files changed, 318 insertions, 15 deletions
diff --git a/include/battle_tower.h b/include/battle_tower.h
index 120ab9a99..ec00d1f96 100644
--- a/include/battle_tower.h
+++ b/include/battle_tower.h
@@ -4,5 +4,7 @@
#include "global.h"
u16 sub_8164FCC(u8, u8);
+void sub_80E7524(u32 *);
+void ValidateEReaderTrainer(void);
#endif //GUARD_BATTLE_TOWER_H
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/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/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
diff --git a/include/easy_chat.h b/include/easy_chat.h
index 2b5664420..bd5c9a026 100644
--- a/include/easy_chat.h
+++ b/include/easy_chat.h
@@ -37,5 +37,7 @@ 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);
+void EnableRareWord(u8);
#endif // GUARD_EASYCHAT_H
diff --git a/include/event_data.h b/include/event_data.h
index 2e340f073..13e388bf2 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;
@@ -54,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/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/global.h b/include/global.h
index d5bfc5241..775b3115e 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
@@ -264,7 +266,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,6 +595,68 @@ 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;
+ u8 unk_03;
+ u8 unk_04[40];
+ u8 unk_2C[10][40];
+};
+
+struct MEventBuffer_3120
+{
+ u32 crc;
+ struct MEventBuffer_3120_Sub data;
+};
+
+struct MEventBuffer_32E0_Sub
+{
+ u16 unk_00;
+ u16 unk_02;
+ u32 unk_04;
+ u8 unk_08_0:2;
+ u8 unk_08_2:4;
+ u8 unk_08_6:2;
+ u8 unk_09;
+ u8 unk_0A[40];
+ u8 unk_32[40];
+ u8 unk_5A[4][40];
+ u8 unk_FA[40];
+ u8 unk_122[40];
+};
+
+struct MEventBuffer_32E0
+{
+ u32 crc;
+ struct MEventBuffer_32E0_Sub data;
+};
+
+struct MEventBuffer_3430_Sub
+{
+ u16 unk_00;
+ u16 unk_02;
+ u16 unk_04;
+ u16 unk_06;
+ u16 unk_08[2][7];
+};
+
+struct MEventBuffer_3430
+{
+ u32 crc;
+ struct MEventBuffer_3430_Sub data;
+};
+
+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*/ u32 unk_344[2][5];
+}; // 0x36C 0x348C
+
struct SaveBlock1
{
/*0x0000*/ struct Coords16 pos;
@@ -638,9 +704,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_348C[0x190];
/*0x361C*/ struct RamScript ramScript;
/*0x3A08*/ u8 filler3A08[12];
/*0x3A14*/ u8 seen2[DEX_FLAGS_NO];
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/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);
diff --git a/include/link.h b/include/link.h
index 239a59b71..ef8776c64 100644
--- a/include/link.h
+++ b/include/link.h
@@ -146,6 +146,11 @@ extern u16 word_3002910[];
extern bool8 gReceivedRemoteLinkPlayers;
extern bool8 gLinkVSyncDisabled;
+extern u8 gUnknown_3003F64;
+extern u8 gUnknown_3003F84;
+extern u64 gUnknown_3003FB4;
+extern u16 gLinkType;
+
void Task_DestroySelf(u8);
void OpenLink(void);
void CloseLink(void);
@@ -164,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);
@@ -196,5 +201,12 @@ void sub_8011BD0(void);
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);
+void sub_80098D8(void);
+void sub_80098B8(void);
+bool8 sub_800A4BC(void);
#endif // GUARD_LINK_H
diff --git a/include/link_rfu.h b/include/link_rfu.h
new file mode 100644
index 000000000..6e54fcc6c
--- /dev/null
+++ b/include/link_rfu.h
@@ -0,0 +1,9 @@
+#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);
+void sub_8142420(void);
+
+#endif //GUARD_LINK_RFU_H
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/main.h b/include/main.h
index 84d356692..adbf1fb5d 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,9 @@ void SetSerialCallback(IntrCallback callback);
void InitFlashTimer(void);
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..d940b212c 100644
--- a/include/mevent.h
+++ b/include/mevent.h
@@ -3,7 +3,51 @@
#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 MEvent_Str_1
+{
+ u16 unk_000;
+ size_t unk_004;
+ const void * unk_008;
+};
+
+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/mevent_server.h b/include/mevent_server.h
new file mode 100644
index 000000000..e593b5dbd
--- /dev/null
+++ b/include/mevent_server.h
@@ -0,0 +1,95 @@
+#ifndef GUARD_MEVENT_SERVER_H
+#define GUARD_MEVENT_SERVER_H
+
+#include "global.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;
+};
+
+struct mevent_cmd_ish
+{
+ u32 instr;
+ u32 parameter;
+};
+
+struct mevent_srv_ish
+{
+ u32 unk_00;
+ u32 param;
+ u32 mainseqno;
+ u32 flag;
+ u32 cmdidx;
+ void * sendBuffer;
+ void * recvBuffer;
+ struct mevent_cmd_ish * cmdBuffer;
+ void * buffer;
+ struct mevent_srv_sub manager;
+};
+
+struct mevent_cmd
+{
+ u32 instr;
+ bool32 flag;
+ void * parameter;
+};
+
+struct mevent_srv_common
+{
+ u32 unk_00;
+ u32 param;
+ u32 mainseqno;
+ u32 cmdidx;
+ const struct mevent_cmd * cmdBuffer;
+ 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);
+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 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
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 <gba/gba.h>
+
+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 1ba1464fa..be64663ed 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(u8 *);
+bool32 sub_80DA8B0(u32 *);
+
#endif // GUARD_MYSTERY_EVENT_SCRIPT_H
diff --git a/include/mystery_gift_menu.h b/include/mystery_gift_menu.h
new file mode 100644
index 000000000..24bf85a13
--- /dev/null
+++ b/include/mystery_gift_menu.h
@@ -0,0 +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 da58a2d83..593715b7d 100644
--- a/include/pokemon_icon.h
+++ b/include/pokemon_icon.h
@@ -10,5 +10,10 @@ 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);
+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
diff --git a/include/script.h b/include/script.h
index 9e26b8a28..ebb4caa86 100644
--- a/include/script.h
+++ b/include/script.h
@@ -62,5 +62,8 @@ 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);
+void sub_8069EA4(u8 * script, u16 scriptSize);
+u8 * sub_8069E48(void);
#endif // GUARD_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
diff --git a/include/unk_815c27c.h b/include/unk_815c27c.h
new file mode 100644
index 000000000..cc1cbb7ce
--- /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, size_t, const void *, u8);
+
+#endif //GUARD_UNK_815C27C_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