Match several functions in code_802B0210 (#216)

Several other functions are as matched as the can be, needing only
 the addition of some RODATA to fully match.

Others are in a mostly-matched state, but have some incorrect
 register allocation. More investigation/work is needed to
 figure that out.

Most of those leftover have had their m2c output regenerated.

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2022-06-02 02:48:44 -04:00
committed by GitHub
parent c82a7438fb
commit 56120481f9
10 changed files with 846 additions and 1618 deletions
+25 -25
View File
@@ -3012,10 +3012,10 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802AD278.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75
s32 func_802AC760(void *, f32, f32, f32, f32, f32, f32, f32, f32); /* extern */
s32 func_802ACBA4(void *, void *, f32, f32, f32, s32, f32, f32, f32); /* extern */
s32 func_802AD278(void *, void *, f32, f32, f32, s32, f32, f32, f32); /* extern */
//generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b
s32 func_802AC760(f32, f32, f32, f32, f32, f32, f32, f32, f32); /* extern */
s32 func_802ACBA4(UnkActorInner *, f32, f32, f32, f32, s32, f32, f32, f32); /* extern */
s32 func_802AD278(UnkActorInner *, f32, f32, f32, f32, s32, f32, f32, f32); /* extern */
extern ? D_8014F110;
extern s32 D_8015F584;
extern s16 D_8015F6E8;
@@ -3023,7 +3023,7 @@ extern s16 D_8015F6EA;
extern s16 D_8015F6F0;
extern s16 D_8015F6F2;
s32 func_802AD950(void *arg0, void *arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
s32 func_802AD950(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
s16 temp_v0_4;
s16 temp_v1;
s32 temp_f10;
@@ -3045,46 +3045,46 @@ s32 func_802AD950(void *arg0, void *arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5
s32 phi_s4_5;
s32 phi_s4_6;
arg0->unk0 = 0;
arg0->unk2 = 0;
arg0->unk4 = 0;
arg0->unkC = 1000.0f;
arg0->unk10 = 1000.0f;
arg0->unk14 = 1000.0f;
temp_v0 = arg0->unkA;
arg0->unk30 = 0;
arg0->unk32 = 0;
arg0->unk34 = 0;
arg0->unk3C = 1000.0f;
arg0->unk40 = 1000.0f;
arg0->unk44 = 1000.0f;
temp_v0 = arg0->unk3A;
phi_s4_6 = 0;
if (((s32) temp_v0 < (s32) D_8015F588) && (func_802AC760(arg1, arg2, arg3, arg4, (bitwise f32) temp_v0, arg5, arg6, arg7) == 1)) {
phi_s4_6 = 0x4000;
phi_s4_6 = 0x00004000;
}
temp_v0_2 = arg0->unk6;
temp_v0_2 = arg0->unk36;
phi_s4_4 = phi_s4_6;
if (((s32) temp_v0_2 < (s32) D_8015F588) && (func_802ACBA4(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_2, arg5, arg6, arg7) == 1)) {
phi_s4_4 = (phi_s4_6 | 0x2000) & 0xFFFF;
}
temp_v0_3 = arg0->unk8;
temp_v0_3 = arg0->unk38;
phi_s4 = phi_s4_4;
if (((s32) temp_v0_3 < (s32) D_8015F588) && (func_802AD278(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_3, arg5, arg6, arg7) == 1)) {
phi_s4 = (phi_s4_4 | 0x8000) & 0xFFFF;
}
phi_s4_2 = phi_s4;
phi_s4_3 = phi_s4;
if (phi_s4 == 0xE000) {
if (phi_s4 == 0x0000E000) {
goto block_39;
}
temp_v0_4 = D_8015F6EA;
temp_v1 = D_8015F6F2;
temp_f10 = (s32) ((arg2 - (f32) temp_v0_4) / (f32) ((s32) (D_8015F6E8 - temp_v0_4) / 32));
temp_f16 = (s32) ((arg4 - (f32) temp_v1) / (f32) ((s32) (D_8015F6F0 - temp_v1) / 32));
if ((s32) (s16) temp_f10 < 0) {
if ((s16) temp_f10 < 0) {
return 0;
}
if ((s32) (s16) temp_f16 < 0) {
if ((s16) temp_f16 < 0) {
return 0;
}
if ((s32) (s16) temp_f10 >= 0x20) {
if ((s16) temp_f10 >= 0x20) {
return 0;
}
if ((s32) (s16) temp_f16 >= 0x20) {
if ((s16) temp_f16 >= 0x20) {
return 0;
}
temp_v1_2 = ((s16) ((s16) temp_f10 + ((s16) temp_f16 << 5)) * 4) + &D_8014F110;
@@ -3098,20 +3098,20 @@ s32 func_802AD950(void *arg0, void *arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5
loop_22:
phi_s4_3 = phi_s4_2;
phi_s4_5 = phi_s4_2;
if (phi_s4_2 == 0xE000) {
if (phi_s4_2 == 0x0000E000) {
} else {
temp_v0_5 = *(D_8015F584 + (phi_s2 * 2));
temp_v1_3 = (*D_8015F580)[temp_v0_5].flags;
temp_v1_3 = D_8015F580[temp_v0_5].flags;
if ((temp_v1_3 & 0x4000) != 0) {
if (((phi_s4_2 & 0x4000) == 0) && (arg0->unkA != temp_v0_5) && (func_802AC760(arg0, (bitwise f32) arg1, arg2, arg3, arg4, (bitwise f32) temp_v0_5, arg5, arg6, arg7) == 1)) {
if (((phi_s4_2 & 0x4000) == 0) && (arg0->unk3A != temp_v0_5) && (func_802AC760((bitwise f32) arg0, arg1, arg2, arg3, arg4, (bitwise f32) temp_v0_5, arg5, arg6, arg7) == 1)) {
phi_s4_5 = (phi_s4_2 | 0x4000) & 0xFFFF;
}
} else if ((temp_v1_3 & 0x8000) != 0) {
if (((phi_s4_2 & 0x8000) == 0) && (arg0->unk8 != temp_v0_5) && (func_802AD278(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_5, arg5, arg6, arg7) == 1)) {
if (((phi_s4_2 & 0x8000) == 0) && (arg0->unk38 != temp_v0_5) && (func_802AD278(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_5, arg5, arg6, arg7) == 1)) {
phi_s4_5 = (phi_s4_2 | 0x8000) & 0xFFFF;
}
} else if (((phi_s4_2 & 0x2000) == 0) && (arg0->unk6 != temp_v0_5) && (func_802ACBA4(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_5, arg5, arg6, arg7) == 1)) {
} else if (((phi_s4_2 & 0x2000) == 0) && (arg0->unk36 != temp_v0_5) && (func_802ACBA4(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_5, arg5, arg6, arg7) == 1)) {
phi_s4_5 = (phi_s4_2 | 0x2000) & 0xFFFF;
}
temp_t7 = (phi_s3 + 1) & 0xFFFF;