diff --git a/spec b/spec index ec0af718ed..18c9e5a6b5 100644 --- a/spec +++ b/spec @@ -1498,8 +1498,7 @@ beginseg name "ovl_Obj_Bombiwa" compress include "build/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.o" - include "build/data/ovl_Obj_Bombiwa/ovl_Obj_Bombiwa.data.o" - include "build/data/ovl_Obj_Bombiwa/ovl_Obj_Bombiwa.reloc.o" + include "build/src/overlays/actors/ovl_Obj_Bombiwa/ovl_Obj_Bombiwa_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 0b91f6f5ff..8a09c6f01a 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -5,6 +5,7 @@ */ #include "z_obj_bombiwa.h" +#include "objects/object_bombiwa/object_bombiwa.h" #define FLAGS 0x00000000 @@ -14,10 +15,15 @@ void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx); void ObjBombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx); void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx); +s32 func_809393B0(Actor* thisx); +s32 func_80939470(Actor* thisx); +void func_80939EE0(ObjBombiwa* this); void func_80939EF4(ObjBombiwa* this, GlobalContext* globalCtx); +void func_8093A080(ObjBombiwa* this); void func_8093A1F0(ObjBombiwa* this, GlobalContext* globalCtx); +void func_8093A418(Actor* thisx, GlobalContext* globalCtx); +void func_8093A608(Actor* thisx, GlobalContext* globalCtx); -#if 0 const ActorInit Obj_Bombiwa_InitVars = { ACTOR_OBJ_BOMBIWA, ACTORCAT_PROP, @@ -30,70 +36,495 @@ const ActorInit Obj_Bombiwa_InitVars = { (ActorFunc)NULL, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_8093A940 = { - { COLTYPE_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x81C37FBE, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit1 = { + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x81C37FBE, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 55, 70, 0, { 0, 0, 0 } }, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_8093A96C = { - { COLTYPE_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x81C37BBE, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit2 = { + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x81C37BBE, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 75, 130, 0, { 0, 0, 0 } }, }; -// sColChkInfoInit -static CollisionCheckInfoInit D_8093A9B8 = { 0, 12, 60, MASS_IMMOVABLE }; +typedef struct { + /* 0x00 */ ColliderCylinderInit* collider; + /* 0x04 */ ActorShadowFunc unk_04; + /* 0x08 */ ActorFunc unk_08; + /* 0x0C */ s32 (*unk_0C)(Actor*); +} ObjBombiwaStruct2; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_8093A9C0[] = { +static ObjBombiwaStruct2 D_8093A998[] = { + { &sCylinderInit1, ActorShadow_DrawCircle, func_8093A418, func_809393B0 }, + { &sCylinderInit2, NULL, func_8093A608, func_80939470 }, +}; + +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; + +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 500, ICHAIN_STOP), }; -#endif +static s16 D_8093A9D0[] = { + 17, 14, 10, 8, 7, 5, 3, 2, +}; -extern ColliderCylinderInit D_8093A940; -extern ColliderCylinderInit D_8093A96C; -extern CollisionCheckInfoInit D_8093A9B8; -extern InitChainEntry D_8093A9C0[]; +static s16 D_8093A9E0[] = { + 16, 12, 8, 6, 5, 4, 3, 2, +}; -extern UNK_TYPE D_060009E0; -extern UNK_TYPE D_06004560; -extern UNK_TYPE D_06005990; +s32 func_809393B0(Actor* thisx) { + ObjBombiwa* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_809393B0.s") + if (this->collider.base.acFlags & AC_HIT) { + Actor* ac = this->collider.base.ac; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939470.s") + if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x80000000) { + if ((ac != NULL) && (Math3D_Vec3fDistSq(&this->actor.world.pos, &ac->world.pos) < SQ(150.0f))) { + return true; + } + } else if (this->collider.info.acHitInfo->toucher.dmgFlags & 8) { + if ((ac != NULL) && (Math3D_Vec3fDistSq(&this->actor.world.pos, &ac->world.pos) < SQ(95.0f))) { + return true; + } + } else if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x500) { + return true; + } + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093951C.s") +s32 func_80939470(Actor* thisx) { + ObjBombiwa* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939594.s") + if (this->collider.base.acFlags & AC_HIT) { + Actor* temp_v0 = this->collider.base.ac; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/ObjBombiwa_Init.s") + if (temp_v0 != NULL) { + if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x80000000) { + if (Math3D_Vec3fDistSq(&this->actor.world.pos, &temp_v0->world.pos) < SQ(175.0f)) { + return true; + } + } else if ((this->collider.info.acHitInfo->toucher.dmgFlags & 8) && + (Math3D_Vec3fDistSq(&this->actor.world.pos, &temp_v0->world.pos) < SQ(115.0f))) { + return true; + } + } + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/ObjBombiwa_Destroy.s") +s32 func_8093951C(ObjBombiwa* this, GlobalContext* globalCtx) { + s32 pad; + WaterBox* sp30; + f32 sp2C; + s32 sp28; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939794.s") + if (WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C, + &sp30, &sp28) && + (this->actor.world.pos.y < sp2C)) { + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939994.s") +void func_80939594(ObjBombiwa* this, GlobalContext* globalCtx) { + s32 pad; + Vec3f sp28; + s32 sp24; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939C50.s") + sp28.x = this->actor.world.pos.x; + sp28.y = this->actor.world.pos.y + 30.0f; + sp28.z = this->actor.world.pos.z; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939EE0.s") + this->actor.floorHeight = + BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &this->actor.floorPoly, &sp24, &this->actor, &sp28); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939EF4.s") +void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + ObjBombiwa* this = THIS; + s32 sp34 = OBJBOMBIWA_GET_100(&this->actor); + s32 pad2; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093A080.s") + Actor_ProcessInitChain(&this->actor, sInitChain); + Collider_InitCylinder(globalCtx, &this->collider); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093A1F0.s") + if (Flags_GetSwitch(globalCtx, OBJBOMBIWA_GET_7F(&this->actor))) { + Actor_MarkForDeath(&this->actor); + return; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/ObjBombiwa_Update.s") + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, D_8093A998[sp34].collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093A418.s") + if (sp34 == OBJBOMBIWA_100_0) { + if (this->actor.shape.rot.y == 0) { + this->actor.shape.rot.y = this->actor.world.rot.y = (u32)Rand_Next() >> 0x10; + } + func_80939594(this, globalCtx); + } + ActorShape_Init(&this->actor.shape, -200.0f, D_8093A998[sp34].unk_04, 9.8f); + this->actor.world.pos.y = this->actor.home.pos.y + 20.0f; + this->actor.draw = D_8093A998[sp34].unk_08; + if (func_8093951C(this, globalCtx)) { + this->unk_203 |= 1; + } + func_80939EE0(this); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093A608.s") +void ObjBombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx) { + Collider_DestroyCylinder(globalCtx, &THIS->collider); +} + +void func_80939794(ObjBombiwa* this, GlobalContext* globalCtx) { + Vec3f spB4; + Vec3f spA8; + s32 phi_v1; + s32 i; + + for (i = 0; i < ARRAY_COUNT(D_8093A9D0); i++) { + spB4.x = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.home.pos.x; + spB4.y = (Rand_ZeroOne() * 5.0f) + this->actor.home.pos.y + 8.0f; + spB4.z = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.home.pos.z; + + spA8.x = (Rand_ZeroOne() - 0.5f) * 15.0f; + spA8.y = (Rand_ZeroOne() * 16.0f) + 5.0f; + spA8.z = (Rand_ZeroOne() - 0.5f) * 15.0f; + + if (D_8093A9D0[i] > 10) { + phi_v1 = 0x25; + } else { + phi_v1 = 0x21; + } + EffectSsKakera_Spawn(globalCtx, &spB4, &spA8, &spB4, -400, phi_v1, 10, 2, 0, D_8093A9D0[i], 1, 0, 60, -1, + OBJECT_BOMBIWA, object_bombiwa_DL_0009E0); + } + + func_800BBFB0(globalCtx, &this->actor.world.pos, 60.0f, 8, 80, 140, 1); +} + +void func_80939994(GlobalContext* globalCtx, Vec3f* arg1) { + Vec3f spAC; + Vec3f spA0; + s16 phi_v0; + s16 life; + s32 i; + + for (i = 0; i < 16; i++) { + spAC.x = (Rand_ZeroOne() - 0.5f) * 80.0f; + spAC.y = Rand_ZeroOne() * 120.0f; + spAC.z = (Rand_ZeroOne() - 0.5f) * 80.0f; + + spA0.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + (spAC.x * 0.2f); + spA0.y = (Rand_ZeroOne() * 16.0f) + 5.0f; + spA0.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + (spAC.z * 0.2f); + + spAC.x += arg1->x; + spAC.y += arg1->y; + spAC.z += arg1->z; + + if (i >= 14) { + phi_v0 = 33; + life = 60; + } else if (i >= 12) { + phi_v0 = 65; + life = 60; + } else { + life = 40; + if (Rand_ZeroOne() < 0.7f) { + phi_v0 = 64; + } else { + phi_v0 = 32; + } + } + EffectSsKakera_Spawn(globalCtx, &spAC, &spA0, &spAC, -450, phi_v0, 15, 0, 0, i, 1, 0, life, -1, OBJECT_BOMBIWA, + object_bombiwa_DL_005990); + } + + func_800BBFB0(globalCtx, arg1, 120.0f, 3, 80, 140, 1); + + spAC.x = arg1->x; + spAC.y = arg1->y + 70.0f; + spAC.z = arg1->z; + + func_800BBFB0(globalCtx, &spAC, 120.0f, 3, 80, 140, 1); +} + +void func_80939C50(GlobalContext* globalCtx, Vec3f* arg1) { + Vec3f spBC; + Vec3f spB0; + s32 phi_v0; + s32 phi_s0; + s32 i; + + for (i = 0; i < ARRAY_COUNT(D_8093A9E0); i++) { + spBC.x = (Rand_ZeroOne() - 0.5f) * 15.0f; + spBC.y = (Rand_ZeroOne() - 0.2f) * 10.0f; + spBC.z = (Rand_ZeroOne() - 0.5f) * 15.0f; + + spB0.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + (spBC.x * 0.85f); + spB0.y = (Rand_ZeroOne() * 15.0f) + 8.0f; + spB0.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + (spBC.z * 0.85f); + + spBC.x += arg1->x; + spBC.y += arg1->y; + spBC.z += arg1->z; + + if (i == 0) { + phi_v0 = 33; + phi_s0 = 60; + } else if (i == 1) { + phi_v0 = 65; + phi_s0 = 60; + } else { + phi_s0 = 40; + if (Rand_ZeroOne() < 0.7f) { + phi_v0 = 64; + } else { + phi_v0 = 32; + } + } + EffectSsKakera_Spawn(globalCtx, &spBC, &spB0, &spBC, -450, phi_v0, 15, 0, 0, D_8093A9E0[i], 1, 0, phi_s0, -1, + OBJECT_BOMBIWA, object_bombiwa_DL_005990); + } + + func_800BBFB0(globalCtx, arg1, 60.0f, 4, 80, 140, 1); +} + +void func_80939EE0(ObjBombiwa* this) { + this->actionFunc = func_80939EF4; +} + +void func_80939EF4(ObjBombiwa* this, GlobalContext* globalCtx) { + s32 pad; + s32 params = OBJBOMBIWA_GET_100(&this->actor); + ObjBombiwaStruct2* sp28 = &D_8093A998[params]; + + if (this->collider.base.acFlags & AC_HIT) { + this->unk_202 = 5; + } + + if (sp28->unk_0C(&this->actor)) { + Flags_SetSwitch(globalCtx, OBJBOMBIWA_GET_7F(&this->actor)); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); + if (OBJBOMBIWA_GET_8000(&this->actor)) { + play_sound(NA_SE_SY_CORRECT_CHIME); + } + + if (params == OBJBOMBIWA_100_0) { + func_80939794(this, globalCtx); + Actor_MarkForDeath(&this->actor); + } else { + func_80939994(globalCtx, &this->actor.world.pos); + this->actor.flags |= ACTOR_FLAG_10; + func_8093A080(this); + } + } else { + this->collider.base.acFlags &= ~AC_HIT; + + if (this->actor.xzDistToPlayer < 1400.0f) { + if (this->unk_202 > 0) { + this->unk_202--; + if (this->unk_202 == 0) { + this->collider.base.colType = COLTYPE_HARD; + } else { + this->collider.base.colType = COLTYPE_NONE; + } + } + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } + } +} + +void func_8093A080(ObjBombiwa* this) { + ObjBombiwaStruct* ptr; + s16 phi_s2; + s32 i; + + for (i = 0, phi_s2 = 0; i < ARRAY_COUNT(this->unk_190); i++, phi_s2 += 0x4000) { + ptr = &this->unk_190[i]; + + ptr->unk_00 = (Rand_ZeroOne() * 0.1f) + 0.05f; + + ptr->unk_04.x = (Math_SinS(phi_s2) * 50.0f) + this->actor.world.pos.x; + ptr->unk_04.y = ((i + 1) * 31.0f) + this->actor.world.pos.y; + ptr->unk_04.z = (Math_CosS(phi_s2) * 50.0f) + this->actor.world.pos.z; + + ptr->unk_10 = i + 3.0f; + ptr->unk_14.x = phi_s2; + ptr->unk_14.y = (u32)Rand_Next() >> 0x10; + ptr->unk_14.z = 0; + ptr->unk_1A = 0; + } + + this->unk_200 = 0; + this->unk_201 = 80; + this->actionFunc = func_8093A1F0; +} + +void func_8093A1F0(ObjBombiwa* this, GlobalContext* globalCtx) { + s32 pad; + s32 i; + Vec3f sp9C; + ObjBombiwaStruct* ptr; + CollisionPoly* sp94; + s32 sp90; + f32 temp_f0; + s16 phi_s1; + + for (i = 0, phi_s1 = 0; i < ARRAY_COUNT(this->unk_190); i++, phi_s1 += 0x4000) { + ptr = &this->unk_190[i]; + + if (ptr->unk_1A != 0) { + continue; + } + + ptr->unk_10 -= 3.0f; + + ptr->unk_04.x += Math_SinS(phi_s1) * 1.5f; + ptr->unk_04.y += ptr->unk_10; + ptr->unk_04.z += Math_CosS(phi_s1) * 1.5f; + + ptr->unk_14.x += 0x5DC; + + sp9C.x = ptr->unk_04.x; + sp9C.y = ptr->unk_04.y + 30.0f; + sp9C.z = ptr->unk_04.z; + + temp_f0 = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &sp94, &sp90, &this->actor, &sp9C); + if ((temp_f0 <= (BGCHECK_Y_MIN + 10.0f)) || ((ptr->unk_04.y - (200.0f * ptr->unk_00)) < temp_f0)) { + this->unk_200++; + ptr->unk_1A = 1; + func_80939C50(globalCtx, &ptr->unk_04); + } + } + + this->unk_201--; + if ((this->unk_200 >= 4) || (this->unk_201 <= 0)) { + Actor_MarkForDeath(&this->actor); + } +} + +void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjBombiwa* this = THIS; + + this->actionFunc(this, globalCtx); +} + +void func_8093A418(Actor* thisx, GlobalContext* globalCtx) { + ObjBombiwa* this = THIS; + f32 sp28; + + if ((this->actor.projectedPos.z <= 2200.0f) || ((this->unk_203 & 1) && (this->actor.projectedPos.z < 2300.0f))) { + this->actor.shape.shadowAlpha = 160; + Gfx_DrawDListOpa(globalCtx, object_bombiwa_DL_0009E0); + return; + } + + if (this->actor.projectedPos.z < 2300.0f) { + OPEN_DISPS(globalCtx->state.gfxCtx); + + sp28 = (2300.0f - this->actor.projectedPos.z) * 2.55f; + + this->actor.shape.shadowAlpha = sp28 * (32.0f / 51); + func_8012C2DC(globalCtx->state.gfxCtx); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s32)sp28); + gSPDisplayList(POLY_XLU_DISP++, object_bombiwa_DL_000AF0); + + CLOSE_DISPS(globalCtx->state.gfxCtx); + } else { + this->actor.shape.shadowAlpha = 0; + } +} + +void func_8093A608(Actor* thisx, GlobalContext* globalCtx) { + s32 pad[8]; + ObjBombiwa* this = THIS; + f32 sp38; + s32 i; + ObjBombiwaStruct* ptr; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + if (this->actionFunc == func_80939EF4) { + if ((this->actor.projectedPos.z <= 2200.0f) || + ((this->unk_203 & 1) && (this->actor.projectedPos.z < 2300.0f))) { + func_8012C28C(globalCtx->state.gfxCtx); + + gSPSegment(POLY_OPA_DISP++, 0x08, D_801AEFA0); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x9B, 255, 255, 255, 255); + gSPDisplayList(POLY_OPA_DISP++, object_bombiwa_DL_004560); + + func_8012C2DC(globalCtx->state.gfxCtx); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, object_bombiwa_DL_004688); + } else if (this->actor.projectedPos.z < 2300.0f) { + sp38 = (2300.0f - this->actor.projectedPos.z) * 2.55f; + func_8012C2DC(globalCtx->state.gfxCtx); + + gSPSegment(POLY_XLU_DISP++, 0x08, D_801AEF88); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x9B, 255, 255, 255, (s32)sp38); + gSPDisplayList(POLY_XLU_DISP++, object_bombiwa_DL_004560); + } + } else { + func_8012C28C(globalCtx->state.gfxCtx); + + for (i = 0; i < ARRAY_COUNT(this->unk_190); i++) { + ptr = &this->unk_190[i]; + + if (ptr->unk_1A == 0) { + Matrix_SetStateRotationAndTranslation(ptr->unk_04.x, ptr->unk_04.y, ptr->unk_04.z, &ptr->unk_14); + Matrix_Scale(ptr->unk_00, ptr->unk_00, ptr->unk_00, 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_bombiwa_DL_005990); + } + } + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h index 36fafc7e6a..54d4024e99 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h @@ -7,9 +7,28 @@ struct ObjBombiwa; typedef void (*ObjBombiwaActionFunc)(struct ObjBombiwa*, GlobalContext*); +#define OBJBOMBIWA_GET_7F(thisx) ((thisx)->params & 0x7F) +#define OBJBOMBIWA_GET_100(thisx) (((thisx)->params >> 8) & 1) +#define OBJBOMBIWA_GET_8000(thisx) (((thisx)->params >> 0xF) & 1) + +#define OBJBOMBIWA_100_0 0 + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ Vec3f unk_04; + /* 0x10 */ f32 unk_10; + /* 0x14 */ Vec3s unk_14; + /* 0x1A */ s16 unk_1A; +} ObjBombiwaStruct; // size = 0x1C + typedef struct ObjBombiwa { /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0xC0]; + /* 0x0144 */ ColliderCylinder collider; + /* 0x0190 */ ObjBombiwaStruct unk_190[4]; + /* 0x0200 */ s8 unk_200; + /* 0x0201 */ s8 unk_201; + /* 0x0202 */ s8 unk_202; + /* 0x0203 */ u8 unk_203; /* 0x0204 */ ObjBombiwaActionFunc actionFunc; } ObjBombiwa; // size = 0x208 diff --git a/undefined_syms.txt b/undefined_syms.txt index d30baf7870..8182801cce 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -2003,14 +2003,6 @@ D_060014F0 = 0x060014F0; D_06007630 = 0x06007630; D_06009A88 = 0x06009A88; -// ovl_Obj_Bombiwa - -D_060009E0 = 0x060009E0; -D_06000AF0 = 0x06000AF0; -D_06004560 = 0x06004560; -D_06004688 = 0x06004688; -D_06005990 = 0x06005990; - // ovl_Obj_Chan D_06000A10 = 0x06000A10;