General Cleanup 11 (#992)

* char -> UNK_TYPE1

* SubS fixes

* func_800B8500

* macros

* misc

* A few more GET_{ACTOR} vs {ACTOR}_GETw

* More Macros

* fix

* PARSE_TYPE -> GET_TYPE

* 1 more
This commit is contained in:
Derek Hensley 2022-08-15 18:42:21 -07:00 committed by GitHub
parent f3a51c5403
commit bb96e47f8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
75 changed files with 253 additions and 252 deletions

View File

@ -49,7 +49,7 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
// Actors which may be pictographed anywhere
switch (actor->id) {
case ACTOR_EN_KAKASI:
if (GET_KAKASI_ABOVE_GROUND(actor) == 1) {
if (KAKASI_GET_ABOVE_GROUND(actor) == 1) {
seen |= PICTO_SEEN_ANYWHERE;
break; //! @bug break is inside conditional, meaning it falls through if it is false
}

View File

@ -15,7 +15,7 @@ typedef struct ArmsHook {
/* 0x1EC */ Vec3f unk1EC;
/* 0x1F8 */ Actor* grabbed;
/* 0x1FC */ Vec3f unk1FC;
/* 0x208 */ char unk208[0x2];
/* 0x208 */ UNK_TYPE1 unk208[0x2];
/* 0x20A */ s16 timer;
/* 0x20C */ ArmsHookActionFunc actionFunc;
} ArmsHook; // size = 0x210

View File

@ -153,7 +153,7 @@ void func_80C0ABA8(BgIkninSusceil* this, PlayState* play) {
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
func_80C0A86C(this, play, 4, 14, 1);
Flags_UnsetSwitch(play, GET_SUSCEIL_SWITCHFLAG(this));
Flags_UnsetSwitch(play, SUSCEIL_GET_SWITCHFLAG(&this->dyna.actor));
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND);
func_80C0AC74(this);
} else {
@ -167,7 +167,7 @@ void func_80C0AC74(BgIkninSusceil* this) {
}
void func_80C0AC90(BgIkninSusceil* this, PlayState* play) {
if (Flags_GetSwitch(play, GET_SUSCEIL_SWITCHFLAG(this))) {
if (Flags_GetSwitch(play, SUSCEIL_GET_SWITCHFLAG(&this->dyna.actor))) {
func_80C0ACD4(this);
}
}

View File

@ -3,7 +3,7 @@
#include "global.h"
#define GET_SUSCEIL_SWITCHFLAG(this) (((this)->dyna.actor.params) & 0x7F)
#define SUSCEIL_GET_SWITCHFLAG(thisx) (((thisx)->params) & 0x7F)
struct BgIkninSusceil;

View File

@ -145,7 +145,7 @@ void BgKin2Bombwall_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_Init(&this->dyna, 0);
bombwallCollider = &this->collider;
Collider_InitCylinder(play, bombwallCollider);
if (Flags_GetSwitch(play, BG_KIN2_BOMBWALL_SWITCH_FLAG(this))) {
if (Flags_GetSwitch(play, BG_KIN2_BOMBWALL_SWITCH_FLAG(&this->dyna.actor))) {
Actor_MarkForDeath(&this->dyna.actor);
} else {
DynaPolyActor_LoadMesh(play, &this->dyna, &gOceanSpiderHouseBombableWallCol);
@ -184,7 +184,7 @@ void BgKin2Bombwall_SetupPlayCutscene(BgKin2Bombwall* this) {
void BgKin2Bombwall_PlayCutscene(BgKin2Bombwall* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
Flags_SetSwitch(play, BG_KIN2_BOMBWALL_SWITCH_FLAG(this));
Flags_SetSwitch(play, BG_KIN2_BOMBWALL_SWITCH_FLAG(&this->dyna.actor));
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 60, NA_SE_EV_WALL_BROKEN);
func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId);
this->dyna.actor.draw = NULL;

View File

@ -1,7 +1,7 @@
#ifndef Z_BG_KIN2_BOMBWALL_H
#define Z_BG_KIN2_BOMBWALL_H
#define BG_KIN2_BOMBWALL_SWITCH_FLAG(thisx) (thisx->dyna.actor.params & 0x7F)
#define BG_KIN2_BOMBWALL_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F)
#include "global.h"

View File

@ -49,8 +49,8 @@ void BgLadder_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->switchFlag = GET_BGLADDER_SWITCHFLAG(thisx);
thisx->params = GET_BGLADDER_SIZE(thisx);
this->switchFlag = BGLADDER_GET_SWITCHFLAG(thisx);
thisx->params = BGLADDER_GET_SIZE(thisx);
DynaPolyActor_Init(&this->dyna, 0);
size = thisx->params;

View File

@ -3,8 +3,8 @@
#include "global.h"
#define GET_BGLADDER_SIZE(actor) ((actor)->params & 0xFF)
#define GET_BGLADDER_SWITCHFLAG(actor) (((actor)->params >> 8) & 0xFF)
#define BGLADDER_GET_SIZE(thisx) ((thisx)->params & 0xFF)
#define BGLADDER_GET_SWITCHFLAG(thisx) (((thisx)->params >> 8) & 0xFF)
struct BgLadder;
@ -18,10 +18,10 @@ typedef struct BgLadder {
} BgLadder; // size = 0x164
typedef enum {
LADDER_SIZE_12RUNG,
LADDER_SIZE_16RUNG,
LADDER_SIZE_20RUNG,
LADDER_SIZE_24RUNG,
/* 0 */ LADDER_SIZE_12RUNG,
/* 1 */ LADDER_SIZE_16RUNG,
/* 2 */ LADDER_SIZE_20RUNG,
/* 3 */ LADDER_SIZE_24RUNG,
} BgLadderSize;
extern const ActorInit Bg_Ladder_InitVars;

View File

@ -25,9 +25,9 @@ typedef enum {
typedef struct DmChar07 {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ char pad15C[0x14C];
/* 0x15C */ UNK_TYPE1 pad15C[0x14C];
/* 0x2A8 */ DmChar07ActionFunc actionFunc;
/* 0x2AC */ char pad2AC[0xD];
/* 0x2AC */ UNK_TYPE1 pad2AC[0xD];
/* 0x2B9 */ u8 spotlightFlags;
/* 0x2BA */ u8 isStage;
} DmChar07; // size = 0x2BC

View File

@ -10,7 +10,7 @@ typedef void (*DoorShutterActionFunc)(struct DoorShutter*, PlayState*);
#define DOORSHUTTER_GET_1F(thisx) ((thisx)->params & 0x1F)
#define DOORSHUTTER_GET_7F(thisx) ((thisx)->params & 0x7F)
#define DOORSHUTTER_GET_380(thisx) (((thisx)->params >> 7) & 7)
#define DOORSHUTTER_GET_FC00(thisx) (((u16)(thisx)->params >> 0xA))
#define DOORSHUTTER_GET_FC00(thisx) ((u16)(thisx)->params >> 0xA)
typedef struct DoorShutter {
/* 0x0000 */ Actor actor;

View File

@ -16,10 +16,6 @@
#define THIS ((DoorSpiral*)thisx)
#define GET_ORIENTATION_PARAM(this) ((((Actor*)(this))->params >> 7) & 0x1)
#define GET_UNK145_PARAM(this) ((((Actor*)(this))->params >> 8) & 0x3)
#define GET_TRANSITION_ID_PARAM(this) ((u16)((Actor*)(this))->params >> 10)
typedef enum {
/* 0 */ SPIRAL_OVERWORLD, // does not display anything as there is not a DL in GAMEPLAY_KEEP for it
/* 1 */ SPIRAL_DUNGEON,
@ -179,7 +175,7 @@ static InitChainEntry sInitChain[] = {
void DoorSpiral_Init(Actor* thisx, PlayState* play) {
DoorSpiral* this = THIS;
s32 pad;
s32 transition = GET_TRANSITION_ID_PARAM(thisx);
s32 transition = DOORSPIRAL_GET_TRANSITION_ID(thisx);
s8 objBankId;
if (this->actor.room != play->doorCtx.transitionActorList[transition].sides[0].room) {
@ -188,8 +184,8 @@ void DoorSpiral_Init(Actor* thisx, PlayState* play) {
}
Actor_ProcessInitChain(&this->actor, sInitChain);
this->unk145 = GET_UNK145_PARAM(thisx); // set but never used
this->orientation = GET_ORIENTATION_PARAM(thisx);
this->unk145 = DOORSPIRAL_GET_UNK145(thisx); // set but never used
this->orientation = DOORSPIRAL_GET_ORIENTATION(thisx);
this->objectType = DoorSpiral_GetObjectType(play);
objBankId = Object_GetIndex(&play->objectCtx, sSpiralObjectInfo[this->objectType].objectBankId);
this->bankIndex = objBankId;
@ -204,7 +200,7 @@ void DoorSpiral_Init(Actor* thisx, PlayState* play) {
}
void DoorSpiral_Destroy(Actor* thisx, PlayState* play) {
s32 transition = GET_TRANSITION_ID_PARAM(thisx);
s32 transition = DOORSPIRAL_GET_TRANSITION_ID(thisx);
play->doorCtx.transitionActorList[transition].id *= -1;
}
@ -281,7 +277,7 @@ void DoorSpiral_Wait(DoorSpiral* this, PlayState* play) {
player->doorType = 4;
player->doorDirection = this->orientation;
player->doorActor = &this->actor;
transition = GET_TRANSITION_ID_PARAM(this);
transition = DOORSPIRAL_GET_TRANSITION_ID(&this->actor);
player->doorNext = ((u16)play->doorCtx.transitionActorList[transition].params) >> 10;
func_80122F28(player);

View File

@ -5,6 +5,10 @@
struct DoorSpiral;
#define DOORSPIRAL_GET_ORIENTATION(thisx) (((thisx)->params >> 7) & 0x1)
#define DOORSPIRAL_GET_UNK145(thisx) (((thisx)->params >> 8) & 0x3)
#define DOORSPIRAL_GET_TRANSITION_ID(thisx) ((u16)(thisx)->params >> 10)
typedef void (*DoorSpiralActionFunc)(struct DoorSpiral*, PlayState*);
typedef struct DoorSpiral {

View File

@ -128,7 +128,7 @@ void EnAni_Init(Actor* thisx, PlayState* play) {
this->treeReachTimer = 0;
this->blinkFunc = EnAni_DefaultBlink;
if (GET_ANI_TYPE(thisx) == ANI_TYPE_TREE_HANGING) {
if (ANI_GET_TYPE(thisx) == ANI_TYPE_TREE_HANGING) {
Animation_Change(&this->skelAnime, &gAniTreeHangingAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gAniTreeHangingAnim), ANIMMODE_ONCE, 0.0f);
this->actionFunc = EnAni_HangInTree;

View File

@ -33,6 +33,6 @@ enum EnAniType {
/* 1 */ ANI_TYPE_TREE_HANGING = 1,
};
#define GET_ANI_TYPE(thisx) (thisx->params & 0xFF)
#define ANI_GET_TYPE(thisx) ((thisx)->params & 0xFF)
#endif // Z_EN_ANI_H

View File

@ -181,8 +181,7 @@ void EnBigpo_Init(Actor* thisx, PlayState* play2) {
Actor_ProcessInitChain(&this->actor, sInitChain);
// thisx req to match
this->switchFlags = GET_BIGPO_SWITCHFLAGS(thisx);
this->switchFlags = BIGPO_GET_SWITCHFLAGS(thisx);
thisx->params &= 0xFF;
if (thisx->params == ENBIGPO_POSSIBLEFIRE) {
if (Flags_GetSwitch(play, this->switchFlags)) {

View File

@ -64,6 +64,6 @@ enum EnBigpoType {
/* 5 */ ENBIGPO_UNK5,
};
#define GET_BIGPO_SWITCHFLAGS(thisx) ((u8)(thisx->params >> 0x8))
#define BIGPO_GET_SWITCHFLAGS(thisx) (u8)((thisx)->params >> 0x8)
#endif // Z_EN_BIGPO_H

View File

@ -509,7 +509,7 @@ void func_809C59F0(EnBomBowlMan* this, PlayState* play) {
} else {
this->actor.textId = 0x716;
}
func_800B8500(&this->actor, play, 400.0f, 400.0f, -1);
func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_AP_MINUS1);
this->actionFunc = func_809C5AA4;
} else {
Actor_PickUp(&this->actor, play, GI_BOMBERS_NOTEBOOK, 300.0f, 300.0f);
@ -524,7 +524,7 @@ void func_809C5AA4(EnBomBowlMan* this, PlayState* play) {
this->actionFunc = func_809C5598;
}
} else {
func_800B8500(&this->actor, play, 400.0f, 400.0f, -1);
func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_AP_MINUS1);
}
}

View File

@ -15,7 +15,7 @@ typedef struct EnDyExtra {
/* 0x14C */ s16 unk14C;
/* 0x14E */ s16 unk14E;
/* 0x150 */ f32 unk150;
/* 0x154 */ char unk154[0xC];
/* 0x154 */ UNK_TYPE1 unk154[0xC];
/* 0x160 */ Vec3f unk160;
} EnDyExtra; // size = 0x16C

View File

@ -114,7 +114,7 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) {
this->dyna.actor.targetMode = 6;
this->dyna.actor.colChkInfo.health = 1;
this->scale = 0.1;
this->switchFlag = GET_ENCOUNT2_SWITCH_FLAG(this);
this->switchFlag = ENCOUNT2_GET_SWITCH_FLAG(&this->dyna.actor);
if (this->switchFlag == 0x7F) {
this->switchFlag = -1;
@ -137,6 +137,7 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) {
void EnEncount2_Destroy(Actor* thisx, PlayState* play) {
EnEncount2* this = THIS;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
Collider_DestroyJntSph(play, &this->collider);
}

View File

@ -33,7 +33,7 @@ typedef struct EnEncount2 {
/* 0x01D0 */ EnEncount2Effect effects[EN_ENCOUNT2_EFFECT_COUNT];
} EnEncount2; // size = 0x2A70
#define GET_ENCOUNT2_SWITCH_FLAG(actor) ((s16)(((Actor*)actor)->params & 0x7F))
#define ENCOUNT2_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F)
extern const ActorInit En_Encount2_InitVars;

View File

@ -166,7 +166,7 @@ void EnFamos_Init(Actor* thisx, PlayState* play) {
s32 i;
Actor_ProcessInitChain(&this->actor, sInitChain);
if (GET_FAMOS_PATH(thisx) != 0xFF) {
if (FAMOS_GET_PATH(thisx) != 0xFF) {
path = &play->setupPathList[this->actor.params];
this->pathPoints = Lib_SegmentedToVirtual(path->points);
this->pathNodeCount = path->count;
@ -193,7 +193,7 @@ void EnFamos_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.mass = 250;
this->baseHeight = this->actor.world.pos.y;
// params: [this->actor.shape.rot.x] is used to set aggro distance
this->aggroDistance = (GET_FAMOS_AGGRO_DISTANCE(thisx) <= 0) ? (200.0f) : (this->actor.shape.rot.x * 40.0f * 0.1f);
this->aggroDistance = (FAMOS_GET_AGGRO_DISTANCE(thisx) <= 0) ? (200.0f) : (this->actor.shape.rot.x * 40.0f * 0.1f);
this->actor.shape.rot.x = 0;
this->actor.world.rot.x = 0;
this->hasFinishedRotating = true;

View File

@ -15,8 +15,8 @@ typedef struct EnFamosRock {
/* 0x20 */ f32 scale;
} EnFamosRock; // size = 0x24
#define GET_FAMOS_PATH(thisx) (thisx->params)
#define GET_FAMOS_AGGRO_DISTANCE(thisx) (thisx->shape.rot.x)
#define FAMOS_GET_PATH(thisx) ((thisx)->params)
#define FAMOS_GET_AGGRO_DISTANCE(thisx) ((thisx)->shape.rot.x)
// stateTimer gets reused:
// after spotting player, counts frames until first attack (8)

View File

@ -34,7 +34,7 @@ typedef struct EnFish2 {
/* 0x02C8 */ u8 unk_2C8;
/* 0x02CA */ s16 subCamId;
/* 0x02CC */ f32 unk_2CC;
/* 0x02D0 */ char unk_2D0[0x4];
/* 0x02D0 */ UNK_TYPE1 unk_2D0[0x4];
/* 0x02D4 */ f32 unk_2D4;
/* 0x02D8 */ f32 unk_2D8;
/* 0x02DC */ Vec3f subCamEye;
@ -53,7 +53,6 @@ typedef struct EnFish2 {
/* 0x0348 */ s16 unk_348;
/* 0x034A */ s16 unk_34A;
/* 0x034C */ s16 unk_34C;
/* 0x034E */ char unk_34E[0x02];
/* 0x0350 */ Actor* unk_350;
/* 0x0354 */ struct EnFish2* unk_354;
/* 0x0358 */ ColliderJntSph collider;

View File

@ -12,12 +12,12 @@ typedef void (*EnFuActionFunc)(struct EnFu*, PlayState*);
typedef struct {
/* 0x00 */ f32 unk_00;
/* 0x04 */ char unk_04[0x4];
/* 0x04 */ UNK_TYPE1 unk_04[0x4];
/* 0x08 */ Vec3f unk_08;
/* 0x14 */ Vec3f unk_14;
/* 0x20 */ Vec3f unk_20;
/* 0x2C */ s16 unk_2C;
/* 0x2E */ char unk_2E[0x8];
/* 0x2E */ UNK_TYPE1 unk_2E[0x8];
/* 0x36 */ u8 unk_36;
/* 0x37 */ u8 unk_37;
} EnFuUnkStruct; // size = 0x38
@ -36,7 +36,7 @@ typedef struct EnFu {
/* 0x520 */ s32 unk_520;
/* 0x524 */ s16 unk_524[3];
/* 0x52A */ s16 unk_52A[3];
/* 0x530 */ char unk530[0x8];
/* 0x530 */ UNK_TYPE1 unk530[0x8];
/* 0x538 */ Vec3s* unk_538;
/* 0x53C */ s16 unk_53C;
/* 0x53E */ s16 unk_53E;

View File

@ -15,10 +15,10 @@ typedef struct EnGuruguru {
/* 0x248 */ EnGuruguruActionFunc actionFunc;
/* 0x24C */ s16 headZRot;
/* 0x24E */ s16 headXRot;
/* 0x250 */ char unk250[0x2];
/* 0x250 */ UNK_TYPE1 unk250[0x2];
/* 0x252 */ s16 headZRotTarget;
/* 0x254 */ s16 headXRotTarget;
/* 0x256 */ char unk256[0xE];
/* 0x256 */ UNK_TYPE1 unk256[0xE];
/* 0x264 */ s16 unusedTimer; // set to 6 and decremented, but never has any effect
/* 0x266 */ s16 unk266;
/* 0x268 */ s16 unk268;

View File

@ -7,7 +7,7 @@ struct EnHitTag;
typedef void (*EnHitTagActionFunc)(struct EnHitTag*, PlayState*);
#define ENHITTAG_GET_SWITCHFLAG(thisx) (s32)(((thisx)->params & 0xFE00) >> 9)
#define ENHITTAG_GET_SWITCHFLAG(thisx) (((thisx)->params & 0xFE00) >> 9)
typedef struct EnHitTag {
/* 0x000 */ Actor actor;

View File

@ -162,7 +162,7 @@ void func_80953098(EnHs* this, PlayState* play) {
this->actionFunc = func_8095345C;
this->actor.flags |= ACTOR_FLAG_10000;
this->stateFlags |= 0x10;
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
} else {
this->stateFlags |= 8;
if (INV_CONTENT(ITEM_MASK_BUNNY) == ITEM_MASK_BUNNY) {
@ -264,7 +264,7 @@ void func_8095345C(EnHs* this, PlayState* play) {
this->actionFunc = func_80953354;
this->stateTimer = 40;
} else if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_10000)) {
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
this->stateFlags |= 1;
} else if ((this->actor.xzDistToPlayer < 120.0f) && Player_IsFacingActor(&this->actor, 0x2000, play)) {
func_800B8614(&this->actor, play, 130.0f);

View File

@ -46,7 +46,7 @@ typedef struct EnIn {
/* 0x18C */ ColliderJntSph colliderJntSph;
/* 0x1AC */ ColliderJntSphElement colliderJntSphElement;
/* 0x1EC */ ColliderCylinder colliderCylinder;
/* 0x238 */ char unk238[0x4];
/* 0x238 */ UNK_TYPE1 unk238[0x4];
/* 0x23C */ u8 unk23C;
/* 0x23D */ u8 unk23D;
/* 0x240 */ Path* path;
@ -60,19 +60,19 @@ typedef struct EnIn {
/* 0x352 */ Vec3s trackTarget;
/* 0x358 */ Vec3s headRot;
/* 0x35E */ Vec3s torsoRot;
/* 0x364 */ char unk364[0x12];
/* 0x364 */ UNK_TYPE1 unk364[0x12];
/* 0x376 */ s16 unk376[20];
/* 0x39E */ s16 unk39E[20];
/* 0x3C6 */ char unk3C6[0xBC];
/* 0x3C6 */ UNK_TYPE1 unk3C6[0xBC];
/* 0x482 */ s16 unk482;
/* 0x484 */ s16 unk484;
/* 0x486 */ s16 unk486;
/* 0x488 */ s16 unk488;
/* 0x48A */ u16 unk48A;
/* 0x48C */ s32 unk48C;
/* 0x490 */ char unk490[0x4];
/* 0x490 */ UNK_TYPE1 unk490[0x4];
/* 0x494 */ s32 unk494;
/* 0x498 */ char unk498[0xC];
/* 0x498 */ UNK_TYPE1 unk498[0xC];
/* 0x4A4 */ struct EnIn* unk4A4;
/* 0x4A8 */ s32 unk4A8;
/* 0x4AC */ s32 unk4AC;

View File

@ -34,32 +34,32 @@ typedef enum {
} EnInvadepohDirection;
typedef struct unkStruct80B50350 {
/* 0x000 */ s8 unk0;
/* 0x001 */ s8 unk1;
/* 0x002 */ u8 unk2;
/* 0x004 */ Vec3f unk4;
/* 0x0 */ s8 unk0;
/* 0x1 */ s8 unk1;
/* 0x2 */ u8 unk2;
/* 0x4 */ Vec3f unk4;
} unkStruct80B50350; // size = 0x10;
typedef struct {
/* 0x00 */ s8* unk00;
/* 0x04 */ s8 unk04;
} unkstructInvadepoh0; // size = 0x08
/* 0x0 */ s8* unk00;
/* 0x4 */ s8 unk04;
} unkstructInvadepoh0; // size = 0x8
typedef struct {
/* 0x00 */ s8 unk00;
/* 0x04 */ f32 unk04;
} unkstructInvadepoh1; // size = 0x08
/* 0x0 */ s8 unk00;
/* 0x4 */ f32 unk04;
} unkstructInvadepoh1; // size = 0x8
typedef struct {
/* 0x00 */ s8 unk00;
/* 0x04 */ unkstructInvadepoh0* unk04;
} unkstructInvadepoh2; // size = 0x08
/* 0x0 */ s8 unk00;
/* 0x4 */ unkstructInvadepoh0* unk04;
} unkstructInvadepoh2; // size = 0x8
typedef struct {
/* 0x00 */ s8 unk0;
/* 0x04 */ unkstructInvadepoh0* unk4;
/* 0x08 */ s8 unk8;
/* 0x0C */ unkstructInvadepoh1* unkC;
/* 0x0 */ s8 unk0;
/* 0x4 */ unkstructInvadepoh0* unk4;
/* 0x8 */ s8 unk8;
/* 0xC */ unkstructInvadepoh1* unkC;
} unkstructInvadepoh3; // size = 0x10
typedef struct {
@ -72,38 +72,38 @@ typedef struct {
} unkstructInvadepoh4; // size = 0x14
typedef struct {
/* 0x00 */ f32 unk00;
/* 0x04 */ s16 unk04;
/* 0x06 */ s16 unk06;
} unkstruct80B4EE0C; // size = 0x08
/* 0x0 */ f32 unk00;
/* 0x4 */ s16 unk04;
/* 0x6 */ s16 unk06;
} unkstruct80B4EE0C; // size = 0x8
typedef struct EnInvadePohStruct {
/* 0x000 */ unkstructInvadepoh4* unk0;
/* 0x004 */ s8 unk4;
/* 0x008 */ unkstructInvadepoh4* unk8;
/* 0x00C */ s16 unkC;
/* 0x00E */ s8 unkE;
/* 0x00F */ s8 unkF;
/* 0x0 */ unkstructInvadepoh4* unk0;
/* 0x4 */ s8 unk4;
/* 0x8 */ unkstructInvadepoh4* unk8;
/* 0xC */ s16 unkC;
/* 0xE */ s8 unkE;
/* 0xF */ s8 unkF;
} EnInvadePohStruct; // size = 0x10;
typedef struct AlienBehaviorInfo {
/* 0x000 */ EnInvadePohStruct unk0;
/* 0x010 */ EnInvadePohStruct unk10;
/* 0x020 */ Vec3s unk20;
/* 0x026 */ Vec3s unk26;
/* 0x02C */ s16 unk2C;
/* 0x02E */ u16 unk2E;
/* 0x030 */ f32 unk30;
/* 0x034 */ f32 unk34;
/* 0x038 */ f32 unk38;
/* 0x03C */ f32 unk3C;
/* 0x040 */ s16 unk40;
/* 0x042 */ s16 unk42;
/* 0x044 */ f32 unk44;
/* 0x048 */ s16 unk48;
/* 0x04A */ char unk4A[0x2];
/* 0x04C */ s16 unk4C;
/* 0x04E */ s16 unk4E;
/* 0x00 */ EnInvadePohStruct unk0;
/* 0x10 */ EnInvadePohStruct unk10;
/* 0x20 */ Vec3s unk20;
/* 0x26 */ Vec3s unk26;
/* 0x2C */ s16 unk2C;
/* 0x2E */ u16 unk2E;
/* 0x30 */ f32 unk30;
/* 0x34 */ f32 unk34;
/* 0x38 */ f32 unk38;
/* 0x3C */ f32 unk3C;
/* 0x40 */ s16 unk40;
/* 0x42 */ s16 unk42;
/* 0x44 */ f32 unk44;
/* 0x48 */ s16 unk48;
/* 0x4A */ UNK_TYPE1 unk4A[0x2];
/* 0x4C */ s16 unk4C;
/* 0x4E */ s16 unk4E;
} AlienBehaviorInfo; // size = 0x50
typedef struct EnInvadepoh {
@ -148,7 +148,7 @@ typedef struct EnInvadepoh {
/* 0x3A8 */ s16 scaleAdjAngle;
/* 0x3AA */ s16 unk3AA;
/* 0x3AC */ s8 unk3AC; // index for D_80B4EDD0
/* 0x3AD */ char unk3AD[0xF];
/* 0x3AD */ UNK_TYPE1 unk3AD[0xF];
/* 0x3BC */ s8 unk3BC;
} EnInvadepoh; // size = 0x3C0

View File

@ -149,7 +149,7 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) {
Collider_InitAndSetCylinder(play, &this->collider, &this->picto.actor, &D_80971D80);
SkelAnime_InitFlex(play, &this->skelanime, &object_ka_Skel_0065B0, &object_ka_Anim_000214, 0, 0, 0);
this->songSummonDist = GET_KAKASI_SUMMON_DISTANCE(&this->picto.actor) * 20.0f;
this->songSummonDist = KAKASI_GET_SUMMON_DISTANCE(&this->picto.actor) * 20.0f;
if (this->songSummonDist < 40.0f) {
this->songSummonDist = 40.0f;
}
@ -158,11 +158,11 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) {
this->picto.actor.world.rot.z = 0;
this->picto.actor.targetMode = 0;
if (this->picto.actor.world.rot.x > 0 && this->picto.actor.world.rot.x < 8) {
this->picto.actor.targetMode = GET_KAKASI_TARGETMODE(thisx);
this->picto.actor.targetMode = KAKASI_GET_TARGETMODE(thisx);
}
this->picto.actor.shape.rot.y = this->picto.actor.world.rot.y;
this->aboveGroundStatus = GET_KAKASI_ABOVE_GROUND(&this->picto.actor);
this->aboveGroundStatus = KAKASI_GET_ABOVE_GROUND(&this->picto.actor);
this->picto.actor.world.rot.x = 0;
this->picto.actor.flags |= ACTOR_FLAG_400;
this->picto.actor.colChkInfo.mass = MASS_IMMOVABLE;
@ -318,7 +318,7 @@ void EnKakasi_TimeSkipDialogue(EnKakasi* this, PlayState* play) {
this->picto.actor.flags &= ~ACTOR_FLAG_10000;
this->actionFunc = EnKakasi_RegularDialogue;
} else {
func_800B8500(&this->picto.actor, play, 9999.9f, 9999.9f, -1);
func_800B8500(&this->picto.actor, play, 9999.9f, 9999.9f, PLAYER_AP_MINUS1);
}
}
}

View File

@ -44,8 +44,8 @@ extern const ActorInit En_Kakasi_InitVars;
#define ENKAKASI_ABOVE_GROUND_TYPE 2
#define GET_KAKASI_SUMMON_DISTANCE(thisx) (((thisx)->params >> 0x8) & 0xFF)
#define GET_KAKASI_ABOVE_GROUND(thisx) ((thisx)->params & 0x1)
#define GET_KAKASI_TARGETMODE(thisx) ((thisx)->world.rot.x - 1)
#define KAKASI_GET_SUMMON_DISTANCE(thisx) (((thisx)->params >> 0x8) & 0xFF)
#define KAKASI_GET_ABOVE_GROUND(thisx) ((thisx)->params & 0x1)
#define KAKASI_GET_TARGETMODE(thisx) ((thisx)->world.rot.x - 1)
#endif // Z_EN_KAKASI_H

View File

@ -12,16 +12,16 @@ typedef struct EnKnight {
/* 0x144 */ s16 unk_144;
/* 0x146 */ char unk_146[0x2];
/* 0x148 */ s8 unk_148;
/* 0x149 */ char pad149[8];
/* 0x149 */ char unk_149[0x8];
/* 0x151 */ s8 unk_151;
/* 0x152 */ char pad152[1];
/* 0x152 */ char unk_152[0x1];
/* 0x153 */ u8 unk_153;
/* 0x154 */ u8 unk_154;
/* 0x155 */ char pad155[0x2CB];
/* 0x155 */ char unk_155[0x2CB];
/* 0x420 */ EnKnightActionFunc actionFunc;
/* 0x424 */ char unk_424[0x25C];
/* 0x680 */ u8 unk_680;
/* 0x681 */ char pad681[9];
/* 0x681 */ char unk_681[0x9];
/* 0x68A */ s16 unk_68A;
/* 0x68C */ char pad68C[0x48];
} EnKnight; // size = 0x6D4

View File

@ -244,12 +244,12 @@ void EnKusa_DropCollectible(EnKusa* this, PlayState* play) {
s32 collectible;
s32 collectableParams;
if ((GET_KUSA_TYPE(&this->actor) == ENKUSA_TYPE_GRASS) || (GET_KUSA_TYPE(&this->actor) == ENKUSA_TYPE_BUSH)) {
if ((KUSA_GET_TYPE(&this->actor) == ENKUSA_TYPE_GRASS) || (KUSA_GET_TYPE(&this->actor) == ENKUSA_TYPE_BUSH)) {
if (!KUSA_GET_PARAMS_0C(&this->actor)) {
Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos,
KUSA_GET_RAND_COLLECTIBLE_ID(&this->actor) * 0x10);
}
} else if (GET_KUSA_TYPE(&this->actor) == ENKUSA_TYPE_REGROWING_GRASS) {
} else if (KUSA_GET_TYPE(&this->actor) == ENKUSA_TYPE_REGROWING_GRASS) {
Item_DropCollectible(play, &this->actor.world.pos, 3);
} else {
collectible = func_800A8150(KUSA_GET_PARAMS_3F(&this->actor));
@ -362,7 +362,7 @@ void EnKusa_InitCollider(Actor* thisx, PlayState* play) {
void EnKusa_Init(Actor* thisx, PlayState* play) {
EnKusa* this = THIS;
s32 pad;
s32 kusaType = GET_KUSA_TYPE(&this->actor);
s32 kusaType = KUSA_GET_TYPE(&this->actor);
Actor_ProcessInitChain(&this->actor, sInitChain);
@ -393,7 +393,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) {
this->isInWater |= 1;
}
this->objIndex = Object_GetIndex(&play->objectCtx, objectIds[(GET_KUSA_TYPE(&this->actor))]);
this->objIndex = Object_GetIndex(&play->objectCtx, objectIds[(KUSA_GET_TYPE(&this->actor))]);
if (this->objIndex < 0) {
Actor_MarkForDeath(&this->actor);
return;
@ -429,7 +429,7 @@ void EnKusa_WaitObject(EnKusa* this, PlayState* play) {
s32 pad;
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
s32 kusaType = GET_KUSA_TYPE(&this->actor);
s32 kusaType = KUSA_GET_TYPE(&this->actor);
if (this->isCut) {
EnKusa_SetupCut(this);
@ -466,11 +466,11 @@ void EnKusa_WaitForInteract(EnKusa* this, PlayState* play) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN);
if (KUSA_SHOULD_SPAWN_BUGS(&this->actor)) {
if (GET_KUSA_TYPE(&this->actor) != ENKUSA_TYPE_GRASS_2) {
if (KUSA_GET_TYPE(&this->actor) != ENKUSA_TYPE_GRASS_2) {
EnKusa_SpawnBugs(this, play);
}
}
if (GET_KUSA_TYPE(&this->actor) == ENKUSA_TYPE_BUSH) {
if (KUSA_GET_TYPE(&this->actor) == ENKUSA_TYPE_BUSH) {
Actor_MarkForDeath(&this->actor);
} else {
EnKusa_SetupCut(this);
@ -489,7 +489,7 @@ void EnKusa_WaitForInteract(EnKusa* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 400.0f) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
if (this->actor.xzDistToPlayer < 100.0f) {
if (GET_KUSA_TYPE(&this->actor) != ENKUSA_TYPE_GRASS_2) {
if (KUSA_GET_TYPE(&this->actor) != ENKUSA_TYPE_GRASS_2) {
Actor_LiftActor(&this->actor, play);
}
}
@ -558,7 +558,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) {
}
EnKusa_SpawnFragments(this, play);
EnKusa_DropCollectible(this, play);
switch (GET_KUSA_TYPE(&this->actor)) {
switch (KUSA_GET_TYPE(&this->actor)) {
case ENKUSA_TYPE_BUSH:
case ENKUSA_TYPE_GRASS:
Actor_MarkForDeath(&this->actor);
@ -611,7 +611,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) {
}
void EnKusa_SetupCut(EnKusa* this) {
switch (GET_KUSA_TYPE(&this->actor)) {
switch (KUSA_GET_TYPE(&this->actor)) {
case ENKUSA_TYPE_GRASS:
case ENKUSA_TYPE_GRASS_2:
this->actionFunc = EnKusa_DoNothing;

View File

@ -34,6 +34,6 @@ extern const ActorInit En_Kusa_InitVars;
#define KUSA_GET_PARAMS_3F(thisx) (((thisx)->params >> 0x2) & 0x3F)
#define GET_KUSA_TYPE(thisx)((thisx)->params & 0x3)
#define KUSA_GET_TYPE(thisx)((thisx)->params & 0x3)
#endif // Z_EN_KUSA_H

View File

@ -9,8 +9,8 @@ struct EnKusa2UnkBssSubStruct;
typedef void (*EnKusa2ActionFunc)(struct EnKusa2*, PlayState*);
typedef void (*EnKusa2BssFunc)(struct EnKusa2UnkBssSubStruct*);
#define ENKUSA2_GET_1(thisx) (((thisx)->params) & 1)
#define ENKUSA2_GET_7F00(thisx) (u8)((((thisx)->params) >> 8) & 0x7F)
#define ENKUSA2_GET_1(thisx) ((thisx)->params & 1)
#define ENKUSA2_GET_7F00(thisx) (u8)(((thisx)->params >> 8) & 0x7F)
typedef struct EnKusa2UnkBssSubStruct {
/* 0x00 */ Vec3f unk_00;

View File

@ -161,7 +161,7 @@ void EnMaYto_Init(Actor* thisx, PlayState* play) {
this->unk31E = 0;
this->blinkTimer = 100;
this->type = EN_MA_YTO_PARSE_TYPE(this->actor.params);
this->type = EN_MA_YTO_GET_TYPE(&this->actor);
if (!EnMaYto_CheckValidSpawn(this, play)) {
Actor_MarkForDeath(&this->actor);
return;
@ -304,7 +304,7 @@ s32 EnMaYto_SearchRomani(EnMaYto* this, PlayState* play) {
while (npcActor != NULL) {
if (npcActor->id == ACTOR_EN_MA_YTS) {
EnMaYts* romani = (EnMaYts*)npcActor;
s16 romaniType = EN_MA_YTS_PARSE_TYPE(&romani->actor);
s16 romaniType = EN_MA_YTS_GET_TYPE(&romani->actor);
if ((this->type == MA_YTO_TYPE_DINNER && romaniType == MA_YTS_TYPE_SITTING) ||
(this->type == MA_YTO_TYPE_BARN && romaniType == MA_YTS_TYPE_BARN)) {

View File

@ -40,7 +40,7 @@ typedef enum {
/* 4 */ MA_YTO_TYPE_4 // HugCutscene? Doesn't seem to work properly in-game
} EnMaYtoType;
#define EN_MA_YTO_PARSE_TYPE(params) (((params)&0xF000) >> 12)
#define EN_MA_YTO_GET_TYPE(thisx) (((thisx)->params & 0xF000) >> 12)
#define EN_MA_YTO_PARAM(enMaYtsType, arg1) (((enMaYtsType) << 12) | ((arg1) << 8))
#endif // Z_EN_MA_YTO_H

View File

@ -218,7 +218,7 @@ void EnMaYts_Init(Actor* thisx, PlayState* play) {
EnMaYts* this = THIS;
s32 pad;
this->type = EN_MA_YTS_PARSE_TYPE(thisx);
this->type = EN_MA_YTS_GET_TYPE(thisx);
if (!EnMaYts_CheckValidSpawn(this, play)) {
Actor_MarkForDeath(&this->actor);
}

View File

@ -16,16 +16,16 @@ typedef struct EnMaYts {
/* 0x1D8 */ struct_800BD888_arg1 unk_1D8;
/* 0x200 */ s32 unk_200; // Set, but not used
/* 0x204 */ Vec3s jointTable[ROMANI_LIMB_MAX];
/* 0x28E */ char unk_28E[0x6];
/* 0x28E */ UNK_TYPE1 unk_28E[0x6];
/* 0x294 */ Vec3s morphTable[ROMANI_LIMB_MAX];
/* 0x31E */ char unk_31E[0x8];
/* 0x31E */ UNK_TYPE1 unk_31E[0x8];
/* 0x326 */ s16 blinkTimer;
/* 0x328 */ s16 overrideEyeTexIndex; // If non-zero, then this index will be used instead of eyeTexIndex
/* 0x32A */ s16 eyeTexIndex;
/* 0x32C */ s16 unk_32C; // flag?
/* 0x32E */ s16 mouthTexIndex;
/* 0x330 */ s16 type;
/* 0x332 */ char unk_332[0x2];
/* 0x332 */ UNK_TYPE1 unk_332[0x2];
/* 0x334 */ s16 endCreditsFlag;
/* 0x336 */ s16 hasBow;
/* 0x338 */ u16 textId;
@ -40,7 +40,7 @@ typedef enum {
/* 3 */ MA_YTS_TYPE_ENDCREDITS
} EnMaYtsType;
#define EN_MA_YTS_PARSE_TYPE(actor) ((((actor)->params)&0xF000) >> 12)
#define EN_MA_YTS_GET_TYPE(thisx) (((thisx)->params & 0xF000) >> 12)
#define EN_MA_YTS_PARAM(enMaYtsType) ((enMaYtsType) << 12)
/**

View File

@ -365,7 +365,7 @@ void func_80959C94(EnMk* this, PlayState* play) {
Message_StartTextbox(play, 0xFB3, &this->actor);
} else {
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, play, 350.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 350.0f, 1000.0f, PLAYER_AP_MINUS1);
}
}

View File

@ -149,7 +149,7 @@ void EnMs_Talk(EnMs* this, PlayState* play) {
void EnMs_Sell(EnMs* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
this->actor.textId = 0;
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE);
this->actionFunc = EnMs_TalkAfterPurchase;
} else {
Actor_PickUp(&this->actor, play, GI_MAGIC_BEANS, this->actor.xzDistToPlayer, this->actor.playerHeightRel);
@ -161,7 +161,7 @@ void EnMs_TalkAfterPurchase(EnMs* this, PlayState* play) {
func_80151938(play, 0x936); // "You can plant 'em whenever you want [...]"
this->actionFunc = EnMs_Talk;
} else {
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, -1);
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_MINUS1);
}
}

View File

@ -606,7 +606,7 @@ void func_80B5CB0C(EnOt* this, PlayState* play) {
void func_80B5CBA0(EnOt* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE);
this->actionFunc = func_80B5CBEC;
}
@ -617,7 +617,7 @@ void func_80B5CBEC(EnOt* this, PlayState* play) {
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E);
this->actor.world.rot.y = this->actor.shape.rot.y;
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE);
}
}
@ -693,7 +693,7 @@ void func_80B5CEC8(EnOt* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E);
if (this->unk_32C & 0x800) {
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE);
} else {
this->actor.flags &= ~ACTOR_FLAG_10000;
if ((player->actor.bgCheckFlags & 1) && !func_801242B4(player) && (this->actor.xzDistToPlayer < 130.0f)) {

View File

@ -129,7 +129,7 @@ void EnPoFusen_Init(Actor* thisx, PlayState* play) {
this->limb9Rot = 0x71C;
this->randBaseRotChange = 0;
if (GET_IS_FUSE_TYPE_PARAM(&this->actor)) {
if (ENPOFUSEN_IS_FUSE_TYPE(&this->actor)) {
EnPoFusen_InitFuse(this);
return;
}
@ -147,7 +147,7 @@ u16 EnPoFusen_CheckParent(EnPoFusen* this, PlayState* play) {
Actor* actorPtr;
actorPtr = play->actorCtx.actorLists[ACTORCAT_NPC].first;
if (GET_IS_FUSE_TYPE_PARAM(&this->actor)) {
if (ENPOFUSEN_IS_FUSE_TYPE(&this->actor)) {
return true;
}
@ -168,7 +168,7 @@ u16 EnPoFusen_CheckCollision(EnPoFusen* this, PlayState* play) {
}
this->collider.dim.worldSphere.center.x = this->actor.world.pos.x;
this->collider.dim.worldSphere.center.y = (this->actor.world.pos.y + 20.0f);
this->collider.dim.worldSphere.center.y = this->actor.world.pos.y + 20.0f;
this->collider.dim.worldSphere.center.z = this->actor.world.pos.z;
if ((this->collider.base.acFlags & AC_HIT) && (this->actor.colChkInfo.damageEffect == 0xF)) {
@ -243,7 +243,7 @@ void EnPoFusen_Pop(EnPoFusen* this, PlayState* play) {
void EnPoFusen_InitFuse(EnPoFusen* this) {
s16 rotZ = this->actor.shape.rot.z;
this->fuse = GET_FUSE_LEN_PARAM(&this->actor);
this->fuse = ENPOFUSEN_GET_FUSE_LEN(&this->actor);
this->actor.shape.rot.z = 0;
this->randScaleChange = rotZ & 0xFFFF;
this->actionFunc = EnPoFusen_IdleFuse;

View File

@ -5,8 +5,8 @@
struct EnPoFusen;
#define GET_FUSE_LEN_PARAM(thisx) ((thisx)->params & 0x3FF)
#define GET_IS_FUSE_TYPE_PARAM(thisx) ((thisx)->params & 0x8000)
#define ENPOFUSEN_GET_FUSE_LEN(thisx) ((thisx)->params & 0x3FF)
#define ENPOFUSEN_IS_FUSE_TYPE(thisx) ((thisx)->params & 0x8000)
typedef void (*EnPoFusenActionFunc)(struct EnPoFusen*, PlayState*);

View File

@ -275,7 +275,7 @@ void func_80B67348(EnSth* this, PlayState* play) {
}
Message_StartTextbox(play, phi_a1, &this->actor);
} else {
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
}
}
@ -286,7 +286,7 @@ void func_80B67458(EnSth* this, PlayState* play) {
this->actor.parent = NULL;
this->actionFunc = func_80B67348;
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
if (CURRENT_DAY == 3) {
func_80B670A4(this, 6);
} else {
@ -470,7 +470,7 @@ void func_80B67AB4(EnSth* this, PlayState* play) {
gSaveContext.save.weekEventReg[34] |= 0x40;
Message_StartTextbox(play, 0x918, &this->actor);
} else {
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
}
}
@ -481,7 +481,7 @@ void func_80B67B50(EnSth* this, PlayState* play) {
this->actor.parent = NULL;
this->actionFunc = func_80B67AB4;
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
} else {
this->unk_29C &= ~1;
gSaveContext.save.weekEventReg[34] |= 8;

View File

@ -7,7 +7,7 @@ struct EnTagObj;
typedef struct EnTagObj {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x50];
/* 0x144 */ UNK_TYPE1 unk_144[0x50];
/* 0x194 */ s32 hasSpawnedSeahorse;
} EnTagObj; // size = 0x198

View File

@ -9,7 +9,7 @@ typedef void (*EnTanron6ActionFunc)(struct EnTanron6*, PlayState*);
typedef struct EnTanron6 {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0xBC];
/* 0x144 */ UNK_TYPE1 unk_144[0xBC];
/* 0x200 */ EnTanron6ActionFunc actionFunc;
} EnTanron6; // size = 0x204

View File

@ -699,7 +699,7 @@ void func_80AED940(EnTk* this, PlayState* play) {
func_8013E8F8(&this->actor, play, 100.0f, 100.0f, PLAYER_AP_NONE, 0x4000, 0x4000);
}
} else {
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE);
}
}

View File

@ -10,7 +10,7 @@ typedef void (*EnTsnActionFunc)(struct EnTsn*, PlayState*);
#define ENTSN_GET_F(thisx) ((thisx)->params & 0xF)
#define ENTSN_GET_100(thisx) ((thisx)->params & 0x100)
#define ENTSN_GET_Z(thisx) ((thisx)->home.rot.z)
#define ENTSN_SET_Z(thisx, state) ((thisx)->home.rot.z = state)
#define ENTSN_SET_Z(thisx, state) ((thisx)->home.rot.z = (state))
#define ENTSN_F_0 0
#define ENTSN_F_1 1

View File

@ -51,10 +51,10 @@ void EnWarptag_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
Actor_SetFocus(&this->dyna.actor, 0.0f);
if (GET_WARPTAG_3C0_MAX(thisx) == WARPTAG_3C0_MAX) {
if (WARPTAG_GET_3C0_MAX(thisx) == WARPTAG_3C0_MAX) {
this->dyna.actor.flags &= ~ACTOR_FLAG_1;
if (GET_WARPTAG_INVISIBLE(&this->dyna.actor)) {
if (WARPTAG_GET_INVISIBLE(&this->dyna.actor)) {
this->actionFunc = EnWarpTag_WaitForPlayer;
} else {
@ -93,7 +93,7 @@ void EnWarpTag_CheckDungeonKeepObject(EnWarptag* this, PlayState* play) {
void EnWarpTag_WaitForPlayer(EnWarptag* this, PlayState* play) {
if (!Player_InCsMode(play) && (this->dyna.actor.xzDistToPlayer <= 30.0f) &&
(this->dyna.actor.playerHeightRel <= 10.0f)) {
if (GET_WARPTAG_INVISIBLE(&this->dyna.actor)) {
if (WARPTAG_GET_INVISIBLE(&this->dyna.actor)) {
func_800B7298(play, NULL, 0x51);
this->actionFunc = EnWarpTag_GrottoReturn;
} else {
@ -112,8 +112,8 @@ void EnWarpTag_Unused809C09A0(EnWarptag* this, PlayState* play) {
// this actor doesnt have that flag set default, or in init, and this is called shortly after init
// and I doubt its set externally by another actor, so I believe this is unused
// might be a bug, they might have meant to set actor flag (0x2000 0000) up above but mistyped (0x200 0000)
// also GET_WARPTAG_3C0 should always return 2C0 -> 0xF for all known in-game uses, which is OOB
func_80152434(play, D_809C1000[GET_WARPTAG_3C0(&this->dyna.actor)]); // unk message function
// also WARPTAG_GET_3C0 should always return 2C0 -> 0xF for all known in-game uses, which is OOB
func_80152434(play, D_809C1000[WARPTAG_GET_3C0(&this->dyna.actor)]); // unk message function
this->actionFunc = EnWarpTag_Unused809C0A20;
} else {
@ -180,7 +180,7 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
player->actor.gravity = -0.5f;
if (this->dyna.actor.playerHeightRel < -80.0f) {
playerSpawnIndexPerForm[PLAYER_FORM_FIERCE_DEITY] = GET_WARPTAG_EXIT_INDEX(&this->dyna.actor);
playerSpawnIndexPerForm[PLAYER_FORM_FIERCE_DEITY] = WARPTAG_GET_EXIT_INDEX(&this->dyna.actor);
playerSpawnIndexPerForm[PLAYER_FORM_HUMAN] = playerSpawnIndexPerForm[PLAYER_FORM_FIERCE_DEITY];
playerSpawnIndexPerForm[PLAYER_FORM_GORON] = this->dyna.actor.world.rot.x;
playerSpawnIndexPerForm[PLAYER_FORM_ZORA] = this->dyna.actor.world.rot.y;
@ -200,7 +200,7 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
newRespawnPos.y = playerActorEntry->pos.y;
newRespawnPos.z = playerActorEntry->pos.z;
if (GET_WARPTAG_3C0_MAX(&this->dyna.actor) == WARPTAG_3C0_MAX) {
if (WARPTAG_GET_3C0_MAX(&this->dyna.actor) == WARPTAG_3C0_MAX) {
playerParams = 0x9FF;
} else { // not used by any known variant
playerParams = 0x8FF;
@ -241,7 +241,7 @@ void EnWarpTag_GrottoReturn(EnWarptag* this, PlayState* play) {
}
if (this->grottoExitDelay++ == 10) {
play->nextEntrance = play->setupExitList[GET_WARPTAG_EXIT_INDEX(&this->dyna.actor)];
play->nextEntrance = play->setupExitList[WARPTAG_GET_EXIT_INDEX(&this->dyna.actor)];
Scene_SetExitFade(play);
play->transitionTrigger = TRANS_TRIGGER_START;
func_8019F128(NA_SE_OC_SECRET_HOLE_OUT);

View File

@ -24,10 +24,10 @@ extern const ActorInit En_Warp_tag_InitVars;
// Goron Trial (MOON): 0x03C1
// Deku Playground: 0x83C0
#define GET_WARPTAG_3C0_MAX(thisx) ((thisx)->params & 0x3C0)
#define GET_WARPTAG_3C0(thisx) (((thisx)->params >> 6) & 0xF)
#define GET_WARPTAG_EXIT_INDEX(thisx) ((thisx)->params & 0x3F)
#define GET_WARPTAG_INVISIBLE(thisx) ((thisx)->params < 0) // 0x8000 flag
#define WARPTAG_GET_3C0_MAX(thisx) ((thisx)->params & 0x3C0)
#define WARPTAG_GET_3C0(thisx) (((thisx)->params >> 6) & 0xF)
#define WARPTAG_GET_EXIT_INDEX(thisx) ((thisx)->params & 0x3F)
#define WARPTAG_GET_INVISIBLE(thisx) ((thisx)->params < 0) // 0x8000 flag
#define WARPTAG_3C0_MAX 0x3C0

View File

@ -69,7 +69,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) {
// flag: is targetable. Should do nothing as not set by default above
this->actor.flags &= ~ACTOR_FLAG_1;
switch (WEATHER_TAG_TYPE(this)) {
switch (WEATHER_TAG_TYPE(&this->actor)) {
case WEATHERTAG_TYPE_UNK0:
this->unk154 = 0;
this->fadeDistance = this->actor.world.rot.x;
@ -101,7 +101,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) {
EnWeatherTag_SetupAction(this, func_80966BF4);
break;
case WEATHERTAG_TYPE_WATERMURK:
pathID = WEATHER_TAG_PATHID(this);
pathID = WEATHER_TAG_PATHID(&this->actor);
path = &play->setupPathList[pathID];
this->pathPoints = Lib_SegmentedToVirtual(path->points);
this->pathCount = path->count;
@ -119,7 +119,7 @@ u8 func_80966608(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4,
Player* player = GET_PLAYER(play);
u8 returnVal = 0;
if (WEATHER_TAG_RANGE100(this) > Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) {
if (WEATHER_TAG_RANGE100(&this->actor) > Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) {
if (play->envCtx.unk_1F == play->envCtx.unk_20) {
D_801BDBB8 = 1;
if (!(play->envCtx.unk_1E == 0) || ((play->envCtx.unk_1F != 1) && (play->envCtx.unk_21 == 0))) {
@ -147,7 +147,7 @@ u8 func_80966758(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4,
Player* player = GET_PLAYER(play);
u8 returnVal = 0;
if (WEATHER_TAG_RANGE100(this) < Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) {
if (WEATHER_TAG_RANGE100(&this->actor) < Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) {
if (play->envCtx.unk_1F == play->envCtx.unk_20) {
D_801BDBB8 = 1;
if (!(play->envCtx.unk_1E == 0) || ((play->envCtx.unk_1F != 1) && (play->envCtx.unk_21 == 0))) {
@ -199,7 +199,7 @@ void func_8096689C(EnWeatherTag* this, PlayState* play) {
// WEATHERTAG_TYPE_UNK0
void func_80966A08(EnWeatherTag* this, PlayState* play) {
this->unk154 += this->unk158;
if (this->unk154 >= 0x8001) {
if (this->unk154 > 0x8000) {
this->unk154 = 0x8000;
EnWeatherTag_SetupAction(this, func_80966A68);
}
@ -346,7 +346,7 @@ void func_80966F74(EnWeatherTag* this, PlayState* play) {
// all of them have shorter distances though, like 0xA and 0x6, so their locations are important
void func_80966FEC(EnWeatherTag* this, PlayState* play) {
// weirdly, not the same as the other param lookup used in the rest of the file, which is float
s32 distance = WEATHER_TAG_RANGE100INT(this);
s32 distance = WEATHER_TAG_RANGE100INT(&this->actor);
if (distance > 0) {
D_801F4E7A = distance;
}
@ -424,7 +424,7 @@ void func_809672DC(EnWeatherTag* this, PlayState* play) {
&this->actor.world.pos, false);
distance = Actor_XZDistanceBetweenActors(&player->actor, &this->actor);
range = WEATHER_TAG_RANGE100(this);
range = WEATHER_TAG_RANGE100(&this->actor);
if (distance < range) {
play->envCtx.sandstormState = 6;
@ -448,7 +448,7 @@ void func_809672DC(EnWeatherTag* this, PlayState* play) {
void func_809674C8(EnWeatherTag* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (Actor_XZDistanceBetweenActors(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(this)) {
if (Actor_XZDistanceBetweenActors(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(&this->actor)) {
if (CURRENT_DAY == 2) {
if ((gSaveContext.save.time >= CLOCK_TIME(7, 0)) && (gSaveContext.save.time < CLOCK_TIME(17, 30)) &&
(play->envCtx.unk_F2[2] == 0)) {
@ -471,7 +471,8 @@ void func_809674C8(EnWeatherTag* this, PlayState* play) {
// WEATHERTAG_TYPE_LOCALDAY2RAIN 2
void func_80967608(EnWeatherTag* this, PlayState* play) {
if ((WEATHER_TAG_RANGE100(this) + 10.0f) < Actor_XZDistanceBetweenActors(&GET_PLAYER(play)->actor, &this->actor)) {
if ((WEATHER_TAG_RANGE100(&this->actor) + 10.0f) <
Actor_XZDistanceBetweenActors(&GET_PLAYER(play)->actor, &this->actor)) {
gWeatherMode = 0;
EnWeatherTag_SetupAction(this, func_809674C8);
}

View File

@ -21,10 +21,10 @@ typedef struct EnWeatherTag {
extern const ActorInit En_Weather_Tag_InitVars;
#define WEATHER_TAG_TYPE(x) (x->actor.params & 0xF)
#define WEATHER_TAG_PATHID(x) (x->actor.params >> 4 & 0xF)
#define WEATHER_TAG_RANGE100(x) ((u8)(((x->actor.params >> 8) & 0xFF)) * 100.0f)
#define WEATHER_TAG_RANGE100INT(x) ((u8)(((x->actor.params >> 8))) * 100)
#define WEATHER_TAG_TYPE(thisx) ((thisx)->params & 0xF)
#define WEATHER_TAG_PATHID(thisx) (((thisx)->params >> 4) & 0xF)
#define WEATHER_TAG_RANGE100(thisx) ((u8)(((thisx)->params >> 8) & 0xFF) * 100.0f)
#define WEATHER_TAG_RANGE100INT(thisx) ((u8)(((thisx)->params >> 8) & 0xFF) * 100)
typedef enum {
/* 0 */ WEATHERTAG_TYPE_UNK0,

View File

@ -263,7 +263,7 @@ void EnYb_SetupLeaving(EnYb* this, PlayState* play) {
Message_StartTextbox(play, 0x147D, &this->actor);
func_80BFA2FC(play);
} else {
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
}
EnYb_EnableProximityMusic(this);
}
@ -275,7 +275,7 @@ void EnYb_ReceiveMask(EnYb* this, PlayState* play) {
this->actor.parent = NULL;
this->actionFunc = EnYb_SetupLeaving;
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
} else {
Actor_PickUp(&this->actor, play, GI_MASK_KAMARO, 10000.0f, 100.0f);
}
@ -326,7 +326,7 @@ void EnYb_TeachingDanceFinish(EnYb* this, PlayState* play) {
Message_StartTextbox(play, 0x147C, &this->actor);
this->actor.flags &= ~ACTOR_FLAG_10000;
} else {
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
}
EnYb_EnableProximityMusic(this);
}
@ -341,7 +341,7 @@ void EnYb_TeachingDance(EnYb* this, PlayState* play) {
EnYb_FinishTeachingCutscene(this);
this->actionFunc = EnYb_TeachingDanceFinish;
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
}
EnYb_EnableProximityMusic(this);
}

View File

@ -227,7 +227,7 @@ void func_80BBB2C4(EnZos* this, PlayState* play) {
this->actionFunc = func_80BBB8AC;
this->actor.flags &= ~ACTOR_FLAG_10000;
} else {
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
}
}
@ -239,7 +239,7 @@ void func_80BBB354(EnZos* this, PlayState* play) {
this->actionFunc = func_80BBB2C4;
gSaveContext.save.weekEventReg[39] |= 0x20;
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
} else {
if (gSaveContext.save.weekEventReg[39] & 0x20) {
getItemId = GI_RUPEE_PURPLE;
@ -498,7 +498,7 @@ void func_80BBBCBC(EnZos* this, PlayState* play) {
Message_StartTextbox(play, 0x124D, &this->actor);
this->actionFunc = func_80BBB574;
} else {
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
}
}
@ -507,7 +507,7 @@ void func_80BBBD5C(EnZos* this, PlayState* play) {
if (!Cutscene_CheckActorAction(play, 0x1F5)) {
this->actionFunc = func_80BBBCBC;
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, -1);
func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1);
}
}

View File

@ -7,7 +7,7 @@ struct ItemBHeart;
typedef struct ItemBHeart {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x20];
/* 0x144 */ UNK_TYPE1 unk_144[0x20];
/* 0x164 */ f32 unk_164;
/* 0x168 */ f32 unk_168;
} ItemBHeart; // size = 0x16C

View File

@ -14,10 +14,10 @@ typedef struct ObjBell {
/* 0x210 */ s16 unk_210;
/* 0x212 */ s16 unk_212;
/* 0x214 */ s16 unk_214;
/* 0x216 */ char unk_216[0x06];
/* 0x216 */ UNK_TYPE1 unk_216[0x06];
/* 0x21C */ f32 unk_21C; // bell speed?
/* 0x220 */ f32 unk_220;
/* 0x224 */ char unk_224[0x04];
/* 0x224 */ UNK_TYPE1 unk_224[0x04];
} ObjBell; // size = 0x228
extern const ActorInit Obj_Bell_InitVars;

View File

@ -231,7 +231,7 @@ void ObjChan_ChandelierAction(ObjChan* this2, PlayState* play) {
}
this->actor.shape.rot.z = (Math_SinS(this->unk1D4) * this->unk1D0);
if ((this->stateFlags & OBJCHAN_STATE_START_CUTSCENE) &&
SubS_StartActorCutscene(&this->actor, this->cutscenes[0], -1, 0)) {
SubS_StartActorCutscene(&this->actor, this->cutscenes[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
this->stateFlags |= OBJCHAN_STATE_CUTSCENE;
this->stateFlags &= ~OBJCHAN_STATE_START_CUTSCENE;
}

View File

@ -10,7 +10,7 @@ typedef void (*ObjGhakaActionFunc)(struct ObjGhaka*, PlayState*);
typedef struct ObjGhaka {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ ObjGhakaActionFunc actionFunc;
/* 0x160 */ char unk160[0x8];
/* 0x160 */ UNK_TYPE1 unk160[0x8];
/* 0x168 */ s16 unk_168;
} ObjGhaka; // size = 0x16C

View File

@ -213,7 +213,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) {
D_80B9DED0 = Lib_SegmentedToVirtual(object_hunsui_Matanimheader_000BF0);
D_80B9DED4 = Lib_SegmentedToVirtual(object_hunsui_Matanimheader_001888);
SubS_FillCutscenesList(&this->dyna.actor, &this->unk_170, 1);
SubS_FillCutscenesList(&this->dyna.actor, this->unk_170, ARRAY_COUNT(this->unk_170));
this->unk_18C = 0;
switch (this->unk_160) {
@ -326,7 +326,8 @@ void ObjHunsui_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if ((this->unk_172 & 0x40) && SubS_StartActorCutscene(&this->dyna.actor, this->unk_17C, -1, 0)) {
if ((this->unk_172 & 0x40) &&
SubS_StartActorCutscene(&this->dyna.actor, this->unk_17C, -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
this->unk_172 &= ~0x40;
}
@ -354,7 +355,7 @@ void func_80B9CE64(ObjHunsui* this, PlayState* play) {
if (!(this->unk_172 & 1)) {
if (sp2C != this->unk_180) {
this->unk_17C = this->unk_170;
this->unk_17C = this->unk_170[0];
this->unk_172 |= 0x40;
}
}
@ -446,7 +447,7 @@ void func_80B9D120(ObjHunsui* this, PlayState* play) {
}
if (func_80B9C450(play, this->unk_168, this->unk_164)) {
this->unk_17C = this->unk_170;
this->unk_17C = this->unk_170[0];
this->unk_172 |= 0x40;
func_80B9D4D0(this, play);
}
@ -559,7 +560,7 @@ void func_80B9D508(ObjHunsui* this, PlayState* play) {
}
if (!(this->unk_172 & 1) && !func_80B9C450(play, this->unk_168, this->unk_164)) {
this->unk_17C = this->unk_170;
this->unk_17C = this->unk_170[0];
this->unk_172 |= 0x40;
func_80B9D0FC(this, play);
}

View File

@ -31,7 +31,7 @@ typedef struct ObjHunsui {
/* 0x16C */ s8 unk_16C;
/* 0x16D */ s8 unk_16D;
/* 0x16E */ s8 unk_16E;
/* 0x170 */ s16 unk_170;
/* 0x170 */ s16 unk_170[1];
/* 0x172 */ u16 unk_172;
/* 0x174 */ f32 unk_174;
/* 0x178 */ f32 unk_178;

View File

@ -914,7 +914,7 @@ void ObjIceblock_Init(Actor* thisx, PlayState* play) {
this->dyna.actor.world.rot.z = 0;
this->dyna.actor.home.rot.x = 0;
this->dyna.actor.home.rot.z = 0;
if (!GET_ICEBLOCK_SNAP_ROT(&this->dyna.actor)) {
if (!ICEBLOCK_GET_SNAP_ROT(&this->dyna.actor)) {
this->dyna.actor.shape.rot.y = (this->dyna.actor.shape.rot.y + 0x2000) & 0xC000;
this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y;
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y;
@ -926,7 +926,7 @@ void ObjIceblock_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit);
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor)) {
this->collider.dim.yShift = -100;
this->collider.dim.height = 126;
this->collider.dim.radius = 29;
@ -948,7 +948,7 @@ void ObjIceblock_Init(Actor* thisx, PlayState* play) {
}
}
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor)) {
this->unk_2B4 = -1.0f;
}
@ -997,7 +997,7 @@ void func_80A2586C(ObjIceblock* this, PlayState* play) {
if (Math_StepToF(&this->dyna.actor.scale.x, 0.1f, 0.02f)) {
Actor_SetScale(&this->dyna.actor, 0.1f);
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor)) {
this->unk_2B4 = 0.05f;
}
func_80A25978(this);
@ -1030,7 +1030,7 @@ void func_80A25994(ObjIceblock* this, PlayState* play) {
if (this->dyna.actor.flags & ACTOR_FLAG_40) {
func_80A2339C(play, &this->dyna.actor.world.pos, this->dyna.actor.scale.x, 1.2f, 15);
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor)) {
sp30.x = this->dyna.actor.world.pos.x;
sp30.y = this->dyna.actor.world.pos.y - 30.0f;
sp30.z = this->dyna.actor.world.pos.z;
@ -1038,7 +1038,7 @@ void func_80A25994(ObjIceblock* this, PlayState* play) {
}
}
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor)) {
this->unk_2B4 = 0.1f;
}
@ -1074,7 +1074,7 @@ void func_80A25AA8(ObjIceblock* this, PlayState* play) {
this->dyna.actor.shape.yOffset = 300.0f;
this->unk_248.y += sp24;
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor)) {
this->collider.dim.yShift = -69;
} else {
this->collider.dim.yShift = 0;
@ -1400,7 +1400,7 @@ void func_80A266E0(ObjIceblock* this, PlayState* play) {
actor->scale.z = actor->scale.x;
}
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor)) {
this->unk_2B4 = actor->scale.y;
this->collider.dim.height = (s32)(actor->scale.y * 1230.0f) + 1;
this->collider.dim.yShift = actor->scale.y * -1000.0f;
@ -1483,7 +1483,7 @@ void ObjIceblock_Update(Actor* thisx, PlayState* play) {
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
if (this->unk_1B0 & 0x10) {
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) {
this->collider.base.ocFlags1 &= ~OC1_NO_PUSH;
this->collider.base.ocFlags1 |= (OC1_TYPE_2 | OC1_TYPE_1 | OC1_TYPE_PLAYER);
this->collider.info.bumper.dmgFlags |=
@ -1511,7 +1511,7 @@ void func_80A26B64(ObjIceblock* this, PlayState* play) {
// draw func
void func_80A26B74(ObjIceblock* this, PlayState* play) {
Gfx_DrawDListXlu(play, gIceBlockCubeDL);
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) {
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(gIceBlockIceBergSublimatingAirTexAnim));
Gfx_DrawDListXlu(play, gIceBlockIceBergDL);
}
@ -1541,7 +1541,7 @@ void func_80A26BF8(ObjIceblock* this, PlayState* play) {
gSPDisplayList(POLY_XLU_DISP++, gIceBlockCubeDL);
}
if (GET_ICEBLOCK_ICEBERG(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) {
if (ICEBLOCK_GET_ICEBERG(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) {
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(gIceBlockIceBergSublimatingAirTexAnim));
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y - 20.0f,
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);

View File

@ -8,8 +8,8 @@ struct ObjIceblock;
typedef void (*ObjIceblockActionFunc)(struct ObjIceblock*, PlayState*);
typedef void (*ObjIceblockExtendedDrawFunc)(struct ObjIceblock*, PlayState*);
#define GET_ICEBLOCK_SNAP_ROT(thisx) (((thisx)->params >> 1) & 1)
#define GET_ICEBLOCK_ICEBERG(thisx) ((thisx)->params & 1)
#define ICEBLOCK_GET_SNAP_ROT(thisx) (((thisx)->params >> 1) & 1)
#define ICEBLOCK_GET_ICEBERG(thisx) ((thisx)->params & 1)
typedef struct {
/* 0x00 */ s16 unk_00;

View File

@ -100,9 +100,9 @@ void ObjLightswitch_UpdateSwitchFlags(ObjLightswitch* this, PlayState* play, s32
if (this) {}
if (set) {
Flags_SetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(&this->actor));
Flags_SetSwitch(play, LIGHTSWITCH_GET_SWITCHFLAG(&this->actor));
} else {
Flags_UnsetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(&this->actor));
Flags_UnsetSwitch(play, LIGHTSWITCH_GET_SWITCHFLAG(&this->actor));
}
}
@ -150,13 +150,13 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) {
u32 isSwitchActivated;
s32 isTriggered;
isSwitchActivated = Flags_GetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(&this->actor));
isSwitchActivated = Flags_GetSwitch(play, LIGHTSWITCH_GET_SWITCHFLAG(&this->actor));
isTriggered = false;
Actor_ProcessInitChain(&this->actor, sInitChain);
Actor_SetFocus(&this->actor, 0.0f);
if (isSwitchActivated) {
if (GET_LIGHTSWITCH_TYPE(&this->actor) == LIGHTSWITCH_TYPE_FAKE) {
if (LIGHTSWITCH_GET_TYPE(&this->actor) == LIGHTSWITCH_TYPE_FAKE) {
isTriggered = true;
} else {
ObjLightSwitch_SetupEnabled(this);
@ -167,7 +167,7 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) {
ObjLightswitch_InitCollider(this, play);
if (GET_LIGHTSWITCH_INVISIBLE(&this->actor)) {
if (LIGHTSWITCH_GET_INVISIBLE(&this->actor)) {
// the stone tower exterior switch is part of the scene mesh, the actor is invisble on top
this->actor.draw = NULL;
}
@ -209,7 +209,7 @@ void ObjLightswitch_SetupIdle(ObjLightswitch* this) {
}
void ObjLightswitch_Idle(ObjLightswitch* this, PlayState* play) {
s32 actorType = GET_LIGHTSWITCH_TYPE(&this->actor);
s32 actorType = LIGHTSWITCH_GET_TYPE(&this->actor);
if (this->hitState >= 10) {
if (actorType == LIGHTSWITCH_TYPE_FAKE) {
@ -260,11 +260,11 @@ void ObjLightSwitch_SetupEnabled(ObjLightswitch* this) {
}
void ObjLightSwitch_Enabled(ObjLightswitch* this, PlayState* play) {
s32 actorType = GET_LIGHTSWITCH_TYPE(&this->actor);
s32 actorType = LIGHTSWITCH_GET_TYPE(&this->actor);
if (actorType == LIGHTSWITCH_TYPE_REGULAR) {
// switch can be disabled outside of this actor by flag
if (!Flags_GetSwitch(play, GET_LIGHTSWITCH_SWITCHFLAG(&this->actor))) {
if (!Flags_GetSwitch(play, LIGHTSWITCH_GET_SWITCHFLAG(&this->actor))) {
ObjLightSwitch_SetupDisabled(this);
}
} else if (actorType == LIGHTSWITCH_TYPE_FLIP) {
@ -329,7 +329,7 @@ void ObjLightswitch_Update(Actor* thisx, PlayState* play) {
// dmgFlags enum doesn't exist yet, 0x2000 is light arrows
if ((this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x2000) != 0) {
this->hitState = 10;
} else if (GET_LIGHTSWITCH_TYPE(&this->actor) == LIGHTSWITCH_TYPE_FLIP) {
} else if (LIGHTSWITCH_GET_TYPE(&this->actor) == LIGHTSWITCH_TYPE_FLIP) {
if (this->hitState == 0) {
if ((this->previousACFlags & AC_HIT) == 0) {
this->hitState = 1;
@ -438,7 +438,7 @@ void ObjLightswitch_Draw(Actor* thisx, PlayState* play) {
ObjLightswitch* this = THIS;
s32 alpha = (u8)(this->colorAlpha >> 6);
if ((GET_LIGHTSWITCH_TYPE(&this->actor) == LIGHTSWITCH_TYPE_FAKE) && (alpha > 0) && (alpha < 255)) {
if ((LIGHTSWITCH_GET_TYPE(&this->actor) == LIGHTSWITCH_TYPE_FAKE) && (alpha > 0) && (alpha < 255)) {
ObjLightSwitch_DrawXlu(this, play);
} else {
ObjLightSwitch_DrawOpa(this, play);

View File

@ -40,8 +40,8 @@ extern const ActorInit Obj_Lightswitch_InitVars;
#define LIGHTSWITCH_TYPE_UNK2 2
#define LIGHTSWITCH_TYPE_FAKE 3
#define GET_LIGHTSWITCH_TYPE(thisx) (((thisx)->params >> 4) & 0x3)
#define GET_LIGHTSWITCH_INVISIBLE(thisx) (((thisx)->params >> 3) & 1)
#define GET_LIGHTSWITCH_SWITCHFLAG(thisx) (((thisx)->params >> 8) & 0x7F)
#define LIGHTSWITCH_GET_TYPE(thisx) (((thisx)->params >> 4) & 0x3)
#define LIGHTSWITCH_GET_INVISIBLE(thisx) (((thisx)->params >> 3) & 1)
#define LIGHTSWITCH_GET_SWITCHFLAG(thisx) (((thisx)->params >> 8) & 0x7F)
#endif // Z_OBJ_LIGHTSWITCH_H

View File

@ -27,8 +27,8 @@ const ActorInit Obj_Makeoshihiki_InitVars = {
s32 ObjMakeoshihiki_GetChildSpawnPointIndex(ObjMakeoshihiki* this, PlayState* play) {
s32 pad;
s32 pathIndexOffset1 = Flags_GetSwitch(play, OBJMAKEOSHIHIKI_GET_SWITCHFLAG_1(this)) ? 1 : 0;
s32 pathIndexOffset2 = Flags_GetSwitch(play, OBJMAKEOSHIHIKI_GET_SWITCHFLAG_2(this)) ? 2 : 0;
s32 pathIndexOffset1 = Flags_GetSwitch(play, OBJMAKEOSHIHIKI_GET_SWITCHFLAG_1(&this->actor)) ? 1 : 0;
s32 pathIndexOffset2 = Flags_GetSwitch(play, OBJMAKEOSHIHIKI_GET_SWITCHFLAG_2(&this->actor)) ? 2 : 0;
return pathIndexOffset1 + pathIndexOffset2;
}
@ -39,8 +39,8 @@ void ObjMakeoshihiki_SetSwitchFlags(ObjMakeoshihiki* this, PlayState* play, s32
s32 switchFlag1;
s32 switchFlag2;
switchFlag2 = OBJMAKEOSHIHIKI_GET_SWITCHFLAG_2(this);
switchFlag1 = OBJMAKEOSHIHIKI_GET_SWITCHFLAG_1(this);
switchFlag2 = OBJMAKEOSHIHIKI_GET_SWITCHFLAG_2(&this->actor);
switchFlag1 = OBJMAKEOSHIHIKI_GET_SWITCHFLAG_1(&this->actor);
if (pathIndex & 2) {
Flags_SetSwitch(play, switchFlag2);
@ -61,7 +61,7 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play) {
Path* path;
s32 childPointIndex;
path = &play->setupPathList[OBJMAKEOSHIHIKI_GET_PATHLISTINDEX(this)];
path = &play->setupPathList[OBJMAKEOSHIHIKI_GET_PATHLISTINDEX(&this->actor)];
this->pathPoints = Lib_SegmentedToVirtual(path->points);
this->pathCount = path->count;
childPointIndex = ObjMakeoshihiki_GetChildSpawnPointIndex(this, play);

View File

@ -5,9 +5,9 @@
struct ObjMakeoshihiki;
#define OBJMAKEOSHIHIKI_GET_PATHLISTINDEX(this) (((this)->actor.params >> 7) & 0x7F)
#define OBJMAKEOSHIHIKI_GET_SWITCHFLAG_1(this) ((this)->actor.home.rot.z & 0x7F)
#define OBJMAKEOSHIHIKI_GET_SWITCHFLAG_2(this) ((this)->actor.params & 0x7F)
#define OBJMAKEOSHIHIKI_GET_PATHLISTINDEX(thisx) (((thisx)->params >> 7) & 0x7F)
#define OBJMAKEOSHIHIKI_GET_SWITCHFLAG_1(thisx) ((thisx)->home.rot.z & 0x7F)
#define OBJMAKEOSHIHIKI_GET_SWITCHFLAG_2(thisx) ((thisx)->params & 0x7F)
typedef struct ObjMakeoshihiki {
/* 0x000 */ Actor actor;

View File

@ -7,7 +7,7 @@ struct ObjMilkBin;
typedef struct ObjMilkBin {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x4];
/* 0x144 */ UNK_TYPE1 unk_144[0x4];
/* 0x148 */ ColliderCylinder collider;
/* 0x194 */ s32 disableDraw;
/* 0x198 */ s32 type;

View File

@ -9,7 +9,7 @@ typedef void (*ObjMoonStoneActionFunc)(struct ObjMoonStone*, PlayState*);
typedef struct ObjMoonStone {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x4C];
/* 0x144 */ UNK_TYPE1 unk_144[0x4C];
/* 0x190 */ ObjMoonStoneActionFunc actionFunc;
/* 0x194 */ s16 unk194;
} ObjMoonStone; // size = 0x198

View File

@ -91,10 +91,10 @@ s32 func_808D7928(ObjMure* this, PlayState* play) {
void ObjMure_Init(Actor* thisx, PlayState* play) {
ObjMure* this = THIS;
this->chNum = OBJ_MURE_GET_CHNUM(this->actor.params);
this->ptn = OBJ_MURE_GET_PTN(this->actor.params);
this->svNum = OBJ_MURE_GET_SVNUM(this->actor.params);
this->type = OBJ_MURE_GET_TYPE(this->actor.params);
this->chNum = OBJ_MURE_GET_CHNUM(&this->actor);
this->ptn = OBJ_MURE_GET_PTN(&this->actor);
this->svNum = OBJ_MURE_GET_SVNUM(&this->actor);
this->type = OBJ_MURE_GET_TYPE(&this->actor);
if (this->ptn >= 4) {
Actor_MarkForDeath(&this->actor);
return;

View File

@ -11,7 +11,7 @@ typedef void (*ObjMureActionFunc)(struct ObjMure*, PlayState*);
typedef struct {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x53];
/* 0x144 */ UNK_TYPE1 unk_144[0x53];
/* 0x197 */ u8 unk_197;
} ObjMureChild; // size = 0x198
@ -31,9 +31,9 @@ typedef struct ObjMure {
extern const ActorInit Obj_Mure_InitVars;
#define OBJ_MURE_GET_CHNUM(params) ((params >> 12) & 0xF)
#define OBJ_MURE_GET_PTN(params) ((params >> 8) & 0x7)
#define OBJ_MURE_GET_SVNUM(params) ((params >> 5) & 0x3)
#define OBJ_MURE_GET_TYPE(params) (params & 0x1F)
#define OBJ_MURE_GET_CHNUM(thisx) (((thisx)->params >> 12) & 0xF)
#define OBJ_MURE_GET_PTN(thisx) (((thisx)->params >> 8) & 0x7)
#define OBJ_MURE_GET_SVNUM(thisx) (((thisx)->params >> 5) & 0x3)
#define OBJ_MURE_GET_TYPE(thisx) ((thisx)->params & 0x1F)
#endif // Z_OBJ_MURE_H

View File

@ -50,10 +50,10 @@ typedef enum {
#define OBJ_SYOKUDAI_SNUFF_TIMER_JUST_LIT_BONUS 10
#define OBJ_SYOKUDAI_LIGHT_RADIUS_MAX 250
#define OBJ_SYOKUDAI_GET_TYPE(thisx) (thisx->params >> 0xC)
#define OBJ_SYOKUDAI_GET_START_LIT(thisx) (thisx->params & 0x800)
#define OBJ_SYOKUDAI_GET_GROUP_SIZE(thisx) ((thisx->params >> 7) & 0xF)
#define OBJ_SYOKUDAI_GET_SWITCH_FLAG(thisx) (thisx->params & 0x7F)
#define OBJ_SYOKUDAI_GET_TYPE(thisx) ((thisx)->params >> 0xC)
#define OBJ_SYOKUDAI_GET_START_LIT(thisx) ((thisx)->params & 0x800)
#define OBJ_SYOKUDAI_GET_GROUP_SIZE(thisx) (((thisx)->params >> 7) & 0xF)
#define OBJ_SYOKUDAI_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F)
#define OBJ_SYOKUDAI_SNUFF_TIMER_INITIAL(groupSize) ((groupSize * 50) + 100)

View File

@ -679,8 +679,8 @@ void ObjUm_Init(Actor* thisx, PlayState* play) {
this->wheelRot = 0;
ObjUm_DefaultAnim(this, play);
this->type = OBJ_UM_PARSE_TYPE(thisx);
this->initialPathIndex = OBJ_UM_PARSE_PATH_INDEX(thisx);
this->type = OBJ_UM_GET_TYPE(thisx);
this->initialPathIndex = OBJ_UM_GET_PATH_INDEX(thisx);
// if (!AliensDefeated)
if (!(gSaveContext.save.weekEventReg[22] & 1)) {

View File

@ -72,8 +72,8 @@ typedef enum {
/* 4 */ OBJ_UM_TYPE_POST_MILK_RUN // milk road, post-minigame
} ObjUmType;
#define OBJ_UM_PARSE_TYPE(thisx) (((thisx)->params & 0xFF00) >> 8)
#define OBJ_UM_PARSE_PATH_INDEX(thisx) ((thisx)->params & 0xFF)
#define OBJ_UM_GET_TYPE(thisx) (((thisx)->params & 0xFF00) >> 8)
#define OBJ_UM_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF)
#define OBJ_UM_FLAG_NONE (0)
#define OBJ_UM_FLAG_0001 (1 << 0)

View File

@ -66,7 +66,7 @@ void EffectSsIcePiece_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_RotateXS(this->rPitch, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C2DC(play->state.gfxCtx);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, (s32)alpha & 0xFF);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, (u8)(s32)alpha);
func_800BCC68(&this->pos, play);
gSPSegment(
POLY_XLU_DISP++, 0x08,