Player Docs: Idle and Fidget (#1723)

* idle and fidget docs

* more cleanup

* cleanup

* regs

* spacing
This commit is contained in:
engineer124 2024-10-21 01:35:03 +11:00 committed by GitHub
parent 781d1d1119
commit d03e8719e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 645 additions and 294 deletions

View File

@ -17,7 +17,7 @@
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
#define ARRAY_COUNT_2D(arr) (ARRAY_COUNT(arr) * ARRAY_COUNT(arr[0])) #define ARRAY_COUNT_2D(arr) (s32)(sizeof(arr) / sizeof(arr[0][0]))
#define CLOCK_TIME(hr, min) (s32)(((hr) * 60 + (min)) * 0x10000 / (24 * 60)) #define CLOCK_TIME(hr, min) (s32)(((hr) * 60 + (min)) * 0x10000 / (24 * 60))
#define CLOCK_TIME_MINUTE (CLOCK_TIME(0, 1)) #define CLOCK_TIME_MINUTE (CLOCK_TIME(0, 1))

View File

@ -64,6 +64,7 @@ extern RegEditor* gRegEditor;
#define R_ENV_DISABLE_DBG REG(9) #define R_ENV_DISABLE_DBG REG(9)
#define R_TIME_SPEED REG(15) #define R_TIME_SPEED REG(15)
#define R_DECELERATE_RATE REG(43)
#define R_RUN_SPEED_LIMIT REG(45) #define R_RUN_SPEED_LIMIT REG(45)
#define R_ENABLE_ARENA_DBG SREG(0) // Same as OoT #define R_ENABLE_ARENA_DBG SREG(0) // Same as OoT

View File

@ -57,6 +57,12 @@ typedef enum {
/* 4 */ PLAYER_ENV_HAZARD_UNDERWATER_FREE /* 4 */ PLAYER_ENV_HAZARD_UNDERWATER_FREE
} PlayerEnvHazard; } PlayerEnvHazard;
typedef enum PlayerIdleType {
/* -0x1 */ PLAYER_IDLE_CRIT_HEALTH = -1,
/* 0x0 */ PLAYER_IDLE_DEFAULT,
/* 0x1 */ PLAYER_IDLE_FIDGET
} PlayerIdleType;
/* /*
* Current known usages for PLAYER_IA_MINUS1: * Current known usages for PLAYER_IA_MINUS1:
* 1. With TalkExchange requests, used to continue a current conversation after a textbox is closed * 1. With TalkExchange requests, used to continue a current conversation after a textbox is closed
@ -984,8 +990,8 @@ typedef enum PlayerCueId {
#define PLAYER_STATE2_4000000 (1 << 26) #define PLAYER_STATE2_4000000 (1 << 26)
// //
#define PLAYER_STATE2_8000000 (1 << 27) #define PLAYER_STATE2_8000000 (1 << 27)
// // Playing a fidget idle animation (under typical circumstances, see `Player_ChooseNextIdleAnim` for more info)
#define PLAYER_STATE2_10000000 (1 << 28) #define PLAYER_STATE2_IDLE_FIDGET (1 << 28)
// Disable drawing player // Disable drawing player
#define PLAYER_STATE2_20000000 (1 << 29) #define PLAYER_STATE2_20000000 (1 << 29)
// Lunge: small forward boost at the end of certain attack animations // Lunge: small forward boost at the end of certain attack animations
@ -1220,7 +1226,7 @@ typedef struct Player {
/* 0xA98 */ Actor* unk_A98; /* 0xA98 */ Actor* unk_A98;
/* 0xA9C */ f32 secretRumbleCharge; // builds per frame until discharges with a rumble request /* 0xA9C */ f32 secretRumbleCharge; // builds per frame until discharges with a rumble request
/* 0xAA0 */ f32 closestSecretDistSq; // Used to augment `secretRumbleCharge`. Cleared every frame /* 0xAA0 */ f32 closestSecretDistSq; // Used to augment `secretRumbleCharge`. Cleared every frame
/* 0xAA4 */ s8 unk_AA4; /* 0xAA4 */ s8 idleType;
/* 0xAA5 */ u8 unk_AA5; // PlayerUnkAA5 enum /* 0xAA5 */ u8 unk_AA5; // PlayerUnkAA5 enum
/* 0xAA6 */ u16 unk_AA6_rotFlags; // See `UNKAA6_ROT_` macros. If its flag isn't set, a rot steps to 0. /* 0xAA6 */ u16 unk_AA6_rotFlags; // See `UNKAA6_ROT_` macros. If its flag isn't set, a rot steps to 0.
/* 0xAA8 */ s16 upperLimbYawSecondary; /* 0xAA8 */ s16 upperLimbYawSecondary;
@ -1251,6 +1257,7 @@ typedef struct Player {
} av1; // "Action Variable 1": context dependent variable that has different meanings depending on what action is currently running } av1; // "Action Variable 1": context dependent variable that has different meanings depending on what action is currently running
/* 0xAE8 */ union { /* 0xAE8 */ union {
s16 actionVar2; s16 actionVar2;
s16 fallDamageStunTimer; // Player_Action_Idle: Prevents any movement and shakes model up and down quickly to indicate fall damage stun
} av2; // "Action Variable 2": context dependent variable that has different meanings depending on what action is currently running } av2; // "Action Variable 2": context dependent variable that has different meanings depending on what action is currently running
/* 0xAEC */ f32 unk_AEC; /* 0xAEC */ f32 unk_AEC;
/* 0xAF0 */ union { /* 0xAF0 */ union {

View File

@ -416,21 +416,173 @@ FlexSkeletonHeader* gPlayerSkeletons[PLAYER_FORM_MAX] = {
s16 D_801BFE14[PLAYER_BOOTS_MAX][18] = { s16 D_801BFE14[PLAYER_BOOTS_MAX][18] = {
// PLAYER_BOOTS_FIERCE_DEITY // PLAYER_BOOTS_FIERCE_DEITY
{ 200, 666, 200, 700, 366, 200, 600, 175, 60, 800, 1000, -100, 600, 590, 800, 125, 300, 65 }, {
200, // REG(19)
666, // REG(30)
200, // REG(32)
700, // REG(34)
366, // REG(35)
200, // REG(36)
600, // REG(37)
175, // REG(38)
60, // REG(39)
800, // R_DECELERATE_RATE
1000, // R_RUN_SPEED_LIMIT
-100, // REG(68)
600, // REG(69)
590, // IREG(66)
800, // IREG(67)
125, // IREG(68)
300, // IREG(69)
65, // MREG(95)
},
// PLAYER_BOOTS_HYLIAN // PLAYER_BOOTS_HYLIAN
{ 200, 1000, 300, 800, 500, 400, 800, 400, 120, 800, 550, -100, 600, 540, 750, 125, 400, 200 }, {
200, // REG(19)
1000, // REG(30)
300, // REG(32)
800, // REG(34)
500, // REG(35)
400, // REG(36)
800, // REG(37)
400, // REG(38)
120, // REG(39)
800, // R_DECELERATE_RATE
550, // R_RUN_SPEED_LIMIT
-100, // REG(68)
600, // REG(69)
540, // IREG(66)
750, // IREG(67)
125, // IREG(68)
400, // IREG(69)
200, // MREG(95)
},
// PLAYER_BOOTS_GIANT // PLAYER_BOOTS_GIANT
{ 100, 1000, 300, 800, 250, 200, 800, 200, 90, 800, 350, -80, 600, 540, 750, 60, 200, 200 }, {
100, // REG(19)
1000, // REG(30)
300, // REG(32)
800, // REG(34)
250, // REG(35)
200, // REG(36)
800, // REG(37)
200, // REG(38)
90, // REG(39)
800, // R_DECELERATE_RATE
350, // R_RUN_SPEED_LIMIT
-80, // REG(68)
600, // REG(69)
540, // IREG(66)
750, // IREG(67)
60, // IREG(68)
200, // IREG(69)
200, // MREG(95)
},
// PLAYER_BOOTS_DEKU // PLAYER_BOOTS_DEKU
{ 200, 1000, 300, 700, 550, 270, 600, 1000, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, {
200, // REG(19)
1000, // REG(30)
300, // REG(32)
700, // REG(34)
550, // REG(35)
270, // REG(36)
600, // REG(37)
1000, // REG(38)
120, // REG(39)
800, // R_DECELERATE_RATE
600, // R_RUN_SPEED_LIMIT
-100, // REG(68)
600, // REG(69)
590, // IREG(66)
750, // IREG(67)
125, // IREG(68)
200, // IREG(69)
130, // MREG(95)
},
// PLAYER_BOOTS_ZORA_LAND // PLAYER_BOOTS_ZORA_LAND
{ 200, 1000, 300, 700, 550, 270, 700, 300, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, {
200, // REG(19)
1000, // REG(30)
300, // REG(32)
700, // REG(34)
550, // REG(35)
270, // REG(36)
700, // REG(37)
300, // REG(38)
120, // REG(39)
800, // R_DECELERATE_RATE
600, // R_RUN_SPEED_LIMIT
-100, // REG(68)
600, // REG(69)
590, // IREG(66)
750, // IREG(67)
125, // IREG(68)
200, // IREG(69)
130, // MREG(95)
},
// PLAYER_BOOTS_ZORA_UNDERWATER // PLAYER_BOOTS_ZORA_UNDERWATER
{ 200, 1000, 300, 700, 550, 270, 700, 300, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, {
200, // REG(19)
1000, // REG(30)
300, // REG(32)
700, // REG(34)
550, // REG(35)
270, // REG(36)
700, // REG(37)
300, // REG(38)
120, // REG(39)
800, // R_DECELERATE_RATE
600, // R_RUN_SPEED_LIMIT
-100, // REG(68)
600, // REG(69)
590, // IREG(66)
750, // IREG(67)
125, // IREG(68)
200, // IREG(69)
130, // MREG(95)
},
// PLAYER_BOOTS_GORON // PLAYER_BOOTS_GORON
{ 200, 1000, 300, 700, 550, 270, 700, 200, 120, 800, 600, -140, 600, 590, 750, 125, 200, 130 }, {
200, // REG(19)
1000, // REG(30)
300, // REG(32)
700, // REG(34)
550, // REG(35)
270, // REG(36)
700, // REG(37)
200, // REG(38)
120, // REG(39)
800, // R_DECELERATE_RATE
600, // R_RUN_SPEED_LIMIT
-140, // REG(68)
600, // REG(69)
590, // IREG(66)
750, // IREG(67)
125, // IREG(68)
200, // IREG(69)
130, // MREG(95)
},
// PLAYER_BOOTS_7 // PLAYER_BOOTS_7
{ 80, 800, 150, 700, 480, 270, 600, 50, 120, 800, 300, -40, 400, 540, 270, 25, 0, 80 }, {
80, // REG(19)
800, // REG(30)
150, // REG(32)
700, // REG(34)
480, // REG(35)
270, // REG(36)
600, // REG(37)
50, // REG(38)
120, // REG(39)
800, // R_DECELERATE_RATE
300, // R_RUN_SPEED_LIMIT
-40, // REG(68)
400, // REG(69)
540, // IREG(66)
270, // IREG(67)
25, // IREG(68)
0, // IREG(69)
80, // MREG(95)
},
}; };
// OoT's Player_SetBootData // OoT's Player_SetBootData
@ -469,7 +621,7 @@ void func_80123140(PlayState* play, Player* player) {
REG(37) = bootRegs[6]; REG(37) = bootRegs[6];
REG(38) = bootRegs[7]; REG(38) = bootRegs[7];
REG(39) = bootRegs[8]; REG(39) = bootRegs[8];
REG(43) = bootRegs[9]; R_DECELERATE_RATE = bootRegs[9];
R_RUN_SPEED_LIMIT = bootRegs[10]; R_RUN_SPEED_LIMIT = bootRegs[10];
REG(68) = bootRegs[11]; // gravity REG(68) = bootRegs[11]; // gravity
REG(69) = bootRegs[12]; REG(69) = bootRegs[12];

View File

@ -4,6 +4,7 @@
* Description: Kafei * Description: Kafei
*/ */
#include "prevent_bss_reordering.h"
#include "z_en_test3.h" #include "z_en_test3.h"
#include "zelda_arena.h" #include "zelda_arena.h"

File diff suppressed because it is too large Load Diff

View File

@ -4300,9 +4300,9 @@
0x8082EC9C:("Player_Anim_PlayOnceWaterAdjustment",), 0x8082EC9C:("Player_Anim_PlayOnceWaterAdjustment",),
0x8082ECCC:("func_8082ECCC",), 0x8082ECCC:("func_8082ECCC",),
0x8082ECE0:("func_8082ECE0",), 0x8082ECE0:("func_8082ECE0",),
0x8082ED20:("func_8082ED20",), 0x8082ED20:("Player_GetIdleAnim",),
0x8082ED94:("func_8082ED94",), 0x8082ED94:("Player_CheckForIdleAnim",),
0x8082EEA4:("func_8082EEA4",), 0x8082EEA4:("Player_ProcessFidgetAnimSfxList",),
0x8082EEE0:("func_8082EEE0",), 0x8082EEE0:("func_8082EEE0",),
0x8082EF20:("func_8082EF20",), 0x8082EF20:("func_8082EF20",),
0x8082EF54:("func_8082EF54",), 0x8082EF54:("func_8082EF54",),
@ -4381,7 +4381,7 @@
0x80832754:("func_80832754",), 0x80832754:("func_80832754",),
0x80832888:("func_80832888",), 0x80832888:("func_80832888",),
0x80832CAC:("Player_CalcSpeedAndYawFromControlStick",), 0x80832CAC:("Player_CalcSpeedAndYawFromControlStick",),
0x80832F24:("func_80832F24",), 0x80832F24:("Player_DecelerateToZero",),
0x80832F78:("Player_GetMovementSpeedAndYaw",), 0x80832F78:("Player_GetMovementSpeedAndYaw",),
0x80833058:("Player_TryActionHandlerList",), 0x80833058:("Player_TryActionHandlerList",),
0x808331FC:("Player_TryActionInterrupt",), 0x808331FC:("Player_TryActionInterrupt",),
@ -4557,7 +4557,7 @@
0x8083E958:("func_8083E958",), 0x8083E958:("func_8083E958",),
0x8083E9C4:("func_8083E9C4",), 0x8083E9C4:("func_8083E9C4",),
0x8083EA44:("func_8083EA44",), 0x8083EA44:("func_8083EA44",),
0x8083EBD0:("Player_ChooseIdleAnim",), 0x8083EBD0:("Player_ChooseNextIdleAnim",),
0x8083EE60:("func_8083EE60",), 0x8083EE60:("func_8083EE60",),
0x8083F144:("func_8083F144",), 0x8083F144:("func_8083F144",),
0x8083F190:("func_8083F190",), 0x8083F190:("func_8083F190",),
@ -4665,7 +4665,7 @@
0x808497A0:("Player_Action_1",), 0x808497A0:("Player_Action_1",),
0x80849A9C:("Player_Action_2",), 0x80849A9C:("Player_Action_2",),
0x80849DD0:("Player_Action_3",), 0x80849DD0:("Player_Action_3",),
0x80849FE0:("Player_Action_4",), 0x80849FE0:("Player_Action_Idle",),
0x8084A26C:("Player_Action_5",), 0x8084A26C:("Player_Action_5",),
0x8084A5C0:("Player_Action_6",), 0x8084A5C0:("Player_Action_6",),
0x8084A794:("Player_Action_7",), 0x8084A794:("Player_Action_7",),

View File

@ -4806,24 +4806,24 @@
0x8085C318:("D_8085C318","UNK_TYPE1","",0x1), 0x8085C318:("D_8085C318","UNK_TYPE1","",0x1),
0x8085C344:("D_8085C344","UNK_TYPE1","",0x1), 0x8085C344:("D_8085C344","UNK_TYPE1","",0x1),
0x8085C394:("D_8085C394","UNK_TYPE1","",0x1), 0x8085C394:("D_8085C394","UNK_TYPE1","",0x1),
0x8085C3E4:("sPlayerWaterSpeedScale","f32","",0x4), 0x8085C3E4:("sWaterSpeedFactor","f32","",0x4),
0x8085C3E8:("D_8085C3E8","f32","",0x4), 0x8085C3E8:("sInvWaterSpeedFactor","f32","",0x4),
0x8085C3EC:("D_8085C3EC","UNK_TYPE2","",0x2), 0x8085C3EC:("D_8085C3EC","UNK_TYPE2","",0x2),
0x8085C3F4:("sGetItemTable","GetItemEntry","[0xB9]",0x456), 0x8085C3F4:("sGetItemTable","GetItemEntry","[0xB9]",0x456),
0x8085C84C:("sPlayerIdleAnimations","UNK_TYPE4","",0x78), 0x8085C84C:("sFidgetAnimations","UNK_TYPE4","",0x78),
0x8085C8C4:("D_8085C8C4","UNK_TYPE1","",0x1), 0x8085C8C4:("sFidgetAnimSfxSneeze","UNK_TYPE1","",0x1),
0x8085C8C8:("D_8085C8C8","UNK_TYPE1","",0x1), 0x8085C8C8:("sFidgetAnimSfxSweat","UNK_TYPE1","",0x1),
0x8085C8CC:("D_8085C8CC","UNK_TYPE1","",0x1), 0x8085C8CC:("sFidgetAnimSfxCritHealthStart","UNK_TYPE1","",0x1),
0x8085C8D0:("D_8085C8D0","UNK_TYPE1","",0x1), 0x8085C8D0:("sFidgetAnimSfxCritHealthLoop","UNK_TYPE1","",0x1),
0x8085C8D4:("D_8085C8D4","UNK_TYPE1","",0x1), 0x8085C8D4:("sFidgetAnimSfxTunic","UNK_TYPE1","",0x1),
0x8085C8E8:("D_8085C8E8","UNK_TYPE1","",0x1), 0x8085C8E8:("sFidgetAnimSfxTapFeet","UNK_TYPE1","",0x1),
0x8085C900:("D_8085C900","UNK_TYPE1","",0x1), 0x8085C900:("sFidgetAnimSfxShield","UNK_TYPE1","",0x1),
0x8085C90C:("D_8085C90C","UNK_TYPE1","",0x1), 0x8085C90C:("sFidgetAnimSfxSword","UNK_TYPE1","",0x1),
0x8085C91C:("D_8085C91C","UNK_TYPE1","",0x1), 0x8085C91C:("sFidgetAnimSfxSwordTwoHand","UNK_TYPE1","",0x1),
0x8085C924:("D_8085C924","UNK_TYPE1","",0x1), 0x8085C924:("sFidgetAnimSfxStretch","UNK_TYPE1","",0x1),
0x8085C928:("D_8085C928","UNK_TYPE1","",0x14), 0x8085C928:("sFidgetAnimSfxPigGrunt","UNK_TYPE1","",0x14),
0x8085C93C:("D_8085C93C","UNK_TYPE1","",0x1), 0x8085C93C:("sFidgetAnimSfxLists","UNK_TYPE1","",0x1),
0x8085C96C:("D_8085C96C","UNK_TYPE1","",0x1), 0x8085C96C:("sFidgetAnimSfxTypes","UNK_TYPE1","",0x1),
0x8085C98C:("sZoraBarrierEnvLighting","UNK_TYPE1","",0x1), 0x8085C98C:("sZoraBarrierEnvLighting","UNK_TYPE1","",0x1),
0x8085C99C:("sItemActionParams","UNK_TYPE1","",0x1), 0x8085C99C:("sItemActionParams","UNK_TYPE1","",0x1),
0x8085C9F0:("sPlayerUpperActionUpdateFuncs","UNK_PTR","",0x4), 0x8085C9F0:("sPlayerUpperActionUpdateFuncs","UNK_PTR","",0x4),
@ -4855,7 +4855,7 @@
0x8085D004:("sActionHandlerList4","UNK_TYPE1","",0x1), 0x8085D004:("sActionHandlerList4","UNK_TYPE1","",0x1),
0x8085D00C:("sActionHandlerList5","UNK_TYPE1","",0x1), 0x8085D00C:("sActionHandlerList5","UNK_TYPE1","",0x1),
0x8085D018:("sActionHandlerList6","UNK_TYPE1","",0x1), 0x8085D018:("sActionHandlerList6","UNK_TYPE1","",0x1),
0x8085D01C:("sActionHandlerList7","UNK_TYPE1","",0x1), 0x8085D01C:("sActionHandlerListIdle","UNK_TYPE1","",0x1),
0x8085D028:("sActionHandlerList8","UNK_TYPE1","",0x1), 0x8085D028:("sActionHandlerList8","UNK_TYPE1","",0x1),
0x8085D034:("sActionHandlerList9","UNK_TYPE1","",0x1), 0x8085D034:("sActionHandlerList9","UNK_TYPE1","",0x1),
0x8085D044:("sActionHandlerList10","UNK_TYPE1","",0x1), 0x8085D044:("sActionHandlerList10","UNK_TYPE1","",0x1),