crash_screen decomp and misc (#221)

* crash_screen decomp and misc
This commit is contained in:
MegaMech
2022-06-14 02:37:54 -06:00
committed by GitHub
parent ed3dad7e1a
commit d9bd7bfbc0
25 changed files with 435 additions and 1559 deletions
+190 -438
View File
@@ -11,27 +11,51 @@
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_802B4F60(s32 arg0, ? arg2, ? arg3) {
? sp30;
void func_802B6434(Vec3f arg0, Mat4 arg1);
void *vec3f_copy(Vec3f, Vec3f);
// weird stuff going on. But this is an unused func... So who cares.
UNUSED s32 func_802B4F60(UNUSED s32 arg0, Vec3f arg2, UNUSED f32 arg3, UNUSED f32 arg4) {
Mat4 sp30;
f32 sp2C;
f32 pad;
Vec3f sp1C;
vec3f_copy(sp1C, arg2);
sp2C = sp30[1][3]; // permuter
sp2C = (((sp1C[0] * sp30[0][3]) + (((0, sp1C[1])) * sp2C)) + (sp1C[2] * sp30[2][3])) + sp30[3][3];
//sp2C = (sp1C[0] * sp30[0][3]) + (sp1C[1] * sp30[1][3]) + (sp1C[2] * sp30[2][3]) + sp30[3][3];
func_802B6434(sp1C, sp30);
if (sp2C <= 0) {
return 0;
}
return 1;
}
/*
s32 func_802B4F60(s32 arg0, f32* arg1, ? arg2, ? arg3) {
f32 sp2C;
f32 sp1C;
f32 temp_f2;
? phi_v0;
? var_v0;
vec3f_copy(&sp1C);
temp_f2 = sp6C + ((sp3C * sp1C) + (sp4C * sp20) + (sp5C * sp24));
sp2C = temp_f2;
func_802B6434(sp1C, sp20, &sp1C, &sp30);
phi_v0 = 1;
if (temp_f2 <= 0.0f) {
phi_v0 = 0;
vec3f_copy(&sp1C, arg1);
sp2C = sp6C + ((sp30[3] * sp1C) + (sp4C * sp20) + (sp5C * sp24));
func_802B6434(&sp1C, (f32 (*)[4]) &sp30[0]);
var_v0 = 1;
if (sp2C <= 0.0f) {
var_v0 = 0;
}
return phi_v0;
return var_v0;
}
*/
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B4F60.s")
#endif
UNUSED func_802B4FF0() {
}
s32 func_802B4FF8(Mat4 arg0, s32 arg1) {
if (D_80150112 >= 0x80) {
return 0;
@@ -133,7 +157,7 @@ UNUSED void *sm64_vec3f_set(Vec3f dest, f32 x, f32 y, f32 z) {
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
void func_802B5350(void *arg0, void *arg1) {
UNUSED void func_802B5350(void *arg0, void *arg1) {
s32 temp_v0;
void *temp_a2;
void *temp_v1;
@@ -161,30 +185,12 @@ void func_802B5350(void *arg0, void *arg1) {
GLOBAL_ASM("asm/non_matchings/math_util/func_802B5350.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
void func_802B5398(void *arg0, s32 *arg1, s32 arg2) {
void *temp_a0;
s32 *phi_a1;
void *phi_a0;
s32 phi_a2;
phi_a1 = arg1;
phi_a0 = arg0;
phi_a2 = arg2 - 1;
if (arg2 > 0) {
do {
temp_a0 = phi_a0 + 4;
temp_a0->unk-4 = *phi_a1;
phi_a1 += 4;
phi_a0 = temp_a0;
phi_a2 += -1;
} while (phi_a2 > 0);
}
// mtxf_copy
void func_802B5398(s32 *dest, s32 *src, s32 arg2) {
while (arg2-- > 0) {
*dest++ = *src++;
}
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B5398.s")
#endif
void mtxf_identity(Mat4 mtx) {
register s32 i;
@@ -228,130 +234,44 @@ void mtxf_translate(Mat4 dest, Vec3f b) {
dest[3][1] = b[1];
dest[3][2] = b[2];
}
extern f64 D_802B9FB0; // = 0.017453292222222222;
// Note the use of `2` which generates diff asm than just using floats (2.0f).
void func_802B5564(Mat4 arg0, u16 *arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) {
f32 temp;
s32 i, j;
mtxf_identity(arg0);
arg2 *= D_802B9FB0;
temp = cosf(arg2 / 2) / sinf(arg2 / 2);
arg0[0][0] = temp / arg3;
arg0[1][1] = temp;
arg0[2][2] = (arg4 + arg5) / (arg4 - arg5);
arg0[2][3] = -1.0f;
arg0[3][2] = (2 * arg4 * arg5) / (arg4 - arg5);
arg0[3][3] = 0.0f;
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
f32 cosf(f32, f32); /* extern */
? mtxf_identity(f32); /* extern */
f32 sinf(f32); /* extern */
static f64 D_802B9FB0 = 0.017453292222222222;
void func_802B5564(void *arg0, s16 *arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) {
f32 sp20;
f32 sp1C;
f32 temp_f10;
f32 temp_f10_2;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f12_3;
f32 temp_f12_4;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f14_3;
f32 temp_f14_4;
f32 temp_f16;
f32 temp_f16_2;
f32 temp_f18;
f32 temp_f2;
f64 temp_f0;
s32 temp_v1;
u32 temp_t8;
void *temp_v0;
void *temp_v0_2;
f32 phi_f10;
void *phi_v0;
f32 phi_f16;
f32 phi_f12;
f32 phi_f14;
s32 phi_v1;
f32 phi_f10_2;
void *phi_v0_2;
f32 phi_f16_2;
f32 phi_f12_2;
f32 phi_f14_2;
temp_f14 = arg2;
arg2 = temp_f14;
mtxf_identity(temp_f14);
temp_f14_2 = arg2 * D_802B9FB0;
temp_f12 = temp_f14_2 / 2.0f;
sp1C = temp_f12;
sp20 = cosf(temp_f12, temp_f14_2);
temp_f2 = sp20 / sinf(temp_f12);
temp_f18 = arg4 + arg5;
temp_f12_2 = arg4 - arg5;
arg0->unk2C = -1.0f;
arg0->unk14 = temp_f2;
arg0->unk28 = temp_f18 / temp_f12_2;
arg0->unk0 = temp_f2 / arg3;
arg0->unk3C = 0.0f;
arg0->unk38 = (2.0f * arg4 * arg5) / temp_f12_2;
temp_f16 = arg0->unk4;
temp_f10 = arg0->unk0 * arg6;
temp_f12_3 = arg0->unk8;
temp_f14_3 = arg0->unkC;
phi_f10 = temp_f10;
phi_v0 = arg0;
phi_f16 = temp_f16;
phi_f12 = temp_f12_3;
phi_f14 = temp_f14_3;
phi_v1 = 1;
phi_f10_2 = temp_f10;
phi_v0_2 = arg0;
phi_f16_2 = temp_f16;
phi_f12_2 = temp_f12_3;
phi_f14_2 = temp_f14_3;
if (1 != 4) {
do {
temp_f16_2 = phi_v0->unk14;
temp_f12_4 = phi_v0->unk18;
temp_v1 = phi_v1 + 1;
temp_f14_4 = phi_v0->unk1C;
phi_v0->unk0 = phi_f10;
temp_f10_2 = phi_v0->unk10 * arg6;
phi_v0->unk4 = phi_f16 * arg6;
phi_v0->unk8 = phi_f12 * arg6;
temp_v0 = phi_v0 + 0x10;
temp_v0->unk-4 = phi_f14 * arg6;
phi_f10 = temp_f10_2;
phi_v0 = temp_v0;
phi_f16 = temp_f16_2;
phi_f12 = temp_f12_4;
phi_f14 = temp_f14_4;
phi_v1 = temp_v1;
phi_f10_2 = temp_f10_2;
phi_v0_2 = temp_v0;
phi_f16_2 = temp_f16_2;
phi_f12_2 = temp_f12_4;
phi_f14_2 = temp_f14_4;
} while (temp_v1 != 4);
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
arg0[i][j] *= arg6;
}
}
temp_v0_2 = phi_v0_2 + 0x10;
temp_v0_2->unk-10 = phi_f10_2;
temp_v0_2->unk-C = phi_f16_2 * arg6;
temp_v0_2->unk-8 = phi_f12_2 * arg6;
temp_v0_2->unk-4 = phi_f14_2 * arg6;
if (arg1 != 0) {
temp_f0 = temp_f18;
if (temp_f0 <= 2.0) {
if ((arg4 + arg5) <= 2.0) {
*arg1 = 0xFFFF;
return;
}
temp_t8 = 131072.0 / temp_f0;
*arg1 = temp_t8;
if ((temp_t8 & 0xFFFF) <= 0) {
*arg1 = 1;
else {
*arg1 = 131072.0 / (arg4 + arg5);
if (*arg1 <= 0) {
*arg1 = 1;
}
}
/* Duplicate return node #7. Try simplifying control flow for better match */
}
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B5564.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
void func_802B5794(void *arg0, void *arg1, void *arg2) {
// Similar to sm64's mtxf_lookat
void func_802B5794(void* arg0, void* arg1, void* arg2) {
f32 sp4C;
f32 sp48;
f32 sp30;
@@ -377,12 +297,12 @@ void func_802B5794(void *arg0, void *arg1, void *arg2) {
temp_f12 = arg2->unk0 - arg1->unk0;
temp_f14 = arg2->unk4 - arg1->unk4;
temp_f2 = arg2->unk8 - arg1->unk8;
temp_f16 = -1.0 / sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14) + (temp_f2 * temp_f2));
temp_f16 = (f32) (-1.0 / (f64) sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14) + (temp_f2 * temp_f2)));
temp_f12_2 = temp_f12 * temp_f16;
temp_f14_2 = temp_f14 * temp_f16;
temp_f2_2 = temp_f2 * temp_f16;
temp_f16_2 = 0.0f - (1.0f * temp_f12_2);
temp_f22 = 1.0 / sqrtf((temp_f2_2 * temp_f2_2) + 0.0f + (temp_f16_2 * temp_f16_2));
temp_f22 = (f32) (1.0 / (f64) sqrtf((temp_f2_2 * temp_f2_2) + 0.0f + (temp_f16_2 * temp_f16_2)));
temp_f28 = temp_f2_2 * temp_f22;
temp_f18 = temp_f16_2 * temp_f22;
temp_f6 = temp_f14_2 * temp_f18;
@@ -390,7 +310,7 @@ void func_802B5794(void *arg0, void *arg1, void *arg2) {
temp_f20 = temp_f6 - (temp_f2_2 * 0.0f);
temp_f16_3 = (temp_f2_2 * temp_f28) - (temp_f12_2 * sp30);
temp_f18_2 = (temp_f12_2 * 0.0f) - (temp_f14_2 * temp_f28);
temp_f22_2 = 1.0 / sqrtf((temp_f20 * temp_f20) + (temp_f16_3 * temp_f16_3) + (temp_f18_2 * temp_f18_2));
temp_f22_2 = (f32) (1.0 / (f64) sqrtf((temp_f20 * temp_f20) + (temp_f16_3 * temp_f16_3) + (temp_f18_2 * temp_f18_2)));
temp_f20_2 = temp_f20 * temp_f22_2;
temp_f10 = temp_f18_2 * temp_f22_2;
sp4C = temp_f16_3 * temp_f22_2;
@@ -398,118 +318,63 @@ void func_802B5794(void *arg0, void *arg1, void *arg2) {
arg0->unk0 = temp_f28;
arg0->unk10 = 0.0f;
arg0->unk20 = sp30;
arg0->unk30 = -((arg1->unk8 * sp30) + ((arg1->unk0 * temp_f28) + (arg1->unk4 * 0.0f)));
arg0->unk30 = (f32) -((arg1->unk8 * sp30) + ((arg1->unk0 * temp_f28) + (arg1->unk4 * 0.0f)));
arg0->unk4 = temp_f20_2;
arg0->unk24 = sp48;
arg0->unk14 = sp4C;
arg0->unk8 = temp_f12_2;
arg0->unk18 = temp_f14_2;
arg0->unk28 = temp_f2_2;
arg0->unk34 = -((arg1->unk8 * sp48) + ((arg1->unk0 * temp_f20_2) + (arg1->unk4 * sp4C)));
arg0->unk34 = (f32) -((arg1->unk8 * sp48) + ((arg1->unk0 * temp_f20_2) + (arg1->unk4 * sp4C)));
arg0->unkC = 0.0f;
arg0->unk1C = 0.0f;
arg0->unk2C = 0.0f;
arg0->unk3C = 1.0f;
arg0->unk38 = -((arg1->unk8 * temp_f2_2) + ((arg1->unk0 * temp_f12_2) + (arg1->unk4 * temp_f14_2)));
arg0->unk38 = (f32) -((arg1->unk8 * temp_f2_2) + ((arg1->unk0 * temp_f12_2) + (arg1->unk4 * temp_f14_2)));
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B5794.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
? mtxf_identity(void *); /* extern */
f32 sins(s32); /* extern */
f32 coss(s32); /* extern */
void func_802B59DC(Mat4 arg0, s16 arg1) {
f32 sp28 = sins(arg1);
f32 temp_f0 = coss(arg1);
void func_802B59DC(void *arg0, s32 arg1) {
f32 sp2C;
f32 sp28;
s32 sp24;
f32 temp_f0;
s32 temp_a0;
temp_a0 = arg1 & 0xFFFF;
sp24 = temp_a0;
temp_f0 = sins(temp_a0);
sp2C = temp_f0;
sp28 = coss(temp_a0);
mtxf_identity(arg0);
arg0->unk18 = temp_f0;
arg0->unk24 = -temp_f0;
arg0->unk14 = sp28;
arg0->unk28 = sp28;
arg0[1][1] = temp_f0;
arg0[1][2] = sp28;
arg0[2][1] = -sp28;
arg0[2][2] = temp_f0;
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B59DC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
//This function did not have a glabel in the original assembly, as such it may
//be unused/unnamed
? mtxf_identity(void *); /* extern */
f32 sins(s32); /* extern */
f32 coss(s32); /* extern */
void func_802B5A44(Mat4 arg0, s16 arg1) {
f32 temp_f0 = sins(arg1);
f32 sp28 = coss(arg1);
void func_802B5A44(void *arg0, s32 arg1) {
f32 sp2C;
f32 sp28;
s32 sp24;
f32 temp_f0;
s32 temp_a0;
temp_a0 = arg1 & 0xFFFF;
sp24 = temp_a0;
temp_f0 = sins(temp_a0);
sp2C = temp_f0;
sp28 = coss(temp_a0);
mtxf_identity(arg0);
arg0->unk20 = temp_f0;
arg0->unk8 = -temp_f0;
arg0->unk0 = sp28;
arg0->unk28 = sp28;
arg0[0][0] = sp28;
arg0[0][2] = -temp_f0;
arg0[2][0] = temp_f0;
arg0[2][2] = sp28;
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B5A44.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
//This function did not have a glabel in the original assembly, as such it may
//be unused/unnamed
? mtxf_identity(void *); /* extern */
f32 sins(s32); /* extern */
f32 coss(s32); /* extern */
void func_802B5AAC(Mat4 arg0, s16 arg1) {
f32 temp_f0 = sins(arg1);
f32 sp28 = coss(arg1);
void func_802B5AAC(void *arg0, s32 arg1) {
f32 sp2C;
f32 sp28;
s32 sp24;
f32 temp_f0;
s32 temp_a0;
temp_a0 = arg1 & 0xFFFF;
sp24 = temp_a0;
temp_f0 = sins(temp_a0);
sp2C = temp_f0;
sp28 = coss(temp_a0);
mtxf_identity(arg0);
arg0->unk4 = temp_f0;
arg0->unk10 = -temp_f0;
arg0->unk0 = sp28;
arg0->unk14 = sp28;
arg0[0][0] = sp28;
arg0[0][1] = temp_f0;
arg0[1][0] = -temp_f0;
arg0[1][1] = sp28;
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B5AAC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
f32 sins(u16); /* extern */
f32 coss(u16); /* extern */
//f32 sins(u16); /* extern */
//f32 coss(u16); /* extern */
void func_802B5B14(void *arg0, void *arg1) {
void func_802B5B14(Vec3f arg0, Vec3s arg1) {
f32 sp70;
f32 sp6C;
f32 sp68;
@@ -521,31 +386,35 @@ void func_802B5B14(void *arg0, void *arg1) {
f32 sp48;
f32 sp40;
f32 sp3C;
f32 sp38;
f32 sp30;
f32 sp2C;
f32 sp28;
f32 temp_f0;
f32 sp38 = sins(arg1[0]);
f32 sp30 = sins(arg1[1]);
f32 sp2C = coss(arg1[1]);
f32 sp28 = sins(arg1[2]);
f32 temp_f0 = coss(arg1[2]);
f32 temp_f20 = coss(arg1[0]);
f32 temp_f10;
f32 temp_f12;
//f32 temp_f12;
f32 temp_f18;
f32 temp_f20;
f32 temp_f4;
f32 temp_f6;
sp38 = sins(arg1->unk0);
temp_f20 = coss(arg1->unk0);
sp30 = sins(arg1->unk2);
sp2C = coss(arg1->unk2);
sp28 = sins(arg1->unk4);
temp_f0 = coss(arg1->unk4);
temp_f4 = arg0->unk0;
temp_f12 = sp38 * sp30;
sp3C = temp_f4;
sp40 = arg0->unk4;
temp_f6 = (sp2C * temp_f0) + (temp_f12 * sp28);
//sp38 = sins(arg1->unk0);
//temp_f20 = coss(arg1->unk0);
//sp30 = sins(arg1->unk2);
//sp2C = coss(arg1->unk2);
//sp28 = sins(arg1->unk4);
//temp_f0 = coss(arg1->unk4);
//temp_f4 = arg0[0];
//temp_f12 = sp38 * sp30;
//sp3C = temp_f4;
sp3C = arg0[0];
sp40 = arg0[1];
temp_f6 = (sp2C * temp_f0) + (sp38 * sp30 * sp28);
sp48 = temp_f6;
sp58 = (-sp2C * sp28) + (temp_f12 * temp_f0);
sp58 = (-sp2C * sp28) + (sp38 * sp30 * temp_f0);
sp68 = temp_f20 * sp30;
sp4C = temp_f20 * sp28;
temp_f18 = sp38 * sp2C;
@@ -555,54 +424,28 @@ void func_802B5B14(void *arg0, void *arg1) {
sp50 = temp_f10;
sp60 = (sp30 * sp28) + (temp_f18 * temp_f0);
sp70 = temp_f20 * sp2C;
arg0->unk0 = (temp_f10 * sp40) + ((temp_f4 * temp_f6) + (sp40 * sp4C));
arg0->unk4 = (sp60 * sp40) + ((temp_f4 * sp58) + (sp40 * sp5C));
arg0->unk8 = (sp70 * sp40) + ((sp3C * sp68) + (sp40 * sp6C));
arg0[0] = (temp_f10 * sp40) + ((sp3C * temp_f6) + (sp40 * sp4C));
arg0[1] = (sp60 * sp40) + ((sp3C * sp58) + (sp40 * sp5C));
arg0[2] = (sp70 * sp40) + ((sp3C * sp68) + (sp40 * sp6C));
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B5B14.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
f32 sins(s32); /* extern */
f32 coss(s32); /* extern */
void func_802B5CAC(s16 arg0, s16 arg1, Vec3f arg2) {
f32 sp2C = sins(arg1);
f32 sp28 = coss(arg1);
f32 sp24 = sins(arg0);
f32 temp_f10 = coss(arg0);
void func_802B5CAC(u16 arg0, s32 arg1, void *arg2) {
f32 sp2C;
f32 sp28;
f32 sp24;
s32 sp1C;
f32 temp_f10;
s32 temp_a0;
temp_a0 = arg1 & 0xFFFF;
sp1C = temp_a0;
sp2C = sins(temp_a0);
sp28 = coss(temp_a0);
sp1C = arg0;
sp24 = sins(arg0);
temp_f10 = sp28 * coss(arg0);
arg2->unk0 = sp28 * sp24;
arg2->unk4 = sp2C;
arg2->unk8 = -temp_f10;
arg2[0] = sp28 * sp24;
arg2[1] = sp2C;
arg2[2] = -(sp28 * temp_f10);
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B5CAC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
//This function did not have a glabel in the original assembly, as such it may
//be unused/unnamed
? func_802B5D64(?, s16, s16, ?); /* extern */
void func_802B5D30(s16 arg0, s16 arg1, ? arg2) {
void func_802B5D30(s16 arg0, s16 arg1, s32 arg2) {
func_802B5D64(0x9000000, arg0, arg1, arg2);
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B5D30.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
@@ -844,118 +687,60 @@ void func_802B6214(void *arg0, void *arg1, void *arg2) {
GLOBAL_ASM("asm/non_matchings/math_util/func_802B6214.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
//This function did not have a glabel in the original assembly, as such it may
//be unused/unnamed
void func_802B6374(void *arg0) {
UNUSED void func_802B6374(Vec3f arg0) {
f32 temp_f0;
f32 temp_f12;
f32 temp_f14;
f32 temp_f18;
f32 temp_f2;
temp_f12 = arg0->unk0;
temp_f14 = arg0->unk4;
temp_f2 = arg0->unk8;
temp_f0 = sqrtf((temp_f2 * temp_f2) + ((temp_f12 * temp_f12) + (temp_f14 * temp_f14)));
temp_f18 = temp_f14 / temp_f0;
arg0->unk0 = temp_f12 / temp_f0;
arg0->unk4 = temp_f18;
arg0->unk8 = temp_f2 / temp_f0;
temp_f0 = sqrtf((arg0[0] * arg0[0]) + (arg0[1] * arg0[1]) + (arg0[2] * arg0[2]));
arg0[0] /= temp_f0;
arg0[1] /= temp_f0;
arg0[2] /= temp_f0;
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B6374.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
void func_802B63B8(void *arg0, void *arg1) {
void func_802B63B8(Vec3f arg0, Mat3 arg1) {
f32 temp_f12;
f32 temp_f14;
f32 temp_f16;
f32 temp_f14;
temp_f12 = (arg1[0][0] * arg0[0]) + (arg1[0][1] * arg0[1]) + (arg1[0][2] * arg0[2]);
temp_f16 = (arg1[1][0] * arg0[0]) + (arg1[1][1] * arg0[1]) + (arg1[1][2] * arg0[2]);
temp_f14 = (arg1[2][0] * arg0[0]) + (arg1[2][1] * arg0[1]) + (arg1[2][2] * arg0[2]);
arg0[0] = temp_f12;
arg0[1] = temp_f16;
arg0[2] = temp_f14;
}
void func_802B6434(Vec3f arg0, Mat4 arg1) {
f32 temp_f2;
f32 temp_f16;
f32 temp_f6;
temp_f12 = arg0->unk0;
temp_f14 = arg0->unk4;
temp_f2 = arg0->unk8;
temp_f6 = arg1->unk18 * temp_f12;
temp_f16 = (temp_f2 * arg1->unk14) + ((arg1->unkC * temp_f12) + (arg1->unk10 * temp_f14));
arg0->unk0 = (temp_f2 * arg1->unk8) + ((arg1->unk0 * temp_f12) + (arg1->unk4 * temp_f14));
arg0->unk4 = temp_f16;
arg0->unk8 = (temp_f2 * arg1->unk20) + (temp_f6 + (arg1->unk1C * temp_f14));
temp_f2 = ((arg1[0][0] * arg0[0]) + (arg1[0][1] * arg0[1]) + (arg1[0][2] * arg0[2]));
temp_f16 = ((arg1[1][0] * arg0[0]) + (arg1[1][1] * arg0[1]) + (arg1[1][2] * arg0[2]));
temp_f6 = (arg1[2][0] * arg0[0]) + (arg1[2][1] * arg0[1]) + (arg1[2][2] * arg0[2]);
arg0[0] = temp_f2;
arg0[1] = temp_f16;
arg0[2] = temp_f6;
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B63B8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
void func_802B6434(void *arg0, void *arg1) {
f32 temp_f12;
f32 temp_f14;
f32 temp_f16;
f32 temp_f2;
f32 temp_f6;
temp_f12 = arg0->unk0;
temp_f14 = arg0->unk4;
temp_f2 = arg0->unk8;
temp_f6 = arg1->unk20 * temp_f12;
temp_f16 = (temp_f2 * arg1->unk18) + ((arg1->unk10 * temp_f12) + (arg1->unk14 * temp_f14));
arg0->unk0 = (temp_f2 * arg1->unk8) + ((arg1->unk0 * temp_f12) + (arg1->unk4 * temp_f14));
arg0->unk4 = temp_f16;
arg0->unk8 = (temp_f2 * arg1->unk28) + (temp_f6 + (arg1->unk24 * temp_f14));
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B6434.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
//This function did not have a glabel in the original assembly, as such it may
//be unused/unnamed
void func_802B64B0(s32 arg0, ? arg1, ? arg2, ? arg3) {
UNUSED void func_802B64B0(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B64B0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
f32 sins(s32, void *); /* extern */
f32 coss(s32); /* extern */
void func_802B64C4(Vec3f arg0, s16 arg1) {
f32 sp2C = sins(arg1);
f32 temp_f0 = coss(arg1);
void func_802B64C4(void *arg0, s32 arg1) {
f32 sp2C;
s32 sp18;
f32 temp_f0;
f32 temp_f10;
f32 temp_f12;
f32 temp_f2;
f32 temp_f4;
s32 temp_a0;
void *temp_a2;
f32 temp1 = arg0[0];
f32 temp2 = arg0[1];
f32 temp3 = arg0[2];
temp_a2 = arg0;
temp_a0 = arg1 & 0xFFFF;
sp18 = temp_a0;
arg0 = temp_a2;
sp2C = sins(temp_a0, temp_a2);
temp_f0 = coss(temp_a0);
temp_f2 = arg0->unk0;
temp_f12 = arg0->unk8;
temp_f4 = temp_f0 * temp_f2;
arg0->unk4 = arg0->unk4;
temp_f10 = sp2C * temp_f2;
arg0->unk0 = temp_f4 - (sp2C * temp_f12);
arg0->unk8 = temp_f10 + (temp_f0 * temp_f12);
arg0[0] = temp_f0 * temp1 - (sp2C * temp3);
arg0[1] = temp2;
arg0[2] = sp2C * temp1 + (temp_f0 * temp3);
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B64C4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
@@ -1635,39 +1420,19 @@ s16 func_802B7F34(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
return atan2s(arg2 - arg0, arg3 - arg1);
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
s16 func_802B7F34(f32, f32, ?32, ?32); /* extern */
void func_802B7F7C(Vec3f arg0, Vec3f arg1, Vec3s arg2) {
f32 temp_f14 = arg0[0];
f32 sp28 = arg0[1];
f32 temp_f12 = arg0[2];
void func_802B7F7C(void *arg0, void *arg1, void *arg2) {
f32 sp2C;
f32 sp28;
f32 sp24;
?32 sp20;
?32 sp1C;
?32 sp18;
?32 temp_f0;
?32 temp_f2;
f32 temp_f12;
f32 temp_f14;
f32 temp_f2 = arg1[0];
f32 sp1C = arg1[1];
f32 temp_f0 = arg1[2];
temp_f14 = arg0->unk0;
sp28 = arg0->unk4;
temp_f12 = arg0->unk8;
temp_f2 = arg1->unk0;
sp1C = arg1->unk4;
temp_f0 = arg1->unk8;
sp2C = temp_f14;
sp24 = temp_f12;
sp20 = temp_f2;
sp18 = temp_f0;
arg2->unk2 = func_802B7F34(temp_f12, temp_f14, temp_f0, temp_f2);
arg2->unk0 = func_802B7F34(sp28, sp24, sp1C, temp_f0);
arg2->unk4 = func_802B7F34(sp2C, sp28, sp20, sp1C);
arg2[1] = func_802B7F34(temp_f12, temp_f14, temp_f0, temp_f2);
arg2[0] = func_802B7F34(sp28, temp_f12, sp1C, temp_f0);
arg2[2] = func_802B7F34(temp_f14, sp28, temp_f2, sp1C);
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B7F7C.s")
#endif
f32 sins(u16 arg0) {
return gSineTable[arg0 >> 4];
@@ -1677,34 +1442,21 @@ f32 coss(u16 arg0) {
return gCosineTable[arg0 >> 4];
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
? func_802B8058(s32 arg0, s32 arg1, s32 arg2) {
s32 temp_t7;
s32 temp_t8;
s32 temp_v1;
temp_v1 = arg0 & 0xFFFF;
temp_t7 = arg1 & 0xFFFF;
temp_t8 = arg2 & 0xFFFF;
if (temp_t7 < temp_v1) {
if (temp_t7 >= temp_t8) {
s32 func_802B8058(u16 arg0, u16 arg1, u16 arg2) {
if (arg1 < arg0) {
if (arg1 >= arg2) {
return 0;
}
if (temp_t8 >= temp_v1) {
if (arg2 >= arg0) {
return 0;
}
} else {
if ((arg1 >= arg2) && (arg2 >= arg0)) {
return 0;
}
/* Duplicate return node #8. Try simplifying control flow for better match */
return 1;
}
if ((temp_t7 >= temp_t8) && (temp_t8 >= temp_v1)) {
return 0;
}
return 1;
}
#else
GLOBAL_ASM("asm/non_matchings/math_util/func_802B8058.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909