z_actor documentation pass (#1154)

* ActorContext_unk_1F4

* a

* ACTOR_FLAG_IGNORE_QUAKE

* ACTOR_FLAG_TALK_REQUESTED and ACTOR_FLAG_CANT_LOCK_ON

* actorCtx->unkC => ctorCtx->halfDaysBit

* HALFDAYBIT defines

* actor.halfDaysBits

* format

* Actor_InitHalfDaysBit

* Name actor-killing functions

* cleanup variables.h a bit

* DAWN

* bss

* Actor_RequestRumble and Actor_GetArrowDmgFlags

* name vars of func_800BC620

* format

* fix missing PLAYER_IA

* Actor_OfferGetItem

* Actor_SetClosestSecretDistance

* freezeCategoryPlayerFlags1

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* DROPFLAG_

* a

* COLORFILTER

* format

* sCategoryFreezeMasks

* Actor_OfferCarry

* review

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* change hex to dec

* COLORFILTER_INTENSITY_FLAG

* format

* review

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* shiftedHalfDaysBit

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* cleanup

* Undo Actor_RequestRumble

* Undo ACTOR_FLAG_IGNORE_QUAKE

* format

* Remove COLORFILTER_GET_BUFFLAG

* Undo Actor_KillAllFromUnloadedRooms

* format

* Update Actor_OfferGetItem comment

* Update Actor_OfferGetItem description

* diving

* bss

* namefixer

* format

* speed

* review

---------

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
Anghelo Carvajal
2023-03-09 12:35:23 -05:00
committed by GitHub
co-authored by Dragorn421 Derek Hensley
parent 496b4928ea
commit c833969ea7
195 changed files with 987 additions and 871 deletions
+16 -16
View File
@@ -614,7 +614,7 @@ void Flags_SetCollectible(PlayState* play, s32 flag);
void TitleCard_InitBossName(GameState* gameState, TitleCardContext* titleCtx, TexturePtr texture, s16 x, s16 y, u8 width, u8 height);
s32 func_800B648C(PlayState* play, s32 arg1, s32 arg2, f32 arg3, Vec3f* arg4);
s32 func_800B648C(PlayState* play, s32 arg1, s32 timer, f32 arg3, Vec3f* arg4);
f32 func_800B64FC(PlayState* play, f32 arg1, Vec3f* arg2, u32* arg3);
void* func_800B6584(PlayState* play, s16 id, void* arg2, size_t size);
void* func_800B6608(PlayState* play, s16 id);
@@ -691,13 +691,13 @@ s32 func_800B886C(Actor* actor, PlayState* play);
void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* x, s16* y);
s32 Actor_OnScreen(PlayState* play, Actor* actor);
s32 Actor_HasParent(Actor* actor, PlayState* play);
s32 Actor_PickUp(Actor* actor, PlayState* play, GetItemId getItemId, f32 xzRange, f32 yRange);
s32 Actor_PickUpNearby(Actor* actor, PlayState* play, GetItemId getItemId);
s32 Actor_LiftActor(Actor* actor, PlayState* play);
s32 Actor_PickUpFar(Actor* actor, PlayState* play, GetItemId getItemId);
s32 Actor_OfferGetItem(Actor* actor, PlayState* play, GetItemId getItemId, f32 xzRange, f32 yRange);
s32 Actor_OfferGetItemNearby(Actor* actor, PlayState* play, GetItemId getItemId);
s32 Actor_OfferCarry(Actor* actor, PlayState* play);
s32 Actor_OfferGetItemFar(Actor* actor, PlayState* play, GetItemId getItemId);
s32 Actor_HasNoParent(Actor* actor, PlayState* play);
void func_800B8C20(Actor* actorA, Actor* actorB, PlayState* play);
void func_800B8C50(Actor* actor, PlayState* play);
void Actor_SetClosestSecretDistance(Actor* actor, PlayState* play);
s32 Actor_HasRider(PlayState* play, Actor* horse);
s32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide);
s32 Actor_HasNoRider(PlayState* play, Actor* horse);
@@ -718,37 +718,37 @@ void func_800B9084(Actor* actor);
void func_800B9098(Actor* actor);
s32 func_800B90AC(PlayState* play, Actor* actor, CollisionPoly* polygon, s32 bgId, Vec3f* arg4);
void Actor_DeactivateLens(PlayState* play);
void func_800B9120(ActorContext* actorCtx);
void Actor_InitHalfDaysBit(ActorContext* actorCtx);
void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* actorEntry);
void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx);
s32 Actor_AddToLensActors(PlayState* play, Actor* actor);
void Actor_DrawAll(PlayState* play, ActorContext* actorCtx);
void func_800BA6FC(PlayState* play, ActorContext* actorCtx);
void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx);
void func_800BA798(PlayState* play, ActorContext* actorCtx);
void Actor_CleanupContext(ActorContext* actorCtx, PlayState* play);
Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params);
Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s32 params, u32 cutscene, s32 arg11, Actor* parent);
Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s32 params, u32 cutscene, u32 halfDaysBits, Actor* parent);
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);
void Actor_SpawnBodyParts(Actor* actor, PlayState* play, s32 arg2, Gfx** dList);
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);
void func_800BC154(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory);
s32 func_800BC188(s32 index);
Actor* func_800BC270(PlayState* play, Actor* actor, f32 arg2, s32 arg3);
Actor* func_800BC444(PlayState* play, Actor* actor, f32 arg2);
u32 Actor_GetArrowDmgFlags(s32 params);
Actor* func_800BC270(PlayState* play, Actor* actor, f32 distance, u32 dmgFlags);
Actor* func_800BC444(PlayState* play, Actor* actor, f32 distance);
s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16 angle);
s32 Actor_IsTargeted(PlayState* play, Actor* actor);
s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor);
void func_800BC620(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play);
void func_800BC620(Vec3f* pos, Vec3f* scale, u8 alpha, PlayState* play);
void Actor_AddQuake(PlayState* play, s16 verticalMag, s16 countdown);
void Actor_AddQuakeWithSpeed(PlayState* play, s16 verticalMag, s16 countdown, s16 speed);
void func_800BC848(Actor* actor, PlayState* play, s16 y, s16 countdown);
void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type);
void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 xluFlag, u16 duration);
void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 bufFlag, u16 duration);
Hilite* func_800BCBF4(Vec3f* arg0, PlayState* play);
Hilite* func_800BCC68(Vec3f* arg0, PlayState* play);
void Actor_GetClosestPosOnPath(Vec3s* points, s32 numPoints, Vec3f* srcPos, Vec3f* dstPos, s32 isPathLoop);
@@ -767,7 +767,7 @@ s32 func_800BE184(PlayState* play, Actor* actor, f32 xzDist, s16 arg3, s16 arg4,
u8 Actor_ApplyDamage(Actor* actor);
void Actor_SetDropFlag(Actor* actor, ColliderInfo* colInfo);
void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSphere);
void func_800BE33C(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3);
void func_800BE33C(Vec3f* arg0, Vec3f* arg1, Vec3s* dst, s32 arg3);
void func_800BE3D0(Actor* actor, s16 angle, Vec3s* arg2);
void func_800BE504(Actor* actor, ColliderCylinder* collider);
void func_800BE568(Actor* actor, ColliderSphere* collider);
+1 -17
View File
@@ -378,23 +378,7 @@ extern EffectSsOverlay gParticleOverlayTable[39];
// extern s32 sEntryIndex;
// extern u32 sCurrentBit;
// extern s32 sTimer;
extern f32 actorMovementScale;
extern TargetRangeParams gTargetRanges[];
extern s16 D_801AED48[8];
extern Color_RGBA8 actorDefaultHitColor;
// extern UNK_TYPE1 D_801AED8C;
// extern UNK_TYPE4 D_801AED98;
// extern UNK_TYPE4 D_801AEDA4;
// extern UNK_TYPE1 D_801AEDB0;
// extern UNK_TYPE4 D_801AEDD4;
// extern UNK_TYPE4 D_801AEE28;
// extern UNK_TYPE4 D_801AEE30;
// extern UNK_TYPE2 D_801AEE4C;
extern Gfx D_801AEF88[];
extern Gfx D_801AEFA0[];
// extern UNK_TYPE1 D_801AEFB8;
// extern UNK_TYPE1 D_801AEFBC;
// extern UNK_TYPE1 D_801AEFC0;
extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX];
extern ActorId gMaxActorId;
extern BgCheckSceneSubdivisionEntry sSceneSubdivisionList[];
-5
View File
@@ -815,11 +815,6 @@ typedef struct {
/* 0x14 */ Gfx* dList;
} VisMono; // size = 0x18
typedef struct {
/* 0x0 */ f32 rangeSq;
/* 0x4 */ f32 leashScale;
} TargetRangeParams; // size = 0x8
typedef struct {
/* 0x0 */ u8* value;
/* 0x4 */ const char* name;
+63 -16
View File
@@ -101,13 +101,13 @@ typedef struct {
/* 0x1C */ ActorFunc draw;
} ActorInit; // size = 0x20
typedef enum {
ALLOCTYPE_NORMAL,
ALLOCTYPE_ABSOLUTE,
ALLOCTYPE_PERMANENT
typedef enum AllocType {
/* 0 */ ALLOCTYPE_NORMAL,
/* 1 */ ALLOCTYPE_ABSOLUTE,
/* 2 */ ALLOCTYPE_PERMANENT
} AllocType;
typedef struct {
typedef struct ActorOverlay {
/* 0x00 */ uintptr_t vromStart;
/* 0x04 */ uintptr_t vromEnd;
/* 0x08 */ void* vramStart;
@@ -157,7 +157,7 @@ typedef struct Actor {
/* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data"
/* 0x01E */ s8 objBankIndex; // Object bank index of the actor's object dependency; original name: "bank"
/* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on
/* 0x020 */ s16 unk20;
/* 0x020 */ s16 halfDaysBits; // Bitmask indicating which half-days this actor is allowed to not be killed(?) (TODO: not sure how to word this). If the current halfDayBit is not part of this mask then the actor is killed when spawning the setup actors
/* 0x024 */ PosRot world; // Position/rotation in the world
/* 0x038 */ s8 cutscene;
/* 0x039 */ u8 audioFlags; // Another set of flags? Seems related to sfx or bgm
@@ -366,6 +366,13 @@ typedef struct {
/* 0xE */ s16 intensity;
} TitleCardContext; // size = 0x10
typedef struct ActorContext_unk_1F4 {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 timer;
/* 0x04 */ f32 unk_04;
/* 0x08 */ Vec3f unk_08;
} ActorContext_unk_1F4; // size = 0x14
typedef struct ActorContext_unk_20C {
/* 0x0 */ s16 id;
/* 0x2 */ s8 isDynamicallyInitialised;
@@ -396,6 +403,21 @@ typedef enum {
// Target size when activated
#define LENS_MASK_ACTIVE_SIZE 100
#define HALFDAYBIT_DAY0_DAWN (1 << 9)
#define HALFDAYBIT_DAY0_NIGHT (1 << 8)
#define HALFDAYBIT_DAY1_DAWN (1 << 7)
#define HALFDAYBIT_DAY1_NIGHT (1 << 6)
#define HALFDAYBIT_DAY2_DAWN (1 << 5)
#define HALFDAYBIT_DAY2_NIGHT (1 << 4)
#define HALFDAYBIT_DAY3_DAWN (1 << 3)
#define HALFDAYBIT_DAY3_NIGHT (1 << 2)
#define HALFDAYBIT_DAY4_DAWN (1 << 1)
#define HALFDAYBIT_DAY4_NIGHT (1 << 0)
#define HALFDAYBIT_DAWNS (HALFDAYBIT_DAY0_DAWN | HALFDAYBIT_DAY1_DAWN | HALFDAYBIT_DAY2_DAWN | HALFDAYBIT_DAY3_DAWN | HALFDAYBIT_DAY4_DAWN)
#define HALFDAYBIT_NIGHTS (HALFDAYBIT_DAY0_NIGHT | HALFDAYBIT_DAY1_NIGHT | HALFDAYBIT_DAY2_NIGHT | HALFDAYBIT_DAY3_NIGHT | HALFDAYBIT_DAY4_NIGHT)
#define HALFDAYBIT_ALL (HALFDAYBIT_DAWNS | HALFDAYBIT_NIGHTS)
typedef struct ActorContext {
/* 0x000 */ u8 freezeFlashTimer;
/* 0x001 */ UNK_TYPE1 pad1;
@@ -405,7 +427,7 @@ typedef struct ActorContext {
/* 0x005 */ u8 flags;
/* 0x006 */ UNK_TYPE1 pad6[0x5];
/* 0x00B */ s8 lensActorsDrawn;
/* 0x00C */ s16 unkC;
/* 0x00C */ s16 halfDaysBit; // A single bit indicating the current half-day. It is one of HALFDAYBIT_DAYX_ macro values
/* 0x00E */ u8 totalLoadedActors;
/* 0x00F */ u8 numLensActors;
/* 0x010 */ ActorListEntry actorLists[ACTORCAT_MAX];
@@ -413,11 +435,7 @@ typedef struct ActorContext {
/* 0x120 */ TargetContext targetContext;
/* 0x1B8 */ ActorContextSceneFlags sceneFlags;
/* 0x1E4 */ TitleCardContext titleCtxt;
/* 0x1F4 */ u8 unk1F4;
/* 0x1F5 */ u8 unk1F5;
/* 0x1F6 */ UNK_TYPE1 pad1F6[0x2];
/* 0x1F8 */ f32 unk1F8;
/* 0x1FC */ Vec3f unk1FC;
/* 0x1F4 */ ActorContext_unk_1F4 unk_1F4;
/* 0x208 */ UNK_TYPE1 unk_208[0x4];
/* 0x20C */ ActorContext_unk_20C unk_20C[8];
/* 0x24C */ UNK_TYPE1 unk_24C[0x4];
@@ -477,8 +495,8 @@ typedef enum {
#define ACTOR_FLAG_40 (1 << 6)
// hidden or revealed by Lens of Truth (depending on room lensMode)
#define ACTOR_FLAG_REACT_TO_LENS (1 << 7)
// Related to talk
#define ACTOR_FLAG_100 (1 << 8)
// Player has requested to talk to the actor; Player uses this flag differently than every other actor
#define ACTOR_FLAG_TALK_REQUESTED (1 << 8)
//
#define ACTOR_FLAG_200 (1 << 9)
//
@@ -515,8 +533,8 @@ typedef enum {
#define ACTOR_FLAG_2000000 (1 << 25)
//
#define ACTOR_FLAG_4000000 (1 << 26)
//
#define ACTOR_FLAG_8000000 (1 << 27)
// Prevents locking on with Z targeting an actor even if Tatl is floating over it
#define ACTOR_FLAG_CANT_LOCK_ON (1 << 27)
//
#define ACTOR_FLAG_10000000 (1 << 28)
//
@@ -526,6 +544,25 @@ typedef enum {
//
#define ACTOR_FLAG_80000000 (1 << 31)
#define DROPFLAG_NONE (0)
#define DROPFLAG_1 (1 << 0)
#define DROPFLAG_2 (1 << 1)
#define DROPFLAG_20 (1 << 5)
#define COLORFILTER_GET_COLORFLAG(colorFilterParams) ((colorFilterParams) & 0xC000)
#define COLORFILTER_GET_COLORINTENSITY(colorFilterParams) (((colorFilterParams) & 0x1F00) >> 5)
#define COLORFILTER_GET_DURATION(colorFilterParams) ((colorFilterParams) & 0xFF)
#define COLORFILTER_COLORFLAG_NONE 0xC000
#define COLORFILTER_COLORFLAG_GRAY 0x8000
#define COLORFILTER_COLORFLAG_RED 0x4000
#define COLORFILTER_COLORFLAG_BLUE 0x0000
#define COLORFILTER_INTENSITY_FLAG 0x8000
#define COLORFILTER_BUFFLAG_XLU 0x2000
#define COLORFILTER_BUFFLAG_OPA 0x0000
typedef enum {
/* 0x00 */ CLEAR_TAG_SMALL_EXPLOSION,
/* 0x01 */ CLEAR_TAG_LARGE_EXPLOSION,
@@ -641,6 +678,11 @@ typedef enum {
/* 0xFF */ TATL_HINT_ID_NONE = 0xFF
} TatlHintId;
typedef struct TargetRangeParams {
/* 0x0 */ f32 rangeSq;
/* 0x4 */ f32 leashScale;
} TargetRangeParams; // size = 0x8
typedef enum NpcTalkState {
/* 0 */ NPC_TALK_STATE_IDLE, // NPC not currently talking to player
/* 1 */ NPC_TALK_STATE_TALKING, // NPC is currently talking to player
@@ -668,4 +710,9 @@ typedef struct NpcInteractInfo {
/* 0x24 */ UNK_TYPE1 unk_24[0x4];
} NpcInteractInfo; // size = 0x28
extern TargetRangeParams gTargetRanges[];
extern s16 D_801AED48[8];
extern Gfx D_801AEF88[];
extern Gfx D_801AEFA0[];
#endif