From fbbe7c5e4c42f6c4a25c40216e4eda1d1b1fb89e Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 18 Oct 2017 02:58:11 -0400 Subject: document bike.c. --- include/global.fieldmap.h | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 5c93eb8ab..4167f7cbd 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_FRAME, // not the same as turning! turns your avatar without moving. + 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 a turn frame, 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 -- cgit v1.2.3 From 17bb6dc21f3b5ab3cf1a694bb966928d1c24482f Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 18 Oct 2017 14:21:43 -0400 Subject: mbt to mach trans and additional comments --- include/global.fieldmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index eb99cc19f..488cc11d9 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -357,7 +357,7 @@ enum enum { NOT_MOVING, - TURN_FRAME, // not the same as turning! turns your avatar without moving. + TURN_DIRECTION, // not the same as turning! turns your avatar without moving. also known as a turn frame in some circles MOVING, }; @@ -373,7 +373,7 @@ struct PlayerAvatar /* 0x202E858 */ { /*0x00*/ u8 flags; /*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 a turn frame, 02 is moving. + /*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; -- cgit v1.2.3