Matched a couple functions in code_80091750 (#243)

Refreshed a couple mips_to_c outputs as well

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
Tyler McGavran
2022-07-11 05:21:10 -04:00
committed by GitHub
parent fd7941e841
commit 7508cd2761
5 changed files with 673 additions and 918 deletions
@@ -1,18 +0,0 @@
glabel func_8009CA2C
/* 09D62C 8009CA2C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 09D630 8009CA30 AFB10018 */ sw $s1, 0x18($sp)
/* 09D634 8009CA34 AFB00014 */ sw $s0, 0x14($sp)
/* 09D638 8009CA38 AFBF001C */ sw $ra, 0x1c($sp)
/* 09D63C 8009CA3C 00008025 */ move $s0, $zero
/* 09D640 8009CA40 24110005 */ li $s1, 5
.L8009CA44:
/* 09D644 8009CA44 0C02729B */ jal func_8009CA6C
/* 09D648 8009CA48 02002025 */ move $a0, $s0
/* 09D64C 8009CA4C 26100001 */ addiu $s0, $s0, 1
/* 09D650 8009CA50 1611FFFC */ bne $s0, $s1, .L8009CA44
/* 09D654 8009CA54 00000000 */ nop
/* 09D658 8009CA58 8FBF001C */ lw $ra, 0x1c($sp)
/* 09D65C 8009CA5C 8FB00014 */ lw $s0, 0x14($sp)
/* 09D660 8009CA60 8FB10018 */ lw $s1, 0x18($sp)
/* 09D664 8009CA64 03E00008 */ jr $ra
/* 09D668 8009CA68 27BD0020 */ addiu $sp, $sp, 0x20
+558 -650
View File
File diff suppressed because it is too large Load Diff
+7 -4
View File
@@ -63,6 +63,7 @@ void func_80092290(s32, s32*, s32*);
void func_80092500();
void func_80092564();
void func_800925A0();
void func_800925CC();
void func_80092604();
void func_80092630();
void func_8009265C();
@@ -115,7 +116,7 @@ void func_8009CA2C();
void func_8009CA6C(s32);
void func_80099A94(MkTexture *, s32);
void func_80099AEC();
void func_8009E1E4(void);
void func_8009E1E4();
void func_80099E54();
void func_80099E60(MkTexture *, s32, s32);
void func_80099EC4();
@@ -137,12 +138,13 @@ Gfx *func_8009BEF0(Gfx*, s32, f32, f32, s32, f32,f32);
Gfx *func_8009C434(Gfx*, struct_8018DEE0_entry*, s32, s32, s32);
Gfx *func_8009C708(Gfx*, struct_8018DEE0_entry *, s32, s32, s32, s32);
void func_8009C918();
void func_8009CA2C();
void func_8009E0F0(s32);
void func_8009E1C0();
void func_8009E1E4();
void func_8009E208(void);
void func_8009E258(void);
void func_8009E280(void);
void func_8009E208();
void func_8009E258();
void func_8009E280();
void func_8009E5BC();
void func_8009E620();
void add_8018D9E0_entry(s32, s32, s32, s8);
@@ -192,6 +194,7 @@ struct_8018D9E0_entry *find_8018D9E0_entry_dupe(s32);
struct_8018D9E0_entry *find_8018D9E0_entry(s32);
s32 func_800AAF70(s32);
void func_800AAF94(struct_8018D9E0_entry*, s32);
void func_800AB098(struct_8018D9E0_entry*);
void func_800AB260(struct_8018D9E0_entry*);
void func_800AB290(struct_8018D9E0_entry*);
void func_800AC978(struct_8018D9E0_entry*);
+67 -77
View File
@@ -83,142 +83,132 @@ void func_80290CAC(uintptr_t arg0) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_802ABD40(u16, void *, s16); // extern
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
extern ? D_80152300;
extern void *gDisplayListHead;
extern ? gSegmentTable;
s16 gCurrentCourseId; /* unable to generate initializer */
void load_surface_map(u32 arg0, void *arg1) {
void *sp34;
void *sp30;
s32 sp24;
void load_surface_map(u32 arg0, struct UnkStruct_800DC5EC *arg1) {
Player *sp34;
Camera *sp30;
void *sp24;
s16 sp22;
s16 sp1E;
Camera *temp_a2;
Gfx *temp_v1_3;
Player *temp_t1;
s16 temp_v0_3;
s16 temp_v0_4;
s16 temp_v1;
s16 temp_v1_2;
s16 var_a0;
s16 var_a3;
u16 temp_v0;
u16 temp_v0_2;
void *temp_a2;
void *temp_t1;
void *temp_v1_3;
s16 phi_a3;
s16 phi_a0;
void *phi_t0;
s16 phi_a3_2;
temp_t1 = arg1->unk8;
temp_a2 = arg1->unk4;
sp24 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000;
temp_t1 = arg1->player;
temp_a2 = arg1->camera;
sp24 = gSegmentTable[arg0 >> 0x18] + (arg0 & 0xFFFFFF) + 0x80000000;
if (gIsMirrorMode != 0) {
temp_v0 = temp_a2->unk26;
if (temp_v0 < 0x2000) {
phi_a3 = 2;
} else if (temp_v0 < 0x6000) {
phi_a3 = 3;
} else if (temp_v0 < 0xA000) {
phi_a3 = 0;
} else if (temp_v0 < 0xE000) {
phi_a3 = 1;
temp_v0 = (u16) temp_a2->rot[1];
if ((s32) temp_v0 < 0x2000) {
var_a3 = 2;
} else if ((s32) temp_v0 < 0x6000) {
var_a3 = 3;
} else if ((s32) temp_v0 < 0xA000) {
var_a3 = 0;
} else if ((s32) temp_v0 < 0xE000) {
var_a3 = 1;
} else {
phi_a3 = 2;
var_a3 = 2;
}
} else {
temp_v0_2 = temp_a2->unk26;
if (temp_v0_2 < 0x2000) {
phi_a3 = 2;
} else if (temp_v0_2 < 0x6000) {
phi_a3 = 1;
} else if (temp_v0_2 < 0xA000) {
phi_a3 = 0;
temp_v0_2 = (u16) temp_a2->rot[1];
if ((s32) temp_v0_2 < 0x2000) {
var_a3 = 2;
} else if ((s32) temp_v0_2 < 0x6000) {
var_a3 = 1;
} else if ((s32) temp_v0_2 < 0xA000) {
var_a3 = 0;
} else {
phi_a3 = 2;
if (temp_v0_2 < 0xE000) {
phi_a3 = 3;
var_a3 = 2;
if ((s32) temp_v0_2 < 0xE000) {
var_a3 = 3;
}
}
}
arg1->unk36 = phi_a3;
if (*(&D_80152300 + (((temp_a2 - camera1) / 0xB8) * 2)) == 1) {
arg1->playerDirection = var_a3;
if (*(&D_80152300 + (((s32) (temp_a2 - camera1) / 184) * 2)) == 1) {
sp34 = temp_t1;
sp22 = phi_a3;
sp22 = var_a3;
sp30 = temp_a2;
sp1E = func_802ABD40(temp_a2->unk5E, temp_a2, phi_a3);
temp_v0_3 = func_802ABD40(temp_t1->unk11A);
sp1E = func_802ABD40(temp_a2->unk_54.unk3A);
temp_v0_3 = func_802ABD40(temp_t1->unk_110.unk3A);
temp_v1 = sp1E - temp_v0_3;
phi_t0 = arg1;
phi_a3_2 = phi_a3;
if ((temp_v1 < 2) && (temp_v1 >= -1)) {
if (sp1E == 0xFF) {
if (temp_v0_3 == 0xFF) {
if (sp1E == 0x00FF) {
if (temp_v0_3 == 0x00FF) {
goto block_60;
}
if (temp_t1->unk124 > 30.0f) {
if (temp_t1->unk_110.unk44 > 30.0f) {
goto block_60;
}
phi_a0 = temp_v0_3;
var_a0 = temp_v0_3;
} else {
if (temp_a2->unk68 > 30.0f) {
if (temp_a2->unk_54.unk44 > 30.0f) {
goto block_60;
}
phi_a0 = sp1E;
var_a0 = sp1E;
}
} else {
temp_v1_2 = gCurrentCourseId;
if (temp_v1_2 != 1) {
if (temp_v1_2 == 2) {
if ((temp_v0_3 >= 0x11) && (temp_v0_3 < 0x18)) {
phi_a0 = temp_v0_3;
} else if ((temp_v0_3 == 0xFF) && (sp1E != 0xFF)) {
phi_a0 = sp1E;
} else if ((temp_v0_3 != 0xFF) && (sp1E == 0xFF)) {
phi_a0 = temp_v0_3;
var_a0 = temp_v0_3;
} else if ((temp_v0_3 == 0x00FF) && (sp1E != 0x00FF)) {
var_a0 = sp1E;
} else if ((temp_v0_3 != 0x00FF) && (sp1E == 0x00FF)) {
var_a0 = temp_v0_3;
} else {
goto block_60;
}
} else {
if (temp_v0_3 == 0xFF) {
if (temp_v0_3 == 0x00FF) {
goto block_60;
}
if (temp_t1->unk124 > 30.0f) {
if (temp_t1->unk_110.unk44 > 30.0f) {
goto block_60;
}
phi_a0 = temp_v0_3;
var_a0 = temp_v0_3;
}
} else if ((temp_v0_3 >= 0xE) && (temp_v0_3 < 0x16)) {
phi_a0 = temp_v0_3;
} else if ((temp_v0_3 == 0xFF) && (sp1E != 0xFF)) {
phi_a0 = sp1E;
} else if ((temp_v0_3 != 0xFF) && (sp1E == 0xFF)) {
phi_a0 = temp_v0_3;
var_a0 = temp_v0_3;
} else if ((temp_v0_3 == 0x00FF) && (sp1E != 0x00FF)) {
var_a0 = sp1E;
} else if ((temp_v0_3 != 0x00FF) && (sp1E == 0x00FF)) {
var_a0 = temp_v0_3;
} else {
goto block_60;
}
}
} else {
sp22 = phi_a3;
sp22 = var_a3;
sp30 = temp_a2;
temp_v0_4 = func_802ABD40(temp_a2->unk5E, temp_a2, phi_a3);
phi_a0 = temp_v0_4;
phi_t0 = arg1;
phi_a3_2 = phi_a3;
if (temp_a2->unk68 > 30.0f) {
temp_v0_4 = func_802ABD40(temp_a2->unk_54.unk3A);
var_a0 = temp_v0_4;
if (temp_a2->unk_54.unk44 > 30.0f) {
goto block_60;
}
if (temp_v0_4 == 0xFF) {
if (temp_v0_4 == 0x00FF) {
block_60:
phi_a0 = arg1->unk38;
phi_t0 = arg1;
phi_a3_2 = phi_a3;
var_a0 = arg1->pathCounter;
}
}
phi_t0->unk38 = phi_a0;
arg1->pathCounter = var_a0;
temp_v1_3 = gDisplayListHead;
gDisplayListHead = temp_v1_3 + 8;
temp_v1_3->unk0 = 0x6000000;
temp_v1_3->unk4 = *(sp24 + ((((phi_a0 * 4) + phi_a3_2) - 4) * 4));
temp_v1_3->words.w0 = 0x06000000;
temp_v1_3->words.w1 = *(sp24 + ((s16) (((var_a0 * 4) + var_a3) - 4) * 4));
}
#else
GLOBAL_ASM("asm/non_matchings/render_courses/load_surface_map.s")
+41 -169
View File
@@ -581,102 +581,6 @@ void func_802A4A0C(Vtx *arg0, struct UnkStruct_800DC5EC *arg1, s32 arg2, s32 arg
GLOBAL_ASM("asm/non_matchings/skybox/func_802A4A0C.s")
#endif
/*
void func_802A4A0C(Vtx *arg0, void *arg1, ? arg2, ? arg3) {
void *sp13C;
? sp128;
? spE8;
? spA8;
? sp68;
f32 sp64;
f32 sp60;
f32 sp5C;
f32 sp58;
Gfx *temp_v0;
Gfx *temp_v0_2;
Gfx *temp_v0_3;
Gfx *temp_v0_4;
Gfx *temp_v0_5;
Gfx *temp_v0_6;
Gfx *temp_v0_7;
Gfx *temp_v0_8;
Gfx *temp_v0_9;
f32 temp_f0;
f32 temp_f10;
f32 temp_f16;
f32 temp_f18;
f32 temp_f6;
s16 temp_t5;
sp13C = arg1->unk4;
func_802A450C(arg0);
sp64 = D_802B9BB0;
sp5C = 0.0f;
sp60 = 0.0f;
func_802B5564(&spE8, &sp128, sp13C->unkB4, D_80150148, D_80150150, D_8015014C, 1.0f);
func_802B5794(&spA8, sp13C, sp13C + 0xC);
func_802B71CC(&sp68, &spE8, &spA8);
sp58 = spA4 + ((sp74 * sp5C) + (sp84 * sp60) + (sp94 * sp64));
func_802B6434(&sp5C, &sp68);
temp_f0 = (f32) (1.0 / (f64) sp58);
temp_f18 = sp5C * temp_f0;
temp_f6 = sp60 * temp_f0;
temp_f10 = temp_f18 * 160.0f;
sp5C = temp_f18;
temp_f16 = temp_f6 * 120.0f;
sp60 = temp_f6;
sp5C = temp_f10;
sp60 = temp_f16;
temp_t5 = 0x78 - (s32) temp_f16;
arg1->unk28 = temp_t5;
arg0->unk12 = temp_t5;
arg0->unk22 = temp_t5;
arg0->unk42 = temp_t5;
arg0->unk72 = temp_t5;
func_802A3E3C();
temp_v0 = gDisplayListHead;
gDisplayListHead = temp_v0 + 8;
temp_v0->words.w0 = 0xB900031D;
temp_v0->words.w1 = 0xF0A4000;
temp_v0_2 = gDisplayListHead;
gDisplayListHead = temp_v0_2 + 8;
temp_v0_2->words.w0 = 0xB6000000;
temp_v0_2->words.w1 = 0x20001;
guOrtho((Mtx *) gGfxPool, 0.0f, 320.0f, 0.0f, 240.0f, 0.0f, 5.0f, 1.0f);
temp_v0_3 = gDisplayListHead;
gDisplayListHead = temp_v0_3 + 8;
temp_v0_3->words.w1 = 0xFFFF;
temp_v0_3->words.w0 = 0xB4000000;
temp_v0_4 = gDisplayListHead;
gDisplayListHead = temp_v0_4 + 8;
temp_v0_4->words.w0 = 0x1030040;
temp_v0_4->words.w1 = (s32) gGfxPool & 0x1FFFFFFF;
temp_v0_5 = gDisplayListHead;
gDisplayListHead = temp_v0_5 + 8;
temp_v0_5->words.w1 = (s32) &D_0D008E98 & 0x1FFFFFFF;
temp_v0_5->words.w0 = 0x1020040;
temp_v0_6 = gDisplayListHead;
gDisplayListHead = temp_v0_6 + 8;
temp_v0_6->words.w1 = (u32) arg0;
temp_v0_6->words.w0 = 0x400103F;
temp_v0_7 = gDisplayListHead;
gDisplayListHead = temp_v0_7 + 8;
temp_v0_7->words.w0 = 0xB1000602;
temp_v0_7->words.w1 = 0x20604;
if (gCurrentCourseId == 0xD) {
temp_v0_8 = gDisplayListHead;
gDisplayListHead = temp_v0_8 + 8;
temp_v0_8->words.w1 = (u32) (arg0 + 0x40);
temp_v0_8->words.w0 = 0x400103F;
temp_v0_9 = gDisplayListHead;
gDisplayListHead = temp_v0_9 + 8;
temp_v0_9->words.w1 = 0x20604;
temp_v0_9->words.w0 = 0xB1000602;
}
}
*/
#ifdef MIPS_TO_C
extern s32 gScreenModeSelection;
void func_802A4D18(void) {
@@ -1481,95 +1385,63 @@ void func_802A74BC(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
void func_802A7658(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) {
s32 temp_a0;
s32 temp_a1;
s32 temp_a1_2;
s32 temp_t5;
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v1;
u16 *temp_t1;
u16 *temp_t1_2;
u16 *temp_t1_3;
void *temp_t3;
u16 *phi_t3;
u16 *phi_t1;
s32 phi_a1;
void *phi_t3_2;
u16 *phi_t1_2;
s32 phi_a1_2;
s32 phi_v1;
s32 phi_a2;
s32 phi_v0;
s32 phi_a0;
s32 phi_a0_2;
s32 phi_v0_2;
s32 phi_v0_3;
s32 var_a0;
s32 var_a1;
s32 var_a2;
s32 var_v0;
s32 var_v1;
u16 *var_t1;
u16 *var_t3;
u16 temp_t8;
u16 temp_t9;
void *var_t3_2;
phi_v1 = 0;
phi_v0 = 0;
var_v0 = 0;
var_v1 = 0;
if (arg3 > 0) {
phi_a2 = (arg1 * 0x140) + arg0;
var_a2 = (arg1 * 0x140) + arg0;
do {
phi_a1 = 0;
phi_a0 = phi_a2;
phi_a1_2 = 0;
phi_a0_2 = phi_a2;
phi_v0_2 = phi_v0;
phi_v0_3 = phi_v0;
var_a0 = var_a2;
var_a1 = 0;
if (arg2 > 0) {
temp_t5 = arg2 & 3;
temp_t1 = arg5 + (phi_v0 * 2);
phi_t1 = temp_t1;
phi_t1_2 = temp_t1;
var_t1 = arg5 + (var_v0 * 2);
if (temp_t5 != 0) {
phi_t3 = arg4 + (phi_a2 * 2);
var_t3 = arg4 + (var_a0 * 2);
do {
temp_a1 = phi_a1 + 1;
temp_v0 = phi_v0_2 + 1;
temp_t1_2 = phi_t1 + 2;
temp_a0 = phi_a0_2 + 1;
temp_t1_2->unk-2 = *phi_t3;
phi_t3 += 2;
phi_t1 = temp_t1_2;
phi_a1 = temp_a1;
phi_a0 = temp_a0;
phi_t1_2 = temp_t1_2;
phi_a1_2 = temp_a1;
phi_v0 = temp_v0;
phi_a0_2 = temp_a0;
phi_v0_2 = temp_v0;
phi_v0_3 = temp_v0;
} while (temp_t5 != temp_a1);
if (temp_a1 != arg2) {
temp_t9 = *var_t3;
var_a1 += 1;
var_v0 += 1;
var_t1 += 2;
var_a0 += 1;
var_t3 += 2;
var_t1->unk-2 = temp_t9;
} while (temp_t5 != var_a1);
if (var_a1 != arg2) {
goto block_7;
}
} else {
block_7:
phi_t3_2 = arg4 + (phi_a0 * 2);
var_t3_2 = arg4 + (var_a0 * 2);
do {
temp_a1_2 = phi_a1_2 + 4;
temp_v0_2 = phi_v0_3 + 4;
*phi_t1_2 = phi_t3_2->unk0;
temp_t1_3 = phi_t1_2 + 8;
temp_t3 = phi_t3_2 + 8;
temp_t1_3->unk-6 = phi_t3_2->unk2;
temp_t1_3->unk-4 = temp_t3->unk-4;
temp_t1_3->unk-2 = temp_t3->unk-2;
phi_t3_2 = temp_t3;
phi_t1_2 = temp_t1_3;
phi_a1_2 = temp_a1_2;
phi_v0 = temp_v0_2;
phi_v0_3 = temp_v0_2;
} while (temp_a1_2 != arg2);
var_a1 += 4;
var_v0 += 4;
*var_t1 = var_t3_2->unk0;
temp_t8 = var_t3_2->unk2;
var_t1 += 8;
var_t3_2 += 8;
var_t1->unk-6 = temp_t8;
var_t1->unk-4 = (u16) var_t3_2->unk-4;
var_t1->unk-2 = (u16) var_t3_2->unk-2;
} while (var_a1 != arg2);
}
}
temp_v1 = phi_v1 + 1;
phi_v1 = temp_v1;
phi_a2 += 0x140;
} while (temp_v1 != arg3);
var_v1 += 1;
var_a2 += 0x140;
} while (var_v1 != arg3);
}
}
#else