From 9ac748b0d022987fc1137ae4ac7b3a0c42f0ef23 Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sat, 18 Jun 2022 03:49:53 -0600 Subject: [PATCH] Match func in staff_ghosts.c and name menus file (#227) * name some code files * staff ghost func match * Update README.md --- README.md | 7 +- .../{code_800AF9B0 => menus}/func_800AF9E4.s | 0 .../{code_800AF9B0 => menus}/func_800AFC54.s | 0 .../{code_800AF9B0 => menus}/func_800AFE00.s | 0 .../{code_800AF9B0 => menus}/func_800AFF58.s | 0 .../{code_800AF9B0 => menus}/func_800B0004.s | 0 .../{code_800AF9B0 => menus}/func_800B0350.s | 0 .../{code_800AF9B0 => menus}/func_800B053C.s | 0 .../{code_800AF9B0 => menus}/func_800B15AC.s | 0 .../{code_800AF9B0 => menus}/func_800B1C90.s | 0 .../{code_800AF9B0 => menus}/func_800B20F4.s | 0 .../{code_800AF9B0 => menus}/func_800B29D8.s | 0 .../{code_800AF9B0 => menus}/func_800B3554.s | 0 .../{code_800AF9B0 => menus}/func_800B3F74.s | 0 .../{code_800AF9B0 => menus}/func_800B44BC.s | 0 .../{code_800AF9B0 => menus}/func_800B4560.s | 0 .../{code_800AF9B0 => menus}/func_800B492C.s | 0 .../{code_800AF9B0 => menus}/func_800B4A9C.s | 0 .../{code_800AF9B0 => menus}/func_800B4DF4.s | 0 .../{code_800AF9B0 => menus}/func_800B5020.s | 0 .../{code_800AF9B0 => menus}/func_800B5218.s | 0 .../{code_800AF9B0 => menus}/func_800B559C.s | 0 .../{code_800AF9B0 => menus}/func_800B578C.s | 0 .../{code_800AF9B0 => menus}/func_800B5948.s | 0 .../{code_800AF9B0 => menus}/func_800B59F4.s | 0 .../{code_800AF9B0 => menus}/func_800B5B94.s | 0 .../{code_800AF9B0 => menus}/func_800B5DA4.s | 0 .../{code_800AF9B0 => menus}/func_800B6014.s | 0 .../{code_800AF9B0 => menus}/func_800B60E8.s | 0 .../{code_800AF9B0 => menus}/func_800B6178.s | 0 .../{code_800AF9B0 => menus}/func_800B65F4.s | 0 .../{code_800AF9B0 => menus}/func_800B6828.s | 0 .../{code_800AF9B0 => menus}/func_800B68F4.s | 0 .../{code_800AF9B0 => menus}/func_800B69BC.s | 0 .../{code_800AF9B0 => menus}/func_800B6AF8.s | 0 .../staff_ghosts/func_8000599C.s | 97 -------- mk64.ld | 2 +- src/code_80091750.c | 2 +- src/code_80091750.h | 1 + src/main.c | 7 +- src/{code_800AF9B0.c => menus.c} | 72 +++--- src/{code_800AF9B0.h => menus.h} | 6 +- src/staff_ghosts.c | 234 +++++++++--------- 43 files changed, 168 insertions(+), 260 deletions(-) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800AF9E4.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800AFC54.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800AFE00.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800AFF58.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B0004.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B0350.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B053C.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B15AC.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B1C90.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B20F4.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B29D8.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B3554.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B3F74.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B44BC.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B4560.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B492C.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B4A9C.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B4DF4.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B5020.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B5218.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B559C.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B578C.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B5948.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B59F4.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B5B94.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B5DA4.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B6014.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B60E8.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B6178.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B65F4.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B6828.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B68F4.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B69BC.s (100%) rename asm/non_matchings/{code_800AF9B0 => menus}/func_800B6AF8.s (100%) delete mode 100644 asm/non_matchings/staff_ghosts/func_8000599C.s rename src/{code_800AF9B0.c => menus.c} (98%) rename src/{code_800AF9B0.h => menus.h} (98%) diff --git a/README.md b/README.md index e14b52c41..a0000d54c 100644 --- a/README.md +++ b/README.md @@ -98,8 +98,11 @@ Some menu textures are compressed using a format called tkmk00. A byte-matching ## Contributing -Pull requests are welcome. For major changes, please open an issue first to -discuss what you would like to change. +Pull requests are welcome. For major changes, please discuss in the Discord. + +Files needing documentation: +actors.c, actors_extended.c, main.c, kart_dma.c, race_logic.c, render_courses.c, skybox_and_splitscreen.c, staff_ghosts.c. +Any inc.c file. Run `clang-format` on your code to ensure it meets the project's coding standards. diff --git a/asm/non_matchings/code_800AF9B0/func_800AF9E4.s b/asm/non_matchings/menus/func_800AF9E4.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800AF9E4.s rename to asm/non_matchings/menus/func_800AF9E4.s diff --git a/asm/non_matchings/code_800AF9B0/func_800AFC54.s b/asm/non_matchings/menus/func_800AFC54.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800AFC54.s rename to asm/non_matchings/menus/func_800AFC54.s diff --git a/asm/non_matchings/code_800AF9B0/func_800AFE00.s b/asm/non_matchings/menus/func_800AFE00.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800AFE00.s rename to asm/non_matchings/menus/func_800AFE00.s diff --git a/asm/non_matchings/code_800AF9B0/func_800AFF58.s b/asm/non_matchings/menus/func_800AFF58.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800AFF58.s rename to asm/non_matchings/menus/func_800AFF58.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B0004.s b/asm/non_matchings/menus/func_800B0004.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B0004.s rename to asm/non_matchings/menus/func_800B0004.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B0350.s b/asm/non_matchings/menus/func_800B0350.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B0350.s rename to asm/non_matchings/menus/func_800B0350.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B053C.s b/asm/non_matchings/menus/func_800B053C.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B053C.s rename to asm/non_matchings/menus/func_800B053C.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B15AC.s b/asm/non_matchings/menus/func_800B15AC.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B15AC.s rename to asm/non_matchings/menus/func_800B15AC.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B1C90.s b/asm/non_matchings/menus/func_800B1C90.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B1C90.s rename to asm/non_matchings/menus/func_800B1C90.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B20F4.s b/asm/non_matchings/menus/func_800B20F4.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B20F4.s rename to asm/non_matchings/menus/func_800B20F4.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B29D8.s b/asm/non_matchings/menus/func_800B29D8.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B29D8.s rename to asm/non_matchings/menus/func_800B29D8.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B3554.s b/asm/non_matchings/menus/func_800B3554.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B3554.s rename to asm/non_matchings/menus/func_800B3554.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B3F74.s b/asm/non_matchings/menus/func_800B3F74.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B3F74.s rename to asm/non_matchings/menus/func_800B3F74.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B44BC.s b/asm/non_matchings/menus/func_800B44BC.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B44BC.s rename to asm/non_matchings/menus/func_800B44BC.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B4560.s b/asm/non_matchings/menus/func_800B4560.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B4560.s rename to asm/non_matchings/menus/func_800B4560.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B492C.s b/asm/non_matchings/menus/func_800B492C.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B492C.s rename to asm/non_matchings/menus/func_800B492C.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B4A9C.s b/asm/non_matchings/menus/func_800B4A9C.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B4A9C.s rename to asm/non_matchings/menus/func_800B4A9C.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B4DF4.s b/asm/non_matchings/menus/func_800B4DF4.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B4DF4.s rename to asm/non_matchings/menus/func_800B4DF4.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B5020.s b/asm/non_matchings/menus/func_800B5020.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B5020.s rename to asm/non_matchings/menus/func_800B5020.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B5218.s b/asm/non_matchings/menus/func_800B5218.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B5218.s rename to asm/non_matchings/menus/func_800B5218.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B559C.s b/asm/non_matchings/menus/func_800B559C.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B559C.s rename to asm/non_matchings/menus/func_800B559C.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B578C.s b/asm/non_matchings/menus/func_800B578C.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B578C.s rename to asm/non_matchings/menus/func_800B578C.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B5948.s b/asm/non_matchings/menus/func_800B5948.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B5948.s rename to asm/non_matchings/menus/func_800B5948.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B59F4.s b/asm/non_matchings/menus/func_800B59F4.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B59F4.s rename to asm/non_matchings/menus/func_800B59F4.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B5B94.s b/asm/non_matchings/menus/func_800B5B94.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B5B94.s rename to asm/non_matchings/menus/func_800B5B94.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B5DA4.s b/asm/non_matchings/menus/func_800B5DA4.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B5DA4.s rename to asm/non_matchings/menus/func_800B5DA4.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B6014.s b/asm/non_matchings/menus/func_800B6014.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B6014.s rename to asm/non_matchings/menus/func_800B6014.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B60E8.s b/asm/non_matchings/menus/func_800B60E8.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B60E8.s rename to asm/non_matchings/menus/func_800B60E8.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B6178.s b/asm/non_matchings/menus/func_800B6178.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B6178.s rename to asm/non_matchings/menus/func_800B6178.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B65F4.s b/asm/non_matchings/menus/func_800B65F4.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B65F4.s rename to asm/non_matchings/menus/func_800B65F4.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B6828.s b/asm/non_matchings/menus/func_800B6828.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B6828.s rename to asm/non_matchings/menus/func_800B6828.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B68F4.s b/asm/non_matchings/menus/func_800B68F4.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B68F4.s rename to asm/non_matchings/menus/func_800B68F4.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B69BC.s b/asm/non_matchings/menus/func_800B69BC.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B69BC.s rename to asm/non_matchings/menus/func_800B69BC.s diff --git a/asm/non_matchings/code_800AF9B0/func_800B6AF8.s b/asm/non_matchings/menus/func_800B6AF8.s similarity index 100% rename from asm/non_matchings/code_800AF9B0/func_800B6AF8.s rename to asm/non_matchings/menus/func_800B6AF8.s diff --git a/asm/non_matchings/staff_ghosts/func_8000599C.s b/asm/non_matchings/staff_ghosts/func_8000599C.s deleted file mode 100644 index 7a25b95ba..000000000 --- a/asm/non_matchings/staff_ghosts/func_8000599C.s +++ /dev/null @@ -1,97 +0,0 @@ -glabel func_8000599C -/* 00659C 8000599C 3C098016 */ lui $t1, %hi(D_80162DB8) # $t1, 0x8016 -/* 0065A0 800059A0 25292DB8 */ addiu $t1, %lo(D_80162DB8) # addiu $t1, $t1, 0x2db8 -/* 0065A4 800059A4 85220000 */ lh $v0, ($t1) -/* 0065A8 800059A8 3C0E800E */ lui $t6, %hi(gPlayerOne) # $t6, 0x800e -/* 0065AC 800059AC 24190001 */ li $t9, 1 -/* 0065B0 800059B0 28411000 */ slti $at, $v0, 0x1000 -/* 0065B4 800059B4 10200008 */ beqz $at, .L800059D8 -/* 0065B8 800059B8 00000000 */ nop -/* 0065BC 800059BC 8DCEC4DC */ lw $t6, %lo(gPlayerOne)($t6) -/* 0065C0 800059C0 85C300CA */ lh $v1, 0xca($t6) -/* 0065C4 800059C4 306F0002 */ andi $t7, $v1, 2 -/* 0065C8 800059C8 15E00003 */ bnez $t7, .L800059D8 -/* 0065CC 800059CC 30780008 */ andi $t8, $v1, 8 -/* 0065D0 800059D0 13000004 */ beqz $t8, .L800059E4 -/* 0065D4 800059D4 3C04800E */ lui $a0, %hi(gControllerOne) # 0x800e -.L800059D8: -/* 0065D8 800059D8 3C018016 */ lui $at, %hi(D_80162DF8) # 0x8016 -/* 0065DC 800059DC 03E00008 */ jr $ra -/* 0065E0 800059E0 AC392DF8 */ sw $t9, %lo(D_80162DF8)($at) # 0x2df8($at) - -.L800059E4: -/* 0065E4 800059E4 8C84C4BC */ lw $a0, %lo(gControllerOne)($a0) # -0x3b44($a0) -/* 0065E8 800059E8 00003825 */ move $a3, $zero -/* 0065EC 800059EC 00026080 */ sll $t4, $v0, 2 -/* 0065F0 800059F0 84830000 */ lh $v1, ($a0) -/* 0065F4 800059F4 84850002 */ lh $a1, 2($a0) -/* 0065F8 800059F8 84860004 */ lh $a2, 4($a0) -/* 0065FC 800059FC 306A00FF */ andi $t2, $v1, 0xff -/* 006600 80005A00 30AB00FF */ andi $t3, $a1, 0xff -/* 006604 80005A04 30CD8000 */ andi $t5, $a2, 0x8000 -/* 006608 80005A08 01401825 */ move $v1, $t2 -/* 00660C 80005A0C 11A00002 */ beqz $t5, .L80005A18 -/* 006610 80005A10 000B2A00 */ sll $a1, $t3, 8 -/* 006614 80005A14 3C078000 */ lui $a3, 0x8000 -.L80005A18: -/* 006618 80005A18 30CE4000 */ andi $t6, $a2, 0x4000 -/* 00661C 80005A1C 11C00004 */ beqz $t6, .L80005A30 -/* 006620 80005A20 30D82000 */ andi $t8, $a2, 0x2000 -/* 006624 80005A24 3C014000 */ lui $at, 0x4000 -/* 006628 80005A28 00E17825 */ or $t7, $a3, $at -/* 00662C 80005A2C 01E03825 */ move $a3, $t7 -.L80005A30: -/* 006630 80005A30 13000004 */ beqz $t8, .L80005A44 -/* 006634 80005A34 30CA0010 */ andi $t2, $a2, 0x10 -/* 006638 80005A38 3C012000 */ lui $at, 0x2000 -/* 00663C 80005A3C 00E1C825 */ or $t9, $a3, $at -/* 006640 80005A40 03203825 */ move $a3, $t9 -.L80005A44: -/* 006644 80005A44 11400004 */ beqz $t2, .L80005A58 -/* 006648 80005A48 3C068016 */ lui $a2, %hi(D_80162DBC) # $a2, 0x8016 -/* 00664C 80005A4C 3C011000 */ lui $at, 0x1000 -/* 006650 80005A50 00E15825 */ or $t3, $a3, $at -/* 006654 80005A54 01603825 */ move $a3, $t3 -.L80005A58: -/* 006658 80005A58 8CC62DBC */ lw $a2, %lo(D_80162DBC)($a2) -/* 00665C 80005A5C 00E33825 */ or $a3, $a3, $v1 -/* 006660 80005A60 2401FFFF */ li $at, -1 -/* 006664 80005A64 8CCD0000 */ lw $t5, ($a2) -/* 006668 80005A68 00CC4021 */ addu $t0, $a2, $t4 -/* 00666C 80005A6C 00E53825 */ or $a3, $a3, $a1 -/* 006670 80005A70 15A10003 */ bne $t5, $at, .L80005A80 -/* 006674 80005A74 8D040000 */ lw $a0, ($t0) -/* 006678 80005A78 03E00008 */ jr $ra -/* 00667C 80005A7C AD070000 */ sw $a3, ($t0) - -.L80005A80: -/* 006680 80005A80 3C01FF00 */ lui $at, (0xFF00FFFF >> 16) # lui $at, 0xff00 -/* 006684 80005A84 3421FFFF */ ori $at, (0xFF00FFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 006688 80005A88 00817024 */ and $t6, $a0, $at -/* 00668C 80005A8C 15C7000F */ bne $t6, $a3, .L80005ACC -/* 006690 80005A90 244C0001 */ addiu $t4, $v0, 1 -/* 006694 80005A94 3C0300FF */ lui $v1, 0xff -/* 006698 80005A98 00837824 */ and $t7, $a0, $v1 -/* 00669C 80005A9C 146F0007 */ bne $v1, $t7, .L80005ABC -/* 0066A0 80005AA0 24580001 */ addiu $t8, $v0, 1 -/* 0066A4 80005AA4 A5380000 */ sh $t8, ($t1) -/* 0066A8 80005AA8 85390000 */ lh $t9, ($t1) -/* 0066AC 80005AAC 00195080 */ sll $t2, $t9, 2 -/* 0066B0 80005AB0 00CA5821 */ addu $t3, $a2, $t2 -/* 0066B4 80005AB4 03E00008 */ jr $ra -/* 0066B8 80005AB8 AD670000 */ sw $a3, ($t3) - -.L80005ABC: -/* 0066BC 80005ABC 3C010001 */ lui $at, 1 -/* 0066C0 80005AC0 00812021 */ addu $a0, $a0, $at -/* 0066C4 80005AC4 03E00008 */ jr $ra -/* 0066C8 80005AC8 AD040000 */ sw $a0, ($t0) - -.L80005ACC: -/* 0066CC 80005ACC A52C0000 */ sh $t4, ($t1) -/* 0066D0 80005AD0 852D0000 */ lh $t5, ($t1) -/* 0066D4 80005AD4 000D7080 */ sll $t6, $t5, 2 -/* 0066D8 80005AD8 00CE7821 */ addu $t7, $a2, $t6 -/* 0066DC 80005ADC ADE70000 */ sw $a3, ($t7) -/* 0066E0 80005AE0 03E00008 */ jr $ra -/* 0066E4 80005AE4 00000000 */ nop diff --git a/mk64.ld b/mk64.ld index 58f1f950c..03253ce7b 100644 --- a/mk64.ld +++ b/mk64.ld @@ -87,7 +87,7 @@ SECTIONS BUILD_DIR/src/code_80086E70.o(.text); BUILD_DIR/src/code_8008C1D0.o(.text); BUILD_DIR/src/code_80091750.o(.text); - BUILD_DIR/src/code_800AF9B0.o(.text); + BUILD_DIR/src/menus.o(.text); BUILD_DIR/src/audio/synthesis.o(.text); BUILD_DIR/src/audio/heap.o(.text); BUILD_DIR/src/audio/load.o(.text); diff --git a/src/code_80091750.c b/src/code_80091750.c index 3e68a3872..cf438fbd3 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -2,7 +2,7 @@ #include #include #include "code_80091750.h" -#include "code_800AF9B0.h" +#include "menus.h" #include "credits_01.h" #include "data_segment2.h" #include "variables.h" diff --git a/src/code_80091750.h b/src/code_80091750.h index fd1582b7e..b18533bb6 100644 --- a/src/code_80091750.h +++ b/src/code_80091750.h @@ -135,6 +135,7 @@ Gfx *func_8009C434(Gfx*, struct_8018DEE0_entry*, s32, s32, s32); Gfx *func_8009C708(Gfx*, struct_8018DEE0_entry *, s32, s32, s32, s32); void func_8009C918(); void func_8009E1C0(); +void func_8009E1E4(); void func_8009E208(); void func_8009E258(); void func_8009E5BC(); diff --git a/src/main.c b/src/main.c index 8231017db..ae40b4e9c 100644 --- a/src/main.c +++ b/src/main.c @@ -50,9 +50,6 @@ struct Controller *gControllerFive = &gControllers[4]; // 0x800DC4CC struct Controller *gControllerSix = &gControllers[5]; // 0x800DC4D0 struct Controller *gControllerSeven = &gControllers[6]; // 0x800DC4D4 struct Controller *gControllerEight = &gControllers[7]; // 0x800DC4D8 -//Player shift[1]; -//Player *shifting = &shift[0]; - Player gPlayers[8]; Player *gPlayerOne = &gPlayers[0]; // 0x800DC4DC @@ -66,8 +63,8 @@ Player *gPlayerEight = &gPlayers[7]; // 0x800DC4F8 Player *gPlayerOneCopy = &gPlayers[0]; // 0x800DC4FC Player *gPlayerTwoCopy = &gPlayers[1]; // 0x800DC500 -Player *gPlayerThreeCopy = &gPlayers[2]; // 0x800DC504 -Player *gPlayerFourCopy = &gPlayers[3]; // 0x800DC508 +UNUSED Player *gPlayerThreeCopy = &gPlayers[2]; // 0x800DC504 +UNUSED Player *gPlayerFourCopy = &gPlayers[3]; // 0x800DC508 s32 D_800FD850[3]; struct GfxPool gGfxPools[2]; diff --git a/src/code_800AF9B0.c b/src/menus.c similarity index 98% rename from src/code_800AF9B0.c rename to src/menus.c index 5d4b81183..2b043c1a7 100644 --- a/src/code_800AF9B0.c +++ b/src/menus.c @@ -4,7 +4,7 @@ #include "global.h" #include "code_80091750.h" -#include "code_800AF9B0.h" +#include "menus.h" void func_800AF9B0(void) { D_8018EDB8 = func_802A7B70(7680); @@ -96,7 +96,7 @@ void func_800AF9E4(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s16 arg4, s16 arg5, s temp_a3_5->unk0 = 0xBF000000; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800AF9E4.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800AF9E4.s") #endif #ifdef MIPS_TO_C @@ -168,7 +168,7 @@ void func_800AFC54(s32 arg0, s32 arg1, s32 arg2, s32 arg3, void *arg4) { arg4->unk4 = temp_f18 * temp_f2 * 120.0f; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800AFC54.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800AFC54.s") #endif #ifdef MIPS_TO_C @@ -240,7 +240,7 @@ void func_800AFE00(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { } while (temp_v1 != 0x1E0); } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800AFE00.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800AFE00.s") #endif #ifdef MIPS_TO_C @@ -276,7 +276,7 @@ void func_800AFF58(s32 arg0) { } while (temp_s0 != 0xC); } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800AFF58.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800AFF58.s") #endif #ifdef MIPS_TO_C @@ -388,7 +388,7 @@ loop_5: temp_v0_4->unk0 = 0xB6000000; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B0004.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B0004.s") #endif @@ -449,7 +449,7 @@ void func_800B0350(void) { } } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B0350.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B0350.s") #endif #ifdef MIPS_TO_C @@ -1005,7 +1005,7 @@ void func_800B053C(struct Controller *arg0, u16 arg1) { } } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B053C.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B053C.s") #endif // Handle navigating the data menu interface @@ -1322,7 +1322,7 @@ void func_800B15AC(struct Controller *arg0, u16 arg1) { } } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B15AC.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B15AC.s") #endif // Handle controller input during the logo screen @@ -1478,7 +1478,7 @@ void func_800B1C90(struct Controller* controller, u16 arg1) { } } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B1C90.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B1C90.s") #endif #ifdef MIPS_TO_C @@ -1765,7 +1765,7 @@ void func_800B20F4(void *arg0, s32 arg1) { } } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B20F4.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B20F4.s") #endif void func_800B28C8(void) { @@ -2157,7 +2157,7 @@ block_64: } } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B29D8.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B29D8.s") #endif s32 func_800B34E8(s32 arg0) { @@ -2180,7 +2180,7 @@ Please modify the assembly to work around it (e.g. copy the instruction to all jump sources and move the label, or add a nop to the delay slot). */ #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B3554.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B3554.s") #endif // Handle navigating the course menu interface @@ -2560,7 +2560,7 @@ void func_800B3F74(u32 arg0) { func_800B44AC(); } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B3F74.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B3F74.s") #endif void func_800B44AC(void) { @@ -2582,7 +2582,7 @@ void func_800B44BC(void) { } } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B44BC.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B44BC.s") #endif s32 func_800B4520(void) { @@ -2603,7 +2603,7 @@ extern s32 D_80162DE0; extern s32 D_8018D9C0; extern ? D_8018EE16; -// Separated from assembly in code_800AF9B0/func_800B4520.s +// Separated from assembly in menus/func_800B4520.s UNUSED void func_800B4560(s32 arg0, s32 arg1) { s32 sp18; @@ -2613,7 +2613,7 @@ UNUSED void func_800B4560(s32 arg0, s32 arg1) { rmonPrintf(&D_800F2C0C, (s32) ((arg1 << 7) + sp18)->unk6); } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B4560.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B4560.s") #endif void func_800B45E0(s32 arg0) { @@ -2720,7 +2720,7 @@ s32 compute_save_data_checksum_1(void) { return ((D_8018ED10.grandPrixPointsMushroomCup + 1 + ((temp_a0->unk0 + 1) * 2) + 1 + ((temp_a0->unk1 + 1) * 3) + 1 + 1 + ((temp_a0->unk2 + 1) * 4) + 1 + 2 + ((temp_a0->unk3 + 1) * 5) + 1 + 3) % 0x100) & 0xFF; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B492C.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B492C.s") #endif s32 compute_save_data_checksum_2(void) { @@ -2822,7 +2822,7 @@ void func_800B4A9C(s32 arg0) { } } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B4A9C.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B4A9C.s") #endif void validate_save_data(void) { @@ -2885,7 +2885,7 @@ s32 func_800B4DF4(u8 *arg0) { return ((arg0[1] << 8) + arg0[0] + (arg0[2] << 0x10)) & 0xFFFFFF; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B4DF4.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B4DF4.s") #endif // Get a time trial record, infer course index @@ -3033,7 +3033,7 @@ block_10: return phi_s1_2; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B5020.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B5020.s") #endif #ifdef MIPS_TO_C @@ -3102,7 +3102,7 @@ s32 func_800B5218(void) { return phi_v0_2; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B5218.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B5218.s") #endif void func_800B536C(s32 arg0) { @@ -3276,7 +3276,7 @@ void func_800B559C(s32 arg0, void *arg1, void *arg2) { osEepromLongWrite(&gSIEventMesgQueue, ((temp_s2_2 - &D_8018EB90) >> 3) & 0xFF, temp_s2_2, 0x38); } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B559C.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B559C.s") #endif #ifdef MIPS_TO_C @@ -3325,7 +3325,7 @@ loop_2: return (temp_v1 % 0x100) & 0xFF; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B578C.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B578C.s") #endif s32 func_800B5888(s32 arg0) { @@ -3379,7 +3379,7 @@ void update_save_data_backup(void) { osEepromLongWrite(&gSIEventMesgQueue, ((&D_8018ED88 - &D_8018EB90) >> 3) & 0xFF, &D_8018ED88, 8); } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B5948.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B5948.s") #endif #ifdef MIPS_TO_C @@ -3393,7 +3393,7 @@ s32 compute_save_data_checksum_backup_1(void) { return ((D_8018ED88.grandPrixPointsMushroomCup + 1 + ((temp_a0->unk0 + 1) * 2) + 1 + ((temp_a0->unk1 + 1) * 3) + 1 + 1 + ((temp_a0->unk2 + 1) * 4) + 1 + 2 + ((temp_a0->unk3 + 1) * 5) + 1 + 3) % 0x100) & 0xFF; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B59F4.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B59F4.s") #endif s32 compute_save_data_checksum_backup_2(void) { @@ -3519,7 +3519,7 @@ block_27: return phi_v0_2; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B5B94.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B5B94.s") #endif #ifdef MIPS_TO_C @@ -3604,7 +3604,7 @@ block_25: return phi_v0_2; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B5DA4.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B5DA4.s") #endif s32 func_800B5F30(void) { @@ -3682,7 +3682,7 @@ s32 func_800B60E8(s32 arg0) { return temp_v1 & 0xFF; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B60E8.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B60E8.s") #endif #ifdef MIPS_TO_C @@ -3782,7 +3782,7 @@ s32 func_800B6178(s32 arg0) { return phi_v1; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B6178.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B6178.s") #endif s32 func_800B6348(s32 arg0) { @@ -3924,7 +3924,7 @@ block_9: return sp34; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B65F4.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B65F4.s") #endif void func_800B6708(void) { @@ -3985,7 +3985,7 @@ s32 func_800B6828(s32 arg0) { return temp_v1 & 0xFF; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B6828.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B6828.s") #endif #ifdef MIPS_TO_C @@ -4015,7 +4015,7 @@ s32 func_800B68F4(s32 arg0) { return temp_a1 & 0xFF; } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B68F4.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B68F4.s") #endif #ifdef MIPS_TO_C @@ -4056,7 +4056,7 @@ void func_800B69BC(s32 arg0) { osPfsReadWriteFile(&D_8018E868, D_8018EB84, 1, temp_a3, 0x80, temp_t0); } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B69BC.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B69BC.s") #endif s32 func_800B6A68(void) { @@ -4096,7 +4096,7 @@ extern ? D_8018EB84; extern s32 gControllerPakNumPagesFree; extern ? gSIEventMesgQueue; -// Separated from assembly in code_800AF9B0/func_800B6A68.s +// Separated from assembly in menus/func_800B6A68.s UNUSED void func_800B6AF8(void) { s32 temp_t1; @@ -4109,5 +4109,5 @@ UNUSED void func_800B6AF8(void) { } } #else -GLOBAL_ASM("asm/non_matchings/code_800AF9B0/func_800B6AF8.s") +GLOBAL_ASM("asm/non_matchings/menus/func_800B6AF8.s") #endif diff --git a/src/code_800AF9B0.h b/src/menus.h similarity index 98% rename from src/code_800AF9B0.h rename to src/menus.h index 192d80ee9..6d5d97a5e 100644 --- a/src/code_800AF9B0.h +++ b/src/menus.h @@ -1,5 +1,5 @@ -#ifndef CODE_800AF9B0_H -#define CODE_800AF9B0_H +#ifndef MENUS_H +#define MENUS_H #include "PR/os.h" #include "common_structs.h" @@ -152,4 +152,4 @@ extern s8 D_8018EE0A; extern s8 gCupCourseSelection; // D_8018EE0B extern struct_8018EE10_entry D_8018EE10[]; -#endif +#endif // MENUS_H diff --git a/src/staff_ghosts.c b/src/staff_ghosts.c index cd65ab00f..731306c51 100644 --- a/src/staff_ghosts.c +++ b/src/staff_ghosts.c @@ -52,8 +52,8 @@ s32 D_80162DFC; s32 D_80162E00; extern u8 D_802BFB80[77824]; -extern u8 D_802D2B80[32768]; -extern u8 D_802DAB80[20480]; +extern u8 *D_802D2B80[32768]; +extern u8 *D_802DAB80[20480]; u32 *D_800DC710 = &D_802D2B80[0]; u32 *D_800DC714 = &D_802DAB80[0]; @@ -222,7 +222,7 @@ void func_80005310(void) { D_80162DD8 = 1U; D_80162DBC = &D_802BFB80[(D_80162DCC << 0xF) + 0x3000]; - D_80162DBC[0] = -1; + *D_80162DBC = 0xFFFFFFFF; D_80162DB8 = 0; D_80162DDC = 0; func_80091EE4(&D_80162DC0); @@ -411,67 +411,69 @@ void func_800057DC(void) { D_80162D8C += (s32) 0xFFFF0000; } } -/* + void func_8000599C(void) { s16 temp_a2; - - u32 temp_v0; + u32 phi_a3; u32 temp_v1; u32 temp_v2; - u32 *temp_t0; + s16 new_var; + u32 temp_v0; + u32 temp_t0; u32 temp_a0_2; - u32 temp_a3; - u32 phi_a3; - if (D_80162DB8 >= 0x1000) { + if (((D_80162DB8 >= 0x1000) || + ((gPlayerOne->unk_0CA & 2) != 0)) || + ((gPlayerOne->unk_0CA & 8) != 0)) { D_80162DF8 = 1; return; } - temp_v1 &= 0xff; - temp_v2 &= 0xff << 8; - //temp_v1 = gPlayerOne->unk_0CA; - - //if (((temp_v1 & 2) != 0) || ((temp_v1 & 8) != 0)) { - - //} + temp_v1 = gControllerOne->rawStickX; + temp_v1 &= 0xFF; + temp_v2 = gControllerOne->rawStickY; + temp_v2 = (temp_v2 & 0xFF) << 8; temp_a2 = gControllerOne->button; phi_a3 = 0; - if (temp_a2 & A_BUTTON) { + if (temp_a2 & 0x8000) { phi_a3 |= 0x80000000; - } - if (temp_a2 & B_BUTTON) { + } if (temp_a2 & 0x4000) { phi_a3 |= 0x40000000; } - if (temp_a2 & Z_TRIG) { + if (temp_a2 & 0x2000) { phi_a3 |= 0x20000000; } - if (temp_a2 & R_TRIG) { + if (temp_a2 & 0x0010) { phi_a3 |= 0x10000000; } phi_a3 |= temp_v1; phi_a3 |= temp_v2; - temp_v0 = (gControllerOne->rawStickY & 0xFF) << 8; - temp_a3 = phi_a3 | (gControllerOne->rawStickX & 0xFF) | temp_v0; - temp_a0_2 = &D_80162DBC[D_80162DB8];; - if (*D_80162DBC == -1) { - *temp_t0 = temp_a3; - } else { - if ((temp_a0_2 & 0xFF00FFFF) == temp_a3) { - if ((temp_a0_2 & 0xFF0000) == 0xFF0000) { - D_80162DB8++; - D_80162DBC[D_80162DB8] = temp_a3; - } else { - *temp_t0 += 0x10000; - } - } else { + temp_t0 = D_80162DBC[D_80162DB8]; + temp_a0_2 = temp_t0 & 0xFF00FFFF; + + if ((*D_80162DBC) == 0xFFFFFFFF) { + + D_80162DBC[D_80162DB8] = phi_a3; + + } else if (temp_a0_2 == phi_a3) { + + temp_v0 = temp_t0 & 0xFF0000; + + if (temp_v0 == 0xFF0000) { + D_80162DB8++; - D_80162DBC[D_80162DB8] = temp_a3; + D_80162DBC[D_80162DB8] = phi_a3; + + } else { + + temp_t0 += 0x10000; + D_80162DBC[D_80162DB8] = temp_t0; + } + } else { + D_80162DB8++; D_80162DBC[D_80162DB8] = phi_a3; } } -*/ -GLOBAL_ASM("asm/non_matchings/staff_ghosts/func_8000599C.s") // sets player to AI? (unconfirmed) void func_80005AE8(Player *ply) { @@ -482,84 +484,86 @@ void func_80005AE8(Player *ply) { #ifdef NON_MATCHING -void func_80005B18(void) { - s16 *temp_v0_2; - s16 *temp_v0_3; - s32 temp_v0; - u16 *phi_a3; - - if (gModeSelection == TIME_TRIALS) { - temp_v0 = gLapCountByPlayerId[0]; - //phi_a3 = &D_80162DD4; - if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && D_80162DF8 != 1) { - //if (D_80162DF8 != 1) { - - if (D_80162DD4 == 1) { - D_80162DD0 = D_80162DCC; - func_800052A4(); //gModeSelection, &D_80162DDC, 3, &D_80162DD4); - D_80162DD4 = 0; - D_80162DDC = 1; - D_80162DE0 = gPlayerOne->characterId; - D_80162DE8 = gPlayerOne->characterId; - D_80162E00 = 0; - D_80162DFC = D_8018CA78; - func_80005AE8(gPlayerTwo); // (u16) &D_80162DDC); - func_80005AE8(gPlayerThree); - - } else { - if (gLapCountByPlayerId[4] != 3) { - D_80162DD0 = D_80162DCC; - func_800052A4(); // gModeSelection, &D_80162DDC, 3, &D_80162DD4); - D_80162DDC = 1; - D_80162DE0 = gPlayerOne->characterId; - D_80162DFC = D_8018CA78; - D_80162E00 = 0; - D_80162DE8 = gPlayerOne->characterId; - func_80005AE8(gPlayerTwo); // (u16) &D_80162DDC); - func_80005AE8(gPlayerThree); - return; - - } - } - D_80162D80 = (void *) ((D_80162DC8 << 0xF) + 0x3000 + &D_802BFB80); - D_80162D84 = D_80162D86; - D_80162DD0 = D_80162DCC; - D_80162DE8 = gPlayerOne->characterId; - D_80162DD8 = 0; - D_80162DD4 = 0; - D_80162DDC = 1; - func_80005AE8(gPlayerTwo); // (u16) &D_80162DDC, 3, &D_80162DD4); - func_80005AE8(gPlayerThree); - - - return; - } - if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (D_80162DF8 == 1)) { - D_80162D80 = (void *) ((D_80162DC8 << 0xF) + 0x3000 + &D_802BFB80); - D_80162D84 = D_80162D86; - D_80162DDC = 1; - } - if (( gPlayerOne->unk_000 & PLAYER_CINEMATIC_MODE) == PLAYER_CINEMATIC_MODE) { - func_80005AE8(gPlayerTwo); // (u16) &D_80162DDC, 3, phi_a3); - func_80005AE8(gPlayerThree); - return; - }; - D_80162DEC++; - if (D_80162DEC > 100) { - D_80162DEC = 100; - } - if ((gModeSelection == TIME_TRIALS) && (gActiveScreenMode == 0)) { - if ((D_80162DD4 == 0) && (gLapCountByPlayerId[4] != 3)) { - func_800057DC(); //gModeSelection, &D_80162DDC, 3, &D_80162DD4); - } - if ((D_80162DD6 == 0) && (3 != gLapCountByPlayerId[8])) { - func_8000561C(); - } - if (( gPlayerOne->unk_000 & PLAYER_CINEMATIC_MODE) == 0) { - func_8000599C(); - } +void func_80005B18(void) +{ + if (gModeSelection == 1) + { + if (((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0)) && (D_80162DF8 != 1)) + { + if (D_80162DD4 == (u16)1) + { + D_80162DD0 = D_80162DCC; + func_800052A4(); + D_80162DD4 = 0; + D_80162DDC = 1; + D_80162DE0 = gPlayerOne->characterId; + D_80162DE8 = gPlayerOne->characterId; + D_80162E00 = 0; + D_80162DFC = D_8018CA78; + func_80005AE8(gPlayerTwo); + func_80005AE8(gPlayerThree); + } + else + { + if (gLapCountByPlayerId[4] != 3) + { + D_80162DD0 = D_80162DCC; + func_800052A4(); + D_80162DDC = 1; + D_80162DE0 = gPlayerOne->characterId; + D_80162DFC = D_8018CA78; + D_80162E00 = 0; + D_80162DE8 = gPlayerOne->characterId; + func_80005AE8(gPlayerTwo); + func_80005AE8(gPlayerThree); + return; } + } + D_80162D80 = &D_802BFB80[(D_80162DC8 << 0xF) + 0x3000]; + D_80162D84 = D_80162D86; + D_80162DD0 = D_80162DCC; + D_80162DE8 = gPlayerOne->characterId; + D_80162DD8 = 0; + D_80162DD4 = 0; + D_80162DDC = 1; + func_80005AE8(gPlayerTwo); + func_80005AE8(gPlayerThree); + return; } + if (((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0)) && (D_80162DF8 == 1)) + { + D_80162D80 = &D_802BFB80[(D_80162DC8 << 0xF) + 0x3000]; + D_80162D84 = D_80162D86; + D_80162DDC = 1; + } + if ((gPlayerOne->unk_000 & 0x800) == 0x800) + { + func_80005AE8(gPlayerTwo); + func_80005AE8(gPlayerThree); + return; + } + ; + D_80162DEC++; + if (D_80162DEC > 100) + { + D_80162DEC = 100; + } + if ((gModeSelection == 1) && (gActiveScreenMode == 0)) + { + if ((D_80162DD4 == 0) && (gLapCountByPlayerId[1] != 3)) + { + func_800057DC(); + } + if ((D_80162DD6 == 0) && (3 != gLapCountByPlayerId[8])) + { + func_8000561C(); + } + if ((gPlayerOne->unk_000 & (1 << 11)) == 0) + { + func_8000599C(); + } + } + } } #else