From b7cfa9d36537b8ae53012eb88d59f8b842fb35c4 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Fri, 8 Mar 2019 21:39:51 -0500 Subject: Move more contest constants into C --- include/graphics.h | 8 ++++++++ include/sprite.h | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index c651268ca..063f71ee5 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4765,6 +4765,14 @@ extern const u32 gUnknown_08C16FA8[]; extern const u32 gUnknown_08C16E90[]; extern const u32 gUnknown_08C17170[]; extern const u32 gUnknown_08C17980[]; +extern const u32 gTiles_8C19450[]; +extern const u32 gContestNextTurnGfx[]; +extern const u16 gContestPal[]; +extern const u32 gUnknown_08C19168[]; +extern const u32 gContestApplauseGfx[]; +extern const u32 gContestJudgeGfx[]; +extern const u32 gContestJudgeSymbolsGfx[]; +extern const u32 gContest3Pal[]; extern const u32 gUnknown_08D95E00[]; extern const u32 gUnknown_08D960D0[]; diff --git a/include/sprite.h b/include/sprite.h index 32bdd9c55..10c4145b0 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -151,6 +151,26 @@ enum SUBSPRITES_IGNORE_PRIORITY, // on but priority is ignored }; +#define OAM_SIZE_0 (0) +#define OAM_SIZE_1 (1 << 0) +#define OAM_SIZE_2 (1 << 1) +#define OAM_SIZE_3 (1 << 2) + +#define SPRITE_SIZE_8x8 .shape = ST_OAM_SQUARE, .size = OAM_SIZE_0 +#define SPRITE_SIZE_16x16 .shape = ST_OAM_SQUARE, .size = OAM_SIZE_1 +#define SPRITE_SIZE_32x32 .shape = ST_OAM_SQUARE, .size = OAM_SIZE_2 +#define SPRITE_SIZE_64x64 .shape = ST_OAM_SQUARE, .size = OAM_SIZE_3 + +#define SPRITE_SIZE_16x8 .shape = ST_OAM_H_RECTANGLE, .size = OAM_SIZE_0 +#define SPRITE_SIZE_32x8 .shape = ST_OAM_H_RECTANGLE, .size = OAM_SIZE_1 +#define SPRITE_SIZE_32x16 .shape = ST_OAM_H_RECTANGLE, .size = OAM_SIZE_2 +#define SPRITE_SIZE_64x32 .shape = ST_OAM_H_RECTANGLE, .size = OAM_SIZE_3 + +#define SPRITE_SIZE_8x16 .shape = ST_OAM_V_RECTANGLE, .size = OAM_SIZE_0 +#define SPRITE_SIZE_8x32 .shape = ST_OAM_V_RECTANGLE, .size = OAM_SIZE_1 +#define SPRITE_SIZE_16x32 .shape = ST_OAM_V_RECTANGLE, .size = OAM_SIZE_2 +#define SPRITE_SIZE_32x64 .shape = ST_OAM_V_RECTANGLE, .size = OAM_SIZE_3 + struct Subsprite { s8 x; // was u16 in R/S -- cgit v1.2.3 From 5b4b0a245be14b7485c3e2cc40e40c78eeaa7ce0 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 9 Mar 2019 00:00:10 -0500 Subject: Move contest winner list to C --- include/contest.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/contest.h b/include/contest.h index 8146486cb..4fbec9d22 100644 --- a/include/contest.h +++ b/include/contest.h @@ -196,6 +196,14 @@ enum CONTEST_STRING_NONE = 255 }; +enum { + CONTEST_RANK_NORMAL, + CONTEST_RANK_SUPER, + CONTEST_RANK_HYPER, + CONTEST_RANK_MASTER, + CONTEST_RANK_LINK +}; + struct ContestPokemon { /*0x00*/ u16 species; -- cgit v1.2.3 From 153499ed6f08b6546349ba1ec33ea9e18840f44b Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 9 Mar 2019 01:38:38 -0500 Subject: Clean up contest_opponents.inc --- include/contest.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/contest.h b/include/contest.h index 4fbec9d22..a803c6d4c 100644 --- a/include/contest.h +++ b/include/contest.h @@ -208,15 +208,17 @@ struct ContestPokemon { /*0x00*/ u16 species; /*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; - /*0x0D*/ u8 trainerName[8]; + /*0x0D*/ u8 trainerName[PLAYER_NAME_LENGTH + 1]; /*0x15*/ u8 trainerGfxId; + // Temp note: 2 bytes of padding /*0x18*/ u32 flags; - /*0x1C*/ u8 whichRank:2; - u8 aiPool_Cool:1; - u8 aiPool_Beauty:1; - u8 aiPool_Cute:1; - u8 aiPool_Smart:1; - u8 aiPool_Tough:1; + /*0x1C*/ u8 whichRank:2; // 0x1 0x2 + u8 aiPool_Cool:1; // 0x4 + u8 aiPool_Beauty:1; // 0x8 + u8 aiPool_Cute:1; // 0x10 + u8 aiPool_Smart:1; // 0x20 + u8 aiPool_Tough:1; // 0x40 + // Temp note: 1 byte of padding /*0x1E*/ u16 moves[4]; // moves /*0x26*/ u8 cool; // cool /*0x27*/ u8 beauty; // beauty @@ -227,7 +229,7 @@ struct ContestPokemon /*0x2C*/ u8 unk2C[12]; /*0x38*/ u32 personality; // personality /*0x3C*/ u32 otId; // otId -}; // wow +}; struct Shared18000 { -- cgit v1.2.3 From 0c935a8bd500535ba67fad4f25ea50199cfc1871 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 9 Mar 2019 22:54:17 -0500 Subject: Move the contest opponent filter to C --- include/contest.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/contest.h b/include/contest.h index a803c6d4c..5c299bee5 100644 --- a/include/contest.h +++ b/include/contest.h @@ -204,6 +204,12 @@ enum { CONTEST_RANK_LINK }; +enum { + CONTEST_FILTER_NONE, + CONTEST_FILTER_NO_POSTGAME, + CONTEST_FILTER_ONLY_POSTGAME +}; + struct ContestPokemon { /*0x00*/ u16 species; -- cgit v1.2.3 From 7f70b629f569ce9a4c1b90cca3a3ce86ebd3e1c2 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 12 Mar 2019 05:35:15 -0400 Subject: Document sAreaGlowTilemapMapping I used a script to generate the format for the array, so I can easily change its formatting if needed. --- include/constants/maps.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/constants/maps.h b/include/constants/maps.h index e1e2da992..93291f29e 100644 --- a/include/constants/maps.h +++ b/include/constants/maps.h @@ -9,4 +9,10 @@ #define MAP_GROUP(map) (MAP_##map >> 8) #define MAP_NUM(map) (MAP_##map & 0xFF) +// These groups are used by pokedex_area_screen.c to find wild +// pokemon locations. +#define MAP_AREA_OVERWORLD_MONS MAP_GROUP(PETALBURG_CITY) +#define MAP_AREA_SPECIAL_MONS_1 MAP_GROUP(METEOR_FALLS_1F_1R) +#define MAP_AREA_SPECIAL_MONS_2 MAP_GROUP(SAFARI_ZONE_NORTHWEST) + #endif // GUARD_CONSTANTS_MAPS_H -- cgit v1.2.3 From f34cda3b5209735fbf276b0f23e29549b1a1a3d9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 30 Mar 2019 13:14:00 -0400 Subject: Start decompiling mystery gift --- include/mystery_gift.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 include/mystery_gift.h (limited to 'include') diff --git a/include/mystery_gift.h b/include/mystery_gift.h new file mode 100644 index 000000000..b83239bc7 --- /dev/null +++ b/include/mystery_gift.h @@ -0,0 +1,4 @@ +#ifndef GUARD_MYSTERY_GIFT_H +#define GUARD_MYSTERY_GIFT_H + +#endif //GUARD_MYSTERY_GIFT_H -- cgit v1.2.3 From aafe9df454f42c77146d76676cc477e876d6540b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 30 Mar 2019 14:36:52 -0400 Subject: through sub_8018798 --- include/mevent2.h | 6 ++ include/mystery_gift.h | 4 ++ include/rom_8011DC0.h | 171 ------------------------------------------------ include/strings.h | 20 ++++++ include/union_room.h | 172 ++++++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 199 insertions(+), 174 deletions(-) create mode 100644 include/mevent2.h (limited to 'include') diff --git a/include/mevent2.h b/include/mevent2.h new file mode 100644 index 000000000..80b1fd51b --- /dev/null +++ b/include/mevent2.h @@ -0,0 +1,6 @@ +#ifndef GUARD_MEVENT2_H +#define GUARD_MEVENT2_H + +void sub_801B990(u32, u32); + +#endif //GUARD_MEVENT2_H diff --git a/include/mystery_gift.h b/include/mystery_gift.h index b83239bc7..b43fbe9a9 100644 --- a/include/mystery_gift.h +++ b/include/mystery_gift.h @@ -1,4 +1,8 @@ #ifndef GUARD_MYSTERY_GIFT_H #define GUARD_MYSTERY_GIFT_H +void sub_8018438(void); +void sub_80186EC(bool8 isJapanese, bool32 usePickOkCancel); +void sub_8018798(u32 bg); + #endif //GUARD_MYSTERY_GIFT_H diff --git a/include/rom_8011DC0.h b/include/rom_8011DC0.h index fa54fca66..ee7397320 100644 --- a/include/rom_8011DC0.h +++ b/include/rom_8011DC0.h @@ -1,175 +1,4 @@ #ifndef GUARD_rom_8011DC0_H #define GUARD_rom_8011DC0_H -#include "librfu.h" - -// Exported type declarations - -struct UnkStruct_Shared -{ - struct UnkLinkRfuStruct_02022B14 field_0; - u8 ALIGNED(4) playerName[PLAYER_NAME_LENGTH + 1]; -}; - -struct UnkStruct_x1C -{ - struct UnkStruct_Shared unk0; - u8 unk18:1; -}; - -struct UnkStruct_x20 -{ - struct UnkStruct_Shared unk; - u16 field_18; - u8 field_1A_0:2; - u8 field_1A_1:1; - u8 field_1B; - u8 field_1D; - u8 field_1E; - u8 field_1F; -}; - -struct UnkStruct_Main0 -{ - struct UnkStruct_x20 arr[8]; -}; - -struct UnkStruct_Main4 -{ - struct UnkStruct_x1C arr[5]; -}; - -struct UnkStruct_Main8 -{ - struct UnkStruct_x20 arr[5]; -}; - -struct UnkStruct_Leader -{ - struct UnkStruct_Main0 *field_0; - struct UnkStruct_Main4 *field_4; - struct UnkStruct_Main8 *field_8; - u8 state; - u8 textState; - u8 field_E; - u8 listWindowId; - u8 field_10; - u8 field_11; - u8 listTaskId; - u8 field_13; - u8 field_14; - u8 field_15; - u8 field_16; - u8 field_17; - u8 field_18; - u8 field_19; - u16 field_1A; -}; - -struct UnkStruct_Group -{ - struct UnkStruct_Main0 *field_0; - struct UnkStruct_Main4 *field_4; - u8 state; - u8 textState; - u8 field_A; - u8 listWindowId; - u8 field_C; - u8 field_D; - u8 listTaskId; - u8 field_F; - u8 field_10; - u8 field_11; - u8 field_12; - u8 field_13; - u8 field_14; - u8 field_15; -}; - -struct UnkStruct_8019BA8 -{ - u8 field_0; - u8 field_1; - u8 field_2; - u8 field_3; -}; - -struct UnkStruct_URoom -{ - struct UnkStruct_Main0 *field_0; - struct UnkStruct_Main4 *field_4; - struct UnkStruct_Main0 *field_8; - struct UnkStruct_Main4 *field_C; - u16 field_10; - u16 field_12; - u8 state; - u8 stateAfterPrint; - u8 textState; - u8 field_17; - u8 field_18; - u8 field_19; - u8 field_1A; - u8 field_1B; - u8 field_1C; - u8 field_1D; - u8 field_1E; - u8 field_1F; - u8 field_20; - u8 spriteIds[40]; - u8 field_49; - u8 field_4A; - u16 field_4C[6]; - u8 field_58[0x98 - 0x58]; - u16 field_98; - u16 field_9A[3]; - struct UnkStruct_8019BA8 field_A0[8]; - u8 field_C0[12][15]; - u8 field_174[48]; - u8 field_1A4[200]; -}; - -union UnkUnion_Main -{ - struct UnkStruct_Leader *leader; - struct UnkStruct_Group *group; - struct UnkStruct_URoom *uRoom; -}; - -struct TradeUnkStruct -{ - u16 field_0; - u16 type; - u32 playerPersonality; - u8 field_8; - u8 field_9; - u16 playerSpecies; - u16 playerLevel; - u16 species; - u16 level; - u16 field_12; - u32 personality; -}; - -// Exported RAM declarations - -extern u8 gUnknown_02022C2C; -extern union UnkUnion_Main gUnknown_02022C30; -extern struct UnkLinkRfuStruct_02022B14Substruct gUnknown_02022C38; - -extern u16 gUnknown_02022C3C; -extern u8 gUnknown_02022C3E; - -// Exported ROM declarations - -void sub_8018438(void); -void sub_801B990(u32, u32); -u8 sub_8013F78(void); -bool32 sub_802C908(u16); -void nullsub_89(u8 taskId); -void var_800D_set_xB(void); - -bool32 mevent_0814257C(u8 *textState, const u8 *str); -void sub_8018884(const u8 *src); -void sub_80186A4(void); - #endif //GUARD_rom_8011DC0_H diff --git a/include/strings.h b/include/strings.h index c762ebd45..2f9a64af1 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2607,4 +2607,24 @@ extern const u8 gText_YayUnkF9F9[]; extern const u8 gText_ThankYou[]; extern const u8 gText_ByeBye[]; +// Mystery Gift +extern const u8 gText_MysteryGift[]; +extern const u8 gText_PickOKCancel[]; +extern const u8 gText_PickOKExit[]; +extern const u8 gJPText_MysteryGift[]; +extern const u8 gJPText_DecideStop[]; +extern const u8 gText_WonderCards[]; +extern const u8 gText_WonderNews[]; +extern const u8 gText_Exit3[]; +extern const u8 gText_WirelessCommunication[]; +extern const u8 gText_Friend2[]; +extern const u8 gText_Cancel2[]; +extern const u8 gText_Receive[]; +extern const u8 gText_Send[]; +extern const u8 gText_Toss[]; +extern const u8 gText_VarietyOfEventsImportedWireless[]; +extern const u8 gText_WonderCardsInPossession[]; +extern const u8 gText_ReadNewsThatArrived[]; +extern const u8 gText_ReturnToTitle[]; + #endif // GUARD_STRINGS_H diff --git a/include/union_room.h b/include/union_room.h index 7634e4763..84a7f1f2b 100644 --- a/include/union_room.h +++ b/include/union_room.h @@ -1,9 +1,175 @@ #ifndef GUARD_UNION_ROOM_H #define GUARD_UNION_ROOM_H -extern bool8 gUnknown_02022C60; +#include "librfu.h" + +// Exported type declarations + +struct UnkStruct_Shared +{ + struct UnkLinkRfuStruct_02022B14 field_0; + u8 ALIGNED(4) playerName[PLAYER_NAME_LENGTH + 1]; +}; + +struct UnkStruct_x1C +{ + struct UnkStruct_Shared unk0; + u8 unk18:1; +}; + +struct UnkStruct_x20 +{ + struct UnkStruct_Shared unk; + u16 field_18; + u8 field_1A_0:2; + u8 field_1A_1:1; + u8 field_1B; + u8 field_1D; + u8 field_1E; + u8 field_1F; +}; + +struct UnkStruct_Main0 +{ + struct UnkStruct_x20 arr[8]; +}; + +struct UnkStruct_Main4 +{ + struct UnkStruct_x1C arr[5]; +}; + +struct UnkStruct_Main8 +{ + struct UnkStruct_x20 arr[5]; +}; + +struct UnkStruct_Leader +{ + struct UnkStruct_Main0 *field_0; + struct UnkStruct_Main4 *field_4; + struct UnkStruct_Main8 *field_8; + u8 state; + u8 textState; + u8 field_E; + u8 listWindowId; + u8 field_10; + u8 field_11; + u8 listTaskId; + u8 field_13; + u8 field_14; + u8 field_15; + u8 field_16; + u8 field_17; + u8 field_18; + u8 field_19; + u16 field_1A; +}; + +struct UnkStruct_Group +{ + struct UnkStruct_Main0 *field_0; + struct UnkStruct_Main4 *field_4; + u8 state; + u8 textState; + u8 field_A; + u8 listWindowId; + u8 field_C; + u8 field_D; + u8 listTaskId; + u8 field_F; + u8 field_10; + u8 field_11; + u8 field_12; + u8 field_13; + u8 field_14; + u8 field_15; +}; + +struct UnkStruct_8019BA8 +{ + u8 field_0; + u8 field_1; + u8 field_2; + u8 field_3; +}; -void sub_8018798(u8); -void sub_80186EC(bool8, bool32); +struct UnkStruct_URoom +{ + struct UnkStruct_Main0 *field_0; + struct UnkStruct_Main4 *field_4; + struct UnkStruct_Main0 *field_8; + struct UnkStruct_Main4 *field_C; + u16 field_10; + u16 field_12; + u8 state; + u8 stateAfterPrint; + u8 textState; + u8 field_17; + u8 field_18; + u8 field_19; + u8 field_1A; + u8 field_1B; + u8 field_1C; + u8 field_1D; + u8 field_1E; + u8 field_1F; + u8 field_20; + u8 spriteIds[40]; + u8 field_49; + u8 field_4A; + u16 field_4C[6]; + u8 field_58[0x98 - 0x58]; + u16 field_98; + u16 field_9A[3]; + struct UnkStruct_8019BA8 field_A0[8]; + u8 field_C0[12][15]; + u8 field_174[48]; + u8 field_1A4[200]; +}; + +union UnkUnion_Main +{ + struct UnkStruct_Leader *leader; + struct UnkStruct_Group *group; + struct UnkStruct_URoom *uRoom; +}; + +struct TradeUnkStruct +{ + u16 field_0; + u16 type; + u32 playerPersonality; + u8 field_8; + u8 field_9; + u16 playerSpecies; + u16 playerLevel; + u16 species; + u16 level; + u16 field_12; + u32 personality; +}; + +// Exported RAM declarations + +extern u8 gUnknown_02022C2C; +extern union UnkUnion_Main gUnknown_02022C30; +extern struct UnkLinkRfuStruct_02022B14Substruct gUnknown_02022C38; + +extern u16 gUnknown_02022C3C; +extern u8 gUnknown_02022C3E; + +// Exported ROM declarations + +u8 sub_8013F78(void); +bool32 sub_802C908(u16); +void nullsub_89(u8 taskId); +void var_800D_set_xB(void); + +bool32 mevent_0814257C(u8 *textState, const u8 *str); +void sub_8018884(const u8 *src); +void sub_80186A4(void); + +extern bool8 gUnknown_02022C60; #endif //GUARD_UNION_ROOM_H -- cgit v1.2.3 From f88f815cff272f4cd19759f2df24f85bc5f02ae1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 11:16:19 -0400 Subject: WIP sub_8018DAC --- include/list_menu.h | 2 +- include/mevent_801BAAC.h | 9 +++++++++ include/strings.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 include/mevent_801BAAC.h (limited to 'include') diff --git a/include/list_menu.h b/include/list_menu.h index a301e5b32..0a54a069a 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -98,7 +98,7 @@ struct CursorStruct extern struct ScrollArrowsTemplate gTempScrollArrowTemplate; extern struct ListMenuTemplate gMultiuseListMenuTemplate; -s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); +s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow); u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow); s32 ListMenu_ProcessInput(u8 listTaskId); diff --git a/include/mevent_801BAAC.h b/include/mevent_801BAAC.h new file mode 100644 index 000000000..db1bb0571 --- /dev/null +++ b/include/mevent_801BAAC.h @@ -0,0 +1,9 @@ +#ifndef GUARD_MEVENT_801BAAC_H +#define GUARD_MEVENT_801BAAC_H + +bool32 sub_801BAAC(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6); +bool32 sub_801C6C8(const struct MEventBuffer_3120_Sub * a0); +s32 sub_801BB74(void); +s32 sub_801C758(void); + +#endif //GUARD_MEVENT_801BAAC_H diff --git a/include/strings.h b/include/strings.h index 2f9a64af1..2ef8411c7 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2626,5 +2626,7 @@ extern const u8 gText_VarietyOfEventsImportedWireless[]; extern const u8 gText_WonderCardsInPossession[]; extern const u8 gText_ReadNewsThatArrived[]; extern const u8 gText_ReturnToTitle[]; +extern const u8 gText_WhatToDoWithCards[]; +extern const u8 gText_WhatToDoWithNews[]; #endif // GUARD_STRINGS_H -- cgit v1.2.3 From 813de11154ac9ac6d561ef820d2a13995ce5bb35 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 12:27:36 -0400 Subject: Through mevent_save_game --- include/mevent_801BAAC.h | 4 ++++ include/strings.h | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/mevent_801BAAC.h b/include/mevent_801BAAC.h index db1bb0571..d747b389c 100644 --- a/include/mevent_801BAAC.h +++ b/include/mevent_801BAAC.h @@ -5,5 +5,9 @@ bool32 sub_801BAAC(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_S bool32 sub_801C6C8(const struct MEventBuffer_3120_Sub * a0); s32 sub_801BB74(void); s32 sub_801C758(void); +s32 sub_801BDA4(bool32 flag); +void sub_801BB48(void); +s32 sub_801CA50(bool32 flag); +void sub_801C72C(void); #endif //GUARD_MEVENT_801BAAC_H diff --git a/include/strings.h b/include/strings.h index 2ef8411c7..36c4e36d9 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2628,5 +2628,11 @@ extern const u8 gText_ReadNewsThatArrived[]; extern const u8 gText_ReturnToTitle[]; extern const u8 gText_WhatToDoWithCards[]; extern const u8 gText_WhatToDoWithNews[]; +extern const u8 gText_IfThrowAwayCardEventWontHappen[]; +extern const u8 gText_OkayToDiscardNews[]; +extern const u8 gText_WonderNewsThrownAway[]; +extern const u8 gText_WonderCardThrownAway[]; +extern const u8 gText_DataWillBeSaved[]; +extern const u8 gText_SaveCompletedPressA[]; #endif // GUARD_STRINGS_H -- cgit v1.2.3 From fb5c19a33bf314f4976ae56ce13f4dc9d9ed0fe0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 12:36:48 -0400 Subject: through mevent_message --- include/strings.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/strings.h b/include/strings.h index 36c4e36d9..4a07d4efb 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2634,5 +2634,21 @@ extern const u8 gText_WonderNewsThrownAway[]; extern const u8 gText_WonderCardThrownAway[]; extern const u8 gText_DataWillBeSaved[]; extern const u8 gText_SaveCompletedPressA[]; +extern const u8 gText_NothingSentOver[]; +extern const u8 gText_RecordUploadedViaWireless[]; +extern const u8 gText_WonderCardReceivedFrom[]; +extern const u8 gText_WonderCardReceived[]; +extern const u8 gText_WonderNewsReceivedFrom[]; +extern const u8 gText_WonderNewsReceived[]; +extern const u8 gText_NewStampReceived[]; +extern const u8 gText_AlreadyHadCard[]; +extern const u8 gText_AlreadyHadStamp[]; +extern const u8 gText_AlreadyHadNews[]; +extern const u8 gText_NoMoreRoomForStamps[]; +extern const u8 gText_CommunicationCanceled[]; +extern const u8 gText_CantAcceptNewsFromTrainer[]; +extern const u8 gText_CantAcceptCardFromTrainer[]; +extern const u8 gText_CommunicationError[]; +extern const u8 gText_NewTrainerReceived[]; #endif // GUARD_STRINGS_H -- cgit v1.2.3 From 90fb329b70433e75cfd571d8b33df2593d2b7656 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 12:55:27 -0400 Subject: through task_add_00_mystery_gift --- include/strings.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/strings.h b/include/strings.h index 4a07d4efb..0e6b2f31c 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2650,5 +2650,16 @@ extern const u8 gText_CantAcceptNewsFromTrainer[]; extern const u8 gText_CantAcceptCardFromTrainer[]; extern const u8 gText_CommunicationError[]; extern const u8 gText_NewTrainerReceived[]; +extern const u8 gText_RecordUploadedViaWireless[]; +extern const u8 gText_WonderCardSentTo[]; +extern const u8 gText_WonderNewsSentTo[]; +extern const u8 gText_StampSentTo[]; +extern const u8 gText_OtherTrainerHasCard[]; +extern const u8 gText_OtherTrainerHasStamp[]; +extern const u8 gText_OtherTrainerHasNews[]; +extern const u8 gText_NoMoreRoomForStamps[]; +extern const u8 gText_OtherTrainerCanceled[]; +extern const u8 gText_GiftSentTo[]; +extern const u8 gText_CantSendGiftToTrainer[]; #endif // GUARD_STRINGS_H -- cgit v1.2.3 From 0a8427c8effeefc58c542f249d7384648585ff4a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 15:50:25 -0400 Subject: fakematching task00_mystery_gift --- include/mevent_801BAAC.h | 3 +++ include/mevent_news.h | 1 + include/mevent_server.h | 8 ++++++++ include/mevent_server_ish.h | 10 ++++++++++ include/strings.h | 11 +++++++++++ include/union_room.h | 3 +++ 6 files changed, 36 insertions(+) create mode 100644 include/mevent_server.h create mode 100644 include/mevent_server_ish.h (limited to 'include') diff --git a/include/mevent_801BAAC.h b/include/mevent_801BAAC.h index d747b389c..2259d3b6d 100644 --- a/include/mevent_801BAAC.h +++ b/include/mevent_801BAAC.h @@ -9,5 +9,8 @@ s32 sub_801BDA4(bool32 flag); void sub_801BB48(void); s32 sub_801CA50(bool32 flag); void sub_801C72C(void); +u32 sub_801CCD0(u16 input); +void sub_801CC80(void); +void sub_801CC38(void); #endif //GUARD_MEVENT_801BAAC_H diff --git a/include/mevent_news.h b/include/mevent_news.h index 698d7148c..4632edd38 100755 --- a/include/mevent_news.h +++ b/include/mevent_news.h @@ -2,5 +2,6 @@ #define GUARD_MEVENT_NEWS_H void sub_801DBC0(void); +void sub_801DB68(u32 a0); #endif //GUARD_MEVENT_NEWS_H diff --git a/include/mevent_server.h b/include/mevent_server.h new file mode 100644 index 000000000..ca3b7091b --- /dev/null +++ b/include/mevent_server.h @@ -0,0 +1,8 @@ +#ifndef GUARD_MEVENT_SERVER_H +#define GUARD_MEVENT_SERVER_H + +void mevent_srv_new_wcard(); +void mevent_srv_init_wnews(); +u32 sub_801D0C4(u16 * a0); + +#endif //GUARD_MEVENT_SERVER_H diff --git a/include/mevent_server_ish.h b/include/mevent_server_ish.h new file mode 100644 index 000000000..76f5080dc --- /dev/null +++ b/include/mevent_server_ish.h @@ -0,0 +1,10 @@ +#ifndef GUARD_MEVENT_SERVER_ISH_H +#define GUARD_MEVENT_SERVER_ISH_H + +void sub_801D484(u32 arg); +u32 sub_801D4A8(u16 * a0); +void sub_801D4E4(void); +void * sub_801D4F4(void); +void sub_801D500(u32 a0); + +#endif //GUARD_MEVENT_SERVER_ISH_H diff --git a/include/strings.h b/include/strings.h index 0e6b2f31c..1561da26d 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2661,5 +2661,16 @@ extern const u8 gText_NoMoreRoomForStamps[]; extern const u8 gText_OtherTrainerCanceled[]; extern const u8 gText_GiftSentTo[]; extern const u8 gText_CantSendGiftToTrainer[]; +extern const u8 gText_DontHaveCardNewOneInput[]; +extern const u8 gText_DontHaveNewsNewOneInput[]; +extern const u8 gText_WhereShouldCardBeAccessed[]; +extern const u8 gText_WhereShouldNewsBeAccessed[]; +extern const u8 gText_Communicating[]; +extern const u8 gText_ThrowAwayWonderCard[]; +extern const u8 gText_HaventReceivedCardsGift[]; +extern const u8 gText_CommunicationCompleted[]; +extern const u8 gText_HaventReceivedGiftOkayToDiscard[]; +extern const u8 gText_SendingWonderCard[]; +extern const u8 gText_SendingWonderNews[]; #endif // GUARD_STRINGS_H diff --git a/include/union_room.h b/include/union_room.h index 84a7f1f2b..3d60e1432 100644 --- a/include/union_room.h +++ b/include/union_room.h @@ -169,6 +169,9 @@ void var_800D_set_xB(void); bool32 mevent_0814257C(u8 *textState, const u8 *str); void sub_8018884(const u8 *src); void sub_80186A4(void); +void sub_8014EFC(u32 arg0); +void sub_80152A8(u32 arg0); +void sub_8014A00(u32 arg0); extern bool8 gUnknown_02022C60; -- cgit v1.2.3 From ade01833781ee8a8057f2b2945095bababb2e639 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 18:59:52 -0400 Subject: Document mystery_gift --- include/ereader_screen.h | 2 +- include/international_string_util.h | 2 +- include/link.h | 2 -- include/link_rfu.h | 2 +- include/menu.h | 2 +- include/mevent.h | 18 +++++++++--------- include/mevent_801BAAC.h | 22 +++++++++++----------- include/mevent_news.h | 2 +- include/mevent_server.h | 2 +- include/mevent_server_ish.h | 10 +++++----- include/mystery_gift.h | 14 +++++++++++--- include/text_window.h | 4 ++-- include/union_room.h | 12 +++--------- 13 files changed, 47 insertions(+), 47 deletions(-) (limited to 'include') diff --git a/include/ereader_screen.h b/include/ereader_screen.h index 0e3e51c76..1daea4be0 100755 --- a/include/ereader_screen.h +++ b/include/ereader_screen.h @@ -1,6 +1,6 @@ #ifndef GUARD_EREADER_SCREEN_H #define GUARD_EREADER_SCREEN_H -void sub_81D5014(void); +void task_add_00_ereader(void); #endif // GUARD_EREADER_SCREEN_H diff --git a/include/international_string_util.h b/include/international_string_util.h index 2d5b1c871..911cd6935 100644 --- a/include/international_string_util.h +++ b/include/international_string_util.h @@ -12,7 +12,7 @@ int GetStringCenterAlignXOffsetWithLetterSpacing(int fontId, const u8 *str, int int GetStringWidthDifference(int fontId, const u8 *str, int totalWidth, int letterSpacing); int GetMaxWidthInMenuTable(const struct MenuAction *str, int arg1); int sub_81DB3D8(const struct MenuAction *str, const u8* arg1, int arg2); -int sub_81DB41C(const struct ListMenuTemplate *listMenu); +int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu); void CopyMonCategoryText(int dexNum, u8 *dest); u8 *sub_81DB494(u8 *str, int fontId, u8 *str2, int totalStringWidth); void PadNameString(u8 *dest, u8 padChar); diff --git a/include/link.h b/include/link.h index 719b0f067..62ae7761c 100644 --- a/include/link.h +++ b/include/link.h @@ -200,8 +200,6 @@ extern bool8 gLinkVSyncDisabled; extern u32 gLinkStatus; -void c2_mystery_gift(void); -void sub_801867C(void); bool8 IsWirelessAdapterConnected(void); void Task_DestroySelf(u8 taskId); void OpenLink(void); diff --git a/include/link_rfu.h b/include/link_rfu.h index d8f374ff9..b8ba1a927 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -260,7 +260,7 @@ u32 sub_8010714(u16 a0, const u8 *a1); void sub_8011DC0(const u8 *a0, u16 a1); bool8 sub_800EF1C(void); bool32 sub_800EF58(bool32 a0); -void sub_800E084(void); +void DestroyWirelessStatusIndicatorSprite(void); void sub_801103C(void); void sub_8011C5C(void); void sub_80106D4(void); diff --git a/include/menu.h b/include/menu.h index b4c3cb2b5..4f3c4a3cc 100644 --- a/include/menu.h +++ b/include/menu.h @@ -35,7 +35,7 @@ void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram); void DisplayYesNoMenuDefaultYes(void); u32 GetPlayerTextSpeed(void); u8 GetPlayerTextSpeedDelay(void); -void sub_81978B0(u16 arg0); +void Menu_LoadStdPalAt(u16 arg0); void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16)); void sub_8199DF0(u32 bg, u8 a1, int a2, int a3); void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); diff --git a/include/mevent.h b/include/mevent.h index 7f12f3501..9c5d559bf 100755 --- a/include/mevent.h +++ b/include/mevent.h @@ -32,23 +32,23 @@ struct MEventStruct_Unk1442CC }; void sub_801AFD8(void); -struct MEventBuffer_3120_Sub *sub_801B00C(void); +struct MEventBuffer_3120_Sub *sav1_get_mevent_buffer_0(void); struct MEventBuffer_32E0_Sub *sav1_get_mevent_buffer_1(void); struct MEventBuffer_3430_Sub *sav1_get_mevent_buffer_2(void); struct MysteryEventStruct *sub_801B044(void); u16 *sub_801B058(void); -void sub_801B06C(void); +void DestroyWonderNews(void); bool32 sub_801B078(const struct MEventBuffer_3120_Sub *src); -bool32 sub_801B0CC(void); -bool32 sub_801B128(void); +bool32 ValidateReceivedWonderNews(void); +bool32 WonderNews_Test_Unk_02(void); bool32 sub_801B1A4(const u8 *src); -void sub_801B1E8(void); +void DestroyWonderCard(void); bool32 sub_801B21C(const struct MEventBuffer_32E0_Sub *data); -bool32 sub_801B27C(void); -bool32 sub_801B308(void); -u16 sub_801B39C(void); +bool32 ValidateReceivedWonderCard(void); +bool32 WonderCard_Test_Unk_08_6(void); +u16 GetWonderCardFlagID(void); void sub_801B3C0(struct MEventBuffer_32E0_Sub *buffer); -bool32 sub_801B3F8(void); +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); diff --git a/include/mevent_801BAAC.h b/include/mevent_801BAAC.h index 2259d3b6d..547d5237b 100644 --- a/include/mevent_801BAAC.h +++ b/include/mevent_801BAAC.h @@ -1,16 +1,16 @@ #ifndef GUARD_MEVENT_801BAAC_H #define GUARD_MEVENT_801BAAC_H -bool32 sub_801BAAC(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6); -bool32 sub_801C6C8(const struct MEventBuffer_3120_Sub * a0); -s32 sub_801BB74(void); -s32 sub_801C758(void); -s32 sub_801BDA4(bool32 flag); -void sub_801BB48(void); -s32 sub_801CA50(bool32 flag); -void sub_801C72C(void); -u32 sub_801CCD0(u16 input); -void sub_801CC80(void); -void sub_801CC38(void); +bool32 InitWonderCardResources(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6); +bool32 InitWonderNewsResources(const struct MEventBuffer_3120_Sub * a0); +s32 FadeToWonderCardMenu(void); +s32 FadeToWonderNewsMenu(void); +s32 FadeOutFromWonderCard(bool32 flag); +void DestroyWonderCardResources(void); +s32 FadeOutFromWonderNews(bool32 flag); +void DestroyWonderNewsResources(void); +u32 MENews_GetInput(u16 input); +void MENews_AddScrollIndicatorArrowPair(void); +void MENews_RemoveScrollIndicatorArrowPair(void); #endif //GUARD_MEVENT_801BAAC_H diff --git a/include/mevent_news.h b/include/mevent_news.h index 4632edd38..5fa009499 100755 --- a/include/mevent_news.h +++ b/include/mevent_news.h @@ -2,6 +2,6 @@ #define GUARD_MEVENT_NEWS_H void sub_801DBC0(void); -void sub_801DB68(u32 a0); +void GenerateRandomNews(u32 a0); #endif //GUARD_MEVENT_NEWS_H diff --git a/include/mevent_server.h b/include/mevent_server.h index ca3b7091b..d7657b270 100644 --- a/include/mevent_server.h +++ b/include/mevent_server.h @@ -3,6 +3,6 @@ void mevent_srv_new_wcard(); void mevent_srv_init_wnews(); -u32 sub_801D0C4(u16 * a0); +u32 mevent_srv_common_do_exec(u16 * a0); #endif //GUARD_MEVENT_SERVER_H diff --git a/include/mevent_server_ish.h b/include/mevent_server_ish.h index 76f5080dc..31f98ed52 100644 --- a/include/mevent_server_ish.h +++ b/include/mevent_server_ish.h @@ -1,10 +1,10 @@ #ifndef GUARD_MEVENT_SERVER_ISH_H #define GUARD_MEVENT_SERVER_ISH_H -void sub_801D484(u32 arg); -u32 sub_801D4A8(u16 * a0); -void sub_801D4E4(void); -void * sub_801D4F4(void); -void sub_801D500(u32 a0); +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/mystery_gift.h b/include/mystery_gift.h index b43fbe9a9..243895a67 100644 --- a/include/mystery_gift.h +++ b/include/mystery_gift.h @@ -1,8 +1,16 @@ #ifndef GUARD_MYSTERY_GIFT_H #define GUARD_MYSTERY_GIFT_H -void sub_8018438(void); -void sub_80186EC(bool8 isJapanese, bool32 usePickOkCancel); -void sub_8018798(u32 bg); +extern bool8 gGiftIsFromEReader; + +u16 GetMysteryGiftBaseBlock(void); +void c2_mystery_gift_e_reader_run(void); +void PrintMysteryGiftOrEReaderTopMenu(bool8 isJapanese, bool32 usePickOkCancel); +void MG_DrawCheckerboardPattern(u32 bg); +void MainCB_FreeAllBuffersAndReturnToInitTitleScreen(void); +bool32 MG_PrintTextOnWindow1AndWaitButton(u8 *textState, const u8 *str); +void AddTextPrinterToWindow1(const u8 *src); +void c2_ereader(void); +void c2_mystery_gift(void); #endif //GUARD_MYSTERY_GIFT_H diff --git a/include/text_window.h b/include/text_window.h index 53a6df2e9..501597aa2 100644 --- a/include/text_window.h +++ b/include/text_window.h @@ -17,8 +17,8 @@ void LoadMessageBoxGfx(u8 windowId, u16 destOffset, u8 palOffset); void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palOffset); void LoadWindowGfx(u8 windowId, u8 frameId, u16 destOffset, u8 palOffset); void LoadUserWindowBorderGfx_(u8 windowId, u16 destOffset, u8 palOffset); -void sub_8098858(u8 windowId, u16 tileNum, u8 palNum); -void sub_80989E0(u8 windowId, u16 tileNum, u8 palNum); +void DrawTextBorderOuter(u8 windowId, u16 tileNum, u8 palNum); +void DrawTextBorderInner(u8 windowId, u16 tileNum, u8 palNum); void rbox_fill_rectangle(u8 windowId); const u16 *stdpal_get(u8 id); const u16 *GetOverworldTextboxPalettePtr(void); diff --git a/include/union_room.h b/include/union_room.h index 3d60e1432..ca3c87ab1 100644 --- a/include/union_room.h +++ b/include/union_room.h @@ -165,14 +165,8 @@ u8 sub_8013F78(void); bool32 sub_802C908(u16); void nullsub_89(u8 taskId); void var_800D_set_xB(void); - -bool32 mevent_0814257C(u8 *textState, const u8 *str); -void sub_8018884(const u8 *src); -void sub_80186A4(void); -void sub_8014EFC(u32 arg0); -void sub_80152A8(u32 arg0); -void sub_8014A00(u32 arg0); - -extern bool8 gUnknown_02022C60; +void MEvent_CreateTask_CardOrNewsWithFriend(u32 arg0); +void MEvent_CreateTask_CardOrNewsOverWireless(u32 arg0); +void MEvent_CreateTask_Leader(u32 arg0); #endif //GUARD_UNION_ROOM_H -- cgit v1.2.3 From 207a54393c533e073e54365a8069753536fefa3c Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 31 Mar 2019 20:07:24 -0400 Subject: Fix mistakes and use EVENT_OBJ_GFX_* macros --- include/contest.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/contest.h b/include/contest.h index 5c299bee5..a0b1a6b34 100644 --- a/include/contest.h +++ b/include/contest.h @@ -216,7 +216,6 @@ struct ContestPokemon /*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; /*0x0D*/ u8 trainerName[PLAYER_NAME_LENGTH + 1]; /*0x15*/ u8 trainerGfxId; - // Temp note: 2 bytes of padding /*0x18*/ u32 flags; /*0x1C*/ u8 whichRank:2; // 0x1 0x2 u8 aiPool_Cool:1; // 0x4 @@ -224,7 +223,6 @@ struct ContestPokemon u8 aiPool_Cute:1; // 0x10 u8 aiPool_Smart:1; // 0x20 u8 aiPool_Tough:1; // 0x40 - // Temp note: 1 byte of padding /*0x1E*/ u16 moves[4]; // moves /*0x26*/ u8 cool; // cool /*0x27*/ u8 beauty; // beauty -- cgit v1.2.3 From 23ac2cc94e2914a427e97467103c0160af6f1be0 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 31 Mar 2019 20:15:44 -0400 Subject: Prep for merge --- include/sprite.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'include') diff --git a/include/sprite.h b/include/sprite.h index 10c4145b0..32bdd9c55 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -151,26 +151,6 @@ enum SUBSPRITES_IGNORE_PRIORITY, // on but priority is ignored }; -#define OAM_SIZE_0 (0) -#define OAM_SIZE_1 (1 << 0) -#define OAM_SIZE_2 (1 << 1) -#define OAM_SIZE_3 (1 << 2) - -#define SPRITE_SIZE_8x8 .shape = ST_OAM_SQUARE, .size = OAM_SIZE_0 -#define SPRITE_SIZE_16x16 .shape = ST_OAM_SQUARE, .size = OAM_SIZE_1 -#define SPRITE_SIZE_32x32 .shape = ST_OAM_SQUARE, .size = OAM_SIZE_2 -#define SPRITE_SIZE_64x64 .shape = ST_OAM_SQUARE, .size = OAM_SIZE_3 - -#define SPRITE_SIZE_16x8 .shape = ST_OAM_H_RECTANGLE, .size = OAM_SIZE_0 -#define SPRITE_SIZE_32x8 .shape = ST_OAM_H_RECTANGLE, .size = OAM_SIZE_1 -#define SPRITE_SIZE_32x16 .shape = ST_OAM_H_RECTANGLE, .size = OAM_SIZE_2 -#define SPRITE_SIZE_64x32 .shape = ST_OAM_H_RECTANGLE, .size = OAM_SIZE_3 - -#define SPRITE_SIZE_8x16 .shape = ST_OAM_V_RECTANGLE, .size = OAM_SIZE_0 -#define SPRITE_SIZE_8x32 .shape = ST_OAM_V_RECTANGLE, .size = OAM_SIZE_1 -#define SPRITE_SIZE_16x32 .shape = ST_OAM_V_RECTANGLE, .size = OAM_SIZE_2 -#define SPRITE_SIZE_32x64 .shape = ST_OAM_V_RECTANGLE, .size = OAM_SIZE_3 - struct Subsprite { s8 x; // was u16 in R/S -- cgit v1.2.3 From 3181c64c64afa47b3adc04f325ad3798c8c324ec Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 31 Mar 2019 20:40:14 -0400 Subject: Change names from MAP_AREA_ to MAP_GROUP_ --- include/constants/maps.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/constants/maps.h b/include/constants/maps.h index 93291f29e..b849749a9 100644 --- a/include/constants/maps.h +++ b/include/constants/maps.h @@ -11,8 +11,8 @@ // These groups are used by pokedex_area_screen.c to find wild // pokemon locations. -#define MAP_AREA_OVERWORLD_MONS MAP_GROUP(PETALBURG_CITY) -#define MAP_AREA_SPECIAL_MONS_1 MAP_GROUP(METEOR_FALLS_1F_1R) -#define MAP_AREA_SPECIAL_MONS_2 MAP_GROUP(SAFARI_ZONE_NORTHWEST) +#define MAP_GROUP_OVERWORLD_MONS MAP_GROUP(PETALBURG_CITY) +#define MAP_GROUP_SPECIAL_MONS_1 MAP_GROUP(METEOR_FALLS_1F_1R) +#define MAP_GROUP_SPECIAL_MONS_2 MAP_GROUP(SAFARI_ZONE_NORTHWEST) #endif // GUARD_CONSTANTS_MAPS_H -- cgit v1.2.3 From 1fe52085606ccd9258eea5a037c43b30fc04d7c5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 12:05:58 -0400 Subject: through sub_801A02C --- .../constants/event_object_movement_constants.h | 2 ++ include/event_object_movement.h | 4 ++++ include/field_player_avatar.h | 12 +--------- include/fieldmap.h | 1 + include/global.fieldmap.h | 27 +++++++++++++++------- include/union_room.h | 2 +- 6 files changed, 28 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/constants/event_object_movement_constants.h b/include/constants/event_object_movement_constants.h index 2a80f9a09..b1f9b4cb5 100755 --- a/include/constants/event_object_movement_constants.h +++ b/include/constants/event_object_movement_constants.h @@ -242,4 +242,6 @@ #define MOVEMENT_ACTION_FLY_UP 0x9C #define MOVEMENT_ACTION_FLY_DOWN 0x9D +#define MOVEMENT_ACTION_STEP_END 0xFE + #endif // GUARD_CONSTANTS_EVENTOBJMV_H diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 63ac09f2d..4a8e0d373 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -413,5 +413,9 @@ u8 MovementType_RunInPlace_Step0(struct EventObject *, struct Sprite *); u8 MovementType_Invisible_Step0(struct EventObject *, struct Sprite *); u8 MovementType_Invisible_Step1(struct EventObject *, struct Sprite *); u8 MovementType_Invisible_Step2(struct EventObject *, struct Sprite *); +void sub_8097C44(u8 var, bool32 var2); +bool32 sub_8097C8C(u8 var); +void sub_8097BB4(u8 var1, u8 graphicsId); +void sub_8097CC4(u8 var1, u8 var2); #endif //GUARD_FIELD_EVENT_OBJ_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index ca3d41546..8d87779e6 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -1,17 +1,6 @@ #ifndef GUARD_FIELD_PLAYER_AVATAR_H #define GUARD_FIELD_PLAYER_AVATAR_H -enum { - PLAYER_AVATAR_STATE_NORMAL, - PLAYER_AVATAR_STATE_MACH_BIKE, - PLAYER_AVATAR_STATE_ACRO_BIKE, - PLAYER_AVATAR_STATE_SURFING, - PLAYER_AVATAR_STATE_UNDERWATER, - PLAYER_AVATAR_STATE_FIELD_MOVE, - PLAYER_AVATAR_STATE_FISHING, - PLAYER_AVATAR_STATE_WATERING, -}; - void player_step(u8 a, u16 b, u16 c); void ClearPlayerAvatarInfo(void); void SetPlayerAvatarExtraStateTransition(u8, u8); @@ -73,5 +62,6 @@ void sub_808D1C8(void); bool32 sub_808D1B4(void); bool32 sub_808D1E8(void); void sub_808C0A8(u8 a); +u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); #endif // GUARD_FIELD_PLAYER_AVATAR_H diff --git a/include/fieldmap.h b/include/fieldmap.h index bb5b0e290..2384ed46a 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -50,5 +50,6 @@ void SpriteCB_HallOfFameMonitor(struct Sprite *); // field_region_map.c void FieldInitRegionMap(MainCallback callback); +void sub_8088B94(int x, int y, int a2); #endif //GUARD_FIELDMAP_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index e35d900d8..3aa44ec9a 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -232,14 +232,25 @@ struct EventObjectGraphicsInfo /*0x20*/ const union AffineAnimCmd *const *affineAnims; }; -#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0) -#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << 1) -#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << 2) -#define PLAYER_AVATAR_FLAG_SURFING (1 << 3) -#define PLAYER_AVATAR_FLAG_UNDERWATER (1 << 4) -#define PLAYER_AVATAR_FLAG_5 (1 << 5) -#define PLAYER_AVATAR_FLAG_6 (1 << 6) -#define PLAYER_AVATAR_FLAG_DASH (1 << 7) +enum { + PLAYER_AVATAR_STATE_NORMAL, + PLAYER_AVATAR_STATE_MACH_BIKE, + PLAYER_AVATAR_STATE_ACRO_BIKE, + PLAYER_AVATAR_STATE_SURFING, + PLAYER_AVATAR_STATE_UNDERWATER, + PLAYER_AVATAR_STATE_FIELD_MOVE, + PLAYER_AVATAR_STATE_FISHING, + PLAYER_AVATAR_STATE_WATERING, +}; + +#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << PLAYER_AVATAR_STATE_NORMAL) +#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << PLAYER_AVATAR_STATE_MACH_BIKE) +#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << PLAYER_AVATAR_STATE_ACRO_BIKE) +#define PLAYER_AVATAR_FLAG_SURFING (1 << PLAYER_AVATAR_STATE_SURFING) +#define PLAYER_AVATAR_FLAG_UNDERWATER (1 << PLAYER_AVATAR_STATE_UNDERWATER) +#define PLAYER_AVATAR_FLAG_5 (1 << PLAYER_AVATAR_STATE_FIELD_MOVE) +#define PLAYER_AVATAR_FLAG_6 (1 << PLAYER_AVATAR_STATE_FISHING) +#define PLAYER_AVATAR_FLAG_DASH (1 << PLAYER_AVATAR_STATE_WATERING) enum { diff --git a/include/union_room.h b/include/union_room.h index ca3c87ab1..538d37716 100644 --- a/include/union_room.h +++ b/include/union_room.h @@ -90,7 +90,7 @@ struct UnkStruct_8019BA8 { u8 field_0; u8 field_1; - u8 field_2; + s8 field_2; u8 field_3; }; -- cgit v1.2.3 From ce89cf6f75a94e08d02cc8c60147469c91ea99c9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 14:09:56 -0400 Subject: through sub_801A3D0 --- include/event_object_movement.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 4a8e0d373..817dc78df 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -417,5 +417,6 @@ void sub_8097C44(u8 var, bool32 var2); bool32 sub_8097C8C(u8 var); void sub_8097BB4(u8 var1, u8 graphicsId); void sub_8097CC4(u8 var1, u8 var2); +bool32 sub_8097D9C(u8 var); #endif //GUARD_FIELD_EVENT_OBJ_H -- cgit v1.2.3 From 9f1d1219cec0643bb6e58cb2cdba07ca6f8587ed Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 14:20:34 -0400 Subject: create header and fix prototypes --- include/union_room_player_avatar.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 include/union_room_player_avatar.h (limited to 'include') diff --git a/include/union_room_player_avatar.h b/include/union_room_player_avatar.h new file mode 100644 index 000000000..9870d0981 --- /dev/null +++ b/include/union_room_player_avatar.h @@ -0,0 +1,14 @@ +#ifndef GUARD_UNION_ROOM_PLAYER_AVATAR_H +#define GUARD_UNION_ROOM_PLAYER_AVATAR_H + +u8 sub_8019BA8(struct UnkStruct_8019BA8 * ptr); +void sub_8019E3C(void); +void sub_8019E70(u8 *arg0, s32 arg1); +void sub_8019F04(u8 *spriteIds); +void sub_8019F2C(void); +void sub_801A274(struct UnkStruct_URoom *arg0); +void sub_801A284(struct UnkStruct_URoom *arg0); +bool32 sub_801A2A8(struct UnkStruct_Main0 *arg0, s16 *arg1, s16 *arg2, u8 *arg3); +void sub_801A3D0(u32 arg0, u32 arg1, struct UnkStruct_Main0 *arg2); + +#endif //GUARD_UNION_ROOM_PLAYER_AVATAR_H -- cgit v1.2.3 From c429e6d69c3df23687e2336039b676b8927c238e Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Mon, 1 Apr 2019 20:30:41 -0400 Subject: Move gPlayerFacingPosition out of sym_ewram.txt (#617) * Move gPlayerFacingPosition out of sym_ewram.txt * Fix tabs in sym_ewram.txt * Remove redundant faraway island extern --- include/fldeff.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/fldeff.h b/include/fldeff.h index e095396a4..ff6c9823f 100644 --- a/include/fldeff.h +++ b/include/fldeff.h @@ -10,6 +10,7 @@ void FixLongGrassMetatilesWindowTop(s16 x, s16 y); void FixLongGrassMetatilesWindowBottom(s16 x, s16 y); extern const struct SpritePalette gFieldEffectObjectPaletteInfo6; +extern struct MapPosition gPlayerFacingPosition; // groundshake bool8 sub_81BE66C(void); -- cgit v1.2.3 From 4be97b2dc691d5215ae402a345708b3e207ceb9f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 18:42:57 -0400 Subject: through sub_801A960 --- include/strings.h | 5 +++++ include/union_room_battle.h | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 include/union_room_battle.h (limited to 'include') diff --git a/include/strings.h b/include/strings.h index 1561da26d..99c9ce73c 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2672,5 +2672,10 @@ extern const u8 gText_CommunicationCompleted[]; extern const u8 gText_HaventReceivedGiftOkayToDiscard[]; extern const u8 gText_SendingWonderCard[]; extern const u8 gText_SendingWonderNews[]; +extern const u8 gText_WirelessCommStatus[]; +extern const u8 gText_PeopleTrading[]; +extern const u8 gText_PeopleBattling[]; +extern const u8 gText_PeopleInUnionRoom[]; +extern const u8 gText_PeopleCommunicating[]; #endif // GUARD_STRINGS_H diff --git a/include/union_room_battle.h b/include/union_room_battle.h new file mode 100644 index 000000000..1bc9d0015 --- /dev/null +++ b/include/union_room_battle.h @@ -0,0 +1,6 @@ +#ifndef GUARD_UNION_ROOM_BATTLE_H +#define GUARD_UNION_ROOM_BATTLE_H + +u8 sub_8013C40(void); + +#endif //GUARD_UNION_ROOM_BATTLE_H -- cgit v1.2.3 From 7571969a458fefcfa242acdd4a38dce134897977 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 22:30:30 -0400 Subject: Finish union room battle --- include/constants/game_stat.h | 2 +- include/main.h | 2 +- include/strings.h | 3 +++ include/union_room_battle.h | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/constants/game_stat.h b/include/constants/game_stat.h index 7ebf3501b..e302f1345 100644 --- a/include/constants/game_stat.h +++ b/include/constants/game_stat.h @@ -51,7 +51,7 @@ #define GAME_STAT_USED_DAYCARE 47 #define GAME_STAT_RODE_CABLE_CAR 48 #define GAME_STAT_ENTERED_HOT_SPRINGS 49 -#define GAME_STAT_50 50 +#define GAME_STAT_NUM_UNION_ROOM_BATTLES 50 #define GAME_STAT_51 51 #define NUM_USED_GAME_STATS 52 diff --git a/include/main.h b/include/main.h index 6c67fbe9f..16ac31df2 100644 --- a/include/main.h +++ b/include/main.h @@ -71,6 +71,6 @@ void RestoreSerialTimer3IntrHandlers(void); void StartTimer1(void); void SeedRngAndSetTrainerId(void); u16 GetGeneratedTrainerIdLower(void); - +void sub_819789C(void); #endif // GUARD_MAIN_H diff --git a/include/strings.h b/include/strings.h index 99c9ce73c..8aa296eb1 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2677,5 +2677,8 @@ extern const u8 gText_PeopleTrading[]; extern const u8 gText_PeopleBattling[]; extern const u8 gText_PeopleInUnionRoom[]; extern const u8 gText_PeopleCommunicating[]; +extern const u8 gText_CommStandbyAwaitingOtherPlayer[]; +extern const u8 gText_RefusedBattle[]; +extern const u8 gText_BattleWasRefused[]; #endif // GUARD_STRINGS_H diff --git a/include/union_room_battle.h b/include/union_room_battle.h index 1bc9d0015..2f5086008 100644 --- a/include/union_room_battle.h +++ b/include/union_room_battle.h @@ -2,5 +2,6 @@ #define GUARD_UNION_ROOM_BATTLE_H u8 sub_8013C40(void); +void sub_8014210(u16 battleFlags); #endif //GUARD_UNION_ROOM_BATTLE_H -- cgit v1.2.3 From 6916f09cd5cdb508e270bfba40f1bd165a16762f Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 2 Apr 2019 03:22:07 -0400 Subject: Expand MatchCallStruct defs, use REMATCH_* enum --- include/battle_setup.h | 5 +++-- include/constants/flags.h | 15 ++++++++------- include/gym_leader_rematch.h | 2 ++ 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/battle_setup.h b/include/battle_setup.h index 3b327e3f7..e3faa5dcf 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -1,10 +1,11 @@ #ifndef GUARD_BATTLE_SETUP_H #define GUARD_BATTLE_SETUP_H +#include "gym_leader_rematch.h" + #define REMATCHES_COUNT 5 #define REMATCH_TABLE_ENTRIES 78 -#define REMATCH_WALLY_ENTRY 64 -#define REMATCH_ELITE_FOUR_ENTRIES 73 +#define REMATCH_ELITE_FOUR_ENTRIES REMATCH_SIDNEY struct RematchTrainer { diff --git a/include/constants/flags.h b/include/constants/flags.h index f28af3278..0450e988d 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -445,13 +445,14 @@ #define FLAG_REMATCH_NORMAN 0x1A2 #define FLAG_REMATCH_WINONA 0x1A3 #define FLAG_REMATCH_TATE_AND_LIZA 0x1A4 -#define FLAG_REMATCH_JUAN 0x1A5 -#define FLAG_REMATCH_SIDNEY 0x1A6 -#define FLAG_REMATCH_PHOEBE 0x1A7 -#define FLAG_REMATCH_GLACIA 0x1A8 -#define FLAG_REMATCH_DRAKE 0x1A9 -#define FLAG_REMATCH_WALLACE 0x1AA - +// Note: FLAG_REMATCH_JUAN is handled by FLAG_ENABLE_JUAN_MATCH_CALL instead. +#define FLAG_REMATCH_SIDNEY 0x1A5 +#define FLAG_REMATCH_PHOEBE 0x1A6 +#define FLAG_REMATCH_GLACIA 0x1A7 +#define FLAG_REMATCH_DRAKE 0x1A8 +#define FLAG_REMATCH_WALLACE 0x1A9 + +#define FLAG_UNUSED_0x1AA 0x1AA // Unused Flag #define FLAG_UNUSED_0x1AB 0x1AB // Unused Flag #define FLAG_DEFEATED_DEOXYS 0x1AC diff --git a/include/gym_leader_rematch.h b/include/gym_leader_rematch.h index ef0e5fef1..ed1143db5 100644 --- a/include/gym_leader_rematch.h +++ b/include/gym_leader_rematch.h @@ -75,6 +75,8 @@ enum { REMATCH_WINONA, REMATCH_TATE_AND_LIZA, REMATCH_JUAN, + + // Entries below SIDNEY are considered part of REMATCH_ELITE_FOUR_ENTRIES. REMATCH_SIDNEY, REMATCH_PHOEBE, REMATCH_GLACIA, -- cgit v1.2.3 From 9f44ebc5cd2b3088469f188c355db4fe905d299a Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 2 Apr 2019 03:27:05 -0400 Subject: Automatically calculate REMATCH_TABLE_ENTRIES Uses the standard C way of calculating the length of an enum. --- include/battle_setup.h | 1 - include/gym_leader_rematch.h | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/battle_setup.h b/include/battle_setup.h index e3faa5dcf..984c820bb 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -4,7 +4,6 @@ #include "gym_leader_rematch.h" #define REMATCHES_COUNT 5 -#define REMATCH_TABLE_ENTRIES 78 #define REMATCH_ELITE_FOUR_ENTRIES REMATCH_SIDNEY struct RematchTrainer diff --git a/include/gym_leader_rematch.h b/include/gym_leader_rematch.h index ed1143db5..778d7a1e8 100644 --- a/include/gym_leader_rematch.h +++ b/include/gym_leader_rematch.h @@ -81,7 +81,11 @@ enum { REMATCH_PHOEBE, REMATCH_GLACIA, REMATCH_DRAKE, - REMATCH_WALLACE + REMATCH_WALLACE, + + // The total number of rematch entries. This must be the last element + // in the enum. + REMATCH_TABLE_ENTRIES }; void UpdateGymLeaderRematch(void); -- cgit v1.2.3 From baa187665b102b0210ecd7296aaaf0de512d3e87 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 2 Apr 2019 13:35:52 +0200 Subject: Document a bit of script menu and battle anims --- include/menu.h | 2 +- include/script_menu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/menu.h b/include/menu.h index 4f3c4a3cc..2392de703 100644 --- a/include/menu.h +++ b/include/menu.h @@ -91,7 +91,7 @@ void sub_8199C30(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette); void sub_8199D3C(void *ptr, int delta, int width, int height, bool32 is8BPP); void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyToVram); void sub_8197AE8(bool8 copyToVram); -void sub_81997AC(u8 windowId, u8 a4, u8 a6, u8 a7, const struct MenuAction *strs); +void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, const struct MenuAction *strs); s8 Menu_ProcessInputGridLayout(void); u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, bool8 APressMuted); s8 Menu_ProcessInputNoWrapAround_other(void); diff --git a/include/script_menu.h b/include/script_menu.h index 1f4e549fe..efb51870b 100644 --- a/include/script_menu.h +++ b/include/script_menu.h @@ -11,7 +11,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 var1, u8 var2, u8 var3); bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void); int convert_pixel_width_to_tile_width(int); u8 CreateWindowFromRect(u8, u8, u8, u8); -void sub_80E2A78(u8); +void ClearToTransparentAndRemoveWindow(u8); int display_text_and_get_width(const u8*, int); int sub_80E2D5C(int arg0, int tileWidth); bool16 ScrSpecial_CreatePCMenu(void); -- cgit v1.2.3 From d8c9f1b30fb92289e7aa4d44dfcf1b2120bea8d6 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 2 Apr 2019 15:06:44 +0200 Subject: Rows and columns --- include/menu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/menu.h b/include/menu.h index 2392de703..4d55fc955 100644 --- a/include/menu.h +++ b/include/menu.h @@ -69,7 +69,7 @@ u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress); void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8); void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8); -u8 sub_8199944(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, u8 initialCursorPos); +u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos); u8 sub_8199134(s8, s8); u8 GetStartMenuWindowId(void); void sub_819A2BC(u8, u8); @@ -91,7 +91,7 @@ void sub_8199C30(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette); void sub_8199D3C(void *ptr, int delta, int width, int height, bool32 is8BPP); void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyToVram); void sub_8197AE8(bool8 copyToVram); -void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, const struct MenuAction *strs); +void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *strs); s8 Menu_ProcessInputGridLayout(void); u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, bool8 APressMuted); s8 Menu_ProcessInputNoWrapAround_other(void); -- cgit v1.2.3