Replace mk_Vtx_Flag type with GBI provided Vtx (#160)

There's no reason to have our own special type when it exactly matches a GBI type.

This required updating some inc.c data as the old mk_Vtx_Flag type had the 'flag'
 member in the incorrect location.

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2022-02-13 02:04:43 -05:00
committed by GitHub
parent aa47c86fe5
commit 5badb9e49c
9 changed files with 3092 additions and 3213 deletions
+62 -78
View File
@@ -418,64 +418,48 @@ u32 MIO0_0F(s32 arg0, u32 arg1, u32 arg2) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda
extern f32 D_800DC608;
// 802A86C0, 00000010
struct UnkStruct_802A86A8 {
s8 unk0;
s8 unk1;
s8 unk2;
s8 unk3;
s16 unk4;
s16 unk6;
s16 unk8;
s16 unkA;
s16 unkC;
s16 unkE;
};
void func_802A86A8(struct UnkStruct_802A86A8 *arg0, u32 arg1) {
void func_802A86A8(mk64_Vtx *arg0, u32 arg1) {
Vtx *temp_v1;
Vtx *temp_v1_2;
mk64_Vtx *temp_v0;
s8 temp_a0;
s8 temp_a3;
u32 temp_a2;
struct UnkStruct_802A86A8 *temp_v0;
u32 temp_v1;
struct UnkStruct_802A86A8 *temp_v1_2;
struct UnkStruct_802A86A8 *phi_v0;
s8 phi_v1;
mk64_Vtx *phi_v0;
Vtx *phi_v1;
u32 phi_a2;
temp_v1 = gHeapEndPtr - (((arg1 * 0x10) + 0xF) & ~0xF);
gHeapEndPtr = temp_v1;
phi_v0 = arg0;
phi_a2 = 0;
// phi_v1 = temp_v1;
phi_a2 = 0U;
if (arg1 != 0) {
phi_v1 = temp_v1;
do {
if (gIsMirrorMode != 0) {
phi_v1 = -phi_v0->unk0;
phi_v1->v.ob[0] = (s16) -(s32) phi_v0->ob[0];
} else {
phi_v1 = phi_v0->unk0;
phi_v1->v.ob[0] = phi_v0->ob[0];
}
temp_a2 = phi_a2 + 1;
temp_v1_2 = phi_v1 + 0x10;
temp_v0 = phi_v0 + 0xE;
temp_v1_2->unkE = phi_v0->unk2 * D_800DC608;
temp_a0 = temp_v0->unk4;
temp_a3 = temp_v0->unk3;
temp_v1_2->unkC = temp_v0->unkA;
temp_v1_2->unk8 = temp_v0->unk8;
temp_v1_2->unk4 = temp_a0 & 0xFC;
temp_v1_2->unk3 = temp_a3 & 0xFC;
temp_v1_2->unk6 = temp_v0->unk6;
temp_v1_2->unk2 = temp_v0->unk2;
temp_v1_2->unkA = (temp_a0 & 3) | ((temp_a3 * 4) & 0xC);
temp_v1_2->unk1 = 0xFF;
temp_v1_2->unk-E = (s16) (s32) ((f32) phi_v0->ob[1] * D_800DC608);
temp_a0 = temp_v0->unk-4;
temp_a3 = temp_v0->unk-3;
temp_v1_2->unk-C = (s16) temp_v0->unk-A;
temp_v1_2->unk-8 = (s16) temp_v0->unk-8;
temp_v1_2->unk-4 = (s8) (temp_a0 & 0xFC);
temp_v1_2->unk-3 = (s8) (temp_a3 & 0xFC);
temp_v1_2->unk-6 = (s16) temp_v0->unk-6;
temp_v1_2->unk-2 = (s8) temp_v0->unk-2;
temp_v1_2->unk-A = (s16) (s8) ((temp_a0 & 3) | ((temp_a3 * 4) & 0xC));
temp_v1_2->unk-1 = 0xFF;
phi_v0 = temp_v0;
// phi_v1 = temp_v1_2;
phi_v1 = temp_v1_2;
phi_a2 = temp_a2;
} while (temp_a2 < arg1);
}
@@ -3587,7 +3571,7 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802AE1C0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75
//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda
extern s32 D_8015F59C;
extern s32 D_8015F5A0;
extern s32 D_8015F5A4;
@@ -3604,7 +3588,7 @@ static f32 D_802B9E68 = 0.9f;
static f32 D_802B9E6C = 0.1f;
static f32 D_802B9E70 = -0.1f;
void func_802AE434(mk_Vtx_Flag *arg0, mk_Vtx_Flag *arg1, mk_Vtx_Flag *arg2, s8 arg3, u16 arg4) {
void func_802AE434(Vtx *arg0, Vtx *arg1, Vtx *arg2, s8 arg3, u16 arg4) {
s16 spBA;
s16 spB8;
s16 spB6;
@@ -3619,10 +3603,13 @@ void func_802AE434(mk_Vtx_Flag *arg0, mk_Vtx_Flag *arg1, mk_Vtx_Flag *arg2, s8 a
s16 sp48;
s16 sp44;
s16 sp42;
mk_Vtx_Flag *sp1C; /* compiler-managed */
Vtx *sp1C; /* compiler-managed */
f64 sp10;
f64 sp8;
f64 sp0;
Vtx *temp_t1;
Vtx *temp_t2;
Vtx *temp_t6;
f32 temp_f0;
f32 temp_f18_2;
f32 temp_f4_2;
@@ -3634,9 +3621,6 @@ void func_802AE434(mk_Vtx_Flag *arg0, mk_Vtx_Flag *arg1, mk_Vtx_Flag *arg2, s8 a
f64 temp_f4;
f64 temp_f8;
mk64_surface_map_ram *temp_t0;
mk_Vtx_Flag *temp_t1;
mk_Vtx_Flag *temp_t2;
mk_Vtx_Flag *temp_t6;
s16 temp_a0;
s16 temp_a1;
s16 temp_t3;
@@ -3669,36 +3653,36 @@ void func_802AE434(mk_Vtx_Flag *arg0, mk_Vtx_Flag *arg1, mk_Vtx_Flag *arg2, s8 a
temp_t0->vtxs[0] = arg0;
temp_t0->vtxs[1] = arg1;
temp_t0->vtxs[2] = arg2;
if (((u16) arg0->tc[0] != 4) || ((u16) arg1->tc[0] != 4) || ((u16) temp_t0->vtxs[2]->tc[0] != 4)) {
if ((arg0->v.flag != 4) || (arg1->v.flag != 4) || (temp_t0->vtxs[2]->v.flag != 4)) {
temp_t6 = temp_t0->vtxs[0];
sp1C = temp_t6;
temp_t1 = temp_t0->vtxs[1];
temp_t2 = temp_t0->vtxs[2];
temp_a0 = temp_t6->ob[0];
temp_t3 = temp_t1->ob[0];
temp_a1 = temp_t6->ob[2];
temp_t4 = temp_t1->ob[2];
temp_a0 = temp_t6->v.ob[0];
temp_t3 = temp_t1->v.ob[0];
temp_a1 = temp_t6->v.ob[2];
temp_t4 = temp_t1->v.ob[2];
phi_a0 = (s32) temp_a0;
phi_t3 = (s32) temp_t3;
phi_t5 = (s32) temp_t2->ob[0];
phi_t5 = (s32) temp_t2->v.ob[0];
phi_a1 = (s32) temp_a1;
phi_t4 = (s32) temp_t4;
phi_v1 = (s32) temp_t2->ob[2];
phi_a2 = (s32) temp_t6->ob[1];
phi_a3 = (s32) temp_t1->ob[1];
phi_v0 = (s32) temp_t2->ob[1];
phi_v1 = (s32) temp_t2->v.ob[2];
phi_a2 = (s32) temp_t6->v.ob[1];
phi_a3 = (s32) temp_t1->v.ob[1];
phi_v0 = (s32) temp_t2->v.ob[1];
if ((temp_a0 == temp_t3) && (temp_a1 == temp_t4)) {
temp_t0->vtxs[2] = arg1;
temp_t0->vtxs[1] = arg2;
phi_a0 = (s32) arg0->ob[0];
phi_t3 = (s32) arg1->ob[0];
phi_t5 = (s32) arg2->ob[0];
phi_a1 = (s32) arg0->ob[2];
phi_t4 = (s32) arg1->ob[2];
phi_v1 = (s32) arg2->ob[2];
phi_a2 = (s32) arg0->ob[1];
phi_a3 = (s32) arg1->ob[1];
phi_v0 = (s32) arg2->ob[1];
phi_a0 = (s32) arg0->v.ob[0];
phi_t3 = (s32) arg1->v.ob[0];
phi_t5 = (s32) arg2->v.ob[0];
phi_a1 = (s32) arg0->v.ob[2];
phi_t4 = (s32) arg1->v.ob[2];
phi_v1 = (s32) arg2->v.ob[2];
phi_a2 = (s32) arg0->v.ob[1];
phi_a3 = (s32) arg1->v.ob[1];
phi_v0 = (s32) arg2->v.ob[1];
}
if (phi_a0 >= phi_t3) {
if (phi_a0 >= phi_t5) {
@@ -3821,12 +3805,12 @@ block_33:
temp_t0->gravity = sp54;
temp_t0->rotation = sp50;
temp_t0->height2 = sp4C;
temp_t0->unk2 = (s16) arg3;
temp_t0->surfaceType = (u16) arg3;
D_8015F6FA = 0;
D_8015F6FC = 0;
temp_a3_2 = (u16) temp_t0->vtxs[0]->tc[0];
temp_v1_2 = (u16) temp_t0->vtxs[1]->tc[0];
temp_a0_3 = (u16) temp_t0->vtxs[2]->tc[0];
temp_a3_2 = temp_t0->vtxs[0]->v.flag;
temp_v1_2 = temp_t0->vtxs[1]->v.flag;
temp_a0_3 = temp_t0->vtxs[2]->v.flag;
phi_a1_2 = arg4;
if ((temp_a3_2 == 1) && (temp_v1_2 == 1) && (temp_a0_3 == 1)) {
phi_t8 = (arg4 | 0x400) & 0xFFFF;
@@ -4080,7 +4064,7 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802AEE1C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75
//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda
s32 func_802AEE1C(s16, s16, s16, s16, s32, s32, s32, s32); /* extern */
s32 func_802AF0FC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u16 arg4) {
@@ -4090,10 +4074,10 @@ s32 func_802AF0FC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u16 arg4) {
s16 sp2C;
s16 sp2A;
s16 sp28;
Vtx *temp_t0;
Vtx *temp_t1;
Vtx *temp_v1;
mk64_surface_map_ram *temp_v0;
mk_Vtx_Flag *temp_t0;
mk_Vtx_Flag *temp_t1;
mk_Vtx_Flag *temp_v1;
s16 temp_a0;
s16 temp_a0_2;
s16 temp_a1;
@@ -4116,12 +4100,12 @@ s32 func_802AF0FC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u16 arg4) {
temp_v1 = temp_v0->vtxs[0];
temp_t0 = temp_v0->vtxs[1];
temp_t1 = temp_v0->vtxs[2];
temp_t2 = temp_v1->ob[0];
temp_t3 = temp_v1->ob[2];
temp_t4 = temp_t0->ob[0];
temp_t5 = temp_t0->ob[2];
temp_ra = temp_t1->ob[0];
sp28 = temp_t1->ob[2];
temp_t2 = temp_v1->v.ob[0];
temp_t3 = temp_v1->v.ob[2];
temp_t4 = temp_t0->v.ob[0];
temp_t5 = temp_t0->v.ob[2];
temp_ra = temp_t1->v.ob[0];
sp28 = temp_t1->v.ob[2];
if (((s32) temp_t2 >= (s32) temp_a0) && ((s32) temp_a1 >= (s32) temp_t2) && ((s32) temp_t3 >= (s32) temp_a2) && ((s32) temp_a3 >= (s32) temp_t3)) {
return 1;
}