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
+1 -1
View File
@@ -101,7 +101,7 @@ void update_simple_objects();
// audio/external.c
extern void func_800C98B8(Vec3f, Vec3f, u32);
extern void func_800C9060(Player*, s32);
extern void func_800C9060(u8, s32);
extern void func_800C90F4(u8, uintptr_t);
extern void func_800C99E0(Vec3f, s32);
extern void func_800C9D80(Vec3f*, Vec3f*, u32);
+789 -1217
View File
File diff suppressed because it is too large Load Diff
+30 -2
View File
@@ -1,7 +1,7 @@
#ifndef CODE_802B0210_H
#define CODE_802B0210_H
#include "types.h"
#include "common_structs.h"
#include "actor_types.h"
void func_802B0210(UnkActorInner*, UnkActorInner*);
@@ -13,16 +13,44 @@ s32 func_802B09C0(s16);
void update_obj_banana_bunch(struct BananaBunchParent*);
s32 func_802B0E14(s16);
void update_obj_triple_shell(struct TripleShellParent*, s16);
s32 func_802B17F4(Player*);
s32 func_802B18E4(Player*, s16);
s32 func_802B19EC(struct TripleShellParent*, Player*, s16, u16);
s32 func_802B1E48(Player*);
void func_802B1FFC(Player*);
void update_obj_green_shell(struct ShellActor*);
void update_obj_red_blue_shell(struct ShellActor*);
void update_obj_banana(struct BananaActor*);
void func_802B2914(struct BananaBunchParent*, Player*, s16);
s32 func_802B2C40(Player*);
s32 func_802B2D70(Player*);
void func_802B2EBC(Player*);
void func_802B2FA0(Player*);
void func_802B30EC();
void func_802B3E7C(struct ShellActor*, Player*);
void func_802B4104(struct ShellActor*);
void func_802B4E30(struct Actor*);
// src/code_80091750.c
void func_8009E5BC();
// audio/external.c
extern void func_800C9060(Player*, s32);
extern void func_800C9060(u8, s32);
extern void func_800C90F4(u8, u32);
extern void func_800CAB4C(u8);
extern f32 D_802B9F68;
extern s16 gPlayerBalloonCount[];
extern struct Actor gActorList[];
extern Player gPlayers[];
extern Player *gPlayerOne;
extern Player *gPlayerTwo;
extern Player *gPlayerThree;
extern struct Controller gControllers[];
extern struct Controller *gControllerEight;
extern struct Controller *gControllerSeven;
extern struct Controller *gControllerSix;
#endif
+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;
+1
View File
@@ -91,6 +91,7 @@ s16 func_802ABDB8(u16);
s16 func_802ABDF4(u16);
f32 func_802ABE30(f32, f32, f32, u16);
f32 func_802ABEAC(UnkActorInner*, Vec3f);
void func_802AD950(UnkActorInner*, f32, f32, f32, f32, f32, f32, f32);
void func_802ADDC8(UnkActorInner*, f32, f32, f32, f32);
f32 func_802AE1C0(f32, f32, f32);