Add struct for D_8018CA70 (#153)

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2022-01-27 19:29:33 -05:00
committed by GitHub
parent 226a557d8c
commit a5e945b233
7 changed files with 1155 additions and 1003 deletions
+15 -19
View File
@@ -3072,48 +3072,44 @@ GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B5020.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800B45E0(s32); // extern
? populate_time_trial_record(void *, u32, s32, s32); // extern
s32 func_800B4F2C(s32, ? *, ? *, s32); // extern
extern ? D_8018CA70;
//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75
? populate_time_trial_record(u8 *, u32, s32, s32); /* extern */
extern ? D_8018CA74;
extern ? D_8018EB90;
extern s8 gCupSelection;
s8 gCharacterSelections[4]; /* unable to generate initializer; const */
s32 func_800B5218(void) {
s32 sp38;
s32 sp28;
s32 sp24;
void *sp20;
? *sp18;
u8 *sp20;
struct_8018CA70_entry *sp18;
? *temp_a1;
s32 temp_a0;
s32 temp_v0;
s32 temp_v1;
u32 temp_a1_2;
void *temp_v0_2;
u8 *temp_v0_2;
? *phi_a1;
? *phi_a2;
struct_8018CA70_entry *phi_a2;
s32 phi_v0;
? *phi_a2_2;
struct_8018CA70_entry *phi_a2_2;
s32 phi_a3;
s32 phi_v0_2;
s32 phi_a3_2;
sp38 = (gCupSelection * 4) + gCupCourseSelection;
sp28 = *gCharacterSelections;
sp28 = (s32) *gCharacterSelections;
phi_a1 = &D_8018CA74;
phi_a2 = &D_8018CA70;
phi_a2 = D_8018CA70;
phi_v0 = 1;
phi_a3_2 = 1;
do {
temp_v1 = phi_a1->unk20;
temp_a0 = phi_a2->unk20;
temp_a0 = phi_a2->lap1Duration;
phi_a2_2 = phi_a2;
phi_a3 = phi_a3_2;
if (temp_v1 < temp_a0) {
phi_a2_2 = (phi_v0 * 4) + &D_8018CA70;
phi_a2_2 = (phi_v0 * 4) + D_8018CA70;
phi_a3 = 1 << phi_v0;
} else if (temp_a0 == temp_v1) {
phi_a3 = phi_a3_2 | (1 << phi_v0);
@@ -3127,10 +3123,10 @@ s32 func_800B5218(void) {
} while (temp_v0 != 3);
sp18 = phi_a2_2;
sp24 = phi_a3;
temp_a1_2 = phi_a2_2->unk20;
temp_a1_2 = phi_a2_2->lap1Duration;
phi_v0_2 = 0;
if (temp_a1_2 < (func_800B4F2C(temp_a0, temp_a1, phi_a2_2, phi_a3) & 0xFFFFF)) {
temp_v0_2 = ((sp38 / 4) * 0x60) + ((sp38 % 4) * 0x18) + &D_8018EB90;
if (temp_a1_2 < (u32) (func_800B4F2C(temp_a0, temp_a1, phi_a2_2, phi_a3) & 0xFFFFF)) {
temp_v0_2 = &D_8018EB90.allCourseTimeTrialRecords.cupRecords[sp38].courseRecords[sp38].records[0];
sp20 = temp_v0_2;
sp24 = phi_a3;
populate_time_trial_record(temp_v0_2 + 0xF, temp_a1_2, sp28, phi_a3);