Imported funcs from sm64 to code_80004740.c and trig_tables.inc.c (#68)

* fixed float issue brought over from zeldaret

* Import trig_tables.inc.c

* Delete game_data_802BA370.s

* Import two funcs from sm64 into code_80004740.c
This commit is contained in:
CoderStig
2021-11-28 15:42:03 -07:00
committed by GitHub
parent 7387724509
commit 632512ada9
132 changed files with 2469 additions and 6154 deletions
+25 -25
View File
@@ -55,8 +55,8 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80006018.s")
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
f32 func_802B8018(s32, s16, void *); // extern
f32 func_802B8038(s32); // extern
f32 sins(s32, s16, void *); // extern
f32 coss(s32); // extern
void func_80006114(void *arg0, void *arg1, s16 arg2) {
f32 sp34;
@@ -81,8 +81,8 @@ void func_80006114(void *arg0, void *arg1, s16 arg2) {
arg0 = temp_a3;
sp1C = temp_a0;
sp30 = temp_f10 - arg1->unk8;
sp24 = func_802B8018(temp_a0, phi_a2, temp_a3);
temp_f0 = func_802B8038(temp_a0);
sp24 = sins(temp_a0, phi_a2, temp_a3);
temp_f0 = coss(temp_a0);
temp_f6 = (sp30 * temp_f0) - (sp34 * sp24);
arg0->unk0 = arg1->unk0 + ((sp34 * temp_f0) + (sp30 * sp24));
arg0->unk8 = arg1->unk8 + temp_f6;
@@ -5346,8 +5346,8 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000DD78.s")
f32 func_802ABE30(f32, ?, void *, f32, u16); /* extern */
? func_802ADDC8(void *, ?, f32, f32, f32); /* extern */
s32 func_802B5224(? *, ? *, ? *, u16); /* extern */
f32 func_802B8018(s32, s32, s32); /* extern */
f32 func_802B8038(s32, s32, s32, s32); /* extern */
f32 sins(s32, s32, s32); /* extern */
f32 coss(s32, s32, s32, s32); /* extern */
f32 sqrtf(f32, f32, ? *, ? *); /* extern */
extern ? D_80162FB0;
extern ? D_80162FC0;
@@ -5543,8 +5543,8 @@ void func_8000DF8C(s32 arg0, f32 arg1, s32 arg2, s32 arg3) {
temp_t6 = ((temp_t4 * 0xFFFF) / 360) & 0xFFFF;
sp48 = temp_t4;
sp44 = temp_t6;
sp118 = func_802B8038(temp_t6, phi_a1, phi_a2, phi_a3) * 25.0;
temp_f0_3 = func_802B8018(sp44);
sp118 = coss(temp_t6, phi_a1, phi_a2, phi_a3) * 25.0;
temp_f0_3 = sins(sp44);
temp_v0_2 = D_80164550 + (spCA * 8);
temp_f20_2 = temp_s0->unk50 + 3.5f;
temp_t7 = ((((sp48 + 1) % 360) * 0xFFFF) / 360) & 0xFFFF;
@@ -5555,8 +5555,8 @@ void func_8000DF8C(s32 arg0, f32 arg1, s32 arg2, s32 arg3) {
sp110 = temp_v0_2;
temp_f24_2 = temp_v0_2->unk4 + (temp_f0_3 * 25.0);
D_80162FB0.unk8 = temp_f24_2;
sp118 = func_802B8038(temp_t7) * 25.0;
temp_f10 = func_802B8018(sp44);
sp118 = coss(temp_t7) * 25.0;
temp_f10 = sins(sp44);
D_80162FC0.unk0 = temp_v0_2->unk0 + sp118;
D_80162FC0.unk4 = temp_v0_2->unk2;
D_80162FC0.unk8 = temp_v0_2->unk4 + (temp_f10 * 25.0);
@@ -5571,11 +5571,11 @@ void func_8000DF8C(s32 arg0, f32 arg1, s32 arg2, s32 arg3) {
temp_a0_2 = ((temp_v0_3 * 0xFFFF) / 360) & 0xFFFF;
sp44 = temp_a0_2;
sp48 = temp_v0_3;
sp118 = func_802B8038(temp_a0_2, phi_a1, phi_a2, phi_a3) * 25.0;
sp118 = coss(temp_a0_2, phi_a1, phi_a2, phi_a3) * 25.0;
temp_v0_4 = D_80164550 + (spCA * 8);
temp_f22_3 = temp_v0_4->unk0 + sp118;
temp_f20_3 = temp_s0->unk50 + 3.5f;
temp_f4 = func_802B8018(temp_a0_2) * 25.0;
temp_f4 = sins(temp_a0_2) * 25.0;
temp_a0_3 = ((((sp48 + 1) % 360) * 0xFFFF) / 360) & 0xFFFF;
D_80162FB0.unk0 = temp_f22_3;
D_80162FB0.unk4 = temp_f20_3;
@@ -5583,8 +5583,8 @@ void func_8000DF8C(s32 arg0, f32 arg1, s32 arg2, s32 arg3) {
sp110 = temp_v0_4;
temp_f24_3 = temp_v0_4->unk4 + temp_f4;
D_80162FB0.unk8 = temp_f24_3;
sp118 = func_802B8038(temp_a0_3) * 25.0;
temp_f8 = func_802B8018(temp_a0_3);
sp118 = coss(temp_a0_3) * 25.0;
temp_f8 = sins(temp_a0_3);
D_80162FC0.unk0 = temp_v0_4->unk0 + sp118;
D_80162FC0.unk4 = temp_v0_4->unk2;
D_80162FC0.unk8 = temp_v0_4->unk4 + (temp_f8 * 25.0);
@@ -5688,9 +5688,9 @@ block_42:
temp_t7_2 = (0xFFFF - spC2) & 0xFFFF;
sp108 = 2.0f * phi_f12;
sp48 = temp_t7_2;
sp118 = func_802B8038((bitwise s32) phi_f12, temp_t7_2) * phi_f12;
sp118 = coss((bitwise s32) phi_f12, temp_t7_2) * phi_f12;
temp_t9_2 = (phi_s1_2 + 1) & 0xFFFF;
temp_f18 = func_802B8018((bitwise s32) phi_f12, sp48) * phi_f12;
temp_f18 = sins((bitwise s32) phi_f12, sp48) * phi_f12;
temp_f2_4 = (phi_f20_2 - 2.3f) + (sp108 / 3.0f);
spAC = temp_f2_4;
spA0 = temp_f2_4;
@@ -5705,8 +5705,8 @@ block_42:
} else {
temp_t2_2 = (0xFFFF - spC2) & 0xFFFF;
sp48 = temp_t2_2;
sp118 = func_802B8038(temp_t2_2) * 1.5f;
temp_f18_2 = func_802B8018(sp48) * 1.5f;
sp118 = coss(temp_t2_2) * 1.5f;
temp_f18_2 = sins(sp48) * 1.5f;
temp_f16_2 = phi_f20_2 - 2.3f;
temp_f12_4 = (sp7C % 3) * 0.15f;
temp_f14_2 = temp_f16_2 - temp_f12_4;
@@ -5718,7 +5718,7 @@ block_42:
sp88 = temp_f12_5;
sp4C = sp7C;
temp_f18_3 = temp_f18_2;
temp_f20_5 = phi_f20_2 + func_802B8018((bitwise s32) temp_f12_5, (bitwise s32) temp_f14_2, ((sp7C * 0x13FFEC) / 360) & 0xFFFF);
temp_f20_5 = phi_f20_2 + sins((bitwise s32) temp_f12_5, (bitwise s32) temp_f14_2, ((sp7C * 0x13FFEC) / 360) & 0xFFFF);
sp7C = (sp7C + 1) % 18;
phi_f18 = temp_f18_3;
phi_f20_3 = temp_f20_5;
@@ -10110,8 +10110,8 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014EE4.s")
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
f32 func_802B8018(s32); // extern
f32 func_802B8038(s32); // extern
f32 sins(s32); // extern
f32 coss(s32); // extern
extern ? D_801646C0;
void func_800151A4(void *arg0, s32 arg1) {
@@ -10151,12 +10151,12 @@ void func_800151A4(void *arg0, s32 arg1) {
temp_f10 = temp_f16 / temp_f0;
sp40 = temp_f8;
sp3C = temp_f10;
sp28 = 1.0 - func_802B8038(temp_s1 & 0xFFFF);
arg0->unk18 = (sp28 * sp44 * sp40) - (func_802B8018(temp_s1 & 0xFFFF) * temp_f10);
sp28 = 1.0 - coss(temp_s1 & 0xFFFF);
arg0->unk18 = (sp28 * sp44 * sp40) - (sins(temp_s1 & 0xFFFF) * temp_f10);
temp_f2_2 = sp28 * sp40;
arg0->unk1C = func_802B8038(temp_s1 & 0xFFFF) + (temp_f2_2 * sp40);
arg0->unk1C = coss(temp_s1 & 0xFFFF) + (temp_f2_2 * sp40);
sp20 = temp_f2_2;
arg0->unk20 = (func_802B8018(temp_s1 & 0xFFFF) * sp44) + (temp_f2_2 * temp_f10);
arg0->unk20 = (sins(temp_s1 & 0xFFFF) * sp44) + (temp_f2_2 * temp_f10);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800151A4.s")