From 0c3bba3ff6b78e8b03265f01d7ee4cb6bb09d6d3 Mon Sep 17 00:00:00 2001 From: Kenix3 Date: Sun, 14 Nov 2021 17:06:34 -0500 Subject: [PATCH] Moves func_800CB000 to z_bg_item, decompiles func_800CB000, and documents z_bg_item and a few DynaPolyActor struct members. (#407) * Moves func_800CB000 to z_bg_item, decompiles func_800CB000, and documents z_bg_item and a few DynaPolyActor struct members. * Adding usage of dynapoly state flag defines. * Formats z_bg_item * Update z_bg_item.c * Update z_bg_collect.c * Update z_bg_item.c * Update z_bg_item.c * Renames z_bg_item system to DynaPolyActor * Format --- include/functions.h | 34 ++-- include/z64actor.h | 8 +- spec | 1 - src/code/code_800CB000.c | 3 - src/code/z_actor.c | 4 +- src/code/z_bg_collect.c | 12 +- src/code/z_bg_item.c | 146 +++++++++++------- .../ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c | 8 +- .../ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c | 8 +- .../actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c | 2 +- .../ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c | 4 +- .../actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c | 4 +- .../ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c | 4 +- .../actors/ovl_Bg_Icicle/z_bg_icicle.c | 4 +- .../ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c | 4 +- .../ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c | 4 +- .../actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c | 4 +- .../ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c | 4 +- .../actors/ovl_Bg_Ladder/z_bg_ladder.c | 10 +- .../actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c | 4 +- src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c | 6 +- .../ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c | 4 +- .../actors/ovl_Bg_Tobira01/z_bg_tobira01.c | 4 +- .../actors/ovl_Dm_Char07/z_dm_char07.c | 4 +- src/overlays/actors/ovl_En_Dnb/z_en_dnb.c | 4 +- .../actors/ovl_En_Encount2/z_en_encount2.c | 2 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 3 +- src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c | 4 +- .../actors/ovl_Obj_Etcetera/z_obj_etcetera.c | 10 +- .../actors/ovl_Obj_Ghaka/z_obj_ghaka.c | 8 +- .../actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c | 2 +- .../actors/ovl_Obj_HsStump/z_obj_hsstump.c | 4 +- .../ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c | 4 +- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 4 +- .../ovl_Obj_Lightblock/z_obj_lightblock.c | 4 +- .../actors/ovl_Obj_Raillift/z_obj_raillift.c | 8 +- .../ovl_Obj_Tokei_Step/z_obj_tokei_step.c | 6 +- .../ovl_Obj_Visiblock/z_obj_visiblock.c | 4 +- tools/disasm/files.txt | 3 +- tools/disasm/functions.txt | 32 ++-- tools/sizes/code_functions.csv | 32 ++-- 41 files changed, 231 insertions(+), 193 deletions(-) delete mode 100644 src/code/code_800CB000.c diff --git a/include/functions.h b/include/functions.h index 1102363d5a..55945e4c84 100644 --- a/include/functions.h +++ b/include/functions.h @@ -995,7 +995,7 @@ s32 func_800C45C4(CollisionContext* colCtx, u32 arg1, Vec3f* arg2, Vec3f* arg3, // void func_800C5538(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10); s32 func_800C55C4(CollisionContext* colCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, CollisionPoly** arg4, u32 arg5, u32 arg6, u32 arg7, u32 arg8, u32* arg9); // void func_800C5650(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10, UNK_TYPE4 param_11); -// void func_800C56E0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10, UNK_TYPE4 param_11, UNK_TYPE4 param_12); +s32 func_800C56E0(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, Actor* actor, f32 chkDist); s32 func_800C576C(CollisionContext* colCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, CollisionPoly** arg4, u32 arg5, u32 arg6, u32 arg7, u32 arg8, u32* arg9); // void func_800C57F8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); // void func_800C583C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9); @@ -1109,22 +1109,22 @@ void BgCheck2_UpdateActorPosition(CollisionContext* colCtx, s32 index, Actor* ac void BgCheck2_UpdateActorYRotation(CollisionContext* colCtx, s32 index, Actor* actor); void BgCheck2_AttachToMesh(CollisionContext* colCtx, Actor* actor, s32 index); u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* colCtx, s32 index, Actor* actor); -void BcCheck3_BgActorInit(DynaPolyActor* actor, UNK_TYPE4 param_2); -void BgCheck3_LoadMesh(GlobalContext* globalCtx, DynaPolyActor* actor, CollisionHeader* meshHeader); -void BgCheck3_ResetFlags(DynaPolyActor* actor); -void func_800CAE88(DynaPolyActor* actor); -void func_800CAE9C(DynaPolyActor* actor); -void func_800CAEB0(CollisionContext* colCtx, s32 index); -void func_800CAEE0(DynaPolyActor* actor); -void func_800CAEF4(CollisionContext* colCtx, s32 index); -void func_800CAF24(DynaPolyActor* actor); -void func_800CAF38(DynaPolyActor* actor); -s32 func_800CAF4C(DynaPolyActor* actor); -s32 func_800CAF70(DynaPolyActor* actor); -s32 func_800CAF94(DynaPolyActor* actor); -s32 func_800CAFB8(DynaPolyActor* actor); -s32 func_800CAFDC(DynaPolyActor* actor); -// void func_800CB000(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5); +void DynaPolyActor_Init(DynaPolyActor* dynaActor, s32 flags); +void DynaPolyActor_LoadMesh(GlobalContext* globalCtx, DynaPolyActor* dynaActor, CollisionHeader* meshHeader); +void DynaPolyActor_ResetState(DynaPolyActor* dynaActor); +void DynaPolyActor_SetRidingFallingState(DynaPolyActor* dynaActor); +void DynaPolyActor_SetRidingMovingState(DynaPolyActor* dynaActor); +void DynaPolyActor_SetRidingMovingStateByIndex(CollisionContext* colCtx, s32 index); +void DynaPolyActor_SetRidingRotatingState(DynaPolyActor* dynaActor); +void DynaPolyActor_SetRidingRotatingStateByIndex(CollisionContext* colCtx, s32 index); +void DynaPolyActor_SetSwitchPressedState(DynaPolyActor* dynaActor); +void DynaPolyActor_SetHeavySwitchPressedState(DynaPolyActor* dynaActor); +s32 DynaPolyActor_IsInRidingFallingState(DynaPolyActor* dynaActor); +s32 DynaPolyActor_IsInRidingMovingState(DynaPolyActor* dynaActor); +s32 DynaPolyActor_IsInRidingRotatingState(DynaPolyActor* dynaActor); +s32 DynaPolyActor_IsInSwitchPressedState(DynaPolyActor* dynaActor); +s32 DynaPolyActor_IsInHeavySwitchPressedState(DynaPolyActor* dynaActor); +s32 DynaPolyActor_ValidateMove(GlobalContext* globalCtx, DynaPolyActor* dynaActor, s16 arg2, s16 arg3, s16 arg4); f32 Camera_fabsf(f32 f); f32 Camera_LengthVec3f(Vec3f* v); // void func_800CB270(void); diff --git a/include/z64actor.h b/include/z64actor.h index 9e75f0f9e3..7923e3da95 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -228,12 +228,12 @@ typedef enum { typedef struct { /* 0x000 */ Actor actor; /* 0x144 */ s32 bgId; - /* 0x148 */ f32 unk148; + /* 0x148 */ f32 pushForce; /* 0x14C */ f32 unk14C; - /* 0x150 */ s16 unk150; + /* 0x150 */ s16 yRotation; /* 0x152 */ u16 unk152; - /* 0x154 */ u32 unk154; - /* 0x158 */ u8 unk_158; + /* 0x154 */ u32 flags; + /* 0x158 */ u8 stateFlags; /* 0x15A */ s16 pad15A; } DynaPolyActor; // size = 0x15C diff --git a/spec b/spec index 95f2a48d76..05efcb13c2 100644 --- a/spec +++ b/spec @@ -457,7 +457,6 @@ beginseg include "build/data/code/z_bgcheck.bss.o" include "build/src/code/z_bg_collect.o" include "build/src/code/z_bg_item.o" - include "build/src/code/code_800CB000.o" include "build/src/code/z_camera.o" include "build/data/code/z_camera.data.o" include "build/data/code/z_camera.bss.o" diff --git a/src/code/code_800CB000.c b/src/code/code_800CB000.c deleted file mode 100644 index 7642d35c42..0000000000 --- a/src/code/code_800CB000.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "global.h" - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_800CB000/func_800CB000.s") diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 03a362fc66..42f67987a1 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -509,8 +509,8 @@ f32 Actor_YDistance(Actor* actor1, Actor* actor2) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B72E0.s") void func_800B72F8(DynaPolyActor* dpactor, f32 a1, s16 a2) { - dpactor->unk150 = a2; - dpactor->unk148 += a1; + dpactor->yRotation = a2; + dpactor->pushForce += a1; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_IsLinkFacingActor.s") diff --git a/src/code/z_bg_collect.c b/src/code/z_bg_collect.c index 29c4cf7dae..706c4b80a4 100644 --- a/src/code/z_bg_collect.c +++ b/src/code/z_bg_collect.c @@ -61,13 +61,13 @@ void BgCheck2_AttachToMesh(CollisionContext* colCtx, Actor* actor, s32 index) { meshActor = BgCheck_GetActorOfMesh(colCtx, index); if (meshActor != NULL) { - func_800CAE88(meshActor); + DynaPolyActor_SetRidingFallingState(meshActor); if ((actor->flags & 0x4000000) == 0x4000000) { - func_800CAF24(meshActor); + DynaPolyActor_SetSwitchPressedState(meshActor); } if ((actor->flags & 0x20000) == 0x20000) { - func_800CAF38(meshActor); + DynaPolyActor_SetHeavySwitchPressedState(meshActor); } } } @@ -80,7 +80,7 @@ u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* colCtx, s32 index, Acto return 0; } - if (((colCtx->dyna.bgActorFlags[index] & 2) != 0) || ((colCtx->dyna.bgActorFlags[index] & 1) == 0)) { + if (colCtx->dyna.bgActorFlags[index] & 2 || !(colCtx->dyna.bgActorFlags[index] & 1)) { return 0; } @@ -90,12 +90,12 @@ u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* colCtx, s32 index, Acto return 0; } - if ((meshActor->unk154 & 1) != 0) { + if (meshActor->flags & 1) { BgCheck2_UpdateActorPosition(colCtx, index, actor); wasUpdated = 1; } - if ((meshActor->unk154 & 2) != 0) { + if (meshActor->flags & 2) { BgCheck2_UpdateActorYRotation(colCtx, index, actor); wasUpdated = 1; } diff --git a/src/code/z_bg_item.c b/src/code/z_bg_item.c index 77cc014b44..92a300e43d 100644 --- a/src/code/z_bg_item.c +++ b/src/code/z_bg_item.c @@ -1,99 +1,141 @@ #include "global.h" -void BcCheck3_BgActorInit(DynaPolyActor* actor, UNK_TYPE4 param_2) { - actor->bgId = -1; - actor->unk148 = 0; - actor->unk14C = 0; - actor->unk154 = param_2; - actor->unk_158 = 0; +#define DYNAPOLY_STATE_NONE 0 +#define DYNAPOLY_STATE_RIDING_FALLING (1 << 0) +#define DYNAPOLY_STATE_RIDING_MOVING (1 << 1) +#define DYNAPOLY_STATE_RIDING_ROTATING (1 << 2) +#define DYNAPOLY_STATE_SWITCH_PRESSED (1 << 3) +#define DYNAPOLY_STATE_HEAVY_SWITCH_PRESSED (1 << 4) + +void DynaPolyActor_Init(DynaPolyActor* dynaActor, s32 flags) { + dynaActor->bgId = -1; + dynaActor->pushForce = 0.0f; + dynaActor->unk14C = 0.0f; + dynaActor->flags = flags; + dynaActor->stateFlags = DYNAPOLY_STATE_NONE; } -void BgCheck3_LoadMesh(GlobalContext* globalCtx, DynaPolyActor* actor, CollisionHeader* meshHeader) { - CollisionHeader* header; +void DynaPolyActor_LoadMesh(GlobalContext* globalCtx, DynaPolyActor* dynaActor, CollisionHeader* meshHeader) { + CollisionHeader* header = NULL; - header = NULL; BgCheck_RelocateMeshHeader(meshHeader, &header); - actor->bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, actor, header); + dynaActor->bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, dynaActor, header); } -void BgCheck3_ResetFlags(DynaPolyActor* actor) { - actor->unk_158 = 0; +void DynaPolyActor_ResetState(DynaPolyActor* dynaActor) { + dynaActor->stateFlags = DYNAPOLY_STATE_NONE; } -void func_800CAE88(DynaPolyActor* actor) { - actor->unk_158 |= 1; +void DynaPolyActor_SetRidingFallingState(DynaPolyActor* dynaActor) { + dynaActor->stateFlags |= DYNAPOLY_STATE_RIDING_FALLING; } -void func_800CAE9C(DynaPolyActor* actor) { - actor->unk_158 |= 2; +void DynaPolyActor_SetRidingMovingState(DynaPolyActor* dynaActor) { + dynaActor->stateFlags |= DYNAPOLY_STATE_RIDING_MOVING; } -void func_800CAEB0(CollisionContext* colCtx, s32 index) { - DynaPolyActor* actor; +void DynaPolyActor_SetRidingMovingStateByIndex(CollisionContext* colCtx, s32 index) { + DynaPolyActor* dynaActor = BgCheck_GetActorOfMesh(colCtx, index); - actor = BgCheck_GetActorOfMesh(colCtx, index); - if (actor != (DynaPolyActor*)0x0) { - func_800CAE9C(actor); + if (dynaActor != NULL) { + DynaPolyActor_SetRidingMovingState(dynaActor); } } -void func_800CAEE0(DynaPolyActor* actor) { - actor->unk_158 |= 4; +void DynaPolyActor_SetRidingRotatingState(DynaPolyActor* dynaActor) { + dynaActor->stateFlags |= DYNAPOLY_STATE_RIDING_ROTATING; } -void func_800CAEF4(CollisionContext* colCtx, s32 index) { - DynaPolyActor* actor; +void DynaPolyActor_SetRidingRotatingStateByIndex(CollisionContext* colCtx, s32 index) { + DynaPolyActor* dynaActor = BgCheck_GetActorOfMesh(colCtx, index); - actor = BgCheck_GetActorOfMesh(colCtx, index); - if (actor != (DynaPolyActor*)0x0) { - func_800CAEE0(actor); + if (dynaActor != NULL) { + DynaPolyActor_SetRidingRotatingState(dynaActor); } } -void func_800CAF24(DynaPolyActor* actor) { - actor->unk_158 |= 8; +void DynaPolyActor_SetSwitchPressedState(DynaPolyActor* dynaActor) { + dynaActor->stateFlags |= DYNAPOLY_STATE_SWITCH_PRESSED; } -void func_800CAF38(DynaPolyActor* actor) { - actor->unk_158 |= 0x10; +void DynaPolyActor_SetHeavySwitchPressedState(DynaPolyActor* dynaActor) { + dynaActor->stateFlags |= DYNAPOLY_STATE_HEAVY_SWITCH_PRESSED; } -s32 func_800CAF4C(DynaPolyActor* actor) { - if (actor->unk_158 & 1) { - return 1; +s32 DynaPolyActor_IsInRidingFallingState(DynaPolyActor* dynaActor) { + if (dynaActor->stateFlags & DYNAPOLY_STATE_RIDING_FALLING) { + return true; } else { - return 0; + return false; } } -s32 func_800CAF70(DynaPolyActor* actor) { - if (actor->unk_158 & 2) { - return 1; +s32 DynaPolyActor_IsInRidingMovingState(DynaPolyActor* dynaActor) { + if (dynaActor->stateFlags & DYNAPOLY_STATE_RIDING_MOVING) { + return true; } else { - return 0; + return false; } } -s32 func_800CAF94(DynaPolyActor* actor) { - if (actor->unk_158 & 4) { - return 1; +s32 DynaPolyActor_IsInRidingRotatingState(DynaPolyActor* dynaActor) { + if (dynaActor->stateFlags & DYNAPOLY_STATE_RIDING_ROTATING) { + return true; } else { - return 0; + return false; } } -s32 func_800CAFB8(DynaPolyActor* actor) { - if (actor->unk_158 & 8) { - return 1; +s32 DynaPolyActor_IsInSwitchPressedState(DynaPolyActor* dynaActor) { + if (dynaActor->stateFlags & DYNAPOLY_STATE_SWITCH_PRESSED) { + return true; } else { - return 0; + return false; } } -s32 func_800CAFDC(DynaPolyActor* actor) { - if (actor->unk_158 & 0x10) { - return 1; +s32 DynaPolyActor_IsInHeavySwitchPressedState(DynaPolyActor* dynaActor) { + if (dynaActor->stateFlags & DYNAPOLY_STATE_HEAVY_SWITCH_PRESSED) { + return true; } else { - return 0; + return false; } } + +s32 DynaPolyActor_ValidateMove(GlobalContext* globalCtx, DynaPolyActor* dynaActor, s16 startRadius, s16 endRadius, + s16 startHeight) { + Vec3f startPos; + Vec3f endPos; + Vec3f intersectionPos; + f32 sin = Math_SinS(dynaActor->yRotation); + f32 cos = Math_CosS(dynaActor->yRotation); + s32 bgId; + CollisionPoly* poly; + f32 adjustedStartRadius; + f32 adjustedEndRadius; + f32 sign = (0.0f <= dynaActor->pushForce) ? 1.0f : -1.0f; + + adjustedStartRadius = (f32)startRadius - 0.1f; + startPos.x = dynaActor->actor.world.pos.x + (adjustedStartRadius * cos); + startPos.y = dynaActor->actor.world.pos.y + startHeight; + startPos.z = dynaActor->actor.world.pos.z - (adjustedStartRadius * sin); + + adjustedEndRadius = (f32)endRadius - 0.1f; + endPos.x = sign * adjustedEndRadius * sin + startPos.x; + endPos.y = startPos.y; + endPos.z = sign * adjustedEndRadius * cos + startPos.z; + + if (func_800C56E0(&globalCtx->colCtx, &startPos, &endPos, &intersectionPos, &poly, true, false, false, true, &bgId, + &dynaActor->actor, 0.0f)) { + return false; + } + startPos.x = (dynaActor->actor.world.pos.x * 2.0f) - startPos.x; + startPos.z = (dynaActor->actor.world.pos.z * 2.0f) - startPos.z; + endPos.x = sign * adjustedEndRadius * sin + startPos.x; + endPos.z = sign * adjustedEndRadius * cos + startPos.z; + if (func_800C56E0(&globalCtx->colCtx, &startPos, &endPos, &intersectionPos, &poly, true, false, false, true, &bgId, + &dynaActor->actor, 0.0f)) { + return false; + } + return true; +} diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c index 18b8a343c6..e41b4ef732 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c @@ -143,11 +143,11 @@ void BgCtowerGear_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); } if (type == WATER_WHEEL) { - BcCheck3_BgActorInit(&this->dyna, 3); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06018588); + DynaPolyActor_Init(&this->dyna, 3); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06018588); } else if (type == ORGAN) { - BcCheck3_BgActorInit(&this->dyna, 0); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06016E70); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06016E70); func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } } diff --git a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c index 68371797b9..df56b42a0c 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c @@ -53,18 +53,18 @@ void BgCtowerRot_Init(Actor* thisx, GlobalContext* globalCtx) { Vec3f offset; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 1); + DynaPolyActor_Init(&this->dyna, 1); if (this->dyna.actor.params == CORRIDOR) { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060142E8); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060142E8); this->actionFunc = BgCtowerRot_CorridorRotate; return; } player = GET_PLAYER(globalCtx); if (this->dyna.actor.params == MAIN_DOOR) { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06017410); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06017410); this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x4000; } else { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06017650); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06017650); this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y - 0x4000; } Actor_CalcOffsetOrientedToDrawRotation(&this->dyna.actor, &offset, &player->actor.world.pos); diff --git a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c index f9447ba033..f757f54ab8 100644 --- a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c +++ b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c @@ -36,7 +36,7 @@ void BgFuKaiten_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader* header = 0; Actor_SetScale(thisx, 1.0); - BcCheck3_BgActorInit(&THIS->bg, 3); + DynaPolyActor_Init(&THIS->bg, 3); BgCheck_RelocateMeshHeader(&D_06002D30, &header); THIS->bg.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &THIS->bg, header); diff --git a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c index d6f3bdcdb4..dfe04cbba5 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c +++ b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c @@ -51,8 +51,8 @@ void BgHakaCurtain_Init(Actor* thisx, GlobalContext* globalCtx) { BgHakaCurtain* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06001588); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06001588); if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) { func_80B6DE80(this); return; diff --git a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c index 6a610470ea..e05c842823 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c @@ -47,8 +47,8 @@ void BgHakaTomb_Init(Actor* thisx, GlobalContext* globalCtx) { BgHakaTomb* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, D_06000EE8); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, D_06000EE8); func_8013E3B8(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); func_80BD6624(this); } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c index 453bd919cc..13facec770 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c @@ -704,8 +704,8 @@ void BgHakuginPost_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.world.rot.z = 0; this->dyna.actor.shape.rot.x = 0; this->dyna.actor.shape.rot.z = 0; - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_0600D3B0); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600D3B0); func_80A9B3BC(this, globalCtx); func_80A9CA94(this); } else { diff --git a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c index 2695cb9967..965a999bcd 100644 --- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c +++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c @@ -70,8 +70,8 @@ void BgIcicle_Init(Actor* thisx, GlobalContext* globalCtx) { s32 paramsMid; Actor_ProcessInitChain(thisx, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 0); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000294); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000294); Collider_InitAndSetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); Collider_UpdateCylinder(thisx, &this->collider); diff --git a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c index 9d5a36ba56..6643aeab7c 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c @@ -67,8 +67,8 @@ void BgIkanaShutter_Init(Actor* thisx, GlobalContext* globalCtx) { BgIkanaShutter* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 0); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000F28); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000F28); if (!((this->dyna.actor.params >> 8) & 1)) { if (BgIkanaShutter_AllSwitchesPressed(this, globalCtx)) { func_80BD599C(this); 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 5b68e1363c..9ffd1e549d 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 @@ -115,8 +115,8 @@ void BgIkninSusceil_Init(Actor* thisx, GlobalContext* globalCtx) { BgIkninSusceil* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_0600CBAC); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600CBAC); this->animatedTexture = Lib_SegmentedToVirtual(&D_0600C670); func_80C0AC74(this); } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c index 8c6380aaf2..90984244c4 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c @@ -74,7 +74,7 @@ void BgIknvObj_Init(Actor* thisx, GlobalContext* globalCtx) { break; case IKNV_OBJ_RAISED_DOOR: this->displayListPtr = D_06011880; - BcCheck3_BgActorInit(&this->dyna, 0); + DynaPolyActor_Init(&this->dyna, 0); BgCheck_RelocateMeshHeader(&D_060119D4, &colHeader); this->dyna.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, colHeader); this->actionFunc = BgIknvObj_UpdateRaisedDoor; @@ -83,7 +83,7 @@ void BgIknvObj_Init(Actor* thisx, GlobalContext* globalCtx) { case IKNV_OBJ_SAKON_DOOR: this->displayListPtr = D_060129C8; this->actionFunc = BgIknvObj_UpdateSakonDoor; - BcCheck3_BgActorInit(&this->dyna, 0); + DynaPolyActor_Init(&this->dyna, 0); BgCheck_RelocateMeshHeader(&D_06012CA4, &colHeader); this->dyna.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, colHeader); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c index 39b22417c2..4b98ed4e05 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c @@ -158,8 +158,8 @@ void BgKin2Fence_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i = 0; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 0); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000908); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000908); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements); Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, 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 0c391f43bd..81c1f6a97c 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c @@ -61,17 +61,17 @@ void BgLadder_Init(Actor* thisx, GlobalContext* globalCtx) { // Has to be `thisx` instead of `&this->actor` to match this->switchFlag = GET_BGLADDER_SWITCHFLAG(thisx); thisx->params = GET_BGLADDER_SIZE(thisx); - BcCheck3_BgActorInit(&this->dyna, 0); + DynaPolyActor_Init(&this->dyna, 0); size = thisx->params; if (size == LADDER_SIZE_12RUNG) { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060001D8); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060001D8); } else if (size == LADDER_SIZE_16RUNG) { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000408); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000408); } else if (size == LADDER_SIZE_20RUNG) { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000638); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000638); } else if (size == LADDER_SIZE_24RUNG) { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000868); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000868); } else { Actor_MarkForDeath(&this->dyna.actor); return; diff --git a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c index 2b77f73acf..19a6e36680 100644 --- a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c +++ b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c @@ -38,8 +38,8 @@ void BgLbfshot_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->dyna.actor.uncullZoneForward = 4000.0f; - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060014D8); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060014D8); } void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx) { BgLbfshot* this = THIS; diff --git a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c index 02e9517f5d..d8141abc39 100644 --- a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c +++ b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c @@ -44,8 +44,8 @@ void BgLotus_Init(Actor* thisx, GlobalContext* globalCtx) { s32 sp2C; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000A20); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000A20); this->dyna.actor.floorHeight = func_800C411C(&globalCtx->colCtx, &thisx->floorPoly, &sp2C, &this->dyna.actor, &this->dyna.actor.world.pos); this->timer2 = 96; @@ -93,7 +93,7 @@ void BgLotus_Wait(BgLotus* this, GlobalContext* globalCtx) { } else { this->dyna.actor.world.pos.y = this->height; - if (func_800CAF70(&this->dyna)) { + if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) { if (this->hasSpawnedRipples == 0) { EffectSsGRipple_Spawn(globalCtx, &this->dyna.actor.world.pos, 1000, 1400, 0); EffectSsGRipple_Spawn(globalCtx, &this->dyna.actor.world.pos, 1000, 1400, 8); diff --git a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c index 43022630a6..112eabfbcb 100644 --- a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c +++ b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c @@ -41,8 +41,8 @@ void BgMbarChair_Init(Actor* thisx, GlobalContext* globalCtx) { BgMbarChair* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 0); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060019B4); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060019B4); } void BgMbarChair_Destroy(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c index 506b508b26..e759edfb3a 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c @@ -78,8 +78,8 @@ void BgTobira01_Init(Actor* thisx, GlobalContext* globalCtx) { BgTobira01* this = THIS; s32 pad; - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060011C0); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060011C0); gSaveContext.weekEventReg[88] &= (u8)~0x40; Actor_SetScale(&this->dyna.actor, 1.0f); this->timer2 = gSaveContext.isNight; diff --git a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c index c80f7222d6..c5ff12452d 100644 --- a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c +++ b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c @@ -61,8 +61,8 @@ void DmChar07_Init(Actor* thisx, GlobalContext* globalCtx) { if (this->dyna.actor.params == DMCHAR07_STAGE) { Actor_SetScale(&this->dyna.actor, 0.1f); this->isStage = 1; - BcCheck3_BgActorInit(&this->dyna, 0); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06006688); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06006688); } else { Actor_SetScale(&this->dyna.actor, 1.0f); } diff --git a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c index 780ce1cda5..945e9365d8 100644 --- a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c +++ b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c @@ -108,8 +108,8 @@ void EnDnb_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i; s16* alloc; - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06004D8C); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06004D8C); alloc = (s16*)Lib_SegmentedToVirtual(D_06004710); for (i = 0; i < ARRAY_COUNT(this->particles); i++) { 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 6071137ce1..20bd44fe71 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -106,7 +106,7 @@ void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; CollisionHeader* colHeader = NULL; - BcCheck3_BgActorInit(&this->dyna, 0); + DynaPolyActor_Init(&this->dyna, 0); BgCheck_RelocateMeshHeader(&D_06002420, &colHeader); this->dyna.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, colHeader); ActorShape_Init(&this->dyna.actor.shape, 0.0f, func_800B3FC0, 25.0f); diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 550a54f620..737c142bff 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -781,7 +781,8 @@ void func_80962F4C(EnFu* this, GlobalContext* globalCtx) { func_801518B0(globalCtx, 0x288B, &this->actor); } - if ((!func_800CAF94((DynaPolyActor*)this->actor.child) && (player->actor.bgCheckFlags & 1)) || + if ((!DynaPolyActor_IsInRidingRotatingState((DynaPolyActor*)this->actor.child) && + (player->actor.bgCheckFlags & 1)) || (gSaveContext.unk_3DE0[4] < 1) || (this->unk_548 == this->unk_54C)) { player->stateFlags3 &= ~0x400000; func_80961E88(globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c index de7f30fbd6..4a70dc0ec1 100644 --- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c +++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c @@ -264,8 +264,8 @@ void func_80A35BD4(Actor* thisx, GlobalContext* globalCtx) { void ObjBell_Init(Actor* thisx, GlobalContext* globalCtx) { ObjBell* this = THIS; - BcCheck3_BgActorInit(&this->dyna, 0); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06001BA8); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06001BA8); Actor_SetScale(&this->dyna.actor, 0.08f); Collider_InitAndSetSphere(globalCtx, &this->collider1, &this->dyna.actor, &sCylinderInit1); Collider_InitAndSetSphere(globalCtx, &this->collider2, &this->dyna.actor, &sCylinderInit2); diff --git a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c index e4d9707be2..b08f690d48 100644 --- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c +++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c @@ -147,7 +147,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, GlobalContext* globalCtx) { this->oscillationTimer = minOscillationTimer; } } else { - if (func_800CAF70(&this->dyna)) { + if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) { if (!(this->burrowFlag & 1)) { // Player is walking onto the Deku Flower, or falling on it from a height this->oscillationTimer = 10; @@ -175,7 +175,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, GlobalContext* globalCtx) { } void ObjEtcetera_PlaySmallFlutterAnimation(ObjEtcetera* this, GlobalContext* globalCtx) { - if (func_800CAF70(&this->dyna)) { + if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) { this->burrowFlag |= 1; } else { this->burrowFlag &= ~1; @@ -190,11 +190,11 @@ void ObjEtcetera_PlaySmallFlutterAnimation(ObjEtcetera* this, GlobalContext* glo void ObjEtcetera_DoIntenseOscillation(ObjEtcetera* this, GlobalContext* globalCtx) { // In order to match, we are seemingly required to access scale.x at one point // without using this. We can create a thisx or dyna pointer to achieve that, but - // it's more likely they used dyna given that func_800CAF70 takes a DynaPolyActor. + // it's more likely they used dyna given that DynaPolyActor_IsInRidingMovingState takes a DynaPolyActor. DynaPolyActor* dyna = &this->dyna; f32 scaleTemp; - if (func_800CAF70(dyna)) { + if (DynaPolyActor_IsInRidingMovingState(dyna)) { this->burrowFlag |= 1; } else { this->burrowFlag &= ~1; @@ -233,7 +233,7 @@ void ObjEtcetera_Setup(ObjEtcetera* this, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->objIndex)) { this->dyna.actor.objBankIndex = this->objIndex; Actor_SetObjectSegment(globalCtx, &this->dyna.actor); - BcCheck3_BgActorInit(&this->dyna, 1); + DynaPolyActor_Init(&this->dyna, 1); thisCollisionHeader = collisionHeaders[type]; if (thisCollisionHeader != 0) { BgCheck_RelocateMeshHeader(thisCollisionHeader, &colHeader); diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c index 7a20bab743..6a7bf18e47 100644 --- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c +++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c @@ -87,12 +87,12 @@ void func_80B3C39C(ObjGhaka* this, GlobalContext* globalCtx) { } } } - if (this->dyna.unk148 < 0.0f && !(gSaveContext.weekEventReg[20] & 0x20) && + if (this->dyna.pushForce < 0.0f && !(gSaveContext.weekEventReg[20] & 0x20) && player->transformation == PLAYER_FORM_GORON) { func_80B3C2B0(this); } else { player->stateFlags2 &= ~0x10; - this->dyna.unk148 = 0.0f; + this->dyna.pushForce = 0.0f; } } @@ -136,7 +136,7 @@ void func_80B3C624(ObjGhaka* this, GlobalContext* globalCtx) { if (stepTemp) { player->stateFlags2 &= ~0x10; - this->dyna.unk148 = 0.0f; + this->dyna.pushForce = 0.0f; func_80B3C2C4(this, globalCtx); gSaveContext.weekEventReg[20] |= 0x20; func_80B3C260(this); @@ -153,7 +153,7 @@ void ObjGhaka_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, D_80B3C96C); Actor_SetScale(&this->dyna.actor, 0.1f); - BcCheck3_BgActorInit(&this->dyna, 1); + DynaPolyActor_Init(&this->dyna, 1); BgCheck_RelocateMeshHeader(&D_06003CD0, &colHeader); this->dyna.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, colHeader); Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x4); diff --git a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c index 9632088b77..31184fc30a 100644 --- a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c +++ b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c @@ -78,7 +78,7 @@ void ObjHgdoor_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader* header = NULL; Actor_SetScale(&this->dyna.actor, 0.1f); - BcCheck3_BgActorInit(&this->dyna, 1); + DynaPolyActor_Init(&this->dyna, 1); if (OBJHGDOOR_IS_RIGHT_DOOR(&this->dyna.actor)) { BgCheck_RelocateMeshHeader(&D_06001D10, &header); } else { diff --git a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c index 3a61c41e8b..e3813efb52 100644 --- a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c +++ b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c @@ -47,8 +47,8 @@ void ObjHsStump_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->isHidden = OBJHSSTUMP_GET_ISHIDDEN(thisx); this->switchFlag = OBJHSSTUMP_GET_SWITCHFLAG(thisx); // Must be thisx to match - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060011B0); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060011B0); switch (this->isHidden) { case true: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { diff --git a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c index 9b3d19051a..f7901f708d 100644 --- a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c +++ b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c @@ -40,8 +40,8 @@ void ObjKepnKoya_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_SetScale(&this->dyna.actor, 0.1f); - BcCheck3_BgActorInit(&this->dyna, 0); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_0600805C); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600805C); if (this->dyna.bgId == 0x32) { Actor_MarkForDeath(&this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index 87d3f91457..abd04dc65e 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -149,10 +149,10 @@ void ObjKibako2_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; ObjKibako2Contents contents = KIBAKO2_CONTENTS(&this->dyna.actor); - BcCheck3_BgActorInit(&this->dyna, 0); + DynaPolyActor_Init(&this->dyna, 0); Collider_InitCylinder(globalCtx, &this->collider); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000B70); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000B70); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); Collider_UpdateCylinder(&this->dyna.actor, &this->collider); this->dyna.actor.home.rot.z = 0; diff --git a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c index d955a5aa3a..6a123c6ca0 100644 --- a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c +++ b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c @@ -91,12 +91,12 @@ void ObjLightblock_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_SetScale(&this->dyna.actor, typeVars->scale); - BcCheck3_BgActorInit(&this->dyna, 0); + DynaPolyActor_Init(&this->dyna, 0); Collider_InitCylinder(globalCtx, &this->collider); if (Flags_GetSwitch(globalCtx, LIGHTBLOCK_DESTROYED(&this->dyna.actor))) { Actor_MarkForDeath(&this->dyna.actor); } else { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000B80); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000B80); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); Collider_UpdateCylinder(&this->dyna.actor, &this->collider); this->collider.dim.radius = typeVars->radius; diff --git a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c index eb9202197b..969326cf4f 100644 --- a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c +++ b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c @@ -70,8 +70,8 @@ void ObjRaillift_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->world.rot.x = 0; thisx->shape.rot.z = 0; thisx->world.rot.z = 0; - BcCheck3_BgActorInit(&this->dyna, 1); - BgCheck3_LoadMesh(globalCtx, &this->dyna, sColHeaders[type]); + DynaPolyActor_Init(&this->dyna, 1); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, sColHeaders[type]); this->speed = OBJRAILLIFT_GET_SPEED(thisx); if (this->speed < 0.0f) { this->speed = -this->speed; @@ -187,7 +187,7 @@ void ObjRaillift_Move(ObjRaillift* this, GlobalContext* globalCtx) { Will teleport to what ever curpoint is set to */ void ObjRaillift_Teleport(ObjRaillift* this, GlobalContext* globalCtx) { - if (!func_800CAF70(&this->dyna)) { + if (!DynaPolyActor_IsInRidingMovingState(&this->dyna)) { ObjRaillift_UpdatePosition(this, this->curPoint); func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->actionFunc = ObjRaillift_Move; @@ -237,7 +237,7 @@ void ObjRaillift_Update(Actor* thisx, GlobalContext* globalCtx) { s32 requiredScopeTemp; this->isWeightOnPrev = this->isWeightOn; - if (func_800CAF70(&this->dyna)) { + if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) { this->isWeightOn = true; } else { this->isWeightOn = false; diff --git a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c index 22bcddc570..c5e00241c4 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c +++ b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c @@ -195,9 +195,9 @@ void ObjTokeiStep_Init(Actor* thisx, GlobalContext* globalCtx) { ObjTokeiStep* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 0); + DynaPolyActor_Init(&this->dyna, 0); if ((globalCtx->sceneNum == 0x6F) && (gSaveContext.sceneSetupIndex == 2) && (globalCtx->csCtx.unk_12 == 0)) { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000968); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000968); ObjTokeiStep_InitSteps(this); ObjTokeiStep_SetupBeginOpen(this); } else if (!((CURRENT_DAY != 3) || (gSaveContext.time >= 0x4000)) || gSaveContext.day >= 4) { @@ -205,7 +205,7 @@ void ObjTokeiStep_Init(Actor* thisx, GlobalContext* globalCtx) { ObjTokeiStep_InitStepsOpen(this); ObjTokeiStep_SetupDoNothingOpen(this); } else { - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000968); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000968); ObjTokeiStep_InitSteps(this); ObjTokeiStep_SetupDoNothing(this); } diff --git a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c index 23178e9c1f..5f5b25cb3e 100644 --- a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c +++ b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c @@ -40,8 +40,8 @@ void ObjVisiblock_Init(Actor* thisx, GlobalContext* globalCtx) { ObjVisiblock* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - BcCheck3_BgActorInit(&this->dyna, 0); - BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000AD0); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000AD0); } void ObjVisiblock_Destroy(Actor* thisx, GlobalContext* globalCtx) { diff --git a/tools/disasm/files.txt b/tools/disasm/files.txt index 8dc09cca4a..bf786209cc 100644 --- a/tools/disasm/files.txt +++ b/tools/disasm/files.txt @@ -366,7 +366,6 @@ 0x800BFB80 : "z_bgcheck", 0x800CAAD0 : "z_bg_collect", 0x800CAE10 : "z_bg_item", - 0x800CB000 : "code_800CB000", 0x800CB210 : "z_camera", 0x800E03A0 : "z_collision_btltbls", 0x800E0400 : "[PADDING]", @@ -592,7 +591,7 @@ 0x801DC9D0 : "z_actor", 0x801DCBB0 : "z_actor_dlftbls", 0x801DCC00 : "z_bgcheck", - 0x801DCDB0 : "code_800CB000", + 0x801DCDB0 : "z_bg_item", 0x801DCDC0 : "z_camera", 0x801DD5C0 : "z_collision_check", 0x801DD600 : "z_debug_mode", diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index b6ec70b65b..7dab11b4dd 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -1096,22 +1096,22 @@ 0x800CAC0C:("BgCheck2_UpdateActorYRotation",), 0x800CACA0:("BgCheck2_AttachToMesh",), 0x800CAD2C:("BgCheck2_UpdateActorAttachedToMesh",), - 0x800CAE10:("BcCheck3_BgActorInit",), - 0x800CAE34:("BgCheck3_LoadMesh",), - 0x800CAE7C:("BgCheck3_ResetFlags",), - 0x800CAE88:("func_800CAE88",), - 0x800CAE9C:("func_800CAE9C",), - 0x800CAEB0:("func_800CAEB0",), - 0x800CAEE0:("func_800CAEE0",), - 0x800CAEF4:("func_800CAEF4",), - 0x800CAF24:("func_800CAF24",), - 0x800CAF38:("func_800CAF38",), - 0x800CAF4C:("func_800CAF4C",), - 0x800CAF70:("func_800CAF70",), - 0x800CAF94:("func_800CAF94",), - 0x800CAFB8:("func_800CAFB8",), - 0x800CAFDC:("func_800CAFDC",), - 0x800CB000:("func_800CB000",), + 0x800CAE10:("DynaPolyActor_Init",), + 0x800CAE34:("DynaPolyActor_LoadMesh",), + 0x800CAE7C:("DynaPolyActor_ResetState",), + 0x800CAE88:("DynaPolyActor_SetRidingFallingState",), + 0x800CAE9C:("DynaPolyActor_SetRidingMovingState",), + 0x800CAEB0:("DynaPolyActor_SetRidingMovingStateByIndex",), + 0x800CAEE0:("DynaPolyActor_SetRidingRotatingState",), + 0x800CAEF4:("DynaPolyActor_SetRidingRotatingStateByIndex",), + 0x800CAF24:("DynaPolyActor_SetSwitchPressedState",), + 0x800CAF38:("DynaPolyActor_SetHeavySwitchPressedState",), + 0x800CAF4C:("DynaPolyActor_IsInRidingFallingState",), + 0x800CAF70:("DynaPolyActor_IsInRidingMovingState",), + 0x800CAF94:("DynaPolyActor_IsInRidingRotatingState",), + 0x800CAFB8:("DynaPolyActor_IsInSwitchPressedState",), + 0x800CAFDC:("DynaPolyActor_IsInHeavySwitchPressedState",), + 0x800CB000:("DynaPolyActor_ValidateMove",), 0x800CB210:("Camera_fabsf",), 0x800CB240:("Camera_LengthVec3f",), 0x800CB270:("func_800CB270",), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 9737ede4dd..44250fc0c4 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -610,22 +610,22 @@ asm/non_matchings/code/z_bg_collect/BgCheck2_UpdateActorPosition.s,BgCheck2_Upda asm/non_matchings/code/z_bg_collect/BgCheck2_UpdateActorYRotation.s,BgCheck2_UpdateActorYRotation,0x800CAC0C,0x25 asm/non_matchings/code/z_bg_collect/BgCheck2_AttachToMesh.s,BgCheck2_AttachToMesh,0x800CACA0,0x23 asm/non_matchings/code/z_bg_collect/BgCheck2_UpdateActorAttachedToMesh.s,BgCheck2_UpdateActorAttachedToMesh,0x800CAD2C,0x39 -asm/non_matchings/code/z_bg_item/BcCheck3_BgActorInit.s,BcCheck3_BgActorInit,0x800CAE10,0x9 -asm/non_matchings/code/z_bg_item/BgCheck3_LoadMesh.s,BgCheck3_LoadMesh,0x800CAE34,0x12 -asm/non_matchings/code/z_bg_item/BgCheck3_ResetFlags.s,BgCheck3_ResetFlags,0x800CAE7C,0x3 -asm/non_matchings/code/z_bg_item/func_800CAE88.s,func_800CAE88,0x800CAE88,0x5 -asm/non_matchings/code/z_bg_item/func_800CAE9C.s,func_800CAE9C,0x800CAE9C,0x5 -asm/non_matchings/code/z_bg_item/func_800CAEB0.s,func_800CAEB0,0x800CAEB0,0xC -asm/non_matchings/code/z_bg_item/func_800CAEE0.s,func_800CAEE0,0x800CAEE0,0x5 -asm/non_matchings/code/z_bg_item/func_800CAEF4.s,func_800CAEF4,0x800CAEF4,0xC -asm/non_matchings/code/z_bg_item/func_800CAF24.s,func_800CAF24,0x800CAF24,0x5 -asm/non_matchings/code/z_bg_item/func_800CAF38.s,func_800CAF38,0x800CAF38,0x5 -asm/non_matchings/code/z_bg_item/func_800CAF4C.s,func_800CAF4C,0x800CAF4C,0x9 -asm/non_matchings/code/z_bg_item/func_800CAF70.s,func_800CAF70,0x800CAF70,0x9 -asm/non_matchings/code/z_bg_item/func_800CAF94.s,func_800CAF94,0x800CAF94,0x9 -asm/non_matchings/code/z_bg_item/func_800CAFB8.s,func_800CAFB8,0x800CAFB8,0x9 -asm/non_matchings/code/z_bg_item/func_800CAFDC.s,func_800CAFDC,0x800CAFDC,0x9 -asm/non_matchings/code/code_800CB000/func_800CB000.s,func_800CB000,0x800CB000,0x84 +asm/non_matchings/code/z_bg_item/DynaPoly_Init.s,DynaPoly_Init,0x800CAE10,0x9 +asm/non_matchings/code/z_bg_item/DynaPoly_LoadMesh.s,DynaPoly_LoadMesh,0x800CAE34,0x12 +asm/non_matchings/code/z_bg_item/DynaPoly_ResetState.s,DynaPoly_ResetState,0x800CAE7C,0x3 +asm/non_matchings/code/z_bg_item/DynaPoly_SetRidingFallingState.s,DynaPoly_SetRidingFallingState,0x800CAE88,0x5 +asm/non_matchings/code/z_bg_item/DynaPoly_SetRidingMovingState.s,DynaPoly_SetRidingMovingState,0x800CAE9C,0x5 +asm/non_matchings/code/z_bg_item/DynaPoly_SetRidingMovingStateByIndex.s,DynaPoly_SetRidingMovingStateByIndex,0x800CAEB0,0xC +asm/non_matchings/code/z_bg_item/DynaPoly_SetRidingRotatingState.s,DynaPoly_SetRidingRotatingState,0x800CAEE0,0x5 +asm/non_matchings/code/z_bg_item/DynaPoly_SetRidingRotatingStateByIndex.s,DynaPoly_SetRidingRotatingStateByIndex,0x800CAEF4,0xC +asm/non_matchings/code/z_bg_item/DynaPoly_SetSwitchPressedState.s,DynaPoly_SetSwitchPressedState,0x800CAF24,0x5 +asm/non_matchings/code/z_bg_item/DynaPoly_SetHeavySwitchPressedState.s,DynaPoly_SetHeavySwitchPressedState,0x800CAF38,0x5 +asm/non_matchings/code/z_bg_item/DynaPoly_IsInRidingFallingState.s,DynaPoly_IsInRidingFallingState,0x800CAF4C,0x9 +asm/non_matchings/code/z_bg_item/DynaPoly_IsInRidingMovingState.s,DynaPoly_IsInRidingMovingState,0x800CAF70,0x9 +asm/non_matchings/code/z_bg_item/DynaPoly_IsInRidingRotatingState.s,DynaPoly_IsInRidingRotatingState,0x800CAF94,0x9 +asm/non_matchings/code/z_bg_item/DynaPoly_IsInSwitchPressedState.s,DynaPoly_IsInSwitchPressedState,0x800CAFB8,0x9 +asm/non_matchings/code/z_bg_item/DynaPoly_IsInHeavySwitchPressedState.s,DynaPoly_IsInHeavySwitchPressedState,0x800CAFDC,0x9 +asm/non_matchings/code/z_bg_item/DynaPoly_ValidateMove.s,DynaPoly_ValidateMove,0x800CB000,0x84 asm/non_matchings/code/z_camera/Camera_fabsf.s,Camera_fabsf,0x800CB210,0xC asm/non_matchings/code/z_camera/Camera_LengthVec3f.s,Camera_LengthVec3f,0x800CB240,0xC asm/non_matchings/code/z_camera/func_800CB270.s,func_800CB270,0x800CB270,0x30