z_player_lib: Dawn of the final PR (#1142)

* Player_GetMask and Player_RemoveMask

* some comments

* Player_ActionToBottle and Player_GetBottleHeld

* Player_DrawGetItemImpl and Player_DrawGetItem

* func_80123420 OK

* Decompile a few more functions

* Decompile a few more functions

* func_80122760

* func_80122868, func_801229A0 and func_801229EC

* func_80122F28

* func_8012301C

* func_801242B4

* func_801242DC

* func_80124420 nonmatching

* func_80126440

* func_801240C8 and func_801240DC

* func_8012405C and func_80124088

* func_80124020

* Player_IsBurningStickInRange

* func_8012754C

* func_80125318 and func_80125CE0

* func_801229FC

* func_80127B64

* func_80127488

* func_80122D44

* func_80122BA4

* func_80122C20 attempt

* func_80122EEC

* func_80122F9C

* func_80122FCC and func_8012300C

* func_80123448

* func_801234D4

* func_801235DC

* func_80123960

* func_80123BD4

* func_80123AA4

* func_801239AC

* func_801241B4

* func_80123C58 and func_80123C90

* func_80123D50 and func_80123DA4

* func_80123DC0, func_80123E90 and func_80123F14

* func_80124110 and func_80124148

* func_80124168 and func_80124190

* func_80124278

* func_80124F18 non_equivalent

* func_80125340 and func_8012536C

* func_801263FC

* func_801265C8

* func_8012669C

* func_80128B74

* func_80123140

* func_801246F4

* func_801253A4 NON_MATCHING

* func_801262C8

* func_80126AB4

* func_80126B8C

* func_80127438

* func_801278F8 NON_MATCHING

* Fix data split

* cleanup externs

* func_80128BD0 compiles...

* Rename Player_SetEquipmentData

* fix merge issues

* Fix types

* Improvement? Worse? I don't know at this point

* func_80128640 attempt

* func_80127BE8

* func_80127A60

* func_80127594 attempt

* func_801271B0

* func_8012364C NON_MATCHING

* func_80124618

* func_80124CC4 non matching

* func_801251C4

* func_80125580 non equivalent

* func_80128388

* cleanup

* remove some hardcoded pointers

* object symbol cleanup

* func_80124870 NON_EQUIVALENT

* name overridlimbdraw arguments

* func_80125D4C NON_EQUIVALENT

* func_80126BD0 NON_MATCHING

* Match func_80126BD0 thanks to anon58

* func_80127DA4 NON_EQUIVALENT

* fix merge issues

* some stealing from OoT

* small rename pass and cleanup

* Improve some

* CLAMP and fix warnings

* func_80125580 matched by mzx

* cleanup func_80128BD0  a bit

* import data

* func_80124CC4

* Rename objectFileTable to gObjectTable

* Improve func_80124FF0 thanks to maide

* fix renames

* Match func_80124FF0 thanks to Maide

* cleanup

* More cleaning up

* import bss

* Add PLAYER_STATE macros

* a bit more of cleanup

* run formatter

* func_80128BD0 a bit more deecent

* Add player limb enum

* Use limb enum

* cleanup and format

* Use symbols for player dlists groups

* A bunch more of pointers

* more object pointers

* Change the remaining object pointers

* Add a few missing dlist in link_child

* Small rename

* whoops

* Work on NON_MATCHINGs

* Cleanup

* Steal OoT renames from "sword" to "meleeWeapon"

* Fix some symbols

* Match func_80127594 and format

* Match func_80127DA4

* Matched func_801284A0

* Annotate D_801F59AC

* Matched func_80128640

* Some cleanup

* format

* stuffs

* some cleanups

* import stuff from pr

* swords and shields

* fixes

* bss

* cleanup Player_OverrideLimbDrawGameplayCommon

* progress on func_80125D4C

* PlayerMeleeWeapon enum

* Player_BButtonSwordFromAP

* GET_B_SWORD_FROM_AP

* GET_MELEE_WEAPON_FROM_AP

* PlayerBottle

* PlayerExplosive and PlayerSword

* misc fixes

* Various changes fromplayer_actor

* z64player.h stuff from player_actor

* Fixes

* skelanime stuff

* placeholders on z64item.h, save macros and ther cleanups

* <= PLAYER_AP_MINUS1

* Player_UpdateBunnyEarsKinematics

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* cleanup

* bodyPartsPos

* comment

* sizeof(u16)

* typo

* merge fixes

* fix

* fixes

* format

* fix merge

* fix merge

* func_80125D4C

Co-authored-by: engineer124 <engineer124engineer124@gmail.com>

* func_80128BD0 improvement

* minor renames

* format

* whoops

* small cleanup

* Update src/code/z_player_lib.c

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* review

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* format

* _B_

* review

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* review

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* format

* remove gap

* whoops

* clanups

* remove stuff from permuter_settings

* steal some OoT docs

* some other docs vscode didn't add to the last commit

* format

* data as infunction-static data

* OoT docs stealing

* Improvements on Player_PostLimbDrawGameplay

* More improvement

* Match Player_PostLimbDrawGameplay

Co-authored-by: engineer124 <engineer124engineer124@gmail.com>

* cleanups

* Convert unk_AF0 into an union and some other cleanups

* bss

* headLimbRot and upperLimbRot

* fix naming

* cleanups

* bss

* bss

* Update src/code/z_player_lib.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* pr review

Co-authored-by: engineer124 <engineer124engineer124@gmail.com>

* bss

* gesture

* namefixer

* gestureInfo

* IA_MIN and BOTTLE_EMPTY

* review

Co-authored-by: engineer124 <engineer124engineer124@gmail.com>

* review

* D_801F59B0_LEN

* Remove LevelOfDetail enum

* bss

* review

* review

* gLinkDekuClosedFlowerDL gLinkDekuOpenFlowerDL

* _B_

* Player_DrawStrayFairyParticles

* fix build

---------

Co-authored-by: kyleburnette <kyle@kyleburnette.com>
Co-authored-by: Kelebek1 <eeeedddccc@hotmail.co.uk>
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal
2023-04-18 23:01:05 -04:00
committed by GitHub
parent f9c638117c
commit 543c38ae06
31 changed files with 2048 additions and 448 deletions
+1 -1
View File
@@ -472,7 +472,7 @@ u16 gSceneIdsPerRegion[REGION_MAX][27] = {
};
s32 Inventory_GetBtnBItem(PlayState* play) {
if (gSaveContext.buttonStatus[0] == BTN_DISABLED) {
if (gSaveContext.buttonStatus[EQUIP_SLOT_B] == BTN_DISABLED) {
return ITEM_NONE;
} else if (gSaveContext.bButtonStatus == BTN_DISABLED) {
return ITEM_NONE;
+1 -1
View File
@@ -2032,7 +2032,7 @@ s32 Actor_OfferGetItem(Actor* actor, PlayState* play, GetItemId getItemId, f32 x
if (!(player->stateFlags1 &
(PLAYER_STATE1_80 | PLAYER_STATE1_1000 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 |
PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000)) &&
Player_GetExplosiveHeld(player) < 0) {
(Player_GetExplosiveHeld(player) <= PLAYER_EXPLOSIVE_NONE)) {
if ((actor->xzDistToPlayer <= xzRange) && (fabsf(actor->playerHeightRel) <= fabsf(yRange))) {
if ((getItemId == GI_MASK_CIRCUS_LEADER || getItemId == GI_PENDANT_OF_MEMORIES ||
getItemId == GI_DEED_LAND ||
+1 -1
View File
@@ -11,7 +11,7 @@ void func_800AE930(CollisionContext* colCtx, EffectTireMark* this, Vec3f* pos, f
u32 spA0;
Vec3s* vtxList = colCtx->colHeader->vtxList;
if ((bgId != 50) || (this->numElements >= (ARRAY_COUNT(this->elements) - 1)) || (colPoly == NULL)) {
if ((bgId != BGCHECK_SCENE) || (this->numElements >= (ARRAY_COUNT(this->elements) - 1)) || (colPoly == NULL)) {
func_800AEF44(this);
return;
}
+1 -1
View File
@@ -1266,7 +1266,7 @@ void Play_DrawMain(PlayState* this) {
goto PostWorldDraw;
}
if (this->unk_18844 == 0) {
if (!this->unk_18844) {
if (1) {
if ((this->skyboxId != SKYBOX_NONE) && !this->envCtx.skyboxDisabled) {
if ((this->skyboxId == SKYBOX_NORMAL_SKY) || (this->skyboxId == SKYBOX_3)) {
+1770 -273
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1226,7 +1226,7 @@ void SkelAnime_InitPlayer(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHea
allocSize = sizeof(Vec3s) * limbCount;
if (flags & 8) {
allocSize += 2;
allocSize += sizeof(u16);
}
if (jointTableBuffer == NULL) {
@@ -48,6 +48,8 @@
* - Effect Update/Draw
* - Seaweed
*/
#include "prevent_bss_reordering.h"
#include "z_boss_03.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
#include "overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h"
+1 -1
View File
@@ -997,7 +997,7 @@ void EnFsn_GiveItem(EnFsn* this, PlayState* play) {
}
this->actor.parent = NULL;
if (ENFSN_IS_SHOP(&this->actor) && !this->isSelling) {
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE_EMPTY);
}
this->actionFunc = EnFsn_SetupResumeInteraction;
} else if (this->isSelling == true) {
@@ -461,7 +461,7 @@ s32 func_80B26F6C(EnKendoJs* this, PlayState* play) {
switch (this->unk_288) {
case 0x271D:
if (Player_GetMeleeWeaponHeld(player) != 0) {
if (Player_GetMeleeWeaponHeld(player) != PLAYER_MELEEWEAPON_NONE) {
Message_StartTextbox(play, 0x272A, &this->actor);
this->unk_288 = 0x272A;
return true;
+1 -1
View File
@@ -743,7 +743,7 @@ void func_80B41E18(EnKgy* this, PlayState* play) {
case 0xC46:
case 0xC55:
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE_EMPTY);
player->exchangeItemId = PLAYER_IA_NONE;
this->unk_29C &= ~0x8;
play->msgCtx.msgLength = 0;
@@ -400,7 +400,7 @@ void EnMinifrog_NextFrogReturned(EnMinifrog* this, PlayState* play) {
this->actionFunc = EnMinifrog_ContinueChoirCutscene;
this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE |
0x2 << MINIFROG_WHITE);
play->setPlayerTalkAnim(play, &gPlayerAnim_link_normal_talk_free_wait, 0);
play->setPlayerTalkAnim(play, &gPlayerAnim_link_normal_talk_free_wait, ANIMMODE_LOOP);
}
}
@@ -431,7 +431,7 @@ void EnMinifrog_SetupNextFrogChoir(EnMinifrog* this, PlayState* play) {
this->flags &= ~0x100;
this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE |
0x2 << MINIFROG_WHITE);
play->setPlayerTalkAnim(play, &gPlayerAnim_link_normal_talk_free_wait, 0);
play->setPlayerTalkAnim(play, &gPlayerAnim_link_normal_talk_free_wait, ANIMMODE_LOOP);
} else if (this->timer <= 0) {
this->actionFunc = EnMinifrog_NextFrogReturned;
this->timer = 30;
@@ -451,7 +451,7 @@ void EnMinifrog_BeginChoirCutscene(EnMinifrog* this, PlayState* play) {
this->timer = 5;
func_801A1F00(3, NA_BGM_FROG_SONG);
this->flags |= 0x100;
play->setPlayerTalkAnim(play, &gPlayerAnim_pn_gakkiplay, 0);
play->setPlayerTalkAnim(play, &gPlayerAnim_pn_gakkiplay, ANIMMODE_LOOP);
} else {
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
}
@@ -347,7 +347,7 @@ void EnStoneheishi_DrinkBottleProcess(EnStoneheishi* this, PlayState* play) {
if ((this->timer < 10) && (this->bottleDisplay != EN_STONE_BOTTLE_EMPTY)) {
this->bottleDisplay = EN_STONE_BOTTLE_EMPTY;
Actor_PlaySfx(&this->actor, NA_SE_VO_NP_DRINK);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE_EMPTY);
}
} else {
this->drinkBottleState++;
+2 -2
View File
@@ -323,9 +323,9 @@ s32 func_80BE0D60(EnTab* this, PlayState* play) {
this->unk_320++;
if (this->unk_320 == 1) {
play->setPlayerTalkAnim(play, &gPlayerAnim_link_demo_bikkuri, 2);
play->setPlayerTalkAnim(play, &gPlayerAnim_link_demo_bikkuri, ANIMMODE_ONCE);
} else if (this->unk_320 > 20) {
play->setPlayerTalkAnim(play, NULL, 0);
play->setPlayerTalkAnim(play, NULL, ANIMMODE_LOOP);
this->unk_320 = 0;
ret = true;
}
@@ -824,7 +824,7 @@ void EnTalkGibud_Talk(EnTalkGibud* this, PlayState* play) {
if (!requestedItem->isBottledItem) {
Inventory_ChangeAmmo(requestedItem->item, -requestedItem->amount);
} else {
Player_UpdateBottleHeld(play, player, ITEM_BOTTLE, PLAYER_IA_BOTTLE);
Player_UpdateBottleHeld(play, player, ITEM_BOTTLE, PLAYER_IA_BOTTLE_EMPTY);
}
player->stateFlags1 |= PLAYER_STATE1_20;
player->stateFlags1 |= PLAYER_STATE1_20000000;
+11 -11
View File
@@ -1123,9 +1123,9 @@ s32 EnTest3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
*dList = NULL;
}
if (limbIndex == OBJECT_TEST3_LIMB_0B) {
rot->x += this->player.unk_AAC.z;
rot->y -= this->player.unk_AAC.y;
rot->z += this->player.unk_AAC.x;
rot->x += this->player.headLimbRot.z;
rot->y -= this->player.headLimbRot.y;
rot->z += this->player.headLimbRot.x;
} else if (limbIndex == OBJECT_TEST3_LIMB_0A) {
s32 requiredScopeTemp;
@@ -1133,12 +1133,12 @@ s32 EnTest3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
Matrix_RotateZS(0x44C, MTXMODE_APPLY);
Matrix_RotateYS(this->player.unk_AA8, MTXMODE_APPLY);
}
if (this->player.unk_AB2.y != 0) {
Matrix_RotateYS(this->player.unk_AB2.y, MTXMODE_APPLY);
if (this->player.upperLimbRot.y != 0) {
Matrix_RotateYS(this->player.upperLimbRot.y, MTXMODE_APPLY);
}
Matrix_RotateXS(this->player.unk_AB2.x, MTXMODE_APPLY);
if (this->player.unk_AB2.z != 0) {
Matrix_RotateZS(this->player.unk_AB2.z, MTXMODE_APPLY);
Matrix_RotateXS(this->player.upperLimbRot.x, MTXMODE_APPLY);
if (this->player.upperLimbRot.z != 0) {
Matrix_RotateZS(this->player.upperLimbRot.z, MTXMODE_APPLY);
}
} else {
func_80125500(play, &this->player, limbIndex, pos, rot);
@@ -1214,7 +1214,7 @@ void EnTest3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList1, Gfx** dL
} else if (limbIndex == OBJECT_TEST3_LIMB_15) {
if (D_80A41D60 || CHECK_WEEKEVENTREG(WEEKEVENTREG_50_80) ||
(INV_CONTENT(ITEM_PENDANT_OF_MEMORIES) == ITEM_PENDANT_OF_MEMORIES) ||
(this->player.getItemDrawId - 1 == GID_PENDANT_OF_MEMORIES)) {
(this->player.getItemDrawIdPlusOne - 1 == GID_PENDANT_OF_MEMORIES)) {
D_80A41D60 = true;
} else {
OPEN_DISPS(play->state.gfxCtx);
@@ -1222,7 +1222,7 @@ void EnTest3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList1, Gfx** dL
CLOSE_DISPS(play->state.gfxCtx);
}
} else {
func_80128B74(play, &this->player, limbIndex);
Player_SetFeetPos(play, &this->player, limbIndex);
}
}
@@ -1295,7 +1295,7 @@ void EnTest3_Draw(Actor* thisx, PlayState* play2) {
if (this->player.invincibilityTimer > 0) {
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
}
if ((this->player.getItemDrawId - 1) != GID_NONE) {
if ((this->player.getItemDrawIdPlusOne - 1) != GID_NONE) {
Player_DrawGetItem(play, &this->player);
}
CLOSE_DISPS(play->state.gfxCtx);
+2 -2
View File
@@ -349,7 +349,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) {
this->textId = 0x884;
Message_StartTextbox(play, this->textId, &this->actor);
SET_WEEKEVENTREG(WEEKEVENTREG_53_08);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE_EMPTY);
break;
case 0x888:
this->textId = 0x889;
@@ -375,7 +375,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) {
void EnTrt_PayForMushroom(EnTrt* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
this->actor.parent = NULL;
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE_EMPTY);
this->actionFunc = EnTrt_SetupItemGiven;
} else {
Actor_OfferGetItem(&this->actor, play, GI_RUPEE_RED, 300.0f, 300.0f);
+1 -1
View File
@@ -913,7 +913,7 @@ s32 func_80A87880(Actor* thisx, PlayState* play) {
Animation_OnFrame(&this->skelAnime, 52.0f)) {
if (Animation_OnFrame(&this->skelAnime, 52.0f)) {
this->unk_34E &= ~0x400;
Player_UpdateBottleHeld(play, player, ITEM_BOTTLE, PLAYER_IA_BOTTLE);
Player_UpdateBottleHeld(play, player, ITEM_BOTTLE, PLAYER_IA_BOTTLE_EMPTY);
}
Actor_PlaySfx(&this->actor, NA_SE_EN_KOUME_DRINK);
} else if (Animation_OnFrame(&this->skelAnime, 90.0f)) {
+6 -6
View File
@@ -620,13 +620,13 @@ void func_80B78EBC(ObjUm* this, PlayState* play) {
player->actor.focus.rot.z = 0;
player->actor.focus.rot.y = player->actor.shape.rot.y;
player->unk_AAC.x = 0;
player->unk_AAC.y = 0;
player->unk_AAC.z = 0;
player->headLimbRot.x = 0;
player->headLimbRot.y = 0;
player->headLimbRot.z = 0;
player->unk_AB2.x = 0;
player->unk_AB2.y = 0;
player->unk_AB2.z = 0;
player->upperLimbRot.x = 0;
player->upperLimbRot.y = 0;
player->upperLimbRot.z = 0;
player->currentYaw = player->actor.focus.rot.y;
}