ovl_player_actor: Dawn of a new PR (#1227)

* Rename Player_UpdateBottleHeld

* Match func_808497A0

* func_80852290 NON_MATCHING

* Match func_8083B3B4

* Params cleanup

* Match func_8083FBC4

* sfxId cleanups and others

* Fix declaration of functions from D_8085D990

* Change D_8085BE84 to be a 2D array

* ARRAY_COUNT_2D

* Match func_8085ADA0

* func_808426F0 nonmatching

* Match func_80852290

* Match func_808426F0

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

* Add notes to Player_SetDoAction

* Name putAwayCountdown

* rebase

* Match func_80856918

* format

* func_8084933C nonmatching
small amount of boomerang documentation

* Progress on moving data near where it is used

* finish moving data

* format

* cleanup up remaining data

* more match

* Some minor cleanups

* PlayerCsMode enum

* func_80851F18 nonmatching

* Fix unk_B10

* Purge ExchangeItemID enum

* Rename `targetActor` to `talkActor`

* Name `targetedActor`

* PLAYER_LIMB_BUF_SIZE

Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com>

* Change SkelAnime Player functions to take a void pointer for the corresponding buffers

* Use PlayerAnimationFrame on Player_DrawImpl

* Match func_8082F1AC

* Match func_8083D23C

* cleanup

* Match and clean up func_808373F8

* Match and document func_8083A98C

* PLAYER_PARAMS macro and PlayerInitMode enum

* Preliminary names for InitMode functions

* Match func_8083C8E8

* remove redundant externs

* Match func_8084933C

* cleanup func_8084933C

* Access D_8085BE84 directly instead of using a macro

* Match func_8084AC84

* Fix boomearng typo

* OK boomerang

* cleanup func_8083D168

* untargetedRotY

* this->unk_14E = ABS_ALT(var_v1);

* GIFIELD macros

* sort of a match

* Match func_8084C16C

Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com>

* Use the same trick to match func_808573A4

* Add note on Deku spinning

* Match func_8084D18C

* Match func_80850D68

* Improve func_80832660

* Match func_80854EFC

Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com>

* Rename unk_B2A to getItemDrawId

* Some cleanup

* fix merge issues

* format

* minor anim docs

* Match func_808553F4

* Cleanup func_808553F4

* func_8083D860 nonmatching

* Match func_8083D860

* Defake func_80859BA8

* ()

* Add notes to PlayerAnimGroup enum

* underwaterTimer

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

* some stateFlags cleaning

* more stateFlags cleaning

* some notes and minor cleanups

* more general cleanups

* Slightly less fake func_80832CAC

* Document some melee weapon damage stuff

* Mark lunge storage

* Note PCS patch

* match

* add notes to bss

* yeet extra indentation

* add reloc as nonmatching to spec

* floorSfxOffset

* Player_GetFloorSfx

* Player_GetFloorSfxByAge

* Comments for AnimSfx dunctions

* Name some AnimSfx functions

* Name AnimSfx stuff

* Some PlayerAgeProperties notes

* use animflag defines

* Player_SpawnExplosive

* fix enum and some other minor fixes

* Bit more misc. cleanup

* Use OoT's version of func_808333CC

* Note on quickspin buffer

* Final nonmatching, func_80851F18

Co-authored-by: Synray <31429825+Synray@users.noreply.github.com>

* RIP player.c

* Name Player_StopHorizontalMovement

* misc fixes

* Actor_DeactivateLens

* fixes

* typos and tweaks

* minor stuff

* add names as comments on the animgoup array

* Correct some function names and data type

* add anim commets to ageproperties

* some notes

* De-fake func_80840F90

* Defake & clean up func_8085ADA0

* Improve func_80859BA8

* Enums in func_80852B28

* Name some secret-related things

* 3 small things

* stuff

* Player_TalkWithPlayer

* SurfaceType_GetFloorType

* SurfaceType_GetWallFlags

* and more bgcheck stuff

* more bss naming

* sPlayerControlInput

* clean up func_80836F10 a bit

* name the parameters of func_80835BF8

* door stuff

* remove NON_MATCHING

* remove D_8085D2B0 padding

* Name some Player_Cutscene_ functions

* various cleanups

* format

* remainingHopsCounter

* some cleanups on the struct

* Actor_RequestRumble

* this->exchangeItemId = PLAYER_AP_NONE;

* fix merge stuff

* format

* PlayerUnkAA5

* Name two cylinder-related functions

* BSS

* Add MagicConsume's enum, treat lensActive as bool

* Update func_808332A0 based on better info

* fix merge

* fix merge issues

* remove redundant comments

* Name Player_AddQuake

* ANIM_FLAG_UPDATE*_*Y

* Format

* AT_TYPE_ENEMY

* fix merge issues

* format

* fix uintptr_ts

* Rename

* Name leftHandMf

* fix merge issues

* format

* exchangeItemId <= PLAYER_IA_MINUS1

* getItemDrawIdPlusOne

* currentActorCsIndex

* <= PLAYER_IA_MINUS1

* fix merge issues

* format

* namefixer and bss

* fix build

* bombs parameters cleanup

* bss

* Fix building

* fix building

* Fix building

* Fix building and cleanups

* Pre-PR cleanup

* really...

* format

* review

* stateFlag Mistakes

* 268 * 0.1f

* z64door.h

* fix cutscene stuff

* bss

* Update include/z64player.h

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

* Update include/z64player.h

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

* reiew

* PR Review

* collision

* review

* format and a few stuff i missed

* EnBomExplosiveType

* weekeventregconvert and eventinfconvert

* more review

* review

* bss

* review

* re format sGetItemTable

* Entangle PlayerMask and PlayerItemAction

* a few extra cases i missed

* bss

* review

* EnArrow stuff

* ARROW_MAGIC_DEKU_BUBBLE

* minor format

* merge

* fix bss

* review

* !ARROW_IS_ARROW

* review

* bool cleanup

* fix merge

* review

* Player_StopCutscene

* Player_RequestQuake

* quakeIndex

* Player_RequestQuakeAndRumble

* knobDoor and slidingDoor

* bss

* fix

* review

* dog and float

---------

Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
Co-authored-by: petrie911 <pmontag@PHYS-S129.iowa.uiowa.edu>
Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com>
Co-authored-by: Synray <31429825+Synray@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal
2023-05-28 17:41:37 -04:00
committed by GitHub
co-authored by Elliptic Ellipsis engineer124 petrie911 petrie911 Synray
parent 20f7e2199a
commit efc9df3f56
87 changed files with 22423 additions and 2223 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ endif
# Check code syntax with host compiler
ifneq ($(RUN_CC_CHECK),0)
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-label
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-label -Wno-sign-compare -Wno-tautological-compare
CC_CHECK := gcc -fno-builtin -fsyntax-only -funsigned-char -fdiagnostics-color -std=gnu89 -D _LANGUAGE_C -D NON_MATCHING $(IINC) -nostdinc $(CHECK_WARNINGS)
ifneq ($(WERROR), 0)
CC_CHECK += -Werror
Executable → Regular
View File
+3 -2
View File
@@ -726,8 +726,9 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params);
void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx);
void Enemy_StartFinishingBlow(PlayState* play, Actor* actor);
s16 func_800BBAC0(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3);
s16 func_800BBB74(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3);
s16 func_800BBAC0(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3);
s16 func_800BBB74(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3);
s16 func_800BBC20(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3);
void Actor_SpawnBodyParts(Actor* actor, PlayState* play, s32 partParams, Gfx** dList);
void Actor_SpawnFloorDustRing(PlayState* play, Actor* actor, Vec3f* posXZ, f32 radius, s32 countMinusOne, f32 randAccelWeight, s16 scale, s16 scaleStep, u8 useLighting);
void func_800BBFB0(PlayState* play, Vec3f* position, f32 arg2, s32 arg3, s16 arg4, s16 scaleStep, u8 arg6);
+2
View File
@@ -17,6 +17,8 @@
#define ARRAY_COUNT(arr) (s32)(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]))
// TODO: After uintptr_t cast change should have an AVOID_UB target that just toggles the KSEG0 bit in the address rather than add/sub 0x80000000
#define PHYSICAL_TO_VIRTUAL(addr) ((uintptr_t)(addr) + RDRAM_CACHED)
#define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr) - RDRAM_CACHED)
+7 -6
View File
@@ -82,11 +82,12 @@
#define Z_PRIORITY_IRQMGR 18
typedef enum {
/* 0 */ EQUIP_SLOT_B,
/* 1 */ EQUIP_SLOT_C_LEFT,
/* 2 */ EQUIP_SLOT_C_DOWN,
/* 3 */ EQUIP_SLOT_C_RIGHT,
/* 4 */ EQUIP_SLOT_A
/* -1 */ EQUIP_SLOT_NONE = -1,
/* 0 */ EQUIP_SLOT_B,
/* 1 */ EQUIP_SLOT_C_LEFT,
/* 2 */ EQUIP_SLOT_C_DOWN,
/* 3 */ EQUIP_SLOT_C_RIGHT,
/* 4 */ EQUIP_SLOT_A
} EquipSlot;
typedef struct {
@@ -517,7 +518,7 @@ typedef struct PlayState {
/* 0x18770 */ void (*unk_18770)(struct PlayState* play, Player* player);
/* 0x18774 */ s32 (*startPlayerFishing)(struct PlayState* play);
/* 0x18778 */ s32 (*grabPlayer)(struct PlayState* play, Player* player);
/* 0x1877C */ s32 (*startPlayerCutscene)(struct PlayState* play, Player* player, s32 mode);
/* 0x1877C */ s32 (*startPlayerCutscene)(struct PlayState* play, Player* player, PlayerCsMode csMode);
/* 0x18780 */ void (*func_18780)(Player* player, struct PlayState* play);
/* 0x18784 */ s32 (*damagePlayer)(struct PlayState* play, s32 damage);
/* 0x18788 */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor);
+5
View File
@@ -739,6 +739,11 @@ typedef struct NpcInteractInfo {
/* 0x24 */ UNK_TYPE1 unk_24[0x4];
} NpcInteractInfo; // size = 0x28
typedef struct BlinkInfo {
/* 0x0 */ s16 eyeTexIndex;
/* 0x2 */ s16 blinkTimer;
} BlinkInfo; // size = 0x4
extern TargetRangeParams gTargetRanges[];
extern s16 D_801AED48[8];
extern Gfx D_801AEF88[];
+6 -1
View File
@@ -14,9 +14,13 @@ struct PlayerAnimationFrame;
#define LIMB_DONE 0xFF
#define ANIM_FLAG_1 (1 << 0)
#define ANIM_FLAG_UPDATEY (1 << 1)
#define ANIM_FLAG_UPDATE_Y (1 << 1)
#define ANIM_FLAG_4 (1 << 2)
#define ANIM_FLAG_8 (1 << 3)
#define ANIM_FLAG_NOMOVE (1 << 4)
#define ANIM_FLAG_80 (1 << 7)
#define ANIM_FLAG_100 (1 << 8)
#define ANIM_FLAG_200 (1 << 9)
typedef enum AnimationMode {
/* 0 */ ANIMMODE_LOOP,
@@ -326,6 +330,7 @@ void AnimationContext_Update(struct PlayState* play, AnimationContext* animation
void SkelAnime_InitPlayer(struct PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, PlayerAnimationHeader* animation, s32 flags, void* jointTableBuffer, void* morphTableBuffer, s32 limbBufCount);
void PlayerAnimation_SetUpdateFunction(SkelAnime* skelAnime);
s32 PlayerAnimation_Update(struct PlayState* play, SkelAnime* skelAnime);
void PlayerAnimation_AnimateFrame(struct PlayState* play, SkelAnime* skelAnime);
void Animation_SetMorph(struct PlayState* play, SkelAnime* skelAnime, f32 morphFrames);
void PlayerAnimation_Change(struct PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames);
void PlayerAnimation_PlayOnce(struct PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation);
+24
View File
@@ -0,0 +1,24 @@
#ifndef Z64_DOOR_H
#define Z64_DOOR_H
#include "ultra64.h"
#include "z64actor.h"
typedef struct KnobDoorActor {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ SkelAnime skelAnime;
/* 0x1A0 */ u8 animIndex;
/* 0x1A1 */ u8 playOpenAnim;
/* 0x1A2 */ s8 requiredObjBankIndex;
/* 0x1A3 */ s8 dlIndex;
} KnobDoorActor; // size = 0x1A4
typedef struct SlidingDoorActor {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ s16 unk_15C;
/* 0x15E */ s16 unk_15E;
} SlidingDoorActor; // size = 0x160
#define DOOR_GET_TRANSITION_ID(thisx) ((u16)(thisx)->params >> 10)
#endif
+4 -4
View File
@@ -118,10 +118,10 @@ typedef struct {
/* 0x188 */ u16 flags;
/* 0x18A */ s16 addAngleChange;
/* 0x18C */ s16 addAngle;
/* 0x18E */ Color_RGBA8 p1StartColor;
/* 0x192 */ Color_RGBA8 p2StartColor;
/* 0x196 */ Color_RGBA8 p1EndColor;
/* 0x19A */ Color_RGBA8 p2EndColor;
/* 0x18E */ u8 p1StartColor[4];
/* 0x192 */ u8 p2StartColor[4];
/* 0x196 */ u8 p1EndColor[4];
/* 0x19A */ u8 p2EndColor[4];
/* 0x19E */ u8 numElements; // "now_edge_num"
/* 0x19F */ u8 elemDuration;
/* 0x1A0 */ u8 unkFlag;
+51 -13
View File
@@ -332,12 +332,16 @@ typedef enum GetItemId {
/* 0x08 */ GI_WALLET_ADULT,
/* 0x09 */ GI_WALLET_GIANT,
/* 0x0A */ GI_RECOVERY_HEART,
/* 0x0C */ GI_HEART_PIECE = 0x0C,
/* 0x0B */ GI_0B,
/* 0x0C */ GI_HEART_PIECE,
/* 0x0D */ GI_HEART_CONTAINER,
/* 0x0E */ GI_MAGIC_SMALL,
/* 0x0F */ GI_MAGIC_LARGE,
/* 0x11 */ GI_STRAY_FAIRY = 0x11,
/* 0x14 */ GI_BOMBS_1 = 0x14,
/* 0x10 */ GI_10,
/* 0x11 */ GI_STRAY_FAIRY,
/* 0x12 */ GI_12,
/* 0x13 */ GI_13,
/* 0x14 */ GI_BOMBS_1,
/* 0x15 */ GI_BOMBS_5,
/* 0x16 */ GI_BOMBS_10,
/* 0x17 */ GI_BOMBS_20,
@@ -360,8 +364,14 @@ typedef enum GetItemId {
/* 0x28 */ GI_NUTS_1,
/* 0x29 */ GI_NUTS_5,
/* 0x2A */ GI_NUTS_10,
/* 0x2E */ GI_BOMBCHUS_20 = 0x2E,
/* 0x32 */ GI_SHIELD_HERO = 0x32,
/* 0x2B */ GI_2B,
/* 0x2C */ GI_2C,
/* 0x2D */ GI_2D,
/* 0x2E */ GI_BOMBCHUS_20,
/* 0x2F */ GI_2F,
/* 0x30 */ GI_30,
/* 0x31 */ GI_31,
/* 0x32 */ GI_SHIELD_HERO,
/* 0x33 */ GI_SHIELD_MIRROR,
/* 0x34 */ GI_POWDER_KEG,
/* 0x35 */ GI_MAGIC_BEANS,
@@ -379,10 +389,24 @@ typedef enum GetItemId {
/* 0x41 */ GI_HOOKSHOT,
/* 0x42 */ GI_LENS,
/* 0x43 */ GI_PICTO_BOX,
/* 0x4C */ GI_OCARINA = 0x4C,
/* 0x50 */ GI_BOMBERS_NOTEBOOK = 0x50,
/* 0x52 */ GI_SKULL_TOKEN = 0x52,
/* 0x55 */ GI_REMAINS_ODOLWA = 0x55,
/* 0x44 */ GI_44,
/* 0x45 */ GI_45,
/* 0x46 */ GI_46,
/* 0x47 */ GI_47,
/* 0x48 */ GI_48,
/* 0x49 */ GI_49,
/* 0x4A */ GI_4A,
/* 0x4B */ GI_4B,
/* 0x4C */ GI_OCARINA,
/* 0x4D */ GI_4D,
/* 0x4E */ GI_4E,
/* 0x4F */ GI_4F,
/* 0x50 */ GI_BOMBERS_NOTEBOOK,
/* 0x51 */ GI_51,
/* 0x52 */ GI_SKULL_TOKEN,
/* 0x53 */ GI_53,
/* 0x54 */ GI_54,
/* 0x55 */ GI_REMAINS_ODOLWA,
/* 0x56 */ GI_REMAINS_GOHT,
/* 0x57 */ GI_REMAINS_GYORG,
/* 0x58 */ GI_REMAINS_TWINMOLD,
@@ -410,9 +434,14 @@ typedef enum GetItemId {
/* 0x6E */ GI_SEAHORSE,
/* 0x6F */ GI_CHATEAU_BOTTLE,
/* 0x70 */ GI_HYLIAN_LOACH,
/* 0x75 */ GI_75 = 0x75,
/* 0x71 */ GI_71,
/* 0x72 */ GI_72,
/* 0x73 */ GI_73,
/* 0x74 */ GI_74,
/* 0x75 */ GI_75,
/* 0x76 */ GI_ICE_TRAP,
/* 0x78 */ GI_MASK_DEKU = 0x78,
/* 0x77 */ GI_77,
/* 0x78 */ GI_MASK_DEKU,
/* 0x79 */ GI_MASK_GORON,
/* 0x7A */ GI_MASK_ZORA,
/* 0x7B */ GI_MASK_FIERCE_DEITY,
@@ -436,7 +465,8 @@ typedef enum GetItemId {
/* 0x8D */ GI_MASK_BLAST,
/* 0x8E */ GI_MASK_SCENTS,
/* 0x8F */ GI_MASK_KAFEIS_MASK,
/* 0x91 */ GI_CHATEAU = 0x91,
/* 0x90 */ GI_90,
/* 0x91 */ GI_CHATEAU,
/* 0x92 */ GI_MILK,
/* 0x93 */ GI_GOLD_DUST_2,
/* 0x94 */ GI_HYLIAN_LOACH_2, // Unused bottled eel
@@ -463,7 +493,15 @@ typedef enum GetItemId {
/* 0xA9 */ GI_BOTTLE_STOLEN, // buy back stolen bottle
/* 0xAA */ GI_LETTER_TO_KAFEI,
/* 0xAB */ GI_PENDANT_OF_MEMORIES,
/* 0xB4 */ GI_TINGLE_MAP_CLOCK_TOWN = 0xB4,
/* 0xAC */ GI_AC,
/* 0xAD */ GI_AD,
/* 0xAE */ GI_AE,
/* 0xAF */ GI_AF,
/* 0xB0 */ GI_B0,
/* 0xB1 */ GI_B1,
/* 0xB2 */ GI_B2,
/* 0xB3 */ GI_B3,
/* 0xB4 */ GI_TINGLE_MAP_CLOCK_TOWN,
/* 0xB5 */ GI_TINGLE_MAP_WOODFALL,
/* 0xB6 */ GI_TINGLE_MAP_SNOWHEAD,
/* 0xB7 */ GI_TINGLE_MAP_ROMANI_RANCH,
+132 -80
View File
@@ -43,35 +43,6 @@ typedef enum PlayerTransformation {
/* 5 */ PLAYER_FORM_MAX
} PlayerTransformation;
typedef enum PlayerMask {
/* 0x00 */ PLAYER_MASK_NONE,
/* 0x01 */ PLAYER_MASK_TRUTH,
/* 0x02 */ PLAYER_MASK_KAFEIS_MASK,
/* 0x03 */ PLAYER_MASK_ALL_NIGHT,
/* 0x04 */ PLAYER_MASK_BUNNY,
/* 0x05 */ PLAYER_MASK_KEATON,
/* 0x06 */ PLAYER_MASK_GARO,
/* 0x07 */ PLAYER_MASK_ROMANI,
/* 0x08 */ PLAYER_MASK_CIRCUS_LEADER,
/* 0x09 */ PLAYER_MASK_POSTMAN,
/* 0x0A */ PLAYER_MASK_COUPLE,
/* 0x0B */ PLAYER_MASK_GREAT_FAIRY,
/* 0x0C */ PLAYER_MASK_GIBDO,
/* 0x0D */ PLAYER_MASK_DON_GERO,
/* 0x0E */ PLAYER_MASK_KAMARO,
/* 0x0F */ PLAYER_MASK_CAPTAIN,
/* 0x10 */ PLAYER_MASK_STONE,
/* 0x11 */ PLAYER_MASK_BREMEN,
/* 0x12 */ PLAYER_MASK_BLAST,
/* 0x13 */ PLAYER_MASK_SCENTS,
/* 0x14 */ PLAYER_MASK_GIANT,
/* 0x15 */ PLAYER_MASK_FIERCE_DEITY,
/* 0x16 */ PLAYER_MASK_GORON,
/* 0x17 */ PLAYER_MASK_ZORA,
/* 0x18 */ PLAYER_MASK_DEKU,
/* 0x19 */ PLAYER_MASK_MAX
} PlayerMask;
typedef enum {
/* 0 */ PLAYER_ENV_HAZARD_NONE,
/* 1 */ PLAYER_ENV_HAZARD_HOTROOM,
@@ -89,7 +60,7 @@ typedef enum PlayerItemAction {
/* 0x03 */ PLAYER_IA_SWORD_KOKIRI = PLAYER_IA_SWORD_MIN,
/* 0x04 */ PLAYER_IA_SWORD_RAZOR,
/* 0x05 */ PLAYER_IA_SWORD_GILDED,
/* 0x06 */ PLAYER_IA_SWORD_GREAT_FAIRY,
/* 0x06 */ PLAYER_IA_SWORD_TWO_HANDED,
/* 0x07 */ PLAYER_IA_STICK,
/* 0x08 */ PLAYER_IA_ZORA_FINS,
/* 0x09 */ PLAYER_IA_BOW,
@@ -143,7 +114,8 @@ typedef enum PlayerItemAction {
/* 0x37 */ PLAYER_IA_37,
/* 0x38 */ PLAYER_IA_38,
/* 0x39 */ PLAYER_IA_39,
/* 0x3A */ PLAYER_IA_MASK_TRUTH,
/* 0x3A */ PLAYER_IA_MASK_MIN,
/* 0x3A */ PLAYER_IA_MASK_TRUTH = PLAYER_IA_MASK_MIN,
/* 0x3B */ PLAYER_IA_MASK_KAFEIS_MASK,
/* 0x3C */ PLAYER_IA_MASK_ALL_NIGHT,
/* 0x3D */ PLAYER_IA_MASK_BUNNY,
@@ -163,10 +135,12 @@ typedef enum PlayerItemAction {
/* 0x4B */ PLAYER_IA_MASK_BLAST,
/* 0x4C */ PLAYER_IA_MASK_SCENTS,
/* 0x4D */ PLAYER_IA_MASK_GIANT,
/* 0x4E */ PLAYER_IA_MASK_FIERCE_DEITY,
/* 0x4E */ PLAYER_IA_MASK_TRANSFORMATION_MIN,
/* 0x4E */ PLAYER_IA_MASK_FIERCE_DEITY = PLAYER_IA_MASK_TRANSFORMATION_MIN,
/* 0x4F */ PLAYER_IA_MASK_GORON,
/* 0x50 */ PLAYER_IA_MASK_ZORA,
/* 0x51 */ PLAYER_IA_MASK_DEKU,
/* 0x51 */ PLAYER_IA_MASK_MAX = PLAYER_IA_MASK_DEKU,
/* 0x52 */ PLAYER_IA_LENS,
/* 0x53 */ PLAYER_IA_MAX
} PlayerItemAction;
@@ -190,12 +164,45 @@ typedef enum PlayerMeleeWeapon {
/* 1 */ PLAYER_MELEEWEAPON_SWORD_KOKIRI = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_SWORD_KOKIRI),
/* 2 */ PLAYER_MELEEWEAPON_SWORD_RAZOR = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_SWORD_RAZOR),
/* 3 */ PLAYER_MELEEWEAPON_SWORD_GILDED = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_SWORD_GILDED),
/* 4 */ PLAYER_MELEEWEAPON_SWORD_GREAT_FAIRY = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_SWORD_GREAT_FAIRY),
/* 4 */ PLAYER_MELEEWEAPON_SWORD_TWO_HANDED = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_SWORD_TWO_HANDED),
/* 5 */ PLAYER_MELEEWEAPON_STICK = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_STICK),
/* 6 */ PLAYER_MELEEWEAPON_ZORA_FINS = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_ZORA_FINS),
/* 7 */ PLAYER_MELEEWEAPON_MAX
} PlayerMeleeWeapon;
// Relies on mask item actions to be contiguous
#define GET_MASK_FROM_IA(itemAction) ((itemAction) - (PLAYER_IA_MASK_MIN - 1))
#define GET_IA_FROM_MASK(mask) ((mask) + (PLAYER_IA_MASK_MIN - 1))
typedef enum PlayerMask {
/* 0x00 */ PLAYER_MASK_NONE,
/* 0x01 */ PLAYER_MASK_TRUTH = GET_MASK_FROM_IA(PLAYER_IA_MASK_TRUTH),
/* 0x02 */ PLAYER_MASK_KAFEIS_MASK = GET_MASK_FROM_IA(PLAYER_IA_MASK_KAFEIS_MASK),
/* 0x03 */ PLAYER_MASK_ALL_NIGHT = GET_MASK_FROM_IA(PLAYER_IA_MASK_ALL_NIGHT),
/* 0x04 */ PLAYER_MASK_BUNNY = GET_MASK_FROM_IA(PLAYER_IA_MASK_BUNNY),
/* 0x05 */ PLAYER_MASK_KEATON = GET_MASK_FROM_IA(PLAYER_IA_MASK_KEATON),
/* 0x06 */ PLAYER_MASK_GARO = GET_MASK_FROM_IA(PLAYER_IA_MASK_GARO),
/* 0x07 */ PLAYER_MASK_ROMANI = GET_MASK_FROM_IA(PLAYER_IA_MASK_ROMANI),
/* 0x08 */ PLAYER_MASK_CIRCUS_LEADER = GET_MASK_FROM_IA(PLAYER_IA_MASK_CIRCUS_LEADER),
/* 0x09 */ PLAYER_MASK_POSTMAN = GET_MASK_FROM_IA(PLAYER_IA_MASK_POSTMAN),
/* 0x0A */ PLAYER_MASK_COUPLE = GET_MASK_FROM_IA(PLAYER_IA_MASK_COUPLE),
/* 0x0B */ PLAYER_MASK_GREAT_FAIRY = GET_MASK_FROM_IA(PLAYER_IA_MASK_GREAT_FAIRY),
/* 0x0C */ PLAYER_MASK_GIBDO = GET_MASK_FROM_IA(PLAYER_IA_MASK_GIBDO),
/* 0x0D */ PLAYER_MASK_DON_GERO = GET_MASK_FROM_IA(PLAYER_IA_MASK_DON_GERO),
/* 0x0E */ PLAYER_MASK_KAMARO = GET_MASK_FROM_IA(PLAYER_IA_MASK_KAMARO),
/* 0x0F */ PLAYER_MASK_CAPTAIN = GET_MASK_FROM_IA(PLAYER_IA_MASK_CAPTAIN),
/* 0x10 */ PLAYER_MASK_STONE = GET_MASK_FROM_IA(PLAYER_IA_MASK_STONE),
/* 0x11 */ PLAYER_MASK_BREMEN = GET_MASK_FROM_IA(PLAYER_IA_MASK_BREMEN),
/* 0x12 */ PLAYER_MASK_BLAST = GET_MASK_FROM_IA(PLAYER_IA_MASK_BLAST),
/* 0x13 */ PLAYER_MASK_SCENTS = GET_MASK_FROM_IA(PLAYER_IA_MASK_SCENTS),
/* 0x14 */ PLAYER_MASK_GIANT = GET_MASK_FROM_IA(PLAYER_IA_MASK_GIANT),
/* 0x15 */ PLAYER_MASK_FIERCE_DEITY = GET_MASK_FROM_IA(PLAYER_IA_MASK_FIERCE_DEITY),
/* 0x16 */ PLAYER_MASK_GORON = GET_MASK_FROM_IA(PLAYER_IA_MASK_GORON),
/* 0x17 */ PLAYER_MASK_ZORA = GET_MASK_FROM_IA(PLAYER_IA_MASK_ZORA),
/* 0x18 */ PLAYER_MASK_DEKU = GET_MASK_FROM_IA(PLAYER_IA_MASK_DEKU),
/* 0x19 */ PLAYER_MASK_MAX
} PlayerMask;
// Relies on bottle-related item actions to be contiguous
#define GET_BOTTLE_FROM_IA(itemAction) ((itemAction) - PLAYER_IA_BOTTLE_MIN)
@@ -244,7 +251,7 @@ typedef enum PlayerSword {
/* 0 */ PLAYER_SWORD_KOKIRI = GET_SWORD_FROM_IA(PLAYER_IA_SWORD_KOKIRI),
/* 1 */ PLAYER_SWORD_RAZOR = GET_SWORD_FROM_IA(PLAYER_IA_SWORD_RAZOR),
/* 2 */ PLAYER_SWORD_GILDED = GET_SWORD_FROM_IA(PLAYER_IA_SWORD_GILDED),
/* 3 */ PLAYER_SWORD_GREAT_FAIRY = GET_SWORD_FROM_IA(PLAYER_IA_SWORD_GREAT_FAIRY),
/* 3 */ PLAYER_SWORD_TWO_HANDED = GET_SWORD_FROM_IA(PLAYER_IA_SWORD_TWO_HANDED),
/* 4 */ PLAYER_SWORD_MAX
} PlayerSword;
@@ -287,6 +294,12 @@ typedef enum PlayerMeleeWeaponAnimation {
/* 34 */ PLAYER_MWA_MAX
} PlayerMeleeWeaponAnimation;
typedef enum PlayerMeleeWeaponState {
/* -1 */ PLAYER_MELEE_WEAPON_STATE_MINUS_1 = -1,
/* 0 */ PLAYER_MELEE_WEAPON_STATE_0,
/* 1 */ PLAYER_MELEE_WEAPON_STATE_1
} PlayerMeleeWeaponState;
typedef enum PlayerDoorType {
/* -1 */ PLAYER_DOORTYPE_TALKING = -1, // Displays a message instead of opening
/* 0 */ PLAYER_DOORTYPE_NONE,
@@ -300,13 +313,61 @@ typedef enum PlayerDoorType {
typedef enum PlayerAnimType {
/* 0 */ PLAYER_ANIMTYPE_DEFAULT, // DEFAULT
/* 1 */ PLAYER_ANIMTYPE_1,
/* 2 */ PLAYER_ANIMTYPE_2,
/* 2 */ PLAYER_ANIMTYPE_2, // Shield but no sword?
/* 3 */ PLAYER_ANIMTYPE_3, // Two hand weapon
/* 4 */ PLAYER_ANIMTYPE_4,
/* 5 */ PLAYER_ANIMTYPE_5,
/* 6 */ PLAYER_ANIMTYPE_MAX
} PlayerAnimType;
typedef enum PlayerAnimGroup {
/* 0 */ PLAYER_ANIMGROUP_0, // STANDING_IDLE
/* 1 */ PLAYER_ANIMGROUP_1, // WALKING
/* 2 */ PLAYER_ANIMGROUP_2, // RUNNING
/* 3 */ PLAYER_ANIMGROUP_3,
/* 4 */ PLAYER_ANIMGROUP_4,
/* 5 */ PLAYER_ANIMGROUP_5, // Z-Targeting ?
/* 6 */ PLAYER_ANIMGROUP_6, // Start or finishing some animation
/* 7 */ PLAYER_ANIMGROUP_7, // DRAW_MELEE_WEAPON
/* 8 */ PLAYER_ANIMGROUP_8, // OPEN_DOOR_LEFT_FIERCE_DEITY
/* 9 */ PLAYER_ANIMGROUP_9, // OPEN_DOOR_LEFT_HUMAN
/* 10 */ PLAYER_ANIMGROUP_10, // OPEN_DOOR_RIGHT_FIERCE_DEITY
/* 11 */ PLAYER_ANIMGROUP_11, // OPEN_DOOR_RIGHT_HUMAN
/* 12 */ PLAYER_ANIMGROUP_12, // GRABBING
/* 13 */ PLAYER_ANIMGROUP_13, // FALLING/LANDING?
/* 14 */ PLAYER_ANIMGROUP_14, // landing from short distances?
/* 15 */ PLAYER_ANIMGROUP_15, // ROLLING
/* 16 */ PLAYER_ANIMGROUP_16, // BONK/BONKING
/* 17 */ PLAYER_ANIMGROUP_17,
/* 18 */ PLAYER_ANIMGROUP_18,
/* 19 */ PLAYER_ANIMGROUP_19, // START_SHIELDING
/* 20 */ PLAYER_ANIMGROUP_20, // SHIELDING
/* 21 */ PLAYER_ANIMGROUP_21, // STOP_SHIELDING/END_SHIELDING
/* 22 */ PLAYER_ANIMGROUP_22, // SLOW_SIDE_WALK?
/* 23 */ PLAYER_ANIMGROUP_23, // SIDE_WALK
/* 24 */ PLAYER_ANIMGROUP_24, // SIDE_WALK_RIGHT
/* 25 */ PLAYER_ANIMGROUP_25,
/* 26 */ PLAYER_ANIMGROUP_26,
/* 27 */ PLAYER_ANIMGROUP_27,
/* 28 */ PLAYER_ANIMGROUP_28, // THROWING
/* 29 */ PLAYER_ANIMGROUP_29, // PUT_DOWN_OBJECT?
/* 30 */ PLAYER_ANIMGROUP_30, // back walking slow?
/* 31 */ PLAYER_ANIMGROUP_31,
/* 32 */ PLAYER_ANIMGROUP_32,
/* 33 */ PLAYER_ANIMGROUP_33,
/* 34 */ PLAYER_ANIMGROUP_34, // PULLING_START
/* 35 */ PLAYER_ANIMGROUP_35, // PULLING
/* 36 */ PLAYER_ANIMGROUP_36, // PULLING_END
/* 37 */ PLAYER_ANIMGROUP_37, // climbing from a ledge?
/* 38 */ PLAYER_ANIMGROUP_38, // ledge
/* 39 */ PLAYER_ANIMGROUP_39, // ledge
/* 40 */ PLAYER_ANIMGROUP_40, // climbing from a ledge
/* 41 */ PLAYER_ANIMGROUP_41,
/* 42 */ PLAYER_ANIMGROUP_42,
/* 43 */ PLAYER_ANIMGROUP_43,
/* 44 */ PLAYER_ANIMGROUP_MAX
} PlayerAnimGroup;
typedef enum PlayerModelType {
// left hand
/* 0 */ PLAYER_MODELTYPE_LH_OPEN,
@@ -464,7 +525,7 @@ typedef struct PlayerAnimationFrame {
#define GET_RIGHT_HAND_INDEX_FROM_JOINT_TABLE(jointTable) (GET_APPEARANCE_FROM_JOINT_TABLE(jointTable) & 0x0F00)
typedef struct PlayerAgeProperties {
/* 0x00 */ f32 unk_00; // ceilingCheckHeight?
/* 0x00 */ f32 unk_00; // ceilingCheckHeight
/* 0x04 */ f32 shadowScale;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
@@ -478,7 +539,7 @@ typedef struct PlayerAgeProperties {
/* 0x2C */ f32 unk_2C; // water stuff // depthInWater
/* 0x30 */ f32 unk_30; // water stuff // depthInWater
/* 0x34 */ f32 unk_34;
/* 0x38 */ f32 unk_38; // wallCheckHeight?
/* 0x38 */ f32 unk_38; // wallCheckHeight
/* 0x3C */ f32 unk_3C;
/* 0x40 */ f32 unk_40;
/* 0x44 */ Vec3s unk_44;
@@ -489,9 +550,9 @@ typedef struct PlayerAgeProperties {
/* 0x94 */ u16 surfaceSfxIdOffset;
/* 0x98 */ f32 unk_98;
/* 0x9C */ f32 unk_9C;
/* 0xA0 */ PlayerAnimationHeader* unk_A0;
/* 0xA4 */ PlayerAnimationHeader* unk_A4;
/* 0xA8 */ PlayerAnimationHeader* unk_A8;
/* 0xA0 */ PlayerAnimationHeader* openChestAnim;
/* 0xA4 */ PlayerAnimationHeader* unk_A4; // OoT leftovers to interact with the Master Sword
/* 0xA8 */ PlayerAnimationHeader* unk_A8; // OoT leftovers to interact with the Master Sword
/* 0xAC */ PlayerAnimationHeader* unk_AC;
/* 0xB0 */ PlayerAnimationHeader* unk_B0;
/* 0xB4 */ PlayerAnimationHeader* unk_B4[4];
@@ -547,7 +608,7 @@ typedef enum PlayerCsMode {
/* 0x0F */ PLAYER_CSMODE_15,
/* 0x10 */ PLAYER_CSMODE_16,
/* 0x11 */ PLAYER_CSMODE_17,
/* 0x12 */ PLAYER_CSMODE_18,
/* 0x12 */ PLAYER_CSMODE_18, // Strangled by Wallmaster
/* 0x13 */ PLAYER_CSMODE_19,
/* 0x14 */ PLAYER_CSMODE_20,
/* 0x15 */ PLAYER_CSMODE_21,
@@ -555,7 +616,7 @@ typedef enum PlayerCsMode {
/* 0x17 */ PLAYER_CSMODE_23,
/* 0x18 */ PLAYER_CSMODE_24,
/* 0x19 */ PLAYER_CSMODE_25,
/* 0x1A */ PLAYER_CSMODE_26,
/* 0x1A */ PLAYER_CSMODE_26, // Halt!
/* 0x1B */ PLAYER_CSMODE_27,
/* 0x1C */ PLAYER_CSMODE_28,
/* 0x1D */ PLAYER_CSMODE_29,
@@ -613,7 +674,7 @@ typedef enum PlayerCsMode {
/* 0x51 */ PLAYER_CSMODE_81,
/* 0x52 */ PLAYER_CSMODE_82,
/* 0x53 */ PLAYER_CSMODE_83,
/* 0x54 */ PLAYER_CSMODE_84,
/* 0x54 */ PLAYER_CSMODE_84, // Sucked by the moon
/* 0x55 */ PLAYER_CSMODE_85,
/* 0x56 */ PLAYER_CSMODE_86,
/* 0x57 */ PLAYER_CSMODE_87,
@@ -867,10 +928,11 @@ typedef enum PlayerCsMode {
#define PLAYER_STATE3_20000000 (1 << 29)
//
#define PLAYER_STATE3_40000000 (1 << 30)
//
// TARGETING_HOSTILE?
#define PLAYER_STATE3_80000000 (1 << 31)
#define PLAYER_GET_BG_CAM_INDEX(thisx) ((thisx)->params & 0xFF)
#define PLAYER_GET_INITMODE(thisx) (((thisx)->params & 0xF00) >> 8)
typedef enum PlayerInitMode {
@@ -894,6 +956,15 @@ typedef enum PlayerInitMode {
#define PLAYER_PARAMS(startBgCamIndex, initMode) ((startBgCamIndex & 0xFF) | ((initMode & 0xF) << 8))
typedef enum PlayerUnkAA5 {
/* 0 */ PLAYER_UNKAA5_0,
/* 1 */ PLAYER_UNKAA5_1,
/* 2 */ PLAYER_UNKAA5_2,
/* 3 */ PLAYER_UNKAA5_3,
/* 4 */ PLAYER_UNKAA5_4,
/* 5 */ PLAYER_UNKAA5_5,
} PlayerUnkAA5;
typedef void (*PlayerActionFunc)(struct Player* this, struct PlayState* play);
typedef s32 (*PlayerFuncAC4)(struct Player* this, struct PlayState* play);
typedef void (*PlayerFuncD58)(struct PlayState* play, struct Player* this);
@@ -917,31 +988,13 @@ typedef struct Player {
/* 0x151 */ u8 rightHandType;
/* 0x152 */ u8 sheathType;
/* 0x153 */ u8 currentMask; // PlayerMask enum
/* 0x154 */ s8 unk_154;
/* 0x154 */ s8 unk_154; // EquipSlot enum // Last pressed equip slot?
/* 0x155 */ u8 prevMask;
/* 0x158 */ Gfx** rightHandDLists;
/* 0x15C */ Gfx** leftHandDLists;
/* 0x160 */ Gfx** sheathDLists;
/* 0x164 */ Gfx** waistDLists;
/* 0x168 */ f32 unk_168;
/* 0x16C */ f32 unk_16C;
/* 0x170 */ f32 unk_170;
/* 0x174 */ f32 unk_174;
/* 0x178 */ f32 unk_178;
/* 0x17C */ f32 unk_17C;
/* 0x180 */ f32 unk_180;
/* 0x184 */ f32 unk_184;
/* 0x188 */ f32 unk_188;
/* 0x18C */ f32 unk_18C;
/* 0x190 */ f32 unk_190;
/* 0x194 */ f32 unk_194;
/* 0x198 */ f32 unk_198;
/* 0x19C */ f32 unk_19C;
/* 0x1A0 */ f32 unk_1A0;
/* 0x1A4 */ f32 unk_1A4;
/* 0x1A8 */ f32 unk_1A8;
/* 0x1AC */ f32 unk_1AC;
/* 0x1B0 */ f32 unk_1B0;
/* 0x168 */ UNK_TYPE1 unk_168[0x4C];
/* 0x1B4 */ s16 unk_1B4;
/* 0x1B6 */ char unk_1B6[2];
/* 0x1B8 */ u8 giObjectLoading;
@@ -960,8 +1013,7 @@ typedef struct Player {
/* 0x2C8 */ SkelAnime unk_2C8;
/* 0x30C */ Vec3s jointTable[5];
/* 0x32A */ Vec3s morphTable[5];
/* 0x348 */ s16 eyeTexId;
/* 0x34A */ s16 eyeAnimTimer;
/* 0x348 */ BlinkInfo blinkInfo;
/* 0x34C */ Actor* heldActor;
/* 0x350 */ PosRot leftHandWorld;
/* 0x364 */ Actor* rightHandActor;
@@ -980,12 +1032,12 @@ typedef struct Player {
/* 0x395 */ u8 prevCsMode; // PlayerCsMode enum
/* 0x396 */ u8 unk_396; // currentActorActionId?
/* 0x397 */ u8 unk_397; // PlayerDoorType enum
/* 0x398 */ Actor* unk_398;
/* 0x398 */ Actor* unk_398; // csActor?
/* 0x39C */ UNK_TYPE1 unk_39C[0x4];
/* 0x3A0 */ Vec3f unk_3A0;
/* 0x3AC */ Vec3f unk_3AC;
/* 0x3B8 */ u16 unk_3B8;
/* 0x3BA */ s16 unk_3BA;
/* 0x3BA */ s16 doorBgCamIndex;
/* 0x3BC */ s16 subCamId;
/* 0x3BE */ char unk_3BE[2];
/* 0x3C0 */ Vec3f unk_3C0;
@@ -1028,7 +1080,7 @@ typedef struct Player {
/* 0xA9C */ f32 secretRumbleCharge; // builds per frame until discharges with a rumble request
/* 0xAA0 */ f32 closestSecretDistSq; // Used to augment `secretRumbleCharge`. Cleared every frame
/* 0xAA4 */ s8 unk_AA4;
/* 0xAA5 */ u8 unk_AA5;
/* 0xAA5 */ u8 unk_AA5; // PlayerUnkAA5 enum
/* 0xAA6 */ u16 unk_AA6; // flags of some kind
/* 0xAA8 */ s16 unk_AA8;
/* 0xAAA */ s16 unk_AAA;
@@ -1049,20 +1101,21 @@ typedef struct Player {
/* 0xADA */ s8 meleeWeaponAnimation;
/* 0xADB */ s8 meleeWeaponState;
/* 0xADC */ s8 unk_ADC;
/* 0xADD */ s8 unk_ADD;
/* 0xADD */ s8 unk_ADD; // Some sort of combo counter
/* 0xADE */ u8 unk_ADE;
/* 0xADF */ s8 unk_ADF[4]; // Circular buffer used for testing for triggering a quickspin
/* 0xAE3 */ s8 unk_AE3[4]; // Circular buffer used for ?
/* 0xAE7 */ s8 unk_AE7; // a timer
/* 0xAE7 */ s8 unk_AE7; // a timer, used as an index for multiple kinds of animations too, room index?, etc
/* 0xAE8 */ s16 unk_AE8; // multipurpose timer
/* 0xAEC */ f32 unk_AEC;
/* 0xAF0 */ union { // TODO: this may be an union of two structs
/* 0xAF0 */ union {
Vec3f unk_AF0[2];
f32 arr_AF0[6];
};
/* 0xB08 */ f32 unk_B08[2]; // TODO: Investigate if this member actually is an array
/* 0xB08 */ f32 unk_B08;
/* 0xB0C */ f32 unk_B0C;
/* 0xB10 */ f32 unk_B10[6];
/* 0xB28 */ s16 unk_B28; //Burning stick timer?
/* 0xB28 */ s16 unk_B28; // Burning stick timer?
/* 0xB2A */ s8 getItemDrawIdPlusOne;
/* 0xB2B */ s8 unk_B2B;
/* 0xB2C */ f32 windSpeed;
@@ -1088,7 +1141,7 @@ typedef struct Player {
/* 0xB64 */ u8 unk_B64;
/* 0xB65 */ u8 shockTimer;
/* 0xB66 */ u8 unk_B66;
/* 0xB67 */ u8 unk_B67; // deku remaining hops counter
/* 0xB67 */ u8 remainingHopsCounter; // Deku hopping on water
/* 0xB68 */ s16 fallStartHeight; // last truncated Y position before falling
/* 0xB6A */ s16 fallDistance; // truncated Y distance the player has fallen so far (positive is down)
/* 0xB6C */ s16 unk_B6C;
@@ -1100,8 +1153,8 @@ typedef struct Player {
/* 0xB76 */ s16 unk_B76;
/* 0xB78 */ f32 unk_B78;
/* 0xB7C */ f32 unk_B7C;
/* 0xB80 */ f32 unk_B80;
/* 0xB84 */ s16 unk_B84;
/* 0xB80 */ f32 pushedSpeed; // Pushing player, examples include water currents, floor conveyors, climbing sloped surfaces
/* 0xB84 */ s16 pushedYaw; // Yaw of direction in which player is being pushed
/* 0xB86 */ s16 unk_B86[2]; // unknown length
/* 0xB8A */ s16 unk_B8A;
/* 0xB8C */ s16 unk_B8C;
@@ -1112,7 +1165,7 @@ typedef struct Player {
/* 0xB96 */ s16 unk_B96;
/* 0xB98 */ WeaponInfo meleeWeaponInfo[3];
/* 0xBEC */ Vec3f bodyPartsPos[PLAYER_BODYPART_MAX];
/* 0xCC4 */ MtxF mf_CC4;
/* 0xCC4 */ MtxF leftHandMf;
/* 0xD04 */ MtxF shieldMf;
/* 0xD44 */ u8 isBurning;
/* 0xD45 */ u8 flameTimers[PLAYER_BODYPART_MAX]; // one flame per body part
@@ -1120,8 +1173,7 @@ typedef struct Player {
/* 0xD58 */ PlayerFuncD58 unk_D58;
/* 0xD5C */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame)
/* 0xD5D */ u8 unk_D5D;
/* 0xD5E */ u8 unk_D5E;
/* 0xD5F */ u8 unk_D5F;
/* 0xD5E */ u8 floorProperty; // FloorProperty enum
/* 0xD60 */ f32 unk_D60;
/* 0xD64 */ s16 unk_D64;
/* 0xD66 */ u16 unk_D66; // sfx
+1 -1
View File
@@ -338,7 +338,7 @@ typedef struct SaveContext {
/* 0x3DB8 */ u16 entranceSound; // "player_wipe_door_SE"
/* 0x3DBA */ u8 unk_3DBA; // "player_wipe_item"
/* 0x3DBB */ u8 unk_3DBB; // "next_walk"
/* 0x3DBC */ s16 dogParams; // "dog_flag"
/* 0x3DBC */ s16 dogParams; // OoT leftover. "dog_flag"
/* 0x3DBE */ u8 envHazardTextTriggerFlags; // "guide_status"
/* 0x3DBF */ u8 showTitleCard; // "name_display"
/* 0x3DC0 */ s16 unk_3DC0; // "shield_magic_timer"
+1 -3
View File
@@ -700,9 +700,7 @@ beginseg
name "ovl_player_actor"
compress
include "build/src/overlays/actors/ovl_player_actor/z_player.o"
include "build/data/ovl_player_actor/ovl_player_actor.data.o"
include "build/data/ovl_player_actor/ovl_player_actor.bss.o"
include "build/data/ovl_player_actor/ovl_player_actor.reloc.o"
include "build/src/overlays/actors/ovl_player_actor/ovl_player_actor_reloc.o"
endseg
beginseg
+1
View File
@@ -1,3 +1,4 @@
#include "prevent_bss_reordering.h"
#include "global.h"
#include "stack.h"
#include "stackcheck.h"
+38 -37
View File
@@ -1374,7 +1374,7 @@ s32 func_800B724C(PlayState* play, Actor* actor, u8 csMode) {
player->csMode = csMode;
player->unk_398 = actor;
player->unk_3BA = 0;
player->doorBgCamIndex = 0;
return true;
}
@@ -1382,7 +1382,7 @@ s32 func_800B7298(PlayState* play, Actor* actor, u8 csMode) {
Player* player = GET_PLAYER(play);
if (func_800B724C(play, actor, csMode)) {
player->unk_3BA = 1;
player->doorBgCamIndex = 1;
return true;
}
return false;
@@ -3490,49 +3490,50 @@ void Enemy_StartFinishingBlow(PlayState* play, Actor* actor) {
}
// blinking routine
s16 func_800BBAC0(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) {
if (DECR(arg0[1]) == 0) {
arg0[1] = Rand_S16Offset(arg1, arg2);
s16 func_800BBAC0(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3) {
if (DECR(info->blinkTimer) == 0) {
info->blinkTimer = Rand_S16Offset(arg1, arg2);
}
if (arg0[1] - arg3 > 0) {
arg0[0] = 0;
} else if ((arg0[1] - arg3 >= -1) || (arg0[1] < 2)) {
arg0[0] = 1;
if (info->blinkTimer - arg3 > 0) {
info->eyeTexIndex = 0;
} else if ((info->blinkTimer - arg3 >= -1) || (info->blinkTimer < 2)) {
info->eyeTexIndex = 1;
} else {
arg0[0] = 2;
info->eyeTexIndex = 2;
}
return arg0[0];
return info->eyeTexIndex;
}
// blinking routine
s16 func_800BBB74(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) {
if (DECR(arg0[1]) == 0) {
arg0[1] = Rand_S16Offset(arg1, arg2);
s16 func_800BBB74(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3) {
if (DECR(info->blinkTimer) == 0) {
info->blinkTimer = Rand_S16Offset(arg1, arg2);
}
if (arg0[1] - arg3 > 0) {
arg0[0] = 0;
} else if (arg0[1] - arg3 == 0) {
arg0[0] = 1;
if (info->blinkTimer - arg3 > 0) {
info->eyeTexIndex = 0;
} else if (info->blinkTimer - arg3 == 0) {
info->eyeTexIndex = 1;
} else {
arg0[0] = 2;
info->eyeTexIndex = 2;
}
return arg0[0];
return info->eyeTexIndex;
}
// unused blinking routine
s16 func_800BBC20(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) {
if (DECR(arg0[1]) == 0) {
arg0[1] = Rand_S16Offset(arg1, arg2);
arg0[0]++;
if ((arg0[0] % 3) == 0) {
arg0[0] = (s32)(Rand_ZeroOne() * arg3) * 3;
s16 func_800BBC20(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3) {
if (DECR(info->blinkTimer) == 0) {
info->blinkTimer = Rand_S16Offset(arg1, arg2);
info->eyeTexIndex++;
if ((info->eyeTexIndex % 3) == 0) {
info->eyeTexIndex = (s32)(Rand_ZeroOne() * arg3) * 3;
}
}
return arg0[0];
return info->eyeTexIndex;
}
void Actor_SpawnBodyParts(Actor* actor, PlayState* play, s32 partParams, Gfx** dList) {
@@ -3614,15 +3615,15 @@ void func_800BC154(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 act
// Damage flags for EnArrow
u32 sArrowDmgFlags[] = {
DMG_FIRE_ARROW, // ENARROW_0
DMG_NORMAL_ARROW, // ENARROW_1
DMG_NORMAL_ARROW, // ENARROW_2
DMG_FIRE_ARROW, // ENARROW_3
DMG_ICE_ARROW, // ENARROW_4
DMG_LIGHT_ARROW, // ENARROW_5
DMG_DEKU_NUT, // ENARROW_6
DMG_DEKU_BUBBLE, // ENARROW_7
DMG_DEKU_NUT, // ENARROW_8
DMG_FIRE_ARROW, // ARROW_TYPE_NORMAL_LIT
DMG_NORMAL_ARROW, // ARROW_TYPE_NORMAL_HORSE
DMG_NORMAL_ARROW, // ARROW_TYPE_NORMAL
DMG_FIRE_ARROW, // ARROW_TYPE_FIRE
DMG_ICE_ARROW, // ARROW_TYPE_ICE
DMG_LIGHT_ARROW, // ARROW_TYPE_LIGHT
DMG_DEKU_NUT, // ARROW_TYPE_SLINGSHOT
DMG_DEKU_BUBBLE, // ARROW_TYPE_DEKU_BUBBLE
DMG_DEKU_NUT, // ARROW_TYPE_DEKU_NUT
};
u32 Actor_GetArrowDmgFlags(s32 params) {
@@ -4476,7 +4477,7 @@ s32 func_800BE184(PlayState* play, Actor* actor, f32 xzDist, s16 arg3, s16 arg4,
s16 phi_v0 = BINANG_SUB(BINANG_ROT180(actor->yawTowardsPlayer), player->actor.shape.rot.y);
s16 temp_t0 = actor->yawTowardsPlayer - arg5;
if ((actor->xzDistToPlayer <= xzDist) && (player->meleeWeaponState != 0)) {
if ((actor->xzDistToPlayer <= xzDist) && (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0)) {
if ((arg4 >= ABS_ALT(phi_v0)) && (arg3 >= ABS_ALT(temp_t0))) {
return true;
}
+5 -5
View File
@@ -465,13 +465,13 @@ s32 func_800CBA7C(Camera* camera) {
}
}
s32 func_800CBAAC(Camera* camera) {
PlayerMeleeWeaponState func_800CBAAC(Camera* camera) {
Actor* focalActor = camera->focalActor;
if (camera->focalActor == &GET_PLAYER(camera->play)->actor) {
return ((Player*)focalActor)->meleeWeaponState;
} else {
return 0;
return PLAYER_MELEE_WEAPON_STATE_0;
}
}
@@ -506,13 +506,13 @@ s32 func_800CBB88(Camera* camera) {
Actor* focalActor = camera->focalActor;
if (camera->focalActor == &GET_PLAYER(camera->play)->actor) {
if ((((Player*)focalActor)->meleeWeaponState != 0) &&
if ((((Player*)focalActor)->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
(((Player*)focalActor)->meleeWeaponAnimation == PLAYER_MWA_GORON_PUNCH_BUTT)) {
return 3;
}
if ((((Player*)focalActor)->stateFlags2 & PLAYER_STATE2_20000) ||
((((Player*)focalActor)->meleeWeaponState != 0) &&
((((Player*)focalActor)->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
(((Player*)focalActor)->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_KICK))) {
return 1;
}
@@ -3958,7 +3958,7 @@ s32 Camera_Battle1(Camera* camera) {
}
camera->roll = Camera_ScaledStepToCeilS(sp88, camera->roll, 0.06f, 5);
if (func_800CBAAC(camera) != 0) {
if (func_800CBAAC(camera) != PLAYER_MELEE_WEAPON_STATE_0) {
phi_f12 = ((camera->play->state.frames & 8) != 0) ? roData->unk_20 - (roData->unk_20 * 0.5f) : roData->unk_20;
} else {
phi_f12 = ((gSaveContext.save.saveInfo.playerData.health <= 16) ? 0.8f : 1.0f) * (sp78 - (sp78 * 0.05f * spEC));
+36 -48
View File
@@ -114,23 +114,17 @@ void EffectBlure_Init1(void* thisx, void* initParamsx) {
EffectBlureInit1* initParams = (EffectBlureInit1*)initParamsx;
if ((this != NULL) && (initParams != NULL)) {
s32 i;
EffectBlure_InitElements(this);
this->p1StartColor.r = initParams->p1StartColor[0];
this->p2StartColor.r = initParams->p2StartColor[0];
this->p1EndColor.r = initParams->p1EndColor[0];
this->p2EndColor.r = initParams->p2EndColor[0];
this->p1StartColor.g = initParams->p1StartColor[1];
this->p2StartColor.g = initParams->p2StartColor[1];
this->p1EndColor.g = initParams->p1EndColor[1];
this->p2EndColor.g = initParams->p2EndColor[1];
this->p1StartColor.b = initParams->p1StartColor[2];
this->p2StartColor.b = initParams->p2StartColor[2];
this->p1EndColor.b = initParams->p1EndColor[2];
this->p2EndColor.b = initParams->p2EndColor[2];
this->p1StartColor.a = initParams->p1StartColor[3];
this->p2StartColor.a = initParams->p2StartColor[3];
this->p1EndColor.a = initParams->p1EndColor[3];
this->p2EndColor.a = initParams->p2EndColor[3];
for (i = 0; i < 4; i++) {
this->p1StartColor[i] = initParams->p1StartColor[i];
this->p2StartColor[i] = initParams->p2StartColor[i];
this->p1EndColor[i] = initParams->p1EndColor[i];
this->p2EndColor[i] = initParams->p2EndColor[i];
}
this->elemDuration = initParams->elemDuration;
this->unkFlag = initParams->unkFlag;
this->calcMode = initParams->calcMode;
@@ -155,23 +149,17 @@ void EffectBlure_Init2(void* thisx, void* initParamsx) {
EffectBlureInit2* initParams = (EffectBlureInit2*)initParamsx;
if ((this != NULL) && (initParams != NULL)) {
s32 i;
EffectBlure_InitElements(this);
this->p1StartColor.r = initParams->p1StartColor[0];
this->p2StartColor.r = initParams->p2StartColor[0];
this->p1EndColor.r = initParams->p1EndColor[0];
this->p2EndColor.r = initParams->p2EndColor[0];
this->p1StartColor.g = initParams->p1StartColor[1];
this->p2StartColor.g = initParams->p2StartColor[1];
this->p1EndColor.g = initParams->p1EndColor[1];
this->p2EndColor.g = initParams->p2EndColor[1];
this->p1StartColor.b = initParams->p1StartColor[2];
this->p2StartColor.b = initParams->p2StartColor[2];
this->p1EndColor.b = initParams->p1EndColor[2];
this->p2EndColor.b = initParams->p2EndColor[2];
this->p1StartColor.a = initParams->p1StartColor[3];
this->p2StartColor.a = initParams->p2StartColor[3];
this->p1EndColor.a = initParams->p1EndColor[3];
this->p2EndColor.a = initParams->p2EndColor[3];
for (i = 0; i < 4; i++) {
this->p1StartColor[i] = initParams->p1StartColor[i];
this->p2StartColor[i] = initParams->p2StartColor[i];
this->p1EndColor[i] = initParams->p1EndColor[i];
this->p2EndColor[i] = initParams->p2EndColor[i];
}
this->elemDuration = initParams->elemDuration;
this->unkFlag = initParams->unkFlag;
this->calcMode = initParams->calcMode;
@@ -372,14 +360,14 @@ void EffectBlure_GetComputedValues(EffectBlure* this, s32 index, f32 ratio, Vec3
color1->r = color1->g = color1->b = color1->a = 255;
color2->r = color2->g = color2->b = color2->a = 255;
} else {
color1->r = func_800B0A24(this->p1StartColor.r, this->p1EndColor.r, ratio);
color1->g = func_800B0A24(this->p1StartColor.g, this->p1EndColor.g, ratio);
color1->b = func_800B0A24(this->p1StartColor.b, this->p1EndColor.b, ratio);
color1->a = func_800B0A24(this->p1StartColor.a, this->p1EndColor.a, ratio);
color2->r = func_800B0A24(this->p2StartColor.r, this->p2EndColor.r, ratio);
color2->g = func_800B0A24(this->p2StartColor.g, this->p2EndColor.g, ratio);
color2->b = func_800B0A24(this->p2StartColor.b, this->p2EndColor.b, ratio);
color2->a = func_800B0A24(this->p2StartColor.a, this->p2EndColor.a, ratio);
color1->r = func_800B0A24(this->p1StartColor[0], this->p1EndColor[0], ratio);
color1->g = func_800B0A24(this->p1StartColor[1], this->p1EndColor[1], ratio);
color1->b = func_800B0A24(this->p1StartColor[2], this->p1EndColor[2], ratio);
color1->a = func_800B0A24(this->p1StartColor[3], this->p1EndColor[3], ratio);
color2->r = func_800B0A24(this->p2StartColor[0], this->p2EndColor[0], ratio);
color2->g = func_800B0A24(this->p2StartColor[1], this->p2EndColor[1], ratio);
color2->b = func_800B0A24(this->p2StartColor[2], this->p2EndColor[2], ratio);
color2->a = func_800B0A24(this->p2StartColor[3], this->p2EndColor[3], ratio);
}
}
@@ -992,19 +980,19 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
vtx[j].v.flag = 0;
vtx[j].v.tc[0] = 0;
vtx[j].v.tc[1] = 0;
vtx[j].v.cn[0] = func_800B0A24(this->p1StartColor.r, this->p1EndColor.r, ratio);
vtx[j].v.cn[1] = func_800B0A24(this->p1StartColor.g, this->p1EndColor.g, ratio);
vtx[j].v.cn[2] = func_800B0A24(this->p1StartColor.b, this->p1EndColor.b, ratio);
vtx[j].v.cn[3] = func_800B0A24(this->p1StartColor.a, this->p1EndColor.a, ratio);
vtx[j].v.cn[0] = func_800B0A24(this->p1StartColor[0], this->p1EndColor[0], ratio);
vtx[j].v.cn[1] = func_800B0A24(this->p1StartColor[1], this->p1EndColor[1], ratio);
vtx[j].v.cn[2] = func_800B0A24(this->p1StartColor[2], this->p1EndColor[2], ratio);
vtx[j].v.cn[3] = func_800B0A24(this->p1StartColor[3], this->p1EndColor[3], ratio);
j++;
vtx[j].v.flag = 0;
vtx[j].v.tc[0] = 0;
vtx[j].v.tc[1] = 0;
vtx[j].v.cn[0] = func_800B0A24(this->p2StartColor.r, this->p2EndColor.r, ratio);
vtx[j].v.cn[1] = func_800B0A24(this->p2StartColor.g, this->p2EndColor.g, ratio);
vtx[j].v.cn[2] = func_800B0A24(this->p2StartColor.b, this->p2EndColor.b, ratio);
vtx[j].v.cn[3] = func_800B0A24(this->p2StartColor.a, this->p2EndColor.a, ratio);
vtx[j].v.cn[0] = func_800B0A24(this->p2StartColor[0], this->p2EndColor[0], ratio);
vtx[j].v.cn[1] = func_800B0A24(this->p2StartColor[1], this->p2EndColor[1], ratio);
vtx[j].v.cn[2] = func_800B0A24(this->p2StartColor[2], this->p2EndColor[2], ratio);
vtx[j].v.cn[3] = func_800B0A24(this->p2StartColor[3], this->p2EndColor[3], ratio);
j++;
}
}
+8 -8
View File
@@ -69,13 +69,13 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) {
do {
doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
door = (EnDoor*)doorIter;
dist = Actor_WorldDistXYZToActor(actor, &door->dyna.actor);
dist = Actor_WorldDistXYZToActor(actor, &door->knobDoor.dyna.actor);
if (!isSetup || (dist < minDist)) {
nearestDoor = door;
minDist = dist;
isSetup = true;
}
doorIter = door->dyna.actor.next;
doorIter = door->knobDoor.dyna.actor.next;
} while (doorIter != NULL);
if (1) {}
@@ -134,16 +134,16 @@ void func_800F0BB4(EnHy* enHy, PlayState* play, EnDoor* door, s16 arg3, s16 arg4
Vec3f offset;
f32 phi_f0;
Actor_OffsetOfPointInActorCoords(&door->dyna.actor, &offset, &enHy->actor.world.pos);
Actor_OffsetOfPointInActorCoords(&door->knobDoor.dyna.actor, &offset, &enHy->actor.world.pos);
phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f;
animIndex = ((s8)phi_f0 < 0) ? 0 : 2;
EnHy_ChangeObjectAndAnim(enHy, play, (animIndex == 0) ? arg3 : arg4);
enHy->skelAnime.baseTransl = *enHy->skelAnime.jointTable;
enHy->skelAnime.prevTransl = *enHy->skelAnime.jointTable;
enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATEY | ANIM_FLAG_1);
enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATE_Y | ANIM_FLAG_1);
AnimationContext_SetMoveActor(play, &enHy->actor, &enHy->skelAnime, 1.0f);
door->unk_1A1 = 1;
door->animIndex = animIndex;
door->knobDoor.playOpenAnim = true;
door->knobDoor.animIndex = animIndex;
}
s32 func_800F0CE4(EnHy* enHy, PlayState* play, ActorFunc draw, s16 arg3, s16 arg4, f32 arg5) {
@@ -157,7 +157,7 @@ s32 func_800F0CE4(EnHy* enHy, PlayState* play, ActorFunc draw, s16 arg3, s16 arg
if (door != NULL) {
ret = true;
func_800F0BB4(enHy, play, door, arg3, arg4);
yaw = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->dyna.actor.world.pos);
yaw = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->knobDoor.dyna.actor.world.pos);
enHy->actor.world.pos.x += arg5 * Math_SinS(yaw);
enHy->actor.world.pos.z += arg5 * Math_CosS(yaw);
enHy->actor.world.rot.y = -yaw;
@@ -179,7 +179,7 @@ s32 func_800F0DD4(EnHy* enHy, PlayState* play, s16 arg2, s16 arg3) {
if (door != NULL) {
ret = true;
func_800F0BB4(enHy, play, door, arg2, arg3);
enHy->actor.shape.rot.y = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->dyna.actor.world.pos);
enHy->actor.shape.rot.y = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->knobDoor.dyna.actor.world.pos);
enHy->actor.world.rot.y = enHy->actor.shape.rot.y;
enHy->actor.gravity = 0.0f;
enHy->actor.flags &= ~ACTOR_FLAG_1;
+2 -2
View File
@@ -2327,8 +2327,8 @@ void Play_Init(GameState* thisx) {
Camera_InitFocalActorSettings(&this->mainCamera, &player->actor);
gDbgCamEnabled = false;
if ((player->actor.params & 0xFF) != 0xFF) {
Camera_ChangeActorCsCamIndex(&this->mainCamera, player->actor.params & 0xFF);
if (PLAYER_GET_BG_CAM_INDEX(&player->actor) != 0xFF) {
Camera_ChangeActorCsCamIndex(&this->mainCamera, PLAYER_GET_BG_CAM_INDEX(&player->actor));
}
CutsceneManager_StoreCamera(&this->mainCamera);
+31 -27
View File
@@ -472,7 +472,7 @@ void func_80123140(PlayState* play, Player* player) {
REG(39) = bootRegs[8];
REG(43) = bootRegs[9];
R_RUN_SPEED_LIMIT = bootRegs[10];
REG(68) = bootRegs[11];
REG(68) = bootRegs[11]; // gravity
REG(69) = bootRegs[12];
IREG(66) = bootRegs[13];
IREG(67) = bootRegs[14];
@@ -503,7 +503,7 @@ s32 Player_InBlockingCsMode(PlayState* play, Player* player) {
s32 Player_InCsMode(PlayState* play) {
Player* player = GET_PLAYER(play);
return Player_InBlockingCsMode(play, player) || player->unk_AA5 == 5;
return Player_InBlockingCsMode(play, player) || (player->unk_AA5 == PLAYER_UNKAA5_5);
}
s32 func_80123420(Player* player) {
@@ -556,8 +556,8 @@ s32 func_801235DC(PlayState* play, f32 arg1, s16 arg2) {
Player* player = GET_PLAYER(play);
if (player->stateFlags3 & PLAYER_STATE3_1000) {
player->unk_B08[0] = arg1;
player->unk_B08[1] += arg1 * 0.05f;
player->unk_B08 = arg1;
player->unk_B0C += arg1 * 0.05f;
player->currentYaw = arg2;
player->actor.home.rot.y = arg2;
player->actor.shape.rot.y = arg2;
@@ -659,7 +659,7 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = {
PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_KOKIRI
PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_RAZOR
PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_GILDED
PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_IA_SWORD_GREAT_FAIRY
PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_IA_SWORD_TWO_HANDED
PLAYER_MODELGROUP_STICK, // PLAYER_IA_STICK
PLAYER_MODELGROUP_ZORA_FINS, // PLAYER_IA_ZORA_FINS
PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW
@@ -1316,6 +1316,7 @@ void Player_UpdateBottleHeld(PlayState* play, Player* player, ItemId itemId, Pla
player->itemAction = itemAction;
}
// Player_Untarget / Player_StopTargeting?
void func_80123DA4(Player* player) {
player->targetedActor = NULL;
player->stateFlags2 &= ~PLAYER_STATE2_2000;
@@ -1445,7 +1446,7 @@ PlayerMeleeWeapon Player_GetMeleeWeaponHeld(Player* player) {
s32 Player_IsHoldingTwoHandedWeapon(Player* player) {
// Relies on the itemActions for two-handed weapons being contiguous.
if ((player->heldItemAction >= PLAYER_IA_SWORD_GREAT_FAIRY) && (player->heldItemAction <= PLAYER_IA_STICK)) {
if ((player->heldItemAction >= PLAYER_IA_SWORD_TWO_HANDED) && (player->heldItemAction <= PLAYER_IA_STICK)) {
return true;
}
@@ -2038,7 +2039,7 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
pos->x *= player->ageProperties->unk_08;
pos->z *= player->ageProperties->unk_08;
}
if (!(player->skelAnime.moveFlags & ANIM_FLAG_4) || (player->skelAnime.moveFlags & ANIM_FLAG_UPDATEY)) {
if (!(player->skelAnime.moveFlags & ANIM_FLAG_4) || (player->skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y)) {
pos->y *= player->ageProperties->unk_08;
}
}
@@ -2552,14 +2553,16 @@ void func_8012669C(PlayState* play, Player* player, Vec3f* arg2, Vec3f* arg3) {
Matrix_MultVec3f(arg2, &sp3C);
Matrix_MultVec3f(arg3, &sp30);
if (player->meleeWeaponState != 0) {
if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
if (func_80126440(play, NULL, &player->meleeWeaponInfo[0], &sp3C, &sp30) &&
(player->transformation != PLAYER_FORM_GORON) && (!(player->stateFlags1 & PLAYER_STATE1_400000))) {
EffectBlure_AddVertex(Effect_GetByIndex(player->meleeWeaponEffectIndex[0]), &player->meleeWeaponInfo[0].tip,
&player->meleeWeaponInfo[0].base);
}
if ((player->meleeWeaponState > 0) && ((player->meleeWeaponAnimation < PLAYER_MWA_SPIN_ATTACK_1H) ||
(player->stateFlags2 & PLAYER_STATE2_20000))) {
if ((player->meleeWeaponState >= PLAYER_MELEE_WEAPON_STATE_1) &&
((player->meleeWeaponAnimation < PLAYER_MWA_SPIN_ATTACK_1H) ||
(player->stateFlags2 & PLAYER_STATE2_20000))) {
Matrix_MultVec3f(&arg2[1], &sp3C);
Matrix_MultVec3f(&arg3[1], &sp30);
func_80126440(play, &player->meleeWeaponQuads[0], &player->meleeWeaponInfo[1], &sp3C, &sp30);
@@ -2714,7 +2717,7 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) {
gSPDisplayList(POLY_OPA_DISP++, D_801C0AB4[arg2]);
if (player->meleeWeaponState != 0) {
if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
if ((((player->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_LEFT)) && (arg2 == 0)) ||
((player->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_COMBO) && (arg2 != 0))) {
func_8012669C(play, player, D_801C0A00, D_801C09DC);
@@ -3296,7 +3299,7 @@ s32 func_80128640(PlayState* play, Player* player, Gfx* dlist) {
Matrix_Push();
Matrix_Translate(-428.26f, 267.2f, -33.82f, MTXMODE_APPLY);
Matrix_RotateZYX(-0x8000, 0, 0x4000, MTXMODE_APPLY);
Matrix_Scale(1.0f, player->unk_B08[1], 1.0f, MTXMODE_APPLY);
Matrix_Scale(1.0f, player->unk_B0C, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gDekuStickDL);
@@ -3413,7 +3416,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
3000.0f, // PLAYER_MELEEWEAPON_SWORD_KOKIRI
3000.0f, // PLAYER_MELEEWEAPON_SWORD_RAZOR
4000.0f, // PLAYER_MELEEWEAPON_SWORD_GILDED
5500.0f, // PLAYER_MELEEWEAPON_SWORD_GREAT_FAIRY
5500.0f, // PLAYER_MELEEWEAPON_SWORD_TWO_HANDED
-1.0f, // PLAYER_MELEEWEAPON_STICK
2500.0f, // PLAYER_MELEEWEAPON_ZORA_FINS
};
@@ -3421,19 +3424,19 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
if ((player->transformation == PLAYER_FORM_FIERCE_DEITY) ||
((player->transformation != PLAYER_FORM_ZORA) &&
((player->itemAction == PLAYER_IA_STICK) ||
((player->meleeWeaponState != 0) &&
((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) &&
(player->meleeWeaponAnimation != PLAYER_MWA_GORON_PUNCH_RIGHT) &&
(player->meleeWeaponAnimation != PLAYER_MWA_GORON_PUNCH_BUTT))))) {
if (player->itemAction == PLAYER_IA_STICK) {
D_801C0994->x = player->unk_B08[1] * 5000.0f;
D_801C0994->x = player->unk_B0C * 5000.0f;
} else {
D_801C0994->x = sMeleeWeaponLengths[Player_GetMeleeWeaponHeld(player)];
}
func_80126B8C(play, player);
}
Matrix_Get(&player->mf_CC4);
Matrix_MtxFToYXZRot(&player->mf_CC4, &player->leftHandWorld.rot, false);
Matrix_Get(&player->leftHandMf);
Matrix_MtxFToYXZRot(&player->leftHandMf, &player->leftHandWorld.rot, false);
}
}
} else if (limbIndex == PLAYER_LIMB_RIGHT_HAND) {
@@ -3458,18 +3461,18 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
Matrix_MultZero(&sp20C);
temp_fv0 = Math_Vec3f_DistXYZ(sPlayerCurBodyPartPos, &sp20C);
player->unk_B08[0] = temp_fv0 - 3.0f;
player->unk_B08 = temp_fv0 - 3.0f;
if (temp_fv0 < 3.0f) {
player->unk_B08[0] = 0.0f;
player->unk_B08 = 0.0f;
} else {
player->unk_B08[0] *= 1.6f;
if (player->unk_B08[0] > 1.0f) {
player->unk_B08[0] = 1.0f;
player->unk_B08 *= 1.6f;
if (player->unk_B08 > 1.0f) {
player->unk_B08 = 1.0f;
}
}
player->unk_B08[1] = -0.5f;
player->unk_B0C = -0.5f;
}
Matrix_Scale(1.0f, player->unk_B08[0], 1.0f, MTXMODE_APPLY);
Matrix_Scale(1.0f, player->unk_B08, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -3518,7 +3521,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
Player_DrawHookshotReticle(play, player, 77600.0f);
}
}
} else if (player->meleeWeaponState != 0) {
} else if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
if (player->meleeWeaponAnimation == PLAYER_MWA_GORON_PUNCH_RIGHT) {
func_80126B8C(play, player);
}
@@ -3590,6 +3593,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
for (i = 0; i < ARRAY_COUNT(sp178); i++) {
Matrix_Push();
Matrix_Scale(sp178[i].x, sp178[i].y, sp178[i].z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -3811,7 +3815,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
&player->meleeWeaponInfo[0].base);
}
} else if (limbIndex == PLAYER_LIMB_RIGHT_SHIN) {
if (player->meleeWeaponState != 0) {
if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
if ((player->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_KICK) ||
(player->meleeWeaponAnimation == PLAYER_MWA_ZORA_JUMPKICK_START) ||
(player->meleeWeaponAnimation == PLAYER_MWA_ZORA_JUMPKICK_FINISH)) {
@@ -3819,7 +3823,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
}
}
} else if (limbIndex == PLAYER_LIMB_WAIST) {
if (player->meleeWeaponState != 0) {
if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) {
if (player->meleeWeaponAnimation == PLAYER_MWA_GORON_PUNCH_BUTT) {
Math_Vec3f_Copy(&player->unk_AF0[1], &player->meleeWeaponInfo[0].base);
func_8012669C(play, player, D_801C0A90, D_801C0A6C);

Some files were not shown because too many files have changed in this diff Show More