From e7c43d6890616fa10b770266c2b81f0c7f4677b8 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 6 Oct 2018 15:48:36 -0400 Subject: vs_seeker: sub_810C670 --- include/event_scripts.h | 2 ++ include/field_effect.h | 4 +++- include/item_menu.h | 8 +++++--- include/new_menu_helpers.h | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/event_scripts.h b/include/event_scripts.h index 844f1052a..a210e4c34 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -372,4 +372,6 @@ extern const u8 SecretBase_RedCave1_Text_274E75[]; extern const u8 SecretBase_RedCave1_Text_2751E1[]; extern const u8 SecretBase_RedCave1_Text_2754F6[]; extern const u8 SecretBase_RedCave1_Text_2758CC[]; +extern const u8 gUnknown_81C137C[]; +extern const u8 gUnknown_81C13D6[]; #endif //GUARD_EVENT_SCRIPTS_H diff --git a/include/field_effect.h b/include/field_effect.h index 629ae07c7..9404e3959 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -66,7 +66,9 @@ enum FieldEffectScriptIdx FLDEFF_USE_FLY_ANCIENT_TOMB, FLDEFF_PCTURN_ON, FLDEFF_HALL_OF_FAME_RECORD, - FLDEFF_USE_TELEPORT + FLDEFF_USE_TELEPORT, + FLDEFF_UNK_40, + FLDEFF_UNK_41 // TODO: related to vs_seeker }; extern u32 gFieldEffectArguments[8]; diff --git a/include/item_menu.h b/include/item_menu.h index 85655e9d5..0e1f20588 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -1,12 +1,14 @@ -#ifndef GUARD_item_menu_H -#define GUARD_item_menu_H +#ifndef GUARD_ITEM_MENU_H +#define GUARD_ITEM_MENU_H // Exported type declarations // Exported RAM declarations +extern u16 gUnknown_203AD30; + // Exported ROM declarations void sub_81AAC50(void); void sub_81AAC70(void); -#endif //GUARD_item_menu_H +#endif //GUARD_ITEM_MENU_H diff --git a/include/new_menu_helpers.h b/include/new_menu_helpers.h index c52184972..71e1f3c0d 100644 --- a/include/new_menu_helpers.h +++ b/include/new_menu_helpers.h @@ -1,6 +1,7 @@ #ifndef GUARD_NEW_MENU_HELPERS_H #define GUARD_NEW_MENU_HELPERS_H +#include "global.h" #include "text.h" #include "task.h" @@ -9,7 +10,7 @@ void sub_81973C4(u8, u8); void sub_819746C(u8 windowId, bool8 copyToVram); void sub_81973FC(u8, u8); u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor); -void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); +void DisplayItemMessageOnField(u8 taskId, u8 bgId, const u8 *src, TaskFunc callback); void sub_8197434(u8 a0, u8 a1); void SetStandardWindowBorderStyle(u8 a0, u8 a1); void sub_8197930(void); -- cgit v1.2.3 From 43a0915d90b8c53c3e1fc8141e3c3d6376e18293 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 6 Oct 2018 16:16:33 -0400 Subject: through sub_810C760 --- include/item_use.h | 9 +++++++++ include/vs_seeker.h | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 include/item_use.h create mode 100644 include/vs_seeker.h (limited to 'include') diff --git a/include/item_use.h b/include/item_use.h new file mode 100644 index 000000000..5ec5f2b33 --- /dev/null +++ b/include/item_use.h @@ -0,0 +1,9 @@ +#ifndef GUARD_ITEM_USE_H +#define GUARD_ITEM_USE_H + +#include "global.h" + +void sub_80A1E0C(u8); +void sub_80A2294(u8, u8, u16, u16); + +#endif //GUARD_ITEM_USE_H diff --git a/include/vs_seeker.h b/include/vs_seeker.h new file mode 100644 index 000000000..6db741a11 --- /dev/null +++ b/include/vs_seeker.h @@ -0,0 +1,13 @@ +#ifndef GUARD_VS_SEEKER_H +#define GUARD_VS_SEEKER_H + +#include "global.h" + +struct VsSeekerStruct +{ + /*0x000*/ u8 filler_00[0x431]; + /*0x431*/ u8 unk_431_0:3; + u8 unk_431_3:5; +}; + +#endif //GUARD_VS_SEEKER_H -- cgit v1.2.3 From 53b701c9effd24ec19e1e0dbeb5f411b0674a95d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 6 Oct 2018 17:23:14 -0400 Subject: sub_810C808 --- include/global.h | 9 ++++++++- include/vs_seeker.h | 14 +++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 75911b9f2..a48de5a61 100644 --- a/include/global.h +++ b/include/global.h @@ -476,7 +476,14 @@ struct SaveBlock1 { /*0x0000*/ u8 filler[0x4]; /*0x0004*/ struct WarpData location; - /*0x000C*/ u8 fillerC[0x3610]; + /*0x0C*/ struct WarpData warp1; + /*0x14*/ struct WarpData warp2; + /*0x1C*/ struct WarpData lastHealLocation; + /*0x24*/ struct WarpData warp4; + /*0x002C*/ u8 filler2C[0x674]; + /*0x06A0*/ struct MapObject mapObjects[MAP_OBJECTS_COUNT]; + /*0x08E0*/ struct MapObjectTemplate mapObjectTemplates[64]; + /*0x0EE0*/ u8 fillerEE0[0x273C]; /*0x361C*/ struct RamScript ramScript; /*0x3A08*/ u8 filler3A08[0x44]; /*0x3A4C*/ u8 rivalName[PLAYER_NAME_LENGTH]; diff --git a/include/vs_seeker.h b/include/vs_seeker.h index 6db741a11..e01713f49 100644 --- a/include/vs_seeker.h +++ b/include/vs_seeker.h @@ -3,9 +3,21 @@ #include "global.h" +struct VsSeekerSubstruct +{ + const u8 *unk_0; + u16 unk_4; + u8 unk_6; + u8 unk_7; + u16 unk_8; + u16 unk_a; + u8 unk_c; +}; + struct VsSeekerStruct { - /*0x000*/ u8 filler_00[0x431]; + /*0x000*/ struct VsSeekerSubstruct unk_000[MAP_OBJECTS_COUNT]; + /*0x100*/ u8 filler_100[0x331]; /*0x431*/ u8 unk_431_0:3; u8 unk_431_3:5; }; -- cgit v1.2.3 From b6cc51de43826e74fef7967b1694133a87c215f9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 6 Oct 2018 17:48:06 -0400 Subject: through sub_810C96C --- include/event_scripts.h | 3 +++ include/field_specials.h | 1 + include/global.h | 4 +++- include/map_obj_lock.h | 1 + include/new_menu_helpers.h | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/event_scripts.h b/include/event_scripts.h index a210e4c34..03329ba34 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -372,6 +372,9 @@ extern const u8 SecretBase_RedCave1_Text_274E75[]; extern const u8 SecretBase_RedCave1_Text_2751E1[]; extern const u8 SecretBase_RedCave1_Text_2754F6[]; extern const u8 SecretBase_RedCave1_Text_2758CC[]; + +// vs_seeker extern const u8 gUnknown_81C137C[]; extern const u8 gUnknown_81C13D6[]; +extern const u8 gUnknown_81C1429[]; #endif //GUARD_EVENT_SCRIPTS_H diff --git a/include/field_specials.h b/include/field_specials.h index 1f8fbf147..8c0e69c2c 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -2,5 +2,6 @@ #define GUARD_FIELD_SPECIALS_H u8 GetLeadMonIndex(void); +void TV_PrintIntToStringVar(u8, int); #endif // GUARD_FIELD_SPECIALS_H diff --git a/include/global.h b/include/global.h index a48de5a61..7fa5cfafe 100644 --- a/include/global.h +++ b/include/global.h @@ -480,7 +480,9 @@ struct SaveBlock1 /*0x14*/ struct WarpData warp2; /*0x1C*/ struct WarpData lastHealLocation; /*0x24*/ struct WarpData warp4; - /*0x002C*/ u8 filler2C[0x674]; + /*0x002C*/ u8 filler2C[0x60C]; + /*0x638*/ u8 trainerRematchStepCounter; + /*0x639*/ u8 trainerRematches[100]; /*0x06A0*/ struct MapObject mapObjects[MAP_OBJECTS_COUNT]; /*0x08E0*/ struct MapObjectTemplate mapObjectTemplates[64]; /*0x0EE0*/ u8 fillerEE0[0x273C]; diff --git a/include/map_obj_lock.h b/include/map_obj_lock.h index a10648f2f..cf1f714d7 100644 --- a/include/map_obj_lock.h +++ b/include/map_obj_lock.h @@ -7,5 +7,6 @@ bool8 sub_809847C(void); void LockSelectedMapObject(void); void sub_8098630(void); bool8 sub_8098734(void); +void sub_80696C0(void); #endif // GUARD_MAP_OBJ_LOCK_H diff --git a/include/new_menu_helpers.h b/include/new_menu_helpers.h index 71e1f3c0d..639395941 100644 --- a/include/new_menu_helpers.h +++ b/include/new_menu_helpers.h @@ -15,5 +15,6 @@ void sub_8197434(u8 a0, u8 a1); void SetStandardWindowBorderStyle(u8 a0, u8 a1); void sub_8197930(void); u8 GetPlayerTextSpeed(void); +void sub_80F6F54(u8, u8); #endif // GUARD_NEW_MENU_HELPERS_H -- cgit v1.2.3 From b09d7508d0064ec1d2fe490923d5acc8b272ed27 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 6 Oct 2018 22:00:21 -0400 Subject: sub_810C9A8 --- include/field_map_obj.h | 1 + include/global.h | 3 ++- include/vs_seeker.h | 9 +++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/field_map_obj.h b/include/field_map_obj.h index 0107fa10f..803ed275b 100644 --- a/include/field_map_obj.h +++ b/include/field_map_obj.h @@ -76,6 +76,7 @@ void MoveCoords(u8, s16 *, s16 *); bool8 FieldObjectIsSpecialAnimActive(struct MapObject *); u8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *); u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z); +void npc_coords_shift_still(struct MapObject *); // Exported data declarations diff --git a/include/global.h b/include/global.h index 7fa5cfafe..f1a5fbc18 100644 --- a/include/global.h +++ b/include/global.h @@ -482,7 +482,8 @@ struct SaveBlock1 /*0x24*/ struct WarpData warp4; /*0x002C*/ u8 filler2C[0x60C]; /*0x638*/ u8 trainerRematchStepCounter; - /*0x639*/ u8 trainerRematches[100]; + u8 filler_639; + /*0x63a*/ u8 trainerRematches[100]; /*0x06A0*/ struct MapObject mapObjects[MAP_OBJECTS_COUNT]; /*0x08E0*/ struct MapObjectTemplate mapObjectTemplates[64]; /*0x0EE0*/ u8 fillerEE0[0x273C]; diff --git a/include/vs_seeker.h b/include/vs_seeker.h index e01713f49..d79035576 100644 --- a/include/vs_seeker.h +++ b/include/vs_seeker.h @@ -17,8 +17,13 @@ struct VsSeekerSubstruct struct VsSeekerStruct { /*0x000*/ struct VsSeekerSubstruct unk_000[MAP_OBJECTS_COUNT]; - /*0x100*/ u8 filler_100[0x331]; - /*0x431*/ u8 unk_431_0:3; + /*0x100*/ u8 filler_100[0x300]; + /*0x400*/ u16 unk_400[0x10]; + /*0x420*/ u8 unk_420[0x10]; + /*0x430*/ u8 unk_430; + /*0x431*/ u8 unk_431_0:1; + /*0x431*/ u8 unk_431_1:1; + /*0x431*/ u8 unk_431_2:1; u8 unk_431_3:5; }; -- cgit v1.2.3 From ce33bbe84fedf7fd10552bd920ae18ed3c9775f3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 7 Oct 2018 20:37:08 -0400 Subject: through sub_810CDE8 --- include/battle_setup.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/battle_setup.h b/include/battle_setup.h index 0168022cc..9b9ad2e15 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -14,5 +14,6 @@ void trainer_flag_clear(u16); void BattleSetup_StartTrainerBattle(void); u8 *BattleSetup_GetScriptAddrAfterBattle(void); u8 *BattleSetup_GetTrainerPostBattleScript(void); +void sub_80803FC(void); #endif // GUARD_BATTLE_SETUP_H -- cgit v1.2.3 From 88c181a6b08d0b792e1a0c55f1ac010f80373d11 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 8 Oct 2018 21:49:28 -0400 Subject: through sub_810D0FC --- include/vs_seeker.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/vs_seeker.h b/include/vs_seeker.h index d79035576..e69a80dba 100644 --- a/include/vs_seeker.h +++ b/include/vs_seeker.h @@ -9,8 +9,8 @@ struct VsSeekerSubstruct u16 unk_4; u8 unk_6; u8 unk_7; - u16 unk_8; - u16 unk_a; + s16 unk_8; + s16 unk_a; u8 unk_c; }; -- cgit v1.2.3 From 6617a6e2a3148daa0d6b6f11d645f770a46d7025 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 9 Oct 2018 07:56:00 -0400 Subject: sub_810D1CC --- include/field_map_obj.h | 1 + include/unk_810c3a4.h | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 include/unk_810c3a4.h (limited to 'include') diff --git a/include/field_map_obj.h b/include/field_map_obj.h index 803ed275b..0cba810d7 100644 --- a/include/field_map_obj.h +++ b/include/field_map_obj.h @@ -77,6 +77,7 @@ bool8 FieldObjectIsSpecialAnimActive(struct MapObject *); u8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *); u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z); void npc_coords_shift_still(struct MapObject *); +void sub_805FE7C(struct MapObject *, u8); // Exported data declarations diff --git a/include/unk_810c3a4.h b/include/unk_810c3a4.h new file mode 100644 index 000000000..3f85ab00f --- /dev/null +++ b/include/unk_810c3a4.h @@ -0,0 +1,7 @@ +#ifndef GUARD_UNK_810C3A4_H +#define GUARD_UNK_810C3A4_H + +void sub_810C604(void); +void sub_810C640(void); + +#endif //GUARD_UNK_810C3A4_H -- cgit v1.2.3 From 76262efe7d75825eea49fe2a6f5cd969884032e6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 9 Oct 2018 09:46:18 -0400 Subject: sub_810D304 --- include/field_map_obj.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/field_map_obj.h b/include/field_map_obj.h index 0cba810d7..304dcb825 100644 --- a/include/field_map_obj.h +++ b/include/field_map_obj.h @@ -78,6 +78,7 @@ u8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *); u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z); void npc_coords_shift_still(struct MapObject *); void sub_805FE7C(struct MapObject *, u8); +void npc_set_running_behaviour_etc(struct MapObject *, u8); // Exported data declarations -- cgit v1.2.3 From 760d339c3b810fa13ff74b5d3a4d39cb30bc8f23 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 9 Oct 2018 10:17:08 -0400 Subject: Assign static qualifiers --- include/vs_seeker.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/vs_seeker.h b/include/vs_seeker.h index e69a80dba..cf7dbf5ab 100644 --- a/include/vs_seeker.h +++ b/include/vs_seeker.h @@ -27,4 +27,12 @@ struct VsSeekerStruct u8 unk_431_3:5; }; +void sub_810C670(u8 taskId); +void sub_810CB90(void); +void sub_810CDE8(void); +int sub_810CE64(u16 a0); +bool8 sub_810CF04(u8 a0); +u8 sub_810CF54(struct MapObjectTemplate *); +void sub_810D0D0(void); + #endif //GUARD_VS_SEEKER_H -- cgit v1.2.3 From 46e957bacd9ba5538262c89bb87e1915167bb201 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 9 Oct 2018 15:37:50 -0400 Subject: Name many functions and objects in vs_seeker.c --- include/constants/flags.h | 2 + include/constants/movement_commands.h | 117 ++++++++++++++++++++++++++++++++++ include/vs_seeker.h | 28 +------- 3 files changed, 121 insertions(+), 26 deletions(-) create mode 100644 include/constants/movement_commands.h (limited to 'include') diff --git a/include/constants/flags.h b/include/constants/flags.h index e74ef1ef0..ac9730884 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_FLAGS_H #define GUARD_CONSTANTS_FLAGS_H +// TODO: Get correct names and numbers + #define FLAG_0x001 0x1 #define FLAG_0x002 0x2 #define FLAG_0x003 0x3 diff --git a/include/constants/movement_commands.h b/include/constants/movement_commands.h new file mode 100644 index 000000000..0451e16b7 --- /dev/null +++ b/include/constants/movement_commands.h @@ -0,0 +1,117 @@ +#ifndef GUARD_CONSTANTS_MOVEMENT_COMMANDS_H +#define GUARD_CONSTANTS_MOVEMENT_COMMANDS_H + +enum +{ + step_00, + step_01, + step_02, + step_03, + slow_step_down, + slow_step_up, + slow_step_left, + slow_step_right, + step_down, + step_up, + step_left, + step_right, + fast_step_down, + fast_step_up, + fast_step_left, + fast_step_right, + step_10, + step_11, + step_12, + step_13, + step_14, + step_15, + step_16, + step_17, + step_18, + step_19, + step_1a, + step_1b, + step_1c, + step_1d, + step_1e, + step_1f, + step_20, + step_21, + step_22, + step_23, + step_24, + step_25, + step_26, + step_27, + step_28, + step_29, + step_2a, + step_2b, + step_2c, + step_2d, + step_2e, + step_2f, + step_30, + step_31, + step_32, + step_33, + step_34, + step_35, + step_36, + step_37, + step_38, + step_39, + step_3a, + step_3b, + step_3c, + step_3d, + step_3e, + step_3f, + step_40, + step_41, + step_42, + step_43, + step_44, + step_45, + step_46, + step_47, + step_48, + step_49, + step_4a, + step_4b, + step_4c, + step_4d, + step_4e, + step_4f, + step_50, + step_51, + step_52, + step_53, + step_54, + step_55, + step_56, + step_57, + step_58, + step_59, + step_5a, + step_5b, + step_5c, + step_5d, + step_5e, + step_5f, + step_60, + step_61, + step_62, + step_63, + step_64, + step_65, + + step_91 = 0x91, + step_92, + + step_96 = 0x96, + + step_end = 0xfe, +}; + +#endif //GUARD_CONSTANTS_MOVEMENT_COMMANDS_H diff --git a/include/vs_seeker.h b/include/vs_seeker.h index cf7dbf5ab..efc014a4a 100644 --- a/include/vs_seeker.h +++ b/include/vs_seeker.h @@ -3,36 +3,12 @@ #include "global.h" -struct VsSeekerSubstruct -{ - const u8 *unk_0; - u16 unk_4; - u8 unk_6; - u8 unk_7; - s16 unk_8; - s16 unk_a; - u8 unk_c; -}; - -struct VsSeekerStruct -{ - /*0x000*/ struct VsSeekerSubstruct unk_000[MAP_OBJECTS_COUNT]; - /*0x100*/ u8 filler_100[0x300]; - /*0x400*/ u16 unk_400[0x10]; - /*0x420*/ u8 unk_420[0x10]; - /*0x430*/ u8 unk_430; - /*0x431*/ u8 unk_431_0:1; - /*0x431*/ u8 unk_431_1:1; - /*0x431*/ u8 unk_431_2:1; - u8 unk_431_3:5; -}; - -void sub_810C670(u8 taskId); +void Task_VsSeeker_0(u8 taskId); void sub_810CB90(void); void sub_810CDE8(void); int sub_810CE64(u16 a0); bool8 sub_810CF04(u8 a0); -u8 sub_810CF54(struct MapObjectTemplate *); +u8 sub_810CF54(); void sub_810D0D0(void); #endif //GUARD_VS_SEEKER_H -- cgit v1.2.3