From 10bae68937139c4a4602dfa0d82c18b876bc3f75 Mon Sep 17 00:00:00 2001 From: cadmic Date: Sat, 24 Feb 2024 10:00:37 -0800 Subject: [PATCH] Match En actors A-C, and a few more (#1890) --- .../actors/ovl_Door_Warp1/z_door_warp1.c | 10 +-- src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c | 85 ++++++++++--------- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 8 ++ src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c | 8 ++ src/overlays/actors/ovl_En_Am/z_en_am.c | 14 ++- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 5 +- .../ovl_En_Attack_Niw/z_en_attack_niw.c | 5 +- src/overlays/actors/ovl_En_Ba/z_en_ba.c | 1 + src/overlays/actors/ovl_En_Bb/z_en_bb.c | 5 +- .../actors/ovl_En_Bdfire/z_en_bdfire.c | 7 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 3 +- src/overlays/actors/ovl_En_Bili/z_en_bili.c | 6 +- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 6 +- src/overlays/actors/ovl_En_Boom/z_en_boom.c | 2 + .../actors/ovl_En_Bubble/z_en_bubble.c | 2 + src/overlays/actors/ovl_En_Bw/z_en_bw.c | 5 +- src/overlays/actors/ovl_En_Bx/z_en_bx.c | 3 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 10 ++- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 5 +- tools/disasm/gc-eu-mq/functions.txt | 2 +- 20 files changed, 112 insertions(+), 80 deletions(-) diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 52c111c58a..dbddf17995 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -456,12 +456,10 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, PlayState* play) { } void DoorWarp1_ChildWarpIdle(DoorWarp1* this, PlayState* play) { - Player* player; - Actor_PlaySfx(&this->actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); if (DoorWarp1_PlayerInRange(this, play)) { - player = GET_PLAYER(play); + Player* player = GET_PLAYER(play); Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -830,12 +828,10 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { } void DoorWarp1_Destination(DoorWarp1* this, PlayState* play) { - f32 alphaFrac; + f32 alphaFrac = 1.0f; - this->warpTimer++; this->unk_194 = 5.0f; - - alphaFrac = 1.0f; + this->warpTimer++; if (this->warpTimer < 20) { alphaFrac = this->warpTimer / 20.f; } else if (this->warpTimer >= 60) { diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index 1c07031a0c..893360582f 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -273,31 +273,32 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) { Gfx_SetupDL_25Opa(gfxCtx); gDPPipeSync(POLY_XLU_DISP++); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 128, 128, 128, 255); - gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 0); initialPositions = this->initialPositions; distanceTraveled = this->distanceTraveled; + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 128, 128, 128, 255); + gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 0); gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL); - for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) { - if (!(*distanceTraveled < 1.0f)) { - continue; + for (i = 0; i < 64; i++) { + if (*distanceTraveled < 1.0f) { + aux = 1.0f - SQ(*distanceTraveled); + Matrix_Translate(this->actor.world.pos.x + (initialPositions->x * ((this->dx * aux) + (1.0f - this->dx))), + this->actor.world.pos.y + (initialPositions->y * ((this->dy * aux) + (1.0f - this->dy))), + this->actor.world.pos.z + (initialPositions->z * ((this->dz * aux) + (1.0f - this->dz))), + MTXMODE_NEW); + + Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, MTXMODE_APPLY); + Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); + + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 449), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); } - aux = 1.0f - SQ(*distanceTraveled); - Matrix_Translate(this->actor.world.pos.x + (initialPositions->x * ((this->dx * aux) + (1.0f - this->dx))), - this->actor.world.pos.y + (initialPositions->y * ((this->dy * aux) + (1.0f - this->dy))), - this->actor.world.pos.z + (initialPositions->z * ((this->dz * aux) + (1.0f - this->dz))), - MTXMODE_NEW); - - Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, MTXMODE_APPLY); - Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); - - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 449), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); + initialPositions++; + distanceTraveled++; } CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 458); @@ -318,6 +319,10 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) { Gfx_SetupDL_25Opa(gfxCtx); gDPPipeSync(POLY_XLU_DISP++); + + initialPositions = this->initialPositions; + distanceTraveled = this->distanceTraveled; + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); if (player->unk_858 >= 0.85f) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); @@ -325,34 +330,32 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) { gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0); } - initialPositions = this->initialPositions; - distanceTraveled = this->distanceTraveled; - gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL); - for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) { - if (!(*distanceTraveled < 1.0f)) { - continue; + for (i = 0; i < 64; i++) { + if (*distanceTraveled < 1.0f) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255); + + aux = 1.0f - SQ(*distanceTraveled); + + Matrix_Mult(&player->mf_9E0, MTXMODE_NEW); + + Matrix_Translate(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)), + initialPositions->y * (1.0f - *distanceTraveled) + 320.0f, + initialPositions->z * (1.0f - *distanceTraveled) + -20.0f, MTXMODE_APPLY); + + Matrix_Scale(*distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor, + *distanceTraveled * this->scalingFactor, MTXMODE_APPLY); + + Matrix_ReplaceRotation(&play->billboardMtxF); + + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 506), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); } - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255); - - aux = 1.0f - SQ(*distanceTraveled); - - Matrix_Mult(&player->mf_9E0, MTXMODE_NEW); - - Matrix_Translate(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)), - initialPositions->y * (1.0f - *distanceTraveled) + 320.0f, - initialPositions->z * (1.0f - *distanceTraveled) + -20.0f, MTXMODE_APPLY); - - Matrix_Scale(*distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor, - *distanceTraveled * this->scalingFactor, MTXMODE_APPLY); - - Matrix_ReplaceRotation(&play->billboardMtxF); - - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 506), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); + initialPositions++; + distanceTraveled++; } CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 515); diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index dfa44b0cd4..d326f93b5c 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -13,7 +13,9 @@ void ElfMsg_Init(Actor* thisx, PlayState* play); void ElfMsg_Destroy(Actor* thisx, PlayState* play); void ElfMsg_Update(Actor* thisx, PlayState* play); +#if OOT_DEBUG void ElfMsg_Draw(Actor* thisx, PlayState* play); +#endif void ElfMsg_CallNaviCuboid(ElfMsg* this, PlayState* play); void ElfMsg_CallNaviCylinder(ElfMsg* this, PlayState* play); @@ -27,7 +29,11 @@ ActorInit Elf_Msg_InitVars = { /**/ ElfMsg_Init, /**/ ElfMsg_Destroy, /**/ ElfMsg_Update, +#if OOT_DEBUG /**/ ElfMsg_Draw, +#else + /**/ NULL, +#endif }; static InitChainEntry sInitChain[] = { @@ -163,6 +169,7 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) { } } +#if OOT_DEBUG #include "assets/overlays/ovl_Elf_Msg/ovl_Elf_Msg.c" void ElfMsg_Draw(Actor* thisx, PlayState* play) { @@ -191,3 +198,4 @@ void ElfMsg_Draw(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_elf_msg.c", 457); } +#endif diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index d36f9813cb..0e94e73927 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -12,7 +12,9 @@ void ElfMsg2_Init(Actor* thisx, PlayState* play); void ElfMsg2_Destroy(Actor* thisx, PlayState* play); void ElfMsg2_Update(Actor* thisx, PlayState* play); +#if OOT_DEBUG void ElfMsg2_Draw(Actor* thisx, PlayState* play); +#endif s32 ElfMsg2_GetMessageId(ElfMsg2* this); void ElfMsg2_WaitUntilActivated(ElfMsg2* this, PlayState* play); @@ -27,7 +29,11 @@ ActorInit Elf_Msg2_InitVars = { /**/ ElfMsg2_Init, /**/ ElfMsg2_Destroy, /**/ ElfMsg2_Update, +#if OOT_DEBUG /**/ ElfMsg2_Draw, +#else + /**/ NULL, +#endif }; static InitChainEntry sInitChain[] = { @@ -147,6 +153,7 @@ void ElfMsg2_Update(Actor* thisx, PlayState* play) { } } +#if OOT_DEBUG #include "assets/overlays/ovl_Elf_Msg2/ovl_Elf_Msg2.c" void ElfMsg2_Draw(Actor* thisx, PlayState* play) { @@ -165,3 +172,4 @@ void ElfMsg2_Draw(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_elf_msg2.c", 367); } +#endif diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 932308eb20..de26bf1140 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -782,7 +782,6 @@ void EnAm_TransformSwordHitbox(Actor* thisx, PlayState* play) { void EnAm_UpdateDamage(EnAm* this, PlayState* play) { s32 pad; - Vec3f sparkPos; if (this->deathTimer == 0) { if (this->blockCollider.base.acFlags & AC_BOUNCED) { @@ -810,7 +809,8 @@ void EnAm_UpdateDamage(EnAm* this, PlayState* play) { this->dyna.actor.colChkInfo.health = 0; } } else if (this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_STUN) { - sparkPos = this->dyna.actor.world.pos; + Vec3f sparkPos = this->dyna.actor.world.pos; + sparkPos.y += 50.0f; CollisionCheck_SpawnShieldParticlesMetal(play, &sparkPos); } @@ -836,8 +836,6 @@ void EnAm_Update(Actor* thisx, PlayState* play) { EnBom* bomb; Vec3f dustPos; s32 i; - f32 dustPosScale; - s32 pad1; if (this->dyna.actor.params != ARMOS_STATUE) { EnAm_UpdateDamage(this, play); @@ -854,7 +852,8 @@ void EnAm_Update(Actor* thisx, PlayState* play) { this->deathTimer--; if (this->deathTimer == 0) { - dustPosScale = play->gameplayFrames * 10; + f32 dustPosScale = play->gameplayFrames * 10; + s32 pad1; EnAm_SpawnEffects(this, play); bomb = @@ -943,9 +942,9 @@ static Vec3f sIcePosOffsets[] = { }; void EnAm_Draw(Actor* thisx, PlayState* play) { - s32 pad; - Vec3f sp68; EnAm* this = (EnAm*)thisx; + Vec3f sp68; + s32 index; OPEN_DISPS(play->state.gfxCtx, "../z_en_am.c", 1580); @@ -959,7 +958,6 @@ void EnAm_Draw(Actor* thisx, PlayState* play) { this->iceTimer--; if ((this->iceTimer % 4) == 0) { - s32 index; index = this->iceTimer >> 2; diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 84a05c3b16..39b86fc6b3 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -246,8 +246,6 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) { s32 atTouched; u16 sfxId; Actor* hitActor; - Vec3f sp60; - Vec3f sp54; if (DECR(this->timer) == 0) { Actor_Kill(&this->actor); @@ -342,6 +340,9 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) { if (this->hitActor != NULL) { if (this->hitActor->update != NULL) { + Vec3f sp60; + Vec3f sp54; + Math_Vec3f_Sum(&this->unk_210, &this->unk_250, &sp60); Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_250, &sp54); diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index c5c4392382..f42593a57e 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -297,8 +297,6 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { EnAttackNiw* this = (EnAttackNiw*)thisx; EnNiw* cucco; Player* player = GET_PLAYER(play); - s32 pad; - Vec3f sp30; PlayState* play2 = play; this->unk_28C++; @@ -343,6 +341,9 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { } if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actionFunc != func_809B5C18)) { + Vec3f sp30; + s32 pad; + Math_Vec3f_Copy(&sp30, &this->actor.world.pos); sp30.y += this->actor.yDistToWater; EffectSsGSplash_Spawn(play, &sp30, NULL, NULL, 0, 0x190); diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 965df7954f..03528ef5e3 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -492,6 +492,7 @@ void EnBa_Draw(Actor* thisx, PlayState* play) { Matrix_RotateZYX(this->unk_2A8[i].x, this->unk_2A8[i].y, this->unk_2A8[i].z, MTXMODE_APPLY); Matrix_Scale(this->unk_200[i].x, this->unk_200[i].y, this->unk_200[i].z, MTXMODE_APPLY); if ((i == 6) || (i == 13)) { + if (mtx) {} switch (i) { case 13: Collider_UpdateSpheres(i, &this->collider); diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index b6bca7f72f..7ff5296e23 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -291,9 +291,10 @@ void EnBb_SpawnFlameTrail(PlayState* play, EnBb* this, s16 startAtZero) { void EnBb_KillFlameTrail(EnBb* this) { Actor* actor = &this->actor; + Actor* nextActor; while (actor->child != NULL) { - Actor* nextActor = actor->child; + nextActor = actor->child; if (nextActor->id == ACTOR_EN_BB) { nextActor->parent = NULL; @@ -408,10 +409,10 @@ void EnBb_Destroy(Actor* thisx, PlayState* play) { void EnBb_SetupFlameTrail(EnBb* this) { this->action = BB_FLAME_TRAIL; this->moveMode = BBMOVE_NOCLIP; - this->actor.flags &= ~ACTOR_FLAG_0; this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; this->actor.speed = 0.0f; + this->actor.flags &= ~ACTOR_FLAG_0; EnBb_SetupAction(this, EnBb_FlameTrail); } diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index 1febc79760..ba1920a321 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -121,9 +121,7 @@ void func_809BC2A4(EnBdfire* this, PlayState* play) { void func_809BC598(EnBdfire* this, PlayState* play) { s16 quarterTurn; Player* player = GET_PLAYER(play); - f32 distToBurn; BossDodongo* bossDodongo; - s16 i; bossDodongo = ((BossDodongo*)this->actor.parent); this->unk_158 = bossDodongo->unk_1A2; @@ -164,8 +162,11 @@ void func_809BC598(EnBdfire* this, PlayState* play) { return; } } else if (!player->bodyIsBurning) { - distToBurn = (this->actor.scale.x * 130.0f) / 4.2000003f; + f32 distToBurn = (this->actor.scale.x * 130.0f) / 4.2000003f; + if (this->actor.xyzDistToPlayerSq < SQ(distToBurn)) { + s16 i; + for (i = 0; i < 18; i++) { player->bodyFlameTimers[i] = Rand_S16Offset(0, 200); } diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index e58bd6b2a4..b982fa7ddb 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -837,6 +837,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, temp_f0, temp_f0, temp_f0, 255); + if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1945); } } else if (limbIndex == 10) { @@ -848,7 +849,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec } gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, intensity, intensity, intensity, intensity); - + if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1972); } else if (limbIndex == 17 && this->actionFunc == func_809BE26C) { if (this->unk_198 < 5) { diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index de0a12eebf..6410634593 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -143,12 +143,12 @@ void EnBili_SetupFloatIdle(EnBili* this) { this->actor.speed = 0.7f; this->collider.elem.bumper.effect = 1; // Shock? this->timer = 32; - this->collider.base.atFlags |= AT_ON; - this->collider.base.acFlags |= AC_ON; - this->actionFunc = EnBili_FloatIdle; this->actor.home.pos.y = this->actor.world.pos.y; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; + this->collider.base.atFlags |= AT_ON; + this->collider.base.acFlags |= AC_ON; + this->actionFunc = EnBili_FloatIdle; } /** diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 6d0ecbc276..d091fbe3a0 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -474,7 +474,7 @@ Gfx* EnBombf_NewMtxDList(GraphicsContext* gfxCtx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); gSPMatrix(displayListHead++, MATRIX_NEW(gfxCtx, "../z_en_bombf.c", 1021), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPEndDisplayList(displayListHead); + gSPEndDisplayList(displayListHead++); return displayList; } @@ -482,8 +482,6 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) { s32 pad; EnBombf* this = (EnBombf*)thisx; - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1034); if (thisx->params <= BOMBFLOWER_BODY) { @@ -510,5 +508,7 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) { Collider_UpdateSpheres(0, &this->explosionCollider); } + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1063); } diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 579cc5920b..a92aa86d5e 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -272,5 +272,7 @@ void EnBoom_Draw(Actor* thisx, PlayState* play) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gBoomerangRefDL); + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_boom.c", 604); } diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 23f49a4625..d8082a7973 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -425,6 +425,8 @@ void EnBubble_Draw(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_XLU_DISP++, gBubbleDL); } + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_bubble.c", 1226); if (this->actionFunc != EnBubble_Disappear) { diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 4a5b89f85c..1516d57d55 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -859,7 +859,7 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) { POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnBw_OverrideLimbDraw, NULL, this, POLY_OPA_DISP); } else { - Gfx_SetupDL_25Xlu(play->state.gfxCtx); + Gfx_SetupDL_25Xlu(play2->state.gfxCtx); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 0, 0, 0, this->color1.a); gDPSetEnvColor(POLY_XLU_DISP++, this->color1.r, this->color1.g, this->color1.b, this->color1.a); @@ -906,5 +906,8 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) { EffectSsEnIce_SpawnFlyingVec3f(play, thisx, &icePos, 0x96, 0x96, 0x96, 0xFA, 0xEB, 0xF5, 0xFF, 1.3f); } } + + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_bw.c", 1521); } diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index 0e6b72e037..35f1565912 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -205,6 +205,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) { s32 pad; Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Mtx)); s16 i; + s16 off; OPEN_DISPS(play->state.gfxCtx, "../z_en_bx.c", 464); @@ -226,7 +227,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) { thisx->scale.z = thisx->scale.x = (Math_CosS(this->unk_14E) * 0.0075f) + 0.015f; for (i = 3; i >= 0; i--) { - s16 off = (0x2000 * i); + off = (0x2000 * i); this->unk_184[i].z = this->unk_184[i].x = (Math_CosS(this->unk_14E + off) * 0.0075f) + 0.015f; this->unk_1B4[i].x = thisx->shape.rot.x; diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index f415f0f100..f13b19221f 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -283,11 +283,15 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) { * This is used for the ground flash display lists and Arwing shadow display lists to snap onto the floor. */ void EnClearTag_CalculateFloorTangent(EnClearTag* this) { + f32 x; + f32 y; + f32 z; + // If there is a floor poly below the Arwing, calculate the floor tangent. if (this->actor.floorPoly != NULL) { - f32 x = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x); - f32 y = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y); - f32 z = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z); + x = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x); + y = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y); + z = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z); this->floorTangent.x = -Math_FAtan2F(-z * y, 1.0f); this->floorTangent.z = Math_FAtan2F(-x * y, 1.0f); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index caa64d3009..3cd26ef460 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -285,8 +285,6 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { void EnCrow_DiveAttack(EnCrow* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 facingPlayer; - Vec3f pos; - s16 target; SkelAnime_Update(&this->skelAnime); if (this->timer != 0) { @@ -296,6 +294,9 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) { facingPlayer = Actor_IsFacingPlayer(&this->actor, 0x2800); if (facingPlayer) { + Vec3f pos; + s16 target; + pos.x = player->actor.world.pos.x; pos.y = player->actor.world.pos.y + 20.0f; pos.z = player->actor.world.pos.z; diff --git a/tools/disasm/gc-eu-mq/functions.txt b/tools/disasm/gc-eu-mq/functions.txt index cd5d63da24..9fc04e5137 100644 --- a/tools/disasm/gc-eu-mq/functions.txt +++ b/tools/disasm/gc-eu-mq/functions.txt @@ -7460,7 +7460,7 @@ EnCs_ChangeAnim = 0x809CD450; // type:func EnCs_Init = 0x809CD574; // type:func EnCs_Destroy = 0x809CD708; // type:func EnCs_GetTalkState = 0x809CD734; // type:func -EnCs_GetTextID = 0x809CD868; // type:func +EnCs_GetTextId = 0x809CD868; // type:func EnCs_HandleTalking = 0x809CD8EC; // type:func EnCs_GetwaypointCount = 0x809CDA38; // type:func EnCs_GetPathPoint = 0x809CDA4C; // type:func