Start Player Item Docs (#1396)

* Copy Fig Docs

* small cleanup

* ItemChangeType comment

* bool

* item change comments

* PR Review

* rm comments
This commit is contained in:
engineer124 2023-09-30 17:28:14 +10:00 committed by GitHub
parent 9b1335aa7b
commit 33aaaea2c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 387 additions and 293 deletions

View File

@ -884,7 +884,7 @@ s32 func_80123448(PlayState* play);
s32 Player_IsGoronOrDeku(Player* player);
s32 func_801234D4(PlayState* play);
s32 func_80123590(PlayState* play, Actor* actor);
ItemId func_8012364C(PlayState* play, Player* player, s32 arg2);
ItemId Player_GetItemOnButton(PlayState* play, Player* player, EquipSlot slot);
PlayerItemAction func_80123810(PlayState* play);
PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerItemAction itemAction);
void Player_SetModelsForHoldingShield(Player* player);

View File

@ -1040,7 +1040,7 @@ typedef enum PlayerCueId {
// breman mask march?
#define PLAYER_STATE3_20000000 (1 << 29)
//
#define PLAYER_STATE3_40000000 (1 << 30)
#define PLAYER_STATE3_START_CHANGING_HELD_ITEM (1 << 30)
// TARGETING_HOSTILE?
#define PLAYER_STATE3_80000000 (1 << 31)
@ -1095,7 +1095,7 @@ typedef struct Player {
/* 0x14B */ u8 transformation; // PlayerTransformation enum
/* 0x14C */ u8 modelGroup; // PlayerModelGroup enum
/* 0x14D */ u8 nextModelGroup;
/* 0x14E */ s8 unk_14E;
/* 0x14E */ s8 itemChangeType; // ItemChangeType enum
/* 0x14F */ u8 modelAnimType; // PlayerAnimType enum
/* 0x150 */ u8 leftHandType;
/* 0x151 */ u8 rightHandType;
@ -1122,7 +1122,7 @@ typedef struct Player {
/* 0x238 */ OSMesg maskObjectLoadMsg;
/* 0x23C */ void* maskObjectSegment;
/* 0x240 */ SkelAnime skelAnime;
/* 0x284 */ SkelAnime unk_284;
/* 0x284 */ SkelAnime skelAnimeUpper;
/* 0x2C8 */ SkelAnime unk_2C8;
/* 0x30C */ Vec3s jointTable[5];
/* 0x32A */ Vec3s morphTable[5];
@ -1176,8 +1176,8 @@ typedef struct Player {
/* 0x74C */ u8 jointTableBuffer[PLAYER_LIMB_BUF_SIZE];
/* 0x7EB */ u8 morphTableBuffer[PLAYER_LIMB_BUF_SIZE];
/* 0x88A */ u8 blendTableBuffer[PLAYER_LIMB_BUF_SIZE];
/* 0x929 */ u8 unk_929[PLAYER_LIMB_BUF_SIZE];
/* 0x9C8 */ u8 unk_9C8[PLAYER_LIMB_BUF_SIZE];
/* 0x929 */ u8 jointTableUpperBuffer[PLAYER_LIMB_BUF_SIZE];
/* 0x9C8 */ u8 morphTableUpperBuffer[PLAYER_LIMB_BUF_SIZE];
/* 0xA68 */ PlayerAgeProperties* ageProperties; // repurposed as "transformation properties"?
/* 0xA6C */ u32 stateFlags1;
/* 0xA70 */ u32 stateFlags2;
@ -1206,7 +1206,7 @@ typedef struct Player {
/* 0xABC */ f32 unk_ABC;
/* 0xAC0 */ f32 unk_AC0;
/* 0xAC4 */ PlayerUpperActionFunc upperActionFunc; // Upper body/item action functions
/* 0xAC8 */ f32 unk_AC8;
/* 0xAC8 */ f32 skelAnimeUpperBlendWeight;
/* 0xACC */ s16 unk_ACC;
/* 0xACE */ s8 unk_ACE;
/* 0xACF */ u8 putAwayCountdown; // Frames to wait before showing "Put Away" on A

View File

@ -570,12 +570,12 @@ s32 func_801235DC(PlayState* play, f32 arg1, s16 arg2) {
return false;
}
ItemId func_8012364C(PlayState* play, Player* player, s32 arg2) {
if (arg2 >= 4) {
ItemId Player_GetItemOnButton(PlayState* play, Player* player, EquipSlot slot) {
if (slot >= EQUIP_SLOT_A) {
return ITEM_NONE;
}
if (arg2 == 0) {
if (slot == EQUIP_SLOT_B) {
ItemId item = Inventory_GetBtnBItem(play);
if (item >= ITEM_FD) {
@ -597,18 +597,24 @@ ItemId func_8012364C(PlayState* play, Player* player, s32 arg2) {
return item;
}
if (arg2 == 1) {
if (slot == EQUIP_SLOT_C_LEFT) {
return C_BTN_ITEM(EQUIP_SLOT_C_LEFT);
}
if (arg2 == 2) {
if (slot == EQUIP_SLOT_C_DOWN) {
return C_BTN_ITEM(EQUIP_SLOT_C_DOWN);
}
// EQUIP_SLOT_C_RIGHT
return C_BTN_ITEM(EQUIP_SLOT_C_RIGHT);
}
u16 sCItemButtons[] = { BTN_CLEFT, BTN_CDOWN, BTN_CRIGHT };
u16 sCItemButtons[] = {
BTN_CLEFT,
BTN_CDOWN,
BTN_CRIGHT,
};
PlayerItemAction func_80123810(PlayState* play) {
Player* player = GET_PLAYER(play);
@ -630,7 +636,7 @@ PlayerItemAction func_80123810(PlayState* play) {
for (i = 0; i < ARRAY_COUNT(sCItemButtons); i++) {
if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, sCItemButtons[i])) {
i++;
itemId = func_8012364C(play, player, i);
itemId = Player_GetItemOnButton(play, player, i);
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
@ -2092,7 +2098,7 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
EnArrow* bubble = NULL;
if (((player->skelAnime.animation == &gPlayerAnim_pn_drinkend)) ||
(player->unk_284.animation == &gPlayerAnim_pn_tamahaki) ||
(player->skelAnimeUpper.animation == &gPlayerAnim_pn_tamahaki) ||
((player->stateFlags3 & PLAYER_STATE3_40) && ((bubble = (EnArrow*)player->heldActor) != NULL))) {
Matrix_TranslateRotateZYX(pos, rot);
func_80125340();
@ -2108,7 +2114,7 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
} else if (player->skelAnime.animation == &gPlayerAnim_pn_drinkend) {
func_80124618(D_801C03E0, player->skelAnime.curFrame, player->unk_AF0);
} else {
func_80124618(D_801C03C0, player->unk_284.curFrame, player->unk_AF0);
func_80124618(D_801C03C0, player->skelAnimeUpper.curFrame, player->unk_AF0);
}
Matrix_Scale(player->unk_AF0[0].x, player->unk_AF0[0].y, player->unk_AF0[0].z, MTXMODE_APPLY);
@ -3784,7 +3790,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
Matrix_MultVec3f(&sPlayerFocusHeadLimbModelPos, &player->actor.focus.pos);
Matrix_MultVec3f(&D_801C0E94, sPlayerCurBodyPartPos);
if ((player->skelAnime.animation == &gPlayerAnim_pn_drinkend) ||
(player->unk_284.animation == &gPlayerAnim_pn_tamahaki) ||
(player->skelAnimeUpper.animation == &gPlayerAnim_pn_tamahaki) ||
((player->stateFlags3 & PLAYER_STATE3_40) && ((spA8 = player->heldActor) != NULL))) {
if (spA8 != NULL) {
static Vec3f D_801C0EA0 = { 1300.0f, -400.0f, 0.0f };

File diff suppressed because it is too large Load Diff

View File

@ -2199,7 +2199,7 @@
0x801234D4:("func_801234D4",),
0x80123590:("func_80123590",),
0x801235DC:("func_801235DC",),
0x8012364C:("func_8012364C",),
0x8012364C:("Player_GetItemOnButton",),
0x80123810:("func_80123810",),
0x80123960:("Player_ActionToModelGroup",),
0x801239AC:("Player_SetModelsForHoldingShield",),
@ -4256,7 +4256,7 @@
0x8082DC28:("func_8082DC28",),
0x8082DC38:("func_8082DC38",),
0x8082DC64:("func_8082DC64",),
0x8082DCA0:("func_8082DCA0",),
0x8082DCA0:("Player_DetachHeldActor",),
0x8082DD2C:("func_8082DD2C",),
0x8082DE14:("func_8082DE14",),
0x8082DE50:("func_8082DE50",),
@ -4314,7 +4314,7 @@
0x8082F164:("func_8082F164",),
0x8082F1AC:("func_8082F1AC",),
0x8082F43C:("Player_SetUpperAction",),
0x8082F470:("func_8082F470",),
0x8082F470:("Player_InitItemActionWithAnim",),
0x8082F524:("Player_ItemToItemAction",),
0x8082F594:("Player_InitItemAction_DoNothing",),
0x8082F5A4:("Player_InitItemAction_DekuStick",),
@ -4323,30 +4323,30 @@
0x8082F62C:("Player_InitItemAction_SpawnExplosive",),
0x8082F7F4:("Player_InitItemAction_SpawnHookshot",),
0x8082F8A0:("Player_InitItemAction_5",),
0x8082F8BC:("func_8082F8BC",),
0x8082F8BC:("Player_InitItemAction",),
0x8082F938:("Player_OverrideBlureColors",),
0x8082FA5C:("func_8082FA5C",),
0x8082FB68:("func_8082FB68",),
0x8082FBE8:("func_8082FBE8",),
0x8082FC24:("func_8082FC24",),
0x8082FC60:("func_8082FC60",),
0x8082FC78:("func_8082FC78",),
0x8082FCC4:("func_8082FCC4",),
0x8082FC78:("Player_ItemIsInUse",),
0x8082FCC4:("Player_ItemIsItemAction",),
0x8082FD0C:("func_8082FD0C",),
0x8082FDC4:("func_8082FDC4",),
0x8082FE0C:("func_8082FE0C",),
0x808302CC:("func_808302CC",),
0x808304BC:("func_808304BC",),
0x8082FE0C:("Player_ProcessItemButtons",),
0x808302CC:("Player_StartChangingHeldItem",),
0x808304BC:("Player_UpdateItems",),
0x808305BC:("func_808305BC",),
0x808306F8:("func_808306F8",),
0x808308DC:("func_808308DC",),
0x808308DC:("Player_FinishItemChange",),
0x808309CC:("func_808309CC",),
0x80830A58:("func_80830A58",),
0x80830AE8:("func_80830AE8",),
0x80830B38:("func_80830B38",),
0x80830B88:("func_80830B88",),
0x80830CE8:("func_80830CE8",),
0x80830D40:("func_80830D40",),
0x80830D40:("Player_WaitToFinishItemChange",),
0x80830DF0:("func_80830DF0",),
0x80830E30:("func_80830E30",),
0x80830F9C:("func_80830F9C",),
@ -4362,15 +4362,15 @@
0x80831494:("Player_SetAction",),
0x8083172C:("Player_SetAction_PreserveMoveFlags",),
0x80831760:("Player_SetAction_PreserveItemAction",),
0x808317C4:("func_808317C4",),
0x808317C4:("Player_DestroyHookshot",),
0x80831814:("func_80831814",),
0x808318C0:("func_808318C0",),
0x80831944:("func_80831944",),
0x80831990:("func_80831990",),
0x80831990:("Player_UseItem",),
0x80831F34:("func_80831F34",),
0x80832090:("func_80832090",),
0x80832090:("Player_CanUpdateItems",),
0x8083213C:("func_8083213C",),
0x8083216C:("func_8083216C",),
0x8083216C:("Player_UpdateUpperBody",),
0x808323C0:("func_808323C0",),
0x80832444:("func_80832444",),
0x8083249C:("func_8083249C",),
@ -4646,7 +4646,7 @@
0x80848640:("func_80848640",),
0x80848780:("Player_UpperAction_0",),
0x808487B8:("Player_UpperAction_1",),
0x80848808:("Player_UpperAction_2",),
0x80848808:("Player_UpperAction_ChangeHeldItem",),
0x8084894C:("Player_UpperAction_3",),
0x80848A0C:("Player_UpperAction_4",),
0x80848AB0:("Player_UpperAction_5",),

View File

@ -4914,7 +4914,7 @@
0x8082DA82:("sPauseZRCursorGreen","UNK_TYPE1","",0x1),
0x8082DA84:("sPauseZRCursorBlue","UNK_TYPE1","",0x1),
0x8082DA86:("sPauseZRCursorAlpha","UNK_TYPE1","",0x1),
0x8085B9F0:("D_8085B9F0","UNK_TYPE1","",0x1),
0x8085B9F0:("sPlayerUpperBodyLimbCopyMap","UNK_TYPE1","",0x1),
0x8085BA08:("D_8085BA08","UNK_TYPE1","",0x1),
0x8085BA20:("D_8085BA20","UNK_TYPE1","",0x1),
0x8085BA38:("sPlayerAgeProperties","UNK_TYPE1","",0x1),
@ -4944,10 +4944,10 @@
0x8085C96C:("D_8085C96C","UNK_TYPE1","",0x1),
0x8085C98C:("sZoraBarrierEnvLighting","UNK_TYPE1","",0x1),
0x8085C99C:("sItemActionParams","UNK_TYPE1","",0x1),
0x8085C9F0:("D_8085C9F0","UNK_PTR","",0x4),
0x8085CB3C:("sPlayerInitItemActionFuncs","UNK_PTR","",0x4),
0x8085CC88:("D_8085CC88","UNK_TYPE1","",0x1),
0x8085CD00:("D_8085CD00","s8","[36]",0x24),
0x8085C9F0:("sPlayerUpperActionUpdateFuncs","UNK_PTR","",0x4),
0x8085CB3C:("sPlayerItemActionInitFuncs","UNK_PTR","",0x4),
0x8085CC88:("sPlayerItemChangeInfo","UNK_TYPE1","",0x1),
0x8085CD00:("sPlayerItemChangeTypes","s8","[36]",0x24),
0x8085CD24:("sPlayerExplosiveInfo","UNK_TYPE1","",0x1),
0x8085CD30:("sMeleeAttackAnimInfo","UNK_TYPE1","",0x220),
0x8085CF50:("D_8085CF50","UNK_TYPE1","",0x1),
@ -4959,7 +4959,7 @@
0x8085CF80:("D_8085CF80","UNK_TYPE1","",0x1),
0x8085CF84:("D_8085CF84","UNK_TYPE1","",0x1),
0x8085CF88:("D_8085CF88","BlureColors","[2]",0x20),
0x8085CFA8:("D_8085CFA8","u16","[4]",0x8),
0x8085CFA8:("sPlayerItemButtons","u16","[4]",0x8),
0x8085CFB0:("D_8085CFB0","UNK_TYPE1","",0x1),
0x8085CFB8:("sMagicArrowCosts","u8","[4]",0x4),
0x8085CFBC:("D_8085CFBC","UNK_TYPE1","",0x1),
@ -5017,7 +5017,7 @@
0x8085D2B0:("D_8085D2B0","UNK_TYPE1","",0x1),
0x8085D2B4:("D_8085D2B4","UNK_TYPE1","",0x1),
0x8085D2C0:("sInitChain","ActorInitVar","",0x4),
0x8085D2C4:("D_8085D2C4","UNK_TYPE4","",0x4),
0x8085D2C4:("sPlayerSkeletonBaseTransl","UNK_TYPE4","",0x4),
0x8085D2CC:("D_8085D2CC","UNK_PTR","",0x4),
0x8085D30C:("D_8085D30C","EffectBlureInit2","",0x24),
0x8085D330:("D_8085D330","EffectTireMarkInit","",0x8),
@ -5377,8 +5377,8 @@
0x80862B3C:("D_80862B3C","f32","",0x4),
0x80862B40:("sPlayerFloorEffect","UNK_TYPE1","",0x1),
0x80862B44:("sPlayerControlInput","UNK_TYPE1","",0x1),
0x80862B48:("D_80862B48","UNK_TYPE1","",0x1),
0x80862B4C:("D_80862B4C","UNK_TYPE1","",0x1),
0x80862B48:("sPlayerUseHeldItem","UNK_TYPE1","",0x1),
0x80862B4C:("sPlayerHeldItemButtonIsHeldDown","UNK_TYPE1","",0x1),
0x80862B50:("D_80862B50","UNK_TYPE1","",0x1),
0x80862B6C:("D_80862B6C","UNK_TYPE1","",0x1),
0x808637B0:("En_Test_InitVars","ActorInit","",0x20),

View File

@ -1713,7 +1713,7 @@ asm/non_matchings/code/z_player_lib/Player_IsGoronOrDeku.s,Player_IsGoronOrDeku,
asm/non_matchings/code/z_player_lib/func_801234D4.s,func_801234D4,0x801234D4,0x2F
asm/non_matchings/code/z_player_lib/func_80123590.s,func_80123590,0x80123590,0x13
asm/non_matchings/code/z_player_lib/func_801235DC.s,func_801235DC,0x801235DC,0x1C
asm/non_matchings/code/z_player_lib/func_8012364C.s,func_8012364C,0x8012364C,0x71
asm/non_matchings/code/z_player_lib/Player_GetItemOnButton.s,Player_GetItemOnButton,0x8012364C,0x71
asm/non_matchings/code/z_player_lib/func_80123810.s,func_80123810,0x80123810,0x54
asm/non_matchings/code/z_player_lib/Player_ActionToModelGroup.s,Player_ActionToModelGroup,0x80123960,0x13
asm/non_matchings/code/z_player_lib/Player_SetModelsForHoldingShield.s,Player_SetModelsForHoldingShield,0x801239AC,0x3E

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
1713 asm/non_matchings/code/z_player_lib/func_801234D4.s func_801234D4 0x801234D4 0x2F
1714 asm/non_matchings/code/z_player_lib/func_80123590.s func_80123590 0x80123590 0x13
1715 asm/non_matchings/code/z_player_lib/func_801235DC.s func_801235DC 0x801235DC 0x1C
1716 asm/non_matchings/code/z_player_lib/func_8012364C.s asm/non_matchings/code/z_player_lib/Player_GetItemOnButton.s func_8012364C Player_GetItemOnButton 0x8012364C 0x71
1717 asm/non_matchings/code/z_player_lib/func_80123810.s func_80123810 0x80123810 0x54
1718 asm/non_matchings/code/z_player_lib/Player_ActionToModelGroup.s Player_ActionToModelGroup 0x80123960 0x13
1719 asm/non_matchings/code/z_player_lib/Player_SetModelsForHoldingShield.s Player_SetModelsForHoldingShield 0x801239AC 0x3E