matched ovl_Bg_Ikana_Bombwall && ovl_Bg_Haka_Bombwall NON_MATCHING effect functions (#1096)

* progress

* 1 non matching + reloc issues?

* final details

* format

* final details

* reverting changes to ovl_Bg_Kin2_Bombwall

* undefined_syms

* undef

* warnings

* pr review

* fix non_matchings

* pr review

* numbers

* few renames

* names

* pos
This commit is contained in:
Alejandro Asenjo 2022-10-27 22:14:42 -03:00 committed by GitHub
parent 7b81d6e950
commit d76266d91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 101 additions and 98 deletions

10
spec
View File

@ -4421,11 +4421,7 @@ beginseg
name "ovl_Bg_Ikana_Bombwall"
compress
include "build/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.o"
#ifdef NON_MATCHING
include "build/src/overlays/actors/ovl_Bg_Ikana_Bombwall/ovl_Bg_Ikana_Bombwall_reloc.o"
#else
include "build/data/ovl_Bg_Ikana_Bombwall/ovl_Bg_Ikana_Bombwall.reloc.o"
#endif
endseg
beginseg
@ -4446,11 +4442,7 @@ beginseg
name "ovl_Bg_Haka_Bombwall"
compress
include "build/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.o"
#ifdef NON_MATCHING
include "build/src/overlays/actors/ovl_Bg_Haka_Bombwall/ovl_Bg_Haka_Bombwall_reloc.o"
#else
include "build/data/ovl_Bg_Haka_Bombwall/ovl_Bg_Haka_Bombwall.reloc.o"
#endif
include "build/src/overlays/actors/ovl_Bg_Haka_Bombwall/ovl_Bg_Haka_Bombwall_reloc.o"
endseg
beginseg

View File

@ -56,7 +56,7 @@ static ColliderCylinderInit sCylinderInit = {
{ 80, 80, 0, { 0, 0, 0 } },
};
static s16 D_80BD64CC[4] = { 24, 15, 10, 5 };
static s16 sRockScales[4] = { 24, 15, 10, 5 };
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
@ -75,76 +75,83 @@ s32 func_80BD5E00(BgHakaBombwall* this) {
return false;
}
#ifdef NON_MATCHING
void func_80BD5E6C(BgHakaBombwall* this, PlayState* play) {
s32 i;
Vec3f spE0;
Vec3f spD4;
Vec3f spC8;
Vec3f spBC;
f32 temp_fs0;
f32 phi_fs1;
u32 i;
Vec3f pos;
Vec3f vel;
Vec3f posOffset;
Vec3f velOffset;
f32 offsetPosX;
f32 offsetPosY;
s16 scale;
s16 phi_s0;
s16 gravity;
s16 phi_t0;
s16 gravity;
Matrix_Push();
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
temp_fs0 = 0.0f;
phi_fs1 = 0.0f;
offsetPosX = 0.0f;
offsetPosY = 0.0f;
for (i = 0; i < 30; i++) {
temp_fs0 += 60.0f + (Rand_ZeroOne() * 20.0f);
if (temp_fs0 > 75.0f) {
temp_fs0 -= 150.0f;
offsetPosX += 60.0f + (Rand_ZeroOne() * 20.0f);
if (offsetPosX > 75.0f) {
offsetPosX -= 150.0f;
}
spC8.x = temp_fs0;
phi_fs1 += 5;
spC8.y = phi_fs1;
offsetPosY += 5;
spC8.z = (Rand_ZeroOne() * 20.0f) - 10.0f;
posOffset.x = offsetPosX;
posOffset.y = offsetPosY;
posOffset.z = (Rand_ZeroOne() * 20.0f) - 10.0f;
spBC.x = ((Rand_ZeroOne() - 0.5f) * 5.0f) + (temp_fs0 * (4.0f / 75.0f));
spBC.y = (Rand_ZeroOne() * 7.0f) - 2.0f;
spBC.z = (Rand_ZeroOne() * 4.0f) - 2.0f;
velOffset.x = ((Rand_ZeroOne() - 0.5f) * 5.0f) + (offsetPosX * (4.0f / 75.0f));
velOffset.y = (Rand_ZeroOne() * 7.0f) - 2.0f;
velOffset.z = (Rand_ZeroOne() * 4.0f) - 2.0f;
Matrix_MultVec3f(&spC8, &spE0);
Matrix_MultVec3f(&spBC, &spD4);
Matrix_MultVec3f(&posOffset, &pos);
Matrix_MultVec3f(&velOffset, &vel);
spE0.x += this->dyna.actor.world.pos.x;
spE0.y += this->dyna.actor.world.pos.y;
spE0.z += this->dyna.actor.world.pos.z;
pos.x += this->dyna.actor.world.pos.x;
pos.y += this->dyna.actor.world.pos.y;
pos.z += this->dyna.actor.world.pos.z;
//! FAKE
if (1) {}
if ((i & 3) == 0) {
phi_s0 = 32;
func_800BBFB0(play, &spE0, 60.0f, 2, 100, 120, 1);
func_800BBFB0(play, &pos, 60.0f, 2, 100, 120, 1);
} else {
phi_s0 = 64;
}
if (i % 2 != 0) {
if ((i % 2) != 0) {
phi_s0 |= 1;
phi_t0 = 1;
} else {
phi_t0 = 0;
}
if (D_80BD64CC[i & 3] >= 16) {
scale = sRockScales[i & (ARRAY_COUNT(sRockScales) - 1)];
//! FAKE
fake_label:;
if (scale >= 16) {
gravity = -550;
} else {
gravity = -450;
}
EffectSsKakera_Spawn(play, &spE0, &spD4, &spE0, gravity, phi_s0, 30, 0, 0, D_80BD64CC[i & 3], phi_t0, 0, 50, -1,
EffectSsKakera_Spawn(play, &pos, &vel, &pos, gravity, phi_s0, 30, 0, 0, scale, phi_t0, 0, 50, -1,
OBJECT_HAKA_OBJ, object_haka_obj_DL_001680);
}
Matrix_Pop();
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD5E6C.s")
#endif
void BgHakaBombwall_Init(Actor* thisx, PlayState* play) {
s32 pad;

View File

@ -96,50 +96,53 @@ Gfx* D_80BD52E0[] = {
object_ikana_obj_DL_000048,
};
#ifdef NON_MATCHING
void func_80BD4720(BgIkanaBombwall* this, PlayState* play) {
s32 i;
Vec3f spE0;
Vec3f spD4;
Vec3f spC8;
Vec3f spBC;
f32 temp_fs0;
f32 phi_fs1;
Vec3f pos;
Vec3f vel;
Vec3f posOffset;
Vec3f velOffset;
f32 offsetPosX;
f32 offsetPosY;
s16 scale;
s16 phi_s0;
s16 temp;
s16 phi_t0;
s16 gravity;
Matrix_Push();
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
temp_fs0 = 0.0f;
phi_fs1 = 0.0f;
offsetPosX = 0.0f;
offsetPosY = 0.0f;
for (i = 0; i < 30; i++) {
temp_fs0 += 60.0f + (Rand_ZeroOne() * 20.0f);
if (temp_fs0 > 75.0f) {
temp_fs0 -= 150.0f;
offsetPosX += 60.0f + (Rand_ZeroOne() * 20.0f);
if (offsetPosX > 75.0f) {
offsetPosX -= 150.0f;
}
spC8.x = temp_fs0;
phi_fs1 += 5;
spC8.y = phi_fs1;
offsetPosY += 5;
spC8.z = (Rand_ZeroOne() * 20.0f) - 10.0f;
posOffset.x = offsetPosX;
posOffset.y = offsetPosY;
posOffset.z = (Rand_ZeroOne() * 20.0f) - 10.0f;
spBC.x = ((Rand_ZeroOne() - 0.5f) * 5.0f) + (temp_fs0 * 0.053333335f);
spBC.y = (Rand_ZeroOne() * 7.0f) - 2.0f;
spBC.z = (Rand_ZeroOne() * 4.0f) - 2.0f;
velOffset.x = ((Rand_ZeroOne() - 0.5f) * 5.0f) + (offsetPosX * (4.0f / 75.0f));
velOffset.y = (Rand_ZeroOne() * 7.0f) - 2.0f;
velOffset.z = (Rand_ZeroOne() * 4.0f) - 2.0f;
Matrix_MultVec3f(&spC8, &spE0);
Matrix_MultVec3f(&spBC, &spD4);
Matrix_MultVec3f(&posOffset, &pos);
Matrix_MultVec3f(&velOffset, &vel);
spE0.x += this->dyna.actor.world.pos.x;
spE0.y += this->dyna.actor.world.pos.y;
spE0.z += this->dyna.actor.world.pos.z;
pos.x += this->dyna.actor.world.pos.x;
pos.y += this->dyna.actor.world.pos.y;
pos.z += this->dyna.actor.world.pos.z;
//! FAKE
if (1) {}
if ((i & 3) == 0) {
phi_s0 = 32;
func_800BBFB0(play, &spE0, 50.0f, 2, 100, 120, 1);
func_800BBFB0(play, &pos, 50.0f, 2, 100, 120, 1);
} else {
phi_s0 = 64;
}
@ -151,56 +154,57 @@ void func_80BD4720(BgIkanaBombwall* this, PlayState* play) {
phi_t0 = 0;
}
if (D_80BD52C8[i & 3] >= 16) {
temp = -550;
scale = D_80BD52C8[i & (ARRAY_COUNT(D_80BD52C8) - 1)];
//! FAKE
fake_label:;
if (scale >= 16) {
gravity = -550;
} else {
temp = -450;
gravity = -450;
}
EffectSsKakera_Spawn(play, &spE0, &spD4, &spE0, temp, phi_s0, 30, 0, 0, D_80BD52C8[i & 3], phi_t0, 0, 50, -1,
EffectSsKakera_Spawn(play, &pos, &vel, &pos, gravity, phi_s0, 30, 0, 0, scale, phi_t0, 0, 50, -1,
OBJECT_IKANA_OBJ, object_ikana_obj_DL_000288);
}
Matrix_Pop();
}
#else
void func_80BD4720(BgIkanaBombwall* this, PlayState* play);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Bombwall/func_80BD4720.s")
#endif
void func_80BD4A14(BgIkanaBombwall* this, PlayState* play) {
s32 i;
Vec3f spD8;
Vec3f spCC;
Vec3f pos;
Vec3f vel;
f32 temp_fs0;
f32 temp_fs1;
f32 temp_fs3;
s16 temp_v1;
s16 phi_s2;
s32 phi_t0;
s16 scale;
s16 angle;
s32 gravity;
s16 phi_v0;
s32 phi_v1;
temp_fs3 = 0.0f;
for (i = 0, phi_s2 = 0; i < 28; i++, phi_s2 += 0x924) {
for (i = 0, angle = 0; i < 28; i++, angle += 0x924) {
temp_fs3 += 20.0f + (Rand_ZeroOne() * 10.0f);
if (temp_fs3 > 60.0f) {
temp_fs3 -= 60.0f;
}
temp_fs0 = Math_SinS(phi_s2);
temp_fs1 = Math_CosS(phi_s2);
temp_fs0 = Math_SinS(angle);
temp_fs1 = Math_CosS(angle);
spD8.x = (temp_fs0 * temp_fs3) + this->dyna.actor.world.pos.x;
spD8.y = this->dyna.actor.world.pos.y;
spD8.z = (temp_fs1 * temp_fs3) + this->dyna.actor.world.pos.z;
pos.x = (temp_fs0 * temp_fs3) + this->dyna.actor.world.pos.x;
pos.y = this->dyna.actor.world.pos.y;
pos.z = (temp_fs1 * temp_fs3) + this->dyna.actor.world.pos.z;
spCC.x = ((Rand_ZeroOne() - 0.5f) * 3.0f * temp_fs0) + ((temp_fs0 * temp_fs3) * 0.033333335f);
spCC.y = (Rand_ZeroOne() * 18.0f) + 4.0f;
spCC.z = ((Rand_ZeroOne() - 0.5f) * 3.0f * temp_fs1) + ((temp_fs1 * temp_fs3) * 0.033333335f);
vel.x = ((Rand_ZeroOne() - 0.5f) * 3.0f * temp_fs0) + ((temp_fs0 * temp_fs3) * (1.0f / 30.0f));
vel.y = (Rand_ZeroOne() * 18.0f) + 4.0f;
vel.z = ((Rand_ZeroOne() - 0.5f) * 3.0f * temp_fs1) + ((temp_fs1 * temp_fs3) * (1.0f / 30.0f));
temp_v1 = (Rand_Next() & 3) + (i >> 1) + 6;
scale = (Rand_Next() & 3) + (i >> 1) + 6;
if ((i & 3) == 0) {
phi_v0 = 32;
@ -208,21 +212,21 @@ void func_80BD4A14(BgIkanaBombwall* this, PlayState* play) {
phi_v0 = 64;
}
if (temp_v1 >= 15) {
if (scale >= 15) {
phi_v0 |= 1;
phi_v1 = 1;
phi_t0 = -550;
gravity = -550;
} else {
phi_v1 = 0;
phi_t0 = -400;
gravity = -400;
}
EffectSsKakera_Spawn(play, &spD8, &spCC, &spD8, phi_t0, phi_v0, 30, 0, 0, temp_v1, phi_v1, 0, 50, -1,
EffectSsKakera_Spawn(play, &pos, &vel, &pos, gravity, phi_v0, 30, 0, 0, scale, phi_v1, 0, 50, -1,
OBJECT_IKANA_OBJ, object_ikana_obj_DL_000288);
if ((i & 3) == 0) {
spD8.y += 30.0f;
func_800BBFB0(play, &spD8, 50.0f, 2, 70, 110, 1);
pos.y += 30.0f;
func_800BBFB0(play, &pos, 50.0f, 2, 70, 110, 1);
}
}
}