diff options
| author | Tyler McGavran <tyler.taggerung@gmail.com> | 2022-01-27 19:29:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-27 17:29:33 -0700 |
| commit | a5e945b233c43921b744e41a7d593b6b196755bc (patch) | |
| tree | 1f88a18a5ac5b96ccb2ca554b6ad7b284b58d612 /src/code_800AF9B0.c | |
| parent | 226a557d8c2409fb42e525c995b95d3cccf354e2 (diff) | |
Add struct for D_8018CA70 (#153)
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Diffstat (limited to 'src/code_800AF9B0.c')
| -rw-r--r-- | src/code_800AF9B0.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/code_800AF9B0.c b/src/code_800AF9B0.c index c915f263e..87fbf8617 100644 --- a/src/code_800AF9B0.c +++ b/src/code_800AF9B0.c @@ -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); |
