diff --git a/include/functions.h b/include/functions.h index 3223aa6245..aff556e4c0 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1503,7 +1503,7 @@ s16 ActorCutscene_GetCurrentIndex(void); ActorCutscene* ActorCutscene_GetCutscene(s16 index); s16 ActorCutscene_GetAdditionalCutscene(s16 index); s16 ActorCutscene_GetLength(s16 index); -// void func_800F2138(void); +s32 func_800F2138(s8 arg0); s32 func_800F2178(s16 arg0); s16 ActorCutscene_GetCurrentCamera(s16 index); // void func_800F21CC(void); diff --git a/spec b/spec index f6871e38b9..0909055e85 100644 --- a/spec +++ b/spec @@ -2126,8 +2126,7 @@ beginseg name "ovl_Obj_Comb" compress include "build/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.o" - include "build/data/ovl_Obj_Comb/ovl_Obj_Comb.data.o" - include "build/data/ovl_Obj_Comb/ovl_Obj_Comb.reloc.o" + include "build/src/overlays/actors/ovl_Obj_Comb/ovl_Obj_Comb_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 4a82c76098..f406340448 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -5,6 +5,7 @@ */ #include "z_obj_comb.h" +#include "objects/object_comb/object_comb.h" #define FLAGS 0x00000000 @@ -15,11 +16,12 @@ void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx); void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx); void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx); +void func_8098DC44(ObjComb* this); void func_8098DC60(ObjComb* this, GlobalContext* globalCtx); void func_8098DEA0(ObjComb* this, GlobalContext* globalCtx); +void func_8098E098(ObjComb* this); void func_8098E0B8(ObjComb* this, GlobalContext* globalCtx); -#if 0 const ActorInit Obj_Comb_InitVars = { ACTOR_OBJ_COMB, ACTORCAT_PROP, @@ -32,71 +34,538 @@ const ActorInit Obj_Comb_InitVars = { (ActorFunc)ObjComb_Draw, }; -// static ColliderJntSphElementInit sJntSphElementsInit[1] = { -static ColliderJntSphElementInit D_8098E440[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x05CBFFBE, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x05CBFFBE, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 15 }, 100 }, }, }; -// static ColliderJntSphInit sJntSphInit = { -static ColliderJntSphInit D_8098E464 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_2, COLSHAPE_JNTSPH, }, - 1, D_8098E440, // sJntSphElementsInit, +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, + 1, + sJntSphElementsInit, }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_8098E474[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1200, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_STOP), }; -#endif +s32 func_8098CE40(ObjComb* this, GlobalContext* globalCtx) { + s32 phi_a2 = -1; + s32 temp_v0 = (OBJCOMB_GET_1F(&this->actor) << 2) | 0xFF01; -extern ColliderJntSphElementInit D_8098E440[1]; -extern ColliderJntSphInit D_8098E464; -extern InitChainEntry D_8098E474[]; + if ((u8)temp_v0 & 3) { + phi_a2 = ((temp_v0 & 0x3FC) >> 2) & 0xFF; + } -extern UNK_TYPE D_06000CB0; -extern UNK_TYPE D_06001040; + return ((phi_a2 < 0) == 1) || !Flags_GetTreasure(globalCtx, phi_a2); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098CE40.s") +void func_8098CEAC(ObjComb* this, GlobalContext* globalCtx) { + Vec3f spDC; + Vec3f spD0; + Vec3f spC4; + s32 i; + f32 temp_f20; + s16 temp_s2 = 0; + s16 temp_f10; + s32 phi_s0; + s32 phi_v0; + s32 phi_s1; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098CEAC.s") + for (i = 0; i < 31; i++) { + temp_s2 += 0x4E20; + temp_f20 = Rand_ZeroOne() * 10.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D19C.s") + spDC.x = Math_SinS(temp_s2) * temp_f20; + spDC.y = (i - 15) * 0.7f; + spDC.z = Math_CosS(temp_s2) * temp_f20; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D47C.s") + Math_Vec3f_Sum(&spDC, &this->actor.world.pos, &spD0); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D6E0.s") + spC4.x = (Rand_ZeroOne() - 0.5f) + (spDC.x * 0.5f); + spC4.y = (Rand_ZeroOne() - 0.5f) + (spDC.y * 0.6f); + spC4.z = (Rand_ZeroOne() - 0.5f) + (spDC.z * 0.5f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D870.s") + temp_f10 = (Rand_ZeroOne() * 72.0f) + 25.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D8C8.s") + if (temp_f10 < 40) { + phi_s0 = -200; + phi_s1 = 40; + } else if (temp_f10 < 70) { + phi_s0 = -280; + phi_s1 = 30; + } else { + phi_s0 = -340; + phi_s1 = 20; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D99C.s") + temp_f20 = Rand_ZeroOne(); + if (temp_f20 < 0.1f) { + phi_v0 = 0x60; + } else if (temp_f20 < 0.8f) { + phi_v0 = 0x40; + } else { + phi_v0 = 0x20; + } + EffectSsKakera_Spawn(globalCtx, &spD0, &spC4, &spD0, phi_s0, phi_v0, phi_s1, 4, 0, temp_f10, 0, 0, 60, -1, + OBJECT_COMB, object_comb_DL_001040); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DA74.s") + spD0.x = this->actor.world.pos.x; + spD0.y = this->actor.world.pos.y - 10.0f; + spD0.z = this->actor.world.pos.z; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/ObjComb_Init.s") + func_800BBFB0(globalCtx, &spD0, 40.0f, 6, 70, 60, 1); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/ObjComb_Destroy.s") +void func_8098D19C(ObjComb* this, GlobalContext* globalCtx) { + Vec3f spDC; + Vec3f spD0; + Vec3f spC4; + f32 temp_f20; + s16 temp_s2 = 0; + s16 temp_f8; + s32 phi_s0; + s32 phi_v0; + s32 phi_s1; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DC44.s") + for (i = 0; i < 31; i++) { + temp_s2 += 0x4E20; + temp_f20 = Rand_ZeroOne() * 10.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DC60.s") + spDC.x = Math_SinS(temp_s2) * temp_f20; + spDC.y = i * 0.7f; + spDC.z = Math_CosS(temp_s2) * temp_f20; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DE58.s") + Math_Vec3f_Sum(&spDC, &this->actor.world.pos, &spD0); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DEA0.s") + spC4.x = (Rand_ZeroOne() - 0.5f) + (spDC.x * 0.5f); + spC4.y = (Rand_ZeroOne() * 0.5f) + (spDC.y * 0.5f); + spC4.z = (Rand_ZeroOne() - 0.5f) + (spDC.z * 0.5f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098E098.s") + temp_f8 = (Rand_ZeroOne() * 72.0f) + 25.0f; + if (temp_f8 < 40) { + phi_s0 = -200; + phi_s1 = 40; + } else if (temp_f8 < 70) { + phi_s0 = -280; + phi_s1 = 30; + } else { + phi_s0 = -340; + phi_s1 = 20; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098E0B8.s") + temp_f20 = Rand_ZeroOne(); + if (temp_f20 < 0.1f) { + phi_v0 = 0x60; + } else if (temp_f20 < 0.8f) { + phi_v0 = 0x40; + } else { + phi_v0 = 0x20; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/ObjComb_Update.s") + EffectSsKakera_Spawn(globalCtx, &spD0, &spC4, &spD0, phi_s0, phi_v0, phi_s1, 4, 0, temp_f8, 0, 0, 60, -1, + OBJECT_COMB, object_comb_DL_001040); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/ObjComb_Draw.s") + spD0.x = this->actor.world.pos.x; + spD0.y = this->actor.world.pos.y + 20.0f; + spD0.z = this->actor.world.pos.z; + + func_800BBFB0(globalCtx, &spD0, 40.0f, 6, 70, 60, 1); +} + +void func_8098D47C(ObjComb* this, GlobalContext* globalCtx) { + Vec3f spD4; + Vec3f spC8; + Vec3f spBC; + f32 temp_f20; + s16 temp_s1 = 0; + s16 temp_f10; + s32 phi_s0; + s32 phi_v0; + s32 i; + + for (i = 0; i < 21; i++) { + temp_s1 += 0x4E20; + temp_f20 = Rand_ZeroOne() * 10.0f; + + spD4.x = Math_SinS(temp_s1) * temp_f20; + spD4.y = i * 0.25f; + spD4.z = Math_CosS(temp_s1) * temp_f20; + + Math_Vec3f_Sum(&spD4, &this->actor.world.pos, &spC8); + + spBC.x = (Rand_ZeroOne() - 0.5f) + (spD4.x * 0.5f); + spBC.y = Rand_ZeroOne() + (spD4.y * 0.6f) + 6.0f; + spBC.z = (Rand_ZeroOne() - 0.5f) + (spD4.z * 0.5f); + + temp_f10 = (Rand_ZeroOne() * 72.0f) + 25.0f; + if (temp_f10 < 40) { + phi_s0 = -100; + } else if (temp_f10 < 70) { + phi_s0 = -180; + } else { + phi_s0 = -240; + } + + if (Rand_ZeroOne() < 0.2f) { + phi_v0 = 0x40; + } else { + phi_v0 = 0x20; + } + + EffectSsKakera_Spawn(globalCtx, &spC8, &spBC, &spC8, phi_s0, phi_v0, 40, 0, 0, temp_f10, 0, 0, 80, -1, + OBJECT_COMB, object_comb_DL_001040); + } +} + +void func_8098D6E0(ObjComb* this, GlobalContext* globalCtx) { + s32 i; + Vec3f sp70; + f32 temp_f0; + f32 temp_f20; + s32 temp; + + sp70.y = this->actor.world.pos.y + this->actor.depthInWater; + + for (temp = 0, i = 0; i < 8; i++, temp += 0x2000) { + temp_f0 = Rand_ZeroOne(); + temp_f20 = ((1.0f - SQ(temp_f0)) * 14.0f) + 4.0f; + sp70.x = (Math_SinS((s32)(Rand_ZeroOne() * 8000.0f) + temp) * temp_f20) + this->actor.world.pos.x; + sp70.z = (Math_CosS((s32)(Rand_ZeroOne() * 8000.0f) + temp) * temp_f20) + this->actor.world.pos.z; + EffectSsGSplash_Spawn(globalCtx, &sp70, NULL, NULL, 0, 200); + } + + sp70.x = this->actor.world.pos.x; + sp70.z = this->actor.world.pos.z; + EffectSsGSplash_Spawn(globalCtx, &sp70, NULL, NULL, 0, 300); +} + +void func_8098D870(ObjComb* this, GlobalContext* globalCtx) { + s32 temp_v0 = func_800A8150(OBJCOMB_GET_3F(&this->actor)); + + if (temp_v0 >= 0) { + Item_DropCollectible(globalCtx, &this->actor.world.pos, ((OBJCOMB_GET_7F00(&this->actor)) << 8) | temp_v0); + } +} + +void func_8098D8C8(ObjComb* this, GlobalContext* globalCtx) { + s32 params = OBJCOMB_GET_F(&this->actor); + s32 i; + s32 phi_s5; + + if (this->actionFunc == func_8098DC60) { + phi_s5 = 2; + } else { + phi_s5 = 1; + } + this->unk_1B6 = 0; + + for (i = 0; i < params; i++) { + if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BEE, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, phi_s5)) { + this->unk_1B6 = 1; + } + } +} + +void func_8098D99C(ObjComb* this, GlobalContext* globalCtx) { + s32 params; + Actor* temp_v0; + + if (func_8098CE40(this, globalCtx)) { + params = (OBJCOMB_GET_1F(&this->actor) << 2) | 0xFF01; + temp_v0 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.home.rot.y, 0, params); + + if (temp_v0 != NULL) { + temp_v0->parent = &this->actor; + if (this->actionFunc == func_8098DC60) { + temp_v0->velocity.y = 8.0f; + temp_v0->speedXZ = 2.0f; + } else { + temp_v0->velocity.y = 10.0f; + temp_v0->speedXZ = 2.0f; + } + this->unk_1B6 = 1; + play_sound(NA_SE_SY_TRE_BOX_APPEAR); + } + } +} + +void func_8098DA74(ObjComb* this, GlobalContext* globalCtx) { + s32 temp_v0 = OBJCOMB_GET_8000(&this->actor) | OBJCOMB_GET_80(&this->actor); + + if (temp_v0 == 0) { + func_8098D870(this, globalCtx); + } else if (temp_v0 == 1) { + func_8098D8C8(this, globalCtx); + } else { + func_8098D99C(this, globalCtx); + } +} + +void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + ObjComb* this = THIS; + s32 sp2C = OBJCOMB_GET_8000(&this->actor) | OBJCOMB_GET_80(&this->actor); + + Actor_ProcessInitChain(&this->actor, sInitChain); + Collider_InitJntSph(globalCtx, &this->collider); + + if ((sp2C == 1) && OBJCOMB_GET_10(&this->actor) && (gSaveContext.weekEventReg[83] & 2)) { + Actor_MarkForDeath(&this->actor); + return; + } + + Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderElement); + + if ((sp2C == 0) && func_800A81A4(globalCtx, OBJCOMB_GET_3F(&this->actor), OBJCOMB_GET_7F00(&this->actor))) { + this->unk_1B7 = 1; + this->actor.flags |= ACTOR_FLAG_10; + } + + if ((sp2C != 2) || !func_8098CE40(this, globalCtx)) { + this->unk_1B8 = -1; + } + func_8098DC44(this); +} + +void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx) { + Collider_DestroyJntSph(globalCtx, &THIS->collider); +} + +void func_8098DC44(ObjComb* this) { + this->unk_1AC = 0x2EE0; + this->actionFunc = func_8098DC60; +} + +void func_8098DC60(ObjComb* this, GlobalContext* globalCtx) { + s32 temp_a0; + s8 temp_v0; + u32 temp_v1; + + this->unk_1AA += this->unk_1AC; + if (this->unk_1B3) { + this->collider.base.acFlags &= ~AC_HIT; + } + + this->unk_1A8 -= 0x32; + if (this->unk_1A8 < 0) { + this->unk_1A8 = 0; + } + + if (this->unk_1B3) { + if (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x0182C29C) { + func_8098CEAC(this, globalCtx); + func_8098DA74(this, globalCtx); + Actor_MarkForDeath(&this->actor); + } else { + s32 dmgFlags = this->collider.elements->info.acHitInfo->toucher.dmgFlags; + + if (dmgFlags & 0x13820) { + this->unk_1A8 = 0xDAC; + this->unk_1AC = 0x36B0; + } else { + this->unk_1A8 = 0x5DC; + this->unk_1AC = 0x2EE0; + } + + if ((this->unk_1B2 <= 0) && (dmgFlags & 0x13820)) { + if (this->unk_1B5 == 0) { + this->unk_1B5 = 1; + this->actor.flags |= ACTOR_FLAG_10; + } + this->unk_1B2 = 20; + } + } + } else { + if (this->unk_1B8 >= 0) { + if (this->unk_1B8 == 0) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); + if (Rand_ZeroOne() < 0.1f) { + this->unk_1B8 = Rand_S16Offset(40, 80); + } else { + this->unk_1B8 = 8; + } + } else { + this->unk_1B8--; + } + } + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } + + if (this->actor.update != NULL) { + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } + + this->actor.shape.rot.x = (s32)(Math_SinS(this->unk_1AA) * this->unk_1A8) + this->actor.home.rot.x; +} + +void func_8098DE58(ObjComb* this) { + this->actor.flags |= ACTOR_FLAG_10; + this->unk_1B4 = 100; + this->actor.terminalVelocity = -20.0f; + this->actor.gravity = -1.5f; + this->actor.speedXZ = 0.0f; + this->actionFunc = func_8098DEA0; +} + +void func_8098DEA0(ObjComb* this, GlobalContext* globalCtx) { + this->unk_1B4--; + if ((this->actor.bgCheckFlags & 1) || (this->unk_1B4 <= 0)) { + func_8098DA74(this, globalCtx); + if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 30.0f)) { + func_8098D47C(this, globalCtx); + } else { + func_8098D19C(this, globalCtx); + } + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_HONEYCOMB_BROKEN); + func_8098E098(this); + } else { + if (this->actor.bgCheckFlags & 0x40) { + func_8098D6E0(this, globalCtx); + } + + if (this->actor.bgCheckFlags & 0x20) { + this->actor.gravity = -0.5f; + this->actor.velocity.y *= 0.8f; + this->unk_1AE >>= 1; + this->unk_1B0 >>= 1; + } else { + this->actor.gravity = -1.5f; + this->actor.velocity.y *= 0.96f; + + this->unk_1AE += 0x1F4; + if (this->unk_1AE > 0x7D0) { + this->unk_1AE = 0x7D0; + } + + this->unk_1B0 += 0xC8; + if (this->unk_1B0 > 0x258) { + this->unk_1B0 = 0x258; + } + func_800B9010(&this->actor, NA_SE_EV_HONEYCOMB_FALL - SFX_FLAG); + } + + Actor_MoveWithGravity(&this->actor); + this->actor.shape.rot.x += this->unk_1AE; + this->actor.shape.rot.y += this->unk_1B0; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 12.0f, 0.0f, 5); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } +} + +void func_8098E098(ObjComb* this) { + this->actor.draw = NULL; + this->unk_1B4 = 20; + this->actionFunc = func_8098E0B8; +} + +void func_8098E0B8(ObjComb* this, GlobalContext* globalCtx) { + this->unk_1B4--; + if (this->unk_1B4 <= 0) { + Actor_MarkForDeath(&this->actor); + return; + } + + if ((this->unk_1B4 == 10) && (this->unk_1B6 != 0) && (this->unk_1B5 == 2) && (this->actor.cutscene >= 0)) { + if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { + func_800B7298(globalCtx, &this->actor, 4); + } + } +} + +void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjComb* this = THIS; + + this->unk_1B3 = (this->collider.base.acFlags & AC_HIT) != 0; + if (this->unk_1B3) { + this->collider.base.acFlags &= ~AC_HIT; + } + + if (this->unk_1B2 > 0) { + this->unk_1B2--; + if (this->unk_1B2 == 0) { + func_8098DE58(this); + } + } + + this->actionFunc(this, globalCtx); + + if (this->actor.update == NULL) { + if ((this->unk_1B5 == 2) && (func_800F2138(this->actor.cutscene) == -1)) { + ActorCutscene_Stop(this->actor.cutscene); + this->unk_1B5 = 0; + } + } else { + if (this->unk_1B5 != 0) { + Actor_SetFocus(&this->actor, 0.0f); + if (this->unk_1B5 == 1) { + if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (this->actor.cutscene >= 0) { + func_800B7298(globalCtx, &this->actor, 1); + } + + if (((OBJCOMB_GET_8000(&this->actor) | OBJCOMB_GET_80(&this->actor)) == 1) && + OBJCOMB_GET_10(&this->actor)) { + gSaveContext.weekEventReg[83] |= 2; + } + + this->unk_1B5 = 2; + } else { + ActorCutscene_SetIntentToPlay(this->actor.cutscene); + } + } + } + + if (this->unk_1B7 != 0) { + globalCtx->actorCtx.unk5 |= 8; + this->actor.flags |= ACTOR_FLAG_10; + } + } +} + +void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) { + ObjComb* this = THIS; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C28C(globalCtx->state.gfxCtx); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + (118.0f * this->actor.scale.y), + this->actor.world.pos.z, MTXMODE_NEW); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); + Matrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY); + Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY); + Matrix_InsertTranslation(0.0f, -(this->actor.scale.y * 118.0f), 0.0f, MTXMODE_APPLY); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, object_comb_DL_000CB0); + + Collider_UpdateSpheres(0, &this->collider); + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h index 303a3ed5e5..fc47df429b 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h @@ -7,10 +7,31 @@ struct ObjComb; typedef void (*ObjCombActionFunc)(struct ObjComb*, GlobalContext*); +#define OBJCOMB_GET_F(thisx) ((thisx)->params & 0xF) +#define OBJCOMB_GET_10(thisx) (((thisx)->params >> 4) & 0x1) +#define OBJCOMB_GET_1F(thisx) ((thisx)->params & 0x1F) +#define OBJCOMB_GET_3F(thisx) ((thisx)->params & 0x3F) +#define OBJCOMB_GET_80(thisx) (((thisx)->params >> 7) & 0x1) +#define OBJCOMB_GET_7F00(thisx) (((thisx)->params >> 0x8) & 0x7F) +#define OBJCOMB_GET_8000(thisx) (((thisx)->params >> 0xE) & 2) + typedef struct ObjComb { /* 0x0000 */ Actor actor; /* 0x0144 */ ObjCombActionFunc actionFunc; - /* 0x0148 */ char unk_148[0x74]; + /* 0x0148 */ ColliderJntSph collider; + /* 0x0168 */ ColliderJntSphElement colliderElement; + /* 0x01A8 */ s16 unk_1A8; + /* 0x01AA */ s16 unk_1AA; + /* 0x01AC */ s16 unk_1AC; + /* 0x01AE */ s16 unk_1AE; + /* 0x01B0 */ s16 unk_1B0; + /* 0x01B2 */ s8 unk_1B2; + /* 0x01B3 */ s8 unk_1B3; + /* 0x01B4 */ s8 unk_1B4; + /* 0x01B5 */ s8 unk_1B5; + /* 0x01B6 */ s8 unk_1B6; + /* 0x01B7 */ s8 unk_1B7; + /* 0x01B8 */ s8 unk_1B8; } ObjComb; // size = 0x1BC extern const ActorInit Obj_Comb_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 4a386640d3..90419cbcee 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -2009,11 +2009,6 @@ D_06002358 = 0x06002358; D_06000D10 = 0x06000D10; D_06000F00 = 0x06000F00; -// ovl_Obj_Comb - -D_06000CB0 = 0x06000CB0; -D_06001040 = 0x06001040; - // ovl_Obj_Danpeilift D_06000180 = 0x06000180;