From c187c71bb9c354029fd0a3ced13071fca4e70215 Mon Sep 17 00:00:00 2001 From: coco875 <59367621+coco875@users.noreply.github.com> Date: Mon, 25 Dec 2023 18:32:52 +0100 Subject: [PATCH] place const and format external, code_8005fd0 and 80091750 (#515) --- src/audio/external.c | 2301 +++++++++++++++++++-------------------- src/code_80005FD0.c | 37 +- src/code_80091750.c | 57 +- src/hud_renderer.c | 8 +- src/menus.c | 2 +- src/player_controller.c | 101 +- src/render_player.c | 124 +-- src/staff_ghosts.c | 4 +- 8 files changed, 1314 insertions(+), 1320 deletions(-) diff --git a/src/audio/external.c b/src/audio/external.c index c45d9d5ef..60788710a 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -262,18 +262,18 @@ f32 func_800C1480(u8 bank, u8 soundId) { var_f2 = 0.0f; } else { switch (temp_v0->soundBits & 0x30000) { /* irregular */ - case 0x10000: - var_v0 = 0x1F4; - break; - case 0x20000: - var_v0 = 0x29A; - break; - case 0x30000: - var_v0 = 0x3E8; - break; - default: - var_v0 = 0x190; - break; + case 0x10000: + var_v0 = 0x1F4; + break; + case 0x20000: + var_v0 = 0x29A; + break; + case 0x30000: + var_v0 = 0x3E8; + break; + default: + var_v0 = 0x190; + break; } if (temp_f0 < var_v0) { var_f2 = (((var_v0 - temp_f0) / var_v0) * 0.5) + 0.5; @@ -395,18 +395,18 @@ void func_800C19D0(u8 arg0, u8 arg1, u8 arg2) { sp3C = 1.0f; sp34 = 1.0f; switch (arg0) { - case 0: - case 1: - case 2: - case 3: - case 5: - temp_s0 = &sSoundBanks[arg0][arg1]; - temp_s0->distance = sqrtf(temp_s0->distance); - sp3C = (func_800C1480(arg0, arg1) * *temp_s0->unk14) * D_80192C48[arg0].current; - sp3B = func_800C15D0(arg0, arg1, arg2); - sp34 = func_800C1934(arg0, arg1) * *temp_s0->unk10; - sp33 = func_800C16E8(*temp_s0->unk00, *temp_s0->unk08, temp_s0->cameraId); - break; + case 0: + case 1: + case 2: + case 3: + case 5: + temp_s0 = &sSoundBanks[arg0][arg1]; + temp_s0->distance = sqrtf(temp_s0->distance); + sp3C = (func_800C1480(arg0, arg1) * *temp_s0->unk14) * D_80192C48[arg0].current; + sp3B = func_800C15D0(arg0, arg1, arg2); + sp34 = func_800C1934(arg0, arg1) * *temp_s0->unk10; + sp33 = func_800C16E8(*temp_s0->unk00, *temp_s0->unk08, temp_s0->cameraId); + break; } temp_s0_2 = &D_8018EF18[arg2]; if (sp3C != temp_s0_2->unk0) { @@ -605,17 +605,17 @@ void func_800C2274(s32 player) { var_a2 = 0xF; if (((u32) gSequencePlayers[temp_a3] >> 0x1F) != 0) { switch (gScreenModeSelection) { /* irregular */ - case 0: - break; - case 1: - var_a2 = 0xE; - break; - case 3: - var_a2 = 0xC; - if (gPlayerCountSelection1 == 3) { - var_a2 = 0xD; - } - break; + case 0: + break; + case 1: + var_a2 = 0xE; + break; + case 3: + var_a2 = 0xC; + if (gPlayerCountSelection1 == 3) { + var_a2 = 0xD; + } + break; } temp_v0 = gSequencePlayers[temp_a3].channels[var_a2]; temp_s0 = (u8) temp_v0->soundScriptIO[0]; @@ -630,27 +630,27 @@ void func_800C2274(s32 player) { sp44 = var_s1; } switch (temp_s0) { /* switch 1; irregular */ - case 1: /* switch 1 */ - temp_v0_2 = D_8018FC10[sp46]; - temp_v0_2->unk0 = (u16) sp44; - var_s0 = 0; - temp_v0_2->unk2 = sp42; - do { - temp_s1 = D_8018FC10[var_s0]; - temp_a1 = (s16) temp_s1->unk0; - if (temp_a1 != (s16) 0x00FFU) { - func_8001AAAC(var_s0, temp_a1, temp_s1->unk2); - temp_s1->unk0 = 0x00FF; - } - temp_t2 = (var_s0 + 1) & 0xFF; - var_s0 = temp_t2; - } while (temp_t2 < 4); - return; - case 2: /* switch 1 */ - temp_v0_3 = D_8018FC10[sp46]; - temp_v0_3->unk0 = (u16) sp44; - temp_v0_3->unk2 = sp42; - break; + case 1: /* switch 1 */ + temp_v0_2 = D_8018FC10[sp46]; + temp_v0_2->unk0 = (u16) sp44; + var_s0 = 0; + temp_v0_2->unk2 = sp42; + do { + temp_s1 = D_8018FC10[var_s0]; + temp_a1 = (s16) temp_s1->unk0; + if (temp_a1 != (s16) 0x00FFU) { + func_8001AAAC(var_s0, temp_a1, temp_s1->unk2); + temp_s1->unk0 = 0x00FF; + } + temp_t2 = (var_s0 + 1) & 0xFF; + var_s0 = temp_t2; + } while (temp_t2 < 4); + return; + case 2: /* switch 1 */ + temp_v0_3 = D_8018FC10[sp46]; + temp_v0_3->unk0 = (u16) sp44; + temp_v0_3->unk2 = sp42; + break; } } } @@ -855,270 +855,270 @@ void func_800C2A2C(u16 arg0) { temp_t6 = (u32) (arg0 & 0x0F000000) >> 0x18; temp_a1 = temp_t6 & 0xFF; switch (temp_t8) { - case 0: - func_800C284C(temp_t6 & 0xFF, arg0 & 0xFF, ((u32) (arg0 & 0xFF00) >> 8) & 0xFF, ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF); - return; - case 1: - func_800C29B4(temp_t6 & 0xFF, ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF); - return; - case 2: - temp_t8_2 = temp_t6 & 0xFF; - temp_t4 = &D_80192CC6[temp_t8_2]; - sp3C = temp_t8_2; - temp_t1 = *temp_t4; - var_v1 = 0; - var_t3 = temp_t1; - if ((s32) temp_t1 > 0) { - temp_a0 = arg0 & 0xFF; - sp48 = temp_a0; -loop_6: - if (temp_a0 == *(D_80192CA8[temp_t8_2] + (var_v1 * 2))) { - if (var_v1 == 0) { - func_800C284C(unksp3F, unksp4B, ((u32) (arg0 & 0xFF00) >> 8) & 0xFF, ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF); + case 0: + func_800C284C(temp_t6 & 0xFF, arg0 & 0xFF, ((u32) (arg0 & 0xFF00) >> 8) & 0xFF, ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF); + return; + case 1: + func_800C29B4(temp_t6 & 0xFF, ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF); + return; + case 2: + temp_t8_2 = temp_t6 & 0xFF; + temp_t4 = &D_80192CC6[temp_t8_2]; + sp3C = temp_t8_2; + temp_t1 = *temp_t4; + var_v1 = 0; + var_t3 = temp_t1; + if ((s32) temp_t1 > 0) { + temp_a0 = arg0 & 0xFF; + sp48 = temp_a0; + loop_6: + if (temp_a0 == *(D_80192CA8[temp_t8_2] + (var_v1 * 2))) { + if (var_v1 == 0) { + func_800C284C(unksp3F, unksp4B, ((u32) (arg0 & 0xFF00) >> 8) & 0xFF, ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF); + return; + } + } else { + temp_t6_2 = (var_v1 + 1) & 0xFF; + var_v1 = temp_t6_2; + if (temp_t6_2 >= (s32) D_80192CC6[temp_a1]) { + var_v1 = 0; + goto block_11; + } + goto loop_6; + } + } else { + block_11: + var_t0 = temp_t1 & 0xFF; + if ((s32) var_t3 > 0) { + do { + if ((((u32) (arg0 & 0xFF00) >> 8) & 0xFF) >= (s32) (D_80192CA8[sp3C] + (var_v1 * 2))->unk1) { + var_t0 = var_v1 & 0xFF; + var_v1 = temp_t1 & 0xFF; + } + temp_t8_3 = (var_v1 + 1) & 0xFF; + var_v1 = temp_t8_3; + } while (temp_t8_3 < (s32) D_80192CC6[temp_a1]); + } + if ((var_t0 != var_t3) || (var_t0 == 0)) { + temp_a2 = D_80192CA8[sp3C]; + if ((s32) var_t3 < 5) { + temp_t9 = temp_t1 + 1; + *temp_t4 = temp_t9; + var_t3 = temp_t9 & 0xFF; + } + var_v0 = (var_t3 - 1) & 0xFF; + var_v1_2 = var_v0; + if (var_t0 != var_v0) { + do { + temp_a1_2 = temp_a2 + (var_v0 * 2); + temp_a0_2 = temp_a2 + (var_v1_2 * 2); + temp_a0_2->unk1 = (u8) temp_a1_2->unk-1; + var_v0 = (var_v1_2 - 1) & 0xFF; + var_v1_2 = var_v0; + temp_a0_2->unk0 = (u8) temp_a1_2->unk-2; + } while (var_t0 != var_v0); + } + temp_v0 = temp_a2 + (var_t0 * 2); + temp_v0->unk1 = (s8) (((u32) (arg0 & 0xFF00) >> 8) & 0xFF); + temp_v0->unk0 = (s8) (arg0 & 0xFF); + } + if (var_t0 == 0) { + func_800C284C(unksp3F, arg0 & 0xFF, ((u32) (arg0 & 0xFF00) >> 8) & 0xFF, ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF); + return; + } + default: + return; + } + break; + case 3: + temp_t8_4 = temp_t6 & 0xFF; + temp_t4_2 = &D_80192CC6[temp_t8_4]; + sp3C = temp_t8_4; + temp_t1_2 = *temp_t4_2; + var_v1_3 = 0; + var_t0_2 = temp_t1_2; + if ((s32) temp_t1_2 > 0) { + do { + if ((arg0 & 0xFF) == *(D_80192CA8[temp_t8_4] + (var_v1_3 * 2))) { + var_t0_2 = var_v1_3 & 0xFF; + var_v1_3 = temp_t1_2 & 0xFF; + } + temp_t8_5 = (var_v1_3 + 1) & 0xFF; + var_v1_3 = temp_t8_5; + } while (temp_t8_5 < (s32) D_80192CC6[temp_a1]); + } + if (var_t0_2 != temp_t1_2) { + temp_a3 = temp_t1_2 - 1; + var_v1_4 = var_t0_2 & 0xFF; + if ((s32) var_t0_2 < temp_a3) { + temp_a2_2 = D_80192CA8[sp3C]; + var_v0_2 = var_v1_4; + do { + temp_a1_3 = temp_a2_2 + (var_v0_2 * 2); + temp_a0_3 = temp_a2_2 + (var_v1_4 * 2); + temp_a0_3->unk1 = (u8) temp_a1_3->unk3; + var_v0_2 = (var_v1_4 + 1) & 0xFF; + var_v1_4 = var_v0_2; + temp_a0_3->unk0 = (u8) temp_a1_3->unk2; + } while (var_v0_2 < temp_a3); + } + *temp_t4_2 = temp_t1_2 - 1; + } + if (var_t0_2 == 0) { + temp_a3_2 = ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF; + sp4C = temp_a3_2; + sp34 = temp_t4_2; + func_800C29B4(unksp3F, temp_a3_2 & 0xFFFF); + if (*temp_t4_2 != 0) { + temp_v0_2 = D_80192CA8[sp3C]; + func_800C284C((u8) sp3C, temp_v0_2->unk0, temp_v0_2->unk1, (u16) temp_a3_2); + return; + } + } + break; + case 4: + temp_t9_2 = (u32) (arg0 & 0xFF0000) >> 0xF; + temp_v1 = temp_t9_2 & 0xFF; + var_a1 = temp_t9_2 & 0xFF; + if (temp_v1 == 0) { + var_a1 = (temp_v1 + 1) & 0xFF; + } + temp_v0_3 = &D_801930D0[temp_t6 & 0xFF]; + temp_f2 = temp_v0_3->unk_000; + temp_f0 = (f32) (arg0 & 0xFF) / 127.0f; + temp_v0_3->unk_004 = temp_f0; + if (temp_f2 != temp_f0) { + var_f8 = (f32) var_a1; + if (var_a1 < 0) { + var_f8 += 4294967296.0f; + } + temp_v0_3->unk_00C = (u16) var_a1; + temp_v0_3->unk_008 = (temp_f2 - temp_v0_3->unk_004) / var_f8; + return; + } + break; + case 5: + temp_t7 = (u32) (arg0 & 0xFF0000) >> 0xF; + temp_v1_2 = temp_t7 & 0xFF; + var_a1_2 = temp_t7 & 0xFF; + if (temp_v1_2 == 0) { + var_a1_2 = (temp_v1_2 + 1) & 0xFF; + } + var_v1_5 = 0; + temp_a2_3 = temp_t6 & 0xFF; + temp_a0_4 = &D_801930D0[temp_a2_3]; + temp_f0_2 = (f32) (arg0 & 0xFFFF) / 1000.0f; + do { + temp_v0_4 = temp_a0_4 + (var_v1_5 << 5); + temp_t8_6 = (var_v1_5 + 1) & 0xFF; + temp_f4 = temp_a0_4->unk_044[var_v1_5].unk_10 - temp_f0_2; + temp_at = temp_t8_6 < 0x10; + var_v1_5 = temp_t8_6; + temp_v0_4->unk58 = temp_f0_2; + temp_v0_4->unk60 = (s16) var_a1_2; + temp_v0_4->unk5C = (f32) (temp_f4 / (f32) var_a1_2); + } while (temp_at != 0); + D_801930D0[temp_a2_3].unk_244 = 0xFFFF; + return; + case 6: + temp_t8_7 = (u32) (arg0 & 0xFF0000) >> 0xF; + temp_v1_3 = temp_t8_7 & 0xFF; + var_a1_3 = temp_t8_7 & 0xFF; + if (temp_v1_3 == 0) { + var_a1_3 = (temp_v1_3 + 1) & 0xFF; + } + temp_a3_3 = temp_t6 & 0xFF; + temp_a2_4 = ((u32) (arg0 & 0xF00) >> 8) & 0xFF; + temp_t6_3 = &D_801930D0[temp_a3_3]; + temp_f0_3 = (f32) (arg0 & 0xFF) / 127.0f; + temp_t6_3->unk_044[temp_a2_4].unk4 = temp_f0_3; + if (temp_t6_3->unk_044[temp_a2_4].unk_00 != temp_f0_3) { + temp_v0_5 = &D_801930D0[temp_a3_3]; + var_f16 = (f32) var_a1_3; + if (var_a1_3 < 0) { + var_f16 += 4294967296.0f; + } + temp_v0_5->unk_044[temp_a2_4].unk_0C = (u16) var_a1_3; + temp_v0_5->unk_044[temp_a2_4].unk_08 = (temp_v0_5->unk_044[temp_a2_4].unk_00 - temp_v0_5->unk_044[temp_a2_4].unk4) / var_f16; + temp_v0_5->unk_244 |= 1 << temp_a2_4; + return; + } + break; + case 7: + func_800CBBE8(((temp_t6 & 0xFF) << 0x10) | 0x46000000 | ((((u32) (arg0 & 0xFF0000) >> 0x10) & 0xFF) << 8), (s8) arg0); + return; + case 8: + temp_v0_6 = temp_t6 & 0xFF; + temp_a2_5 = ((u32) (arg0 & 0xF00) >> 8) & 0xFF; + if (!(D_801930D0[temp_v0_6].unk_24A & (1 << temp_a2_5))) { + func_800CBBE8(((temp_v0_6 & 0xFF) << 0x10) | 0x06000000 | ((temp_a2_5 & 0xFF) << 8) | (((u32) (arg0 & 0xFF0000) >> 0x10) & 0xFF), (s8) arg0); + return; + } + break; + case 9: + D_801930D0[temp_t6 & 0xFF].unk_24A = arg0; + return; + case 10: + var_a0 = 1; + sp48 = ((temp_t6 & 0xFF) << 0x10) | 0x08000000; + var_a3 = arg0 & 0xFFFF; + var_v1_6 = 0; + do { + if (var_a3 & var_a0) { + var_a2 = 1; + } else { + var_a2 = 0; + } + sp4C = var_a0; + sp5B = var_v1_6; + sp44 = var_a3; + func_800CBBE8(sp48 | ((var_v1_6 & 0xFF) << 8), var_a2); + temp_t8_8 = (var_v1_6 + 1) & 0xFF; + temp_at_2 = temp_t8_8 < 0x10; + var_v1_6 = (u8) temp_t8_8; + var_a0 = (var_a0 * 2) & 0xFFFF; + } while (temp_at_2 != 0); + return; + case 11: + D_801930D0[temp_t6 & 0xFF].unk_014 = (s32) arg0; + return; + case 12: + if ((((u32) (arg0 & 0xF00000) >> 0x14) & 0xFF) != 0xF) { + temp_v0_7 = &D_801930D0[temp_t6 & 0xFF]; + temp_t0 = temp_v0_7->unk_041; + temp_v0_7->unk_041 = temp_t0 + 1; + if ((s32) temp_t0 < 5) { + temp_v0_7->unk_02C[temp_t0] = (u32) arg0; + temp_v0_7->unk_040 = 2; return; } } else { - temp_t6_2 = (var_v1 + 1) & 0xFF; - var_v1 = temp_t6_2; - if (temp_t6_2 >= (s32) D_80192CC6[temp_a1]) { - var_v1 = 0; - goto block_11; - } - goto loop_6; - } - } else { -block_11: - var_t0 = temp_t1 & 0xFF; - if ((s32) var_t3 > 0) { - do { - if ((((u32) (arg0 & 0xFF00) >> 8) & 0xFF) >= (s32) (D_80192CA8[sp3C] + (var_v1 * 2))->unk1) { - var_t0 = var_v1 & 0xFF; - var_v1 = temp_t1 & 0xFF; - } - temp_t8_3 = (var_v1 + 1) & 0xFF; - var_v1 = temp_t8_3; - } while (temp_t8_3 < (s32) D_80192CC6[temp_a1]); - } - if ((var_t0 != var_t3) || (var_t0 == 0)) { - temp_a2 = D_80192CA8[sp3C]; - if ((s32) var_t3 < 5) { - temp_t9 = temp_t1 + 1; - *temp_t4 = temp_t9; - var_t3 = temp_t9 & 0xFF; - } - var_v0 = (var_t3 - 1) & 0xFF; - var_v1_2 = var_v0; - if (var_t0 != var_v0) { - do { - temp_a1_2 = temp_a2 + (var_v0 * 2); - temp_a0_2 = temp_a2 + (var_v1_2 * 2); - temp_a0_2->unk1 = (u8) temp_a1_2->unk-1; - var_v0 = (var_v1_2 - 1) & 0xFF; - var_v1_2 = var_v0; - temp_a0_2->unk0 = (u8) temp_a1_2->unk-2; - } while (var_t0 != var_v0); - } - temp_v0 = temp_a2 + (var_t0 * 2); - temp_v0->unk1 = (s8) (((u32) (arg0 & 0xFF00) >> 8) & 0xFF); - temp_v0->unk0 = (s8) (arg0 & 0xFF); - } - if (var_t0 == 0) { - func_800C284C(unksp3F, arg0 & 0xFF, ((u32) (arg0 & 0xFF00) >> 8) & 0xFF, ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF); + D_801930D0[temp_t6 & 0xFF].unk_041 = 0; return; } - default: - return; - } - break; - case 3: - temp_t8_4 = temp_t6 & 0xFF; - temp_t4_2 = &D_80192CC6[temp_t8_4]; - sp3C = temp_t8_4; - temp_t1_2 = *temp_t4_2; - var_v1_3 = 0; - var_t0_2 = temp_t1_2; - if ((s32) temp_t1_2 > 0) { - do { - if ((arg0 & 0xFF) == *(D_80192CA8[temp_t8_4] + (var_v1_3 * 2))) { - var_t0_2 = var_v1_3 & 0xFF; - var_v1_3 = temp_t1_2 & 0xFF; - } - temp_t8_5 = (var_v1_3 + 1) & 0xFF; - var_v1_3 = temp_t8_5; - } while (temp_t8_5 < (s32) D_80192CC6[temp_a1]); - } - if (var_t0_2 != temp_t1_2) { - temp_a3 = temp_t1_2 - 1; - var_v1_4 = var_t0_2 & 0xFF; - if ((s32) var_t0_2 < temp_a3) { - temp_a2_2 = D_80192CA8[sp3C]; - var_v0_2 = var_v1_4; - do { - temp_a1_3 = temp_a2_2 + (var_v0_2 * 2); - temp_a0_3 = temp_a2_2 + (var_v1_4 * 2); - temp_a0_3->unk1 = (u8) temp_a1_3->unk3; - var_v0_2 = (var_v1_4 + 1) & 0xFF; - var_v1_4 = var_v0_2; - temp_a0_3->unk0 = (u8) temp_a1_3->unk2; - } while (var_v0_2 < temp_a3); - } - *temp_t4_2 = temp_t1_2 - 1; - } - if (var_t0_2 == 0) { - temp_a3_2 = ((u32) (arg0 & 0xFF0000) >> 0xD) & 0xFFFF; - sp4C = temp_a3_2; - sp34 = temp_t4_2; - func_800C29B4(unksp3F, temp_a3_2 & 0xFFFF); - if (*temp_t4_2 != 0) { - temp_v0_2 = D_80192CA8[sp3C]; - func_800C284C((u8) sp3C, temp_v0_2->unk0, temp_v0_2->unk1, (u16) temp_a3_2); + break; + case 14: + temp_t7_2 = ((u32) (arg0 & 0xF00) >> 8) & 0xFF; + switch (temp_t7_2) { /* switch 1; irregular */ + case 0: /* switch 1 */ + func_800CBBB8(0xF0000000U, (u32) D_800EA1F0[arg0 & 0xFF]); + return; + case 1: /* switch 1 */ + D_800EA1EC = arg0 & 1; return; } - } - break; - case 4: - temp_t9_2 = (u32) (arg0 & 0xFF0000) >> 0xF; - temp_v1 = temp_t9_2 & 0xFF; - var_a1 = temp_t9_2 & 0xFF; - if (temp_v1 == 0) { - var_a1 = (temp_v1 + 1) & 0xFF; - } - temp_v0_3 = &D_801930D0[temp_t6 & 0xFF]; - temp_f2 = temp_v0_3->unk_000; - temp_f0 = (f32) (arg0 & 0xFF) / 127.0f; - temp_v0_3->unk_004 = temp_f0; - if (temp_f2 != temp_f0) { - var_f8 = (f32) var_a1; - if (var_a1 < 0) { - var_f8 += 4294967296.0f; - } - temp_v0_3->unk_00C = (u16) var_a1; - temp_v0_3->unk_008 = (temp_f2 - temp_v0_3->unk_004) / var_f8; - return; - } - break; - case 5: - temp_t7 = (u32) (arg0 & 0xFF0000) >> 0xF; - temp_v1_2 = temp_t7 & 0xFF; - var_a1_2 = temp_t7 & 0xFF; - if (temp_v1_2 == 0) { - var_a1_2 = (temp_v1_2 + 1) & 0xFF; - } - var_v1_5 = 0; - temp_a2_3 = temp_t6 & 0xFF; - temp_a0_4 = &D_801930D0[temp_a2_3]; - temp_f0_2 = (f32) (arg0 & 0xFFFF) / 1000.0f; - do { - temp_v0_4 = temp_a0_4 + (var_v1_5 << 5); - temp_t8_6 = (var_v1_5 + 1) & 0xFF; - temp_f4 = temp_a0_4->unk_044[var_v1_5].unk_10 - temp_f0_2; - temp_at = temp_t8_6 < 0x10; - var_v1_5 = temp_t8_6; - temp_v0_4->unk58 = temp_f0_2; - temp_v0_4->unk60 = (s16) var_a1_2; - temp_v0_4->unk5C = (f32) (temp_f4 / (f32) var_a1_2); - } while (temp_at != 0); - D_801930D0[temp_a2_3].unk_244 = 0xFFFF; - return; - case 6: - temp_t8_7 = (u32) (arg0 & 0xFF0000) >> 0xF; - temp_v1_3 = temp_t8_7 & 0xFF; - var_a1_3 = temp_t8_7 & 0xFF; - if (temp_v1_3 == 0) { - var_a1_3 = (temp_v1_3 + 1) & 0xFF; - } - temp_a3_3 = temp_t6 & 0xFF; - temp_a2_4 = ((u32) (arg0 & 0xF00) >> 8) & 0xFF; - temp_t6_3 = &D_801930D0[temp_a3_3]; - temp_f0_3 = (f32) (arg0 & 0xFF) / 127.0f; - temp_t6_3->unk_044[temp_a2_4].unk4 = temp_f0_3; - if (temp_t6_3->unk_044[temp_a2_4].unk_00 != temp_f0_3) { - temp_v0_5 = &D_801930D0[temp_a3_3]; - var_f16 = (f32) var_a1_3; - if (var_a1_3 < 0) { - var_f16 += 4294967296.0f; - } - temp_v0_5->unk_044[temp_a2_4].unk_0C = (u16) var_a1_3; - temp_v0_5->unk_044[temp_a2_4].unk_08 = (temp_v0_5->unk_044[temp_a2_4].unk_00 - temp_v0_5->unk_044[temp_a2_4].unk4) / var_f16; - temp_v0_5->unk_244 |= 1 << temp_a2_4; - return; - } - break; - case 7: - func_800CBBE8(((temp_t6 & 0xFF) << 0x10) | 0x46000000 | ((((u32) (arg0 & 0xFF0000) >> 0x10) & 0xFF) << 8), (s8) arg0); - return; - case 8: - temp_v0_6 = temp_t6 & 0xFF; - temp_a2_5 = ((u32) (arg0 & 0xF00) >> 8) & 0xFF; - if (!(D_801930D0[temp_v0_6].unk_24A & (1 << temp_a2_5))) { - func_800CBBE8(((temp_v0_6 & 0xFF) << 0x10) | 0x06000000 | ((temp_a2_5 & 0xFF) << 8) | (((u32) (arg0 & 0xFF0000) >> 0x10) & 0xFF), (s8) arg0); - return; - } - break; - case 9: - D_801930D0[temp_t6 & 0xFF].unk_24A = arg0; - return; - case 10: - var_a0 = 1; - sp48 = ((temp_t6 & 0xFF) << 0x10) | 0x08000000; - var_a3 = arg0 & 0xFFFF; - var_v1_6 = 0; - do { - if (var_a3 & var_a0) { - var_a2 = 1; - } else { - var_a2 = 0; - } - sp4C = var_a0; - sp5B = var_v1_6; - sp44 = var_a3; - func_800CBBE8(sp48 | ((var_v1_6 & 0xFF) << 8), var_a2); - temp_t8_8 = (var_v1_6 + 1) & 0xFF; - temp_at_2 = temp_t8_8 < 0x10; - var_v1_6 = (u8) temp_t8_8; - var_a0 = (var_a0 * 2) & 0xFFFF; - } while (temp_at_2 != 0); - return; - case 11: - D_801930D0[temp_t6 & 0xFF].unk_014 = (s32) arg0; - return; - case 12: - if ((((u32) (arg0 & 0xF00000) >> 0x14) & 0xFF) != 0xF) { - temp_v0_7 = &D_801930D0[temp_t6 & 0xFF]; - temp_t0 = temp_v0_7->unk_041; - temp_v0_7->unk_041 = temp_t0 + 1; - if ((s32) temp_t0 < 5) { - temp_v0_7->unk_02C[temp_t0] = (u32) arg0; - temp_v0_7->unk_040 = 2; - return; - } - } else { - D_801930D0[temp_t6 & 0xFF].unk_041 = 0; - return; - } - break; - case 14: - temp_t7_2 = ((u32) (arg0 & 0xF00) >> 8) & 0xFF; - switch (temp_t7_2) { /* switch 1; irregular */ - case 0: /* switch 1 */ - func_800CBBB8(0xF0000000U, (u32) D_800EA1F0[arg0 & 0xFF]); - return; - case 1: /* switch 1 */ - D_800EA1EC = arg0 & 1; - return; - } - break; - case 15: - temp_t6_4 = (u32) (arg0 & 0xFF00) >> 8; - D_800EA1C0 = (u8) temp_t6_4; - temp_a0_5 = arg0 & 0xFF; - sp48 = temp_a0_5; - sp4C = temp_t6_4; - func_800C13FC((void *) temp_a0_5); - *D_800EA1F4 = (u8) sp48; - func_800CBBE8(0x46020000U, (s8) sp4C); - func_800C5C40(); - break; + break; + case 15: + temp_t6_4 = (u32) (arg0 & 0xFF00) >> 8; + D_800EA1C0 = (u8) temp_t6_4; + temp_a0_5 = arg0 & 0xFF; + sp48 = temp_a0_5; + sp4C = temp_t6_4; + func_800C13FC((void *) temp_a0_5); + *D_800EA1F4 = (u8) sp48; + func_800CBBE8(0x46020000U, (s8) sp4C); + func_800C5C40(); + break; } } #else @@ -1301,25 +1301,25 @@ void func_800C3724(void) { if (temp_t9_2 != 1) { temp_v1 = temp_a0 & 0xFFFF; switch (temp_t9_2) { /* switch 1; irregular */ - case 2: /* switch 1 */ - if (temp_v1 < temp_a3_2) { - var_a2 = (temp_a3_2 - temp_v1) & 0xFFFF; - } - break; - case 3: /* switch 1 */ - var_f16 = (f32) temp_a3_2; - if (temp_a3_2 < 0) { - var_f16 += 4294967296.0f; - } - var_a2 = (u32) (var_f16 * ((f32) (temp_a0 & 0xFFFF) / 100.0f)) & 0xFFFF; - break; - case 4: /* switch 1 */ - temp_v0_2 = temp_s3->unk_018; - var_a2 = temp_a3_2 & 0xFFFF; - if (temp_v0_2 != 0) { - var_a2 = temp_v0_2 & 0xFFFF; - } - break; + case 2: /* switch 1 */ + if (temp_v1 < temp_a3_2) { + var_a2 = (temp_a3_2 - temp_v1) & 0xFFFF; + } + break; + case 3: /* switch 1 */ + var_f16 = (f32) temp_a3_2; + if (temp_a3_2 < 0) { + var_f16 += 4294967296.0f; + } + var_a2 = (u32) (var_f16 * ((f32) (temp_a0 & 0xFFFF) / 100.0f)) & 0xFFFF; + break; + case 4: /* switch 1 */ + temp_v0_2 = temp_s3->unk_018; + var_a2 = temp_a3_2 & 0xFFFF; + if (temp_v0_2 != 0) { + var_a2 = temp_v0_2 & 0xFFFF; + } + break; } } else { var_a2 = (temp_a0 + temp_a3_2) & 0xFFFF; @@ -1413,35 +1413,35 @@ void func_800C3724(void) { temp_s1 = ((u32) (temp_v0_5 & 0xF0000) >> 0x10) & 0xFF; temp_a1_3 = ((u32) (temp_v0_5 & 0xFF00) >> 8) & 0xFF; switch (temp_t5_3) { - case 0: - temp_s0 = &D_801930D0[temp_s1]; - temp_s0->unk_012 = 1; - temp_s0->unk_00E[1] = 0x7F; - break; - case 1: - func_800C3448(temp_s3->unk_248 | 0x30000000 | (var_s5 << 0x18)); - break; - case 2: - temp_s0_2 = &D_801930D0[temp_s1]; - func_800C3448(temp_s0_2->unk_248 | (temp_s1 << 0x18) | 0x10000); - temp_s0_2->unk_012 = 1; - temp_s0_2->unk_00E[1] = 0x7F; - break; - case 3: - func_800C3448((temp_s1 << 0x18) | 0xB0003000 | (temp_a1_3 << 0x10) | temp_t2_3); - break; - case 4: - func_800C3448((temp_s1 << 0x18) | 0xB0004000 | (temp_t2_3 << 0x10)); - break; - case 5: - temp_s0_3 = &D_801930D0[temp_s1]; - func_800C3448((temp_s0_3->unk_042 << 0x10) | (temp_s1 << 0x18) | (temp_v0_5 & 0xFFFF)); - func_800C36C4(temp_s1 & 0xFF, 1U, 0x7FU, 0U); - temp_s0_3->unk_042 = 0; - break; - case 6: - temp_s3->unk_042 = temp_a1_3; - break; + case 0: + temp_s0 = &D_801930D0[temp_s1]; + temp_s0->unk_012 = 1; + temp_s0->unk_00E[1] = 0x7F; + break; + case 1: + func_800C3448(temp_s3->unk_248 | 0x30000000 | (var_s5 << 0x18)); + break; + case 2: + temp_s0_2 = &D_801930D0[temp_s1]; + func_800C3448(temp_s0_2->unk_248 | (temp_s1 << 0x18) | 0x10000); + temp_s0_2->unk_012 = 1; + temp_s0_2->unk_00E[1] = 0x7F; + break; + case 3: + func_800C3448((temp_s1 << 0x18) | 0xB0003000 | (temp_a1_3 << 0x10) | temp_t2_3); + break; + case 4: + func_800C3448((temp_s1 << 0x18) | 0xB0004000 | (temp_t2_3 << 0x10)); + break; + case 5: + temp_s0_3 = &D_801930D0[temp_s1]; + func_800C3448((temp_s0_3->unk_042 << 0x10) | (temp_s1 << 0x18) | (temp_v0_5 & 0xFFFF)); + func_800C36C4(temp_s1 & 0xFF, 1U, 0x7FU, 0U); + temp_s0_3->unk_042 = 0; + break; + case 6: + temp_s3->unk_042 = temp_a1_3; + break; } temp_t5_2 = (var_s2_2 + 1) & 0xFF; var_s2_2 = temp_t5_2; @@ -1551,36 +1551,36 @@ void func_800C41CC(u8 arg0, struct Unk_80191420 *arg1) { found = FALSE; sound = &sSoundRequests[soundId]; switch (arg0) { - case 0: - if ((sound->soundBits & 0xF0000000) == (arg1->soundBits & 0xF0000000)) { - found = TRUE; - } - break; - case 1: - if (((sound->soundBits & 0xF0000000) == (arg1->soundBits & 0xF0000000)) && (sound->position == arg1->unk00)) { - found = TRUE; - } - break; - case 2: - if (sound->position == arg1->unk00) { - found = TRUE; - } - break; - case 3: - if ((sound->position == arg1->unk00) && (sound->soundBits == arg1->soundBits)) { - found = TRUE; - } - break; - case 4: - if ((sound->cameraId == arg1->cameraId) && (sound->soundBits == arg1->soundBits)) { - found = TRUE; - } - break; - case 5: - if (sound->soundBits == arg1->soundBits) { - found = TRUE; - } - break; + case 0: + if ((sound->soundBits & 0xF0000000) == (arg1->soundBits & 0xF0000000)) { + found = TRUE; + } + break; + case 1: + if (((sound->soundBits & 0xF0000000) == (arg1->soundBits & 0xF0000000)) && (sound->position == arg1->unk00)) { + found = TRUE; + } + break; + case 2: + if (sound->position == arg1->unk00) { + found = TRUE; + } + break; + case 3: + if ((sound->position == arg1->unk00) && (sound->soundBits == arg1->soundBits)) { + found = TRUE; + } + break; + case 4: + if ((sound->cameraId == arg1->cameraId) && (sound->soundBits == arg1->soundBits)) { + found = TRUE; + } + break; + case 5: + if (sound->soundBits == arg1->soundBits) { + found = TRUE; + } + break; } if (found) { sound->soundBits = 0; @@ -2350,14 +2350,14 @@ void func_800C5D04(u8 playerId) { } if (D_800E9E24[playerId] == 1) { switch (D_800EA0EC[playerId]) { - case 2: - D_800EA0EC[playerId] = 1; - case 0: - func_800C97C4(playerId); - func_800C94A4(playerId); - break; - default: - break; + case 2: + D_800EA0EC[playerId] = 1; + case 0: + func_800C97C4(playerId); + func_800C94A4(playerId); + break; + default: + break; } } } else { @@ -2379,19 +2379,19 @@ void func_800C5E38(u8 playerId) { D_800E9DD4[playerId] = D_800E9F7C[playerId].unk_24; if ((D_800E9E34[playerId] == 1) && ((u8) D_800EA16C == 0)) { switch (D_800EA0EC[playerId]) { - case 2: - D_800EA0EC[playerId] = 1; - case 0: - if ((D_800E9F74[playerId] == 0) && (gPlayers[playerId].characterId != 3)) { - if ((s32) D_800EA1C0 < 2) { - play_sound(0x0100F926U, D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], (u8 *) &D_800E9F7C[playerId].unk_14); - } else { - play_sound(0x01008026U, D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], (u8 *) &D_800E9F7C[playerId].unk_14); + case 2: + D_800EA0EC[playerId] = 1; + case 0: + if ((D_800E9F74[playerId] == 0) && (gPlayers[playerId].characterId != 3)) { + if ((s32) D_800EA1C0 < 2) { + play_sound(0x0100F926U, D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], (u8 *) &D_800E9F7C[playerId].unk_14); + } else { + play_sound(0x01008026U, D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], (u8 *) &D_800E9F7C[playerId].unk_14); + } } - } - break; - default: - break; + break; + default: + break; } } } else { @@ -2458,9 +2458,8 @@ void func_800C6108(u8 playerId) { #ifdef VERSION_EU if ((D_800E9EE4[playerId] > 0.5f) || (D_800E9EE4[playerId] < -0.5f)) #else - if ((D_800E9EE4[playerId] > 0.5f) || (D_800E9EE4[playerId] < 0.5f)) + if ((D_800E9EE4[playerId] > 0.5f) || (D_800E9EE4[playerId] < 0.5f)) { #endif - { D_800E9ED4[playerId] = D_800E9EE4[playerId] * 0.25f; D_800E9F7C[playerId].unk_0C = D_800E9EC4[playerId] + D_800E9ED4[playerId] + D_800E9F34[playerId]; } else { @@ -2480,35 +2479,35 @@ void func_800C6108(u8 playerId) { void func_800C64A0(u8 playerId) { switch (D_800E9E74[playerId]) { - case 3: - D_800E9EF4[playerId] = (gPlayers[playerId].unk_094 / 5.0f) + 0.2f; - break; - case 1: - case 13: - case 14: - case 17: - D_800E9EF4[playerId] = ((D_800E9E54[playerId] - 3500.0f) / 3000.0f) + 0.4f; - break; - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 22: - case 23: - case 24: - case 29: - case 30: - case 31: - D_800E9EF4[playerId] = (gPlayers[playerId].unk_094 / 5.0f) + 0.2f; - break; - default: - D_800E9EF4[playerId] = 1.0f; - break; + case 3: + D_800E9EF4[playerId] = (gPlayers[playerId].unk_094 / 5.0f) + 0.2f; + break; + case 1: + case 13: + case 14: + case 17: + D_800E9EF4[playerId] = ((D_800E9E54[playerId] - 3500.0f) / 3000.0f) + 0.4f; + break; + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 22: + case 23: + case 24: + case 29: + case 30: + case 31: + D_800E9EF4[playerId] = (gPlayers[playerId].unk_094 / 5.0f) + 0.2f; + break; + default: + D_800E9EF4[playerId] = 1.0f; + break; } if (D_800E9EF4[playerId] > 1.0f) { D_800E9EF4[playerId] = 1.0f; @@ -2531,17 +2530,17 @@ void func_800C64A0(u8 playerId) { void func_800C6758(u8 playerId) { switch (D_800E9E74[playerId]) { /* irregular */ - case 3: - D_800E9F14[playerId] = (gPlayers[playerId].unk_094 / 9.0f) + 0.6f; - break; - case 2: - case 13: - case 17: - D_800E9F14[playerId] = (D_800E9E54[playerId] / 13000.0f) + 0.95f; - break; - default: - D_800E9F14[playerId] = 1.0f; - break; + case 3: + D_800E9F14[playerId] = (gPlayers[playerId].unk_094 / 9.0f) + 0.6f; + break; + case 2: + case 13: + case 17: + D_800E9F14[playerId] = (D_800E9E54[playerId] / 13000.0f) + 0.95f; + break; + default: + D_800E9F14[playerId] = 1.0f; + break; } } @@ -2550,123 +2549,123 @@ void func_800C683C(u8 arg0) { if (D_800E9E74[arg0] != D_800E9E84[arg0]) { func_800C5578(D_800E9F7C[arg0].pos, D_800E9E94[arg0]); switch (D_800E9E74[arg0]) { - case 3: - play_sound(0x0100F908U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F908; - break; - case 18: - play_sound(0x0100F81DU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F81D; - break; - case 19: - play_sound(0x0100F822U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F822; - break; - case 1: - play_sound(0x0100F009U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F009; - break; - case 2: - play_sound(0x0100F40AU, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F40A; - break; - case 17: - play_sound(0x0100F01EU, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F01E; - break; - case 15: - play_sound(0x0100F01FU, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F01F; - break; - case 16: - play_sound(0x0100F021U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F021; - break; - case 20: - play_sound(0x0100F027U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F027; - break; - case 25: - play_sound(0x0100F020U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F020; - break; - case 26: - play_sound(0x0100F023U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F023; - break; - case 27: - play_sound(0x01008046U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x01008046; - break; - case 28: - play_sound(0x0100F025U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F025; - break; - case 4: - play_sound(0x0100F00BU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00B; - break; - case 5: - play_sound(0x0100F00CU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00C; - break; - case 6: - play_sound(0x0100F00DU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00D; - break; - case 7: - play_sound(0x0100F00EU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00E; - break; - case 8: - play_sound(0x0100F00FU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00F; - break; - case 9: - play_sound(0x0100F010U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F010; - break; - case 10: - case 14: - play_sound(0x0100F011U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F011; - break; - case 11: - play_sound(0x0100F012U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F012; - break; - case 12: - play_sound(0x0100F013U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F013; - break; - case 29: - play_sound(0x0100F048U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F048; - break; - case 30: - play_sound(0x0100F049U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F049; - break; - case 31: - play_sound(0x0100F04AU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F04A; - break; - case 13: - case 22: - play_sound(0x0100F029U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F029; - break; - case 23: - play_sound(0x0100F02AU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F02A; - break; - case 24: - play_sound(0x0100F02BU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F02B; - break; - default: - func_800C5578(D_800E9F7C[arg0].pos, D_800E9E94[arg0]); - break; + case 3: + play_sound(0x0100F908U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F908; + break; + case 18: + play_sound(0x0100F81DU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F81D; + break; + case 19: + play_sound(0x0100F822U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F822; + break; + case 1: + play_sound(0x0100F009U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F009; + break; + case 2: + play_sound(0x0100F40AU, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F40A; + break; + case 17: + play_sound(0x0100F01EU, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F01E; + break; + case 15: + play_sound(0x0100F01FU, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F01F; + break; + case 16: + play_sound(0x0100F021U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F021; + break; + case 20: + play_sound(0x0100F027U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F027; + break; + case 25: + play_sound(0x0100F020U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F020; + break; + case 26: + play_sound(0x0100F023U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F023; + break; + case 27: + play_sound(0x01008046U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x01008046; + break; + case 28: + play_sound(0x0100F025U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F025; + break; + case 4: + play_sound(0x0100F00BU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F00B; + break; + case 5: + play_sound(0x0100F00CU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F00C; + break; + case 6: + play_sound(0x0100F00DU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F00D; + break; + case 7: + play_sound(0x0100F00EU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F00E; + break; + case 8: + play_sound(0x0100F00FU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F00F; + break; + case 9: + play_sound(0x0100F010U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F010; + break; + case 10: + case 14: + play_sound(0x0100F011U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F011; + break; + case 11: + play_sound(0x0100F012U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F012; + break; + case 12: + play_sound(0x0100F013U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F013; + break; + case 29: + play_sound(0x0100F048U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F048; + break; + case 30: + play_sound(0x0100F049U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F049; + break; + case 31: + play_sound(0x0100F04AU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F04A; + break; + case 13: + case 22: + play_sound(0x0100F029U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F029; + break; + case 23: + play_sound(0x0100F02AU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F02A; + break; + case 24: + play_sound(0x0100F02BU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800E9E94[arg0] = 0x0100F02B; + break; + default: + func_800C5578(D_800E9F7C[arg0].pos, D_800E9E94[arg0]); + break; } } D_800E9E84[arg0] = D_800E9E74[arg0]; @@ -2679,186 +2678,186 @@ void func_800C70A8(u8 playerId) { if ((D_800E9E54[playerId] > 3500.0f) || ((gPlayers[playerId].effects & 0x10) == 0x10)) { D_800E9E74[playerId] = 1; switch (gPlayers[playerId].boundingBoxCorners[AUDIO_LEFT_TYRE].surfaceType) { - case 2: /* switch 1 */ - D_800E9E74[playerId] = 0x0000000D; - break; - case 3: /* switch 1 */ - D_800E9E74[playerId] = 0x0000000E; - break; - case 6: /* switch 1 */ - D_800E9E74[playerId] = 0x00000011; - break; - case 4: /* switch 1 */ - D_800E9E74[playerId] = 0x0000000F; - break; - case 5: /* switch 1 */ - D_800E9E74[playerId] = 0x00000010; - break; - case 9: /* switch 1 */ - D_800E9E74[playerId] = 0x00000014; - break; - case 16: /* switch 1 */ - D_800E9E74[playerId] = 0x00000019; - break; - case 17: /* switch 1 */ - D_800E9E74[playerId] = 0x0000001A; - break; - case 14: /* switch 1 */ - D_800E9E74[playerId] = 0x0000001B; - break; + case 2: /* switch 1 */ + D_800E9E74[playerId] = 0x0000000D; + break; + case 3: /* switch 1 */ + D_800E9E74[playerId] = 0x0000000E; + break; + case 6: /* switch 1 */ + D_800E9E74[playerId] = 0x00000011; + break; + case 4: /* switch 1 */ + D_800E9E74[playerId] = 0x0000000F; + break; + case 5: /* switch 1 */ + D_800E9E74[playerId] = 0x00000010; + break; + case 9: /* switch 1 */ + D_800E9E74[playerId] = 0x00000014; + break; + case 16: /* switch 1 */ + D_800E9E74[playerId] = 0x00000019; + break; + case 17: /* switch 1 */ + D_800E9E74[playerId] = 0x0000001A; + break; + case 14: /* switch 1 */ + D_800E9E74[playerId] = 0x0000001B; + break; } } if ((gPlayers[playerId].effects & 0x10) == 0x10) { D_800E9E74[playerId] = 2; switch (gPlayers[playerId].boundingBoxCorners[AUDIO_LEFT_TYRE].surfaceType) { /* switch 2 */ - case 2: /* switch 2 */ - D_800E9E74[playerId] = 0x0000000D; - break; - case 3: /* switch 2 */ - D_800E9E74[playerId] = 0x0000000E; - break; - case 6: /* switch 2 */ - D_800E9E74[playerId] = 0x00000011; - break; - case 4: /* switch 2 */ - D_800E9E74[playerId] = 0x0000000F; - break; - case 5: /* switch 2 */ - D_800E9E74[playerId] = 0x00000010; - break; - case 9: /* switch 2 */ - D_800E9E74[playerId] = 0x00000014; - break; - case 16: /* switch 2 */ - D_800E9E74[playerId] = 0x00000019; - break; - case 17: /* switch 2 */ - D_800E9E74[playerId] = 0x0000001A; - break; - case 14: /* switch 2 */ - D_800E9E74[playerId] = 0x0000001B; - break; + case 2: /* switch 2 */ + D_800E9E74[playerId] = 0x0000000D; + break; + case 3: /* switch 2 */ + D_800E9E74[playerId] = 0x0000000E; + break; + case 6: /* switch 2 */ + D_800E9E74[playerId] = 0x00000011; + break; + case 4: /* switch 2 */ + D_800E9E74[playerId] = 0x0000000F; + break; + case 5: /* switch 2 */ + D_800E9E74[playerId] = 0x00000010; + break; + case 9: /* switch 2 */ + D_800E9E74[playerId] = 0x00000014; + break; + case 16: /* switch 2 */ + D_800E9E74[playerId] = 0x00000019; + break; + case 17: /* switch 2 */ + D_800E9E74[playerId] = 0x0000001A; + break; + case 14: /* switch 2 */ + D_800E9E74[playerId] = 0x0000001B; + break; } } switch (gPlayers[playerId].boundingBoxCorners[AUDIO_LEFT_TYRE].surfaceType) { /* switch 3 */ - case 8: /* switch 3 */ - if (D_800E9E74[playerId] == 6) { - D_800E9E74[playerId] = 4; - } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 5; - } else { - D_800E9E74[playerId] = 4; - } - break; - case 7: /* switch 3 */ - if (D_800E9E74[playerId] == 0x0000000C) { - D_800E9E74[playerId] = 0x0000000A; - } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 0x0000000B; - } else { - D_800E9E74[playerId] = 0x0000000A; - } - break; - case 13: /* switch 3 */ - if (D_800E9E74[playerId] == 0x00000018) { - D_800E9E74[playerId] = 0x00000016; - } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 0x00000017; - } else { - D_800E9E74[playerId] = 0x00000016; - } - break; - case 11: /* switch 3 */ - if (D_800E9E74[playerId] == 0x0000001F) { - D_800E9E74[playerId] = 0x0000001D; - } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 0x0000001E; - } else { - D_800E9E74[playerId] = 0x0000001D; - } - break; - case 10: /* switch 3 */ - if (D_800E9F74[playerId] == 0) { - if (D_800E9E74[playerId] == 9) { - D_800E9E74[playerId] = 7; + case 8: /* switch 3 */ + if (D_800E9E74[playerId] == 6) { + D_800E9E74[playerId] = 4; } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 8; + D_800E9E74[playerId] = 5; } else { - D_800E9E74[playerId] = 7; + D_800E9E74[playerId] = 4; } - } else { - D_800E9E74[playerId] = 0x0000001C; - } - break; - case 16: /* switch 3 */ - D_800E9E74[playerId] = 0x00000019; - break; - case 17: /* switch 3 */ - D_800E9E74[playerId] = 0x0000001A; - break; - case 14: /* switch 3 */ - D_800E9E74[playerId] = 0x0000001B; - break; + break; + case 7: /* switch 3 */ + if (D_800E9E74[playerId] == 0x0000000C) { + D_800E9E74[playerId] = 0x0000000A; + } else if (D_800EA1C0 == 0) { + D_800E9E74[playerId] = 0x0000000B; + } else { + D_800E9E74[playerId] = 0x0000000A; + } + break; + case 13: /* switch 3 */ + if (D_800E9E74[playerId] == 0x00000018) { + D_800E9E74[playerId] = 0x00000016; + } else if (D_800EA1C0 == 0) { + D_800E9E74[playerId] = 0x00000017; + } else { + D_800E9E74[playerId] = 0x00000016; + } + break; + case 11: /* switch 3 */ + if (D_800E9E74[playerId] == 0x0000001F) { + D_800E9E74[playerId] = 0x0000001D; + } else if (D_800EA1C0 == 0) { + D_800E9E74[playerId] = 0x0000001E; + } else { + D_800E9E74[playerId] = 0x0000001D; + } + break; + case 10: /* switch 3 */ + if (D_800E9F74[playerId] == 0) { + if (D_800E9E74[playerId] == 9) { + D_800E9E74[playerId] = 7; + } else if (D_800EA1C0 == 0) { + D_800E9E74[playerId] = 8; + } else { + D_800E9E74[playerId] = 7; + } + } else { + D_800E9E74[playerId] = 0x0000001C; + } + break; + case 16: /* switch 3 */ + D_800E9E74[playerId] = 0x00000019; + break; + case 17: /* switch 3 */ + D_800E9E74[playerId] = 0x0000001A; + break; + case 14: /* switch 3 */ + D_800E9E74[playerId] = 0x0000001B; + break; } switch (gPlayers[playerId].boundingBoxCorners[AUDIO_RIGHT_TYRE].surfaceType) { /* switch 4 */ - case 8: /* switch 4 */ - if (D_800E9E74[playerId] == 5) { - D_800E9E74[playerId] = 4; - } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 6; - } else { - D_800E9E74[playerId] = 4; - } - break; - case 7: /* switch 4 */ - if (D_800E9E74[playerId] == 0x0000000B) { - D_800E9E74[playerId] = 0x0000000A; - } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 0x0000000C; - } else { - D_800E9E74[playerId] = 0x0000000A; - } - break; - case 13: /* switch 4 */ - if (D_800E9E74[playerId] == 0x00000017) { - D_800E9E74[playerId] = 0x00000016; - } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 0x00000018; - } else { - D_800E9E74[playerId] = 0x00000016; - } - break; - case 11: /* switch 4 */ - if (D_800E9E74[playerId] == 0x0000001E) { - D_800E9E74[playerId] = 0x0000001D; - } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 0x0000001F; - } else { - D_800E9E74[playerId] = 0x0000001D; - } - break; - case 10: /* switch 4 */ - if (D_800E9F74[playerId] == 0) { - if (D_800E9E74[playerId] == 8) { - D_800E9E74[playerId] = 7; + case 8: /* switch 4 */ + if (D_800E9E74[playerId] == 5) { + D_800E9E74[playerId] = 4; } else if (D_800EA1C0 == 0) { - D_800E9E74[playerId] = 9; + D_800E9E74[playerId] = 6; } else { - D_800E9E74[playerId] = 7; + D_800E9E74[playerId] = 4; } - } else { - D_800E9E74[playerId] = 0x0000001C; - } - break; - case 16: /* switch 4 */ - D_800E9E74[playerId] = 0x00000019; - break; - case 17: /* switch 4 */ - D_800E9E74[playerId] = 0x0000001A; - break; - case 14: /* switch 4 */ - D_800E9E74[playerId] = 0x0000001B; - break; + break; + case 7: /* switch 4 */ + if (D_800E9E74[playerId] == 0x0000000B) { + D_800E9E74[playerId] = 0x0000000A; + } else if (D_800EA1C0 == 0) { + D_800E9E74[playerId] = 0x0000000C; + } else { + D_800E9E74[playerId] = 0x0000000A; + } + break; + case 13: /* switch 4 */ + if (D_800E9E74[playerId] == 0x00000017) { + D_800E9E74[playerId] = 0x00000016; + } else if (D_800EA1C0 == 0) { + D_800E9E74[playerId] = 0x00000018; + } else { + D_800E9E74[playerId] = 0x00000016; + } + break; + case 11: /* switch 4 */ + if (D_800E9E74[playerId] == 0x0000001E) { + D_800E9E74[playerId] = 0x0000001D; + } else if (D_800EA1C0 == 0) { + D_800E9E74[playerId] = 0x0000001F; + } else { + D_800E9E74[playerId] = 0x0000001D; + } + break; + case 10: /* switch 4 */ + if (D_800E9F74[playerId] == 0) { + if (D_800E9E74[playerId] == 8) { + D_800E9E74[playerId] = 7; + } else if (D_800EA1C0 == 0) { + D_800E9E74[playerId] = 9; + } else { + D_800E9E74[playerId] = 7; + } + } else { + D_800E9E74[playerId] = 0x0000001C; + } + break; + case 16: /* switch 4 */ + D_800E9E74[playerId] = 0x00000019; + break; + case 17: /* switch 4 */ + D_800E9E74[playerId] = 0x0000001A; + break; + case 14: /* switch 4 */ + D_800E9E74[playerId] = 0x0000001B; + break; } if (((gPlayers[playerId].unk_094 < 0.5f) || ((gPlayers[playerId].effects & 8) == 8)) && (D_800E9E74[playerId] != 0x0000001C)) { D_800E9E74[playerId] = 0; @@ -2887,262 +2886,260 @@ void func_800C76C0(u8 playerId) { func_800C5578(D_800E9F7C[playerId].pos, D_800E9E94[playerId]); D_800E9E74[playerId] = 0; switch (gModeSelection) { /* irregular */ - case 0: - D_800EA0EC[playerId] = 2; - func_800C9060(playerId, 0x1900F103U); - if (D_800EA1C0 == 0) { - func_800C3448(0x100100FF); - func_800C3448(0x110100FF); - func_800C5278(5U); - if (gPlayers[playerId].currentRank == 0) { - func_800C97C4(playerId); - D_800EA0F0 = 2; - func_800C9A88(playerId); - func_800CA414(0x000DU, 0x0010U); - } else if (gPlayers[playerId].currentRank < 4) { - func_800C97C4(playerId); - D_800EA0F0 = 2; - func_800C9A88(playerId); - func_800CA414(0x000EU, 0x0010U); - } else { - func_800C3448(-0x3E9F9C00); - func_800CA414(0x000FU, 0x0018U); - } - } else { + case GRAND_PRIX: D_800EA0EC[playerId] = 2; func_800C9060(playerId, 0x1900F103U); - if (gPlayers[playerId].currentRank == 0) { + if (D_800EA1C0 == 0) { func_800C3448(0x100100FF); func_800C3448(0x110100FF); - func_800C97C4(playerId); - D_800EA0F0 = 2; - func_800C9A88(playerId); - func_800CA414(0x000DU, 0x0010U); - } else if (gPlayers[playerId].currentRank < 4) { - if (D_800EA104 == 0) { + func_800C5278(5U); + if (gPlayers[playerId].currentRank == 0) { + func_800C97C4(playerId); + D_800EA0F0 = 2; + func_800C9A88(playerId); + func_800CA414(0x000DU, 0x0010U); + } else if (gPlayers[playerId].currentRank < 4) { + func_800C97C4(playerId); + D_800EA0F0 = 2; + func_800C9A88(playerId); + func_800CA414(0x000EU, 0x0010U); + } else { + func_800C3448(-0x3E9F9C00); + func_800CA414(0x000FU, 0x0018U); + } + } else { + D_800EA0EC[playerId] = 2; + func_800C9060(playerId, 0x1900F103U); + if (gPlayers[playerId].currentRank == 0) { func_800C3448(0x100100FF); func_800C3448(0x110100FF); + func_800C97C4(playerId); + D_800EA0F0 = 2; + func_800C9A88(playerId); + func_800CA414(0x000DU, 0x0010U); + } else if (gPlayers[playerId].currentRank < 4) { + if (D_800EA104 == 0) { + func_800C3448(0x100100FF); + func_800C3448(0x110100FF); + } + func_800C97C4(playerId); + D_800EA0F0 = 2; + func_800C9A88(playerId); + func_800CA414(0x000EU, 0x0010U); + } else if (D_800EA104 == 0) { + func_800C3448(0x100100FF); + func_800C3448(0x110100FF); + func_800C3448(-0x3E9F9C00); + func_800CA414(0x000FU, 0x0018U); + } + if ((D_800EA104 != 0) || (D_800EA0EC[playerId] != 1)) { + func_800C5278(5U); } - func_800C97C4(playerId); - D_800EA0F0 = 2; - func_800C9A88(playerId); - func_800CA414(0x000EU, 0x0010U); - } else if (D_800EA104 == 0) { - func_800C3448(0x100100FF); - func_800C3448(0x110100FF); - func_800C3448(-0x3E9F9C00); - func_800CA414(0x000FU, 0x0018U); } - if ((D_800EA104 != 0) || (D_800EA0EC[playerId] != 1)) { - func_800C5278(5U); - } - } - break; - case 1: - func_800C3448(0x100100FF); - func_800C3448(0x110100FF); - func_800C97C4(playerId); - D_800EA0F0 = 2; - func_800C9A88(0U); - D_800EA0EC[playerId] = 2; - func_800C9060(playerId, 0x1900F103U); - if (D_801657E5 == 1) { - func_800CA414(0x000DU, 0x0010U); - } else if (D_8018ED90 == 1) { - func_800CA414(0x000EU, 0x0010U); - } else { - func_800C3448(0x01640010); - } - break; - case 2: - D_800EA0EC[playerId] = 2; - func_800C9060(playerId, 0x1900F103U); - switch (D_800EA1C0) { /* switch 1; irregular */ - case 1: /* switch 1 */ + break; + case TIME_TRIALS: func_800C3448(0x100100FF); func_800C3448(0x110100FF); func_800C97C4(playerId); D_800EA0F0 = 2; - func_800C9A88(playerId); - func_800CA414(0x000DU, 0x0017U); - break; - case 2: /* switch 1 */ - if ((D_800EA104 == 0) && (D_800EA0EC[playerId] == 1)) { - func_800C3448(0x100100FF); - func_800C3448(0x110100FF); -#ifdef VERSION_EU - func_800C8EF8(0x000DU); -#else - func_800CA414(0x000DU, 0x0017U); -#endif - D_800EA104 = 1; - } else if ((D_800EA104 == 1) && (D_800EA0EC[playerId] == 1)) { - func_800C5278(5U); -#ifndef VERSION_EU - if (func_800C3508(1) != 0x000D) -#endif - { - D_800EA104 = 0; - func_800CA414(0x000EU, 0x0017U); - } - D_800EA104 = 2; - } - break; - case 3: /* switch 1 */ - if ((D_800EA104 == 0) && (D_800EA0EC[playerId] == 1)) { - func_800C3448(0x100100FF); - func_800C3448(0x110100FF); - func_800C8EF8(0x000DU); - D_800EA104 = 1; - } else if ((D_800EA104 == 1) && (D_800EA0EC[playerId] == 1)) { - if (func_800C3508(1) != 0x000D) { - D_800EA104 = 0; - func_800C8EF8(0x000EU); - } - D_800EA104 = 2; - } else if ((D_800EA104 == 2) && (D_800EA0EC[playerId] == 1)) { - func_800C5278(5U); -#ifndef VERSION_EU - if (func_800C3508(1) != 0x000E) -#endif - { - D_800EA104 = 0; - func_800CA414(0x000EU, 0x0017U); - } - D_800EA104 = 3; - } - break; - } - break; - case 3: - switch (D_800EA1C0) { /* switch 2; irregular */ - case 1: /* switch 2 */ - func_800C3448(0x100100FF); - func_800C3448(0x110100FF); - func_800C5278(5U); - func_800C9018(playerId, 0x0100F926); - func_800C8EF8(0x0017U); + func_800C9A88(0U); D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + 0x2900800D); - break; - case 2: /* switch 2 */ - if ((D_800EA0EC[0] == 1) && (D_800EA0EC[1] == 1) && (D_800EA0EC[2] == 1)) { - func_800C5278(5U); - func_800C9018(playerId, 0x01008026); - func_800C8EF8(0x0017U); - D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + 0x2900800D); + func_800C9060(playerId, 0x1900F103U); + if (D_801657E5 == 1) { + func_800CA414(0x000DU, 0x0010U); + } else if (D_8018ED90 == 1) { + func_800CA414(0x000EU, 0x0010U); + } else { + func_800C3448(0x01640010); } break; - case 3: /* switch 2 */ - if ((D_800EA0EC[0] == 1) && (D_800EA0EC[1] == 1) && (D_800EA0EC[2] == 1) && (D_800EA0EC[3] == 1)) { - func_800C5278(5U); - func_800C9018(playerId, 0x01008026); - func_800C8EF8(0x0017U); - D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + 0x2900800D); + case VERSUS: + D_800EA0EC[playerId] = 2; + func_800C9060(playerId, 0x1900F103U); + switch (D_800EA1C0) { /* switch 1; irregular */ + case 1: /* switch 1 */ + func_800C3448(0x100100FF); + func_800C3448(0x110100FF); + func_800C97C4(playerId); + D_800EA0F0 = 2; + func_800C9A88(playerId); + func_800CA414(0x000DU, 0x0017U); + break; + case 2: /* switch 1 */ + if ((D_800EA104 == 0) && (D_800EA0EC[playerId] == 1)) { + func_800C3448(0x100100FF); + func_800C3448(0x110100FF); +#ifdef VERSION_EU + func_800C8EF8(0x000DU); +#else + func_800CA414(0x000DU, 0x0017U); +#endif + D_800EA104 = 1; + } else if ((D_800EA104 == 1) && (D_800EA0EC[playerId] == 1)) { + func_800C5278(5U); +#ifndef VERSION_EU + if (func_800C3508(1) != 0x000D) { +#endif + D_800EA104 = 0; + func_800CA414(0x000EU, 0x0017U); + } + D_800EA104 = 2; + } + break; + case 3: /* switch 1 */ + if ((D_800EA104 == 0) && (D_800EA0EC[playerId] == 1)) { + func_800C3448(0x100100FF); + func_800C3448(0x110100FF); + func_800C8EF8(0x000DU); + D_800EA104 = 1; + } else if ((D_800EA104 == 1) && (D_800EA0EC[playerId] == 1)) { + if (func_800C3508(1) != 0x000D) { + D_800EA104 = 0; + func_800C8EF8(0x000EU); + } + D_800EA104 = 2; + } else if ((D_800EA104 == 2) && (D_800EA0EC[playerId] == 1)) { + func_800C5278(5U); + #ifndef VERSION_EU + if (func_800C3508(1) != 0x000E) { + #endif + D_800EA104 = 0; + func_800CA414(0x000EU, 0x0017U); + } + D_800EA104 = 3; + } + break; } break; - } - break; - default: - break; + case BATTLE: + switch (D_800EA1C0) { /* switch 2; irregular */ + case 1: /* switch 2 */ + func_800C3448(0x100100FF); + func_800C3448(0x110100FF); + func_800C5278(5U); + func_800C9018(playerId, 0x0100F926); + func_800C8EF8(0x0017U); + D_800EA0EC[playerId] = 2; + func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + 0x2900800D); + break; + case 2: /* switch 2 */ + if ((D_800EA0EC[0] == 1) && (D_800EA0EC[1] == 1) && (D_800EA0EC[2] == 1)) { + func_800C5278(5U); + func_800C9018(playerId, 0x01008026); + func_800C8EF8(0x0017U); + D_800EA0EC[playerId] = 2; + func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + 0x2900800D); + } + break; + case 3: /* switch 2 */ + if ((D_800EA0EC[0] == 1) && (D_800EA0EC[1] == 1) && (D_800EA0EC[2] == 1) && (D_800EA0EC[3] == 1)) { + func_800C5278(5U); + func_800C9018(playerId, 0x01008026); + func_800C8EF8(0x0017U); + D_800EA0EC[playerId] = 2; + func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + 0x2900800D); + } + break; + } + break; + default: + break; } } if (D_800E9EA4[playerId] == 0x0000001E) { switch (gModeSelection) { /* switch 3; irregular */ - case 3: /* switch 3 */ - break; - case 0: /* switch 3 */ - if (gPlayers[playerId].currentRank == 0) { - D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008007); - } else if (gPlayers[playerId].currentRank < 4) { - D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x2900800D); - } else { - D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008003); - } - break; - case 2: /* switch 3 */ - if (gPlayers[playerId].currentRank == 0) { - D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x2900800D); - } - break; - case 1: /* switch 3 */ - if (D_801657E5 == 1) { - D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008007); - } else if (D_8018ED90 == (u8) 1) { - D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x2900800D); - } - break; + case BATTLE: /* switch 3 */ + break; + case GRAND_PRIX: /* switch 3 */ + if (gPlayers[playerId].currentRank == 0) { + D_800EA0EC[playerId] = 2; + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008007); + } else if (gPlayers[playerId].currentRank < 4) { + D_800EA0EC[playerId] = 2; + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x2900800D); + } else { + D_800EA0EC[playerId] = 2; + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008003); + } + break; + case VERSUS: /* switch 3 */ + if (gPlayers[playerId].currentRank == 0) { + D_800EA0EC[playerId] = 2; + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x2900800D); + } + break; + case TIME_TRIALS: /* switch 3 */ + if (D_801657E5 == 1) { + D_800EA0EC[playerId] = 2; + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008007); + } else if (D_8018ED90 == (u8) 1) { + D_800EA0EC[playerId] = 2; + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x2900800D); + } + break; } } switch (gModeSelection) { /* switch 4; irregular */ - case 0: /* switch 4 */ - if (gPlayers[playerId].currentRank == 0) { - if (D_800E9EA4[playerId] >= 0x15F) { - if (D_800E9EA4[playerId] == 0x0000015F) { - func_800C9D0C(playerId); + case GRAND_PRIX: /* switch 4 */ + if (gPlayers[playerId].currentRank == 0) { + if (D_800E9EA4[playerId] >= 0x15F) { + if (D_800E9EA4[playerId] == 0x0000015F) { + func_800C9D0C(playerId); + } + } else { + D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 400.0f; + } + } else if (gPlayers[playerId].currentRank < 4) { + if (D_800E9EA4[playerId] >= 0x15F) { + if (D_800E9EA4[playerId] == 0x0000015F) { + func_800C9D0C(playerId); + } + } else { + D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 400.0f; + } + } else if (D_800E9EA4[playerId] >= 0x12D) { + if (D_800E9EA4[playerId] == 0x0000012D) { + func_800C97C4(playerId); } } else { - D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 400.0f; + D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 330.0f; } - } else if (gPlayers[playerId].currentRank < 4) { - if (D_800E9EA4[playerId] >= 0x15F) { - if (D_800E9EA4[playerId] == 0x0000015F) { - func_800C9D0C(playerId); + break; + case VERSUS: /* switch 4 */ + if (D_800EA1C0 == (u8) 1) { + if (D_800E9EA4[playerId] >= 0x65) { + if (D_800E9EA4[playerId] == 0x00000065) { + func_800C9D0C(playerId); + } + } else { + D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 120.0f; } - } else { - D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 400.0f; - } - } else if (D_800E9EA4[playerId] >= 0x12D) { - if (D_800E9EA4[playerId] == 0x0000012D) { - func_800C97C4(playerId); - } - } else { - D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 330.0f; - } - break; - case 2: /* switch 4 */ - if (D_800EA1C0 == (u8) 1) { - if (D_800E9EA4[playerId] >= 0x65) { + } else if (D_800E9EA4[playerId] >= 0x65) { if (D_800E9EA4[playerId] == 0x00000065) { - func_800C9D0C(playerId); + func_800C97C4(playerId); } } else { D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 120.0f; } - } else if (D_800E9EA4[playerId] >= 0x65) { - if (D_800E9EA4[playerId] == 0x00000065) { - func_800C97C4(playerId); + /* fallthrough */ + case TIME_TRIALS: /* switch 4 */ + if (D_800E9EA4[playerId] >= 0x12D) { + if (D_800E9EA4[playerId] == 0x0000012D) { + func_800C9D0C(0U); + } + } else { + D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 350.0f; } - } else { - D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 120.0f; - } - /* fallthrough */ - case 1: /* switch 4 */ - if (D_800E9EA4[playerId] >= 0x12D) { - if (D_800E9EA4[playerId] == 0x0000012D) { - func_800C9D0C(0U); + break; + case BATTLE: /* switch 4 */ + if (D_800E9EA4[playerId] >= 0x65) { + if (D_800E9EA4[playerId] == 0x00000065) { + func_800C97C4(playerId); + } + } else { + D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 120.0f; } - } else { - D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 350.0f; - } - break; - case 3: /* switch 4 */ - if (D_800E9EA4[playerId] >= 0x65) { - if (D_800E9EA4[playerId] == 0x00000065) { - func_800C97C4(playerId); - } - } else { - D_800EA130[playerId] = (f32) D_800E9EA4[playerId] / 120.0f; - } - break; + break; } } } @@ -3203,22 +3200,22 @@ void func_800C8770(u8 playerId) { } } switch (D_800E9F24[playerId]) { /* irregular */ - case 1: - if (D_800E9F34[playerId] < 0.7f) { - D_800E9F34[playerId] += 0.1f; - D_800E9F54[playerId] += 0.03f; - } - break; - case 2: - if (D_800E9F34[playerId] > 0.16f) { - D_800E9F34[playerId] -= 0.15f; - D_800E9F54[playerId] -= 0.03f; - } else { - D_800E9F34[playerId] = 0.0f; - D_800E9F54[playerId] = 0.0f; - D_800E9F24[playerId] = 0; - } - break; + case 1: + if (D_800E9F34[playerId] < 0.7f) { + D_800E9F34[playerId] += 0.1f; + D_800E9F54[playerId] += 0.03f; + } + break; + case 2: + if (D_800E9F34[playerId] > 0.16f) { + D_800E9F34[playerId] -= 0.15f; + D_800E9F54[playerId] -= 0.03f; + } else { + D_800E9F34[playerId] = 0.0f; + D_800E9F54[playerId] = 0.0f; + D_800E9F24[playerId] = 0; + } + break; } } @@ -3273,30 +3270,30 @@ void func_800C8AE4(void) { } } else { switch (D_800EA1C0) { /* irregular */ - case 0: - if (D_800E9F7C[0].unk_14 != 0) { - D_800EA17C = 0.0f; - D_800EA184 = 1; - } - break; - case 1: - if ((D_800E9F7C[0].unk_14 != 0) || (D_800E9F7C[1].unk_14 != 0)) { - D_800EA17C = 0.0f; - D_800EA184 = 1; - } - break; - case 2: - if ((D_800E9F7C[0].unk_14 != 0) || (D_800E9F7C[1].unk_14 != 0) || (D_800E9F7C[2].unk_14 != 0)) { - D_800EA17C = 0.0f; - D_800EA184 = 1; - } - break; - case 3: - if ((D_800E9F7C[0].unk_14 != 0) || (D_800E9F7C[1].unk_14 != 0) || (D_800E9F7C[2].unk_14 != 0) || (D_800E9F7C[3].unk_14 != 0)) { - D_800EA17C = 0.0f; - D_800EA184 = 1; - } - break; + case 0: + if (D_800E9F7C[0].unk_14 != 0) { + D_800EA17C = 0.0f; + D_800EA184 = 1; + } + break; + case 1: + if ((D_800E9F7C[0].unk_14 != 0) || (D_800E9F7C[1].unk_14 != 0)) { + D_800EA17C = 0.0f; + D_800EA184 = 1; + } + break; + case 2: + if ((D_800E9F7C[0].unk_14 != 0) || (D_800E9F7C[1].unk_14 != 0) || (D_800E9F7C[2].unk_14 != 0)) { + D_800EA17C = 0.0f; + D_800EA184 = 1; + } + break; + case 3: + if ((D_800E9F7C[0].unk_14 != 0) || (D_800E9F7C[1].unk_14 != 0) || (D_800E9F7C[2].unk_14 != 0) || (D_800E9F7C[3].unk_14 != 0)) { + D_800EA17C = 0.0f; + D_800EA184 = 1; + } + break; } } } @@ -3321,7 +3318,7 @@ void func_800C8CCC() { func_800C847C(var_s0); func_800C86D8(var_s0); } - if (gModeSelection == 0) { + if (gModeSelection == GRAND_PRIX) { for (var_s0 = 0; var_s0 < 8; var_s0++) { func_800C8770(var_s0); func_800C8C7C(var_s0); @@ -3393,20 +3390,20 @@ void func_800C9060(u8 arg0, u32 arg1) { void func_800C90F4(u8 playerId, u32 arg1) { if (D_800EA108 == 0) { switch (D_800EA0EC[playerId]) { - case 2: - D_800EA0EC[playerId] = 1; - case 0: - if (((arg1 & ~0xF0) == 0x29008003) || ((arg1 & ~0xF0) == 0x29008004) || ((arg1 & ~0xF0) == 0x29008005)) { - D_800EA180 = 1; - } - if (((gPlayers[playerId].effects & 0x40000000) == 0x40000000) && ((s32) D_800E9F2C[playerId] >= 0x1F)) { - play_sound(arg1, D_800E9F7C[playerId].pos, playerId, &D_800EA150, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); - } else { - play_sound(arg1, D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); - } - break; - default: - break; + case 2: + D_800EA0EC[playerId] = 1; + case 0: + if (((arg1 & ~0xF0) == 0x29008003) || ((arg1 & ~0xF0) == 0x29008004) || ((arg1 & ~0xF0) == 0x29008005)) { + D_800EA180 = 1; + } + if (((gPlayers[playerId].effects & 0x40000000) == 0x40000000) && ((s32) D_800E9F2C[playerId] >= 0x1F)) { + play_sound(arg1, D_800E9F7C[playerId].pos, playerId, &D_800EA150, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); + } else { + play_sound(arg1, D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); + } + break; + default: + break; } } } @@ -3439,88 +3436,88 @@ void func_800C94A4(u8 playerId) { if (D_800EA108 == 0) { switch(D_800EA0EC[playerId]) { - case 2: - D_800EA0EC[playerId] = 1; - case 0: - D_800E9F7C[playerId].unk_0C = 1.0f; - D_800E9F7C[playerId].unk_10 = 0.0f; - switch (gPlayers[playerId].characterId) { - case 0: - case 1: - D_800E9F7C[playerId].unk_18 = 2.8f; - D_800E9F7C[playerId].unk_1C = 3844.0f; - D_800E9F7C[playerId].unk_20 = 0.35f; - D_800E9F7C[playerId].unk_24 = -0.8f; - D_800E9F7C[playerId].unk_28 = 0.35f; - D_800E9F7C[playerId].unk_2C = 1568.9796f; - D_800E9F7C[playerId].unk_30 = 1067.7778f; - D_800E9F7C[playerId].unk_34 = 2766.065f; - break; case 2: - case 6: - D_800E9F7C[playerId].unk_18 = 3.2f; - D_800E9F7C[playerId].unk_1C = 3844.0f; - D_800E9F7C[playerId].unk_20 = 0.6f; - D_800E9F7C[playerId].unk_24 = -1.7f; - D_800E9F7C[playerId].unk_28 = 0.6f; - D_800E9F7C[playerId].unk_2C = 1478.4615f; - D_800E9F7C[playerId].unk_30 = 784.4898f; - D_800E9F7C[playerId].unk_34 = 12813.335f; - break; - case 3: - D_800E9F7C[playerId].unk_18 = 2.8f; - D_800E9F7C[playerId].unk_1C = 3844.0f; - D_800E9F7C[playerId].unk_20 = 0.6f; - D_800E9F7C[playerId].unk_24 = -0.6f; - D_800E9F7C[playerId].unk_28 = 0.6f; - D_800E9F7C[playerId].unk_2C = 1747.2728f; - D_800E9F7C[playerId].unk_30 = 1130.5883f; - D_800E9F7C[playerId].unk_34 = 3844.001f; - break; - case 4: - D_800E9F7C[playerId].unk_18 = 2.0f; - D_800E9F7C[playerId].unk_1C = 3844.0f; - D_800E9F7C[playerId].unk_20 = 0.2f; - D_800E9F7C[playerId].unk_24 = -0.4f; - D_800E9F7C[playerId].unk_28 = 0.2f; - D_800E9F7C[playerId].unk_2C = 2135.5557f; - D_800E9F7C[playerId].unk_30 = 1601.6666f; - D_800E9F7C[playerId].unk_34 = 3203.333f; - break; - case 5: - case 7: - D_800E9F7C[playerId].unk_18 = 2.4f; - D_800E9F7C[playerId].unk_1C = 3844.0f; - D_800E9F7C[playerId].unk_20 = 0.4f; - D_800E9F7C[playerId].unk_24 = -0.8f; - D_800E9F7C[playerId].unk_28 = 0.4f; - D_800E9F7C[playerId].unk_2C = 1922.0f; - D_800E9F7C[playerId].unk_30 = 1201.25f; - D_800E9F7C[playerId].unk_34 = 4805.0f; - break; + D_800EA0EC[playerId] = 1; + case 0: + D_800E9F7C[playerId].unk_0C = 1.0f; + D_800E9F7C[playerId].unk_10 = 0.0f; + switch (gPlayers[playerId].characterId) { + case 0: + case 1: + D_800E9F7C[playerId].unk_18 = 2.8f; + D_800E9F7C[playerId].unk_1C = 3844.0f; + D_800E9F7C[playerId].unk_20 = 0.35f; + D_800E9F7C[playerId].unk_24 = -0.8f; + D_800E9F7C[playerId].unk_28 = 0.35f; + D_800E9F7C[playerId].unk_2C = 1568.9796f; + D_800E9F7C[playerId].unk_30 = 1067.7778f; + D_800E9F7C[playerId].unk_34 = 2766.065f; + break; + case 2: + case 6: + D_800E9F7C[playerId].unk_18 = 3.2f; + D_800E9F7C[playerId].unk_1C = 3844.0f; + D_800E9F7C[playerId].unk_20 = 0.6f; + D_800E9F7C[playerId].unk_24 = -1.7f; + D_800E9F7C[playerId].unk_28 = 0.6f; + D_800E9F7C[playerId].unk_2C = 1478.4615f; + D_800E9F7C[playerId].unk_30 = 784.4898f; + D_800E9F7C[playerId].unk_34 = 12813.335f; + break; + case 3: + D_800E9F7C[playerId].unk_18 = 2.8f; + D_800E9F7C[playerId].unk_1C = 3844.0f; + D_800E9F7C[playerId].unk_20 = 0.6f; + D_800E9F7C[playerId].unk_24 = -0.6f; + D_800E9F7C[playerId].unk_28 = 0.6f; + D_800E9F7C[playerId].unk_2C = 1747.2728f; + D_800E9F7C[playerId].unk_30 = 1130.5883f; + D_800E9F7C[playerId].unk_34 = 3844.001f; + break; + case 4: + D_800E9F7C[playerId].unk_18 = 2.0f; + D_800E9F7C[playerId].unk_1C = 3844.0f; + D_800E9F7C[playerId].unk_20 = 0.2f; + D_800E9F7C[playerId].unk_24 = -0.4f; + D_800E9F7C[playerId].unk_28 = 0.2f; + D_800E9F7C[playerId].unk_2C = 2135.5557f; + D_800E9F7C[playerId].unk_30 = 1601.6666f; + D_800E9F7C[playerId].unk_34 = 3203.333f; + break; + case 5: + case 7: + D_800E9F7C[playerId].unk_18 = 2.4f; + D_800E9F7C[playerId].unk_1C = 3844.0f; + D_800E9F7C[playerId].unk_20 = 0.4f; + D_800E9F7C[playerId].unk_24 = -0.8f; + D_800E9F7C[playerId].unk_28 = 0.4f; + D_800E9F7C[playerId].unk_2C = 1922.0f; + D_800E9F7C[playerId].unk_30 = 1201.25f; + D_800E9F7C[playerId].unk_34 = 4805.0f; + break; } var_a0 = gPlayers[playerId].characterId + 0x0104FF00; switch (D_800E9F74[playerId]) { /* switch 1; irregular */ - case 0: /* switch 1 */ - if (D_800EA1C0 != 0) { - var_a0 += 0x14; + case 0: /* switch 1 */ + if (D_800EA1C0 != 0) { + var_a0 += 0x14; + } + break; + case 1: /* switch 1 */ + var_a0 += 0x2E; + break; + case 2: /* switch 1 */ + if (D_800EA1C0 == 0) { + var_a0 += 0x36; + } else { + var_a0 += 0x3E; + } + break; } + play_sound(var_a0, D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_0C, &D_800E9F7C[playerId].unk_10, (u8 *) &D_800E9F7C[playerId].unk_14); break; - case 1: /* switch 1 */ - var_a0 += 0x2E; + default: break; - case 2: /* switch 1 */ - if (D_800EA1C0 == 0) { - var_a0 += 0x36; - } else { - var_a0 += 0x3E; - } - break; - } - play_sound(var_a0, D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_0C, &D_800E9F7C[playerId].unk_10, (u8 *) &D_800E9F7C[playerId].unk_14); - break; - default: - break; } } } @@ -3569,47 +3566,47 @@ void func_800C9A88(u8 playerId) { if (D_800EA108 == 0) { switch(D_800EA0F0) { - case 2: - D_800EA0F0 = 1; - /* fallthrough */ - case 0: - switch (gPlayers[playerId].characterId) { - case 0: - case 1: - D_800EA06C[playerId].unk00[0] = 0.35f; - D_800EA06C[playerId].unk00[1] = 1568.9796f; - break; case 2: - case 6: - D_800EA06C[playerId].unk00[0] = 0.6f; - D_800EA06C[playerId].unk00[1] = 1478.4615f; - break; - case 3: - D_800EA06C[playerId].unk00[0] = 0.6f; - D_800EA06C[playerId].unk00[1] = 1747.2728f; - break; - case 4: - D_800EA06C[playerId].unk00[0] = 0.2f; - D_800EA06C[playerId].unk00[1] = 2135.5557f; - break; - case 5: - case 7: - D_800EA06C[playerId].unk00[0] = 0.4f; - D_800EA06C[playerId].unk00[1] = 1922.0f; - } - if (D_800EA1C0 < 2) { - for (var_s0 = 0; var_s0 < D_800EA1C0 + 1; var_s0++) { - soundBits = gPlayers[playerId].characterId + 0x31028000; - temp_v0_6 = func_800C1C88(playerId, gPlayers[playerId].pos, gPlayers[playerId].velocity, &gPlayers[playerId].unk_098, var_s0, soundBits); - if (temp_v0_6 != NULL) { - temp_v0_6->unk34 = 40.0f; - play_sound(soundBits, temp_v0_6->unk18, var_s0, &temp_v0_6->unk2C, &D_800EA06C[playerId].unk00[2], &D_800EA06C[playerId].unk0C); + D_800EA0F0 = 1; + /* fallthrough */ + case 0: + switch (gPlayers[playerId].characterId) { + case 0: + case 1: + D_800EA06C[playerId].unk00[0] = 0.35f; + D_800EA06C[playerId].unk00[1] = 1568.9796f; + break; + case 2: + case 6: + D_800EA06C[playerId].unk00[0] = 0.6f; + D_800EA06C[playerId].unk00[1] = 1478.4615f; + break; + case 3: + D_800EA06C[playerId].unk00[0] = 0.6f; + D_800EA06C[playerId].unk00[1] = 1747.2728f; + break; + case 4: + D_800EA06C[playerId].unk00[0] = 0.2f; + D_800EA06C[playerId].unk00[1] = 2135.5557f; + break; + case 5: + case 7: + D_800EA06C[playerId].unk00[0] = 0.4f; + D_800EA06C[playerId].unk00[1] = 1922.0f; + } + if (D_800EA1C0 < 2) { + for (var_s0 = 0; var_s0 < D_800EA1C0 + 1; var_s0++) { + soundBits = gPlayers[playerId].characterId + 0x31028000; + temp_v0_6 = func_800C1C88(playerId, gPlayers[playerId].pos, gPlayers[playerId].velocity, &gPlayers[playerId].unk_098, var_s0, soundBits); + if (temp_v0_6 != NULL) { + temp_v0_6->unk34 = 40.0f; + play_sound(soundBits, temp_v0_6->unk18, var_s0, &temp_v0_6->unk2C, &D_800EA06C[playerId].unk00[2], &D_800EA06C[playerId].unk0C); + } } } - } - break; - default: - break; + break; + default: + break; } } } @@ -3699,28 +3696,28 @@ void func_800CA118(u8 arg0) { D_800EA0EC[arg0] = 1; D_800E9EA4[arg0] = 1; switch (D_800EA1C0) { /* irregular */ - case 0: - D_800EA0F0 = 1; - func_800CA0E4(); - break; - case 1: - if ((D_800EA0EC[0] == (u8) 1) && (D_800EA0EC[1] == (u8) 1)) { + case 0: D_800EA0F0 = 1; func_800CA0E4(); - } - break; - case 2: - if ((D_800EA0EC[0] == (u8) 1) && (D_800EA0EC[1] == (u8) 1) && (D_800EA0EC[2] == (u8) 1)) { - D_800EA0F0 = 1; - func_800CA0E4(); - } - break; - case 3: - if ((D_800EA0EC[0] == (u8) 1) && (D_800EA0EC[1] == (u8) 1) && (D_800EA0EC[2] == (u8) 1) && (D_800EA0EC[3] == (u8) 1)) { - D_800EA0F0 = 1; - func_800CA0E4(); - } - break; + break; + case 1: + if ((D_800EA0EC[0] == (u8) 1) && (D_800EA0EC[1] == (u8) 1)) { + D_800EA0F0 = 1; + func_800CA0E4(); + } + break; + case 2: + if ((D_800EA0EC[0] == (u8) 1) && (D_800EA0EC[1] == (u8) 1) && (D_800EA0EC[2] == (u8) 1)) { + D_800EA0F0 = 1; + func_800CA0E4(); + } + break; + case 3: + if ((D_800EA0EC[0] == (u8) 1) && (D_800EA0EC[1] == (u8) 1) && (D_800EA0EC[2] == (u8) 1) && (D_800EA0EC[3] == (u8) 1)) { + D_800EA0F0 = 1; + func_800CA0E4(); + } + break; } } @@ -3883,15 +3880,15 @@ void func_800CAB4C(u8 arg0) { if (D_800EA108 == 0) { switch(D_800EA0EC[arg0]) { - case 2: - D_800EA0EC[arg0] = 1; - case 0: - func_800C36C4(0, 1U, 0x55U, 5); - func_800C9060(arg0, 0x1900F013U); - play_sound(0x5101C00CU, D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); - break; - default: - break; + case 2: + D_800EA0EC[arg0] = 1; + case 0: + func_800C36C4(0, 1U, 0x55U, 5); + func_800C9060(arg0, 0x1900F013U); + play_sound(0x5101C00CU, D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + break; + default: + break; } D_800EA168 = 1; } diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index 661584777..3df502e96 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -1275,10 +1275,10 @@ s32 func_80008E58(s32 payerId, s32 pathIndex) { D_80163318[payerId] = trackSegment; D_80162FCE = func_8000C0BC(posX, posY, posZ, trackSegment, &pathIndex); gNearestWaypointByPlayerId[payerId] = D_80162FCE; - if(pathIndex){}; + if(pathIndex) {}; gPathIndexByPlayerId[payerId] = pathIndex; func_80008DC0(pathIndex); - if(stackPadding){}; + if(stackPadding) {}; return pathIndex; } @@ -3791,8 +3791,7 @@ void func_8000F628(void) { D_80163330[D_80163344[0]] = 1; D_8016334C[D_80163344[0]] = 0; - for (i = 1; i < 2; i++) - { + for (i = 1; i < 2; i++) { D_80163344[i] = cameras[i].playerId; D_80163330[D_80163344[i]] = 1; D_8016334C[D_80163344[i]] = i; @@ -7535,34 +7534,34 @@ void func_8001A124(s32 arg0, s32 arg1) { } } -void func_8001A220(s32 arg0, s32 arg1) { +void func_8001A220(s32 arg0, s32 cameraId) { switch (random_int(6)) { case 0: - D_80164680[arg1] = 4; + D_80164680[cameraId] = 4; break; case 1: - D_80164680[arg1] = 5; + D_80164680[cameraId] = 5; break; case 2: - D_80164680[arg1] = 6; + D_80164680[cameraId] = 6; break; case 3: - D_80164680[arg1] = 7; + D_80164680[cameraId] = 7; break; case 4: - D_80164680[arg1] = 8; + D_80164680[cameraId] = 8; break; case 5: - D_80164680[arg1] = 1; + D_80164680[cameraId] = 1; break; default: - D_80164680[arg1] = 8; + D_80164680[cameraId] = 8; break; } } -s32 func_8001A310(s32 arg0, s32 arg1) { - if ((gCurrentCourseId == COURSE_BOWSER_CASTLE) && (arg1 != 0) && (arg0 >= 0xE7) && (arg0 < 0x1C2)) { +s32 func_8001A310(s32 waypoint, s32 arg1) { + if ((gCurrentCourseId == COURSE_BOWSER_CASTLE) && (arg1 != 0) && (waypoint >= 0xE7) && (waypoint < 0x1C2)) { arg1 = 0; } return arg1; @@ -7630,7 +7629,7 @@ void func_8001A588(u16 *localD_80152300, Camera *camera, Player *player, s8 inde s32 playerId; playerId = camera->playerId; - if (gModeSelection == 1) { + if (gModeSelection == TIME_TRIALS) { playerId = 0; } func_80019FB4(cameraIndex); @@ -7642,8 +7641,8 @@ void func_8001A588(u16 *localD_80152300, Camera *camera, Player *player, s8 inde camera->pos[2] = (f32) (camera->pos[2] + 100.0); } } - if ((gModeSelection != 3) && (D_80164680[cameraIndex] == -1) && (player->type & 0x800) && ((u16) D_801646CC == 0) && (D_801646C8 == 0)) { - if (gModeSelection == 2) { + if ((gModeSelection != BATTLE) && (D_80164680[cameraIndex] == -1) && (player->type & 0x800) && ((u16) D_801646CC == 0) && (D_801646C8 == 0)) { + if (gModeSelection == VERSUS) { func_8001A220(playerId, cameraIndex); } else { func_8001A124((s32) playerId, cameraIndex); @@ -7666,7 +7665,7 @@ void func_8001A588(u16 *localD_80152300, Camera *camera, Player *player, s8 inde if ((cameraIndex == 0) && (((D_801646C8 == 10)) || (D_801646C8 == 11))) { func_8001A518((s32) playerId, gGPCurrentRaceRankByPlayerId[playerId], 0); } - if ((gModeSelection != 1) && (cameraIndex == 1) && (((D_801646C8 == 260)) || (D_801646C8 == 261))) { + if ((gModeSelection != TIME_TRIALS) && (cameraIndex == 1) && (((D_801646C8 == 260)) || (D_801646C8 == 261))) { var_v1 = 0; if (gPlayerCount == 2) { @@ -7798,7 +7797,7 @@ void func_8001AB74(s32 arg0, s16 *arg1, s32 arg2) { break; } if (value >= 0) { - *arg1 = value; + *arg1 = value; } } diff --git a/src/code_80091750.c b/src/code_80091750.c index b29561a55..5654f0868 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -2266,7 +2266,7 @@ void print_text1(s32 column, s32 row, char *text, s32 tracking, f32 x_scale, f32 break; } - if (arg6 < 3){ + if (arg6 < 3) { sp60 = 1; } else{ @@ -2744,7 +2744,7 @@ void func_80094C60(void) { case COURSE_SELECT_MENU: add_8018D9E0_entry(0x00000025, 0, 0, 2); add_8018D9E0_entry(0x00000052, 0, 0, 6); - if (gModeSelection != 3) { + if (gModeSelection != BATTLE) { add_8018D9E0_entry(0x00000053, 0, 0, 4); add_8018D9E0_entry(0x00000054, 0, 0, 4); add_8018D9E0_entry(0x00000055, 0, 0, 4); @@ -2764,12 +2764,12 @@ void func_80094C60(void) { add_8018D9E0_entry(0x00000062, 0, 0, 6); add_8018D9E0_entry(0x0000005D, 0, 0, 6); add_8018D9E0_entry(0x0000005E, 0, 0, 8); - if (gModeSelection == 1) { + if (gModeSelection == TIME_TRIALS) { add_8018D9E0_entry(0x00000065, 0, 0, 8); add_8018D9E0_entry(0x00000066, 0, 0, 8); add_8018D9E0_entry(0x00000069, 0, 0, 8); } - if (gModeSelection == 0) { + if (gModeSelection == GRAND_PRIX) { add_8018D9E0_entry(0x00000068, 0, 0, 8); add_8018D9E0_entry(0x00000067, 0, 0, 5); } @@ -5086,7 +5086,7 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_80099EC4.s") void func_8009A344(void) { s32 index; - for(index = 0; index < D_8018DEE0_SIZE; index++){ + for(index = 0; index < D_8018DEE0_SIZE; index++) { D_8018DEE0[index].visible = 0; } } @@ -5975,7 +5975,7 @@ void func_8009CBE4(s32 arg0, s32 arg1, s32 arg2) { struct UnkStruct_800DC5EC* unk; struct UnkStruct_8018E7E8 *size, *start; - if ((gModeSelection == 0) || (gModeSelection == 1)) { + if ((gModeSelection == GRAND_PRIX) || (gModeSelection == TIME_TRIALS)) { start = &(D_8018E7E8[arg0]); size = &(D_8018E810[arg0]); x = start->x; @@ -6869,7 +6869,7 @@ void func_8009E5FC(s32 arg0) { void func_8009E620(void) { s32 index; - for(index = 0; index < D_8018D9E0_SIZE; index++){ + for(index = 0; index < D_8018D9E0_SIZE; index++) { D_8018D9E0[index].type = 0; } } @@ -7859,10 +7859,8 @@ s32 func_800A095C(char *someString, s32 len, s32 column, s32 row) { void func_800A09E0(struct_8018D9E0_entry *arg0) { s32 table_row, x = 0x20, y; gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, 319, 194); - for(table_row = 0; table_row < 9; table_row++) - { - if ((D_800E86D0[0] != 0) || ((table_row != 0) && (table_row != 8))) - { + for(table_row = 0; table_row < 9; table_row++) { + if ((D_800E86D0[0] != 0) || ((table_row != 0) && (table_row != 8))) { y = (table_row * 0xA) + arg0->row; gDisplayListHead = func_8009BA74(gDisplayListHead, D_0200157C, x, y); } @@ -7876,8 +7874,7 @@ void func_800A0AD0(UNUSED struct_8018D9E0_entry *arg0) { struct_8018D9E0_entry *temp_t1; // Find struct_8018D9E0_entry with a type/id of 0xDA temp_t1 = find_8018D9E0_entry_dupe(0xDA); - if ((gControllerPakMenuSelection != CONTROLLER_PAK_MENU_SELECT_RECORD) && (gControllerPakMenuSelection != CONTROLLER_PAK_MENU_END)) - { + if ((gControllerPakMenuSelection != CONTROLLER_PAK_MENU_SELECT_RECORD) && (gControllerPakMenuSelection != CONTROLLER_PAK_MENU_END)) { gDPSetPrimColor(gDisplayListHead++, 0, 0, 0xFF, temp_t1->unk20, 0x00, 0xFF); gDisplayListHead = func_8009BA74(gDisplayListHead, D_02001874, 0x24, (gControllerPakSelectedTableRow * 0xA) + 0x7C); } @@ -8194,7 +8191,7 @@ void func_800A1A20(struct_8018D9E0_entry *arg0) { set_text_color(TEXT_YELLOW); func_80093324(0xA0, arg0->row + 0x86, D_800E7728[0], 0, 0.75f, 0.75f); // Print the 3 Lap Time Trial records - for(recordType = TIME_TRIAL_3LAP_RECORD_1, rowOffset = 0; recordType < TIME_TRIAL_1LAP_RECORD; recordType++, rowOffset += 0xD){ + for(recordType = TIME_TRIAL_3LAP_RECORD_1, rowOffset = 0; recordType < TIME_TRIAL_1LAP_RECORD; recordType++, rowOffset += 0xD) { set_text_color(TEXT_RED); func_800A474C(recordType, 0x96, arg0->row + rowOffset + 0x92); } @@ -8294,7 +8291,7 @@ void func_800A1F30(struct_8018D9E0_entry *unused) { s32 text; set_text_color(TEXT_RED); - for(row = 0x49, text = 0; row < 0x69; row += 0x10, text++){ + for(row = 0x49, text = 0; row < 0x69; row += 0x10, text++) { func_80093324(0x2A, row, D_800E7860[text], 0, 0.75f, 0.75f); } } @@ -8867,12 +8864,12 @@ void func_800A3C84(struct_8018D9E0_entry *arg0) { draw_text(arg0->column + 0x43, arg0->row + 0x19, D_800E7574[gCupCourseOrder[gCupSelection][gCupCourseSelection]], 0, 0.6f, 0.6f); set_text_color(TEXT_YELLOW); draw_text(arg0->column + 0x46, arg0->row + 0x28, D_800E7730, 0, 0.75f, 0.75f); - for(recordType = 0, rowOffset = 0; recordType < TIME_TRIAL_3LAP_RECORD_5; recordType += 1, rowOffset += 0xF){ + for(recordType = 0, rowOffset = 0; recordType < TIME_TRIAL_3LAP_RECORD_5; recordType += 1, rowOffset += 0xF) { func_800A4550(recordType, arg0->column + 0x17, arg0->row + rowOffset + 0x37); } set_text_color(TEXT_YELLOW); func_80093324(0xB4 - arg0->column, arg0->row + 0x86, D_800E7728[0], 0, 0.75f, 0.75f); - for(recordType = 0, rowOffset = 0; recordType < TIME_TRIAL_1LAP_RECORD; recordType += 1, rowOffset += 0xD){ + for(recordType = 0, rowOffset = 0; recordType < TIME_TRIAL_1LAP_RECORD; recordType += 1, rowOffset += 0xD) { set_text_color(TEXT_RED); func_800A474C(recordType, 0xAA - arg0->column, arg0->row + rowOffset + 0x92); } @@ -9732,13 +9729,13 @@ void func_800A69C8(struct_8018D9E0_entry *arg0) { var_v1 = 0; thing = &D_800E7300[0][var_s0]; switch (gModeSelection) { /* irregular */ - case 2: + case VERSUS: if (gGPCurrentRaceRankByPlayerId[var_s0] != 0) { var_v1 = 1; } var_s4 = &gNmiUnknown1[var_s0]; break; - case 3: + case BATTLE: if (var_s0 != gPlayerWinningIndex) { var_v1 = 1; } @@ -9765,10 +9762,10 @@ void func_800A6BEC(struct_8018D9E0_entry *arg0) { for (var_s0 = 0; var_s0 < gPlayerCount; var_s0++) { switch (gModeSelection) { /* irregular */ - case 2: + case VERSUS: func_800A6E94(3, var_s0, gNmiUnknown2); break; - case 3: + case BATTLE: func_800A6D94(3, var_s0, gNmiUnknown5); break; } @@ -9780,10 +9777,10 @@ void func_800A6CC0(struct_8018D9E0_entry *arg0) { for (var_s0 = 0; var_s0 < gPlayerCount; var_s0++) { switch (gModeSelection) { /* irregular */ - case 2: + case VERSUS: func_800A6E94(4, var_s0, gNmiUnknown3); break; - case 3: + case BATTLE: func_800A6D94(4, var_s0, gNmiUnknown6); break; } @@ -10630,7 +10627,7 @@ void func_800A8A98(struct_8018D9E0_entry *arg0) { gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA); for (someIndex = 0; someIndex < 4; someIndex++) { - if ((someIndex == gCupCourseSelection) && (D_8018EDEC >= 2) && (gModeSelection != 0)) { + if ((someIndex == gCupCourseSelection) && (D_8018EDEC >= 2) && (gModeSelection != GRAND_PRIX)) { if ((D_8018EDEC == 2) || (D_8018EDEC == 4)) { gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, D_800E7208[someIndex][0].column + temp_s2, D_800E7208[someIndex][0].row + temp_s3, D_800E7208[someIndex][1].column + temp_s2, D_800E7208[someIndex][1].row + temp_s3); } else { @@ -10654,7 +10651,7 @@ void func_800A8CA4(struct_8018D9E0_entry *arg0) { gDPPipeSync(gDisplayListHead++); gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA); - if (gModeSelection == 0) { + if (gModeSelection == GRAND_PRIX) { if (D_8018EDEC != 3) { for (var_s0 = 0; var_s0 < 4; var_s0++) { // Wut? @@ -11399,7 +11396,7 @@ void func_800AA2EC(struct_8018D9E0_entry *arg0) { break; } temp_v0 = osPfsInit(&gSIEventMesgQueue, &gControllerPak1FileHandle, 0); - if (temp_v0 != 0){ + if (temp_v0 != 0) { switch (temp_v0) { case PFS_ERR_NOPACK: case PFS_ERR_DEVICE: @@ -12146,7 +12143,7 @@ void func_800ABC38(struct_8018D9E0_entry *arg0) { } break; default: - if ((gModeSelection != 0) || (gPlayerCountSelection1 != (s32) 1U) || (D_8018EE08 != 0)) { + if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != (s32) 1U) || (D_8018EE08 != 0)) { arg0->type = 0; } else { if (arg0->row >= -0x13) { @@ -12208,7 +12205,7 @@ void func_800ABEAC(struct_8018D9E0_entry *arg0) { } break; default: - if ((gModeSelection != 0) || (gPlayerCountSelection1 != why) || (D_8018EE08 != 0)) { + if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != why) || (D_8018EE08 != 0)) { arg0->type = 0; } else { if (arg0->row < 0x104) { @@ -12581,7 +12578,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) { case 2: arg0->unk1C += 0x20; if (arg0->unk1C >= 0x100) { - if (gModeSelection == 2) { + if (gModeSelection == VERSUS) { arg0->unk4 = (s32) D_8018EDF4; } else { arg0->unk4 = (s32) D_8018EDF6; @@ -12617,7 +12614,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) { if (gControllerFive->buttonPressed & 0x9000) { func_8009DFE0(0x0000001E); play_sound2(0x49008016); - if (gModeSelection == 2) { + if (gModeSelection == VERSUS) { D_8018EDF4 = (s8) arg0->unk4; } else { D_8018EDF6 = (s8) arg0->unk4; diff --git a/src/hud_renderer.c b/src/hud_renderer.c index 32501704d..27879c588 100644 --- a/src/hud_renderer.c +++ b/src/hud_renderer.c @@ -2367,7 +2367,7 @@ void func_8004F3E4(s32 arg0) { Player *player; switch (gModeSelection) { /* irregular */ - case 0: + case GRAND_PRIX: for (var_s1 = D_8018D158 - 1; var_s1 >= 0; var_s1--) { temp_a1 = gGPCurrentRacePlayerIdByRank[var_s1]; if ((gPlayerOne + temp_a1)->type & 0x1000) { @@ -2381,7 +2381,7 @@ void func_8004F3E4(s32 arg0) { } } break; - case 1: + case TIME_TRIALS: for (var_s1 = 0; var_s1 < 8; var_s1++) { if (((gPlayerOne + var_s1)->type & 0x100) == 0x100) { func_8004F168(arg0, var_s1, 8); @@ -2389,13 +2389,13 @@ void func_8004F3E4(s32 arg0) { } func_8004F168(arg0, 0, gPlayerOne->characterId); break; - case 2: + case VERSUS: for (var_s1 = gPlayerCountSelection1 - 1; var_s1 >=0; var_s1--) { temp_a1 = gGPCurrentRacePlayerIdByRank[var_s1]; func_8004F168(arg0, temp_a1, (gPlayerOne + temp_a1)->characterId); } break; - case 3: + case BATTLE: for (var_s1 = 0; var_s1 < gPlayerCountSelection1; var_s1++) { if (!((gPlayerOne + var_s1)->type & 0x40)) { func_8004F168(arg0, var_s1, (gPlayerOne + var_s1)->characterId); diff --git a/src/menus.c b/src/menus.c index a9635ff35..862c505b7 100644 --- a/src/menus.c +++ b/src/menus.c @@ -848,7 +848,7 @@ void logo_intro_menu_act(struct Controller *arg0, UNUSED u16 arg1) { gCurrentCourseId = 0; gScreenModeSelection = SCREEN_MODE_1P; gCharacterSelections[0] = 0; - gModeSelection = 0; + gModeSelection = GRAND_PRIX; gPlayerCount = 1; #endif diff --git a/src/player_controller.c b/src/player_controller.c index 7308f3b25..fca4222f0 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -642,7 +642,7 @@ void func_80028864(Player *player, Camera *camera, s8 arg2, s8 arg3) { } if ((sp1E == 1) || ((player->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) || - (gModeSelection == 3) || + (gModeSelection == BATTLE) || ((player->unk_0CA & 2) != 0) || (player->unk_0CA & 8) || ((*((&D_801633F8) + (arg2))) == ((s16) 1U))) { @@ -3657,7 +3657,7 @@ void func_80032700(Player *player) { } if (D_801656F0 == 1) { test = gRaceFrameCounter - D_801652E0[temp_v0]; - if (gModeSelection == (s32) 1) { + if (gModeSelection == TIME_TRIALS) { var_v0 = 0x14; } else { var_v0 = 8; @@ -3931,7 +3931,7 @@ void func_80033AE0(Player *player, struct Controller *controller, s8 arg2) { player->unk_0FA = (s16) sp2D0; if (((sp2D0 >= 0x5A) || (sp2D0 < (-0x59))) && (!(player->unk_044 & 0x4000))) { - if ((((((!(player->effects & 0x10)) && (gCCSelection == CC_150)) && (gModeSelection != 3)) && (!(player->effects & 8))) && (((player->unk_094 / 18.0f) * 216.0f) >= 40.0f)) && (player->unk_204 == 0)) + if ((((((!(player->effects & 0x10)) && (gCCSelection == CC_150)) && (gModeSelection != BATTLE)) && (!(player->effects & 8))) && (((player->unk_094 / 18.0f) * 216.0f) >= 40.0f)) && (player->unk_204 == 0)) { player->statusEffects |= 0x80; } @@ -4246,7 +4246,7 @@ void func_80033AE0(Player *player, struct Controller *controller, s8 arg2) { player->unk_078 = ((s16) var_s1_2) * (var_f2_2 + 1.5f); } } - if (gModeSelection == 3) { + if (gModeSelection == BATTLE) { player->unk_078 *= 1.7; } } @@ -4674,7 +4674,7 @@ void func_80037CFC(Player *player, struct Controller *controller, s8 arg2) { player_speed(player); func_80030E00(player); } else { - if (gModeSelection == 3) + if (gModeSelection == BATTLE) { func_80031F48(player, 2.0f); } @@ -4768,54 +4768,55 @@ void func_800382DC(void) { u16 temp_v0_6; switch (gActiveScreenMode) { - case SCREEN_MODE_1P: - switch (gModeSelection) { - case 0: - func_800381AC(gPlayerOne, gControllerOne, 0); - return; - case 1: - if (D_8015F890 != 1) { - func_800381AC(gPlayerOne, gControllerOne, 0); - temp_v0_3 = gPlayerTwo->type; - if (((temp_v0_3 & 0x100) == 0x100) && ((temp_v0_3 & 0x800) != 0x800)) { - func_800381AC(gPlayerTwo, gControllerSix, 1); - } - temp_v0_4 = gPlayerThree->type; - if (((temp_v0_4 & 0x100) == 0x100) && ((temp_v0_4 & 0x800) != 0x800)) { - func_800381AC(gPlayerThree, gControllerSeven, 2); + case SCREEN_MODE_1P: + switch (gModeSelection) { + case GRAND_PRIX: + func_800381AC(gPlayerOne, gControllerOne, 0); return; - } - } else { - if ((gPlayerOne->type & 0x800) != 0x800) { - func_800381AC(gPlayerOne, gControllerEight, 0); - } - temp_v0_5 = gPlayerTwo->type; - if (((temp_v0_5 & 0x100) == 0x100) && ((temp_v0_5 & 0x800) != 0x800)) { - func_800381AC(gPlayerTwo, gControllerSix, 1); - } - temp_v0_6 = gPlayerThree->type; - if (((temp_v0_6 & 0x100) == 0x100) && ((temp_v0_6 & 0x800) != 0x800)) { - func_800381AC(gPlayerThree, gControllerSeven, 2); - return; - } - return; + case TIME_TRIALS: + if (D_8015F890 != 1) { + func_800381AC(gPlayerOne, gControllerOne, 0); + temp_v0_3 = gPlayerTwo->type; + if (((temp_v0_3 & 0x100) == 0x100) && ((temp_v0_3 & 0x800) != 0x800)) { + func_800381AC(gPlayerTwo, gControllerSix, 1); + } + temp_v0_4 = gPlayerThree->type; + if (((temp_v0_4 & 0x100) == 0x100) && ((temp_v0_4 & 0x800) != 0x800)) { + func_800381AC(gPlayerThree, gControllerSeven, 2); + return; + } + } else { + if ((gPlayerOne->type & 0x800) != 0x800) { + func_800381AC(gPlayerOne, gControllerEight, 0); + } + temp_v0_5 = gPlayerTwo->type; + if (((temp_v0_5 & 0x100) == 0x100) && ((temp_v0_5 & 0x800) != 0x800)) { + func_800381AC(gPlayerTwo, gControllerSix, 1); + } + temp_v0_6 = gPlayerThree->type; + if (((temp_v0_6 & 0x100) == 0x100) && ((temp_v0_6 & 0x800) != 0x800)) { + func_800381AC(gPlayerThree, gControllerSeven, 2); + return; + } + return; + } + + break; + } + break; + case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: + case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: + func_800381AC(gPlayerOne, gControllerOne, 0); + func_800381AC(gPlayerTwo, gControllerTwo, 1); + return; + case SCREEN_MODE_3P_4P_SPLITSCREEN: + func_800381AC(gPlayerOne, gControllerOne, 0); + func_800381AC(gPlayerTwo, gControllerTwo, 1); + func_800381AC(gPlayerThree, gControllerThree, 2); + if (gPlayerCountSelection1 == 4) { + func_800381AC(gPlayerFour, gControllerFour, 3); } break; - } - break; - case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: - case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - func_800381AC(gPlayerOne, gControllerOne, 0); - func_800381AC(gPlayerTwo, gControllerTwo, 1); - return; - case SCREEN_MODE_3P_4P_SPLITSCREEN: - func_800381AC(gPlayerOne, gControllerOne, 0); - func_800381AC(gPlayerTwo, gControllerTwo, 1); - func_800381AC(gPlayerThree, gControllerThree, 2); - if (gPlayerCountSelection1 == 4) { - func_800381AC(gPlayerFour, gControllerFour, 3); - } - break; } } diff --git a/src/render_player.c b/src/render_player.c index d07d914aa..d5438af9a 100644 --- a/src/render_player.c +++ b/src/render_player.c @@ -796,73 +796,73 @@ void func_80022744(void) { void func_8002276C(void) { switch (gActiveScreenMode) { /* irregular */ - case SCREEN_MODE_1P: - switch (gModeSelection) { /* switch 1; irregular */ - case GRAND_PRIX: /* switch 1 */ - func_80022A98(gPlayerOne, 0); - func_80022A98(gPlayerTwo, 1); - func_80022A98(gPlayerThree, 2); - func_80022A98(gPlayerFour, 3); - func_80022A98(gPlayerFive, 4); - func_80022A98(gPlayerSix, 5); - func_80022A98(gPlayerSeven, 6); - func_80022A98(gPlayerEight, 7); + case SCREEN_MODE_1P: + switch (gModeSelection) { /* switch 1; irregular */ + case GRAND_PRIX: /* switch 1 */ + func_80022A98(gPlayerOne, 0); + func_80022A98(gPlayerTwo, 1); + func_80022A98(gPlayerThree, 2); + func_80022A98(gPlayerFour, 3); + func_80022A98(gPlayerFive, 4); + func_80022A98(gPlayerSix, 5); + func_80022A98(gPlayerSeven, 6); + func_80022A98(gPlayerEight, 7); + break; + case TIME_TRIALS: /* switch 1 */ + func_80022A98(gPlayerOne, 0); + if ((gPlayerTwo->type & 0x100) == 0x100) { + func_80022A98(gPlayerTwo, 1); + } + if ((gPlayerThree->type & 0x100) == 0x100) { + func_80022A98(gPlayerThree, 2); + } + break; + case VERSUS: /* switch 1 */ + case BATTLE: /* switch 1 */ + func_80022A98(gPlayerOne, 0); + func_80022A98(gPlayerTwo, 1); + if (gPlayerCountSelection1 >= 3) { + func_80022A98(gPlayerThree, 2); + } + if (gPlayerCountSelection1 == 4) { + func_80022A98(gPlayerFour, 3); + } + break; + } break; - case TIME_TRIALS: /* switch 1 */ - func_80022A98(gPlayerOne, 0); - if ((gPlayerTwo->type & 0x100) == 0x100) { + case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: + case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: + switch (gModeSelection) { /* switch 2; irregular */ + case GRAND_PRIX: /* switch 2 */ + func_80022A98(gPlayerOne, 0); + func_80022A98(gPlayerTwo, 1); + func_80022A98(gPlayerThree, 2); + func_80022A98(gPlayerFour, 3); + func_80022A98(gPlayerFive, 4); + func_80022A98(gPlayerSix, 5); + func_80022A98(gPlayerSeven, 6); + func_80022A98(gPlayerEight, 7); + break; + case VERSUS: /* switch 2 */ + case BATTLE: /* switch 2 */ + func_80022A98(gPlayerOne, 0); + func_80022A98(gPlayerTwo, 1); + break; + case TIME_TRIALS: /* switch 2 */ + func_80022A98(gPlayerOne, 0); + break; + } + break; + case SCREEN_MODE_3P_4P_SPLITSCREEN: + if ((VERSUS == gModeSelection) || (BATTLE == gModeSelection)) { + func_80022A98(gPlayerOne, 0); func_80022A98(gPlayerTwo, 1); - } - if ((gPlayerThree->type & 0x100) == 0x100) { func_80022A98(gPlayerThree, 2); + if (gPlayerCountSelection1 == 4) { + func_80022A98(gPlayerFour, 3); + } } break; - case VERSUS: /* switch 1 */ - case BATTLE: /* switch 1 */ - func_80022A98(gPlayerOne, 0); - func_80022A98(gPlayerTwo, 1); - if (gPlayerCountSelection1 >= 3) { - func_80022A98(gPlayerThree, 2); - } - if (gPlayerCountSelection1 == 4) { - func_80022A98(gPlayerFour, 3); - } - break; - } - break; - case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: - case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - switch (gModeSelection) { /* switch 2; irregular */ - case GRAND_PRIX: /* switch 2 */ - func_80022A98(gPlayerOne, 0); - func_80022A98(gPlayerTwo, 1); - func_80022A98(gPlayerThree, 2); - func_80022A98(gPlayerFour, 3); - func_80022A98(gPlayerFive, 4); - func_80022A98(gPlayerSix, 5); - func_80022A98(gPlayerSeven, 6); - func_80022A98(gPlayerEight, 7); - break; - case VERSUS: /* switch 2 */ - case BATTLE: /* switch 2 */ - func_80022A98(gPlayerOne, 0); - func_80022A98(gPlayerTwo, 1); - break; - case TIME_TRIALS: /* switch 2 */ - func_80022A98(gPlayerOne, 0); - break; - } - break; - case SCREEN_MODE_3P_4P_SPLITSCREEN: - if ((VERSUS == gModeSelection) || (BATTLE == gModeSelection)) { - func_80022A98(gPlayerOne, 0); - func_80022A98(gPlayerTwo, 1); - func_80022A98(gPlayerThree, 2); - if (gPlayerCountSelection1 == 4) { - func_80022A98(gPlayerFour, 3); - } - } - break; } } diff --git a/src/staff_ghosts.c b/src/staff_ghosts.c index 0a471f61b..8c3fef189 100644 --- a/src/staff_ghosts.c +++ b/src/staff_ghosts.c @@ -476,7 +476,7 @@ void func_80005AE8(Player *ply) { } void func_80005B18(void) { - if (gModeSelection == 1) { + if (gModeSelection == TIME_TRIALS) { if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (D_80162DF8 != 1)) { if (D_80162DD4 == 1) { D_80162DD0 = D_80162DCC; @@ -524,7 +524,7 @@ void func_80005B18(void) { if (D_80162DEC >= 0x65) { D_80162DEC = 0x00000064; } - if ((gModeSelection == 1) && (gActiveScreenMode == SCREEN_MODE_1P)) { + if ((gModeSelection == TIME_TRIALS) && (gActiveScreenMode == SCREEN_MODE_1P)) { if ((D_80162DD4 == 0) && (gLapCountByPlayerId[1] != 3)) { func_800057DC(); }