From bb96e47f8df9fa42e2120b7acda90432bacfde39 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Mon, 15 Aug 2022 18:42:21 -0700 Subject: [PATCH] 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 --- src/code/z_snap.c | 2 +- .../actors/ovl_Arms_Hook/z_arms_hook.h | 2 +- .../ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c | 4 +- .../ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.h | 2 +- .../ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c | 4 +- .../ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h | 2 +- .../actors/ovl_Bg_Ladder/z_bg_ladder.c | 4 +- .../actors/ovl_Bg_Ladder/z_bg_ladder.h | 12 +-- .../actors/ovl_Dm_Char07/z_dm_char07.h | 4 +- .../actors/ovl_Door_Shutter/z_door_shutter.h | 2 +- .../actors/ovl_Door_Spiral/z_door_spiral.c | 14 ++- .../actors/ovl_Door_Spiral/z_door_spiral.h | 4 + src/overlays/actors/ovl_En_Ani/z_en_ani.c | 2 +- src/overlays/actors/ovl_En_Ani/z_en_ani.h | 2 +- src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 3 +- src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h | 2 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 4 +- .../actors/ovl_En_Dy_Extra/z_en_dy_extra.h | 2 +- .../actors/ovl_En_Encount2/z_en_encount2.c | 3 +- .../actors/ovl_En_Encount2/z_en_encount2.h | 2 +- src/overlays/actors/ovl_En_Famos/z_en_famos.c | 4 +- src/overlays/actors/ovl_En_Famos/z_en_famos.h | 4 +- src/overlays/actors/ovl_En_Fish2/z_en_fish2.h | 3 +- src/overlays/actors/ovl_En_Fu/z_en_fu.h | 6 +- .../actors/ovl_En_Guruguru/z_en_guruguru.h | 4 +- .../actors/ovl_En_Hit_Tag/z_en_hit_tag.h | 2 +- src/overlays/actors/ovl_En_Hs/z_en_hs.c | 4 +- src/overlays/actors/ovl_En_In/z_en_in.h | 10 +-- .../actors/ovl_En_Invadepoh/z_en_invadepoh.h | 90 +++++++++---------- .../actors/ovl_En_Kakasi/z_en_kakasi.c | 8 +- .../actors/ovl_En_Kakasi/z_en_kakasi.h | 6 +- .../actors/ovl_En_Knight/z_en_knight.h | 8 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 20 ++--- src/overlays/actors/ovl_En_Kusa/z_en_kusa.h | 2 +- src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.h | 4 +- .../actors/ovl_En_Ma_Yto/z_en_ma_yto.c | 4 +- .../actors/ovl_En_Ma_Yto/z_en_ma_yto.h | 2 +- .../actors/ovl_En_Ma_Yts/z_en_ma_yts.c | 2 +- .../actors/ovl_En_Ma_Yts/z_en_ma_yts.h | 8 +- src/overlays/actors/ovl_En_Mk/z_en_mk.c | 2 +- src/overlays/actors/ovl_En_Ms/z_en_ms.c | 4 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 6 +- .../actors/ovl_En_Po_Fusen/z_en_po_fusen.c | 8 +- .../actors/ovl_En_Po_Fusen/z_en_po_fusen.h | 4 +- src/overlays/actors/ovl_En_Sth/z_en_sth.c | 8 +- .../actors/ovl_En_Tag_Obj/z_en_tag_obj.h | 2 +- .../actors/ovl_En_Tanron6/z_en_tanron6.h | 2 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 2 +- src/overlays/actors/ovl_En_Tsn/z_en_tsn.h | 2 +- .../actors/ovl_En_Warp_tag/z_en_warp_tag.c | 16 ++-- .../actors/ovl_En_Warp_tag/z_en_warp_tag.h | 8 +- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 19 ++-- .../ovl_En_Weather_Tag/z_en_weather_tag.h | 8 +- src/overlays/actors/ovl_En_Yb/z_en_yb.c | 8 +- src/overlays/actors/ovl_En_Zos/z_en_zos.c | 8 +- .../actors/ovl_Item_B_Heart/z_item_b_heart.h | 2 +- src/overlays/actors/ovl_Obj_Bell/z_obj_bell.h | 4 +- src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c | 2 +- .../actors/ovl_Obj_Ghaka/z_obj_ghaka.h | 2 +- .../actors/ovl_Obj_Hunsui/z_obj_hunsui.c | 11 +-- .../actors/ovl_Obj_Hunsui/z_obj_hunsui.h | 2 +- .../actors/ovl_Obj_Iceblock/z_obj_iceblock.c | 22 ++--- .../actors/ovl_Obj_Iceblock/z_obj_iceblock.h | 4 +- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 20 ++--- .../ovl_Obj_Lightswitch/z_obj_lightswitch.h | 6 +- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 10 +-- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h | 6 +- .../actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.h | 2 +- .../ovl_Obj_Moon_Stone/z_obj_moon_stone.h | 2 +- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 8 +- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h | 10 +-- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.h | 8 +- src/overlays/actors/ovl_Obj_Um/z_obj_um.c | 4 +- src/overlays/actors/ovl_Obj_Um/z_obj_um.h | 4 +- .../z_eff_ss_ice_piece.c | 2 +- 75 files changed, 253 insertions(+), 252 deletions(-) diff --git a/src/code/z_snap.c b/src/code/z_snap.c index 246309749c..7a234ca225 100644 --- a/src/code/z_snap.c +++ b/src/code/z_snap.c @@ -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 } diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h index cee615da1e..7afe3a2ce2 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c index cc29867e50..0bc385cb7b 100644 --- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c +++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c @@ -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); } } diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.h b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.h index f5f5b384f8..8fc32bd068 100644 --- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.h +++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.h @@ -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; diff --git a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c index 60ca416bcc..86854cbe8d 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c @@ -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; diff --git a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h index 86b0afab3d..17370427a2 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h @@ -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" diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c index 43e5e94f10..36226212e6 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c @@ -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; diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.h b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.h index e5fe13b749..c53a803521 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.h +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.h @@ -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; diff --git a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.h b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.h index 39f09856a7..8d35283476 100644 --- a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.h +++ b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.h @@ -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 diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h index 78861d55c9..e0d5653e26 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h @@ -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; diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c index 43c7143c30..f43f7c58cd 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c @@ -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); diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h index 207765e383..f12b79d84e 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h @@ -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 { diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index c1cb316143..88ddcd0f80 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/src/overlays/actors/ovl_En_Ani/z_en_ani.h index 52e60fc317..fcced964bd 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index e0585b8f5f..8121db9e21 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -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)) { diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h index 248c9356cf..9117bd97c5 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index aad1aa69c0..21fc9901fa 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h index 9a0b53223f..6d5d93ec43 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index d7c0cc5618..d771f3511c 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index 8f2a6c66a0..9927653e2d 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Famos/z_en_famos.c b/src/overlays/actors/ovl_En_Famos/z_en_famos.c index 8cebddded9..cc447a1a16 100644 --- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c +++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Famos/z_en_famos.h b/src/overlays/actors/ovl_En_Famos/z_en_famos.h index c446c21131..874da90346 100644 --- a/src/overlays/actors/ovl_En_Famos/z_en_famos.h +++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.h @@ -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) diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h index 5f79700c96..67dfa98f77 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.h b/src/overlays/actors/ovl_En_Fu/z_en_fu.h index 9ed3b69c5a..e35c961e73 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.h +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.h b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.h index 2178c62783..0262cd41d7 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.h +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.h b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.h index f48ffbe9d9..0a1383e0a0 100644 --- a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.h +++ b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 00bfd2cd58..5fec475944 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -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); diff --git a/src/overlays/actors/ovl_En_In/z_en_in.h b/src/overlays/actors/ovl_En_In/z_en_in.h index 1fb9694f6c..9221c94ce1 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/src/overlays/actors/ovl_En_In/z_en_in.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h index 3826397a84..cafae5f239 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 72eafa2836..b78b65a194 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -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); } } } diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h index b6010d1223..59ef3272ad 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Knight/z_en_knight.h b/src/overlays/actors/ovl_En_Knight/z_en_knight.h index a4fca8554e..167a966828 100644 --- a/src/overlays/actors/ovl_En_Knight/z_en_knight.h +++ b/src/overlays/actors/ovl_En_Knight/z_en_knight.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index ca3d2c326a..dc3ecc56ce 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h index a4be56cf68..eca474d5fc 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.h b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.h index 67e172ee8d..eb8276ac63 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.h +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index 4f74a46d68..e90b2decc9 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -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)) { diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h index cc69a029d6..e21b30c296 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c index f5456f7a21..5fcf1c7f06 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h index c3da6b71d7..e34ef3d0ef 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h @@ -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) /** diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 03dda25adb..cb25445b9d 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 0a3573516d..01b5c4becc 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c index 8c2465585c..6ea2c61536 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -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)) { diff --git a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c index 955b7d5249..a2c5376063 100644 --- a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c +++ b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.h b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.h index 92f75afabb..991b0cf9e1 100644 --- a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.h +++ b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.h @@ -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*); diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 664a74aa1d..77c40d173d 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h index 7a9fe909ae..a58b2b1d3d 100644 --- a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h +++ b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h index 13d060e2e5..fb565a5c82 100644 --- a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h +++ b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 2b8cbef826..60c4b4dd0f 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h index ce61376495..396918fdb4 100644 --- a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h +++ b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c index a7df95fb83..4f302e2687 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.h b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.h index 8bc521f15e..ea7eff8ab5 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.h +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 21302d5121..752447a5d4 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h index fe18c8e1ba..84aa36b031 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h @@ -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, diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c index d0fda7dfd9..d28a06fa0b 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.c b/src/overlays/actors/ovl_En_Zos/z_en_zos.c index cf1913e1c6..1419a7ecd9 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.c +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.c @@ -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); } } diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h index ccf7b43bdc..b89e10eddf 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h @@ -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 diff --git a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.h b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.h index 76265bcec2..c55381ad34 100644 --- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.h +++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.h @@ -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; diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c index db26a87d29..8e555a19f2 100644 --- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c +++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c @@ -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; } diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.h b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.h index 275928f47a..34c71f6b81 100644 --- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.h +++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.h @@ -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 diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c index a013560a44..3289699b0c 100644 --- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c +++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c @@ -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); } diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h index d84069ec06..2f3d968a67 100644 --- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h +++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h @@ -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; diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c index 394172d72b..b01f22ae67 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -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); diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h index fa817781a9..46ebc0c40c 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h @@ -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; diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index b6fd674ef1..dafd9bc2c6 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -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); diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h index 7a8e0043fb..a079001381 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h @@ -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 diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index 8e2756f0b7..b5f9d67b29 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -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); diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h index 708da99d64..8a419c5507 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h @@ -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; diff --git a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.h b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.h index 6bba9c014e..c5f313661a 100644 --- a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.h +++ b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.h @@ -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; diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.h b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.h index fbdf402808..375d40fad9 100644 --- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.h +++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.h @@ -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 diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 65a1734986..9a8072edd8 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -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; diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h index 03ed6dc4e1..bc3669697d 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h @@ -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 diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h index 618b86ed51..d1a0be1c88 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h @@ -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) diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c index dc4270bf2c..9bae7169e0 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -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)) { diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.h b/src/overlays/actors/ovl_Obj_Um/z_obj_um.h index 74eb5f5216..a6644009ee 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.h +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.h @@ -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) diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c index 32d457d74e..ebc28b4694 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c @@ -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,