diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bike.h | 53 | ||||
-rw-r--r-- | include/field_player_avatar.h | 22 | ||||
-rw-r--r-- | include/field_special_scene.h | 4 | ||||
-rw-r--r-- | include/global.fieldmap.h | 43 | ||||
-rw-r--r-- | include/script_movement.h | 2 |
5 files changed, 81 insertions, 43 deletions
diff --git a/include/bike.h b/include/bike.h index decbd1d49..28aa2037d 100644 --- a/include/bike.h +++ b/include/bike.h @@ -1,15 +1,17 @@ #ifndef GUARD_BIKE_H #define GUARD_BIKE_H -struct UnknownStruct1 +// the struct below is used for checking button combinations of the last input so that the acro can potentially perform a side/turn jump. +// its possible that at some point Game Freak intended for the acro bike to have more complex tricks: but only the acro jump combinations can be seen in the final ROM. +struct BikeHistoryInputInfo { - u32 unk0; - u32 unk4; - u32 unk8; - u32 unkC; - const u8 *unk10; - const u8 *unk14; - u32 unk18; + u32 dirHistoryMatch; // the direction you need to press + u32 abStartSelectHistoryMatch; // the button you need to press + u32 dirHistoryMask; // mask applied so that way only the recent nybble (the recent input) is checked + u32 abStartSelectHistoryMask; // mask applied so that way only the recent nybble (the recent input) is checked + const u8 *dirTimerHistoryList; // list of timers to check for direction before the button+dir combination can be verified. + const u8 *abStartSelectHistoryList; // list of timers to check for buttons before the button+dir combination can be verified. + u32 direction; // direction to jump }; // Player speeds @@ -22,7 +24,16 @@ enum SPEED_FASTEST, }; -//Acro bike states +// mach bike transitions enum +enum +{ + MACH_TRANS_FACE_DIRECTION, + MACH_TRANS_TURN_DIRECTION, + MACH_TRANS_KEEP_MOVING, + MACH_TRANS_START_MOVING +}; + +// Acro bike states enum { ACRO_STATE_NORMAL, @@ -30,27 +41,37 @@ enum ACRO_STATE_WHEELIE_STANDING, ACRO_STATE_BUNNY_HOP, ACRO_STATE_WHEELIE_MOVING, - ACRO_STATE_5, - ACRO_STATE_6, + ACRO_STATE_SIDE_JUMP, + ACRO_STATE_TURN_JUMP, }; -//Acro bike transitions +// Acro bike transitions enum { ACRO_TRANS_FACE_DIRECTION, - ACRO_TRANS_NORMAL_TO_WHEELIE = 3, + ACRO_TRANS_TURN_DIRECTION, + ACRO_TRANS_MOVING, + ACRO_TRANS_NORMAL_TO_WHEELIE, ACRO_TRANS_WHEELIE_TO_NORMAL, + ACRO_TRANS_WHEELIE_IDLE, + ACRO_TRANS_WHEELIE_HOPPING_STANDING, + ACRO_TRANS_WHEELIE_HOPPING_MOVING, + ACRO_TRANS_SIDE_JUMP, + ACRO_TRANS_TURN_JUMP, + ACRO_TRANS_WHEELIE_MOVING, + ACRO_TRANS_WHEELIE_RISING_MOVING, + ACRO_TRANS_WHEELIE_LOWERING_MOVING, }; void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys); -void sub_80E5B38(u16 a, u16 b); +void Bike_TryAcroBikeHistoryUpdate(u16 a, u16 b); bool8 IsRunningDisallowed(u8 tile); bool8 IsBikingDisallowedByPlayer(void); bool8 player_should_look_direction_be_enforced_upon_movement(void); void GetOnOffBike(u8 var); void BikeClearState(int var1, int var2); -void sub_80E6010(u8 var); +void Bike_UpdateBikeCounterSpeed(u8 var); s16 GetPlayerSpeed(void); -void sub_80E6084(void); +void Bike_HandleBumpySlopeJump(void); #endif diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 86b1af3fb..250ed8469 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -19,7 +19,7 @@ u8 ForcedMovement_SlideSouth(void); u8 ForcedMovement_SlideNorth(void); u8 ForcedMovement_SlideWest(void); u8 ForcedMovement_SlideEast(void); -u8 sub_8058C04(void); +u8 ForcedMovement_MatJump(void); u8 sub_8058C10(void); u8 ForcedMovement_MuddySlope(void); void PlayerNotOnBikeNotMoving(u8 direction, u16 heldKeys); @@ -37,23 +37,23 @@ void sub_80591F4(struct MapObject *a); void sub_8059204(void); u8 player_get_x22(void); void PlayerSetAnimId(u8 a, u8 b); -void PlayerGoSpeed0(u8 a); -void sub_80593C4(u8 a); +void PlayerGoSpeed1(u8 a); +void PlayerGoSpeed2(u8 a); void npc_use_some_d2s(u8 a); -void sub_80593F4(u8 a); +void PlayerGoSpeed4(u8 a); void sub_805940C(u8 a); void PlayerOnBikeCollide(u8); void PlayerFaceDirection(u8 a); void PlayerTurnInPlace(u8 a); void PlayerJumpLedge(u8 a); void sub_80594C0(void); -void sub_8059504(u8 a); +void PlayerIdleWheelie(u8 a); void PlayerStartWheelie(u8 a); -void sub_8059534(u8 a); -void sub_805954C(u8 a); -void sub_8059570(u8 a); -void sub_8059594(u8 a); -void sub_80595B8(u8 a); +void PlayerEndWheelie(u8 a); +void PlayerStandingHoppingWheelie(u8 a); +void PlayerMovingHoppingWheelie(u8 a); +void PlayerLedgeHoppingWheelie(u8 a); +void PlayerAcroTurnJump(u8 a); void sub_80595DC(u8 a); void sub_8059600(u8 a); void sub_8059618(u8 a); @@ -87,7 +87,7 @@ void sub_8059C94(u8); u8 sub_8059E84(struct Task *task, struct MapObject *b, struct MapObject *c); u8 sub_8059EA4(struct Task *task, struct MapObject *b, struct MapObject *c); u8 sub_8059F40(struct Task *task, struct MapObject *b, struct MapObject *c); -u8 sub_805A000(struct Task *task, struct MapObject *mapObject); +u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *task, struct MapObject *mapObject); u8 sub_805A0D8(struct Task *task, struct MapObject *mapObject); u8 sub_805A100(struct Task *task, struct MapObject *mapObject); u8 sub_805A178(struct Task *task, struct MapObject *mapObject); diff --git a/include/field_special_scene.h b/include/field_special_scene.h index d674f09df..240e9ecb6 100644 --- a/include/field_special_scene.h +++ b/include/field_special_scene.h @@ -1,8 +1,8 @@ #ifndef GUARD_FIELD_SPECIAL_SCENE_H #define GUARD_FIELD_SPECIAL_SCENE_H -s32 GetTruckCameraBobbingY(int a1); -s32 GetTruckBoxMovement(int a1); +s16 GetTruckCameraBobbingY(int a1); +s16 GetTruckBoxMovement(int a1); void Task_Truck1(u8 taskId); void Task_Truck2(u8 taskId); void Task_Truck3(u8 taskId); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 7a8cc4592..488cc11d9 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -353,25 +353,42 @@ enum COLLISION_LEDGE_JUMP = 6 }; +// player running states +enum +{ + NOT_MOVING, + TURN_DIRECTION, // not the same as turning! turns your avatar without moving. also known as a turn frame in some circles + MOVING, +}; + +// player tile transition states +enum +{ + T_NOT_MOVING, + T_TILE_TRANSITION, + T_TILE_CENTER, // player is on a frame in which they are centered on a tile during which the player either stops or keeps their momentum and keeps going, changing direction if necessary. +}; + struct PlayerAvatar /* 0x202E858 */ { /*0x00*/ u8 flags; - /*0x01*/ u8 bike; - /*0x02*/ u8 running2; - /*0x03*/ u8 running1; + /*0x01*/ u8 unk1; // used to be named bike, but its definitely not that. seems to be some 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 mapObjectId; - /*0x06*/ u8 unk6; + /*0x06*/ bool8 preventStep; /*0x07*/ u8 gender; - u8 acroBikeState; - u8 unk9; - u8 bikeFrameCounter; - u8 unkB; - u32 unkC; - u32 unk10; - u8 unk14[8]; - u8 unk1C[8]; - // TODO: rest of struct + /*0x08*/ u8 acroBikeState; // 00 is normal, 01 is turning, 02 is standing wheelie, 03 is hopping wheelie + /*0x09*/ u8 newDirBackup; // during bike movement, the new direction as opposed to player's direction is backed up here. + /*0x0A*/ u8 bikeFrameCounter; // on the mach bike, when this value is 1, the bike is moving but not accelerating yet for 1 tile. on the acro bike, this acts as a timer for acro bike. + /*0x0B*/ u8 bikeSpeed; + // acro bike only + /*0x0C*/ u32 directionHistory; // up/down/left/right history is stored in each nybble, but using the field directions and not the io inputs. + /*0x10*/ u32 abStartSelectHistory; // same as above but for A + B + start + select only + // these two are timer history arrays which [0] is the active timer for acro bike. every element is backed up to the next element upon update. + /*0x14*/ u8 dirTimerHistory[8]; + /*0x1C*/ u8 abStartSelectTimerHistory[8]; }; struct Camera diff --git a/include/script_movement.h b/include/script_movement.h index dc6d7e51b..17c1abed7 100644 --- a/include/script_movement.h +++ b/include/script_movement.h @@ -1,7 +1,7 @@ #ifndef GUARD_SCRIPT_MOVEMENT_H #define GUARD_SCRIPT_MOVEMENT_H -bool8 ScriptMovement_StartObjectMovementScript(u8, u8, u8, u8 *); +bool8 ScriptMovement_StartObjectMovementScript(u8, u8, u8, const u8 *); bool8 ScriptMovement_IsObjectMovementFinished(u8, u8, u8); void sub_80A2178(void); |