From dbac777d95875b49e98da94551a89616c2addf3c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 22 Mar 2020 20:17:47 -0400 Subject: through CheckMovementInputNotOnBike --- include/bike.h | 3 +++ include/event_object_movement.h | 3 +++ include/global.fieldmap.h | 6 +++--- include/metatile_behavior.h | 8 ++++---- 4 files changed, 13 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/bike.h b/include/bike.h index 30049ee8c..1ff1ed5a3 100644 --- a/include/bike.h +++ b/include/bike.h @@ -6,4 +6,7 @@ bool8 sub_80BD540(void); void StartTransitionToFlipBikeState(u8 flags); s16 GetPlayerSpeed(void); +void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys); +void MovePlayerNotOnBike(u8 direction, u16 heldKeys); + #endif //GUARD_BIKE_H diff --git a/include/event_object_movement.h b/include/event_object_movement.h index e01364e55..3d5ea03f1 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -26,6 +26,8 @@ struct UnkStruct_083A3698 u8 animPos[4]; }; +typedef void (*MovementAction)(u8 direction); + #define GROUND_EFFECT_FLAG_TALL_GRASS_ON_SPAWN (1 << 0) #define GROUND_EFFECT_FLAG_TALL_GRASS_ON_MOVE (1 << 1) #define GROUND_EFFECT_FLAG_LONG_GRASS_ON_SPAWN (1 << 2) @@ -186,6 +188,7 @@ void sub_8068CA4(struct Sprite *, u8); bool8 sub_8068CB4(struct Sprite *sprite); void SetAndStartSpriteAnim(struct Sprite *, u8, u8); bool8 SpriteAnimEnded(struct Sprite *); +u8 ObjectEventGetHeldMovementActionId(struct ObjectEvent *objectEvent); // Exported data declarations diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 3c4b5f382..fe794a69e 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -283,8 +283,8 @@ struct ObjectEventGraphicsInfo #define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << 2) #define PLAYER_AVATAR_FLAG_SURFING (1 << 3) #define PLAYER_AVATAR_FLAG_4 (1 << 4) -#define PLAYER_AVATAR_FLAG_5 (1 << 5) -#define PLAYER_AVATAR_FLAG_6 (1 << 6) +#define PLAYER_AVATAR_FLAG_FORCED_MVMT_DISABLED (1 << 5) +#define PLAYER_AVATAR_FLAG_MVMT_IS_FORCED (1 << 6) #define PLAYER_AVATAR_FLAG_DASH (1 << 7) enum @@ -349,7 +349,7 @@ struct PlayerAvatar /* 0x202E858 */ u32 unkC; u32 unk10; u8 unk14[8]; - u8 unk1C[8]; + u16 unk1C; // TODO: rest of struct }; diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index ae3e6a01d..34f5bbd7b 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -115,10 +115,10 @@ bool8 MetatileBehavior_UnusedReturnFalse_11(u8 metatileBehavior); bool8 MetatileBehavior_UnusedReturnFalse_12(u8 metatileBehavior); bool8 MetatileBehavior_UnusedReturnFalse_13(u8 metatileBehavior); bool8 TestMetatileAttributeBit(u8 attr, u8 bitmask); -bool8 MetatileBehavior_UnusedIsSpinRight(u8 metatileBehavior); -bool8 MetatileBehavior_UnusedIsSpinLeft(u8 metatileBehavior); -bool8 MetatileBehavior_UnusedIsSpinUp(u8 metatileBehavior); -bool8 MetatileBehavior_UnusedIsSpinDown(u8 metatileBehavior); +bool8 MetatileBehavior_IsSpinRight(u8 metatileBehavior); +bool8 MetatileBehavior_IsSpinLeft(u8 metatileBehavior); +bool8 MetatileBehavior_IsSpinUp(u8 metatileBehavior); +bool8 MetatileBehavior_IsSpinDown(u8 metatileBehavior); bool8 MetatileBehavior_IsStopSpinning(u8 metatileBehavior); bool8 MetatileBehavior_IsSpinTile(u8 metatileBehavior); bool8 MetatileBehavior_IsSignpost(u8 metatileBehavior); -- cgit v1.2.3 From f9a3607824d00f17999288e241fc3ad339716279 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 23 Mar 2020 08:54:37 -0400 Subject: through CheckForObjectEventCollision --- include/bike.h | 2 +- include/constants/flags.h | 2 +- include/field_player_avatar.h | 1 + include/global.fieldmap.h | 7 +------ 4 files changed, 4 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/bike.h b/include/bike.h index 1ff1ed5a3..154ffeeee 100644 --- a/include/bike.h +++ b/include/bike.h @@ -7,6 +7,6 @@ void StartTransitionToFlipBikeState(u8 flags); s16 GetPlayerSpeed(void); void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys); -void MovePlayerNotOnBike(u8 direction, u16 heldKeys); +bool32 IsRunningDisallowed(u8 metatileBehavior); #endif //GUARD_BIKE_H diff --git a/include/constants/flags.h b/include/constants/flags.h index ccac1da3b..417e68255 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1345,7 +1345,7 @@ #define FLAG_SYS_GAME_CLEAR (SYS_FLAGS + 0x2C) #define FLAG_SYS_SET_TRAINER_CARD_PROFILE (SYS_FLAGS + 0x2D) #define FLAG_0x82E (SYS_FLAGS + 0x2E) -#define FLAG_SYS_RUNNING_SHOES (SYS_FLAGS + 0x2F) +#define FLAG_SYS_B_DASH (SYS_FLAGS + 0x2F) #define FLAG_SYS_ON_CYCLING_ROAD (SYS_FLAGS + 0x30) #define FLAG_0x831 (SYS_FLAGS + 0x31) #define FLAG_0x832 (SYS_FLAGS + 0x32) diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 51ae9905f..76271b5cf 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -11,6 +11,7 @@ void PlayerGetDestCoords(s16 *, s16 *); u8 GetPlayerFacingDirection(void); u8 GetPlayerMovementDirection(void); u8 PlayerGetCopyableMovement(void); +void MovePlayerNotOnBike(u8 direction, u16 heldKeys); void sub_808D074(u8); void sub_805C270(void); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index fe794a69e..658ad7393 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -308,12 +308,7 @@ enum COLLISION_STOP_SURFING, COLLISION_LEDGE_JUMP, COLLISION_PUSHED_BOULDER, - COLLISION_ROTATING_GATE, - COLLISION_WHEELIE_HOP, - COLLISION_ISOLATED_VERTICAL_RAIL, - COLLISION_ISOLATED_HORIZONTAL_RAIL, - COLLISION_VERTICAL_RAIL, - COLLISION_HORIZONTAL_RAIL, + COLLISION_UNKNOWN_WARP_6C_6D_6E_6F, }; // player running states -- cgit v1.2.3 From 5b3e9f376b2ed230df1d7e6d23e0239f69d10ba4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 23 Mar 2020 21:42:35 -0400 Subject: through PlayerGetCopyableMovement --- include/constants/event_objects.h | 2 +- include/constants/flags.h | 2 +- include/event_object_movement.h | 1 + include/global.fieldmap.h | 5 +++++ include/metatile_behavior.h | 12 ++++++------ include/quest_log_player.h | 2 ++ 6 files changed, 16 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 2d51cd74d..08634f5f2 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -98,7 +98,7 @@ #define OBJ_EVENT_GFX_POKEDEX 94 #define OBJ_EVENT_GFX_CUT_TREE 95 #define OBJ_EVENT_GFX_ROCK_SMASH_ROCK 96 -#define OBJ_EVENT_GFX_STRENGTH_BOULDER 97 +#define OBJ_EVENT_GFX_PUSHABLE_BOULDER 97 #define OBJ_EVENT_GFX_FOSSIL 98 #define OBJ_EVENT_GFX_RUBY 99 #define OBJ_EVENT_GFX_SAPPHIRE 100 diff --git a/include/constants/flags.h b/include/constants/flags.h index 417e68255..6fd532a0e 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1321,7 +1321,7 @@ #define FLAG_SYS_VS_SEEKER_CHARGING (SYS_FLAGS + 0x1) #define FLAG_SYS_WHITE_FLUTE_ACTIVE (SYS_FLAGS + 0x3) #define FLAG_SYS_BLACK_FLUTE_ACTIVE (SYS_FLAGS + 0x4) -#define FLAG_SYS_STRENGTH_ACTIVE (SYS_FLAGS + 0x5) +#define FLAG_SYS_USE_STRENGTH (SYS_FLAGS + 0x5) #define FLAG_SYS_FLASH_ACTIVE (SYS_FLAGS + 0x6) #define FLAG_SYS_SPECIAL_WILD_BATTLE (SYS_FLAGS + 0x7) #define FLAG_0x808 (SYS_FLAGS + 0x8) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 3d5ea03f1..7bdeb08c5 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -199,5 +199,6 @@ extern const struct OamData gObjectEventBaseOam_32x32; extern const u16 gUnknown_8398648[]; extern const u16 gUnknown_8398688[]; extern const u8 gReflectionEffectPaletteMap[]; +u8 GetLedgeJumpDirection(s16 x, s16 y, u8 z); #endif // GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 658ad7393..f5660a8a4 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -309,6 +309,11 @@ enum COLLISION_LEDGE_JUMP, COLLISION_PUSHED_BOULDER, COLLISION_UNKNOWN_WARP_6C_6D_6E_6F, + COLLISION_WHEELIE_HOP, + COLLISION_ISOLATED_VERTICAL_RAIL, + COLLISION_ISOLATED_HORIZONTAL_RAIL, + COLLISION_VERTICAL_RAIL, + COLLISION_HORIZONTAL_RAIL, }; // player running states diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index 34f5bbd7b..a5f5a81b7 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -23,7 +23,7 @@ bool8 MetatileBehavior_IsUnknownWarp6E(u8 metatileBehavior); bool8 MetatileBehavior_IsUnknownWarp6F(u8 metatileBehavior); bool8 MetatileBehavior_IsUnknownWarp6C_to_6F(u8 metatileBehavior); bool8 MetatileBehavior_IsLadder(u8 metatileBehavior); -bool8 MetatileBehavior_IsCaveDoor(u8 metatileBehavior); +bool8 MetatileBehavior_IsNonAnimDoor(u8 metatileBehavior); bool8 MetatileBehavior_ReturnFalse_2(u8 metatileBehavior); bool8 MetatileBehavior_IsSurfable(u8 metatileBehavior); bool8 MetatileBehavior_IsSemiDeepWater(u8 metatileBehavior); @@ -98,11 +98,11 @@ bool8 MetatileBehavior_IsFallWarp(u8 metatileBehavior); bool8 MetatileBehavior_ReturnFalse_13(u8 metatileBehavior); bool8 MetatileBehavior_IsCyclingRoadPullDownTile(u8 metatileBehavior); bool8 MetatileBehavior_IsCyclingRoadPullDownTileGrass(u8 metatileBehavior); -bool8 MetatileBehavior_ReturnFalse_14(u8 metatileBehavior); -bool8 MetatileBehavior_ReturnFalse_15(u8 metatileBehavior); -bool8 MetatileBehavior_ReturnFalse_16(u8 metatileBehavior); -bool8 MetatileBehavior_ReturnFalse_17(u8 metatileBehavior); -bool8 MetatileBehavior_ReturnFalse_18(u8 metatileBehavior); +bool8 MetatileBehavior_IsBumpySlope(u8 metatileBehavior); +bool8 MetatileBehavior_IsIsolatedVerticalRail(u8 metatileBehavior); +bool8 MetatileBehavior_IsIsolatedHorizontalRail(u8 metatileBehavior); +bool8 MetatileBehavior_IsVerticalRail(u8 metatileBehavior); +bool8 MetatileBehavior_IsHorizontalRail(u8 metatileBehavior); bool8 MetatileBehavior_IsSeaweed(u8 metatileBehavior); bool8 MetatileBehavior_IsMB0A(u8 metatileBehavior); bool8 MetatileBehavior_UnusedReturnFalse_9(u8 metatileBehavior); diff --git a/include/quest_log_player.h b/include/quest_log_player.h index 9cde1747e..eedb6fa37 100644 --- a/include/quest_log_player.h +++ b/include/quest_log_player.h @@ -4,5 +4,7 @@ #include "global.h" void sub_8150454(void); +bool8 sub_8150474(u8 a0); +void sub_8150498(u8 a0); #endif //GUARD_QUEST_LOG_PLAYER_H -- cgit v1.2.3 From 87b2c7f34b5a734d3af98ea2dc7d9fafecd809a6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 24 Mar 2020 08:56:14 -0400 Subject: through PlayerSetAnimId; some quest log doc --- include/constants/vars.h | 9 ++++----- include/quest_log.h | 9 +++++---- include/quest_log_objects.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/constants/vars.h b/include/constants/vars.h index 4a64eb095..358209eaf 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -221,11 +221,10 @@ #define VAR_0x40A7 0x40A7 #define VAR_0x40A8 0x40A8 #define VAR_0x40A9 0x40A9 -#define VAR_0x40AA 0x40AA -#define VAR_0x40AB 0x40AB -#define VAR_0x40AC 0x40AC -#define VAR_0x40AD 0x40AD -#define VAR_0x40AE 0x40AE + +#define VAR_QLBAK_TRAINER_REMATCHES 0x40AA // array of 4 +#define VAR_QLBAK_MAP_LAYOUT 0x40AE + #define VAR_0x40AF 0x40AF #define VAR_0x40B0 0x40B0 #define VAR_0x40B1 0x40B1 diff --git a/include/quest_log.h b/include/quest_log.h index e2e652a81..f4fe0ca45 100644 --- a/include/quest_log.h +++ b/include/quest_log.h @@ -18,9 +18,9 @@ struct UnkStruct_3005E90 extern u8 gQuestLogState; extern u8 gUnknown_3005E88; -extern u16 sNumQuestLogs; +extern u16 sNumEventsInLogEntry; extern struct UnkStruct_3005E90 gUnknown_3005E90; -extern struct UnkStruct_203AE98 * gUnknown_3005E94; +extern struct QuestLogEntry * sCurQuestLogEntry; extern const u16 gUnknown_84566A8[]; void sub_8112720(u8); @@ -30,7 +30,7 @@ void QuestLog_RecordEnteredMap(u16); u8 sub_8112CAC(void); bool8 QuestLog_SchedulePlaybackCB(void (*func)(void)); void sub_8111F38(u16 offset, u16 idx); -void sub_8111134(void); +void CommitQuestLogWindow1(void); void DestroyHelpMessageWindow(u8 a0); u8 CreateHelpMessageWindow(void); void PrintTextOnHelpMessageWindow(const u8 * text, u8 mode); @@ -53,7 +53,8 @@ void sub_811246C(struct Sprite *sprite); void sub_81124EC(u8 a0, u8 a1, u8 a2, u8 a3); bool8 sub_8111C2C(void); void sub_81128BC(u8 a0); -void sub_811278C(u8, u8); +void sub_811278C(u8 movementActionId, u8 duration); void Special_UpdateTrainerFansAfterLinkBattle(void); +void sub_8112628(u8 movementActionId); #endif //GUARD_QUEST_LOG_H diff --git a/include/quest_log_objects.h b/include/quest_log_objects.h index e582ba27a..d3e11d11f 100644 --- a/include/quest_log_objects.h +++ b/include/quest_log_objects.h @@ -4,6 +4,6 @@ #include "global.h" void SetQuestLogObjectEventsData(struct QuestLog *); -void sub_815A1F8(struct QuestLog *, struct ObjectEventTemplate *); +void SetSav1ObjectEventsFromQuestLog(struct QuestLog *, struct ObjectEventTemplate *); #endif //GUARD_QUEST_LOG_OBJECTS_H -- cgit v1.2.3 From 8a85485cc25b9ac67c9b60697efd56c88d7b1d5f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 24 Mar 2020 18:17:18 -0400 Subject: through PlayerTurnInPlace --- include/event_object_movement.h | 6 ++++++ include/quest_log.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 7bdeb08c5..8b2944578 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -200,5 +200,11 @@ extern const u16 gUnknown_8398648[]; extern const u16 gUnknown_8398688[]; extern const u8 gReflectionEffectPaletteMap[]; u8 GetLedgeJumpDirection(s16 x, s16 y, u8 z); +u8 sub_8063F58(u32 direction); +u8 sub_8063FDC(u32 direction); +u8 sub_8064008(u32 direction); +u8 GetPlayerRunMovementAction(u32 direction); +u8 GetPlayerRunSlowMovementAction(u32 direction); +u8 GetWalkSlowMovementAction(u32 direction); #endif // GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/quest_log.h b/include/quest_log.h index f4fe0ca45..70a5c2f30 100644 --- a/include/quest_log.h +++ b/include/quest_log.h @@ -56,5 +56,7 @@ void sub_81128BC(u8 a0); void sub_811278C(u8 movementActionId, u8 duration); void Special_UpdateTrainerFansAfterLinkBattle(void); void sub_8112628(u8 movementActionId); +void sub_81126AC(u8 movementActionId, u8 duration); +void sub_8112588(u8 localId, u8 mapNum, u8 mapGroup, u8 movementActionId, u8 duration); #endif //GUARD_QUEST_LOG_H -- cgit v1.2.3 From 6c964a63505f6dc7527661400f6aae145c4cdf4b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 24 Mar 2020 20:59:37 -0400 Subject: through InitPlayerAvatar --- include/bike.h | 2 ++ include/event_object_movement.h | 11 +++++++++++ include/field_player_avatar.h | 5 +++-- include/global.fieldmap.h | 27 +++++++++++++++++++-------- 4 files changed, 35 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/bike.h b/include/bike.h index 154ffeeee..bdc61ecfe 100644 --- a/include/bike.h +++ b/include/bike.h @@ -8,5 +8,7 @@ s16 GetPlayerSpeed(void); void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys); bool32 IsRunningDisallowed(u8 metatileBehavior); +void Bike_HandleBumpySlopeJump(void); +void Bike_UpdateBikeCounterSpeed(u8 counter); #endif //GUARD_BIKE_H diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 8b2944578..12d3305e7 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -206,5 +206,16 @@ u8 sub_8064008(u32 direction); u8 GetPlayerRunMovementAction(u32 direction); u8 GetPlayerRunSlowMovementAction(u32 direction); u8 GetWalkSlowMovementAction(u32 direction); +u8 sub_80640E4(u32 direction); +u8 GetAcroWheelieFaceDirectionMovementAction(u32 direction); +u8 GetAcroPopWheelieFaceDirectionMovementAction(u32 direction); +u8 GetAcroEndWheelieFaceDirectionMovementAction(u32 direction); +u8 GetAcroWheelieHopFaceDirectionMovementAction(u32 direction); +u8 GetAcroWheelieHopDirectionMovementAction(u32 direction); +u8 GetAcroWheelieJumpDirectionMovementAction(u32 direction); +u8 GetJumpInPlaceTurnAroundMovementAction(u32 direction); +u8 GetAcroWheelieInPlaceDirectionMovementAction(u32 direction); +u8 GetAcroPopWheelieMoveDirectionMovementAction(u32 direction); +u8 GetAcroWheelieMoveDirectionMovementAction(u32 direction); #endif // GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 76271b5cf..7440bd0bd 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -36,8 +36,9 @@ bool32 sub_805DAD0(void); bool32 sub_805DC24(void); bool8 PartyHasMonWithSurf(void); bool8 IsPlayerSurfingNorth(void); -void player_get_pos_including_state_based_drift(s16 *x, s16 *y); +u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); void sub_805CBE8(void); -u8 sub_805C7C8(u8 state, u8 gender); +u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8 state, u8 gender); +u8 GetPlayerAvatarGraphicsIdByStateIdAndGender(u8 state, u8 gender); #endif //GUARD_FIELD_PLAYER_AVATAR_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index f5660a8a4..38391bf27 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -278,14 +278,25 @@ struct ObjectEventGraphicsInfo /*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_4 (1 << 4) -#define PLAYER_AVATAR_FLAG_FORCED_MVMT_DISABLED (1 << 5) -#define PLAYER_AVATAR_FLAG_MVMT_IS_FORCED (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_4 (1 << PLAYER_AVATAR_STATE_UNDERWATER) +#define PLAYER_AVATAR_FLAG_FORCED_MVMT_DISABLED (1 << PLAYER_AVATAR_STATE_FIELD_MOVE) +#define PLAYER_AVATAR_FLAG_MVMT_IS_FORCED (1 << PLAYER_AVATAR_STATE_FISHING) +#define PLAYER_AVATAR_FLAG_DASH (1 << PLAYER_AVATAR_STATE_WATERING) enum { -- cgit v1.2.3 From f1841ef24d63aa2425d4316b9f49408d90c29bdb Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 25 Mar 2020 08:57:52 -0400 Subject: through sub_805D1A8 --- include/constants/event_objects.h | 4 ++-- include/field_control_avatar.h | 1 + include/field_effect_helpers.h | 2 ++ include/field_player_avatar.h | 4 ++-- include/overworld.h | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 08634f5f2..cccba35ff 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -7,14 +7,14 @@ #define OBJ_EVENT_GFX_RED_ITEM 3 #define OBJ_EVENT_GFX_RED_FISH 4 #define OBJ_EVENT_GFX_RED_ITEM_COPY 5 -#define OBJ_EVENT_GFX_RED_VS_SEEKER 6 +#define OBJ_EVENT_GFX_RED_FIELD_MOVE_BIKE 6 #define OBJ_EVENT_GFX_GREEN_NORMAL 7 #define OBJ_EVENT_GFX_GREEN_BIKE 8 #define OBJ_EVENT_GFX_GREEN_SURF 9 #define OBJ_EVENT_GFX_GREEN_ITEM 10 #define OBJ_EVENT_GFX_GREEN_FISH 11 #define OBJ_EVENT_GFX_GREEN_ITEM_COPY 12 -#define OBJ_EVENT_GFX_GREEN_VS_SEEKER 13 +#define OBJ_EVENT_GFX_GREEN_FIELD_MOVE_BIKE 13 #define OBJ_EVENT_GFX_RS_BRENDAN 14 #define OBJ_EVENT_GFX_RS_MAY 15 #define OBJ_EVENT_GFX_LITTLE_BOY 16 diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h index 335076a9d..e0873aa52 100644 --- a/include/field_control_avatar.h +++ b/include/field_control_avatar.h @@ -35,5 +35,6 @@ void FieldClearPlayerInput(struct FieldInput *input); int ProcessPlayerFieldInput(struct FieldInput *input); void FieldInput_HandleCancelSignpost(struct FieldInput * input); void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys); +void sub_806DE70(u16 x, u16 y); #endif //GUARD_FIELD_CONTROL_AVATAR_H diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 9472f0b94..a1fbe49b2 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -22,5 +22,7 @@ bool8 sub_80DCBE0(struct ObjectEvent *); void SetUpReflection(struct ObjectEvent*, struct Sprite*, u8); u32 StartFieldEffectForObjectEvent(u8, struct ObjectEvent*); u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); +void ShowWarpArrowSprite(u8 spriteId, u8 direction, s16 x, s16 y); +void SetSpriteInvisible(u8 spriteId); #endif //GUARD_FIELD_EFFECT_HELPERS_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 7440bd0bd..1dcdb8e5d 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -20,7 +20,7 @@ void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); u8 GetPlayerAvatarGraphicsIdByStateId(u8); void SetPlayerAvatarStateMask(u8 mask); void sub_805D9C4(struct Sprite *sprite); -void sub_805D154(u8 direction); +void CreateStopSurfingTask_NoMusicChange(u8 direction); void sub_805DAE4(u8 direction); void SetPlayerAvatarTransitionFlags(u16 a); bool8 IsPlayerFacingSurfableFishableWater(void); @@ -29,7 +29,7 @@ u8 GetPlayerAvatarObjectId(void); u8 PlayerGetZCoord(void); u8 GetPlayerAvatarGraphicsIdByCurrentState(void); void sub_805CB70(void); -void sub_805CB04(bool8); +void SetPlayerInvisibility(bool8); void sub_805DC04(void); void sub_805DAB0(void); bool32 sub_805DAD0(void); diff --git a/include/overworld.h b/include/overworld.h index bd4dda9b6..730df3667 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -85,7 +85,7 @@ void sub_8084EBC(s16, s16); void sub_80555E0(void); void copy_saved_warp3_bank_and_enter_x_to_warp1(void); u8 IsMapTypeOutdoors(u8 mapType); -void sav1_reset_battle_music_maybe(void); +void Overworld_ClearSavedMusic(void); bool32 sub_8056124(u16 song); void player_avatar_init_params_reset(void); -- cgit v1.2.3 From c032dc02319139771d8fed40c14297ee81b18b34 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 25 Mar 2020 17:37:07 -0400 Subject: through AlignFishingAnimationFrames --- include/event_object_movement.h | 2 ++ include/field_effect_helpers.h | 1 + include/field_player_avatar.h | 4 ++-- include/quest_log.h | 1 + include/quest_log_player.h | 2 +- include/strings.h | 5 +++++ 6 files changed, 12 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 12d3305e7..496b2f245 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -217,5 +217,7 @@ u8 GetJumpInPlaceTurnAroundMovementAction(u32 direction); u8 GetAcroWheelieInPlaceDirectionMovementAction(u32 direction); u8 GetAcroPopWheelieMoveDirectionMovementAction(u32 direction); u8 GetAcroWheelieMoveDirectionMovementAction(u32 direction); +u8 sub_80641EC(u32 direction); +u8 sub_8063510(u8 direction); #endif // GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index a1fbe49b2..4505b2e48 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -24,5 +24,6 @@ u32 StartFieldEffectForObjectEvent(u8, struct ObjectEvent*); u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); void ShowWarpArrowSprite(u8 spriteId, u8 direction, s16 x, s16 y); void SetSpriteInvisible(u8 spriteId); +void sub_80DC4A4(u8 spriteId, u8 value, s16 data1); #endif //GUARD_FIELD_EFFECT_HELPERS_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 1dcdb8e5d..51e29c060 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -19,12 +19,12 @@ void sub_805C780(void); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); u8 GetPlayerAvatarGraphicsIdByStateId(u8); void SetPlayerAvatarStateMask(u8 mask); -void sub_805D9C4(struct Sprite *sprite); +void AlignFishingAnimationFrames(struct Sprite *sprite); void CreateStopSurfingTask_NoMusicChange(u8 direction); void sub_805DAE4(u8 direction); void SetPlayerAvatarTransitionFlags(u16 a); bool8 IsPlayerFacingSurfableFishableWater(void); -void sub_805D2C0(u8 secondaryId); +void StartFishing(u8 secondaryId); u8 GetPlayerAvatarObjectId(void); u8 PlayerGetZCoord(void); u8 GetPlayerAvatarGraphicsIdByCurrentState(void); diff --git a/include/quest_log.h b/include/quest_log.h index 70a5c2f30..28c69505b 100644 --- a/include/quest_log.h +++ b/include/quest_log.h @@ -58,5 +58,6 @@ void Special_UpdateTrainerFansAfterLinkBattle(void); void sub_8112628(u8 movementActionId); void sub_81126AC(u8 movementActionId, u8 duration); void sub_8112588(u8 localId, u8 mapNum, u8 mapGroup, u8 movementActionId, u8 duration); +void sub_8112C9C(void); #endif //GUARD_QUEST_LOG_H diff --git a/include/quest_log_player.h b/include/quest_log_player.h index eedb6fa37..5aee3f2d0 100644 --- a/include/quest_log_player.h +++ b/include/quest_log_player.h @@ -4,7 +4,7 @@ #include "global.h" void sub_8150454(void); -bool8 sub_8150474(u8 a0); +bool32 sub_8150474(u8 a0); void sub_8150498(u8 a0); #endif //GUARD_QUEST_LOG_PLAYER_H diff --git a/include/strings.h b/include/strings.h index e7f274abd..37d856a86 100644 --- a/include/strings.h +++ b/include/strings.h @@ -1463,4 +1463,9 @@ extern const u8 gUnknown_841B2C6[]; extern const u8 gUnknown_841B2E5[]; extern const u8 gUnknown_841B2DC[]; +// field_player_avatar +extern const u8 gText_PokemonOnHook[]; +extern const u8 gText_NotEvenANibble[]; +extern const u8 gText_ItGotAway[]; + #endif //GUARD_STRINGS_H -- cgit v1.2.3 From 302c6bfe6b13a329cb2aa36913b07b86abcc3694 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 25 Mar 2020 18:00:26 -0400 Subject: finish field_player_avatar --- include/bike.h | 1 + include/field_player_avatar.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/bike.h b/include/bike.h index bdc61ecfe..ad2bd999a 100644 --- a/include/bike.h +++ b/include/bike.h @@ -10,5 +10,6 @@ void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys); bool32 IsRunningDisallowed(u8 metatileBehavior); void Bike_HandleBumpySlopeJump(void); void Bike_UpdateBikeCounterSpeed(u8 counter); +bool8 player_should_look_direction_be_enforced_upon_movement(void); #endif //GUARD_BIKE_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 51e29c060..6d854b58b 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -13,7 +13,6 @@ u8 GetPlayerMovementDirection(void); u8 PlayerGetCopyableMovement(void); void MovePlayerNotOnBike(u8 direction, u16 heldKeys); -void sub_808D074(u8); void sub_805C270(void); void sub_805C780(void); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); -- cgit v1.2.3 From 3a29f9be954b8846f32865be146aefaf1b9f5fda Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 25 Mar 2020 18:12:07 -0400 Subject: static syms in field_player_avatar --- include/field_player_avatar.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include') diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 6d854b58b..d6c02d8ab 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -39,5 +39,25 @@ u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); void sub_805CBE8(void); u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8 state, u8 gender); u8 GetPlayerAvatarGraphicsIdByStateIdAndGender(u8 state, u8 gender); +u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior); +void sub_805C0D4(u8 direction); +void PlayerGoSlow(u8 direction); +void PlayerGoSpeed1(u8 direction); +void PlayerGoSpeed2(u8 direction); +void sub_805C134(u8 direction); +void PlayerRideWaterCurrent(u8 direction); +void sub_805C164(u8 direction); +void PlayerRun(u8 direction); +void PlayerRunSlow(u8 direction); +void PlayerOnBikeCollide(u8 direction); +void PlayerNotOnBikeCollide(u8 direction); +void PlayerFaceDirection(u8 direction); +void sub_805C20C(u8 direction); +void PlayerTurnInPlace(u8 direction); +void PlayerJumpLedge(u8 direction); +void sub_805C260(void); +void player_step(u8 direction, u16 newKeys, u16 heldKeys); +bool32 PlayerIsMovingOnRockStairs(u8 direction); +void sub_805BEB8(void); #endif //GUARD_FIELD_PLAYER_AVATAR_H -- cgit v1.2.3 From adc7a0b65a16f8fcbbadd527980950dec351b9cd Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 25 Mar 2020 19:40:34 -0400 Subject: Document field teleport anim --- include/field_fadetransition.h | 4 ++-- include/field_player_avatar.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/field_fadetransition.h b/include/field_fadetransition.h index d649fc02f..240353f5e 100644 --- a/include/field_fadetransition.h +++ b/include/field_fadetransition.h @@ -11,7 +11,7 @@ void DoDoorWarp(void); void DoFallWarp(void); void DoTeleportWarp(void); void sub_807E500(void); -void sub_807DF64(void); +void FieldCB_UnionRoomWarp(void); void WarpFadeOutScreen(void); void FieldCallback_ReturnToEventScript2(void); void FadeInFromBlack(void); @@ -20,7 +20,7 @@ void WarpFadeInScreen(void); void sub_807DCE4(void); -bool32 sub_807E418(void); +bool32 FieldFadeTransitionBackgroundEffectIsFinished(void); void palette_bg_faded_fill_black(void); void sub_807E4A0(u16 metatileBehavior, u16 delay); void DoEscalatorWarp(u8 a0); diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index d6c02d8ab..90e2baaaf 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -20,7 +20,7 @@ u8 GetPlayerAvatarGraphicsIdByStateId(u8); void SetPlayerAvatarStateMask(u8 mask); void AlignFishingAnimationFrames(struct Sprite *sprite); void CreateStopSurfingTask_NoMusicChange(u8 direction); -void sub_805DAE4(u8 direction); +void SavePlayerFacingDirectionForTeleport(u8 direction); void SetPlayerAvatarTransitionFlags(u16 a); bool8 IsPlayerFacingSurfableFishableWater(void); void StartFishing(u8 secondaryId); @@ -29,10 +29,10 @@ u8 PlayerGetZCoord(void); u8 GetPlayerAvatarGraphicsIdByCurrentState(void); void sub_805CB70(void); void SetPlayerInvisibility(bool8); -void sub_805DC04(void); -void sub_805DAB0(void); -bool32 sub_805DAD0(void); -bool32 sub_805DC24(void); +void StartTeleportInPlayerAnim(void); +void StartTeleportWarpOutPlayerAnim(void); +bool32 WaitTeleportWarpOutPlayerAnim(void); +bool32 WaitTeleportInPlayerAnim(void); bool8 PartyHasMonWithSurf(void); bool8 IsPlayerSurfingNorth(void); u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); -- cgit v1.2.3 From 9cb08e34750ad591daf69900d9f857cb8a4ddfbe Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 25 Mar 2020 20:40:44 -0400 Subject: Document player avatar fields --- include/global.fieldmap.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 38391bf27..1858d3344 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -289,14 +289,14 @@ enum { 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_4 (1 << PLAYER_AVATAR_STATE_UNDERWATER) -#define PLAYER_AVATAR_FLAG_FORCED_MVMT_DISABLED (1 << PLAYER_AVATAR_STATE_FIELD_MOVE) -#define PLAYER_AVATAR_FLAG_MVMT_IS_FORCED (1 << PLAYER_AVATAR_STATE_FISHING) -#define PLAYER_AVATAR_FLAG_DASH (1 << 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_FIELD_MOVE (1 << PLAYER_AVATAR_STATE_FIELD_MOVE) +#define PLAYER_AVATAR_FLAG_FISHING (1 << PLAYER_AVATAR_STATE_FISHING) +#define PLAYER_AVATAR_FLAG_WATERING (1 << PLAYER_AVATAR_STATE_WATERING) enum { @@ -346,22 +346,23 @@ enum struct PlayerAvatar /* 0x202E858 */ { /*0x00*/ u8 flags; - /*0x01*/ u8 unk1; // used to be bike, but it's not that in Emerald and probably isn't here either. maybe transition flags? + /*0x01*/ u8 transitionFlags; // used to be bike, but it's not that in Emerald and probably isn't here either. maybe transition flags? /*0x02*/ u8 runningState; // this is a static running state. 00 is not moving, 01 is turn direction, 02 is moving. /*0x03*/ u8 tileTransitionState; // this is a transition running state: 00 is not moving, 01 is transition between tiles, 02 means you are on the frame in which you have centered on a tile but are about to keep moving, even if changing directions. 2 is also used for a ledge hop, since you are transitioning. /*0x04*/ u8 spriteId; /*0x05*/ u8 objectEventId; /*0x06*/ bool8 preventStep; /*0x07*/ u8 gender; + // These are not used in FRLG u8 acroBikeState; - u8 unk9; + u8 newDirBackup; u8 bikeFrameCounter; - u8 unkB; - u32 unkC; - u32 unk10; - u8 unk14[8]; - u16 unk1C; - // TODO: rest of struct + u8 bikeSpeed; + u32 directionHistory; + u32 abStartSelectHistory; + u8 dirTimerHistory[8]; + // For the Rocket mazes + u16 lastSpinTile; }; struct Camera -- cgit v1.2.3 From 9130579f1454c869e74ea8c953c0c778a4760396 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 26 Mar 2020 17:37:14 -0400 Subject: Resolve off-by-one error in evobjmv.c --- include/event_object_movement.h | 6 +++--- include/field_player_avatar.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 34247c3a5..792118c00 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -119,8 +119,8 @@ bool8 ObjectEventSetHeldMovement(struct ObjectEvent *, u8); void ShiftStillObjectEventCoords(struct ObjectEvent *); void OverrideMovementTypeForObjectEvent(const struct ObjectEvent *, u8); void SetTrainerMovementType(struct ObjectEvent *, u8); -u8 GetFishingNoCatchDirectionAnimNum(u8 direction); -u8 GetFishingBiteDirectionAnimNum(u8 a0); +u8 GetFishingDirectionAnimNum(u8 direction); +u8 GetFishingNoCatchDirectionAnimNum(u8 a0); void ObjectEventSetGraphicsId(struct ObjectEvent *objectEvent, u8 a1); u8 sub_805EB44(u8, u8, s16, s16); void InitObjectEventPalettes(u8 mode); @@ -220,6 +220,6 @@ u8 GetAcroWheelieInPlaceDirectionMovementAction(u32 direction); u8 GetAcroPopWheelieMoveDirectionMovementAction(u32 direction); u8 GetAcroWheelieMoveDirectionMovementAction(u32 direction); u8 sub_80641EC(u32 direction); -u8 sub_8063510(u8 direction); +u8 GetFishingBiteDirectionAnimNum(u8 direction); #endif // GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index b88952038..73109ae1e 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -13,6 +13,7 @@ u8 GetPlayerMovementDirection(void); u8 PlayerGetCopyableMovement(void); void MovePlayerNotOnBike(u8 direction, u16 heldKeys); +void MovementType_Player(struct Sprite * sprite); void sub_805C270(void); void sub_805C780(void); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); -- cgit v1.2.3