From 3e3561bbf1f01a74a2ce92ae2a8749c864056792 Mon Sep 17 00:00:00 2001 From: Tyler McGavran Date: Sun, 25 Dec 2022 20:56:35 -0500 Subject: [PATCH] Couple small matches and m2c refreshing (#282) * Moved stuff into header files to make m2c_helper a more useful Signed-off-by: Taggerung --- .../code_80091750/func_800A90D4.s | 68 - asm/non_matchings/menus/options_menu_act.s | 1056 ------- src/audio/external.c | 39 +- src/audio/external.h | 28 +- src/code_800029B0.h | 4 - src/code_80071F00.h | 1 - src/code_80086E70.c | 13 +- src/code_8008C1D0.c | 34 +- src/code_80091750.c | 2791 +++++++---------- src/code_80091750.h | 39 +- src/code_800B45E0.c | 422 ++- src/code_80280650.c | 59 +- src/memory.c | 84 +- src/menus.c | 85 +- src/menus.h | 22 +- 15 files changed, 1519 insertions(+), 3226 deletions(-) delete mode 100644 asm/non_matchings/code_80091750/func_800A90D4.s delete mode 100644 asm/non_matchings/menus/options_menu_act.s diff --git a/asm/non_matchings/code_80091750/func_800A90D4.s b/asm/non_matchings/code_80091750/func_800A90D4.s deleted file mode 100644 index 9575fa0bc..000000000 --- a/asm/non_matchings/code_80091750/func_800A90D4.s +++ /dev/null @@ -1,68 +0,0 @@ -glabel func_800A90D4 -/* 0A9CD4 800A90D4 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0A9CD8 800A90D8 AFBF002C */ sw $ra, 0x2c($sp) -/* 0A9CDC 800A90DC AFA40030 */ sw $a0, 0x30($sp) -/* 0A9CE0 800A90E0 AFA50034 */ sw $a1, 0x34($sp) -/* 0A9CE4 800A90E4 8CAD001C */ lw $t5, 0x1c($a1) -/* 0A9CE8 800A90E8 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015 -/* 0A9CEC 800A90EC 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 -/* 0A9CF0 800A90F0 29A10020 */ slti $at, $t5, 0x20 -/* 0A9CF4 800A90F4 10200034 */ beqz $at, .L800A91C8 -/* 0A9CF8 800A90F8 000D4180 */ sll $t0, $t5, 6 -/* 0A9CFC 800A90FC 8FB80034 */ lw $t8, 0x34($sp) -/* 0A9D00 800A9100 8C620000 */ lw $v0, ($v1) -/* 0A9D04 800A9104 010D4021 */ addu $t0, $t0, $t5 -/* 0A9D08 800A9108 8F09000C */ lw $t1, 0xc($t8) -/* 0A9D0C 800A910C 8F060010 */ lw $a2, 0x10($t8) -/* 0A9D10 800A9110 24590008 */ addiu $t9, $v0, 8 -/* 0A9D14 800A9114 AC790000 */ sw $t9, ($v1) -/* 0A9D18 800A9118 3C0EE700 */ lui $t6, 0xe700 -/* 0A9D1C 800A911C AC4E0000 */ sw $t6, ($v0) -/* 0A9D20 800A9120 AC400004 */ sw $zero, 4($v0) -/* 0A9D24 800A9124 8C620000 */ lw $v0, ($v1) -/* 0A9D28 800A9128 05010003 */ bgez $t0, .L800A9138 -/* 0A9D2C 800A912C 00087983 */ sra $t7, $t0, 6 -/* 0A9D30 800A9130 2501003F */ addiu $at, $t0, 0x3f -/* 0A9D34 800A9134 00017983 */ sra $t7, $at, 6 -.L800A9138: -/* 0A9D38 800A9138 01E04025 */ move $t0, $t7 -/* 0A9D3C 800A913C 244F0008 */ addiu $t7, $v0, 8 -/* 0A9D40 800A9140 AC6F0000 */ sw $t7, ($v1) -/* 0A9D44 800A9144 3C190F0A */ lui $t9, (0x0F0A4000 >> 16) # lui $t9, 0xf0a -/* 0A9D48 800A9148 3C18B900 */ lui $t8, (0xB900031D >> 16) # lui $t8, 0xb900 -/* 0A9D4C 800A914C 3718031D */ ori $t8, (0xB900031D & 0xFFFF) # ori $t8, $t8, 0x31d -/* 0A9D50 800A9150 37394000 */ ori $t9, (0x0F0A4000 & 0xFFFF) # ori $t9, $t9, 0x4000 -/* 0A9D54 800A9154 AC590004 */ sw $t9, 4($v0) -/* 0A9D58 800A9158 AC580000 */ sw $t8, ($v0) -/* 0A9D5C 800A915C 8C620000 */ lw $v0, ($v1) -/* 0A9D60 800A9160 3C18FFFC */ lui $t8, (0xFFFCF279 >> 16) # lui $t8, 0xfffc -/* 0A9D64 800A9164 3C0FFCFF */ lui $t7, (0xFCFFFFFF >> 16) # lui $t7, 0xfcff -/* 0A9D68 800A9168 244E0008 */ addiu $t6, $v0, 8 -/* 0A9D6C 800A916C AC6E0000 */ sw $t6, ($v1) -/* 0A9D70 800A9170 35EFFFFF */ ori $t7, (0xFCFFFFFF & 0xFFFF) # ori $t7, $t7, 0xffff -/* 0A9D74 800A9174 3718F279 */ ori $t8, (0xFFFCF279 & 0xFFFF) # ori $t8, $t8, 0xf279 -/* 0A9D78 800A9178 AC580004 */ sw $t8, 4($v0) -/* 0A9D7C 800A917C AC4F0000 */ sw $t7, ($v0) -/* 0A9D80 800A9180 24D90027 */ addiu $t9, $a2, 0x27 -/* 0A9D84 800A9184 AFB90010 */ sw $t9, 0x10($sp) -/* 0A9D88 800A9188 241900FF */ li $t9, 255 -/* 0A9D8C 800A918C 240F0001 */ li $t7, 1 -/* 0A9D90 800A9190 24180001 */ li $t8, 1 -/* 0A9D94 800A9194 240E0001 */ li $t6, 1 -/* 0A9D98 800A9198 01283823 */ subu $a3, $t1, $t0 -/* 0A9D9C 800A919C 24E70040 */ addiu $a3, $a3, 0x40 -/* 0A9DA0 800A91A0 AFAE0014 */ sw $t6, 0x14($sp) -/* 0A9DA4 800A91A4 AFB8001C */ sw $t8, 0x1c($sp) -/* 0A9DA8 800A91A8 AFAF0018 */ sw $t7, 0x18($sp) -/* 0A9DAC 800A91AC AFB90020 */ sw $t9, 0x20($sp) -/* 0A9DB0 800A91B0 8C640000 */ lw $a0, ($v1) -/* 0A9DB4 800A91B4 0C026306 */ jal func_80098C18 -/* 0A9DB8 800A91B8 01282821 */ addu $a1, $t1, $t0 -/* 0A9DBC 800A91BC 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015 -/* 0A9DC0 800A91C0 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 -/* 0A9DC4 800A91C4 AC620000 */ sw $v0, ($v1) -.L800A91C8: -/* 0A9DC8 800A91C8 8FBF002C */ lw $ra, 0x2c($sp) -/* 0A9DCC 800A91CC 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0A9DD0 800A91D0 03E00008 */ jr $ra -/* 0A9DD4 800A91D4 00000000 */ nop diff --git a/asm/non_matchings/menus/options_menu_act.s b/asm/non_matchings/menus/options_menu_act.s deleted file mode 100644 index 2e0616c0e..000000000 --- a/asm/non_matchings/menus/options_menu_act.s +++ /dev/null @@ -1,1056 +0,0 @@ -.section .late_rodata -glabel jpt_800F2C58 -.word L800B05E0, L800B05E0 -.word L800B05E0, L800B05E0, L800B13A0, L800B13A0 -.word L800B13A0, L800B13A0, L800B13A0, L800B0AF4 -.word L800B0AF4, L800B0C88, L800B13A0, L800B13A0 -.word L800B13A0, L800B13A0, L800B13A0, L800B13A0 -.word L800B13A0, L800B0CAC, L800B0CAC, L800B1020 -.word L800B1020, L800B1020, L800B1020, L800B13A0 -.word L800B13A0, L800B13A0, L800B13A0, L800B0E5C -.word L800B0E5C, L800B1020, L800B1020, L800B13A0 -.word L800B1020, L800B1044, L800B1044, L800B11C8 -.word L800B11FC, L800B1020, L800B13A0, L800B13A0 -.word L800B13A0, L800B13A0, L800B1020, L800B1020 -.word L800B13A0, L800B13A0, L800B13A0, L800B1318 -.word L800B134C - -.word 0x00000000 - -glabel D_800F2D28 -.double 4.2 - -glabel D_800F2D30 -.double 4.2 - -glabel jpt_800F2D38 # jump table -.word L800B0948, L800B096C, L800B0980, L800B09C0 -.word L800B09C0, L800B09A0 - -glabel D_800F2D50 -.double 4.2 - -glabel D_800F2D58 -.double 4.2 - -glabel D_800F2D60 -.double 4.2 - -glabel D_800F2D68 -.double 4.2 - -glabel D_800F2D70 -.double 4.2 - -glabel D_800F2D78 -.double 4.2 - -glabel D_800F2D80 -.double 4.2 - -glabel D_800F2D88 -.double 4.2 - -.section .text -glabel options_menu_act -/* 0B113C 800B053C 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B1140 800B0540 AFBF001C */ sw $ra, 0x1c($sp) -/* 0B1144 800B0544 AFA50044 */ sw $a1, 0x44($sp) -/* 0B1148 800B0548 948F000C */ lhu $t7, 0xc($a0) -/* 0B114C 800B054C 948E0006 */ lhu $t6, 6($a0) -/* 0B1150 800B0550 3C19800E */ lui $t9, %hi(gEnableDebugMode) # $t9, 0x800e -/* 0B1154 800B0554 9739C520 */ lhu $t9, %lo(gEnableDebugMode)($t9) -/* 0B1158 800B0558 01CF3025 */ or $a2, $t6, $t7 -/* 0B115C 800B055C 30D8FFFF */ andi $t8, $a2, 0xffff -/* 0B1160 800B0560 17200007 */ bnez $t9, .L800B0580 -/* 0B1164 800B0564 03003025 */ move $a2, $t8 -/* 0B1168 800B0568 330A1000 */ andi $t2, $t8, 0x1000 -/* 0B116C 800B056C 11400004 */ beqz $t2, .L800B0580 -/* 0B1170 800B0570 00000000 */ nop -/* 0B1174 800B0574 37068000 */ ori $a2, $t8, 0x8000 -/* 0B1178 800B0578 30CBFFFF */ andi $t3, $a2, 0xffff -/* 0B117C 800B057C 01603025 */ move $a2, $t3 -.L800B0580: -/* 0B1180 800B0580 0C02D148 */ jal func_800B4520 -/* 0B1184 800B0584 A7A6003E */ sh $a2, 0x3e($sp) -/* 0B1188 800B0588 14400385 */ bnez $v0, .L800B13A0 -/* 0B118C 800B058C 97A6003E */ lhu $a2, 0x3e($sp) -/* 0B1190 800B0590 240400F0 */ li $a0, 240 -/* 0B1194 800B0594 0C02ABBD */ jal find_8018D9E0_entry_dupe -/* 0B1198 800B0598 A7A6003E */ sh $a2, 0x3e($sp) -/* 0B119C 800B059C 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B11A0 800B05A0 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B11A4 800B05A4 81230000 */ lb $v1, ($t1) -/* 0B11A8 800B05A8 3C0C8019 */ lui $t4, %hi(D_8018D9C0) # $t4, 0x8019 -/* 0B11AC 800B05AC 8D8CD9C0 */ lw $t4, %lo(D_8018D9C0)($t4) -/* 0B11B0 800B05B0 246DFFEB */ addiu $t5, $v1, -0x15 -/* 0B11B4 800B05B4 2DA10033 */ sltiu $at, $t5, 0x33 -/* 0B11B8 800B05B8 97A6003E */ lhu $a2, 0x3e($sp) -/* 0B11BC 800B05BC 00404025 */ move $t0, $v0 -/* 0B11C0 800B05C0 10200377 */ beqz $at, .L800B13A0 -/* 0B11C4 800B05C4 AFAC0030 */ sw $t4, 0x30($sp) -/* 0B11C8 800B05C8 000D6880 */ sll $t5, $t5, 2 -/* 0B11CC 800B05CC 3C01800F */ lui $at, %hi(jpt_800F2C58) # 0x800f -/* 0B11D0 800B05D0 002D0821 */ addu $at, $at, $t5 -/* 0B11D4 800B05D4 8C2D2C58 */ lw $t5, %lo(jpt_800F2C58)($at) # 0x2c58($at) -/* 0B11D8 800B05D8 01A00008 */ jr $t5 -/* 0B11DC 800B05DC 00000000 */ nop -glabel L800B05E0 #0x15,16,17,18 -/* 0B11E0 800B05E0 30CE0400 */ andi $t6, $a2, 0x400 -/* 0B11E4 800B05E4 AFA0002C */ sw $zero, 0x2c($sp) -/* 0B11E8 800B05E8 11C00020 */ beqz $t6, .L800B066C -/* 0B11EC 800B05EC 00C02825 */ move $a1, $a2 -/* 0B11F0 800B05F0 28610018 */ slti $at, $v1, 0x18 -/* 0B11F4 800B05F4 1020001D */ beqz $at, .L800B066C -/* 0B11F8 800B05F8 246F0001 */ addiu $t7, $v1, 1 -/* 0B11FC 800B05FC 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B1200 800B0600 A12F0000 */ sb $t7, ($t1) -/* 0B1204 800B0604 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B1208 800B0608 AFA60020 */ sw $a2, 0x20($sp) -/* 0B120C 800B060C 0C032384 */ jal play_sound2 -/* 0B1210 800B0610 AFA80038 */ sw $t0, 0x38($sp) -/* 0B1214 800B0614 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1218 800B0618 3C01800F */ lui $at, %hi(D_800F2D28) -/* 0B121C 800B061C D4262D28 */ ldc1 $f6, %lo(D_800F2D28)($at) -/* 0B1220 800B0620 C5040024 */ lwc1 $f4, 0x24($t0) -/* 0B1224 800B0624 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1228 800B0628 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B122C 800B062C 46002021 */ cvt.d.s $f0, $f4 -/* 0B1230 800B0630 8FA50020 */ lw $a1, 0x20($sp) -/* 0B1234 800B0634 4626003C */ c.lt.d $f0, $f6 -/* 0B1238 800B0638 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B123C 800B063C 24180001 */ li $t8, 1 -/* 0B1240 800B0640 24190001 */ li $t9, 1 -/* 0B1244 800B0644 45020008 */ bc1fl .L800B0668 -/* 0B1248 800B0648 AD180008 */ sw $t8, 8($t0) -/* 0B124C 800B064C 44814800 */ mtc1 $at, $f9 -/* 0B1250 800B0650 44804000 */ mtc1 $zero, $f8 -/* 0B1254 800B0654 00000000 */ nop -/* 0B1258 800B0658 46280280 */ add.d $f10, $f0, $f8 -/* 0B125C 800B065C 46205420 */ cvt.s.d $f16, $f10 -/* 0B1260 800B0660 E5100024 */ swc1 $f16, 0x24($t0) -/* 0B1264 800B0664 AD180008 */ sw $t8, 8($t0) -.L800B0668: -/* 0B1268 800B0668 AFB9002C */ sw $t9, 0x2c($sp) -.L800B066C: -/* 0B126C 800B066C 30AA0800 */ andi $t2, $a1, 0x800 -/* 0B1270 800B0670 51400022 */ beql $t2, $zero, .L800B06FC -/* 0B1274 800B0674 8FAE002C */ lw $t6, 0x2c($sp) -/* 0B1278 800B0678 81230000 */ lb $v1, ($t1) -/* 0B127C 800B067C 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B1280 800B0680 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B1284 800B0684 28610016 */ slti $at, $v1, 0x16 -/* 0B1288 800B0688 1420001B */ bnez $at, .L800B06F8 -/* 0B128C 800B068C 246BFFFF */ addiu $t3, $v1, -1 -/* 0B1290 800B0690 240C0001 */ li $t4, 1 -/* 0B1294 800B0694 A12B0000 */ sb $t3, ($t1) -/* 0B1298 800B0698 AFAC002C */ sw $t4, 0x2c($sp) -/* 0B129C 800B069C AFA50020 */ sw $a1, 0x20($sp) -/* 0B12A0 800B06A0 0C032384 */ jal play_sound2 -/* 0B12A4 800B06A4 AFA80038 */ sw $t0, 0x38($sp) -/* 0B12A8 800B06A8 8FA80038 */ lw $t0, 0x38($sp) -/* 0B12AC 800B06AC 3C01800F */ lui $at, %hi(D_800F2D30) -/* 0B12B0 800B06B0 D4242D30 */ ldc1 $f4, %lo(D_800F2D30)($at) -/* 0B12B4 800B06B4 C5120024 */ lwc1 $f18, 0x24($t0) -/* 0B12B8 800B06B8 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B12BC 800B06BC 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B12C0 800B06C0 46009021 */ cvt.d.s $f0, $f18 -/* 0B12C4 800B06C4 8FA50020 */ lw $a1, 0x20($sp) -/* 0B12C8 800B06C8 4624003C */ c.lt.d $f0, $f4 -/* 0B12CC 800B06CC 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B12D0 800B06D0 240DFFFF */ li $t5, -1 -/* 0B12D4 800B06D4 45020008 */ bc1fl .L800B06F8 -/* 0B12D8 800B06D8 AD0D0008 */ sw $t5, 8($t0) -/* 0B12DC 800B06DC 44813800 */ mtc1 $at, $f7 -/* 0B12E0 800B06E0 44803000 */ mtc1 $zero, $f6 -/* 0B12E4 800B06E4 00000000 */ nop -/* 0B12E8 800B06E8 46260200 */ add.d $f8, $f0, $f6 -/* 0B12EC 800B06EC 462042A0 */ cvt.s.d $f10, $f8 -/* 0B12F0 800B06F0 E50A0024 */ swc1 $f10, 0x24($t0) -/* 0B12F4 800B06F4 AD0D0008 */ sw $t5, 8($t0) -.L800B06F8: -/* 0B12F8 800B06F8 8FAE002C */ lw $t6, 0x2c($sp) -.L800B06FC: -/* 0B12FC 800B06FC 3C038019 */ lui $v1, %hi(gSoundMode) # $v1, 0x8019 -/* 0B1300 800B0700 2463EDF2 */ addiu $v1, %lo(gSoundMode) # addiu $v1, $v1, -0x120e -/* 0B1304 800B0704 11C00014 */ beqz $t6, .L800B0758 -/* 0B1308 800B0708 00000000 */ nop -/* 0B130C 800B070C 90620000 */ lbu $v0, ($v1) -/* 0B1310 800B0710 8D0F0004 */ lw $t7, 4($t0) -/* 0B1314 800B0714 3C018019 */ lui $at, %hi(gSaveDataSoundMode) # $at, 0x8019 -/* 0B1318 800B0718 11E2000F */ beq $t7, $v0, .L800B0758 -/* 0B131C 800B071C 00000000 */ nop -/* 0B1320 800B0720 A022ED14 */ sb $v0, %lo(gSaveDataSoundMode)($at) -/* 0B1324 800B0724 AFA50020 */ sw $a1, 0x20($sp) -/* 0B1328 800B0728 0C02D19C */ jal write_save_data_grand_prix_points_and_sound_mode -/* 0B132C 800B072C AFA80038 */ sw $t0, 0x38($sp) -/* 0B1330 800B0730 0C02D652 */ jal update_save_data_backup -/* 0B1334 800B0734 00000000 */ nop -/* 0B1338 800B0738 3C038019 */ lui $v1, %hi(gSoundMode) # $v1, 0x8019 -/* 0B133C 800B073C 2463EDF2 */ addiu $v1, %lo(gSoundMode) # addiu $v1, $v1, -0x120e -/* 0B1340 800B0740 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1344 800B0744 90780000 */ lbu $t8, ($v1) -/* 0B1348 800B0748 8FA50020 */ lw $a1, 0x20($sp) -/* 0B134C 800B074C 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1350 800B0750 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1354 800B0754 AD180004 */ sw $t8, 4($t0) -.L800B0758: -/* 0B1358 800B0758 3C038019 */ lui $v1, %hi(gSoundMode) # $v1, 0x8019 -/* 0B135C 800B075C 30B94000 */ andi $t9, $a1, 0x4000 -/* 0B1360 800B0760 13200019 */ beqz $t9, .L800B07C8 -/* 0B1364 800B0764 2463EDF2 */ addiu $v1, %lo(gSoundMode) # addiu $v1, $v1, -0x120e -/* 0B1368 800B0768 0C0278A0 */ jal func_8009E280 -/* 0B136C 800B076C AFA80038 */ sw $t0, 0x38($sp) -/* 0B1370 800B0770 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B1374 800B0774 0C032384 */ jal play_sound2 -/* 0B1378 800B0778 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B137C 800B077C 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1380 800B0780 3C038019 */ lui $v1, %hi(gSoundMode) # $v1, 0x8019 -/* 0B1384 800B0784 2463EDF2 */ addiu $v1, %lo(gSoundMode) # addiu $v1, $v1, -0x120e -/* 0B1388 800B0788 90620000 */ lbu $v0, ($v1) -/* 0B138C 800B078C 8D0A0004 */ lw $t2, 4($t0) -/* 0B1390 800B0790 3C018019 */ lui $at, %hi(gSaveDataSoundMode) # $at, 0x8019 -/* 0B1394 800B0794 51420303 */ beql $t2, $v0, .L800B13A4 -/* 0B1398 800B0798 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B139C 800B079C A022ED14 */ sb $v0, %lo(gSaveDataSoundMode)($at) -/* 0B13A0 800B07A0 0C02D19C */ jal write_save_data_grand_prix_points_and_sound_mode -/* 0B13A4 800B07A4 AFA80038 */ sw $t0, 0x38($sp) -/* 0B13A8 800B07A8 0C02D652 */ jal update_save_data_backup -/* 0B13AC 800B07AC 00000000 */ nop -/* 0B13B0 800B07B0 3C038019 */ lui $v1, %hi(gSoundMode) # $v1, 0x8019 -/* 0B13B4 800B07B4 2463EDF2 */ addiu $v1, %lo(gSoundMode) # addiu $v1, $v1, -0x120e -/* 0B13B8 800B07B8 8FA80038 */ lw $t0, 0x38($sp) -/* 0B13BC 800B07BC 906B0000 */ lbu $t3, ($v1) -/* 0B13C0 800B07C0 100002F7 */ b .L800B13A0 -/* 0B13C4 800B07C4 AD0B0004 */ sw $t3, 4($t0) -.L800B07C8: -/* 0B13C8 800B07C8 30AC8000 */ andi $t4, $a1, 0x8000 -/* 0B13CC 800B07CC 518002F5 */ beql $t4, $zero, .L800B13A4 -/* 0B13D0 800B07D0 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B13D4 800B07D4 81220000 */ lb $v0, ($t1) -/* 0B13D8 800B07D8 24010015 */ li $at, 21 -/* 0B13DC 800B07DC 104100BE */ beq $v0, $at, .L800B0AD8 -/* 0B13E0 800B07E0 24010016 */ li $at, 22 -/* 0B13E4 800B07E4 10410007 */ beq $v0, $at, .L800B0804 -/* 0B13E8 800B07E8 24010017 */ li $at, 23 -/* 0B13EC 800B07EC 1041002E */ beq $v0, $at, .L800B08A8 -/* 0B13F0 800B07F0 24010018 */ li $at, 24 -/* 0B13F4 800B07F4 104100B2 */ beq $v0, $at, .L800B0AC0 -/* 0B13F8 800B07F8 240D001E */ li $t5, 30 -/* 0B13FC 800B07FC 100002E9 */ b .L800B13A4 -/* 0B1400 800B0800 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0804: # case 22 switch 2 -/* 0B1404 800B0804 90620000 */ lbu $v0, ($v1) -/* 0B1408 800B0808 240F0003 */ li $t7, 3 -/* 0B140C 800B080C 28410003 */ slti $at, $v0, 3 -/* 0B1410 800B0810 10200003 */ beqz $at, .L800B0820 -/* 0B1414 800B0814 244D0001 */ addiu $t5, $v0, 1 -/* 0B1418 800B0818 10000002 */ b .L800B0824 -/* 0B141C 800B081C A06D0000 */ sb $t5, ($v1) -.L800B0820: -/* 0B1420 800B0820 A0600000 */ sb $zero, ($v1) -.L800B0824: -/* 0B1424 800B0824 906E0000 */ lbu $t6, ($v1) -/* 0B1428 800B0828 24010002 */ li $at, 2 -/* 0B142C 800B082C 15C10002 */ bne $t6, $at, .L800B0838 -/* 0B1430 800B0830 00000000 */ nop -/* 0B1434 800B0834 A06F0000 */ sb $t7, ($v1) -.L800B0838: -/* 0B1438 800B0838 0C02D12F */ jal func_800B44BC -/* 0B143C 800B083C 00000000 */ nop -/* 0B1440 800B0840 3C038019 */ lui $v1, %hi(gSoundMode) # $v1, 0x8019 -/* 0B1444 800B0844 2463EDF2 */ addiu $v1, %lo(gSoundMode) # addiu $v1, $v1, -0x120e -/* 0B1448 800B0848 90620000 */ lbu $v0, ($v1) -/* 0B144C 800B084C 24010001 */ li $at, 1 -/* 0B1450 800B0850 3C044900 */ lui $a0, 0x4900 -/* 0B1454 800B0854 10400008 */ beqz $v0, .L800B0878 -/* 0B1458 800B0858 00000000 */ nop -/* 0B145C 800B085C 1041000A */ beq $v0, $at, .L800B0888 -/* 0B1460 800B0860 3C044900 */ lui $a0, 0x4900 -/* 0B1464 800B0864 24010003 */ li $at, 3 -/* 0B1468 800B0868 1041000B */ beq $v0, $at, .L800B0898 -/* 0B146C 800B086C 3C044900 */ lui $a0, (0x49008029 >> 16) # lui $a0, 0x4900 -/* 0B1470 800B0870 100002CC */ b .L800B13A4 -/* 0B1474 800B0874 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0878: -/* 0B1478 800B0878 0C032384 */ jal play_sound2 -/* 0B147C 800B087C 34848024 */ ori $a0, (0x49008024 & 0xFFFF) # ori $a0, $a0, 0x8024 -/* 0B1480 800B0880 100002C8 */ b .L800B13A4 -/* 0B1484 800B0884 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0888: -/* 0B1488 800B0888 0C032384 */ jal play_sound2 -/* 0B148C 800B088C 34848025 */ ori $a0, (0x49008025 & 0xFFFF) # ori $a0, $a0, 0x8025 -/* 0B1490 800B0890 100002C4 */ b .L800B13A4 -/* 0B1494 800B0894 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0898: -/* 0B1498 800B0898 0C032384 */ jal play_sound2 -/* 0B149C 800B089C 34848029 */ ori $a0, (0x49008029 & 0xFFFF) # ori $a0, $a0, 0x8029 -/* 0B14A0 800B08A0 100002C0 */ b .L800B13A4 -/* 0B14A4 800B08A4 8FBF001C */ lw $ra, 0x1c($sp) -.L800B08A8: # case 23 switch 2 -/* 0B14A8 800B08A8 0C02D769 */ jal func_800B5DA4 -/* 0B14AC 800B08AC AFA80038 */ sw $t0, 0x38($sp) -/* 0B14B0 800B08B0 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B14B4 800B08B4 2401FFFF */ li $at, -1 -/* 0B14B8 800B08B8 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B14BC 800B08BC 1041000A */ beq $v0, $at, .L800B08E8 -/* 0B14C0 800B08C0 8FA80038 */ lw $t0, 0x38($sp) -/* 0B14C4 800B08C4 1040000F */ beqz $v0, .L800B0904 -/* 0B14C8 800B08C8 24010001 */ li $at, 1 -/* 0B14CC 800B08CC 10410070 */ beq $v0, $at, .L800B0A90 -/* 0B14D0 800B08D0 240B002C */ li $t3, 44 -/* 0B14D4 800B08D4 24010002 */ li $at, 2 -/* 0B14D8 800B08D8 10410073 */ beq $v0, $at, .L800B0AA8 -/* 0B14DC 800B08DC 240C002D */ li $t4, 45 -/* 0B14E0 800B08E0 10000072 */ b .L800B0AAC -/* 0B14E4 800B08E4 3C044900 */ lui $a0, 0x4900 -.L800B08E8: # case -1 switch 3 -/* 0B14E8 800B08E8 2418002B */ li $t8, 43 -/* 0B14EC 800B08EC 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -/* 0B14F0 800B08F0 A1380000 */ sb $t8, ($t1) -/* 0B14F4 800B08F4 0C032384 */ jal play_sound2 -/* 0B14F8 800B08F8 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B14FC 800B08FC 100002A9 */ b .L800B13A4 -/* 0B1500 800B0900 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0904: # case 0 switch 3 -/* 0B1504 800B0904 0C02D9E6 */ jal func_800B6798 -/* 0B1508 800B0908 AFA80038 */ sw $t0, 0x38($sp) -/* 0B150C 800B090C 0C02D6E5 */ jal func_800B5B94 -/* 0B1510 800B0910 00000000 */ nop -/* 0B1514 800B0914 24590001 */ addiu $t9, $v0, 1 -/* 0B1518 800B0918 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B151C 800B091C 2F210006 */ sltiu $at, $t9, 6 -/* 0B1520 800B0920 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1524 800B0924 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1528 800B0928 10200025 */ beqz $at, .L800B09C0 -/* 0B152C 800B092C AFA2002C */ sw $v0, 0x2c($sp) -/* 0B1530 800B0930 0019C880 */ sll $t9, $t9, 2 -/* 0B1534 800B0934 3C01800F */ lui $at, %hi(jpt_800F2D38) -/* 0B1538 800B0938 00390821 */ addu $at, $at, $t9 -/* 0B153C 800B093C 8C392D38 */ lw $t9, %lo(jpt_800F2D38)($at) -/* 0B1540 800B0940 03200008 */ jr $t9 -/* 0B1544 800B0944 00000000 */ nop -glabel L800B0948 # case -1 switch 5 -/* 0B1548 800B0948 240A0046 */ li $t2, 70 -/* 0B154C 800B094C A12A0000 */ sb $t2, ($t1) -/* 0B1550 800B0950 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B1554 800B0954 AD000004 */ sw $zero, 4($t0) -/* 0B1558 800B0958 0C032384 */ jal play_sound2 -/* 0B155C 800B095C 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B1560 800B0960 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1564 800B0964 1000001D */ b .L800B09DC -/* 0B1568 800B0968 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -glabel L800B096C # case 0 switch 5 -/* 0B156C 800B096C 0C02D9C2 */ jal func_800B6708 -/* 0B1570 800B0970 00000000 */ nop -/* 0B1574 800B0974 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1578 800B0978 10000018 */ b .L800B09DC -/* 0B157C 800B097C 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -glabel L800B0980 # case 1 switch 5 -/* 0B1580 800B0980 240B0034 */ li $t3, 52 -/* 0B1584 800B0984 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -/* 0B1588 800B0988 A12B0000 */ sb $t3, ($t1) -/* 0B158C 800B098C 0C032384 */ jal play_sound2 -/* 0B1590 800B0990 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B1594 800B0994 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1598 800B0998 10000010 */ b .L800B09DC -/* 0B159C 800B099C 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -glabel L800B09A0 # case 4 switch 5 -/* 0B15A0 800B09A0 240C0037 */ li $t4, 55 -/* 0B15A4 800B09A4 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -/* 0B15A8 800B09A8 A12C0000 */ sb $t4, ($t1) -/* 0B15AC 800B09AC 0C032384 */ jal play_sound2 -/* 0B15B0 800B09B0 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B15B4 800B09B4 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B15B8 800B09B8 10000008 */ b .L800B09DC -/* 0B15BC 800B09BC 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -.L800B09C0: -glabel L800B09C0 # default switch 5 -/* 0B15C0 800B09C0 240D0035 */ li $t5, 53 -/* 0B15C4 800B09C4 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -/* 0B15C8 800B09C8 A12D0000 */ sb $t5, ($t1) -/* 0B15CC 800B09CC 0C032384 */ jal play_sound2 -/* 0B15D0 800B09D0 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B15D4 800B09D4 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B15D8 800B09D8 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -.L800B09DC: #end switch 5 -/* 0B15DC 800B09DC 8FAE002C */ lw $t6, 0x2c($sp) -/* 0B15E0 800B09E0 2401FFFF */ li $at, -1 -/* 0B15E4 800B09E4 8FAF0030 */ lw $t7, 0x30($sp) -/* 0B15E8 800B09E8 15C1000D */ bne $t6, $at, .L800B0A20 -/* 0B15EC 800B09EC 8FAB002C */ lw $t3, 0x2c($sp) -/* 0B15F0 800B09F0 91F80004 */ lbu $t8, 4($t7) -/* 0B15F4 800B09F4 1700000A */ bnez $t8, .L800B0A20 -/* 0B15F8 800B09F8 00000000 */ nop -/* 0B15FC 800B09FC 91F90084 */ lbu $t9, 0x84($t7) -/* 0B1600 800B0A00 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -/* 0B1604 800B0A04 240A002A */ li $t2, 42 -/* 0B1608 800B0A08 17200005 */ bnez $t9, .L800B0A20 -/* 0B160C 800B0A0C 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B1610 800B0A10 0C032384 */ jal play_sound2 -/* 0B1614 800B0A14 A12A0000 */ sb $t2, ($t1) -/* 0B1618 800B0A18 10000262 */ b .L800B13A4 -/* 0B161C 800B0A1C 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0A20: -/* 0B1620 800B0A20 1560025F */ bnez $t3, .L800B13A0 -/* 0B1624 800B0A24 8FAC0030 */ lw $t4, 0x30($sp) -/* 0B1628 800B0A28 918D0004 */ lbu $t5, 4($t4) -/* 0B162C 800B0A2C 240E0028 */ li $t6, 40 -/* 0B1630 800B0A30 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B1634 800B0A34 11A00006 */ beqz $t5, .L800B0A50 -/* 0B1638 800B0A38 8FB80030 */ lw $t8, 0x30($sp) -/* 0B163C 800B0A3C A12E0000 */ sb $t6, ($t1) -/* 0B1640 800B0A40 0C032384 */ jal play_sound2 -/* 0B1644 800B0A44 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B1648 800B0A48 10000256 */ b .L800B13A4 -/* 0B164C 800B0A4C 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0A50: -/* 0B1650 800B0A50 930F0084 */ lbu $t7, 0x84($t8) -/* 0B1654 800B0A54 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -/* 0B1658 800B0A58 240A002A */ li $t2, 42 -/* 0B165C 800B0A5C 11E00008 */ beqz $t7, .L800B0A80 -/* 0B1660 800B0A60 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B1664 800B0A64 24190029 */ li $t9, 41 -/* 0B1668 800B0A68 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B166C 800B0A6C A1390000 */ sb $t9, ($t1) -/* 0B1670 800B0A70 0C032384 */ jal play_sound2 -/* 0B1674 800B0A74 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B1678 800B0A78 1000024A */ b .L800B13A4 -/* 0B167C 800B0A7C 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0A80: -/* 0B1680 800B0A80 0C032384 */ jal play_sound2 -/* 0B1684 800B0A84 A12A0000 */ sb $t2, ($t1) -/* 0B1688 800B0A88 10000246 */ b .L800B13A4 -/* 0B168C 800B0A8C 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0A90: # case 1 switch 3 -/* 0B1690 800B0A90 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -/* 0B1694 800B0A94 A12B0000 */ sb $t3, ($t1) -/* 0B1698 800B0A98 0C032384 */ jal play_sound2 -/* 0B169C 800B0A9C 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B16A0 800B0AA0 10000240 */ b .L800B13A4 -/* 0B16A4 800B0AA4 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0AA8: # case 2 switch 3 -/* 0B16A8 800B0AA8 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -.L800B0AAC: # default/end switch 3 -/* 0B16AC 800B0AAC A12C0000 */ sb $t4, ($t1) -/* 0B16B0 800B0AB0 0C032384 */ jal play_sound2 -/* 0B16B4 800B0AB4 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B16B8 800B0AB8 1000023A */ b .L800B13A4 -/* 0B16BC 800B0ABC 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0AC0: # case 24 switch 2 -/* 0B16C0 800B0AC0 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B16C4 800B0AC4 A12D0000 */ sb $t5, ($t1) -/* 0B16C8 800B0AC8 0C032384 */ jal play_sound2 -/* 0B16CC 800B0ACC 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B16D0 800B0AD0 10000234 */ b .L800B13A4 -/* 0B16D4 800B0AD4 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0AD8: # case 21 switch 2 -/* 0B16D8 800B0AD8 0C0278A0 */ jal func_8009E280 -/* 0B16DC 800B0ADC 00000000 */ nop -/* 0B16E0 800B0AE0 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B16E4 800B0AE4 0C032384 */ jal play_sound2 -/* 0B16E8 800B0AE8 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B16EC 800B0AEC 1000022D */ b .L800B13A4 -/* 0B16F0 800B0AF0 8FBF001C */ lw $ra, 0x1c($sp) -glabel L800B0AF4 # case 0x1E,1F switch 1 -/* 0B16F4 800B0AF4 30CE0400 */ andi $t6, $a2, 0x400 -/* 0B16F8 800B0AF8 11C0001E */ beqz $t6, .L800B0B74 -/* 0B16FC 800B0AFC 00C02825 */ move $a1, $a2 -/* 0B1700 800B0B00 2861001F */ slti $at, $v1, 0x1f -/* 0B1704 800B0B04 1020001B */ beqz $at, .L800B0B74 -/* 0B1708 800B0B08 24780001 */ addiu $t8, $v1, 1 -/* 0B170C 800B0B0C 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B1710 800B0B10 A1380000 */ sb $t8, ($t1) -/* 0B1714 800B0B14 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B1718 800B0B18 AFA60020 */ sw $a2, 0x20($sp) -/* 0B171C 800B0B1C 0C032384 */ jal play_sound2 -/* 0B1720 800B0B20 AFA80038 */ sw $t0, 0x38($sp) -/* 0B1724 800B0B24 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1728 800B0B28 3C01800F */ lui $at, %hi(D_800F2D50) -/* 0B172C 800B0B2C D4322D50 */ ldc1 $f18, %lo(D_800F2D50)($at) -/* 0B1730 800B0B30 C5100024 */ lwc1 $f16, 0x24($t0) -/* 0B1734 800B0B34 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1738 800B0B38 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B173C 800B0B3C 46008021 */ cvt.d.s $f0, $f16 -/* 0B1740 800B0B40 8FA50020 */ lw $a1, 0x20($sp) -/* 0B1744 800B0B44 4632003C */ c.lt.d $f0, $f18 -/* 0B1748 800B0B48 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B174C 800B0B4C 240F0001 */ li $t7, 1 -/* 0B1750 800B0B50 45020008 */ bc1fl .L800B0B74 -/* 0B1754 800B0B54 AD0F0008 */ sw $t7, 8($t0) -/* 0B1758 800B0B58 44812800 */ mtc1 $at, $f5 -/* 0B175C 800B0B5C 44802000 */ mtc1 $zero, $f4 -/* 0B1760 800B0B60 00000000 */ nop -/* 0B1764 800B0B64 46240180 */ add.d $f6, $f0, $f4 -/* 0B1768 800B0B68 46203220 */ cvt.s.d $f8, $f6 -/* 0B176C 800B0B6C E5080024 */ swc1 $f8, 0x24($t0) -/* 0B1770 800B0B70 AD0F0008 */ sw $t7, 8($t0) -.L800B0B74: -/* 0B1774 800B0B74 30B90800 */ andi $t9, $a1, 0x800 -/* 0B1778 800B0B78 53200020 */ beql $t9, $zero, .L800B0BFC -/* 0B177C 800B0B7C 30AC4000 */ andi $t4, $a1, 0x4000 -/* 0B1780 800B0B80 81230000 */ lb $v1, ($t1) -/* 0B1784 800B0B84 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B1788 800B0B88 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B178C 800B0B8C 2861001F */ slti $at, $v1, 0x1f -/* 0B1790 800B0B90 14200019 */ bnez $at, .L800B0BF8 -/* 0B1794 800B0B94 246AFFFF */ addiu $t2, $v1, -1 -/* 0B1798 800B0B98 A12A0000 */ sb $t2, ($t1) -/* 0B179C 800B0B9C AFA50020 */ sw $a1, 0x20($sp) -/* 0B17A0 800B0BA0 0C032384 */ jal play_sound2 -/* 0B17A4 800B0BA4 AFA80038 */ sw $t0, 0x38($sp) -/* 0B17A8 800B0BA8 8FA80038 */ lw $t0, 0x38($sp) -/* 0B17AC 800B0BAC 3C01800F */ lui $at, %hi(D_800F2D58) -/* 0B17B0 800B0BB0 D4302D58 */ ldc1 $f16, %lo(D_800F2D58)($at) -/* 0B17B4 800B0BB4 C50A0024 */ lwc1 $f10, 0x24($t0) -/* 0B17B8 800B0BB8 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B17BC 800B0BBC 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B17C0 800B0BC0 46005021 */ cvt.d.s $f0, $f10 -/* 0B17C4 800B0BC4 8FA50020 */ lw $a1, 0x20($sp) -/* 0B17C8 800B0BC8 4630003C */ c.lt.d $f0, $f16 -/* 0B17CC 800B0BCC 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B17D0 800B0BD0 240BFFFF */ li $t3, -1 -/* 0B17D4 800B0BD4 45020008 */ bc1fl .L800B0BF8 -/* 0B17D8 800B0BD8 AD0B0008 */ sw $t3, 8($t0) -/* 0B17DC 800B0BDC 44819800 */ mtc1 $at, $f19 -/* 0B17E0 800B0BE0 44809000 */ mtc1 $zero, $f18 -/* 0B17E4 800B0BE4 00000000 */ nop -/* 0B17E8 800B0BE8 46320100 */ add.d $f4, $f0, $f18 -/* 0B17EC 800B0BEC 462021A0 */ cvt.s.d $f6, $f4 -/* 0B17F0 800B0BF0 E5060024 */ swc1 $f6, 0x24($t0) -/* 0B17F4 800B0BF4 AD0B0008 */ sw $t3, 8($t0) -.L800B0BF8: -/* 0B17F8 800B0BF8 30AC4000 */ andi $t4, $a1, 0x4000 -.L800B0BFC: -/* 0B17FC 800B0BFC 11800008 */ beqz $t4, .L800B0C20 -/* 0B1800 800B0C00 30AE8000 */ andi $t6, $a1, 0x8000 -/* 0B1804 800B0C04 240D0018 */ li $t5, 24 -/* 0B1808 800B0C08 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B180C 800B0C0C A12D0000 */ sb $t5, ($t1) -/* 0B1810 800B0C10 0C032384 */ jal play_sound2 -/* 0B1814 800B0C14 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B1818 800B0C18 100001E2 */ b .L800B13A4 -/* 0B181C 800B0C1C 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0C20: -/* 0B1820 800B0C20 51C001E0 */ beql $t6, $zero, .L800B13A4 -/* 0B1824 800B0C24 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B1828 800B0C28 81220000 */ lb $v0, ($t1) -/* 0B182C 800B0C2C 2401001E */ li $at, 30 -/* 0B1830 800B0C30 24180018 */ li $t8, 24 -/* 0B1834 800B0C34 10410006 */ beq $v0, $at, .L800B0C50 -/* 0B1838 800B0C38 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B183C 800B0C3C 2401001F */ li $at, 31 -/* 0B1840 800B0C40 10410008 */ beq $v0, $at, .L800B0C64 -/* 0B1844 800B0C44 240F0020 */ li $t7, 32 -/* 0B1848 800B0C48 100001D6 */ b .L800B13A4 -/* 0B184C 800B0C4C 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0C50: -/* 0B1850 800B0C50 A1380000 */ sb $t8, ($t1) -/* 0B1854 800B0C54 0C032384 */ jal play_sound2 -/* 0B1858 800B0C58 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B185C 800B0C5C 100001D1 */ b .L800B13A4 -/* 0B1860 800B0C60 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0C64: -/* 0B1864 800B0C64 0C02D1B4 */ jal func_800B46D0 -/* 0B1868 800B0C68 A12F0000 */ sb $t7, ($t1) -/* 0B186C 800B0C6C 3C01800E */ lui $at, %hi(D_800DC5AC) # $at, 0x800e -/* 0B1870 800B0C70 3C044900 */ lui $a0, (0x4900801D >> 16) # lui $a0, 0x4900 -/* 0B1874 800B0C74 AC20C5AC */ sw $zero, %lo(D_800DC5AC)($at) -/* 0B1878 800B0C78 0C032384 */ jal play_sound2 -/* 0B187C 800B0C7C 3484801D */ ori $a0, (0x4900801D & 0xFFFF) # ori $a0, $a0, 0x801d -/* 0B1880 800B0C80 100001C8 */ b .L800B13A4 -/* 0B1884 800B0C84 8FBF001C */ lw $ra, 0x1c($sp) -glabel L800B0C88 # case 0x20 switch 1 -/* 0B1888 800B0C88 30D9D000 */ andi $t9, $a2, 0xd000 -/* 0B188C 800B0C8C 132001C4 */ beqz $t9, .L800B13A0 -/* 0B1890 800B0C90 240A0018 */ li $t2, 24 -/* 0B1894 800B0C94 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B1898 800B0C98 A12A0000 */ sb $t2, ($t1) -/* 0B189C 800B0C9C 0C032384 */ jal play_sound2 -/* 0B18A0 800B0CA0 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B18A4 800B0CA4 100001BF */ b .L800B13A4 -/* 0B18A8 800B0CA8 8FBF001C */ lw $ra, 0x1c($sp) -glabel L800B0CAC # case 0x28, 29 switch 1 -/* 0B18AC 800B0CAC 30CB0400 */ andi $t3, $a2, 0x400 -/* 0B18B0 800B0CB0 11600021 */ beqz $t3, .L800B0D38 -/* 0B18B4 800B0CB4 00C02825 */ move $a1, $a2 -/* 0B18B8 800B0CB8 28610029 */ slti $at, $v1, 0x29 -/* 0B18BC 800B0CBC 1020001E */ beqz $at, .L800B0D38 -/* 0B18C0 800B0CC0 8FAC0030 */ lw $t4, 0x30($sp) -/* 0B18C4 800B0CC4 918D0084 */ lbu $t5, 0x84($t4) -/* 0B18C8 800B0CC8 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B18CC 800B0CCC 246E0001 */ addiu $t6, $v1, 1 -/* 0B18D0 800B0CD0 11A00019 */ beqz $t5, .L800B0D38 -/* 0B18D4 800B0CD4 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B18D8 800B0CD8 A12E0000 */ sb $t6, ($t1) -/* 0B18DC 800B0CDC AFA60020 */ sw $a2, 0x20($sp) -/* 0B18E0 800B0CE0 0C032384 */ jal play_sound2 -/* 0B18E4 800B0CE4 AFA80038 */ sw $t0, 0x38($sp) -/* 0B18E8 800B0CE8 8FA80038 */ lw $t0, 0x38($sp) -/* 0B18EC 800B0CEC 3C01800F */ lui $at, %hi(D_800F2D60) -/* 0B18F0 800B0CF0 D42A2D60 */ ldc1 $f10, %lo(D_800F2D60)($at) -/* 0B18F4 800B0CF4 C5080024 */ lwc1 $f8, 0x24($t0) -/* 0B18F8 800B0CF8 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B18FC 800B0CFC 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1900 800B0D00 46004021 */ cvt.d.s $f0, $f8 -/* 0B1904 800B0D04 8FA50020 */ lw $a1, 0x20($sp) -/* 0B1908 800B0D08 462A003C */ c.lt.d $f0, $f10 -/* 0B190C 800B0D0C 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B1910 800B0D10 24180001 */ li $t8, 1 -/* 0B1914 800B0D14 45020008 */ bc1fl .L800B0D38 -/* 0B1918 800B0D18 AD180008 */ sw $t8, 8($t0) -/* 0B191C 800B0D1C 44818800 */ mtc1 $at, $f17 -/* 0B1920 800B0D20 44808000 */ mtc1 $zero, $f16 -/* 0B1924 800B0D24 00000000 */ nop -/* 0B1928 800B0D28 46300480 */ add.d $f18, $f0, $f16 -/* 0B192C 800B0D2C 46209120 */ cvt.s.d $f4, $f18 -/* 0B1930 800B0D30 E5040024 */ swc1 $f4, 0x24($t0) -/* 0B1934 800B0D34 AD180008 */ sw $t8, 8($t0) -.L800B0D38: -/* 0B1938 800B0D38 30AF0800 */ andi $t7, $a1, 0x800 -/* 0B193C 800B0D3C 51E00024 */ beql $t7, $zero, .L800B0DD0 -/* 0B1940 800B0D40 30AD4000 */ andi $t5, $a1, 0x4000 -/* 0B1944 800B0D44 81230000 */ lb $v1, ($t1) -/* 0B1948 800B0D48 8FB90030 */ lw $t9, 0x30($sp) -/* 0B194C 800B0D4C 28610029 */ slti $at, $v1, 0x29 -/* 0B1950 800B0D50 5420001F */ bnel $at, $zero, .L800B0DD0 -/* 0B1954 800B0D54 30AD4000 */ andi $t5, $a1, 0x4000 -/* 0B1958 800B0D58 932A0004 */ lbu $t2, 4($t9) -/* 0B195C 800B0D5C 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B1960 800B0D60 246BFFFF */ addiu $t3, $v1, -1 -/* 0B1964 800B0D64 11400019 */ beqz $t2, .L800B0DCC -/* 0B1968 800B0D68 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B196C 800B0D6C A12B0000 */ sb $t3, ($t1) -/* 0B1970 800B0D70 AFA50020 */ sw $a1, 0x20($sp) -/* 0B1974 800B0D74 0C032384 */ jal play_sound2 -/* 0B1978 800B0D78 AFA80038 */ sw $t0, 0x38($sp) -/* 0B197C 800B0D7C 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1980 800B0D80 3C01800F */ lui $at, %hi(D_800F2D68) -/* 0B1984 800B0D84 D4282D68 */ ldc1 $f8, %lo(D_800F2D68)($at) -/* 0B1988 800B0D88 C5060024 */ lwc1 $f6, 0x24($t0) -/* 0B198C 800B0D8C 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1990 800B0D90 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1994 800B0D94 46003021 */ cvt.d.s $f0, $f6 -/* 0B1998 800B0D98 8FA50020 */ lw $a1, 0x20($sp) -/* 0B199C 800B0D9C 4628003C */ c.lt.d $f0, $f8 -/* 0B19A0 800B0DA0 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B19A4 800B0DA4 240CFFFF */ li $t4, -1 -/* 0B19A8 800B0DA8 45020008 */ bc1fl .L800B0DCC -/* 0B19AC 800B0DAC AD0C0008 */ sw $t4, 8($t0) -/* 0B19B0 800B0DB0 44815800 */ mtc1 $at, $f11 -/* 0B19B4 800B0DB4 44805000 */ mtc1 $zero, $f10 -/* 0B19B8 800B0DB8 00000000 */ nop -/* 0B19BC 800B0DBC 462A0400 */ add.d $f16, $f0, $f10 -/* 0B19C0 800B0DC0 462084A0 */ cvt.s.d $f18, $f16 -/* 0B19C4 800B0DC4 E5120024 */ swc1 $f18, 0x24($t0) -/* 0B19C8 800B0DC8 AD0C0008 */ sw $t4, 8($t0) -.L800B0DCC: -/* 0B19CC 800B0DCC 30AD4000 */ andi $t5, $a1, 0x4000 -.L800B0DD0: -/* 0B19D0 800B0DD0 11A00008 */ beqz $t5, .L800B0DF4 -/* 0B19D4 800B0DD4 30B88000 */ andi $t8, $a1, 0x8000 -/* 0B19D8 800B0DD8 240E0017 */ li $t6, 23 -/* 0B19DC 800B0DDC 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B19E0 800B0DE0 A12E0000 */ sb $t6, ($t1) -/* 0B19E4 800B0DE4 0C032384 */ jal play_sound2 -/* 0B19E8 800B0DE8 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B19EC 800B0DEC 1000016D */ b .L800B13A4 -/* 0B19F0 800B0DF0 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0DF4: -/* 0B19F4 800B0DF4 1300016A */ beqz $t8, .L800B13A0 -/* 0B19F8 800B0DF8 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B19FC 800B0DFC 812F0000 */ lb $t7, ($t1) -/* 0B1A00 800B0E00 3C188019 */ lui $t8, %hi((D_8018EE10 + 0x85)) # $t8, 0x8019 -/* 0B1A04 800B0E04 240B0032 */ li $t3, 50 -/* 0B1A08 800B0E08 25F9FFD8 */ addiu $t9, $t7, -0x28 -/* 0B1A0C 800B0E0C AD190020 */ sw $t9, 0x20($t0) -/* 0B1A10 800B0E10 8FAA0030 */ lw $t2, 0x30($sp) -/* 0B1A14 800B0E14 001961C0 */ sll $t4, $t9, 7 -/* 0B1A18 800B0E18 8318EE95 */ lb $t8, %lo((D_8018EE10 + 0x85))($t8) -/* 0B1A1C 800B0E1C 014C6821 */ addu $t5, $t2, $t4 -/* 0B1A20 800B0E20 81AE0005 */ lb $t6, 5($t5) -/* 0B1A24 800B0E24 3C0F8019 */ lui $t7, %hi((D_8018EE10 + 0x84)) # $t7, 0x8019 -/* 0B1A28 800B0E28 55D80008 */ bnel $t6, $t8, .L800B0E4C -/* 0B1A2C 800B0E2C A12B0000 */ sb $t3, ($t1) -/* 0B1A30 800B0E30 91EFEE94 */ lbu $t7, %lo((D_8018EE10 + 0x84))($t7) -/* 0B1A34 800B0E34 24190033 */ li $t9, 51 -/* 0B1A38 800B0E38 51E00004 */ beql $t7, $zero, .L800B0E4C -/* 0B1A3C 800B0E3C A12B0000 */ sb $t3, ($t1) -/* 0B1A40 800B0E40 10000002 */ b .L800B0E4C -/* 0B1A44 800B0E44 A1390000 */ sb $t9, ($t1) -/* 0B1A48 800B0E48 A12B0000 */ sb $t3, ($t1) -.L800B0E4C: -/* 0B1A4C 800B0E4C 0C032384 */ jal play_sound2 -/* 0B1A50 800B0E50 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B1A54 800B0E54 10000153 */ b .L800B13A4 -/* 0B1A58 800B0E58 8FBF001C */ lw $ra, 0x1c($sp) -glabel L800B0E5C # case 0x32, 33 switch 1 -/* 0B1A5C 800B0E5C 8C580020 */ lw $t8, 0x20($v0) -/* 0B1A60 800B0E60 8FAE0030 */ lw $t6, 0x30($sp) -/* 0B1A64 800B0E64 246AFFCE */ addiu $t2, $v1, -0x32 -/* 0B1A68 800B0E68 3C0D8019 */ lui $t5, %hi(D_8018EE10) # $t5, 0x8019 -/* 0B1A6C 800B0E6C 25ADEE10 */ addiu $t5, %lo(D_8018EE10) # addiu $t5, $t5, -0x11f0 -/* 0B1A70 800B0E70 000A61C0 */ sll $t4, $t2, 7 -/* 0B1A74 800B0E74 001879C0 */ sll $t7, $t8, 7 -/* 0B1A78 800B0E78 018D2021 */ addu $a0, $t4, $t5 -/* 0B1A7C 800B0E7C 01CFC821 */ addu $t9, $t6, $t7 -/* 0B1A80 800B0E80 832B0005 */ lb $t3, 5($t9) -/* 0B1A84 800B0E84 808A0005 */ lb $t2, 5($a0) -/* 0B1A88 800B0E88 00C02825 */ move $a1, $a2 -/* 0B1A8C 800B0E8C 30AD0400 */ andi $t5, $a1, 0x400 -/* 0B1A90 800B0E90 156A0004 */ bne $t3, $t2, .L800B0EA4 -/* 0B1A94 800B0E94 00000000 */ nop -/* 0B1A98 800B0E98 908C0004 */ lbu $t4, 4($a0) -/* 0B1A9C 800B0E9C 55800041 */ bnel $t4, $zero, .L800B0FA4 -/* 0B1AA0 800B0EA0 30AA4000 */ andi $t2, $a1, 0x4000 -.L800B0EA4: -/* 0B1AA4 800B0EA4 11A0001D */ beqz $t5, .L800B0F1C -/* 0B1AA8 800B0EA8 28610033 */ slti $at, $v1, 0x33 -/* 0B1AAC 800B0EAC 1020001B */ beqz $at, .L800B0F1C -/* 0B1AB0 800B0EB0 24780001 */ addiu $t8, $v1, 1 -/* 0B1AB4 800B0EB4 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B1AB8 800B0EB8 A1380000 */ sb $t8, ($t1) -/* 0B1ABC 800B0EBC 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B1AC0 800B0EC0 AFA50020 */ sw $a1, 0x20($sp) -/* 0B1AC4 800B0EC4 0C032384 */ jal play_sound2 -/* 0B1AC8 800B0EC8 AFA80038 */ sw $t0, 0x38($sp) -/* 0B1ACC 800B0ECC 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1AD0 800B0ED0 3C01800F */ lui $at, %hi(D_800F2D70) -/* 0B1AD4 800B0ED4 D4262D70 */ ldc1 $f6, %lo(D_800F2D70)($at) -/* 0B1AD8 800B0ED8 C5040024 */ lwc1 $f4, 0x24($t0) -/* 0B1ADC 800B0EDC 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1AE0 800B0EE0 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1AE4 800B0EE4 46002021 */ cvt.d.s $f0, $f4 -/* 0B1AE8 800B0EE8 8FA50020 */ lw $a1, 0x20($sp) -/* 0B1AEC 800B0EEC 4626003C */ c.lt.d $f0, $f6 -/* 0B1AF0 800B0EF0 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B1AF4 800B0EF4 240E0001 */ li $t6, 1 -/* 0B1AF8 800B0EF8 45020008 */ bc1fl .L800B0F1C -/* 0B1AFC 800B0EFC AD0E0008 */ sw $t6, 8($t0) -/* 0B1B00 800B0F00 44814800 */ mtc1 $at, $f9 -/* 0B1B04 800B0F04 44804000 */ mtc1 $zero, $f8 -/* 0B1B08 800B0F08 00000000 */ nop -/* 0B1B0C 800B0F0C 46280280 */ add.d $f10, $f0, $f8 -/* 0B1B10 800B0F10 46205420 */ cvt.s.d $f16, $f10 -/* 0B1B14 800B0F14 E5100024 */ swc1 $f16, 0x24($t0) -/* 0B1B18 800B0F18 AD0E0008 */ sw $t6, 8($t0) -.L800B0F1C: -/* 0B1B1C 800B0F1C 30AF0800 */ andi $t7, $a1, 0x800 -/* 0B1B20 800B0F20 51E00020 */ beql $t7, $zero, .L800B0FA4 -/* 0B1B24 800B0F24 30AA4000 */ andi $t2, $a1, 0x4000 -/* 0B1B28 800B0F28 81230000 */ lb $v1, ($t1) -/* 0B1B2C 800B0F2C 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B1B30 800B0F30 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B1B34 800B0F34 28610033 */ slti $at, $v1, 0x33 -/* 0B1B38 800B0F38 14200019 */ bnez $at, .L800B0FA0 -/* 0B1B3C 800B0F3C 2479FFFF */ addiu $t9, $v1, -1 -/* 0B1B40 800B0F40 A1390000 */ sb $t9, ($t1) -/* 0B1B44 800B0F44 AFA50020 */ sw $a1, 0x20($sp) -/* 0B1B48 800B0F48 0C032384 */ jal play_sound2 -/* 0B1B4C 800B0F4C AFA80038 */ sw $t0, 0x38($sp) -/* 0B1B50 800B0F50 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1B54 800B0F54 3C01800F */ lui $at, %hi(D_800F2D78) -/* 0B1B58 800B0F58 D4242D78 */ ldc1 $f4, %lo(D_800F2D78)($at) -/* 0B1B5C 800B0F5C C5120024 */ lwc1 $f18, 0x24($t0) -/* 0B1B60 800B0F60 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1B64 800B0F64 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1B68 800B0F68 46009021 */ cvt.d.s $f0, $f18 -/* 0B1B6C 800B0F6C 8FA50020 */ lw $a1, 0x20($sp) -/* 0B1B70 800B0F70 4624003C */ c.lt.d $f0, $f4 -/* 0B1B74 800B0F74 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B1B78 800B0F78 240BFFFF */ li $t3, -1 -/* 0B1B7C 800B0F7C 45020008 */ bc1fl .L800B0FA0 -/* 0B1B80 800B0F80 AD0B0008 */ sw $t3, 8($t0) -/* 0B1B84 800B0F84 44813800 */ mtc1 $at, $f7 -/* 0B1B88 800B0F88 44803000 */ mtc1 $zero, $f6 -/* 0B1B8C 800B0F8C 00000000 */ nop -/* 0B1B90 800B0F90 46260200 */ add.d $f8, $f0, $f6 -/* 0B1B94 800B0F94 462042A0 */ cvt.s.d $f10, $f8 -/* 0B1B98 800B0F98 E50A0024 */ swc1 $f10, 0x24($t0) -/* 0B1B9C 800B0F9C AD0B0008 */ sw $t3, 8($t0) -.L800B0FA0: -/* 0B1BA0 800B0FA0 30AA4000 */ andi $t2, $a1, 0x4000 -.L800B0FA4: -/* 0B1BA4 800B0FA4 11400009 */ beqz $t2, .L800B0FCC -/* 0B1BA8 800B0FA8 30B88000 */ andi $t8, $a1, 0x8000 -/* 0B1BAC 800B0FAC 8D0C0020 */ lw $t4, 0x20($t0) -/* 0B1BB0 800B0FB0 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B1BB4 800B0FB4 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B1BB8 800B0FB8 258D0028 */ addiu $t5, $t4, 0x28 -/* 0B1BBC 800B0FBC 0C032384 */ jal play_sound2 -/* 0B1BC0 800B0FC0 A12D0000 */ sb $t5, ($t1) -/* 0B1BC4 800B0FC4 100000F7 */ b .L800B13A4 -/* 0B1BC8 800B0FC8 8FBF001C */ lw $ra, 0x1c($sp) -.L800B0FCC: -/* 0B1BCC 800B0FCC 130000F4 */ beqz $t8, .L800B13A0 -/* 0B1BD0 800B0FD0 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B1BD4 800B0FD4 812E0000 */ lb $t6, ($t1) -/* 0B1BD8 800B0FD8 3C0A8019 */ lui $t2, %hi((D_8018EE10 + 4)) # 0x8019 -/* 0B1BDC 800B0FDC 240C0038 */ li $t4, 56 -/* 0B1BE0 800B0FE0 25CFFFCE */ addiu $t7, $t6, -0x32 -/* 0B1BE4 800B0FE4 000F59C0 */ sll $t3, $t7, 7 -/* 0B1BE8 800B0FE8 AD0F001C */ sw $t7, 0x1c($t0) -/* 0B1BEC 800B0FEC 014B5021 */ addu $t2, $t2, $t3 -/* 0B1BF0 800B0FF0 914AEE14 */ lbu $t2, %lo((D_8018EE10 + 4))($t2) # -0x11ec($t2) -/* 0B1BF4 800B0FF4 240D003A */ li $t5, 58 -/* 0B1BF8 800B0FF8 51400004 */ beql $t2, $zero, .L800B100C -/* 0B1BFC 800B0FFC A12D0000 */ sb $t5, ($t1) -/* 0B1C00 800B1000 10000003 */ b .L800B1010 -/* 0B1C04 800B1004 A12C0000 */ sb $t4, ($t1) -/* 0B1C08 800B1008 A12D0000 */ sb $t5, ($t1) -.L800B100C: -/* 0B1C0C 800B100C AD000004 */ sw $zero, 4($t0) -.L800B1010: -/* 0B1C10 800B1010 0C032384 */ jal play_sound2 -/* 0B1C14 800B1014 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B1C18 800B1018 100000E2 */ b .L800B13A4 -/* 0B1C1C 800B101C 8FBF001C */ lw $ra, 0x1c($sp) -glabel L800B1020 # case 0x2A +++ switch 1 -/* 0B1C20 800B1020 30D8D000 */ andi $t8, $a2, 0xd000 -/* 0B1C24 800B1024 130000DE */ beqz $t8, .L800B13A0 -/* 0B1C28 800B1028 240E0017 */ li $t6, 23 -/* 0B1C2C 800B102C 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B1C30 800B1030 A12E0000 */ sb $t6, ($t1) -/* 0B1C34 800B1034 0C032384 */ jal play_sound2 -/* 0B1C38 800B1038 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B1C3C 800B103C 100000D9 */ b .L800B13A4 -/* 0B1C40 800B1040 8FBF001C */ lw $ra, 0x1c($sp) -glabel L800B1044 # case 0x38, 39 switch 1 -/* 0B1C44 800B1044 30CF0100 */ andi $t7, $a2, 0x100 -/* 0B1C48 800B1048 11E0001E */ beqz $t7, .L800B10C4 -/* 0B1C4C 800B104C 00C02825 */ move $a1, $a2 -/* 0B1C50 800B1050 28610039 */ slti $at, $v1, 0x39 -/* 0B1C54 800B1054 1020001B */ beqz $at, .L800B10C4 -/* 0B1C58 800B1058 24790001 */ addiu $t9, $v1, 1 -/* 0B1C5C 800B105C 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B1C60 800B1060 A1390000 */ sb $t9, ($t1) -/* 0B1C64 800B1064 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B1C68 800B1068 AFA60020 */ sw $a2, 0x20($sp) -/* 0B1C6C 800B106C 0C032384 */ jal play_sound2 -/* 0B1C70 800B1070 AFA80038 */ sw $t0, 0x38($sp) -/* 0B1C74 800B1074 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1C78 800B1078 3C01800F */ lui $at, %hi(D_800F2D80) -/* 0B1C7C 800B107C D4322D80 */ ldc1 $f18, %lo(D_800F2D80)($at) -/* 0B1C80 800B1080 C5100024 */ lwc1 $f16, 0x24($t0) -/* 0B1C84 800B1084 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1C88 800B1088 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1C8C 800B108C 46008021 */ cvt.d.s $f0, $f16 -/* 0B1C90 800B1090 8FA50020 */ lw $a1, 0x20($sp) -/* 0B1C94 800B1094 4632003C */ c.lt.d $f0, $f18 -/* 0B1C98 800B1098 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B1C9C 800B109C 240B0001 */ li $t3, 1 -/* 0B1CA0 800B10A0 45020008 */ bc1fl .L800B10C4 -/* 0B1CA4 800B10A4 AD0B0008 */ sw $t3, 8($t0) -/* 0B1CA8 800B10A8 44812800 */ mtc1 $at, $f5 -/* 0B1CAC 800B10AC 44802000 */ mtc1 $zero, $f4 -/* 0B1CB0 800B10B0 00000000 */ nop -/* 0B1CB4 800B10B4 46240180 */ add.d $f6, $f0, $f4 -/* 0B1CB8 800B10B8 46203220 */ cvt.s.d $f8, $f6 -/* 0B1CBC 800B10BC E5080024 */ swc1 $f8, 0x24($t0) -/* 0B1CC0 800B10C0 AD0B0008 */ sw $t3, 8($t0) -.L800B10C4: -/* 0B1CC4 800B10C4 30AA0200 */ andi $t2, $a1, 0x200 -/* 0B1CC8 800B10C8 51400020 */ beql $t2, $zero, .L800B114C -/* 0B1CCC 800B10CC 30B84000 */ andi $t8, $a1, 0x4000 -/* 0B1CD0 800B10D0 81230000 */ lb $v1, ($t1) -/* 0B1CD4 800B10D4 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B1CD8 800B10D8 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 -/* 0B1CDC 800B10DC 28610039 */ slti $at, $v1, 0x39 -/* 0B1CE0 800B10E0 14200019 */ bnez $at, .L800B1148 -/* 0B1CE4 800B10E4 246CFFFF */ addiu $t4, $v1, -1 -/* 0B1CE8 800B10E8 A12C0000 */ sb $t4, ($t1) -/* 0B1CEC 800B10EC AFA50020 */ sw $a1, 0x20($sp) -/* 0B1CF0 800B10F0 0C032384 */ jal play_sound2 -/* 0B1CF4 800B10F4 AFA80038 */ sw $t0, 0x38($sp) -/* 0B1CF8 800B10F8 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1CFC 800B10FC 3C01800F */ lui $at, %hi(D_800F2D88) -/* 0B1D00 800B1100 D4302D88 */ ldc1 $f16, %lo(D_800F2D88)($at) -/* 0B1D04 800B1104 C50A0024 */ lwc1 $f10, 0x24($t0) -/* 0B1D08 800B1108 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1D0C 800B110C 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1D10 800B1110 46005021 */ cvt.d.s $f0, $f10 -/* 0B1D14 800B1114 8FA50020 */ lw $a1, 0x20($sp) -/* 0B1D18 800B1118 4630003C */ c.lt.d $f0, $f16 -/* 0B1D1C 800B111C 3C014010 */ li $at, 0x40100000 # 2.250000 -/* 0B1D20 800B1120 240DFFFF */ li $t5, -1 -/* 0B1D24 800B1124 45020008 */ bc1fl .L800B1148 -/* 0B1D28 800B1128 AD0D0008 */ sw $t5, 8($t0) -/* 0B1D2C 800B112C 44819800 */ mtc1 $at, $f19 -/* 0B1D30 800B1130 44809000 */ mtc1 $zero, $f18 -/* 0B1D34 800B1134 00000000 */ nop -/* 0B1D38 800B1138 46320100 */ add.d $f4, $f0, $f18 -/* 0B1D3C 800B113C 462021A0 */ cvt.s.d $f6, $f4 -/* 0B1D40 800B1140 E5060024 */ swc1 $f6, 0x24($t0) -/* 0B1D44 800B1144 AD0D0008 */ sw $t5, 8($t0) -.L800B1148: -/* 0B1D48 800B1148 30B84000 */ andi $t8, $a1, 0x4000 -.L800B114C: -/* 0B1D4C 800B114C 13000009 */ beqz $t8, .L800B1174 -/* 0B1D50 800B1150 30B98000 */ andi $t9, $a1, 0x8000 -/* 0B1D54 800B1154 8D0E001C */ lw $t6, 0x1c($t0) -/* 0B1D58 800B1158 3C044900 */ lui $a0, (0x49008002 >> 16) # lui $a0, 0x4900 -/* 0B1D5C 800B115C 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B1D60 800B1160 25CF0032 */ addiu $t7, $t6, 0x32 -/* 0B1D64 800B1164 0C032384 */ jal play_sound2 -/* 0B1D68 800B1168 A12F0000 */ sb $t7, ($t1) -/* 0B1D6C 800B116C 1000008D */ b .L800B13A4 -/* 0B1D70 800B1170 8FBF001C */ lw $ra, 0x1c($sp) -.L800B1174: -/* 0B1D74 800B1174 5320008B */ beql $t9, $zero, .L800B13A4 -/* 0B1D78 800B1178 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B1D7C 800B117C 812B0000 */ lb $t3, ($t1) -/* 0B1D80 800B1180 24010038 */ li $at, 56 -/* 0B1D84 800B1184 240C003A */ li $t4, 58 -/* 0B1D88 800B1188 15610008 */ bne $t3, $at, .L800B11AC -/* 0B1D8C 800B118C 3C044900 */ lui $a0, 0x4900 -/* 0B1D90 800B1190 240A0017 */ li $t2, 23 -/* 0B1D94 800B1194 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B1D98 800B1198 A12A0000 */ sb $t2, ($t1) -/* 0B1D9C 800B119C 0C032384 */ jal play_sound2 -/* 0B1DA0 800B11A0 34848002 */ ori $a0, (0x49008002 & 0xFFFF) # ori $a0, $a0, 0x8002 -/* 0B1DA4 800B11A4 1000007F */ b .L800B13A4 -/* 0B1DA8 800B11A8 8FBF001C */ lw $ra, 0x1c($sp) -.L800B11AC: -/* 0B1DAC 800B11AC A12C0000 */ sb $t4, ($t1) -/* 0B1DB0 800B11B0 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B1DB4 800B11B4 0C032384 */ jal play_sound2 -/* 0B1DB8 800B11B8 AFA80038 */ sw $t0, 0x38($sp) -/* 0B1DBC 800B11BC 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1DC0 800B11C0 10000077 */ b .L800B13A0 -/* 0B1DC4 800B11C4 AD000004 */ sw $zero, 4($t0) -glabel L800B11C8 # case 0x3a -/* 0B1DC8 800B11C8 97AD0046 */ lhu $t5, 0x46($sp) -/* 0B1DCC 800B11CC 2419003B */ li $t9, 59 -/* 0B1DD0 800B11D0 55A00005 */ bnel $t5, $zero, .L800B11E8 -/* 0B1DD4 800B11D4 8C4F0004 */ lw $t7, 4($v0) -/* 0B1DD8 800B11D8 8C580004 */ lw $t8, 4($v0) -/* 0B1DDC 800B11DC 270E0001 */ addiu $t6, $t8, 1 -/* 0B1DE0 800B11E0 AC4E0004 */ sw $t6, 4($v0) -/* 0B1DE4 800B11E4 8C4F0004 */ lw $t7, 4($v0) -.L800B11E8: -/* 0B1DE8 800B11E8 29E10003 */ slti $at, $t7, 3 -/* 0B1DEC 800B11EC 5420006D */ bnel $at, $zero, .L800B13A4 -/* 0B1DF0 800B11F0 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B1DF4 800B11F4 1000006A */ b .L800B13A0 -/* 0B1DF8 800B11F8 A1390000 */ sb $t9, ($t1) -glabel L800B11FC # 0x3B -/* 0B1DFC 800B11FC 0C02D769 */ jal func_800B5DA4 -/* 0B1E00 800B1200 AFA80038 */ sw $t0, 0x38($sp) -/* 0B1E04 800B1204 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1E08 800B1208 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1E0C 800B120C 14400008 */ bnez $v0, .L800B1230 -/* 0B1E10 800B1210 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1E14 800B1214 8D040020 */ lw $a0, 0x20($t0) -/* 0B1E18 800B1218 8D05001C */ lw $a1, 0x1c($t0) -/* 0B1E1C 800B121C 0C02D97D */ jal func_800B65F4 -/* 0B1E20 800B1220 AFA80038 */ sw $t0, 0x38($sp) -/* 0B1E24 800B1224 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1E28 800B1228 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1E2C 800B122C 8FA80038 */ lw $t0, 0x38($sp) -.L800B1230: -/* 0B1E30 800B1230 10400008 */ beqz $v0, .L800B1254 -/* 0B1E34 800B1234 3C048019 */ lui $a0, %hi(D_8018E868) -/* 0B1E38 800B1238 240B0042 */ li $t3, 66 -/* 0B1E3C 800B123C 3C044900 */ lui $a0, (0x4900FF07 >> 16) # $a0, 0x4900 -/* 0B1E40 800B1240 A12B0000 */ sb $t3, ($t1) -/* 0B1E44 800B1244 0C032384 */ jal play_sound2 -/* 0B1E48 800B1248 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B1E4C 800B124C 10000055 */ b .L800B13A4 -/* 0B1E50 800B1250 8FBF001C */ lw $ra, 0x1c($sp) -.L800B1254: -/* 0B1E54 800B1254 3C0A800F */ lui $t2, %hi(D_800F2E74) # $t2, 0x800f -/* 0B1E58 800B1258 3C0C8019 */ lui $t4, %hi(D_8018EB84) # $t4, 0x8019 -/* 0B1E5C 800B125C 258CEB84 */ addiu $t4, %lo(D_8018EB84) # addiu $t4, $t4, -0x147c -/* 0B1E60 800B1260 254A2E74 */ addiu $t2, %lo(D_800F2E74) # addiu $t2, $t2, 0x2e74 -/* 0B1E64 800B1264 3C05800F */ lui $a1, %hi(D_800E86F0) # $a1, 0x800f -/* 0B1E68 800B1268 3C06800F */ lui $a2, %hi(D_800E86F4) # $a2, 0x800f -/* 0B1E6C 800B126C 3C07800F */ lui $a3, %hi(D_800F2E64) # $a3, 0x800f -/* 0B1E70 800B1270 24E72E64 */ addiu $a3, %lo(D_800F2E64) # addiu $a3, $a3, 0x2e64 -/* 0B1E74 800B1274 8CC686F4 */ lw $a2, %lo(D_800E86F4)($a2) -/* 0B1E78 800B1278 94A586F0 */ lhu $a1, %lo(D_800E86F0)($a1) -/* 0B1E7C 800B127C AFAA0010 */ sw $t2, 0x10($sp) -/* 0B1E80 800B1280 AFAC0014 */ sw $t4, 0x14($sp) -/* 0B1E84 800B1284 2484E868 */ addiu $a0, %lo(D_8018E868) # addiu $a0, $a0, -0x1798 -/* 0B1E88 800B1288 0C033E20 */ jal osPfsFindFile -/* 0B1E8C 800B128C AFA80038 */ sw $t0, 0x38($sp) -/* 0B1E90 800B1290 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1E94 800B1294 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1E98 800B1298 14400007 */ bnez $v0, .L800B12B8 -/* 0B1E9C 800B129C 8FA80038 */ lw $t0, 0x38($sp) -/* 0B1EA0 800B12A0 8D04001C */ lw $a0, 0x1c($t0) -/* 0B1EA4 800B12A4 0C02D85E */ jal func_800B6178 -/* 0B1EA8 800B12A8 AFA80038 */ sw $t0, 0x38($sp) -/* 0B1EAC 800B12AC 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1EB0 800B12B0 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1EB4 800B12B4 8FA80038 */ lw $t0, 0x38($sp) -.L800B12B8: -/* 0B1EB8 800B12B8 10400008 */ beqz $v0, .L800B12DC -/* 0B1EBC 800B12BC 2418003C */ li $t8, 60 -/* 0B1EC0 800B12C0 240D0041 */ li $t5, 65 -/* 0B1EC4 800B12C4 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -/* 0B1EC8 800B12C8 A12D0000 */ sb $t5, ($t1) -/* 0B1ECC 800B12CC 0C032384 */ jal play_sound2 -/* 0B1ED0 800B12D0 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B1ED4 800B12D4 10000033 */ b .L800B13A4 -/* 0B1ED8 800B12D8 8FBF001C */ lw $ra, 0x1c($sp) -.L800B12DC: -/* 0B1EDC 800B12DC A1380000 */ sb $t8, ($t1) -/* 0B1EE0 800B12E0 8D0E0020 */ lw $t6, 0x20($t0) -/* 0B1EE4 800B12E4 8FB90030 */ lw $t9, 0x30($sp) -/* 0B1EE8 800B12E8 8D0C001C */ lw $t4, 0x1c($t0) -/* 0B1EEC 800B12EC 000E79C0 */ sll $t7, $t6, 7 -/* 0B1EF0 800B12F0 01F95821 */ addu $t3, $t7, $t9 -/* 0B1EF4 800B12F4 816A0005 */ lb $t2, 5($t3) -/* 0B1EF8 800B12F8 3C018019 */ lui $at, %hi((D_8018EE10 + 5)) # 0x8019 -/* 0B1EFC 800B12FC 000C69C0 */ sll $t5, $t4, 7 -/* 0B1F00 800B1300 002D0821 */ addu $at, $at, $t5 -/* 0B1F04 800B1304 A02AEE15 */ sb $t2, %lo((D_8018EE10 + 5))($at) # -0x11eb($at) -/* 0B1F08 800B1308 0C02D822 */ jal func_800B6088 -/* 0B1F0C 800B130C 8D04001C */ lw $a0, 0x1c($t0) -/* 0B1F10 800B1310 10000024 */ b .L800B13A4 -/* 0B1F14 800B1314 8FBF001C */ lw $ra, 0x1c($sp) -glabel L800B1318 # 0x46 -/* 0B1F18 800B1318 97B80046 */ lhu $t8, 0x46($sp) -/* 0B1F1C 800B131C 240B0047 */ li $t3, 71 -/* 0B1F20 800B1320 57000005 */ bnel $t8, $zero, .L800B1338 -/* 0B1F24 800B1324 8C590004 */ lw $t9, 4($v0) -/* 0B1F28 800B1328 8C4E0004 */ lw $t6, 4($v0) -/* 0B1F2C 800B132C 25CF0001 */ addiu $t7, $t6, 1 -/* 0B1F30 800B1330 AC4F0004 */ sw $t7, 4($v0) -/* 0B1F34 800B1334 8C590004 */ lw $t9, 4($v0) -.L800B1338: -/* 0B1F38 800B1338 2B210003 */ slti $at, $t9, 3 -/* 0B1F3C 800B133C 54200019 */ bnel $at, $zero, .L800B13A4 -/* 0B1F40 800B1340 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B1F44 800B1344 10000016 */ b .L800B13A0 -/* 0B1F48 800B1348 A12B0000 */ sb $t3, ($t1) -glabel L800B134C # 0x47 -/* 0B1F4C 800B134C 0C02DA9A */ jal func_800B6A68 -/* 0B1F50 800B1350 00000000 */ nop -/* 0B1F54 800B1354 3C098019 */ lui $t1, %hi(D_8018EDEC) # $t1, 0x8019 -/* 0B1F58 800B1358 10400008 */ beqz $v0, .L800B137C -/* 0B1F5C 800B135C 2529EDEC */ addiu $t1, %lo(D_8018EDEC) # addiu $t1, $t1, -0x1214 -/* 0B1F60 800B1360 240C0036 */ li $t4, 54 -/* 0B1F64 800B1364 3C044900 */ lui $a0, (0x4900FF07 >> 16) # lui $a0, 0x4900 -/* 0B1F68 800B1368 A12C0000 */ sb $t4, ($t1) -/* 0B1F6C 800B136C 0C032384 */ jal play_sound2 -/* 0B1F70 800B1370 3484FF07 */ ori $a0, (0x4900FF07 & 0xFFFF) # ori $a0, $a0, 0xff07 -/* 0B1F74 800B1374 1000000B */ b .L800B13A4 -/* 0B1F78 800B1378 8FBF001C */ lw $ra, 0x1c($sp) -.L800B137C: -/* 0B1F7C 800B137C 8FAA0030 */ lw $t2, 0x30($sp) -/* 0B1F80 800B1380 24180028 */ li $t8, 40 -/* 0B1F84 800B1384 240E0029 */ li $t6, 41 -/* 0B1F88 800B1388 914D0004 */ lbu $t5, 4($t2) -/* 0B1F8C 800B138C 51A00004 */ beql $t5, $zero, .L800B13A0 -/* 0B1F90 800B1390 A12E0000 */ sb $t6, ($t1) -/* 0B1F94 800B1394 10000002 */ b .L800B13A0 -/* 0B1F98 800B1398 A1380000 */ sb $t8, ($t1) -/* 0B1F9C 800B139C A12E0000 */ sb $t6, ($t1) -.L800B13A0: -glabel L800B13A0 -/* 0B1FA0 800B13A0 8FBF001C */ lw $ra, 0x1c($sp) -.L800B13A4: -/* 0B1FA4 800B13A4 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0B1FA8 800B13A8 03E00008 */ jr $ra -/* 0B1FAC 800B13AC 00000000 */ nop diff --git a/src/audio/external.c b/src/audio/external.c index b8bc92f80..f5f07b19c 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -13,9 +13,6 @@ void func_800C13F0(void) { } -extern OSMesgQueue *D_800EA3B0; -extern OSMesgQueue *D_800EA3B4; - void func_800C13FC(OSMesg presetId) { OSMesg mesg; osRecvMesg(D_800EA3B4, &mesg, 0); @@ -377,7 +374,7 @@ GLOBAL_ASM("asm/non_matchings/audio/external/func_800C1F8C.s") #ifdef NEEDS_RODATA // data/rodata_audio_2.s extern f32 D_800F35E4;// = 100000.0f; -f32 *func_800C21E8(f32 *arg0, u32 arg1) { +f32 *func_800C21E8(Vec3f arg0, u32 arg1) { u8 var_v0; f32 *ret; // Only here to force a match @@ -4228,8 +4225,6 @@ void func_800C8CCC(void) { GLOBAL_ASM("asm/non_matchings/audio/external/func_800C8CCC.s") #endif -extern u8 D_800EA1D4; - void play_sound2(s32 soundBits) { if ((soundBits == SOUND_ACTION_REV_ENGINE) && (gCurrentCourseId == 0x12)) { @@ -4242,25 +4237,16 @@ void play_sound2(s32 soundBits) { play_sound(soundBits, &D_800EA1C8, 4, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); } -void func_800C3448(s32); -extern u16 D_800EA15C; - void func_800C8EAC(u16 arg0) { func_800C3448(arg0 | 0x10000); D_800EA15C = arg0; } -void func_800C3448(s32); -extern u16 D_800EA160; - void func_800C8EF8(u16 arg0) { func_800C3448(arg0 | 0x1010000); D_800EA160 = arg0; } - -void func_800C36C4(s32 arg0, s32 arg1, u8 arg2, s8 arg3); - void func_800C8F44(u8 arg0) { func_800C36C4(0, 0, arg0, 1); } @@ -4789,17 +4775,13 @@ void func_800C9D80(Vec3f position, Vec3f velocity, u32 soundBits) { GLOBAL_ASM("asm/non_matchings/audio/external/func_800C9D80.s") #endif - -f32 *func_800C21E8(s32, s32); -void func_800C5578(s32, s32); - -void func_800C9EF4(s32 arg0, s32 arg1) { +void func_800C9EF4(Vec3f arg0, u32 arg1) { f32 *temp; u8 i; for (i = 0; i < D_800EA1C0 + 1; i++) { temp = func_800C21E8(arg0, arg1); - if (temp != 0) { + if (temp != NULL) { func_800C5578(temp, arg1); } } @@ -4930,8 +4912,6 @@ void func_800CA118(s32 arg0) { GLOBAL_ASM("asm/non_matchings/audio/external/func_800CA118.s") #endif -extern u8 D_800EA0EC[]; - void func_800CA24C(u8 arg0) { D_800EA0EC[arg0] = 2; } @@ -4940,8 +4920,6 @@ void func_800CA270() { D_800EA0F4 = 1; } -extern u8 D_800E9F90[]; - // appears to write u8 in list of f32s? // However, 0x3C is 0.0f which could likely get confused with `u8 = 0`; void func_800CA288(u8 arg0, s8 arg1) { @@ -4965,8 +4943,6 @@ void func_800CA330(u8 arg0) { func_800C3448(arg0 << 0x10 | 0x110000FF); } -void func_800C58B8(u8, u8, u16); // extern - void func_800CA388(u8 arg0) { arg0 *= 2; func_800C58B8(0, 0, arg0); @@ -4976,9 +4952,6 @@ void func_800CA388(u8 arg0) { func_800C58B8(5, 0, arg0); } -void func_800C3448(s32); -extern u8 D_800EA104; - void func_800CA414(u16 arg0, u16 arg1) { if (D_800EA104 == 0) { func_800C3448(func_800C3508(0) | 0x30000000); @@ -4989,12 +4962,6 @@ void func_800CA414(u16 arg0, u16 arg1) { D_800EA104 = 1; } -extern u8 D_800EA108; -extern u16 D_800EA15C; -extern u8 D_800EA164; -extern u8 D_800EA1C0; -extern u8 D_8018FC08; - void func_800CA49C(u8 arg0) { if (D_800EA108 == 0) { if (D_800EA1C0 >= 2) { diff --git a/src/audio/external.h b/src/audio/external.h index bed5980a0..e86424044 100644 --- a/src/audio/external.h +++ b/src/audio/external.h @@ -89,6 +89,7 @@ struct Unk_800EA06C { } ; void func_800C13F0(); +void func_800C13FC(OSMesg); f32 func_800C1480(u8, u8); s8 func_800C15D0(u8, u8, u8); f32 func_800C1934(u8, u8); @@ -96,12 +97,16 @@ struct Unk_8018EFD8 *func_800C1C88(u8, Vec3f, Vec3f, f32*, u8, u32); void func_800C1DA4(Camera*, Vec3s, struct Unk_8018EFD8*); void func_800C1E2C(Camera*, Vec3f, struct Unk_8018EFD8*); void func_800C1F8C(); -f32 *func_800C21E8(s32, s32); +f32 *func_800C21E8(Vec3f, u32); +void func_800C3448(s32); +void func_800C36C4(s32, s32, u8, s8); void func_800C4084(u16); void play_sound(u32, f32*, u8, f32*, f32*, u8*); void func_800C41CC(u8, struct Unk_80191420*); void func_800C4398(); +void func_800C5578(Vec3f, u32); void func_800C5848(); +void func_800C58B8(u8, u8, u16); void func_800C6758(u8); void func_800C86D8(u8); void func_800C8770(u8); @@ -109,19 +114,29 @@ void func_800C89E4(); void play_sound2(s32); void func_800C8EAC(u16); void func_800C8EF8(u16); +void func_800C8F44(u8); void func_800C9060(u8, u32); void func_800C90F4(u8, uintptr_t); +void func_800C9A88(u8); +void func_800C9EF4(Vec3f, u32); +void func_800C9F90(u8); void func_800CA008(u8, u8); void func_800CA0A0(); void func_800CA0B8(); void func_800CA0CC(); +void func_800CA0E4(); void func_800CA118(); +void func_800CA24C(u8); void func_800CA270(); +void func_800CA288(u8, s8); +void func_800CA2B8(u8); void func_800CA2E4(u8, s8); void func_800CA30C(u8); void func_800CA330(u8); void func_800CA388(u8); +void func_800CA414(u16, u16); void func_800CA49C(u8); +void func_800CAACC(u8); void func_800CB134(); void func_800CB2C4(void); @@ -136,6 +151,7 @@ extern u8 D_8018FB91; extern Camera *D_8018FB98[4]; extern Vec3f D_8018FBA8[4]; extern Vec3f D_8018FBD8[4]; +extern u8 D_8018FC08; extern struct Unk_80191420 sSoundBanks[SOUND_BANK_COUNT][20]; extern u8 sSoundBankUsedListBack[SOUND_BANK_COUNT]; @@ -154,10 +170,16 @@ extern u8 D_800E9F24[8];// = { 0, 0, 0, 0, 0, 0, 0, 0 }; extern f32 D_800E9F34[8];// = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; /* const */ extern f32 D_800E9F54[4];// = { 1.0f, 1.0f, 1.0f, 1.0f }; /* const */ extern u8 D_800E9F2C[8];// = { 0, 0, 0, 0, 0, 0, 0, 0 }; +extern u8 D_800E9F90[]; extern struct Unk_800EA06C D_800EA06C[8]; +extern u8 D_800EA0EC[]; extern u8 D_800EA0F0;// = 0; extern u8 D_800EA0F4; +extern u8 D_800EA104; extern u8 D_800EA108;// = 0; +extern u16 D_800EA15C; +extern u16 D_800EA160; +extern u8 D_800EA164; extern s16 D_800EA174;// = 0; extern f32 D_800EA178; extern f32 D_800EA17C; @@ -166,9 +188,13 @@ extern u8 D_800EA1C0;// = 0; // Most similar to gGlobalSoundSource from SM64, but I don't know if its really // a sound source, its usage makes it look like a 0'd Vec3f for general usage extern Vec3f D_800EA1C8;// = {0.0f, 0.0f, 0.0f} +extern u8 D_800EA1D4; extern u8 D_800EA1DC;// = 0; extern u8 D_800EA244; extern s8 D_800EA16C; +extern OSMesgQueue *D_800EA3B0; +extern OSMesgQueue *D_800EA3B4; + #endif diff --git a/src/code_800029B0.h b/src/code_800029B0.h index 34156a3f2..749855a09 100644 --- a/src/code_800029B0.h +++ b/src/code_800029B0.h @@ -9,10 +9,6 @@ void func_80002DAC(); void clear_nmi_buffer(); void func_80003040(); -// audio/external - -void func_800C8F44(u16 arg0); - extern struct UnkStruct_800DC5EC *D_800DC5EC; extern struct UnkStruct_800DC5EC *D_800DC5F0; extern struct UnkStruct_800DC5EC *D_800DC5F4; diff --git a/src/code_80071F00.h b/src/code_80071F00.h index 8c3eae82e..e519f81fb 100644 --- a/src/code_80071F00.h +++ b/src/code_80071F00.h @@ -207,7 +207,6 @@ void func_80086D80(); // audio/external.c void func_800C9D80(Vec3f, Vec3f, u32); -void func_800C9EF4(Vec3f, s32); s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *mq); s32 osRecvMesg(OSMesgQueue*, OSMesg*, s32); diff --git a/src/code_80086E70.c b/src/code_80086E70.c index 80bb44d93..59e543b41 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -999,20 +999,17 @@ GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008933C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80072180(); // extern -s32 func_8007223C(?); // extern -f32 func_8008933C(Player *, s32, s32, s32); // extern -void func_800C9060(u8, s32); // extern +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-21-2022 +f32 func_8008933C(Player *, s32, s32, s32); /* extern */ -void func_80089474(s32 arg0, u8 arg1, s32 arg2, s32 arg3, s32 arg4) { +void func_80089474(s32 arg0, u8 arg1, s32 arg2, s32 arg3, u32 arg4) { Player *sp18; sp18 = &gPlayerOne[arg1]; - if (func_8007223C(0x4000000) != 0) { + if (func_8007223C(arg0, 0x04000000) != 0) { func_80072180(); } - if ((func_8008933C(sp18, arg0, arg2, arg3) >= 4.0) && ((sp18->unk_000 & 0x1000) != 0x1000)) { + if (((f64) func_8008933C(sp18, arg0, arg2, arg3) >= 4.0) && ((sp18->unk_000 & 0x1000) != 0x1000)) { func_800C9060(arg1, arg4); } } diff --git a/src/code_8008C1D0.c b/src/code_8008C1D0.c index 06d86c195..d9c5dea76 100644 --- a/src/code_8008C1D0.c +++ b/src/code_8008C1D0.c @@ -417,7 +417,7 @@ void func_8008CDC0(Player* player, s8 arg1) { } #ifdef MIPS_TO_C -//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-14-2022 void func_8008CEB0(Player *player, s8 arg1) { f32 sp2C; s16 sp2A; @@ -2226,9 +2226,7 @@ void func_800914A0(void) { } #ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern u16 D_80152308; -extern s16 D_8015F6F8; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-15-2022 extern u32 D_8015F718; static ? D_800E7080; /* unable to generate initializer */ static ? D_800E708C; /* unable to generate initializer */ @@ -2248,9 +2246,9 @@ void func_800914E0(void) { f32 temp_f8; s16 temp_a0; s16 temp_a0_2; - s16 temp_v0_2; - u32 temp_v0; - void *temp_v0_3; + s16 temp_v0; + u16 temp_t0; + void *temp_v0_2; sp64.unk0 = (s32) D_800E7080.unk0; sp64.unk4 = (s32) D_800E7080.unk4; @@ -2258,32 +2256,32 @@ void func_800914E0(void) { sp58.unk0 = (s32) D_800E708C.unk0; sp58.unk4 = (s32) D_800E708C.unk4; sp58.unk8 = (s32) D_800E708C.unk8; - temp_v0 = D_8015F718; - temp_a0 = temp_v0 & 0xFFFFFF; + temp_a0 = D_8015F718 & 0xFFFFFF; var_t1 = &gPlayerOneCopy; - sp48 = gSegmentTable[temp_v0 >> 0x18] + temp_a0 + 0x80000000; - temp_v0_2 = (s16) gPlayerOneCopy->unk_006 - D_80152308; + sp48 = gSegmentTable[(u32) D_8015F718 >> 0x18] + temp_a0 + 0x80000000; + temp_t0 = D_80152308; + temp_v0 = (s16) gPlayerOneCopy->unk_006 - temp_t0; cameras->up[0] = 0.0f; cameras->up[2] = 0.0f; cameras->up[1] = 1.0f; - if (temp_v0_2 == 7) { + if (temp_v0 == 7) { func_800914A0(temp_a0, 7); goto block_5; } - if (temp_v0_2 < 0xE) { - temp_a0_2 = temp_v0_2 + D_8015F6F8; + if (temp_v0 < 0xE) { + temp_a0_2 = temp_v0 + (s16) D_8015F6F8; if (temp_a0_2 == 7) { func_800914A0(temp_a0_2, 7); block_5: var_t1 = &gPlayerOneCopy; } } - temp_v0_3 = (D_80152308 * 8) + sp48; - temp_f8 = (f32) (temp_v0_3->unk0 + 0xA); + temp_v0_2 = (temp_t0 * 8) + sp48; + temp_f8 = (f32) (temp_v0_2->unk0 + 0xA); cameras->pos[0] = temp_f8; - temp_f16 = (f32) (temp_v0_3->unk2 + 7); + temp_f16 = (f32) (temp_v0_2->unk2 + 7); cameras->pos[1] = temp_f16; - temp_f4 = (f32) (temp_v0_3->unk4 - 0x14); + temp_f4 = (f32) (temp_v0_2->unk4 - 0x14); cameras->pos[2] = temp_f4; cameras->lookAt[0] = (*var_t1)->pos[0]; cameras->lookAt[1] = (*var_t1)->pos[1]; diff --git a/src/code_80091750.c b/src/code_80091750.c index 8f92c7930..5f452bd99 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -280,19 +280,13 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_80091B78.s") #endif #ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -extern OSPfs D_8018E868; -extern ? D_8018E938; -extern ? D_8018EB38; -extern s32 D_8018EB78; -extern s32 D_8018EB7C; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 extern u8 gControllerBits; -extern void *gControllerOne; -extern OSContStatus gControllerStatuses; +extern ? gControllerStatuses; s32 func_80091D74(void) { u8 sp67; - ? *var_s1; + s32 *var_s1; s32 temp_v0; s32 var_s0; @@ -302,7 +296,7 @@ s32 func_80091D74(void) { if ((*(&gControllerStatuses + 2) == 0) & 1) { return 0; } - if (!(gControllerOne->unk4 & 0x1000)) { + if (!(gControllerOne->button & 0x1000)) { return 0; } osPfsIsPlug(&gSIEventMesgQueue, &sp67); @@ -314,9 +308,9 @@ s32 func_80091D74(void) { if (osPfsNumFiles(&D_8018E868, &D_8018EB78, &D_8018EB7C) != 0) { return 0; } - var_s1 = &D_8018EB38; + var_s1 = D_8018EB38; do { - temp_v0 = osPfsFileState(&D_8018E868, var_s0, &D_8018E938 + (var_s0 << 5)); + temp_v0 = osPfsFileState(&D_8018E868, var_s0, &D_8018E938[var_s0]); var_s0 += 1; var_s1 += 4; var_s1->unk-4 = temp_v0; @@ -1685,14 +1679,8 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_80094C60.s") #endif #ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -void func_8009E230(); /* extern */ -void func_800CA0A0(); /* extern */ -void play_sound2(?); /* extern */ -extern s8 D_8018E7B0; -extern s8 D_8018EDF1; -extern s8 D_8018EE0C; -static s8 *gDebugCharacterNames[8] = { "MARIO", "LUIGI", "YOSHI", "KINOPIO", "D.KONG", "WARIO", "PEACH", "KOOPA" }; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +? func_8009E230(); /* extern */ static s8 *gDebugCourseNames[0x14] = { "m circuit", "mountain", @@ -1715,22 +1703,22 @@ static s8 *gDebugCourseNames[0x14] = { "jungle", "doughnut", }; +static s8 *gDebugCharacterNames[8] = { "MARIO", "LUIGI", "YOSHI", "KINOPIO", "D.KONG", "WARIO", "PEACH", "KOOPA" }; static s8 *gDebugScreenModeNames[5] = { "1p", "2players UD", "2players LR", "3players", "4players" }; s16 gCurrentCourseId; /* unable to generate initializer */ s8 *gDebugSoundModeNames[4] = { "stereo", "head phone", "xxx", "monaural" }; void func_80095574(void) { Gfx *temp_v1; - s16 temp_a3; - s16 temp_a3_2; s32 var_v0; s32 var_v0_2; - s8 temp_t8; + s8 temp_v0; if ((D_8018EE0C < 3) || (D_8018E7B0 != 0)) { func_800A8230(); } - if (gDebugMenuSelection >= 2) { + temp_v0 = gDebugMenuSelection; + if (temp_v0 >= 2) { load_debug_font(); debug_print_str2(0x00000050, 0x00000064, "debug_mode"); switch (gDebugMenuSelection) { @@ -1758,18 +1746,16 @@ void func_80095574(void) { } else { debug_print_str2(0x000000AA, 0x00000064, "off"); } - temp_a3 = gCurrentCourseId; - if ((temp_a3 >= 0x14) || (temp_a3 < 0)) { + if ((gCurrentCourseId >= 0x14) || (gCurrentCourseId < 0)) { gCurrentCourseId = 0; } print_str_num(0x00000050, 0x0000006E, "map_number", (s32) gCurrentCourseId); - temp_a3_2 = gCurrentCourseId; - if (temp_a3_2 < 0xA) { + if (gCurrentCourseId < 0xA) { var_v0 = 0; } else { var_v0 = 8; } - debug_print_str2(var_v0 + 0xB9, 0x0000006E, gDebugCourseNames[temp_a3_2]); + debug_print_str2(var_v0 + 0xB9, 0x0000006E, gDebugCourseNames[gCurrentCourseId]); debug_print_str2(0x00000050, 0x00000078, "screen_mode"); debug_print_str2(0x000000AA, 0x00000078, gDebugScreenModeNames[D_8018EDF1]); debug_print_str2(0x00000050, 0x00000082, "player"); @@ -1781,14 +1767,14 @@ void func_80095574(void) { } func_80057778(); } - if (gDebugMenuSelection == DEBUG_MENU_DISABLED) { + if (temp_v0 == DEBUG_MENU_DISABLED) { gMenuTimingCounter += 1; } else { gMenuTimingCounter = 3; } var_v0_2 = gMenuTimingCounter; - if (var_v0_2 == 2) { - play_sound2(SOUND_INTRO_WELCOME); + if (var_v0_2 == DEBUG_MENU_DEBUG_MODE) { + play_sound2(0x49009009); var_v0_2 = gMenuTimingCounter; } if (var_v0_2 >= 0x12D) { @@ -1855,49 +1841,39 @@ Gfx *func_800959F8(Gfx *displayListHead, Vtx *arg1) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 void func_80095AE0(Mtx *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { s32 sp14; s32 sp10; s32 spC; s32 sp8; - s32 *temp_a2; - s32 *temp_a3; - s32 *temp_v0_2; - s32 *temp_v1; - s32 temp_v0; - Mtx *phi_v1; - s32 phi_v0; + Mtx *var_v1; + s32 var_v0; - phi_v1 = arg0; - phi_v0 = 0; + var_v0 = 0; + var_v1 = arg0; do { - temp_v0 = phi_v0 + 4; - phi_v1->m[0][0] = 0; - phi_v1->m[0][1] = 0; - phi_v1->m[0][2] = 0; - phi_v1->m[0][3] = 0; - phi_v1 += 0x10; - phi_v0 = temp_v0; - } while (temp_v0 != 0x10); - temp_v0_2 = &sp14; - temp_v1 = &sp10; - temp_a2 = &spC; - temp_a3 = &sp8; + var_v0 += 4; + var_v1->m[0][0] = 0; + var_v1->m[0][1] = 0; + var_v1->m[0][2] = 0; + var_v1->m[0][3] = 0; + var_v1 += 0x10; + } while (var_v0 != 0x10); sp14 = (s32) (arg3 * 65536.0f); sp10 = (s32) (arg4 * 65536.0f); spC = (s32) (arg1 * 65536.0f); sp8 = (s32) (arg2 * 65536.0f); - arg0->unk0 = (s16) temp_v0_2->unk0; + arg0->unk0 = (s16) sp14.unk0; arg0->unk14 = 1; - arg0->unkA = (s16) temp_v1->unk0; - arg0->unk18 = (s16) temp_a2->unk0; + arg0->unkA = (s16) sp10.unk0; + arg0->unk18 = (s16) spC.unk0; arg0->unk1E = 1; - arg0->unk1A = (s16) temp_a3->unk0; - arg0->unk20 = (s16) temp_v0_2->unk2; - arg0->unk2A = (s16) temp_v1->unk2; - arg0->unk38 = (s16) temp_a2->unk2; - arg0->unk3A = (s16) temp_a3->unk2; + arg0->unk1A = (s16) sp8.unk0; + arg0->unk20 = (s16) sp14.unk2; + arg0->unk2A = (s16) sp10.unk2; + arg0->unk38 = (s16) spC.unk2; + arg0->unk3A = (s16) sp8.unk2; } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_80095AE0.s") @@ -3051,19 +3027,21 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_80097274.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +void *func_80095E10(Gfx *, s8, ?, ?, s32, s32, s32, s32, s32, s32, s32, s32, s32); /* extern */ + Gfx *func_80097A14(Gfx *arg0, s8 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, s32 arg9, s32 argA) { Gfx *temp_a0; - Gfx *temp_v0; + void *temp_v0; temp_a0 = arg0 + 8; arg0->words.w0 = 0xE7000000; arg0->words.w1 = 0; - temp_a0->words.w1 = 0x200000; + temp_a0->words.w1 = 0x00200000; temp_a0->words.w0 = 0xBA001402; temp_v0 = func_80095E10(temp_a0 + 8, arg1, 0x1000, 0x400, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, argA); - temp_v0->words.w0 = 0xE7000000; - temp_v0->words.w1 = 0; + temp_v0->unk0 = 0xE7000000; + temp_v0->unk4 = 0; temp_v0->unk8 = 0xBA001402; temp_v0->unkC = 0; return temp_v0 + 0x10; @@ -3728,7 +3706,7 @@ loop_4: GLOBAL_ASM("asm/non_matchings/code_80091750/func_80099184.s") #endif -void func_8009969C(s32 arg0) { +void func_8009969C(MkTexture *arg0) { func_800996BC(arg0, 1); } @@ -4136,71 +4114,50 @@ void func_8009A344(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 0ca3d5f5fa5e3d957908269ac1535e7d4f12bce9 -void func_8009969C(MkTexture *, s32, MkAnimation *); /* extern */ - +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 s32 func_8009A374(MkAnimation *arg0) { s32 sp24; struct_8018DEE0_entry *sp1C; - MkAnimation *temp_a2; MkAnimation *temp_v0; - MkTexture *temp_a0; - s32 temp_a1; + MkAnimation *var_a2; + s32 temp_a0; + s32 var_a1; struct_8018DEE0_entry *temp_v1; - struct_8018DEE0_entry *temp_v1_2; - s32 phi_a1; - struct_8018DEE0_entry *phi_v1; - s32 phi_a1_2; - MkAnimation *phi_a2; + struct_8018DEE0_entry *var_v1; temp_v0 = segmented_to_virtual_dupe_2(arg0); - temp_a2 = temp_v0; - phi_a1 = 0; - phi_a1_2 = 0; - phi_a2 = temp_a2; + var_a1 = 0; if (D_8018DEE0->visible != 0) { - phi_v1 = D_8018DEE0; + var_v1 = D_8018DEE0; loop_2: - temp_a1 = phi_a1 + 1; - temp_v1 = phi_v1 + 0x18; - phi_a1 = temp_a1; - phi_v1 = temp_v1; - phi_a1_2 = temp_a1; - if (temp_a1 >= 0x10) { + var_a1 += 1; + var_v1 += 0x18; + if (var_a1 >= 0x10) { loop_3: goto loop_3; } - if (temp_v1->visible == 0) { + if (var_v1->visible == 0) { goto block_5; } goto loop_2; } block_5: - temp_v1_2 = &D_8018DEE0[phi_a1_2]; - temp_v1_2->textureSequence = temp_v0; - temp_v1_2->sequenceIndex = -1; - temp_v1_2->frameCountDown = 0; - temp_v1_2->visible = 0x80000000; - temp_v1_2->D_8018E118_index = gNumD_8018E118Entries; - if (temp_v0->mk64Texture != 0) { - arg0 = temp_a2; - sp24 = phi_a1_2; - sp1C = temp_v1_2; - func_8009969C(temp_a2->mk64Texture, phi_a1_2, temp_a2); - phi_a2 = arg0; + temp_v1 = &D_8018DEE0[var_a1]; + temp_v1->textureSequence = temp_v0; + temp_v1->sequenceIndex = -1; + temp_v1->frameCountDown = 0; + temp_v1->visible = 0x80000000; + temp_v1->D_8018E118_index = gNumD_8018E118Entries; + if (temp_v0->mk64Texture != NULL) { + func_8009969C(temp_v0->mk64Texture); } - temp_a0 = phi_a2->unk8; - if (temp_a0 != 0) { - sp1C = &D_8018DEE0[phi_a1_2]; - sp24 = phi_a1_2; - func_8009969C(temp_a0, phi_a1_2, phi_a2); + if (temp_v0->unk8 != NULL) { + func_8009969C(temp_v0->unk8); } else { - sp24 = phi_a1_2; - sp1C = &D_8018DEE0[phi_a1_2]; - func_8009969C(phi_a2->mk64Texture, phi_a1_2, phi_a2); + func_8009969C(temp_v0->mk64Texture); } - D_8018DEE0[phi_a1_2].unk14 = 0; - return sp24; + temp_v1->unk14 = 0; + return var_a1; } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009A374.s") @@ -5434,84 +5391,84 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009CA6C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 draw_box(s32, s32, s32, s32, s32, s32, s32, s32, s32); // extern -extern ? D_800E7AE8; -extern UnkStruct_800DC5EC D_8015F480; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +struct _struct_D_800E7AE8_0x8 { + /* 0x0 */ u16 unk0; /* inferred */ + /* 0x2 */ u16 unk2; /* inferred */ + /* 0x4 */ u16 unk4; /* inferred */ + /* 0x6 */ char pad6[2]; +}; /* size = 0x8 */ + extern ? D_8018E7AC; -extern u32 D_8018E7B8; -extern s32 D_8018E7D0; +extern ? D_8018E7B8; +extern ? D_8018E7D0; extern ? D_8018E7E8; extern ? D_8018E810; -extern s8 D_8018EE0C; -extern s32 gDisplayListHead; +static struct _struct_D_800E7AE8_0x8 D_800E7AE8[0]; /* unable to generate initializer */ void func_8009CBE4(s32 arg0, s32 arg1, s32 arg2) { u32 *sp40; u32 *sp3C; + s16 var_ra; + s16 var_t2; + s16 var_t3; + s16 var_t5; s32 temp_t0; s32 temp_t1; s32 temp_v0; s32 temp_v0_2; - s32 temp_v0_4; s32 temp_v1_3; + struct UnkStruct_800DC5EC *temp_v0_3; + struct _struct_D_800E7AE8_0x8 *temp_v0_4; u32 *temp_t4; u32 *temp_t9; u32 temp_t6; void *temp_a0; void *temp_a0_2; - void *temp_v0_3; - void *temp_v0_5; void *temp_v1; void *temp_v1_2; - s16 phi_t2; - s32 phi_t5; - s16 phi_t3; - s32 phi_ra; - temp_v0 = gModeSelection; - if ((temp_v0 == GRAND_PRIX) || (temp_v0 == TIME_TRIALS)) { - temp_v0_4 = arg0 * 8; - temp_v1_2 = temp_v0_4 + &D_8018E7E8; - temp_a0_2 = temp_v0_4 + &D_8018E810; - phi_t2 = temp_v1_2->unk0; - phi_t5 = temp_a0_2->unk0; - phi_t3 = temp_v1_2->unk2; - phi_ra = temp_a0_2->unk2; + if ((gModeSelection == 0) || (gModeSelection == 1)) { + temp_v0 = arg0 * 8; + temp_v1 = temp_v0 + &D_8018E7E8; + temp_a0 = temp_v0 + &D_8018E810; + var_t2 = temp_v1->unk0; + var_t3 = temp_v1->unk2; + var_t5 = temp_a0->unk0; + var_ra = temp_a0->unk2; } else { temp_v0_2 = arg0 * 8; if (arg0 >= 4) { - temp_v1 = temp_v0_2 + &D_8018E7E8; - temp_a0 = temp_v0_2 + &D_8018E810; - phi_t2 = temp_v1->unk0; - phi_t5 = temp_a0->unk0; - phi_t3 = temp_v1->unk2; - phi_ra = temp_a0->unk2; + temp_v1_2 = temp_v0_2 + &D_8018E7E8; + temp_a0_2 = temp_v0_2 + &D_8018E810; + var_t2 = temp_v1_2->unk0; + var_t3 = temp_v1_2->unk2; + var_t5 = temp_a0_2->unk0; + var_ra = temp_a0_2->unk2; } else { - temp_v0_3 = (arg0 << 6) + &D_8015F480; - phi_t2 = temp_v0_3->unk30; - phi_t5 = temp_v0_3->unk2C; - phi_t3 = temp_v0_3->unk32; - phi_ra = temp_v0_3->unk2E; + temp_v0_3 = &D_8015F480[arg0]; + var_t2 = temp_v0_3->screenStartX; + var_t3 = temp_v0_3->screenStartY; + var_t5 = temp_v0_3->screenWidth; + var_ra = temp_v0_3->screenHeight; } } - temp_v0_5 = (arg2 * 8) + &D_800E7AE8; + temp_v0_4 = &D_800E7AE8[arg2]; temp_t1 = arg0 * 4; temp_t4 = temp_t1 + &D_8018E7D0; - temp_v1_3 = phi_t5 / 2; - temp_t0 = phi_ra / 2; + temp_v1_3 = var_t5 / 2; + temp_t0 = var_ra / 2; temp_t9 = temp_t1 + &D_8018E7B8; sp3C = temp_t9; sp40 = temp_t4; - gDisplayListHead = draw_box(gDisplayListHead, phi_t2 - temp_v1_3, phi_t3 - temp_t0, temp_v1_3 + phi_t2, temp_t0 + phi_t3, temp_v0_5->unk0, temp_v0_5->unk2, temp_v0_5->unk4, 0xFF - ((*temp_t4 * 0xFF) / *temp_t9)); - if ((arg1 == 0) && (temp_t6 = *temp_t4 + 1, *temp_t4 = temp_t6, ((temp_t6 < *sp3C) == 0))) { - if (gGamestate == RACING) { + gDisplayListHead = draw_box(gDisplayListHead, var_t2 - temp_v1_3, var_t3 - temp_t0, temp_v1_3 + var_t2, temp_t0 + var_t3, (s32) temp_v0_4->unk0, (s32) temp_v0_4->unk2, (s32) temp_v0_4->unk4, 0xFF - ((u32) (*temp_t4 * 0xFF) / (u32) *temp_t9)); + if ((arg1 == 0) && (temp_t6 = *temp_t4 + 1, *temp_t4 = temp_t6, ((temp_t6 < (u32) *sp3C) == 0))) { + if (gGamestate == 4) { *(&D_8018E7AC + arg0) = 6; return; } *(&D_8018E7AC + arg0) = 0; D_8018EE0C = 0; - // Duplicate return node #11. Try simplifying control flow for better match } } #else @@ -5526,8 +5483,6 @@ void func_8009CDFC(s32 arg0, s32 arg1) { func_8009CBE4(arg0, arg1, 1); } -extern u8 gSoundMode; - void func_8009CE1C(void) { if ((gSoundMode != 3) && (gPlayerCountSelection1 >= 2)) { func_800C3448(0xE0000002); @@ -5535,125 +5490,98 @@ void func_8009CE1C(void) { } #ifdef MIPS_TO_C -//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b -? func_8009CE1C(s32 *, s32, s32, s32); /* extern */ -extern s32 D_800E86A4; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 extern s16 D_8015F892; extern ? D_8018E7AC; -extern s8 D_8018E7B0; -extern u32 D_8018EDE0; -extern s8 D_8018EDFB; -extern s8 D_8018EE08; -extern s8 D_8018EE0C; -extern s16 gCreditsCourseId; -extern s8 gDebugGotoScene; -extern s32 gGamestate; -extern s32 gGamestateNext; -extern s32 gMenuSelectionFromEndingSequence; -u8 gCupSelectionByCourseId[0x15]; /* unable to generate initializer */ s16 gCurrentCourseId; /* unable to generate initializer */ +u8 gCupSelectionByCourseId[0x15]; /* unable to generate initializer */ u8 gPerCupIndexByCourseId[0x15]; /* unable to generate initializer; const */ -void func_8009CE64(s32 *arg0, s32 arg1, s32 arg2, s32 arg3) { +void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) { s32 sp28; s8 *sp18; - s16 temp_a0; s32 *var_a0; s32 temp_t6; s32 temp_t6_2; - s32 temp_v0; - s32 temp_v0_7; s32 temp_v1; s32 temp_v1_2; - s32 temp_v1_3; - s32 temp_v1_5; - s32 temp_v1_6; - s32 temp_v1_8; s32 var_a1; s32 var_a1_2; s32 var_a2; - s32 var_a3; s32 var_t7; s32 var_v0; - s8 *temp_v0_2; - s8 temp_v1_4; - s8 temp_v1_7; - s8 temp_v1_9; + s8 *temp_v0; + struct_8018D9E0_entry *temp_v0_2; struct_8018D9E0_entry *temp_v0_3; struct_8018D9E0_entry *temp_v0_4; struct_8018D9E0_entry *temp_v0_5; - struct_8018D9E0_entry *temp_v0_6; - u32 temp_t9; var_a0 = arg0; - var_a2 = arg2; - var_a3 = arg3; - temp_v0 = gGamestate; + var_a2 = arg3; var_a1 = 0; - if (temp_v0 == (s32) 5) { - temp_v1 = gCCSelection; - if ((temp_v1 != CC_150) && (temp_v1 != CC_EXTRA)) { + if (gGamestate == (s32) 5) { + if ((gCCSelection != 2) && (gCCSelection != 3)) { - } else if ((D_802874F5 < 3) && (gCupSelection == SPECIAL_CUP)) { + } else if ((D_802874F5 < 3) && (gCupSelection == 3)) { var_a1 = 1; } if (var_a1 != 0) { - gMenuSelectionFromEndingSequence = CREDITS_SEQUENCE; - gCreditsCourseId = COURSE_LUIGI_RACEWAY; + gMenuSelectionFromEndingSequence = 9; + gCreditsCourseId = 8; return; } - gMenuSelectionFromEndingSequence = MAIN_MENU_FROM_QUIT; - gMenuSelection = MAIN_MENU; + gMenuSelectionFromEndingSequence = 1; + gMenuSelection = 0x0000000B; return; } - if (temp_v0 == 4) { - temp_v0_2 = var_a0 + &D_8018E7AC; - if (*temp_v0_2 == 2) { - if (temp_v0_2 != &D_8018E7B0) { - *temp_v0_2 = 5; + if (gGamestate == 4) { + temp_v0 = var_a0 + &D_8018E7AC; + if (*temp_v0 == 2) { + if (temp_v0 != &D_8018E7B0) { + *temp_v0 = 5; return; } - sp18 = temp_v0_2; + sp18 = temp_v0; sp28 = 0; - temp_v0_3 = find_8018D9E0_entry(0x000000B0); - if (temp_v0_3 != NULL) { - temp_v1_2 = temp_v0_3->unk4; - switch (temp_v1_2) { /* switch 7; irregular */ - case 10: /* switch 7 */ + temp_v0_2 = find_8018D9E0_entry(0x000000B0); + if (temp_v0_2 != NULL) { + temp_v1 = temp_v0_2->unk4; + switch (temp_v1) { /* switch 8; irregular */ + case 10: /* switch 8 */ func_802903B0(); return; - case 11: /* switch 7 */ + case 11: /* switch 8 */ func_80290388(); return; - case 12: /* switch 7 */ + case 12: /* switch 8 */ func_80290360(); return; - default: /* switch 7 */ - case 13: /* switch 7 */ + default: /* switch 8 */ + case 13: /* switch 8 */ func_80290338(); return; } } else { sp28 = 0; - temp_v0_4 = find_8018D9E0_entry(0x000000AC); - if (temp_v0_4 != NULL) { - temp_v1_3 = temp_v0_4->unk4; - switch (temp_v1_3) { /* switch 6; irregular */ - case 11: /* switch 6 */ + temp_v0_3 = find_8018D9E0_entry(0x000000AC); + if (temp_v0_3 != NULL) { + temp_v1_2 = temp_v0_3->unk4; + switch (temp_v1_2) { /* switch 7; irregular */ + case 11: /* switch 7 */ func_802903B0(); D_8016556E = 1; return; - default: /* switch 6 */ - case 12: /* switch 6 */ + default: /* switch 7 */ + case 12: /* switch 7 */ func_80290338(); return; } } else { sp28 = 0; - temp_v0_5 = find_8018D9E0_entry(0x000000C7); + temp_v0_4 = find_8018D9E0_entry(0x000000C7); var_a1_2 = 0; - if (temp_v0_5 != NULL) { - temp_t6 = temp_v0_5->unk4; + if (temp_v0_4 != NULL) { + temp_t6 = temp_v0_4->unk4; switch (temp_t6) { /* switch 1 */ case 12: /* switch 1 */ func_802903B0(); @@ -5686,9 +5614,9 @@ void func_8009CE64(s32 *arg0, s32 arg1, s32 arg2, s32 arg3) { D_800DC5FC = 0; } } - temp_v0_6 = find_8018D9E0_entry(0x000000BD); - if (temp_v0_6 != NULL) { - temp_t6_2 = temp_v0_6->unk4; + temp_v0_5 = find_8018D9E0_entry(0x000000BD); + if (temp_v0_5 != NULL) { + temp_t6_2 = temp_v0_5->unk4; switch (temp_t6_2) { /* switch 2 */ case 11: /* switch 2 */ D_8015F892 = 1; @@ -5724,16 +5652,14 @@ void func_8009CE64(s32 *arg0, s32 arg1, s32 arg2, s32 arg3) { } } else { *(&D_8018E7AC + var_a0) = 0; - if (gDebugMenuSelection != DEBUG_MENU_EXITED) { - temp_t9 = D_8018EDE0; - switch (temp_t9) { /* switch 3 */ + if (gDebugMenuSelection != 0x40) { + switch (D_8018EDE0) { /* switch 3 */ case 0: /* switch 3 */ var_a0 = &gMenuSelection; - temp_v0_7 = gMenuSelection; var_a2 = 2; - var_t7 = temp_v0_7 + 1; - if (temp_v0_7 == LOGO_INTRO_MENU) { - gMenuSelection = START_MENU; + var_t7 = gMenuSelection + 1; + if (gMenuSelection == 8) { + gMenuSelection = 0x0000000A; D_800E86A4 = 2; } else { block_74: @@ -5748,60 +5674,57 @@ block_74: D_800DC51C = 1; D_8018EE08 = 1; gGamestateNext = 4; - gCCSelection = (s32) CC_100; - temp_v1_4 = (s8) gNextDemoId; - switch (temp_v1_4) { /* switch 4 */ + gCCSelection = (s32) 1; + switch (gNextDemoId) { /* switch 4 */ case 0: /* switch 4 */ gCurrentCourseId = 0; - gScreenModeSelection = SCREEN_MODE_1P; + gScreenModeSelection = 0; gPlayerCountSelection1 = (s32) 1; D_8018EDF3 = 1; gCharacterSelections->unk0 = 0; - gModeSelection = GRAND_PRIX; + gModeSelection = 0; break; case 1: /* switch 4 */ gCurrentCourseId = (s16) 1; var_a2 = 2; - gScreenModeSelection = (s32) SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL; + gScreenModeSelection = (s32) 1; gPlayerCountSelection1 = 2; D_8018EDF3 = (s8) 2; gCharacterSelections->unk0 = (s8) 2; gCharacterSelections->unk1 = (s8) 4; - gModeSelection = VERSUS; + gModeSelection = 2; break; case 2: /* switch 4 */ gCurrentCourseId = 0x000B; - gScreenModeSelection = SCREEN_MODE_1P; + gScreenModeSelection = 0; gPlayerCountSelection1 = (s32) 1; D_8018EDF3 = 1; gCharacterSelections->unk0 = 1; - gModeSelection = GRAND_PRIX; + gModeSelection = 0; break; case 3: /* switch 4 */ gCurrentCourseId = 0x000E; - var_a3 = 3; var_a2 = 2; - gScreenModeSelection = SCREEN_MODE_3P_4P_SPLITSCREEN; + gScreenModeSelection = 3; gPlayerCountSelection1 = 3; D_8018EDF3 = (s8) 3; gCharacterSelections->unk0 = 5; gCharacterSelections->unk1 = (s8) 2; gCharacterSelections->unk2 = 7; - gModeSelection = VERSUS; + gModeSelection = 2; break; case 4: /* switch 4 */ var_a2 = 2; gCurrentCourseId = (s16) 2; - gScreenModeSelection = SCREEN_MODE_1P; + gScreenModeSelection = 0; gPlayerCountSelection1 = (s32) 1; D_8018EDF3 = 1; gCharacterSelections->unk0 = 7; - gModeSelection = GRAND_PRIX; + gModeSelection = 0; break; case 5: /* switch 4 */ gCurrentCourseId = 0x000C; var_a2 = 2; - var_a3 = 3; gScreenModeSelection = 3; gPlayerCountSelection1 = 4; D_8018EDF3 = (s8) 4; @@ -5809,11 +5732,11 @@ block_74: gCharacterSelections->unk1 = 1; gCharacterSelections->unk2 = 6; gCharacterSelections->unk3 = (s8) 3; - gModeSelection = VERSUS; + gModeSelection = 2; break; } - gNextDemoId = temp_v1_4 + 1; - if ((s8) gNextDemoId >= 6) { + gNextDemoId += 1; + if (gNextDemoId >= 6) { gNextDemoId = 0; } var_a0 = (s32 *) gCurrentCourseId; @@ -5823,22 +5746,20 @@ block_74: break; case 3: /* switch 3 */ var_a0 = &gMenuSelection; - temp_v1_5 = gMenuSelection; - if (temp_v1_5 != DATA_MENU) { - if (temp_v1_5 == MAIN_MENU) { - gMenuSelection = DATA_MENU; + if (gMenuSelection != 6) { + if (gMenuSelection == 0x0000000B) { + gMenuSelection = 6; } } else { - gMenuSelection = MAIN_MENU; + gMenuSelection = 0x0000000B; } break; case 4: /* switch 3 */ var_a0 = &gMenuSelection; - temp_v1_6 = gMenuSelection; var_t7 = 0x0000000B; - if (temp_v1_6 != (s32) OPTIONS_MENU) { - if (temp_v1_6 == MAIN_MENU) { - gMenuSelection = (s32) OPTIONS_MENU; + if (gMenuSelection != (s32) 5) { + if (gMenuSelection == 0x0000000B) { + gMenuSelection = (s32) 5; } } else { goto block_74; @@ -5850,71 +5771,68 @@ block_74: } if (gMenuSelection >= 0xE) { gGamestateNext = 4; - if (gModeSelection == TIME_TRIALS) { + if (gModeSelection == 1) { D_8018EDFB = (s8) 1; } - func_8009CE1C(var_a0, 1, var_a2, var_a3); + func_8009CE1C(var_a0, 1, var_a2); } D_8018EE0C = 0; return; } - switch (gDebugGotoScene) { /* switch 5; irregular */ - case DEBUG_GOTO_ENDING_SEQUENCE: /* switch 5 */ + switch (gDebugGotoScene) { /* switch 5; irregular */ + case 1: /* switch 5 */ gGamestateNext = (s32) 5; break; - case DEBUG_GOTO_CREDITS_SEQUENCE_CC_50: /* switch 5 */ - case DEBUG_GOTO_CREDITS_SEQUENCE_CC_EXTRA: /* switch 5 */ + case 2: /* switch 5 */ + case 3: /* switch 5 */ gGamestateNext = 9; - gCreditsCourseId = COURSE_LUIGI_RACEWAY; + gCreditsCourseId = 8; break; default: /* switch 5 */ gGamestateNext = 4; - if (gModeSelection == (s32) TIME_TRIALS) { + if (gModeSelection == (s32) 1) { D_8018EDFB = 1; } - } else { - gGamestateNext = (s32) 5; + break; } func_8000F124(1, 2); - if ((gScreenModeSelection == SCREEN_MODE_3P_4P_SPLITSCREEN) && ((temp_v1_8 = gModeSelection, (temp_v1_8 == GRAND_PRIX)) || (temp_v1_8 == TIME_TRIALS))) { - gModeSelection = VERSUS; + if ((gScreenModeSelection == 3) && ((gModeSelection == 0) || (gModeSelection == 1))) { + gModeSelection = 2; } - temp_a0 = gCurrentCourseId; - if ((temp_a0 != 0x000F) && (temp_a0 != 0x0010) && (temp_a0 != 0x0011) && (temp_a0 != 0x0013)) { + if ((gCurrentCourseId != 0x000F) && (gCurrentCourseId != 0x0010) && (gCurrentCourseId != 0x0011) && (gCurrentCourseId != 0x0013)) { var_v0 = gModeSelection; - if (var_v0 == BATTLE) { - gModeSelection = GRAND_PRIX; - var_v0 = GRAND_PRIX; + if (var_v0 == 3) { + gModeSelection = 0; + var_v0 = 0; } - if ((var_v0 == VERSUS) && (gPlayerCountSelection1 == 1)) { - gModeSelection = GRAND_PRIX; + if ((var_v0 == 2) && (gPlayerCountSelection1 == 1)) { + gModeSelection = 0; } } else { - gModeSelection = BATTLE; + gModeSelection = 3; if (gPlayerCountSelection1 == 1) { D_8018EDF3 = (s8) 2; - gScreenModeSelection = SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL; + gScreenModeSelection = 1; gPlayerCountSelection1 = (s32) D_8018EDF3; } } - gCupSelection = (s8) gCupSelectionByCourseId[temp_a0]; - temp_v1_9 = gDebugGotoScene; + gCupSelection = (s8) gCupSelectionByCourseId[gCurrentCourseId]; D_800DC540 = (s32) gCupSelection; - gCupCourseSelection = (s8) gPerCupIndexByCourseId[temp_a0]; - switch (temp_v1_9) { /* switch 6; irregular */ + gCupCourseSelection = (s8) gPerCupIndexByCourseId[gCurrentCourseId]; + switch (gDebugGotoScene) { /* switch 6; irregular */ case 2: /* switch 6 */ - gCCSelection = CC_50; + gCCSelection = 0; return; case 3: /* switch 6 */ - gCCSelection = CC_EXTRA; + gCCSelection = 3; return; default: /* switch 6 */ - if (gCCSelection == CC_EXTRA) { + if (gCCSelection == 3) { gIsMirrorMode = 1; return; } gIsMirrorMode = 0; - case 1: /* switch 5 */ + case 1: /* switch 6 */ default: /* switch 2 */ return; } @@ -5925,84 +5843,84 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009CE64.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 draw_box(s32, s32, s32, s32, s32, s32, s32, s32, u32); // extern -void func_8009CE64(s32); // extern -extern ? D_800E7AE8; -extern UnkStruct_800DC5EC D_8015F480; -extern u32 D_8018E7B8; -extern s32 D_8018E7D0; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +struct _struct_D_800E7AE8_0x8 { + /* 0x0 */ u16 unk0; /* inferred */ + /* 0x2 */ u16 unk2; /* inferred */ + /* 0x4 */ u16 unk4; /* inferred */ + /* 0x6 */ char pad6[2]; +}; /* size = 0x8 */ + +? func_8009CE64(s32); /* extern */ +extern ? D_8018E7B8; +extern ? D_8018E7D0; extern ? D_8018E7E8; extern ? D_8018E810; -extern s32 gDisplayListHead; +static struct _struct_D_800E7AE8_0x8 D_800E7AE8[0]; /* unable to generate initializer */ void func_8009D77C(s32 arg0, s32 arg1, s32 arg2) { s32 sp44; u32 *sp3C; u32 *sp38; + s16 var_ra; + s16 var_t3; + s16 var_t4; s32 temp_t8; s32 temp_v0; s32 temp_v0_2; s32 temp_v0_4; - s32 temp_v0_5; s32 temp_v1_3; + struct UnkStruct_800DC5EC *temp_v0_3; + struct _struct_D_800E7AE8_0x8 *temp_v0_5; u32 *temp_t1; u32 *temp_t5; - u32 temp_lo; u32 temp_t6; + u32 var_t2; void *temp_a0; void *temp_a0_2; - void *temp_v0_3; - void *temp_v0_6; void *temp_v1; void *temp_v1_2; - s16 phi_t3; - s32 phi_ra; - s16 phi_t4; - u32 phi_t2; - temp_v0 = gModeSelection; - if ((temp_v0 == GRAND_PRIX) || (temp_v0 == TIME_TRIALS)) { - temp_v0_4 = arg0 * 8; - temp_a0_2 = temp_v0_4 + &D_8018E810; - temp_v1_2 = temp_v0_4 + &D_8018E7E8; - sp44 = temp_a0_2->unk2; - phi_t3 = temp_v1_2->unk0; - phi_ra = temp_a0_2->unk0; - phi_t4 = temp_v1_2->unk2; + if ((gModeSelection == 0) || (gModeSelection == 1)) { + temp_v0 = arg0 * 8; + temp_a0 = temp_v0 + &D_8018E810; + temp_v1 = temp_v0 + &D_8018E7E8; + var_t3 = temp_v1->unk0; + var_t4 = temp_v1->unk2; + var_ra = temp_a0->unk0; + sp44 = (s32) temp_a0->unk2; } else if (arg0 >= 4) { temp_v0_2 = arg0 * 8; - temp_a0 = temp_v0_2 + &D_8018E810; - temp_v1 = temp_v0_2 + &D_8018E7E8; - sp44 = temp_a0->unk2; - phi_t3 = temp_v1->unk0; - phi_ra = temp_a0->unk0; - phi_t4 = temp_v1->unk2; + temp_a0_2 = temp_v0_2 + &D_8018E810; + temp_v1_2 = temp_v0_2 + &D_8018E7E8; + var_t3 = temp_v1_2->unk0; + var_t4 = temp_v1_2->unk2; + var_ra = temp_a0_2->unk0; + sp44 = (s32) temp_a0_2->unk2; } else { - temp_v0_3 = (arg0 << 6) + &D_8015F480; - sp44 = temp_v0_3->unk2E; - phi_t3 = temp_v0_3->unk30; - phi_ra = temp_v0_3->unk2C; - phi_t4 = temp_v0_3->unk32; + temp_v0_3 = &D_8015F480[arg0]; + var_t3 = temp_v0_3->screenStartX; + var_t4 = temp_v0_3->screenStartY; + var_ra = temp_v0_3->screenWidth; + sp44 = (s32) temp_v0_3->screenHeight; } - temp_v0_5 = arg0 * 4; - temp_t1 = temp_v0_5 + &D_8018E7D0; - temp_t5 = temp_v0_5 + &D_8018E7B8; - temp_lo = (*temp_t1 * 0xFF) / *temp_t5; - phi_t2 = temp_lo; - if (temp_lo >= 0x100) { - phi_t2 = 0xFF; + temp_v0_4 = arg0 * 4; + temp_t1 = temp_v0_4 + &D_8018E7D0; + temp_t5 = temp_v0_4 + &D_8018E7B8; + var_t2 = (u32) (*temp_t1 * 0xFF) / (u32) *temp_t5; + if ((s32) var_t2 >= 0x100) { + var_t2 = 0x000000FF; } - temp_v1_3 = phi_ra / 2; + temp_v1_3 = var_ra / 2; temp_t8 = sp44 / 2; - temp_v0_6 = (arg2 * 8) + &D_800E7AE8; + temp_v0_5 = &D_800E7AE8[arg2]; sp3C = temp_t1; sp38 = temp_t5; - gDisplayListHead = draw_box(gDisplayListHead, phi_t3 - temp_v1_3, phi_t4 - temp_t8, temp_v1_3 + phi_t3, temp_t8 + phi_t4, temp_v0_6->unk0, temp_v0_6->unk2, temp_v0_6->unk4, phi_t2); + gDisplayListHead = draw_box(gDisplayListHead, var_t3 - temp_v1_3, var_t4 - temp_t8, temp_v1_3 + var_t3, temp_t8 + var_t4, (s32) temp_v0_5->unk0, (s32) temp_v0_5->unk2, (s32) temp_v0_5->unk4, (s32) var_t2); if (arg1 == 0) { temp_t6 = *temp_t1 + 1; *temp_t1 = temp_t6; - if ((*temp_t5 + 1) < temp_t6) { + if ((u32) (*temp_t5 + 1) < temp_t6) { func_8009CE64(arg0); } } @@ -6019,210 +5937,183 @@ void func_8009D978(s32 arg0, s32 arg1) { func_8009D77C(arg0, arg1, 1); } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 draw_box(s32, s32, s32, s32, s32, s32, s32, s32, s32); // extern -extern UnkStruct_800DC5EC D_8015F480; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 extern ? D_8018E7E8; extern ? D_8018E810; -extern s32 gDisplayListHead; void func_8009D998(s32 arg0) { + s16 var_t0; + s16 var_t1; + s16 var_t2; + s16 var_t3; s32 temp_v0; s32 temp_v0_2; s32 temp_v0_4; - s32 temp_v0_5; s32 temp_v1_3; + struct UnkStruct_800DC5EC *temp_v0_3; void *temp_a0; void *temp_a0_2; - void *temp_v0_3; void *temp_v1; void *temp_v1_2; - s16 phi_t0; - s32 phi_t2; - s16 phi_t1; - s32 phi_t3; - temp_v0 = gModeSelection; - if ((temp_v0 == GRAND_PRIX) || (temp_v0 == TIME_TRIALS)) { - temp_v0_4 = arg0 * 8; - temp_v1_2 = temp_v0_4 + &D_8018E7E8; - temp_a0_2 = temp_v0_4 + &D_8018E810; - phi_t0 = temp_v1_2->unk0; - phi_t2 = temp_a0_2->unk0; - phi_t1 = temp_v1_2->unk2; - phi_t3 = temp_a0_2->unk2; + if ((gModeSelection == 0) || (gModeSelection == 1)) { + temp_v0 = arg0 * 8; + temp_v1 = temp_v0 + &D_8018E7E8; + temp_a0 = temp_v0 + &D_8018E810; + var_t0 = temp_v1->unk0; + var_t1 = temp_v1->unk2; + var_t2 = temp_a0->unk0; + var_t3 = temp_a0->unk2; } else { temp_v0_2 = arg0 * 8; if (arg0 >= 4) { - temp_v1 = temp_v0_2 + &D_8018E7E8; - temp_a0 = temp_v0_2 + &D_8018E810; - phi_t0 = temp_v1->unk0; - phi_t2 = temp_a0->unk0; - phi_t1 = temp_v1->unk2; - phi_t3 = temp_a0->unk2; + temp_v1_2 = temp_v0_2 + &D_8018E7E8; + temp_a0_2 = temp_v0_2 + &D_8018E810; + var_t0 = temp_v1_2->unk0; + var_t1 = temp_v1_2->unk2; + var_t2 = temp_a0_2->unk0; + var_t3 = temp_a0_2->unk2; } else { - temp_v0_3 = (arg0 << 6) + &D_8015F480; - phi_t0 = temp_v0_3->unk30; - phi_t2 = temp_v0_3->unk2C; - phi_t1 = temp_v0_3->unk32; - phi_t3 = temp_v0_3->unk2E; + temp_v0_3 = &D_8015F480[arg0]; + var_t0 = temp_v0_3->screenStartX; + var_t1 = temp_v0_3->screenStartY; + var_t2 = temp_v0_3->screenWidth; + var_t3 = temp_v0_3->screenHeight; } } - temp_v0_5 = phi_t2 / 2; - temp_v1_3 = phi_t3 / 2; - gDisplayListHead = draw_box(gDisplayListHead, phi_t0 - temp_v0_5, phi_t1 - temp_v1_3, temp_v0_5 + phi_t0, temp_v1_3 + phi_t1, 0, 0, 0, 0xFF); + temp_v0_4 = var_t2 / 2; + temp_v1_3 = var_t3 / 2; + gDisplayListHead = draw_box(gDisplayListHead, var_t0 - temp_v0_4, var_t1 - temp_v1_3, temp_v0_4 + var_t0, temp_v1_3 + var_t1, 0, 0, 0, 0x000000FF); } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009D998.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void *draw_box(void *, ?, ?, ?, s32, s32, s32, s32, u32); // extern -void func_8009CE64(?, ? *); // extern +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +? func_8009CE64(?, ? *); /* extern */ extern u32 D_8018E7C8; -extern s32 D_8018E7D0; -extern void *gDisplayListHead; +extern ? D_8018E7D0; void func_8009DAA8(void) { - u32 temp_lo; + Gfx *temp_v1; u32 temp_t8; - void *temp_v1; - u32 phi_t0; + u32 var_t0; temp_t8 = D_8018E7D0.unk10 + 1; D_8018E7D0.unk10 = temp_t8; - if (temp_t8 >= (D_8018E7C8 + 1)) { + if (temp_t8 >= (u32) (D_8018E7C8 + 1)) { func_8009CE64(4, &D_8018E7D0); } temp_v1 = gDisplayListHead; gDisplayListHead = temp_v1 + 8; - temp_v1->unk4 = 0; - temp_v1->unk0 = 0xE7000000; - temp_lo = (D_8018E7D0.unk10 * 0xFF) / D_8018E7C8; - phi_t0 = temp_lo; - if (temp_lo >= 0x100) { - phi_t0 = 0xFF; + temp_v1->words.w1 = 0; + temp_v1->words.w0 = 0xE7000000; + var_t0 = (u32) (D_8018E7D0.unk10 * 0xFF) / (u32) D_8018E7C8; + if ((s32) var_t0 >= 0x100) { + var_t0 = 0x000000FF; } - gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x140, 0xF0, 0, 0, 0, phi_t0); + gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x00000140, 0x000000F0, 0, 0, 0, (s32) var_t0); } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009DAA8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void *draw_box(void *, ?, ?, ?, s32, s32, s32, s32, u32); // extern -void func_8009CE64(?); // extern +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +? func_8009CE64(?); /* extern */ extern s32 D_8018D9B8; extern u32 D_8018E7C8; -extern s32 D_8018E7D0; -extern void *gDisplayListHead; +extern ? D_8018E7D0; void func_8009DB8C(void) { - s32 temp_s0; - s32 temp_s0_2; - s32 temp_s0_3; + Gfx *temp_a0; + Gfx *temp_a1; + Gfx *temp_a1_2; + Gfx *temp_a1_3; + Gfx *temp_v0_2; + Gfx *temp_v1; s32 temp_t4; s32 temp_t5; - u32 temp_lo; + s32 var_s0; + s32 var_s0_2; u32 temp_t7; u32 temp_v0; - u32 temp_v0_2; - void *temp_a0; - void *temp_a1; - void *temp_a1_2; - void *temp_a1_3; - void *temp_v0_3; - void *temp_v1; - s32 phi_s0; - s32 phi_s0_2; - u32 phi_v0; - u32 phi_s3; - s32 phi_s0_3; - u32 phi_v1; - u32 phi_s3_2; + u32 var_s3; + u32 var_v1; + void *temp_t8; temp_t7 = D_8018E7D0.unk10 + 1; D_8018E7D0.unk10 = temp_t7; temp_v0 = D_8018E7C8; - phi_v0 = temp_v0; if (temp_t7 >= temp_v0) { - phi_s0 = 0; + var_s0 = 0; if (temp_t7 == temp_v0) { do { - *(D_8018D9B8 + phi_s0) = 1; - (D_8018D9B8 + phi_s0)->unk1 = 1; - (D_8018D9B8 + phi_s0)->unk2 = 1; - temp_s0 = phi_s0 + 4; - (D_8018D9B8 + phi_s0)->unk3 = 1; - phi_s0 = temp_s0; - } while (temp_s0 != 0x4B0); + *(D_8018D9B8 + var_s0) = 1; + (D_8018D9B8 + var_s0)->unk1 = 1; + (D_8018D9B8 + var_s0)->unk2 = 1; + temp_t8 = D_8018D9B8 + var_s0; + var_s0 += 4; + temp_t8->unk3 = 1; + } while (var_s0 != 0x4B0); } else { func_8009CE64(4); } goto block_14; } - phi_s0_2 = 0; - phi_s0_2 = 0; - phi_s3_2 = 0; - if ((0x4B0 / temp_v0) != 0) { + var_s0_2 = 0; + var_s3 = 0; + if ((0x4B0U / temp_v0) != 0) { do { - phi_s3 = phi_s3_2; - if ((*(D_8018D9B8 + phi_s0_2) == 0) && (random_int(((0x4B0 - D_8018E7D0.unk10) / phi_v0) & 0xFFFF) == 0)) { - *(D_8018D9B8 + phi_s0_2) = 1; - phi_s3 = phi_s3_2 + 1; + if ((*(D_8018D9B8 + var_s0_2) == 0) && (random_int(((u32) (0x4B0U - D_8018E7D0.unk10) / temp_v0) & 0xFFFF) == 0)) { + var_s3 += 1; + *(D_8018D9B8 + var_s0_2) = 1; } - temp_v0_2 = D_8018E7C8; - temp_s0_2 = phi_s0_2 + 1; - phi_v0 = temp_v0_2; - phi_s0_2 = temp_s0_2; - phi_s3_2 = phi_s3; - if (temp_s0_2 >= 0x4B0) { - + var_s0_2 += 1; + if (var_s0_2 >= 0x4B0) { + var_s0_2 = 0; } - } while (phi_s3 < (0x4B0 / temp_v0_2)); + } while (var_s3 < (u32) (0x4B0U / (u32) D_8018E7C8)); block_14: + var_s0_2 = 0; } - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; - temp_v0_3->unk0 = 0xE7000000; + temp_v0_2 = gDisplayListHead; + gDisplayListHead = temp_v0_2 + 8; + temp_v0_2->words.w1 = 0; + temp_v0_2->words.w0 = 0xE7000000; temp_v1 = gDisplayListHead; gDisplayListHead = temp_v1 + 8; - temp_v1->unk0 = 0xB900031D; - temp_v1->unk4 = 0x504240; + temp_v1->words.w0 = 0xB900031D; + temp_v1->words.w1 = 0x00504240; temp_a0 = gDisplayListHead; gDisplayListHead = temp_a0 + 8; - temp_a0->unk4 = 0xFF; - temp_a0->unk0 = 0xFA000000; + temp_a0->words.w1 = 0x000000FF; + temp_a0->words.w0 = 0xFA000000; temp_a1 = gDisplayListHead; gDisplayListHead = temp_a1 + 8; - temp_a1->unk4 = 0xFFFDF6FB; - temp_a1->unk0 = 0xFCFFFFFF; - phi_s0_3 = 0; + temp_a1->words.w1 = 0xFFFDF6FB; + temp_a1->words.w0 = 0xFCFFFFFF; do { - if (*(D_8018D9B8 + phi_s0_3) != 0) { + if (*(D_8018D9B8 + var_s0_2) != 0) { temp_a1_2 = gDisplayListHead; - temp_t4 = (phi_s0_3 % 0x28) * 8; + temp_t4 = (var_s0_2 % 40) * 8; gDisplayListHead = temp_a1_2 + 8; - temp_t5 = (phi_s0_3 / 0x28) * 8; - temp_a1_2->unk4 = ((temp_t4 & 0x3FF) << 0xE) | ((temp_t5 & 0x3FF) * 4); - temp_a1_2->unk0 = (((temp_t4 + 8) & 0x3FF) << 0xE) | 0xF6000000 | (((temp_t5 + 8) & 0x3FF) * 4); + temp_t5 = (var_s0_2 / 40) * 8; + temp_a1_2->words.w1 = ((temp_t4 & 0x3FF) << 0xE) | ((temp_t5 & 0x3FF) * 4); + temp_a1_2->words.w0 = (((temp_t4 + 8) & 0x3FF) << 0xE) | 0xF6000000 | (((temp_t5 + 8) & 0x3FF) * 4); } - temp_s0_3 = phi_s0_3 + 1; - phi_s0_3 = temp_s0_3; - } while (temp_s0_3 != 0x4B0); + var_s0_2 += 1; + } while (var_s0_2 != 0x4B0); temp_a1_3 = gDisplayListHead; gDisplayListHead = temp_a1_3 + 8; - temp_a1_3->unk4 = 0; - temp_a1_3->unk0 = 0xE7000000; - temp_lo = (D_8018E7D0.unk10 * 0xFF) / D_8018E7C8; - phi_v1 = temp_lo; - if (temp_lo >= 0x100) { - phi_v1 = 0xFF; + temp_a1_3->words.w1 = 0; + temp_a1_3->words.w0 = 0xE7000000; + var_v1 = (u32) (D_8018E7D0.unk10 * 0x000000FFU) / (u32) D_8018E7C8; + if ((s32) var_v1 >= 0x100) { + var_v1 = 0x000000FF; } - gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x140, 0xF0, 0, 0, 0, phi_v1); + gDisplayListHead = draw_box(gDisplayListHead, 0, 0, 0x00000140, 0x000000F0, 0, 0, 0, (s32) var_v1); } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009DB8C.s") @@ -6401,44 +6292,31 @@ void func_8009E0F0(u32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009E0F0.s") #endif -extern s32 D_8018EDE0; - void func_8009E1C0(void) { func_8009DFE0(10); D_8018EDE0 = 0; } -extern s32 D_8018EDE0; - void func_8009E1E4(void) { func_8009E000(10); D_8018EDE0 = 0; } -extern s32 D_8018EDE0; - void func_8009E208(void) { func_8009DFE0(10); D_8018EDE0 = 1; } -extern s32 D_8018EDE0; - void func_8009E230(void) { func_8009DFE0(10); D_8018EDE0 = 2; } -extern s32 D_8018EDE0; - void func_8009E258(void) { func_8009DFE0(10); D_8018EDE0 = 3; } -void func_8009DFE0(s32); -extern s32 D_8018EDE0; //bss - void func_8009E280(void) { func_8009DFE0(10); D_8018EDE0 = 4; @@ -6555,7 +6433,6 @@ void func_8009E2F0(s32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009E2F0.s") #endif -void func_8009E5FC(s32); void func_8009E5BC(void) { s32 i; for (i = 0; i < 4; i++) { @@ -6563,9 +6440,6 @@ void func_8009E5BC(void) { } } -extern s8 D_8018E838[]; -extern s32 D_8018E840[]; - void func_8009E5FC(s32 arg0) { D_8018E838[arg0] = 1; D_8018E840[arg0] = 0; @@ -6579,32 +6453,25 @@ void func_8009E620(void) { } #ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 struct _struct_D_800E8234_0x8 { /* 0x0 */ void *unk0; /* inferred */ /* 0x4 */ ? unk4; /* inferred */ /* 0x4 */ char pad4[4]; }; /* size = 0x8 */ -s32 func_800051C4(); /* extern */ -void func_8006EF60(); /* extern */ -void func_800996BC(MkTexture *, ?, s8); /* extern */ +? func_8006EE44(s8); /* extern */ +? func_8006EF60(); /* extern */ +? func_800996BC(MkTexture *, ?, s8); /* extern */ s32 func_8009A374(void *); /* extern */ s32 func_8009A478(void *, s32); /* extern */ -void func_8009B0A4(?, ?); /* extern */ -void func_8009B538(?, ?, u16, u16, s32); /* extern */ -u32 func_8009B8C4(u64 *); /* extern */ -void func_8009B954(MkTexture *); /* extern */ -void func_8009B998(); /* extern */ -s32 func_800B5020(s32, s8, s8); /* extern */ +? func_8009B0A4(?, ?); /* extern */ +? func_8009B538(?, ?, u16, u16, s32); /* extern */ s32 func_800B5218(); /* extern */ -s32 func_800B5B94(); /* extern */ -void func_800B6708(); /* extern */ extern ? D_801640F4; -extern s32 D_8018CA78; +extern u32 D_8018CA78; extern s8 D_8018ED90; extern s32 D_8018ED94; -extern s32 gPlayerWinningIndex; static struct _struct_D_800E7248_0x8 D_800E7248[0]; /* unable to generate initializer */ static ? D_800E7268; /* unable to generate initializer */ static struct _struct_D_800E74E8_0x8 D_800E74E8[0]; /* unable to generate initializer */ @@ -6733,8 +6600,6 @@ static MkTexture *D_800E8274[8] = { D_020049E4, D_02004A34, }; - -// texture use in menu static MkTexture *D_800E8294[8] = { D_020048F4, D_0200491C, @@ -6755,7 +6620,6 @@ static MkAnimation *D_800E8320[8] = { D_02007468, D_02006AD8, }; -static ? D_800E85F7; /* unable to generate initializer */ static MkAnimation *gCharacterDefeatAnimation[8] = { D_020068E0, D_02006AC8, @@ -6766,8 +6630,8 @@ static MkAnimation *gCharacterDefeatAnimation[8] = { D_02007640, D_02006CB0, }; +static ? D_800E85F7; /* unable to generate initializer */ static ? D_800EFD64; /* unable to generate initializer; const */ -extern s16 gCupCourseOrder; MkTexture *D_800E7D74[0x14] = { D_02001B2C, D_02001B54, @@ -6863,7 +6727,6 @@ void add_8018D9E0_entry(s32 type, s32 column, s32 row, s8 priority) { s32 temp_v0_5; s32 temp_v0_6; s32 temp_v0_7; - s32 temp_v0_8; s32 var_a2; s32 var_v0; s32 var_v0_2; @@ -6872,7 +6735,6 @@ void add_8018D9E0_entry(s32 type, s32 column, s32 row, s8 priority) { s32 var_v1_5; s8 temp_a1; s8 temp_a1_2; - s8 temp_v0_9; struct _struct_D_800E7248_0x8 *temp_v0_4; struct _struct_D_800E74E8_0x8 *temp_v0_2; struct _struct_D_800E8234_0x8 *temp_v0_3; @@ -7129,7 +6991,7 @@ loop_3: case 0x61: case 0x62: sp7C = var_ra; - var_ra->D_8018DEE0_index = func_8009A374(segmented_to_virtual_dupe_2(D_800E7E34[*(&gCupCourseOrder - 0xBE + (var_ra->type * 2))])); + var_ra->D_8018DEE0_index = func_8009A374(segmented_to_virtual_dupe_2(D_800E7E34[*(gCupCourseOrder - 0xBE + (var_ra->type * 2))])); return; case 0x5E: sp7C = var_ra; @@ -7201,20 +7063,19 @@ loop_3: case 0x8B: sp7C = var_ra; temp_v0_6 = var_ra->type - 0x7C; - func_800996BC(segmented_to_virtual_dupe(D_800E7D74[*(&gCupCourseOrder + (((temp_v0_6 / 4) * 8) + ((temp_v0_6 % 4) * 2)))]), -1); + func_800996BC(segmented_to_virtual_dupe(D_800E7D74[*(gCupCourseOrder + (((temp_v0_6 / 4) * 8) + ((temp_v0_6 % 4) * 2)))]), -1); temp_v0_7 = var_ra->type - 0x7C; - func_800996BC(segmented_to_virtual_dupe(D_800E7DC4[*(&gCupCourseOrder + (((temp_v0_7 / 4) * 8) + ((temp_v0_7 % 4) * 2)))]), 0); + func_800996BC(segmented_to_virtual_dupe(D_800E7DC4[*(gCupCourseOrder + (((temp_v0_7 / 4) * 8) + ((temp_v0_7 % 4) * 2)))]), 0); func_800996BC(segmented_to_virtual_dupe(D_02004A0C), 0); return; case 0xB1: case 0xB2: case 0xB3: case 0xB4: - temp_v0_8 = gModeSelection; temp_a1 = *(&D_800EFD64 + *(&D_800E85F7 + type)); var_v1_3 = 0; - if (temp_v0_8 != VERSUS) { - if (temp_v0_8 != BATTLE) { + if (gModeSelection != 2) { + if (gModeSelection != 3) { var_a2 = type * 4; } else { var_a2 = type * 4; @@ -7247,7 +7108,7 @@ block_63: return; case 0xBB: sp7C = var_ra; - var_ra->unk1C = func_800B5020(D_8018CA78, *gCharacterSelections, priority); + var_ra->unk1C = func_800B5020(D_8018CA78, (s32) *gCharacterSelections); var_ra->unk20 = func_800B5218(); if (*D_80162DD4 != 1) { sp7C = var_ra; @@ -7261,9 +7122,8 @@ block_63: } return; case 0xE6: - temp_v0_9 = gTimeTrialDataCourseIndex; sp7C = var_ra; - var_ra->D_8018DEE0_index = func_8009A374(segmented_to_virtual_dupe_2(D_800E7E34[*(&gCupCourseOrder + (((temp_v0_9 / 4) * 8) + ((temp_v0_9 % 4) * 2)))])); + var_ra->D_8018DEE0_index = func_8009A374(segmented_to_virtual_dupe_2(D_800E7E34[*(gCupCourseOrder + ((((s8) gTimeTrialDataCourseIndex / 4) * 8) + (((s8) gTimeTrialDataCourseIndex % 4) * 2)))])); var_ra->unk1C = (s32) gTimeTrialDataCourseIndex; func_800996BC(segmented_to_virtual_dupe(D_02004A0C), 0); func_8006EF60(); @@ -8199,93 +8059,76 @@ void func_800A0AD0(UNUSED struct_8018D9E0_entry *unused) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_800A08D8(u8, s32, s32); /* extern */ -s32 func_800A095C(void *, ?, ?, s32); /* extern */ -extern ? D_8018E938; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +s32 func_800A095C(s8 *, ?, ?, s32); /* extern */ extern ? D_8018EB34; -static s8 D_800E86C4 = 0; /* const */ void func_800A0B80(struct_8018D9E0_entry *arg0) { Gfx *temp_v1; Gfx *temp_v1_2; s32 temp_a2; - s32 temp_lo; s32 temp_s1; s32 temp_s1_2; s32 temp_s2; - s32 temp_s5; + s32 temp_t7; + s32 var_s1; + s32 var_s5; + s8 *var_s6; s8 temp_v0; s8 temp_v0_2; - void *temp_s4; - s8 *phi_s6; - s32 phi_s5; - s32 phi_s0; - s32 phi_s1; + u32 var_s0; temp_v1 = gDisplayListHead; gDisplayListHead = temp_v1 + 8; - temp_v1->words.w1 = 0x32FF; + var_s6 = D_800E86C4; + var_s5 = 0; + temp_v1->words.w1 = 0x000032FF; temp_v1->words.w0 = 0xFA000000; - phi_s6 = &D_800E86C4; - phi_s5 = 0; do { - temp_v0 = *phi_s6; + temp_v0 = *var_s6; if (temp_v0 != 0) { - temp_s1 = phi_s5 * 0xA; + temp_s1 = var_s5 * 0xA; temp_a2 = arg0->row + temp_s1 + 1; - if ((s32) temp_v0 < 0xA) { - func_800A08D8((temp_v0 + 0x10) & 0xFF, 0x32, temp_a2); + if (temp_v0 < 0xA) { + func_800A08D8((temp_v0 + 0x10) & 0xFF, 0x00000032, temp_a2); } else { - func_800A08D8((((s32) temp_v0 % 10) + 0x10) & 0xFF, 0x35, temp_a2); - func_800A08D8(0x11U, 0x2F, arg0->row + temp_s1 + 1); + func_800A08D8(((temp_v0 % 10) + 0x10) & 0xFF, 0x00000035, temp_a2); + func_800A08D8(0x11U, 0x0000002F, arg0->row + temp_s1 + 1); } - temp_v0_2 = *phi_s6; + temp_v0_2 = *var_s6; temp_s2 = arg0->row + temp_s1 + 1; if (*(&D_8018EB34 + (temp_v0_2 * 4)) == 0) { - temp_s4 = (temp_v0_2 << 5) - 0x20 + &D_8018E938; - temp_s1_2 = func_800A095C(temp_s4 + 0xE, 0x10, 0x4F, temp_s2) * 8; - if (temp_s4->unkA != 0) { + temp_t7 = (temp_v0_2 << 5) - 0x20; + temp_s1_2 = func_800A095C(&D_8018E938->game_name[temp_t7], 0x10, 0x4F, temp_s2) * 8; + if (D_8018E938->ext_name[temp_t7] != 0) { func_800A08D8(0x3CU, temp_s1_2 + 0x4F, temp_s2); - func_800A08D8((u8) temp_s4->unkA, temp_s1_2 + 0x57, temp_s2); + func_800A08D8((u8) D_8018E938->ext_name[temp_t7], temp_s1_2 + 0x57, temp_s2); } - phi_s0 = (s32) ((u32) (temp_s4->unk0 + 0xFF) >> 8); - phi_s1 = 0x10; + var_s1 = 0x10; + var_s0 = (u32) ((temp_t7 + D_8018E938)->unk0 + 0xFF) >> 8; do { - func_800A08D8(((phi_s0 % 10) + 0x10) & 0xFF, phi_s1 + 0xFD, temp_s2); - temp_lo = phi_s0 / 10; - phi_s0 = temp_lo; - phi_s1 += -8; - } while (temp_lo != 0); + func_800A08D8((((s32) var_s0 % 10) + 0x10) & 0xFF, var_s1 + 0xFD, temp_s2); + var_s0 = (u32) ((s32) var_s0 / 10); + var_s1 -= 8; + } while (var_s0 != 0); } } - temp_s5 = phi_s5 + 1; - phi_s6 += 1; - phi_s5 = temp_s5; - } while (temp_s5 != 9); + var_s5 += 1; + var_s6 += 1; + } while (var_s5 != 9); temp_v1_2 = gDisplayListHead; gDisplayListHead = temp_v1_2 + 8; temp_v1_2->words.w0 = 0xED000000; - temp_v1_2->words.w1 = 0x4FC3BC; + temp_v1_2->words.w1 = 0x004FC3BC; } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A0B80.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -static MkTexture *D_800E7D0C[0xA] = { - D_020016BC, - D_020016E4, - D_0200170C, - D_02001734, - D_0200175C, - D_02001784, - D_020017AC, - D_020017D4, - D_020017FC, - D_02001824, -}; +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +// Probably the textures for numbers 0-9 +extern MkTexture *D_800E7D0C[0xA]; void func_800A0DFC(void) { s32 temp_t6; @@ -8295,9 +8138,9 @@ void func_800A0DFC(void) { var_s0 = gControllerPakNumPagesFree; var_s1 = 0x00000110; do { - temp_t6 = (var_s0 % 10) * 4; - var_s0 = var_s0 / 10; - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(*(D_800E7D0C + temp_t6)), var_s1, 0x000000B8); + temp_t6 = var_s0 % 10; + var_s0 /= 10; + gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E7D0C[temp_t6]), var_s1, 0x000000B8); var_s1 -= 9; } while (var_s0 != 0); } @@ -8393,8 +8236,23 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A0FA4.s") #endif #ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -static ? D_800E7940; /* unable to generate initializer */ +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +s8 *D_800E7940[4][4] = { + { + "NO N64 CONTROLLER PAK DETECTED", + "TO SAVE GHOST DATA, ", + "INSERT N64 CONTROLLER PAK ", + "INTO CONTROLLER 1", + }, + { "UNABLE TO READ ", "N64 CONTROLLER PAK DATA", "", "" }, + { "", "", "", "" }, + { + "INSUFFICIENT FREE PAGES AVAILABLE ", + "IN N64 CONTROLLER PAK TO CREATE ", + "GAME DATA, PLEASE FREE 121 PAGES.", + "SEE INSTRUCTION BOOKLET FOR DETAILS.", + }, +}; void func_800A10CC(struct_8018D9E0_entry *arg0) { s32 temp_s3; @@ -8414,7 +8272,7 @@ block_6: gDisplayListHead = func_80098C18(gDisplayListHead, 0x0000001E, 0x00000032, 0x00000122, 0x0000006E, 0, 0, 0, 0x000000FF); temp_s3 = arg0->unk4 - 2; set_text_color(3); - var_s2 = (temp_s3 * 0x10) + &D_800E7940; + var_s2 = D_800E7940[temp_s3]; var_s0 = 0x00000041; var_s1 = 0; do { @@ -8515,39 +8373,38 @@ block_4: GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A143C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -static ? D_800E7168; /* unable to generate initializer; const */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +extern Unk_D_800E70A0 D_800E7168[]; /* unable to generate initializer */ void func_800A1500(struct_8018D9E0_entry *arg0) { - s32 sp1C; - s32 temp_v1; struct_8018D9E0_entry *temp_v0; - void *temp_v0_2; - s32 phi_a1; + Unk_D_800E70A0 *temp_v0_2; + s32 var_a1; - sp1C = 0; - temp_v0 = find_8018D9E0_entry_dupe(0x64); - temp_v1 = temp_v0->unk4; - phi_a1 = sp1C; - switch (temp_v1) { /* irregular */ + var_a1 = 0; + temp_v0 = find_8018D9E0_entry_dupe(0x00000064); + switch (temp_v0->unk4) { /* irregular */ + case 0: + case 1: + break; case 2: - if (arg0->type != (((s32) temp_v0->unk1C % 4) + 0x5F)) { - case 3: - phi_a1 = 1; + if (((temp_v0->unk1C % 4) + 0x5F) != arg0->type) { + var_a1 = 1; } break; + case 3: + var_a1 = 1; + break; } -case 0: -case 1: - switch (phi_a1) { /* switch 1; irregular */ + switch (var_a1) { /* switch 1; irregular */ case 0: /* switch 1 */ - func_8009A76C(arg0->D_8018DEE0_index, 0x17, 0x70, -1); - return; + func_8009A76C(arg0->D_8018DEE0_index, 0x00000017, 0x00000070, -1); + break; case 1: /* switch 1 */ - temp_v0_2 = (arg0->type * 8) - 0x2F8 + &D_800E7168; - func_8009A76C(arg0->D_8018DEE0_index, (s32) temp_v0_2->unk0, (s32) temp_v0_2->unk2, -2); - return; + temp_v0_2 = &D_800E7168[arg0->type - 0x5F]; + func_8009A76C(arg0->D_8018DEE0_index, temp_v0_2->column, temp_v0_2->row, -2); + break; } } #else @@ -9293,14 +9150,10 @@ void func_800A2D1C(struct_8018D9E0_entry *arg0) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_800A32B4(s32, s32, s8, s32); /* extern */ -extern s16 gGPCurrentRacePlayerIdByRank; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +? func_800A32B4(s32, s32, s8, s32); /* extern */ extern s16 D_80164368; extern ? D_80164370; -extern s8 D_8018EDF3; -static ? gGameModeRowSelectionForNumPlayers; /* unable to generate initializer; const */ -static ? gGameModeSubMenuRowSelectionForNumPlayers; /* unable to generate initializer; const */ s8 *D_800E7500[9] = { "mushroom cup", "flower cup", @@ -9311,97 +9164,88 @@ s8 *D_800E7500[9] = { "flower cup", "star cup", "special cup", -}; /* const */ -s8 *D_800E76CC[4] = { "50(", "100(", "150(", "extra" }; /* const */ +}; +s8 *D_800E76CC[4] = { "50(", "100(", "150(", "extra" }; void func_800A2EB8(struct_8018D9E0_entry *arg0) { s8 sp74; s8 sp70; s8 sp69; s8 sp68; - s16 *temp_s0; - s32 temp_s0_2; - s32 temp_s2; - s32 temp_s2_2; - s8 *temp_s1; - s8 temp_v0; - s16 *phi_s0; - s8 *phi_s1; - s16 *phi_s0_2; - s32 phi_a0; - s32 phi_s3; - s8 *phi_s1_2; - s32 phi_s2; - s16 *phi_s0_3; - s32 phi_a0_2; - s32 phi_s3_2; - s8 *phi_s1_3; - s32 phi_s2_2; + s16 *var_s0; + s16 *var_s0_2; + s16 *var_s0_3; + s16 temp_t6; + s32 temp_s0; + s32 var_a0; + s32 var_a0_2; + s32 var_s2; + s32 var_s2_2; + s32 var_s3; + s32 var_s3_2; + s8 *var_s1; + s8 *var_s1_2; + s8 *var_s1_3; - phi_s0 = &gGPCurrentRacePlayerIdByRank; - phi_s1 = &sp70; + var_s0 = gGPCurrentRacePlayerIdByRank; + var_s1 = &sp70; do { - temp_s0 = phi_s0 + 2; - temp_s1 = phi_s1 + 1; - temp_s1->unk-1 = (s8) gPlayers[*phi_s0].characterId; - phi_s0 = temp_s0; - phi_s1 = temp_s1; - } while ((u32) temp_s0 < (u32) &D_80164370); + temp_t6 = *var_s0; + var_s0 += 2; + var_s1 += 1; + var_s1->unk-1 = (s8) gPlayers[temp_t6].characterId; + } while ((u32) var_s0 < (u32) &D_80164370); set_text_color(4); func_80093324(arg0->column + 0x1E, arg0->row + 0x19, "results", 0, 1.0f, 1.0f); set_text_color(5); func_80093324(arg0->column + 0x2C, arg0->row + 0x28, "round", 0, 0.7f, 0.7f); convert_number_to_ascii(gCupCourseSelection + 1, &sp68); func_80093324(arg0->column + 0x57, arg0->row + 0x28, &sp69, 0, 0.7f, 0.7f); - phi_s0_2 = &gGPCurrentRacePlayerIdByRank; - phi_s3 = 0; - phi_s1_2 = &sp70; - phi_s2 = 0; + var_s0_2 = gGPCurrentRacePlayerIdByRank; + var_s2 = 0; + var_s1_2 = &sp70; + var_s3 = 0; do { - if ((s32) *phi_s0_2 < (s32) D_8018EDF3) { - phi_a0 = (s32) gGlobalTimer % 3; + if (*var_s0_2 < D_8018EDF3) { + var_a0 = (s32) gGlobalTimer % 3; } else { - phi_a0 = 3; + var_a0 = 3; } - set_text_color(phi_a0); - func_800A32B4(arg0->column + 7, arg0->row + phi_s3 + 0x38, *phi_s1_2, phi_s2); - temp_s2 = phi_s2 + 1; - phi_s0_2 += 2; - phi_s3 += 0x10; - phi_s1_2 += 1; - phi_s2 = temp_s2; - } while (temp_s2 < 4); - phi_s0_3 = &D_80164368; - phi_s3_2 = 0x40; - phi_s1_3 = &sp74; - phi_s2_2 = 4; + set_text_color(var_a0); + func_800A32B4(arg0->column + 7, arg0->row + var_s3 + 0x38, *var_s1_2, var_s2); + var_s2 += 1; + var_s1_2 += 1; + var_s0_2 += 2; + var_s3 += 0x10; + } while (var_s2 < 4); + var_s0_3 = &D_80164368; + var_s2_2 = 4; + var_s1_3 = &sp74; + var_s3_2 = 0x40; do { - if ((s32) *phi_s0_3 < (s32) D_8018EDF3) { - phi_a0_2 = (s32) gGlobalTimer % 3; + if (*var_s0_3 < D_8018EDF3) { + var_a0_2 = (s32) gGlobalTimer % 3; } else { - phi_a0_2 = 3; + var_a0_2 = 3; } - set_text_color(phi_a0_2); - func_800A32B4(0xBE - arg0->column, arg0->row + phi_s3_2 + 0x5A, *phi_s1_3, phi_s2_2); - temp_s2_2 = phi_s2_2 + 1; - phi_s0_3 += 2; - phi_s3_2 += 0x10; - phi_s1_3 += 1; - phi_s2_2 = temp_s2_2; - } while (temp_s2_2 != 8); + set_text_color(var_a0_2); + func_800A32B4(0xBE - arg0->column, arg0->row + var_s3_2 + 0x5A, *var_s1_3, var_s2_2); + var_s2_2 += 1; + var_s1_3 += 1; + var_s0_3 += 2; + var_s3_2 += 0x10; + } while (var_s2_2 != 8); set_text_color(5); - temp_s0_2 = (s32) (((f32) (get_string_width(D_800E7500[gCupSelection]) + 8) * 0.6f) / 2.0f); + temp_s0 = (s32) (((f32) (get_string_width(D_800E7500[gCupSelection]) + 8) * 0.6f) / 2.0f); draw_text((-(s32) (((f32) (get_string_width(D_800E76CC[gCCSelection]) + 8) * 0.6f) / 2.0f) - arg0->column) + 0xF5, arg0->row + 0xE1, D_800E7500[D_800DC540], 0, 0.6f, 0.6f); - temp_v0 = D_8018EDF3; - draw_text((temp_s0_2 - arg0->column) + 0xF5, arg0->row + 0xE1, D_800E76CC[*(&gGameModeSubMenuRowSelectionForNumPlayers + ((temp_v0 * 3) + *(&gGameModeRowSelectionForNumPlayers + temp_v0)))], 0, 0.6f, 0.6f); + draw_text((temp_s0 - arg0->column) + 0xF5, arg0->row + 0xE1, D_800E76CC[(*(D_800E86B0 - 3))[(D_8018EDF3 * 3) + (D_800E86AC - 1)[D_8018EDF3]]], 0, 0.6f, 0.6f); } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A2EB8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -extern s16 gGPCurrentRacePlayerIdByRank; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 static s8 *D_800E76A8[9] = { "MARIO", "LUIGI", @@ -9412,7 +9256,7 @@ static s8 *D_800E76A8[9] = { "PEACH", "BOWSER", D_800EFE0C, -}; /* const */ +}; static s8 D_800EFE0C[9] = { 0xA1, 0xBC, 0xA1, 0xBC, 0xA1, 0xBC, 0xA1, 0xBC, 0 }; /* const */ void func_800A32B4(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { @@ -9422,7 +9266,7 @@ void func_800A32B4(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { s8 sp3D; s8 sp3C; - sp50 = gTimePlayerLastTouchedFinishLine[*(&gGPCurrentRacePlayerIdByRank + (arg3 * 2))]; + sp50 = gTimePlayerLastTouchedFinishLine[gGPCurrentRacePlayerIdByRank[arg3]]; convert_number_to_ascii(arg3 + 1, &sp3C); sp3E = 0x2E; sp3F = 0; @@ -10040,46 +9884,46 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A3E60.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 extern s32 D_8018CA78; extern ? D_8018CA90; -static ? D_800E7734; /* unable to generate initializer; const */ +s8 *D_800E7734[4] = { "LAP 1", "LAP 2", "LAP 3", "TOTAL" }; void func_800A4550(s32 recordType, s32 column, s32 row) { s32 sp40; s8 sp34; s32 sp2C; s32 temp_v0; + s32 var_a0; + s32 var_v0; struct_8018D9E0_entry *temp_v0_2; - s32 phi_v0; - s32 phi_a0; if (recordType < 3) { temp_v0 = recordType * 4; sp2C = temp_v0; sp40 = *(&D_8018CA90 + temp_v0); set_text_color(2); - phi_v0 = temp_v0; + var_v0 = temp_v0; } else { sp40 = D_8018CA78; set_text_color(1); - phi_v0 = recordType * 4; + var_v0 = recordType * 4; } - func_800936B8(column + 0x21, row, *(&D_800E7734 + phi_v0), 0, 0.7f, 0.7f); - temp_v0_2 = find_8018D9E0_entry_dupe(0xBB); + func_800936B8(column + 0x21, row, *(D_800E7734 + var_v0), 0, 0.7f, 0.7f); + temp_v0_2 = find_8018D9E0_entry_dupe(0x000000BB); if (recordType < 3) { - if ((temp_v0_2->unk20 & (1 << recordType)) != 0) { - phi_a0 = (s32) gGlobalTimer % 3; + if (temp_v0_2->unk20 & (1 << recordType)) { + var_a0 = (s32) gGlobalTimer % 3; } else { - phi_a0 = 3; + var_a0 = 3; } } else { - phi_a0 = 3; + var_a0 = 3; if (temp_v0_2->unk1C >= 0) { - phi_a0 = (s32) gGlobalTimer % 3; + var_a0 = (s32) gGlobalTimer % 3; } } - set_text_color(phi_a0); + set_text_color(var_a0); get_time_record_minutes(sp40, &sp34); func_800939C8(column + 0x2C, row, &sp34, 0, 0.7f, 0.7f); func_80093324(column + 0x37, row, "'", 0, 0.7f, 0.7f); @@ -11593,56 +11437,36 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A79F4.s") #endif #ifdef MIPS_TO_C -//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b -? func_8009E000(?); /* extern */ +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-12-2022 ? func_8009F5E0(struct_8018D9E0_entry *); /* extern */ -? func_800A9710(struct_8018D9E0_entry *); /* extern */ ? func_800A97BC(struct_8018D9E0_entry *); /* extern */ ? func_800A9A98(struct_8018D9E0_entry *); /* extern */ -? func_800A9B9C(struct_8018D9E0_entry *); /* extern */ -? func_800A9C40(struct_8018D9E0_entry *); /* extern */ -? func_800A9D5C(struct_8018D9E0_entry *); /* extern */ ? func_800A9E58(struct_8018D9E0_entry *); /* extern */ -? func_800AA280(struct_8018D9E0_entry *); /* extern */ ? func_800AA2EC(struct_8018D9E0_entry *); /* extern */ ? func_800AA69C(struct_8018D9E0_entry *); /* extern */ ? func_800AAA9C(struct_8018D9E0_entry *); /* extern */ -? func_800AAB90(struct_8018D9E0_entry *); /* extern */ ? func_800AAC18(struct_8018D9E0_entry *); /* extern */ -? func_800AB020(struct_8018D9E0_entry *); /* extern */ -? func_800AB164(struct_8018D9E0_entry *); /* extern */ ? func_800AB314(struct_8018D9E0_entry *); /* extern */ -? func_800AB904(struct_8018D9E0_entry *); /* extern */ ? func_800AB9B0(struct_8018D9E0_entry *); /* extern */ ? func_800ABAE8(struct_8018D9E0_entry *); /* extern */ ? func_800ABB24(struct_8018D9E0_entry *); /* extern */ ? func_800ABBCC(struct_8018D9E0_entry *); /* extern */ ? func_800ABC38(struct_8018D9E0_entry *); /* extern */ -? func_800ABEAC(struct_8018D9E0_entry *); /* extern */ ? func_800AC300(struct_8018D9E0_entry *); /* extern */ -? func_800AC324(struct_8018D9E0_entry *); /* extern */ ? func_800AC458(struct_8018D9E0_entry *); /* extern */ ? func_800ACA14(struct_8018D9E0_entry *); /* extern */ ? func_800ACC50(struct_8018D9E0_entry *); /* extern */ ? func_800ACF40(struct_8018D9E0_entry *); /* extern */ -? func_800AD1A4(struct_8018D9E0_entry *); /* extern */ ? func_800AD2E8(struct_8018D9E0_entry *); /* extern */ ? func_800ADF48(struct_8018D9E0_entry *); /* extern */ ? func_800AE218(struct_8018D9E0_entry *); /* extern */ -? func_800AEC54(struct_8018D9E0_entry *); /* extern */ -? func_800AEDBC(struct_8018D9E0_entry *); /* extern */ ? func_800AEF14(struct_8018D9E0_entry *); /* extern */ ? func_800AEF74(struct_8018D9E0_entry *); /* extern */ ? func_800AF004(struct_8018D9E0_entry *); /* extern */ ? func_800AF1AC(struct_8018D9E0_entry *); /* extern */ ? func_800AF270(struct_8018D9E0_entry *); /* extern */ -? func_800CA388(?); /* extern */ -? play_sound2(?); /* extern */ extern s32 D_8018ED94; -extern s32 D_8018EDE0; -extern s8 D_8018EDEE; extern void *gControllerFive; -extern s8 gMainMenuSelectionDepth; f32 D_800E8530 = 0.0f; f32 D_800E8534 = 3.0f; @@ -11654,13 +11478,8 @@ void func_800A7A4C(s32 arg0) { s32 temp_v0; s32 temp_v0_2; s32 temp_v0_3; - s32 temp_v0_6; s32 var_s0; s32 var_v1_2; - s8 temp_t1; - s8 temp_t9; - s8 temp_v0_4; - s8 temp_v0_5; struct_8018D9E0_entry *var_s1; struct_8018D9E0_entry *var_s1_2; u8 var_v1; @@ -11680,36 +11499,35 @@ block_7: if (var_v1 != 0) { switch (temp_v0) { /* switch 8; irregular */ case 0xFA: /* switch 8 */ - temp_v0_2 = D_8018ED94; - if (temp_v0_2 < 0x50) { + if (D_8018ED94 < 0x50) { D_800E8534 = 3.0f; - } else if (temp_v0_2 < 0x5A) { + } else if (D_8018ED94 < 0x5A) { temp_f0 = (f64) D_800E8530; if (temp_f0 < 1.0) { D_800E8530 = (f32) (temp_f0 + 0.1); } D_800E8534 = (f32) ((f64) D_800E8534 + 0.1); - } else if (temp_v0_2 < 0xA0) { + } else if (D_8018ED94 < 0xA0) { D_800E8534 = (f32) ((f64) D_800E8534 + 0.1); - } else if (temp_v0_2 < 0x190) { + } else if (D_8018ED94 < 0x190) { D_800E8534 = (f32) ((f64) D_800E8534 + 0.3); } temp_f18 = D_8018EDCC - D_800E8534; D_8018EDCC = temp_f18; - D_8018ED94 = temp_v0_2 + 1; + D_8018ED94 += 1; if (temp_f18 < -360.0f) { D_8018EDCC = temp_f18 + 360.0f; } temp_t2 = var_s1->unk1C + 1; var_s1->unk1C = temp_t2; if (temp_t2 == 0x000000B4) { - func_8009E000(0x28); - func_800CA388(0x64); + func_8009E000(0x00000028); + func_800CA388(0x64U); D_8018EDE0 = 0; } if ((var_s1->unk20 != 0) && (var_s1->unk1C >= 3)) { var_s1->unk20 = 0; - play_sound2(SOUND_INTRO_LOGO); + play_sound2(0x49018008); } break; case 0xDA: /* switch 8 */ @@ -11722,12 +11540,12 @@ block_7: func_800A97BC(var_s1); break; case 0x5: /* switch 8 */ - temp_v0_3 = var_s1->unk4; - switch (temp_v0_3) { /* switch 9; irregular */ + temp_v0_2 = var_s1->unk4; + switch (temp_v0_2) { /* switch 9; irregular */ case 0: /* switch 9 */ if (gControllerFive->unk4 & 0x10) { var_s1->unk4 = (s32) 1U; - play_sound2(SOUND_ACTION_PING); + play_sound2(0x4900801C); } else { var_s1->visible = 0; } @@ -11743,17 +11561,17 @@ block_7: break; case 0x10: /* switch 8 */ case 0x11: /* switch 8 */ - switch (gMainMenuSelectionDepth) { /* switch 5 */ - case OPTIONS_SELECTION: /* switch 5 */ - case DATA_SELECTION: /* switch 5 */ - case PLAYER_NUM_SELECTION: /* switch 5 */ + switch (gMainMenuSelectionDepth) { /* switch 5 */ + case 1: /* switch 5 */ + case 2: /* switch 5 */ + case 3: /* switch 5 */ func_800A9B9C(var_s1); break; - case GAME_MODE_SELECTION: /* switch 5 */ - case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 5 */ - case CONFIRM_OK_SELECTION: /* switch 5 */ - case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 5 */ - case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 5 */ + case 4: /* switch 5 */ + case 5: /* switch 5 */ + case 6: /* switch 5 */ + case 7: /* switch 5 */ + case 8: /* switch 5 */ func_800A9C40(var_s1); break; } @@ -11766,17 +11584,17 @@ block_7: case 0xC: /* switch 8 */ case 0xD: /* switch 8 */ case 0xE: /* switch 8 */ - switch (gMainMenuSelectionDepth) { /* switch 6 */ - case OPTIONS_SELECTION: /* switch 6 */ - case DATA_SELECTION: /* switch 6 */ - case PLAYER_NUM_SELECTION: /* switch 6 */ + switch (gMainMenuSelectionDepth) { /* switch 6 */ + case 1: /* switch 6 */ + case 2: /* switch 6 */ + case 3: /* switch 6 */ func_800A9B9C(var_s1); break; - case GAME_MODE_SELECTION: /* switch 6 */ - case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 6 */ - case CONFIRM_OK_SELECTION: /* switch 6 */ - case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 6 */ - case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 6 */ + case 4: /* switch 6 */ + case 5: /* switch 6 */ + case 6: /* switch 6 */ + case 7: /* switch 6 */ + case 8: /* switch 6 */ func_800A9C40(var_s1); break; } @@ -11823,8 +11641,7 @@ block_7: func_800AA69C(var_s1); break; } - temp_v0_4 = D_8018EDEE; - switch (temp_v0_4) { /* switch 10; irregular */ + switch (D_8018EDEE) { /* switch 10; irregular */ case 1: /* switch 10 */ func_800AAB90(var_s1); break; @@ -11844,8 +11661,7 @@ block_7: case 0x55: /* switch 8 */ case 0x56: /* switch 8 */ func_800AB164(var_s1); - temp_v0_5 = D_8018EDEC; - switch (temp_v0_5) { /* switch 11; irregular */ + switch (D_8018EDEC) { /* switch 11; irregular */ case 1: /* switch 11 */ func_800AB020(var_s1); break; @@ -12053,9 +11869,9 @@ block_7: do { var_s1_2 = D_8018D9E0; loop_113: - temp_v0_6 = var_s1_2->type; + temp_v0_3 = var_s1_2->type; var_v1_2 = 0; - if ((temp_v0_6 == 4) || (temp_v0_6 == 5) || (temp_v0_6 == 0x000000C7)) { + if ((temp_v0_3 == 4) || (temp_v0_3 == 5) || (temp_v0_3 == 0x000000C7)) { if (arg0 != 0) { goto block_119; } @@ -12344,51 +12160,31 @@ void func_800A890C(s32 arg0, struct_8018D9E0_entry *arg1) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A890C.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b -static ? D_800E7208; /* unable to generate initializer */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +extern Unk_D_800E70A0 D_800E7208[][2]; /* unable to generate initializer */ void func_800A8A98(struct_8018D9E0_entry *arg0) { - ? *var_s0; - Gfx *temp_v0; - Gfx *temp_v0_2; - Gfx *temp_v0_3; - Gfx *var_v0; s32 temp_s2; s32 temp_s3; - s8 temp_v0_4; - s8 var_s4; + s32 someIndex; - temp_v0 = gDisplayListHead; temp_s2 = arg0->column; temp_s3 = arg0->row; - gDisplayListHead = temp_v0 + 8; - temp_v0->words.w0 = 0xE7000000; - temp_v0->words.w1 = 0; - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->words.w0 = 0xB900031D; - temp_v0_2->words.w1 = 0x0F0A4000; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - var_s0 = &D_800E7208; - var_s4 = 0; - temp_v0_3->words.w0 = 0xFCFFFFFF; - temp_v0_3->words.w1 = 0xFFFCF279; - do { - if ((var_s4 == gCupCourseSelection) && (temp_v0_4 = D_8018EDEC, ((temp_v0_4 < 2) == 0)) && (gModeSelection != GRAND_PRIX)) { - if ((temp_v0_4 == 2) || (temp_v0_4 == 4)) { - var_v0 = func_800959A0(gDisplayListHead, var_s0->unk0 + temp_s2, var_s0->unk2 + temp_s3, var_s0->unk8 + temp_s2, var_s0->unkA + temp_s3); + gDPPipeSync(gDisplayListHead++); + 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 ((D_8018EDEC == 2) || (D_8018EDEC == 4)) { + gDisplayListHead = func_800959A0(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 { - var_v0 = func_80098C18(gDisplayListHead, var_s0->unk0 + temp_s2, var_s0->unk2 + temp_s3, var_s0->unk8 + temp_s2, var_s0->unkA + temp_s3, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF); + gDisplayListHead = func_80098C18(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, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF); } } else { - var_v0 = func_80098C18(gDisplayListHead, var_s0->unk0 + temp_s2, var_s0->unk2 + temp_s3, var_s0->unk8 + temp_s2, var_s0->unkA + temp_s3, 1, 1, 1, 0x000000FF); + gDisplayListHead = func_80098C18(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, 1, 1, 1, 0x000000FF); } - gDisplayListHead = var_v0; - var_s4 += 1; - var_s0 += 0x10; - } while (var_s4 != 4); + } } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A8A98.s") @@ -12517,26 +12313,22 @@ void func_800A8F48(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A8F48.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 054f217e0ef630f2a2a76ec70a84ce37369571c0 void func_800A90D4(s32 arg0, struct_8018D9E0_entry *arg1) { s32 temp_a2; s32 temp_t1; s32 temp_t7; if (arg1->unk1C < 0x20) { + if (1) {} + temp_t7 = (arg1->unk1C * 0x41) / 0x40; temp_t1 = arg1->column; temp_a2 = arg1->row; - temp_t7 = (arg1->unk1C * 0x41) / 0x40; gDPPipeSync(gDisplayListHead++); gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA); gDisplayListHead = func_80098C18(gDisplayListHead, temp_t1 + temp_t7, temp_a2, (temp_t1 - temp_t7) + 0x40, temp_a2 + 0x27, 1, 1, 1, 0xFF); } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A90D4.s") -#endif void func_800A91D8(struct_8018D9E0_entry *arg0, s32 columnTarget, s32 rowTarget) { func_800A9208(arg0, columnTarget); @@ -12958,146 +12750,124 @@ void func_800A9A98(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A9A98.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_800AA280(); /* extern */ - +#ifdef NEEDS_RODATA +// data/data_0DD0A0_3_0.s +// jpt_800F24E8 void func_800A9B9C(struct_8018D9E0_entry *arg0) { - s32 temp_t0; - s32 temp_t6; - s32 temp_v0; - - temp_t6 = arg0->unk4; - switch (temp_t6) { + switch (arg0->unk4) { case 0: - func_800AA280(); - return; + func_800AA280(arg0); + break; case 1: - func_800AA280(); + func_800AA280(arg0); arg0->unk4 = 4; /* fallthrough */ case 4: - temp_v0 = arg0->unk1C; - if (temp_v0 > 0) { - temp_t0 = (temp_v0 - (temp_v0 / 12)) - 2; - arg0->unk1C = temp_t0; - if (temp_t0 < 0) { + if (arg0->unk1C > 0) { + arg0->unk1C = (arg0->unk1C - (arg0->unk1C / 12)) - 2; + if (arg0->unk1C < 0) { arg0->unk1C = 0; - return; } - default: - return; + } else { + arg0->unk1C = 0; + arg0->unk4 = 0; } - arg0->unk1C = 0; - arg0->unk4 = 0; - return; + break; case 2: arg0->unk4 = 3; break; + case 3: + default: + break; } } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A9B9C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_800AA280(); /* extern */ -extern s8 D_8018EDF3; -extern s8 gMainMenuSelectionDepth; - +#ifdef NEEDS_RODATA +// data/data_0DD0A0_3_0.s +// jpt_800F24FC void func_800A9C40(struct_8018D9E0_entry *arg0) { - s32 temp_t6; - s32 temp_t7; - s32 temp_v0_2; - s8 temp_v0; - - temp_t6 = arg0->unk4; - switch (temp_t6) { + switch (arg0->unk4) { case 0: - func_800AA280(); - if (arg0->type == (D_8018EDF3 + 0xA)) { + func_800AA280(arg0); + if ((D_8018EDF3 + 0xA) == arg0->type) { arg0->unk4 = 2; - return; + } else { + arg0->unk4 = 1; } - arg0->unk4 = 1; - return; + break; case 4: - if (arg0->type == (D_8018EDF3 + 0xA)) { + if ((D_8018EDF3 + 0xA) == arg0->type) { arg0->unk4 = 2; arg0->unk1C = 0; - return; + break; } arg0->unk4 = 1; case 1: - func_800AA280(); - temp_v0 = gMainMenuSelectionDepth; - if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { - arg0->unk1C = 0x20; - return; - } - temp_v0_2 = arg0->unk1C; - temp_t7 = temp_v0_2 + 2; - if (temp_v0_2 < 0x20) { - arg0->unk1C = temp_t7; - if (temp_t7 >= 0x20) { - arg0->unk1C = 0x20; - return; + func_800AA280(arg0); + if ((gMainMenuSelectionDepth == 7) || (gMainMenuSelectionDepth == 8)) { + arg0->unk1C = 0x00000020; + } else { + if (arg0->unk1C < 0x20) { + arg0->unk1C += 2; + if (arg0->unk1C >= 0x20) { + arg0->unk1C = 0x00000020; + } } } - default: - return; + break; case 3: - if (arg0->type == (D_8018EDF3 + 0xA)) { + if ((D_8018EDF3 + 0xA) == arg0->type) { arg0->unk4 = 2; } break; + case 2: + default: + break; } } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A9C40.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern s8 gMainMenuSelectionDepth; -static ? D_800E70A0; /* unable to generate initializer */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +extern Unk_D_800E70A0 D_800E70A0[]; /* unable to generate initializer */ +// data/data_0DD0A0_3_0.s +// jpt_800F2510 void func_800A9D5C(struct_8018D9E0_entry *arg0) { - void *sp1C; - s32 temp_t1; - s8 temp_v0; - void *temp_v0_2; + Unk_D_800E70A0 *temp_v0; - if (arg0->type == (D_8018EDF3 + 0xA)) { + if ((D_8018EDF3 + 0xA) == arg0->type) { arg0->priority = 0x0A; } else { arg0->priority = 6; } - temp_t1 = arg0->unk4; - switch (temp_t1) { + + switch (arg0->unk4) { case 2: - temp_v0 = gMainMenuSelectionDepth; - if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { + if ((gMainMenuSelectionDepth == 7) || (gMainMenuSelectionDepth == 8)) { arg0->column = 0x00000080; arg0->row = 0x0000003E; - return; + } else { + func_800A91D8(arg0, 0x00000080, 0x0000003E); } - func_800A91D8(arg0, 0x00000080, 0x0000003E); - return; + break; case 3: - temp_v0_2 = (arg0->type * 8) - 0x50 + &D_800E70A0; - sp1C = temp_v0_2; - func_800A91D8(arg0, (s32) temp_v0_2->unk0, (s32) temp_v0_2->unk2); - if ((temp_v0_2->unk0 == arg0->column) && (temp_v0_2->unk2 == arg0->row)) { + temp_v0 = &D_800E70A0[arg0->type - 0xA]; + func_800A91D8(arg0, temp_v0->column, temp_v0->row); + if ((arg0->column == temp_v0->column) && (arg0->row == temp_v0->row)) { arg0->unk4 = 0; } /* fallthrough */ - default: case 0: case 1: case 4: - return; + default: + break; } } #else @@ -13270,23 +13040,20 @@ block_37: GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A9E58.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern s8 gMainMenuSelectionDepth; -static ? D_800E70A0; /* unable to generate initializer */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +extern Unk_D_800E70A0 D_800E70A0[]; void func_800AA280(struct_8018D9E0_entry *arg0) { - s8 temp_v1; - void *temp_v0; + Unk_D_800E70A0 *temp_v0; - temp_v1 = gMainMenuSelectionDepth; - temp_v0 = (arg0->type * 8) - 0x50 + &D_800E70A0; - if ((temp_v1 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v1 == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { - arg0->column = (s32) temp_v0->unk0; - arg0->row = (s32) temp_v0->unk2; - return; + temp_v0 = &D_800E70A0[arg0->type - 0xA]; + if ((gMainMenuSelectionDepth == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (gMainMenuSelectionDepth == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { + arg0->column = temp_v0->column; + arg0->row = temp_v0->row; + } else { + func_800A91D8(arg0, temp_v0->column, temp_v0->row); } - func_800A91D8(arg0, (s32) temp_v0->unk0, (s32) temp_v0->unk2); } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AA280.s") @@ -13975,43 +13742,41 @@ void func_800AB098(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AB098.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -static ? D_800E7148; /* unable to generate initializer */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +extern Unk_D_800E70A0 D_800E7148[4]; /* unable to generate initializer */ +// data/data_0DD0A0_3_0.s +// jpt_800F261C void func_800AB164(struct_8018D9E0_entry *arg0) { - void *sp1C; - s32 temp_t1; - void *temp_v0; - void *temp_v0_2; + Unk_D_800E70A0 *thing = &D_800E7148[arg0->type - 0x53]; - if (arg0->type == (gCupSelection + 0x53)) { + if ((gCupSelection + 0x53) == arg0->type) { arg0->priority = 0x0A; } else { arg0->priority = 4; } - temp_t1 = arg0->unk4; - switch (temp_t1) { + + switch (arg0->unk4) { case 0: - temp_v0 = (arg0->type * 8) - 0x298 + &D_800E7148; - arg0->column = (s32) temp_v0->unk0; - arg0->row = (s32) temp_v0->unk2; - return; + thing = &D_800E7148[arg0->type - 0x53]; + arg0->column = thing->column; + arg0->row = thing->row; + break; case 2: func_800A91D8(arg0, 0x00000080, 0x0000003B); - return; + break; case 3: - temp_v0_2 = (arg0->type * 8) - 0x298 + &D_800E7148; - sp1C = temp_v0_2; - func_800A91D8(arg0, (s32) temp_v0_2->unk0, (s32) temp_v0_2->unk2); - if ((temp_v0_2->unk0 == arg0->column) && (temp_v0_2->unk2 == arg0->row)) { + thing = &D_800E7148[arg0->type - 0x53]; + func_800A91D8(arg0, thing->column, thing->row); + if ((arg0->column == thing->column) && (arg0->row == thing->row)) { arg0->unk4 = 0; } - /* fallthrough */ - default: + break; case 1: case 4: - return; + default: + break; } } #else @@ -14246,30 +14011,26 @@ void func_800AB314(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AB314.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -static ? D_800E7248; /* unable to generate initializer */ -static ? D_800E7258; /* unable to generate initializer */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +extern Unk_D_800E70A0 D_800E7248[]; /* unable to generate initializer */ +extern Unk_D_800E70A0 D_800E7258[]; /* unable to generate initializer */ void func_800AB904(struct_8018D9E0_entry *arg0) { - s16 temp_a1; - s16 temp_a1_2; - s8 temp_v0; + Unk_D_800E70A0 *temp_a1; - temp_v0 = D_8018EDEC; - switch (temp_v0) { /* irregular */ + switch (D_8018EDEC) { /* irregular */ case 1: - temp_a1 = *((arg0->type * 8) - 0x328 + &D_800E7248); - if (temp_a1 != arg0->column) { - func_800A9208(arg0, (s32) temp_a1); - return; + temp_a1 = &D_800E7248[arg0->type - 0x65]; + if (arg0->column != temp_a1->column) { + func_800A9208(arg0, temp_a1->column); } - return; + break; case 2: case 3: - temp_a1_2 = *((arg0->type * 8) - 0x328 + &D_800E7258); - if (temp_a1_2 != arg0->column) { - func_800A9208(arg0, (s32) temp_a1_2); + temp_a1 = &D_800E7258[arg0->type - 0x65]; + if (arg0->column != temp_a1->column) { + func_800A9208(arg0, temp_a1->column); } break; } @@ -14327,58 +14088,40 @@ void func_800AB9B0(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AB9B0.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -struct _struct_D_800E7430_0x8 { - /* 0x0 */ s16 unk0; /* inferred */ - /* 0x2 */ s16 unk2; /* inferred */ - /* 0x4 */ char pad4[4]; /* maybe part of unk2[3]? */ -}; /* size = 0x8 */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s -static struct _struct_D_800E7430_0x8 D_800E7430[0]; /* unable to generate initializer; const */ +extern Unk_D_800E70A0 D_800E7430[]; /* unable to generate initializer; const */ void func_800ABAE8(struct_8018D9E0_entry *arg0) { - s32 temp_v0; - struct _struct_D_800E7430_0x8 *temp_v0_2; s32 phi_v1; - temp_v0 = arg0->type; - if (temp_v0 == 0x8C) { + if (arg0->type == 0x8C) { phi_v1 = 4; } else { - phi_v1 = temp_v0 - 0x78; + phi_v1 = arg0->type - 0x78; } - temp_v0_2 = &D_800E7430[phi_v1]; - arg0->column = (s32) temp_v0_2->unk0; - arg0->row = (s32) temp_v0_2->unk2; + arg0->column = D_800E7430[phi_v1].column; + arg0->row = D_800E7430[phi_v1].row; } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ABAE8.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -struct _struct_D_800E7430_0x8 { - /* 0x0 */ s16 unk0; /* inferred */ - /* 0x2 */ s16 unk2; /* inferred */ - /* 0x4 */ char pad4[4]; /* maybe part of unk2[3]? */ -}; /* size = 0x8 */ - -static struct _struct_D_800E7430_0x8 D_800E7430[0]; /* unable to generate initializer; const */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +extern Unk_D_800E70A0 D_800E7430[]; void func_800ABB24(struct_8018D9E0_entry *arg0) { - s32 temp_t7; - s8 temp_v0; - struct _struct_D_800E7430_0x8 *temp_v1; + Unk_D_800E70A0 *temp_v1; + s32 thing = gTimeTrialDataCourseIndex; - temp_v0 = gTimeTrialDataCourseIndex; - temp_v1 = &D_800E7430[(s32) temp_v0 / 4]; - arg0->column = temp_v1->unk0 - 2; - temp_t7 = arg0->unk1C + 0x10; - arg0->row = temp_v1->unk2 + (((s32) temp_v0 % 4) * 0x32) + 0x13; - arg0->unk1C = temp_t7; - if (temp_t7 >= 0x100) { - arg0->unk1C = temp_t7 - 0x100; + temp_v1 = &D_800E7430[thing / 4]; + arg0->column = temp_v1->column - 2; + arg0->row = temp_v1->row + ((thing % 4) * 0x32) + 0x13; + arg0->unk1C += 0x10; + if (arg0->unk1C >= 0x100) { + arg0->unk1C -= 0x100; arg0->unk20 = (s32) (arg0->unk20 + 1) % 3; } } @@ -14386,69 +14129,51 @@ void func_800ABB24(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ABB24.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -struct _struct_D_800E7430_0x8 { - /* 0x0 */ s16 unk0; /* inferred */ - /* 0x2 */ s16 unk2; /* inferred */ - /* 0x4 */ char pad4[4]; /* maybe part of unk2[3]? */ -}; /* size = 0x8 */ - -static struct _struct_D_800E7430_0x8 D_800E7430[0]; /* unable to generate initializer; const */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +extern Unk_D_800E70A0 D_800E7430[]; void func_800ABBCC(struct_8018D9E0_entry *arg0) { s32 temp_v0; - struct _struct_D_800E7430_0x8 *temp_v1; + Unk_D_800E70A0 *temp_v1; temp_v0 = arg0->type - 0x7C; temp_v1 = &D_800E7430[temp_v0 / 4]; - arg0->column = (s32) temp_v1->unk0; - arg0->row = temp_v1->unk2 + ((temp_v0 % 4) * 0x32) + 0x14; + arg0->column = (s32) temp_v1->column; + arg0->row = temp_v1->row + ((temp_v0 % 4) * 0x32) + 0x14; } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ABBCC.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_800ABCF4(); /* extern */ -extern s8 D_8018EE08; - void func_800ABC38(struct_8018D9E0_entry *arg0) { - s32 temp_v0; - s32 temp_v0_2; - s32 temp_v0_3; - - func_800ABCF4(); - temp_v0 = D_80164A28; - switch (temp_v0) { /* irregular */ + // Huh? + s32 one = 1; + func_800ABCF4(arg0); + switch (D_80164A28) { /* irregular */ case 1: - arg0->visible = 1; - return; + arg0->visible = one; + break; case 2: - temp_v0_2 = arg0->row; - if (temp_v0_2 >= -0x13) { - arg0->row = temp_v0_2 - 2; - return; + if (arg0->row >= -0x13) { + arg0->row -= 2; + } else { + arg0->type = 0; } -block_13: - arg0->type = 0; - return; + break; default: - if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != 1U) || (D_8018EE08 != 0)) { - goto block_13; + if ((gModeSelection != 0) || (gPlayerCountSelection1 != (s32) 1U) || (D_8018EE08 != 0)) { + arg0->type = 0; + } else { + if (arg0->row >= -0x13) { + arg0->row -= 2; + } else { + arg0->type = 0; + } } - temp_v0_3 = arg0->row; - if (temp_v0_3 >= -0x13) { - arg0->row = temp_v0_3 - 2; - return; - } - goto block_13; + break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ABC38.s") -#endif #ifdef NEEDS_RODATA // data/data_0DD0A0_3_0.s @@ -14658,23 +14383,15 @@ void func_800AC324(struct_8018D9E0_entry *arg0) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_800B536C(s32, s32, s32, struct_8018D9E0_entry *); /* extern */ -void func_800CA330(?, s32); /* extern */ -void play_sound2(?, s32, u8 *, struct_8018D9E0_entry *); /* extern */ -extern void *D_800DC5EC; -extern void *D_800DC5F0; -extern s16 D_8015F894; -extern s16 gGPCurrentRacePlayerIdByRank; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-12-2022 +? func_800B536C(s32, s32, s32, struct_8018D9E0_entry *); /* extern */ extern ? D_80164478; extern void *D_8018D9BC; -extern s8 D_8018D9D8; -extern s8 D_8018EDF3; -static s32 D_800DDB24 = 1; static s8 gGP1stPlaceReward = 9; /* const */ static s8 gGP2ndPlaceReward = 6; /* const */ static s8 gGP3rdPlaceReward = 3; /* const */ static s8 gGP4thPlaceReward = 1; /* const */ +s32 D_800DDB24 = 1; void func_800AC458(struct_8018D9E0_entry *arg0) { s32 sp1C; @@ -14682,7 +14399,6 @@ void func_800AC458(struct_8018D9E0_entry *arg0) { s32 temp_a1; s32 temp_a1_2; s32 temp_a1_3; - s32 temp_a1_4; s32 temp_a2; s32 temp_t2; s32 temp_t3; @@ -14691,66 +14407,56 @@ void func_800AC458(struct_8018D9E0_entry *arg0) { s32 temp_t7; s32 temp_t8; s32 temp_v0; + s32 temp_v0_2; s32 temp_v0_3; - s32 temp_v0_4; - s8 *temp_v1_2; - struct_8018D9E0_entry *temp_a3; + s32 var_a0; + s32 var_a1; + s32 var_t1; + s8 *temp_v1; + s8 *var_v0; u8 *temp_a2_2; u8 temp_t0; - void *temp_v0_2; - void *temp_v0_5; - void *temp_v1; - void *temp_v1_3; - s32 phi_a0; - struct_8018D9E0_entry *phi_a3; - s32 phi_t1; - s8 *phi_v0; - s32 phi_a1; temp_v0 = arg0->unk4; - temp_a3 = arg0; - phi_a3 = temp_a3; switch (temp_v0) { case 0: - temp_a3->column = -0xA0; - temp_a3->unk4 = 1; + arg0->column = -0x000000A0; + arg0->unk4 = 1; D_8018D9BC->unk0 = (s8) gGP1stPlaceReward; D_8018D9BC->unk1 = (s8) gGP2ndPlaceReward; D_8018D9BC->unk2 = (s8) gGP3rdPlaceReward; D_8018D9BC->unk3 = (s8) gGP4thPlaceReward; - temp_a3->unk20 = temp_a3->column; + arg0->unk20 = arg0->column; return; case 1: - temp_a1 = temp_a3->unk20; - temp_a3->column = temp_a1; - phi_a0 = 0x10; + temp_a1 = arg0->unk20; + var_a0 = 0x10; + arg0->column = temp_a1; if (D_8018D9D8 != 0) { - phi_a0 = 0x20; + var_a0 = 0x20; } - temp_a2 = temp_a1 + phi_a0; + temp_a2 = temp_a1 + var_a0; if (temp_a2 < 0) { - temp_a3->unk20 = temp_a2; - temp_v0_2 = D_800DC5EC; - temp_v0_2->unk30 = (s16) (temp_v0_2->unk30 + phi_a0); - temp_v1 = D_800DC5F0; - temp_v1->unk30 = (s16) (temp_v1->unk30 - phi_a0); + arg0->unk20 = temp_a2; + D_800DC5EC->screenStartX += var_a0; + D_800DC5F0->screenStartX -= var_a0; return; } - temp_a3->unk20 = 0; - temp_a3->column = 0; - temp_a3->unk4 = 2; - temp_a3->unk1C = 0; - D_800DC5EC->unk30 = 0xF0; - D_800DC5F0->unk30 = 0x50; + arg0->unk20 = 0; + arg0->column = 0; + arg0->unk4 = 2; + arg0->unk1C = 0; + D_800DC5EC->screenStartX = 0x00F0; + D_800DC5F0->screenStartX = 0x0050; return; case 2: - temp_a3->column = 0; - temp_t5 = temp_a3->unk1C + 1; - temp_a3->unk1C = temp_t5; + arg0->column = 0; + temp_t5 = arg0->unk1C + 1; + arg0->unk1C = temp_t5; if (((D_8018D9D8 != 0) || (temp_t5 >= 0x1F)) && (D_800DDB24 != 0)) { - temp_a3->unk4 = 3; - temp_a3->unk1C = 0; - temp_a3->unk20 = 0; + arg0->unk4 = 3; + arg0->unk1C = 0; + arg0->unk20 = 0; return; } default: @@ -14759,84 +14465,82 @@ void func_800AC458(struct_8018D9E0_entry *arg0) { case 4: case 5: case 6: - temp_t3 = temp_a3->unk1C + 1; + var_t1 = 0; + temp_t3 = arg0->unk1C + 1; temp_a1_2 = temp_v0 - 3; - temp_a3->unk1C = temp_t3; + arg0->unk1C = temp_t3; if (((temp_t3 % 3) == 0) || (D_8018D9D8 != 0)) { temp_a2_2 = D_8018D9BC + temp_a1_2; temp_t0 = *temp_a2_2; if ((s32) temp_t0 > 0) { *temp_a2_2 = temp_t0 - 1; - temp_v1_2 = &gGPPointsByCharacterId[*(&gPlayers->characterId + (*(&gGPCurrentRacePlayerIdByRank + (temp_a1_2 * 2)) * 0xDD8))]; + temp_v1 = &gGPPointsByCharacterId[*(&gPlayers->characterId + (gGPCurrentRacePlayerIdByRank[temp_a1_2] * 0xDD8))]; sp18 = 0; - arg0 = temp_a3; - *temp_v1_2 += 1; + *temp_v1 += 1; sp1C = temp_a1_2; - play_sound2(SOUND_ACTION_COUNT_SCORE, temp_a1_2, temp_a2_2, temp_a3); - phi_a3 = arg0; + play_sound2(0x49008017); + var_t1 = 0; if ((*(D_8018D9BC + temp_a1_2) == 0) && (arg0->unk20 == 0)) { arg0->unk20 = 1; arg0->unk1C = 0; } } } - phi_t1 = 0; - if ((phi_a3->unk20 != 0) && ((temp_v0_3 = phi_a3->unk1C, ((temp_v0_3 < 0xB) == 0)) || ((D_8018D9D8 != 0) && (temp_v0_3 >= 4)))) { - phi_t1 = 1; + if ((arg0->unk20 != 0) && ((temp_v0_2 = arg0->unk1C, ((temp_v0_2 < 0xB) == 0)) || ((D_8018D9D8 != 0) && (temp_v0_2 >= 4)))) { + var_t1 = 1; } - if (phi_t1 != 0) { - temp_v0_4 = phi_a3->unk4; - phi_a3->unk20 = 0; - phi_a3->unk1C = 0; - if (temp_v0_4 < 6) { - phi_a3->unk4 = temp_v0_4 + 1; + if (var_t1 != 0) { + temp_v0_3 = arg0->unk4; + arg0->unk20 = 0; + arg0->unk1C = 0; + if (temp_v0_3 < 6) { + arg0->unk4 = temp_v0_3 + 1; return; } - phi_a3->unk4 = 7; + arg0->unk4 = 7; return; } break; case 7: - temp_t2 = temp_a3->unk1C + 1; - temp_a3->unk1C = temp_t2; - if ((((D_8018D9D8 != 0) && (temp_t2 >= 0xB)) || (temp_a3->unk1C >= 0x3D)) && (D_800DDB24 != 0)) { - temp_a3->unk4 = 8; - temp_a3->unk1C = 0; + temp_t2 = arg0->unk1C + 1; + arg0->unk1C = temp_t2; + if ((((D_8018D9D8 != 0) && (temp_t2 >= 0xB)) || (arg0->unk1C >= 0x3D)) && (D_800DDB24 != 0)) { + arg0->unk4 = 8; + arg0->unk1C = 0; return; } break; case 8: - temp_t8 = temp_a3->unk1C + 1; - temp_a3->unk1C = temp_t8; + temp_t8 = arg0->unk1C + 1; + arg0->unk1C = temp_t8; if (D_8018D9D8 != 0) { - temp_a3->unk1C = temp_t8 + 5; + arg0->unk1C = temp_t8 + 5; } - if (temp_a3->unk1C >= 0x29) { - temp_a3->unk4 = 9; + if (arg0->unk1C >= 0x29) { + arg0->unk4 = 9; return; } break; case 9: - temp_t7 = temp_a3->unk1C - 1; - temp_a3->unk1C = temp_t7; + temp_t7 = arg0->unk1C - 1; + arg0->unk1C = temp_t7; if (D_8018D9D8 != 0) { - temp_a3->unk1C = temp_t7 - 5; + arg0->unk1C = temp_t7 - 5; } - if (temp_a3->unk1C <= 0) { - temp_a3->unk4 = 0xA; - temp_a3->unk1C = 0; - phi_a1 = 0; + if (arg0->unk1C <= 0) { + arg0->unk4 = 0x0000000A; + arg0->unk1C = 0; + var_a1 = 0; if (gCupCourseSelection == 3) { - phi_v0 = gCharacterIdByGPOverallRank; + var_v0 = gCharacterIdByGPOverallRank; loop_41: - if ((s32) *(&D_80164478 + (*phi_v0 * 2)) < (s32) D_8018EDF3) { - func_800B536C(phi_a1, phi_a1, 8, temp_a3); + if (*(&D_80164478 + (*var_v0 * 2)) < D_8018EDF3) { + func_800B536C(var_a1, var_a1, 8, arg0); return; } - temp_a1_3 = phi_a1 + 1; - phi_v0 += 1; - phi_a1 = temp_a1_3; - if (temp_a1_3 == 8) { + var_a1 += 1; + var_v0 += 1; + if (var_a1 == 8) { return; } goto loop_41; @@ -14844,41 +14548,39 @@ loop_41: } break; case 10: - temp_t3_2 = temp_a3->unk1C + 1; - temp_a3->unk1C = temp_t3_2; + temp_t3_2 = arg0->unk1C + 1; + arg0->unk1C = temp_t3_2; if (temp_t3_2 > 0) { - temp_a3->unk4 = 0xB; - temp_a3->unk1C = 0; + arg0->unk4 = 0x0000000B; + arg0->unk1C = 0; func_800921B4(); return; } break; case 11: if ((D_8018D9D8 != 0) && (D_800DDB24 != 0)) { - temp_a3->unk4 = 0xC; - temp_a3->unk20 = temp_a3->row; - play_sound2(SOUND_ACTION_NEXT_COURSE); + arg0->unk4 = 0x0000000C; + arg0->unk20 = arg0->row; + play_sound2(0x49008015); return; } break; case 12: - temp_a1_4 = temp_a3->unk20; - temp_a3->row = temp_a1_4; - if (temp_a1_4 < 0xF0) { - temp_a3->unk20 = temp_a1_4 + 0x10; - temp_v0_5 = D_800DC5EC; - temp_v0_5->unk32 = (s16) (temp_v0_5->unk32 + 0x10); - temp_v1_3 = D_800DC5F0; - temp_v1_3->unk32 = (s16) (temp_v1_3->unk32 - 0x10); + temp_a1_3 = arg0->unk20; + arg0->row = temp_a1_3; + if (temp_a1_3 < 0xF0) { + arg0->unk20 = temp_a1_3 + 0x10; + D_800DC5EC->screenStartY += 0x10; + D_800DC5F0->screenStartY -= 0x10; return; } - temp_a3->unk20 = 0; - temp_a3->unk4 = 0xD; - temp_a3->unk1C = 0; - D_800DC5EC->unk32 = 0x12C; - D_800DC5F0->unk32 = -0x3C; + arg0->unk20 = 0; + arg0->unk4 = 0x0000000D; + arg0->unk1C = 0; + D_800DC5EC->screenStartY = 0x012C; + D_800DC5F0->screenStartY = -0x003C; D_8015F894 = 4; - func_800CA330(0x19, temp_a1_4); + func_800CA330(0x19U); break; } } @@ -14910,119 +14612,81 @@ void func_800AC978(struct_8018D9E0_entry *arg0) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_8009DFE0(?, struct_8018D9E0_entry *); /* extern */ -void func_800CA330(?); /* extern */ -void play_sound2(?, struct_8018D9E0_entry *); /* extern */ -extern void *gControllerFive; - +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-12-2022 void func_800ACA14(struct_8018D9E0_entry *arg0) { f64 temp_f0; f64 temp_f0_2; f64 temp_f0_3; - s32 temp_a0; s32 temp_v0; + s32 temp_v0_2; s32 temp_v0_3; - s32 temp_v0_4; - struct_8018D9E0_entry *temp_a1; - struct_8018D9E0_entry *temp_a1_2; - u16 temp_v1; - u16 temp_v1_2; - void *temp_t5; - void *temp_v0_2; - s32 phi_a0; - struct_8018D9E0_entry *phi_a1; - u16 phi_v1; - struct_8018D9E0_entry *phi_a1_2; - s32 phi_v0; - struct_8018D9E0_entry *phi_a1_3; - struct_8018D9E0_entry *phi_a1_4; + s32 var_a0; + s32 var_v0; + u16 var_v1; - temp_v0 = arg0->unk4; - temp_a1 = arg0; - phi_a1_3 = temp_a1; - phi_a1_4 = temp_a1; - switch (temp_v0) { /* irregular */ + switch (arg0->unk4) { /* irregular */ default: - phi_v0 = arg0->unk20; + var_v0 = arg0->unk20; break; case 0: - if (temp_a1->unk20 >= 0xB) { - temp_a1->unk1C += 3; + if (arg0->unk20 >= 0xB) { + arg0->unk1C += 3; } - if (temp_a1->unk1C >= 0x65) { - temp_a1->unk4 = 0xB; - temp_a1->unk1C = 0; + if (arg0->unk1C >= 0x65) { + arg0->unk4 = 0x0000000B; + arg0->unk1C = 0; } -block_24: - phi_v0 = phi_a1_4->unk20; - phi_a1_3 = phi_a1_4; + var_v0 = arg0->unk20; break; case 11: case 12: - arg0 = temp_a1; - temp_a1_2 = arg0; - phi_a1 = temp_a1_2; - phi_a1_4 = temp_a1_2; - if (func_800B4520(temp_a1) != 0) { - + if (func_800B4520() != 0) { + // Wut? } else { - temp_v0_2 = gControllerFive; - temp_v1 = temp_v0_2->unk6; - temp_a0 = temp_v1 | temp_v0_2->unkC; - phi_a0 = temp_a0; - phi_v1 = temp_v1; - if ((temp_a0 & 0x800) != 0) { - temp_v0_3 = temp_a1_2->unk4; - if (temp_v0_3 >= 0xC) { - temp_a1_2->unk4 = temp_v0_3 - 1; - arg0 = temp_a1_2; - play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_2); + var_v1 = gControllerFive->buttonPressed; + var_a0 = var_v1 | gControllerFive->stickPressed; + if (var_a0 & 0x800) { + temp_v0_2 = arg0->unk4; + if (temp_v0_2 >= 0xC) { + arg0->unk4 = temp_v0_2 - 1; + play_sound2(0x49008000); temp_f0 = (f64) arg0->unk24; - phi_a1 = arg0; if (temp_f0 < 4.2) { arg0->unk24 = (f32) (temp_f0 + 4.0); } arg0->unk8 = -1; - temp_t5 = gControllerFive; - temp_v1_2 = temp_t5->unk6; - phi_a0 = temp_v1_2 | temp_t5->unkC; - phi_v1 = temp_v1_2; + var_v1 = gControllerFive->buttonPressed; + var_a0 = var_v1 | gControllerFive->stickPressed; } } - phi_a1_2 = phi_a1; - if ((phi_a0 & 0x400) != 0) { - temp_v0_4 = phi_a1->unk4; - if (temp_v0_4 < 0xC) { - phi_a1->unk4 = temp_v0_4 + 1; - arg0 = phi_a1; - play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1); + if (var_a0 & 0x400) { + temp_v0_3 = arg0->unk4; + if (temp_v0_3 < 0xC) { + arg0->unk4 = temp_v0_3 + 1; + play_sound2(0x49008000); temp_f0_2 = (f64) arg0->unk24; - phi_a1_2 = arg0; if (temp_f0_2 < 4.2) { arg0->unk24 = (f32) (temp_f0_2 + 4.0); } arg0->unk8 = 1; - phi_v1 = gControllerFive->unk6; + var_v1 = gControllerFive->buttonPressed; } } - phi_a1_4 = phi_a1_2; - if ((phi_v1 & 0x9000) != 0) { - arg0 = phi_a1_2; - func_8009DFE0(0x1E, phi_a1_2); - func_800CA330(0x19); - play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); + if (var_v1 & 0x9000) { + func_8009DFE0(0x0000001E); + func_800CA330(0x19U); + play_sound2(0x4900801B); temp_f0_3 = (f64) arg0->unk24; - phi_a1_4 = arg0; if (temp_f0_3 < 4.2) { arg0->unk24 = (f32) (temp_f0_3 + 4.0); } } } - goto block_24; + var_v0 = arg0->unk20; + break; } - if (phi_v0 < 0x28) { - phi_a1_3->unk20 = phi_v0 + 1; + if (var_v0 < 0x28) { + arg0->unk20 = var_v0 + 1; } } #else @@ -15030,75 +14694,55 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ACA14.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_8009DFE0(?, struct_8018D9E0_entry *); /* extern */ -void play_sound2(?, struct_8018D9E0_entry *); /* extern */ -extern s8 D_8018EDF3; -extern s8 D_8018EDF4; -extern s8 D_8018EDF6; -extern void *gControllerFive; - +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-12-2022 void func_800ACC50(struct_8018D9E0_entry *arg0) { f64 temp_f0; f64 temp_f0_2; f64 temp_f0_3; - s32 temp_a0; - s32 temp_s0; s32 temp_t6; s32 temp_t8; s32 temp_t9; + s32 temp_v0; s32 temp_v0_2; - s32 temp_v0_3; - struct_8018D9E0_entry *temp_a1; - struct_8018D9E0_entry *temp_a1_2; - u16 temp_v1; - u16 temp_v1_2; - void *temp_t8_2; - void *temp_v0; - s32 phi_s0; - s32 phi_a0; - struct_8018D9E0_entry *phi_a1; - u16 phi_v1; - struct_8018D9E0_entry *phi_a1_2; + s32 var_a0; + s32 var_s0; + u16 var_v1; temp_t6 = arg0->unk4; - temp_a1 = arg0; switch (temp_t6) { case 0: - temp_t8 = temp_a1->unk1C + 3; - temp_a1->unk1C = temp_t8; + temp_t8 = arg0->unk1C + 3; + arg0->unk1C = temp_t8; if (temp_t8 >= 0x65) { - temp_a1->unk4 = 1; - temp_a1->unk1C = 0; - phi_s0 = 0; - if ((s32) D_8018EDF3 > 0) { + arg0->unk4 = 1; + arg0->unk1C = 0; + var_s0 = 0; + if (D_8018EDF3 > 0) { do { - add_8018D9E0_entry(phi_s0 + 0xB1, 0, 0, (s8) (5 - phi_s0)); - temp_s0 = phi_s0 + 1; - phi_s0 = temp_s0; - } while (temp_s0 < (s32) D_8018EDF3); + add_8018D9E0_entry(var_s0 + 0xB1, 0, 0, (s8) (5 - var_s0)); + var_s0 += 1; + } while (var_s0 < D_8018EDF3); return; } } default: return; case 1: - arg0 = temp_a1; - if (find_8018D9E0_entry_dupe(0xB1)->unk4 >= 2) { + if (find_8018D9E0_entry_dupe(0x000000B1)->unk4 >= 2) { arg0->unk4 = 2; return; } break; case 2: - temp_t9 = temp_a1->unk1C + 0x20; - temp_a1->unk1C = temp_t9; + temp_t9 = arg0->unk1C + 0x20; + arg0->unk1C = temp_t9; if (temp_t9 >= 0x100) { - if (gModeSelection == VERSUS) { - temp_a1->unk4 = (s32) D_8018EDF4; + if (gModeSelection == 2) { + arg0->unk4 = (s32) D_8018EDF4; } else { - temp_a1->unk4 = (s32) D_8018EDF6; + arg0->unk4 = (s32) D_8018EDF6; } - temp_a1->unk1C = 0; + arg0->unk1C = 0; return; } break; @@ -15106,54 +14750,40 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) { case 11: case 12: case 13: - arg0 = temp_a1; - temp_a1_2 = arg0; - phi_a1 = temp_a1_2; - if (func_800B4520(temp_a1) == 0) { - temp_v0 = gControllerFive; - temp_v1 = temp_v0->unk6; - temp_a0 = temp_v1 | temp_v0->unkC; - phi_a0 = temp_a0; - phi_v1 = temp_v1; - if ((temp_a0 & 0x800) != 0) { - temp_v0_2 = temp_a1_2->unk4; - if (temp_v0_2 >= 0xB) { - temp_a1_2->unk4 = temp_v0_2 - 1; - arg0 = temp_a1_2; - play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_2); + if (func_800B4520() == 0) { + var_v1 = gControllerFive->buttonPressed; + var_a0 = var_v1 | gControllerFive->stickPressed; + if (var_a0 & 0x800) { + temp_v0 = arg0->unk4; + if (temp_v0 >= 0xB) { + arg0->unk4 = temp_v0 - 1; + play_sound2(0x49008000); temp_f0 = (f64) arg0->unk24; - phi_a1 = arg0; if (temp_f0 < 4.2) { arg0->unk24 = (f32) (temp_f0 + 4.0); } arg0->unk8 = -1; - temp_t8_2 = gControllerFive; - temp_v1_2 = temp_t8_2->unk6; - phi_a0 = temp_v1_2 | temp_t8_2->unkC; - phi_v1 = temp_v1_2; + var_v1 = gControllerFive->buttonPressed; + var_a0 = var_v1 | gControllerFive->stickPressed; } } - phi_a1_2 = phi_a1; - if ((phi_a0 & 0x400) != 0) { - temp_v0_3 = phi_a1->unk4; - if (temp_v0_3 < 0xD) { - phi_a1->unk4 = temp_v0_3 + 1; - arg0 = phi_a1; - play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1); + if (var_a0 & 0x400) { + temp_v0_2 = arg0->unk4; + if (temp_v0_2 < 0xD) { + arg0->unk4 = temp_v0_2 + 1; + play_sound2(0x49008000); temp_f0_2 = (f64) arg0->unk24; - phi_a1_2 = arg0; if (temp_f0_2 < 4.2) { arg0->unk24 = (f32) (temp_f0_2 + 4.0); } arg0->unk8 = 1; - phi_v1 = gControllerFive->unk6; + var_v1 = gControllerFive->buttonPressed; } } - if ((phi_v1 & 0x9000) != 0) { - arg0 = phi_a1_2; - func_8009DFE0(0x1E, phi_a1_2); - play_sound2(SOUND_MENU_OK_CLICKED); - if (gModeSelection == VERSUS) { + if (var_v1 & 0x9000) { + func_8009DFE0(0x0000001E); + play_sound2(0x49008016); + if (gModeSelection == 2) { D_8018EDF4 = (s8) arg0->unk4; } else { D_8018EDF6 = (s8) arg0->unk4; @@ -15350,27 +14980,9 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AD1A4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-12-2022 s32 func_800B6348(s32); /* extern */ -void func_800B6708(); /* extern */ -s32 osPfsFindFile(? *, u16, s32, ? *, ? *, ? *); /* extern */ -void play_sound2(?, u16); /* extern */ -extern void *D_800DC5EC; -extern void *D_800DC5F0; -extern s32 D_80162DF8; extern void *D_8018D9BC; -extern s8 D_8018D9D8; -extern OSPfs D_8018E868; -extern s32 D_8018EB78; -extern s32 D_8018EB7C; -extern s32 D_8018EB84; -extern s8 D_8018EDF5; -extern void *gControllerOne; -static u16 D_800E86F0; /* unable to generate initializer; const */ -static s32 D_800E86F4 = 0x4E4B544A; /* const */ -static s8 D_800E86F8 = 0; /* const */ -static u8 D_800F2E64; /* unable to generate initializer; const */ -static u8 D_800F2E74; /* unable to generate initializer; const */ static s8 gGP1stPlaceReward = 9; /* const */ static s8 gGP2ndPlaceReward = 6; /* const */ static s8 gGP3rdPlaceReward = 3; /* const */ @@ -15383,35 +14995,26 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { f64 temp_f0_3; f64 temp_f0_4; s32 temp_a0; - s32 temp_a0_2; s32 temp_a2; s32 temp_t2; s32 temp_t9; s32 temp_v0; + s32 temp_v0_2; s32 temp_v0_3; s32 temp_v0_4; s32 temp_v0_5; s32 temp_v0_6; s32 temp_v0_7; - s32 temp_v0_8; - s8 temp_t3; - u16 temp_a1; - u16 temp_a1_2; - void *temp_t6; - void *temp_v0_2; - void *temp_v1; - void *temp_v1_2; - s32 phi_a1; - s32 phi_a0; - u16 phi_a1_2; - u16 phi_a1_3; - s32 phi_v1; - s32 phi_v1_2; + s32 var_a0; + s32 var_a1; + s32 var_v1; + s32 var_v1_2; + u16 var_a1_2; temp_v0 = arg0->unk4; switch ((u32) temp_v0) { /* switch 3; irregular */ case 0: /* switch 3 */ - arg0->column = -0xA0; + arg0->column = -0x000000A0; arg0->unk4 = 1; D_8018D9BC->unk0 = (s8) gGP1stPlaceReward; D_8018D9BC->unk1 = (s8) gGP2ndPlaceReward; @@ -15421,29 +15024,26 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { return; case 1: /* switch 3 */ temp_a0 = arg0->unk20; + var_a1 = 0x10; arg0->column = temp_a0; - phi_a1 = 0x10; if (D_8018D9D8 != 0) { - phi_a1 = 0x20; + var_a1 = 0x20; } - temp_a2 = temp_a0 + phi_a1; + temp_a2 = temp_a0 + var_a1; if (temp_a2 < 0) { arg0->unk20 = temp_a2; - temp_v0_2 = D_800DC5EC; - temp_v0_2->unk30 = (s16) (temp_v0_2->unk30 + phi_a1); - temp_v1 = D_800DC5F0; - temp_v1->unk30 = (s16) (temp_v1->unk30 - phi_a1); + D_800DC5EC->screenStartX += var_a1; + D_800DC5F0->screenStartX -= var_a1; return; } arg0->unk20 = 0; arg0->column = 0; - temp_t3 = D_8018EDF5; - arg0->unk4 = (s32) temp_t3; - if ((temp_t3 == 9) && (D_80162DF8 == 1)) { - arg0->unk4 = temp_t3 - 1; + arg0->unk4 = (s32) D_8018EDF5; + if ((D_8018EDF5 == 9) && (D_80162DF8 == 1)) { + arg0->unk4 = D_8018EDF5 - 1; } - D_800DC5EC->unk30 = 0xF0; - D_800DC5F0->unk30 = 0x50; + D_800DC5EC->screenStartX = 0x00F0; + D_800DC5F0->screenStartX = 0x0050; return; case 5: /* switch 3 */ case 6: /* switch 3 */ @@ -15452,73 +15052,70 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { case 9: /* switch 3 */ case 10: /* switch 3 */ if (func_800B4520() == 0) { - temp_v1_2 = gControllerOne; - temp_a1 = temp_v1_2->unk6; - temp_a0_2 = temp_a1 | temp_v1_2->unkC; - phi_a0 = temp_a0_2; - phi_a1_2 = temp_a1; - if ((temp_a0_2 & 0x800) != 0) { - temp_v0_3 = arg0->unk4; - temp_t2 = temp_v0_3 - 1; - if (temp_v0_3 >= 6) { + var_a1_2 = gControllerOne->buttonPressed; + var_a0 = var_a1_2 | gControllerOne->stickPressed; + if (var_a0 & 0x800) { + temp_v0_2 = arg0->unk4; + temp_t2 = temp_v0_2 - 1; + if (temp_v0_2 >= 6) { arg0->unk4 = temp_t2; if ((D_80162DF8 == 1) && (temp_t2 == 9)) { arg0->unk4 = temp_t2 - 1; } - play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1); + play_sound2(0x49008000); temp_f0 = (f64) arg0->unk24; if (temp_f0 < 4.2) { arg0->unk24 = (f32) (temp_f0 + 4.0); } arg0->unk8 = -1; - temp_t6 = gControllerOne; - temp_a1_2 = temp_t6->unk6; - phi_a0 = temp_a1_2 | temp_t6->unkC; - phi_a1_2 = temp_a1_2; + var_a1_2 = gControllerOne->buttonPressed; + var_a0 = var_a1_2 | gControllerOne->stickPressed; } } - phi_a1_3 = phi_a1_2; - if ((phi_a0 & 0x400) != 0) { - temp_v0_4 = arg0->unk4; - temp_t9 = temp_v0_4 + 1; - if (temp_v0_4 < 0xA) { + if (var_a0 & 0x400) { + temp_v0_3 = arg0->unk4; + temp_t9 = temp_v0_3 + 1; + if (temp_v0_3 < 0xA) { arg0->unk4 = temp_t9; if ((D_80162DF8 == 1) && (temp_t9 == 9)) { arg0->unk4 = temp_t9 + 1; } - temp_v0_5 = arg0->unk4; - if ((temp_v0_5 == 0xA) && (*D_80162DD4 != 0)) { - arg0->unk4 = temp_v0_5 - 2; - phi_a1_3 = gControllerOne->unk6; + temp_v0_4 = arg0->unk4; + if ((temp_v0_4 == 0x0000000A) && (*D_80162DD4 != 0)) { + arg0->unk4 = temp_v0_4 - 2; + var_a1_2 = gControllerOne->buttonPressed; } else { - play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1_2); + play_sound2(0x49008000); temp_f0_2 = (f64) arg0->unk24; if (temp_f0_2 < 4.2) { arg0->unk24 = (f32) (temp_f0_2 + 4.0); } arg0->unk8 = 1; - phi_a1_3 = gControllerOne->unk6; + var_a1_2 = gControllerOne->buttonPressed; } } } - if ((phi_a1_3 & 0x9000) != 0) { - temp_v0_6 = arg0->unk4; - if (temp_v0_6 == 0xA) { + if (var_a1_2 & 0x9000) { + temp_v0_5 = arg0->unk4; + if (temp_v0_5 == 0x0000000A) { temp_f0_3 = (f64) arg0->unk24; - phi_v1 = 0; + var_v1 = 0; if (temp_f0_3 < 4.2) { arg0->unk24 = (f32) (temp_f0_3 + 4.0); } if (D_800E86F8 != 0) { sp28 = 0; - temp_v0_7 = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84); - switch (temp_v0_7) { /* switch 4; irregular */ + temp_v0_6 = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB84); + var_v1 = 0; + switch (temp_v0_6) { /* switch 4; irregular */ + case 5: /* switch 4 */ + break; case 0: /* switch 4 */ func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11; sp28 = 1; - play_sound2(SOUND_MENU_SELECT); - phi_v1 = 1; + play_sound2(0x49008001); + var_v1 = 1; break; case 2: /* switch 4 */ /* fallthrough */ @@ -15527,70 +15124,69 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { break; } } - case 5: /* switch 4 */ - if (phi_v1 == 0) { + if (var_v1 == 0) { if (D_800E86F8 == 0) { - sp28 = phi_v1; - temp_v0_8 = func_800B5F30(); - phi_v1_2 = phi_v1; - switch (temp_v0_8) { /* switch 2 */ + sp28 = var_v1; + temp_v0_7 = func_800B5F30(); + var_v1_2 = var_v1; + switch (temp_v0_7) { /* switch 2 */ case -1: /* switch 2 */ - arg0->unk4 = 0xB; - phi_v1_2 = 1; + arg0->unk4 = 0x0000000B; + var_v1_2 = 1; break; case -3: /* switch 2 */ case -2: /* switch 2 */ - arg0->unk4 = 0xC; - phi_v1_2 = 1; + arg0->unk4 = 0x0000000C; + var_v1_2 = 1; break; case 1: /* switch 2 */ case 11: /* switch 2 */ - arg0->unk4 = 0xB; - phi_v1_2 = 1; + arg0->unk4 = 0x0000000B; + var_v1_2 = 1; break; case 10: /* switch 2 */ - arg0->unk4 = 0xC; - phi_v1_2 = 1; + arg0->unk4 = 0x0000000C; + var_v1_2 = 1; break; default: /* switch 2 */ - arg0->unk4 = 0xC; - phi_v1_2 = 1; + var_v1_2 = 1; + arg0->unk4 = 0x0000000C; break; } - if (phi_v1_2 != 0) { - play_sound2(SOUND_MENU_FILE_NOT_FOUND); + if (var_v1_2 != 0) { + play_sound2(0x4900FF07); return; } - if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) == 0) { + if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB84) == 0) { func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11; - play_sound2(SOUND_MENU_SELECT); + play_sound2(0x49008001); return; } goto block_56; } block_56: if (D_8018EB7C >= D_8018EB78) { - arg0->unk4 = 0xE; - play_sound2(SOUND_MENU_FILE_NOT_FOUND); + arg0->unk4 = 0x0000000E; + play_sound2(0x4900FF07); return; } if (gControllerPakNumPagesFree >= 0x79) { - arg0->unk4 = 0x13; + arg0->unk4 = 0x00000013; arg0->unk1C = 0; - play_sound2(SOUND_MENU_SELECT); + play_sound2(0x49008001); return; } - arg0->unk4 = 0xE; - play_sound2(SOUND_MENU_FILE_NOT_FOUND); + arg0->unk4 = 0x0000000E; + play_sound2(0x4900FF07); return; } } else { - arg0->unk1C = temp_v0_6; - D_8018EDF5 = (s8) temp_v0_6; - arg0->unk4 = 0x1E; + arg0->unk1C = temp_v0_5; + D_8018EDF5 = (s8) temp_v0_5; + arg0->unk4 = 0x0000001E; arg0->unk20 = arg0->row; - play_sound2(SOUND_ACTION_NEXT_COURSE, phi_a1_3); + play_sound2(0x49008015); temp_f0_4 = (f64) arg0->unk24; if (temp_f0_4 < 4.2) { arg0->unk24 = (f32) (temp_f0_4 + 4.0); @@ -15608,12 +15204,7 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AD2E8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_8009DFE0(?, struct_8018D9E0_entry *, void *, s32 *); /* extern */ -void func_800C9F90(?); /* extern */ -void func_800CA330(?); /* extern */ -void func_8028DF38(?, struct_8018D9E0_entry *, void *, s32 *); /* extern */ -extern Controller gControllers; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-12-2022 static ? D_800F0B50; /* unable to generate initializer; const */ static ? D_800F0B54; /* unable to generate initializer; const */ @@ -15622,26 +15213,19 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { f64 temp_f0; f64 temp_f0_2; f64 temp_f0_3; - s32 temp_a0; - s32 temp_t2; s32 temp_t7; s32 temp_v0; s32 temp_v0_2; + s32 var_a0; s8 temp_v0_3; - struct_8018D9E0_entry *temp_a1; - u16 temp_v1; - u16 temp_v1_2; - void *temp_a2; - s32 phi_a0; - u16 phi_v1; - struct_8018D9E0_entry *phi_a1; + u16 var_v1; + void *var_a2; - temp_a1 = arg0; if (D_800DC5FC != 0) { temp_t7 = arg0->unk4; switch (temp_t7) { case 0: - temp_a1->unk4 = (s32) *(&D_800F0B50 + gModeSelection); + arg0->unk4 = (s32) *(&D_800F0B50 + gModeSelection); return; case 11: case 12: @@ -15658,68 +15242,58 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { case 42: case 43: case 44: - arg0 = temp_a1; - if (func_800B4520(temp_a1) == 0) { - temp_t2 = (D_800DC5FC * 0x10) - 0x10; - temp_a2 = temp_t2 + &gControllers; - temp_v1 = temp_a2->unk6; - temp_a0 = temp_v1 | temp_a2->unkC; - phi_a0 = temp_a0; - phi_v1 = temp_v1; - if ((temp_a0 & 0x800) != 0) { + if (func_800B4520() == 0) { + var_a2 = (D_800DC5FC * 0x10) - 0x10 + gControllers; + var_v1 = var_a2->unk6; + var_a0 = var_v1 | var_a2->unkC; + if (var_a0 & 0x800) { temp_v0 = arg0->unk4; - if ((s32) *(&D_800F0B50 + gModeSelection) < temp_v0) { + if (*(&D_800F0B50 + gModeSelection) < temp_v0) { arg0->unk4 = temp_v0 - 1; - sp18 = temp_a2; - arg0 = arg0; - play_sound2(SOUND_MENU_CURSOR_MOVE); + sp18 = var_a2; + play_sound2(0x49008000); temp_f0 = (f64) arg0->unk24; if (temp_f0 < 4.2) { arg0->unk24 = (f32) (temp_f0 + 4.0); } arg0->unk8 = -1; - temp_v1_2 = temp_a2->unk6; - phi_a0 = temp_v1_2 | temp_a2->unkC; - phi_v1 = temp_v1_2; + var_v1 = var_a2->unk6; + var_a0 = var_v1 | var_a2->unkC; } } - phi_a1 = arg0; - if ((phi_a0 & 0x400) != 0) { + if (var_a0 & 0x400) { temp_v0_2 = arg0->unk4; - if (temp_v0_2 < (s32) *(&D_800F0B54 + gModeSelection)) { + if (temp_v0_2 < *(&D_800F0B54 + gModeSelection)) { arg0->unk4 = temp_v0_2 + 1; - sp18 = temp_t2 + &gControllers; - arg0 = arg0; - play_sound2(SOUND_MENU_CURSOR_MOVE); + sp18 = var_a2; + play_sound2(0x49008000); temp_f0_2 = (f64) arg0->unk24; - phi_a1 = arg0; if (temp_f0_2 < 4.2) { arg0->unk24 = (f32) (temp_f0_2 + 4.0); } arg0->unk8 = 1; - phi_v1 = (temp_t2 + &gControllers)->unk6; + var_v1 = var_a2->unk6; } } - if ((phi_v1 & 0x4000) != 0) { + if (var_v1 & 0x4000) { temp_v0_3 = *(&D_800F0B50 + gModeSelection); - if (phi_a1->unk4 != temp_v0_3) { - phi_a1->unk4 = (s32) temp_v0_3; - play_sound2(SOUND_MENU_GO_BACK); + if (arg0->unk4 != temp_v0_3) { + arg0->unk4 = (s32) temp_v0_3; + play_sound2(0x49008002); return; } } - if ((phi_v1 & 0x9000) != 0) { - if (phi_a1->unk4 == *(&D_800F0B50 + gModeSelection)) { - phi_a1->unk4 = 0; + if (var_v1 & 0x9000) { + if (arg0->unk4 == *(&D_800F0B50 + gModeSelection)) { + arg0->unk4 = 0; D_800DC5FC = 0; - func_8028DF38(0x1E, phi_a1, temp_t2 + &gControllers, &gModeSelection); - func_800C9F90(0); + func_8028DF38(0x0000001E, arg0, var_a2, &gModeSelection); + func_800C9F90(0U); return; } - arg0 = phi_a1; - func_8009DFE0(0x1E, phi_a1, temp_t2 + &gControllers, &gModeSelection); - play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); - func_800CA330(0x3C); + func_8009DFE0(0x0000001E); + play_sound2(0x4900801B); + func_800CA330(0x3CU); temp_f0_3 = (f64) arg0->unk24; if (temp_f0_3 < 4.2) { arg0->unk24 = (f32) (temp_f0_3 + 4.0); @@ -15730,7 +15304,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { break; } } else { - temp_a1->unk4 = 0; + arg0->unk4 = 0; default: } } @@ -15739,29 +15313,10 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ADF48.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_8009DFE0(?); /* extern */ -s32 func_800B6178(s32); /* extern */ +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-12-2022 s32 func_800B6348(s32); /* extern */ s32 func_800B63F0(s32); /* extern */ -void func_800B6708(); /* extern */ -void func_800CA330(?); /* extern */ -void func_800CA388(?); /* extern */ -s32 osPfsFindFile(? *, u16, s32, ? *, ? *, ? *); /* extern */ -void play_sound2(?, s32); /* extern */ -extern s8 D_8018CAE0; -extern OSPfs D_8018E868; -extern s32 D_8018EB78; -extern s32 D_8018EB7C; -extern s32 D_8018EB84; -extern struct_8018EE10_entry D_8018EE10; -extern void *gControllerOne; -static s16 D_800DC5B8; /* unable to generate initializer */ -static u16 D_800E86F0; /* unable to generate initializer; const */ -static s32 D_800E86F4 = 0x4E4B544A; /* const */ -static s8 D_800E86F8 = 0; /* const */ -static u8 D_800F2E64; /* unable to generate initializer; const */ -static u8 D_800F2E74; /* unable to generate initializer; const */ +u16 D_800DC5B8; /* unable to generate initializer */ void func_800AE218(struct_8018D9E0_entry *arg0) { s32 sp28; @@ -15776,39 +15331,26 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { f64 temp_f0_7; f64 temp_f0_8; f64 temp_f0_9; - s32 temp_a0_4; - s32 temp_a1; - s32 temp_a1_2; - s32 temp_a1_3; + s32 temp_a0_2; s32 temp_t5; - s32 temp_t6_2; + s32 temp_t6; s32 temp_t9; s32 temp_v0; + s32 temp_v0_2; s32 temp_v0_3; - s32 temp_v0_4; s32 temp_v1; s32 temp_v1_2; s32 temp_v1_3; s32 temp_v1_4; s32 temp_v1_5; + s32 var_a1; + s32 var_a1_2; + s32 var_a1_3; + s32 var_v1; + s32 var_v1_2; u16 temp_a0; - u16 temp_a0_2; - u16 temp_a0_3; - u16 temp_a0_5; - u16 temp_a0_6; - void *temp_t0; - void *temp_t2; - void *temp_t6; - void *temp_v0_2; - void *temp_v0_5; - void *temp_v0_6; - s32 phi_a1; - u16 phi_a0; - s32 phi_v1; - s32 phi_v1_2; - s32 phi_a1_2; - s32 phi_a1_3; - u16 phi_a0_2; + u16 var_a0; + u16 var_a0_2; if (arg0->unk4 != 0) { D_800DC5B8 = 0; @@ -15819,9 +15361,9 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { if (temp_v0 < 0x1E) { arg0->unk1C = temp_v0 + 1; } - if ((gControllerOne->unk6 & 0x1000) != 0) { - arg0->unk4 = 0xF; - play_sound2(SOUND_ACTION_GO_BACK_2); + if (gControllerOne->buttonPressed & 0x1000) { + arg0->unk4 = 0x0000000F; + play_sound2(0x49008005); return; } if (D_8018CAE0 != 0) { @@ -15835,7 +15377,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { temp_t5 = arg0->unk1C + 3; arg0->unk1C = temp_t5; if (temp_t5 >= 0x8D) { - arg0->unk4 = 0xF; + arg0->unk4 = 0x0000000F; return; } break; @@ -15846,55 +15388,53 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { case 15: /* switch 1 */ case 16: /* switch 1 */ if (func_800B4520() == 0) { - temp_v0_2 = gControllerOne; - temp_a0 = temp_v0_2->unk6; - temp_a1 = temp_a0 | temp_v0_2->unkC; - phi_a1 = temp_a1; - phi_a0 = temp_a0; - if ((temp_a1 & 0x800) != 0) { + var_a0 = gControllerOne->buttonPressed; + var_a1 = var_a0 | gControllerOne->stickPressed; + if (var_a1 & 0x800) { temp_v1 = arg0->unk4; if (temp_v1 >= 0xC) { arg0->unk4 = temp_v1 - 1; - play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1); + play_sound2(0x49008000); temp_f0 = (f64) arg0->unk24; if (temp_f0 < 4.2) { arg0->unk24 = (f32) (temp_f0 + 4.0); } arg0->unk8 = -1; - temp_t2 = gControllerOne; - temp_a0_2 = temp_t2->unk6; - phi_a1 = temp_a0_2 | temp_t2->unkC; - phi_a0 = temp_a0_2; + var_a0 = gControllerOne->buttonPressed; + var_a1 = var_a0 | gControllerOne->stickPressed; } } - if ((phi_a1 & 0x400) != 0) { + if (var_a1 & 0x400) { temp_v1_2 = arg0->unk4; if (temp_v1_2 < 0x10) { arg0->unk4 = temp_v1_2 + 1; - play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1); + play_sound2(0x49008000); temp_f0_2 = (f64) arg0->unk24; if (temp_f0_2 < 4.2) { arg0->unk24 = (f32) (temp_f0_2 + 4.0); } arg0->unk8 = 1; - phi_a0 = gControllerOne->unk6; + var_a0 = gControllerOne->buttonPressed; } } - if ((phi_a0 & 0x9000) != 0) { - if (arg0->unk4 == 0x10) { + if (var_a0 & 0x9000) { + if (arg0->unk4 == 0x00000010) { temp_f0_3 = (f64) arg0->unk24; - phi_v1 = 0; + var_v1 = 0; if (temp_f0_3 < 4.2) { arg0->unk24 = (f32) (temp_f0_3 + 4.0); } if (D_800E86F8 != 0) { sp28 = 0; - temp_v0_3 = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84); - switch (temp_v0_3) { /* switch 3; irregular */ + temp_v0_2 = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB84); + var_v1 = 0; + switch (temp_v0_2) { /* switch 3; irregular */ + case 5: /* switch 3 */ + break; case 0: /* switch 3 */ func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x1E; - phi_v1 = 1; + var_v1 = 1; break; case 2: /* switch 3 */ /* fallthrough */ @@ -15903,71 +15443,70 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { break; } } - case 5: /* switch 3 */ - if (phi_v1 != 0) { - play_sound2(SOUND_MENU_SELECT); + if (var_v1 != 0) { + play_sound2(0x49008001); return; } if (D_800E86F8 == 0) { - sp28 = phi_v1; - temp_v0_4 = func_800B5F30(); - phi_v1_2 = phi_v1; - switch (temp_v0_4) { /* switch 2 */ + sp28 = var_v1; + temp_v0_3 = func_800B5F30(); + var_v1_2 = var_v1; + switch (temp_v0_3) { /* switch 2 */ case -1: /* switch 2 */ - arg0->unk4 = 0x15; - phi_v1_2 = 1; + arg0->unk4 = 0x00000015; + var_v1_2 = 1; break; case -3: /* switch 2 */ case -2: /* switch 2 */ - arg0->unk4 = 0x16; - phi_v1_2 = 1; + arg0->unk4 = 0x00000016; + var_v1_2 = 1; break; case 1: /* switch 2 */ case 11: /* switch 2 */ - arg0->unk4 = 0x15; - phi_v1_2 = 1; + arg0->unk4 = 0x00000015; + var_v1_2 = 1; break; case 10: /* switch 2 */ - arg0->unk4 = 0x16; - phi_v1_2 = 1; + arg0->unk4 = 0x00000016; + var_v1_2 = 1; break; default: /* switch 2 */ - arg0->unk4 = 0x16; - phi_v1_2 = 1; + var_v1_2 = 1; + arg0->unk4 = 0x00000016; break; } - if (phi_v1_2 != 0) { - play_sound2(SOUND_MENU_FILE_NOT_FOUND); + if (var_v1_2 != 0) { + play_sound2(0x4900FF07); return; } - if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) == 0) { + if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB84) == 0) { func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x1E; - play_sound2(SOUND_MENU_SELECT); + play_sound2(0x49008001); return; } goto block_49; } block_49: if (D_8018EB7C >= D_8018EB78) { - arg0->unk4 = 0x18; - play_sound2(SOUND_MENU_FILE_NOT_FOUND); + arg0->unk4 = 0x00000018; + play_sound2(0x4900FF07); return; } if (gControllerPakNumPagesFree >= 0x79) { - arg0->unk4 = 0x20; + arg0->unk4 = 0x00000020; arg0->unk1C = 0; - play_sound2(SOUND_MENU_SELECT); + play_sound2(0x49008001); return; } - arg0->unk4 = 0x18; - play_sound2(SOUND_MENU_FILE_NOT_FOUND); + arg0->unk4 = 0x00000018; + play_sound2(0x4900FF07); return; } - func_8009DFE0(0x1E); - play_sound2(SOUND_MENU_OK_CLICKED); - func_800CA330(0x19); - func_800CA388(0x19); + func_8009DFE0(0x0000001E); + play_sound2(0x49008016); + func_800CA330(0x19U); + func_800CA388(0x19U); temp_f0_4 = (f64) arg0->unk24; if (temp_f0_4 < 4.2) { arg0->unk24 = (f32) (temp_f0_4 + 4.0); @@ -15983,9 +15522,9 @@ block_49: case 25: /* switch 1 */ case 26: /* switch 1 */ case 41: /* switch 1 */ - if ((gControllerOne->unk6 & 0xD000) != 0) { - arg0->unk4 = 0x10; - play_sound2(SOUND_MENU_GO_BACK); + if (gControllerOne->buttonPressed & 0xD000) { + arg0->unk4 = 0x00000010; + play_sound2(0x49008002); temp_f0_5 = (f64) arg0->unk24; if (temp_f0_5 < 4.2) { arg0->unk24 = (f32) (temp_f0_5 + 4.0); @@ -15997,28 +15536,25 @@ block_49: case 31: /* switch 1 */ arg0->unk20 = (u32) arg0->unk4 - 0x1E; if (func_800B639C((gCupSelection * 4) + gCupCourseSelection) != arg0->unk20) { - temp_v0_5 = gControllerOne; - temp_a1_2 = temp_v0_5->unk6 | temp_v0_5->unkC; - phi_a1_2 = temp_a1_2; - if ((temp_a1_2 & 0x800) != 0) { + var_a1_2 = gControllerOne->buttonPressed | gControllerOne->stickPressed; + if (var_a1_2 & 0x800) { temp_v1_3 = arg0->unk4; if (temp_v1_3 >= 0x1F) { arg0->unk4 = temp_v1_3 - 1; - play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_2); + play_sound2(0x49008000); temp_f0_6 = (f64) arg0->unk24; if (temp_f0_6 < 4.2) { arg0->unk24 = (f32) (temp_f0_6 + 4.0); } arg0->unk8 = -1; - temp_t0 = gControllerOne; - phi_a1_2 = temp_t0->unk6 | temp_t0->unkC; + var_a1_2 = gControllerOne->buttonPressed | gControllerOne->stickPressed; } } - if ((phi_a1_2 & 0x400) != 0) { + if (var_a1_2 & 0x400) { temp_v1_4 = arg0->unk4; if (temp_v1_4 < 0x1F) { arg0->unk4 = temp_v1_4 + 1; - play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1_2); + play_sound2(0x49008000); temp_f0_7 = (f64) arg0->unk24; if (temp_f0_7 < 4.2) { arg0->unk24 = (f32) (temp_f0_7 + 4.0); @@ -16027,23 +15563,23 @@ block_49: } } } - temp_a0_3 = gControllerOne->unk6; - if ((temp_a0_3 & 0x4000) != 0) { - arg0->unk4 = 0x10; - play_sound2(SOUND_MENU_GO_BACK); + temp_a0 = gControllerOne->buttonPressed; + if (temp_a0 & 0x4000) { + arg0->unk4 = 0x00000010; + play_sound2(0x49008002); return; } - if ((temp_a0_3 & 0x9000) != 0) { - temp_a0_4 = arg0->unk20; - if (((temp_a0_4 << 7) + &D_8018EE10)->unk4 == 0) { - arg0->unk4 = 0x28; + if (temp_a0 & 0x9000) { + temp_a0_2 = arg0->unk20; + if (D_8018EE10[temp_a0_2].ghostDataSaved == 0) { + arg0->unk4 = 0x00000028; arg0->unk1C = 0; - } else if (func_800B63F0(temp_a0_4) == 0) { - arg0->unk4 = 0x1A; + } else if (func_800B63F0(temp_a0_2) == 0) { + arg0->unk4 = 0x0000001A; } else { - arg0->unk4 = 0x23; + arg0->unk4 = 0x00000023; } - play_sound2(SOUND_MENU_SELECT); + play_sound2(0x49008001); temp_f0_8 = (f64) arg0->unk24; if (temp_f0_8 < 4.2) { arg0->unk24 = (f32) (temp_f0_8 + 4.0); @@ -16053,59 +15589,54 @@ block_49: break; case 32: /* switch 1 */ if ((arg0->unk1C == 1) && (func_800B6A68() != 0)) { - arg0->unk4 = 0x19; + arg0->unk4 = 0x00000019; return; } temp_t9 = arg0->unk1C + 1; arg0->unk1C = temp_t9; if (temp_t9 >= 2) { - arg0->unk4 = 0x1E; + arg0->unk4 = 0x0000001E; return; } break; case 35: /* switch 1 */ case 36: /* switch 1 */ - temp_v0_6 = gControllerOne; - temp_a0_5 = temp_v0_6->unk6; - temp_a1_3 = temp_a0_5 | temp_v0_6->unkC; - phi_a1_3 = temp_a1_3; - phi_a0_2 = temp_a0_5; - if (((temp_a1_3 & 0x800) != 0) && ((s32) (u32) arg0->unk4 >= 0x24)) { + var_a0_2 = gControllerOne->buttonPressed; + var_a1_3 = var_a0_2 | gControllerOne->stickPressed; + if ((var_a1_3 & 0x800) && ((s32) (u32) arg0->unk4 >= 0x24)) { arg0->unk4 = (u32) arg0->unk4 - 1; - play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_3); + play_sound2(0x49008000); temp_f0_9 = (f64) arg0->unk24; if (temp_f0_9 < 4.2) { arg0->unk24 = (f32) (temp_f0_9 + 4.0); } arg0->unk8 = -1; - temp_t6 = gControllerOne; - temp_a0_6 = temp_t6->unk6; - phi_a1_3 = temp_a0_6 | temp_t6->unkC; - phi_a0_2 = temp_a0_6; + var_a0_2 = gControllerOne->buttonPressed; + var_a1_3 = var_a0_2 | gControllerOne->stickPressed; } - if ((phi_a1_3 & 0x400) != 0) { + if (var_a1_3 & 0x400) { temp_v1_5 = arg0->unk4; if (temp_v1_5 < 0x24) { arg0->unk4 = temp_v1_5 + 1; - play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1_3); + play_sound2(0x49008000); temp_f0_10 = (f64) arg0->unk24; if (temp_f0_10 < 4.2) { arg0->unk24 = (f32) (temp_f0_10 + 4.0); } arg0->unk8 = 1; - phi_a0_2 = gControllerOne->unk6; + var_a0_2 = gControllerOne->buttonPressed; } } - if ((phi_a0_2 & 0x4000) != 0) { + if (var_a0_2 & 0x4000) { arg0->unk4 = arg0->unk20 + 0x1E; - play_sound2(SOUND_MENU_GO_BACK); + play_sound2(0x49008002); return; } - if ((phi_a0_2 & 0x9000) != 0) { - if (arg0->unk4 == 0x24) { - arg0->unk4 = 0x28; + if (var_a0_2 & 0x9000) { + if (arg0->unk4 == 0x00000024) { + arg0->unk4 = 0x00000028; arg0->unk1C = 0; - play_sound2(SOUND_MENU_SELECT); + play_sound2(0x49008001); temp_f0_11 = (f64) arg0->unk24; if (temp_f0_11 < 4.2) { arg0->unk24 = (f32) (temp_f0_11 + 4.0); @@ -16113,30 +15644,30 @@ block_49: } } else { arg0->unk4 = arg0->unk20 + 0x1E; - play_sound2(SOUND_MENU_GO_BACK); + play_sound2(0x49008002); return; } } break; case 40: /* switch 1 */ if (arg0->unk1C == 1) { - if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) != 0) { - arg0->unk4 = 0x29; - play_sound2(SOUND_MENU_FILE_NOT_FOUND); + if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB84) != 0) { + arg0->unk4 = 0x00000029; + play_sound2(0x4900FF07); return; } if (func_800B6178(arg0->unk20) != 0) { - arg0->unk4 = 0x29; - play_sound2(SOUND_MENU_FILE_NOT_FOUND); + arg0->unk4 = 0x00000029; + play_sound2(0x4900FF07); return; } goto block_107; } block_107: - temp_t6_2 = arg0->unk1C + 1; - arg0->unk1C = temp_t6_2; - if (temp_t6_2 >= 2) { - arg0->unk4 = 0x10; + temp_t6 = arg0->unk1C + 1; + arg0->unk1C = temp_t6; + if (temp_t6 >= 2) { + arg0->unk4 = 0x00000010; } break; } @@ -16287,121 +15818,87 @@ void func_800AEF74(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AEF74.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_8009DFE0(?); /* extern */ -void func_800CA330(?); /* extern */ -void func_800CA388(?); /* extern */ -void play_sound2(?); /* extern */ -extern void *gControllerFive; - +#ifdef NEEDS_RODATA +// data/data_0DD0A0_3_0.s +// jpt_800F2A9C +extern struct Controller *gControllerFive; void func_800AF004(struct_8018D9E0_entry *arg0) { s32 temp_t1; - s32 temp_t6; - s32 temp_t6_2; - s32 temp_t8; - s32 temp_t9; - void *temp_v0; - temp_t6 = arg0->unk4; - switch (temp_t6) { + switch (arg0->unk4) { case 0: - temp_t8 = arg0->unk1C + 3; - arg0->unk1C = temp_t8; - if (temp_t8 >= 0x65) { + arg0->unk1C += 3; + if (arg0->unk1C >= 0x65) { arg0->unk1C = 0; arg0->unk4 = 1; - gCupSelection = (s8) ((s32) gCupSelection % 4); - gCCSelection = (s32) gCCSelection % 4; - add_8018D9E0_entry(0x12C, 0, 0, 4); - return; + gCupSelection %= 4; + gCCSelection %= 4; + add_8018D9E0_entry(0x0000012C, 0, 0, 4); } - default: - return; + break; case 1: case 2: case 3: case 4: - temp_t6_2 = arg0->unk1C + 1; - arg0->unk1C = temp_t6_2; - if (temp_t6_2 >= 9) { + arg0->unk1C += 1; + if (arg0->unk1C >= 9) { arg0->unk1C = 0; - temp_t9 = arg0->unk4 + 1; - arg0->unk4 = temp_t9; - add_8018D9E0_entry(temp_t9 + 0x12B, 0, 0, 4); - return; + arg0->unk4++; + add_8018D9E0_entry(arg0->unk4 + 0x12B, 0, 0, 4); } break; case 5: - temp_t1 = arg0->unk1C + 1; - arg0->unk1C = temp_t1; - if ((temp_t1 >= 0x65) && ((temp_v0 = gControllerFive, (temp_v0->unk6 != 0)) || (temp_v0->unkC != 0))) { + arg0->unk1C += 1; + if ((arg0->unk1C >= 0x65) && ((gControllerFive->buttonPressed != 0) || (gControllerFive->stickPressed != 0))) { arg0->unk4 = 6; arg0->unk1C = 0; - if ((s32) D_802874F5 < 3) { + if (D_802874F5 < 3) { play_sound2(SOUND_MENU_OK_CLICKED); - return; + } else { + play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); } - play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); - return; } break; case 6: - func_8009DFE0(0x1E); - func_800CA330(0x19); - func_800CA388(0x19); + func_8009DFE0(0x0000001E); + func_800CA330(0x19U); + func_800CA388(0x19U); arg0->unk4 = 7; break; + case 7: + default: + break; } } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AF004.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -struct _struct_D_800E7458_0x8 { - /* 0x0 */ s16 unk0; /* inferred */ - /* 0x2 */ s16 unk2; /* inferred */ - /* 0x4 */ char pad4[4]; /* maybe part of unk2[3]? */ -}; /* size = 0x8 */ - -struct _struct_D_800E7480_0x8 { - /* 0x0 */ s16 unk0; /* inferred */ - /* 0x2 */ s16 unk2; /* inferred */ - /* 0x4 */ char pad4[4]; /* maybe part of unk2[3]? */ -}; /* size = 0x8 */ - -void func_800A91D8(s16, s16); /* extern */ -static struct _struct_D_800E7458_0x8 D_800E7458[0]; /* unable to generate initializer; const */ -static struct _struct_D_800E7480_0x8 D_800E7480[0]; /* unable to generate initializer; const */ +#ifdef NEEDS_RODATA +// data/data_0DD0A0_2_0.s +extern Unk_D_800E70A0 D_800E7458[0]; /* unable to generate initializer */ +extern Unk_D_800E70A0 D_800E7480[0]; /* unable to generate initializer */ void func_800AF1AC(struct_8018D9E0_entry *arg0) { - struct _struct_D_800E7480_0x8 *sp18; - s32 temp_v0; - s32 temp_v1; - struct _struct_D_800E7458_0x8 *temp_v0_2; - struct _struct_D_800E7480_0x8 *temp_v0_3; + Unk_D_800E70A0 *temp_v0_2; + s32 idx = arg0->type - 0x12C; - temp_v0 = arg0->unk4; - temp_v1 = arg0->type - 0x12C; - switch (temp_v0) { /* irregular */ + switch (arg0->unk4) { /* irregular */ case 0: - temp_v0_2 = &D_800E7458[temp_v1]; - arg0->column = (s32) temp_v0_2->unk0; + temp_v0_2 = &D_800E7458[idx]; + arg0->column = temp_v0_2->column; + arg0->row = temp_v0_2->row; arg0->unk4 = 1; - arg0->row = (s32) temp_v0_2->unk2; - return; + break; case 1: - temp_v0_3 = &D_800E7480[temp_v1]; - sp18 = temp_v0_3; - func_800A91D8(temp_v0_3->unk0, temp_v0_3->unk2); - if ((temp_v0_3->unk0 == arg0->column) && (temp_v0_3->unk2 == arg0->row)) { + temp_v0_2 = &D_800E7480[idx]; + func_800A91D8(arg0, temp_v0_2->column, temp_v0_2->row); + if ((arg0->column == temp_v0_2->column) && (arg0->row == temp_v0_2->row)) { arg0->unk4 = 2; } - /* fallthrough */ + break; case 2: - return; + break; } } #else diff --git a/src/code_80091750.h b/src/code_80091750.h index 1c401646c..52107825b 100644 --- a/src/code_80091750.h +++ b/src/code_80091750.h @@ -49,6 +49,13 @@ typedef struct { /* 0x04 */ Gfx *displayList; } struct_8018E768_entry; // size = 0x08 +typedef struct { + /* 0x00 */ s16 column; + /* 0x02 */ s16 row; + /* 0x04 */ s16 pad0; + /* 0x06 */ s16 pad1; +} Unk_D_800E70A0; // size = 0x08 + /* Function Prototypes */ f64 exponent_by_squaring(f64, s32); @@ -115,9 +122,9 @@ void *segmented_to_virtual_dupe_2(const void*); Gfx *func_8009C204(Gfx*, MkTexture*, s32, s32, s32); void func_8009CA2C(); void func_8009CA6C(s32); +void func_8009969C(MkTexture*); void func_80099A94(MkTexture *, s32); void func_80099AEC(); -void func_8009E1E4(); void func_80099E54(); void func_80099E60(MkTexture *, s32, s32); void func_80099EC4(); @@ -141,18 +148,31 @@ Gfx *func_8009C434(Gfx*, struct_8018DEE0_entry*, s32, s32, s32); Gfx *func_8009C708(Gfx*, struct_8018DEE0_entry *, s32, s32, s32, s32); void func_8009C918(); void func_8009CA2C(); +void func_8009CDDC(s32, s32); +void func_8009CDFC(s32, s32); +void func_8009CE1C(); +void func_8009D958(s32, s32); +void func_8009D978(s32, s32); +void func_8009DF4C(s32); +void func_8009DF6C(s32); +void func_8009DFE0(s32); +void func_8009E000(s32); void func_8009E0F0(s32); void func_8009E1C0(); void func_8009E1E4(); void func_8009E208(); +void func_8009E230(); void func_8009E258(); void func_8009E280(); void func_8009E5BC(); +void func_8009E5FC(s32); void func_8009E620(); void add_8018D9E0_entry(s32, s32, s32, s8); void func_800A08D8(u8, s32, s32); void func_800A0AD0(struct_8018D9E0_entry*); +void func_800A0DFC(); void func_800A11D0(struct_8018D9E0_entry*, s32, s32); +void func_800A1500(struct_8018D9E0_entry*); void func_800A15EC(struct_8018D9E0_entry*); void func_800A1924(struct_8018D9E0_entry*); void func_800A1A20(struct_8018D9E0_entry*); @@ -183,8 +203,10 @@ void get_time_record_centiseconds(s32, char*); void func_800A8230(); void func_800A8250(); void func_800A86E8(struct_8018D9E0_entry*); +void func_800A8A98(struct_8018D9E0_entry*); void func_800A8E14(struct_8018D9E0_entry*); void func_800A8EC0(struct_8018D9E0_entry*); +void func_800A90D4(s32, struct_8018D9E0_entry*); void func_800A91D8(struct_8018D9E0_entry*, s32, s32); void func_800A9208(struct_8018D9E0_entry*, s32); void func_800A9278(struct_8018D9E0_entry*, s32); @@ -194,6 +216,10 @@ void func_800A940C(struct_8018D9E0_entry*, s32); void func_800A94C8(struct_8018D9E0_entry*, s32, s32); void func_800A954C(struct_8018D9E0_entry*); void func_800A9710(struct_8018D9E0_entry*); +void func_800A9B9C(struct_8018D9E0_entry*); +void func_800A9C40(struct_8018D9E0_entry*); +void func_800A9D5C(struct_8018D9E0_entry*); +void func_800AA280(struct_8018D9E0_entry*); void func_800AAB90(struct_8018D9E0_entry*); void func_800AADD4(struct_8018D9E0_entry*); void func_800AAE18(struct_8018D9E0_entry*); @@ -206,12 +232,19 @@ void func_800AAF94(struct_8018D9E0_entry*, s32); s32 func_800AAFCC(s32); void func_800AB020(struct_8018D9E0_entry*); void func_800AB098(struct_8018D9E0_entry*); +void func_800AB164(struct_8018D9E0_entry*); void func_800AB260(struct_8018D9E0_entry*); void func_800AB290(struct_8018D9E0_entry*); +void func_800AB904(struct_8018D9E0_entry*); +void func_800ABAE8(struct_8018D9E0_entry*); +void func_800ABB24(struct_8018D9E0_entry*); +void func_800ABBCC(struct_8018D9E0_entry*); +void func_800ABC38(struct_8018D9E0_entry*); void func_800ABCF4(struct_8018D9E0_entry*); void func_800ABEAC(struct_8018D9E0_entry*); void func_800ABF68(struct_8018D9E0_entry*); void func_800AC128(struct_8018D9E0_entry*); +void func_800AC300(struct_8018D9E0_entry*); void func_800AC324(struct_8018D9E0_entry*); void func_800AC978(struct_8018D9E0_entry*); void func_800AD1A4(struct_8018D9E0_entry*); @@ -220,6 +253,8 @@ void func_800AEDBC(struct_8018D9E0_entry*); void func_800AEE90(struct_8018D9E0_entry*); void func_800AEEBC(struct_8018D9E0_entry*); void func_800AEEE8(struct_8018D9E0_entry*); +void func_800AF004(struct_8018D9E0_entry*); +void func_800AF1AC(struct_8018D9E0_entry*); void func_800AF480(struct_8018D9E0_entry*); void func_800AF4DC(struct_8018D9E0_entry*); void func_800AF740(struct_8018D9E0_entry*); @@ -295,6 +330,8 @@ extern s32 gNumD_8018E768Entries; // D_8018E760 extern struct_8018E768_entry D_8018E768[D_8018E768_SIZE]; // D_8018E768 extern s8 gTextColor; // D_8018E860 extern s8 D_8018ED91; +extern s8 D_8018E838[]; +extern s32 D_8018E840[]; extern s32 D_8018E850; extern s32 D_8018E854; extern s32 D_8018E858; diff --git a/src/code_800B45E0.c b/src/code_800B45E0.c index 3e8a7cdde..2cf8387e3 100644 --- a/src/code_800B45E0.c +++ b/src/code_800B45E0.c @@ -721,178 +721,150 @@ s32 check_for_controller_pak(s32 controller) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 check_for_controller_pak(s32); // extern -s32 osPfsInit(? *, OSPfs *, ?); // extern -extern u16 D_800E86F0; -extern u32 D_800E86F4; -extern s8 D_800E86F8; -extern u8 D_800F2E64; -extern u8 D_800F2E74; -extern OSPfs D_8018E868; -extern s32 D_8018EB78; -extern s32 D_8018EB7C; -extern s32 gControllerPakNumPagesFree; -extern s32 D_8018EB84; -extern OSMesgQueue gSIEventMesgQueue; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +s32 check_for_controller_pak(?); /* extern */ s32 func_800B5B94(void) { + s32 temp_v0; s32 temp_v0_2; - s32 temp_v0_3; - s8 temp_v0; - s8 phi_v0; - ? phi_v0_2; + s32 var_v0; + s8 var_v0_2; - temp_v0 = D_800E86F8; - phi_v0 = temp_v0; - if (temp_v0 != 0) { - temp_v0_2 = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84); - if (temp_v0_2 != 0) { - if (temp_v0_2 != 2) { - if (temp_v0_2 != 5) { - D_800E86F8 = 0; - goto block_8; - } - phi_v0 = D_800E86F8; - } else { - D_800E86F8 = 0; + var_v0_2 = D_800E86F8; + if (var_v0_2 != 0) { + temp_v0 = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB84); + switch (temp_v0) { /* irregular */ + default: + D_800E86F8 = 0; block_8: - phi_v0 = 0; - } + var_v0_2 = 0; goto block_9; + case 0: + return 0; + case 5: + var_v0_2 = D_800E86F8; + goto block_9; + case 2: + D_800E86F8 = 0; + goto block_8; } - return 0; - } + } else { block_9: - if (phi_v0 == 0) { - if (check_for_controller_pak(0) == 0) { - return 1; - } - temp_v0_3 = osPfsInit(&gSIEventMesgQueue, &D_8018E868, 0); - if (temp_v0_3 != 0) { - if (temp_v0_3 != 1) { - if (temp_v0_3 != 4) { - if (temp_v0_3 != 0xA) { - if (temp_v0_3 == 0xB) { - goto block_17; + if (var_v0_2 == 0) { + if (check_for_controller_pak(0) == 0) { + return 1; + } + temp_v0_2 = osPfsInit(&gSIEventMesgQueue, &D_8018E868, 0); + if (temp_v0_2 != 0) { + if (temp_v0_2 != 1) { + if (temp_v0_2 != 4) { + if (temp_v0_2 != 0x0000000A) { + if (temp_v0_2 == 0x0000000B) { + goto block_17; + } + goto block_19; } - goto block_19; + return 2; } +block_19: return 2; } -block_19: +block_17: + return 1; + } + D_800E86F8 = 1; + if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB84) == 0) { + return 0; + } + if (osPfsNumFiles(&D_8018E868, &D_8018EB78, &D_8018EB7C) != 0) { return 2; } -block_17: - return 1; + if (osPfsFreeBlocks(&D_8018E868, &gControllerPakNumPagesFree) != 0) { + return 2; + } + gControllerPakNumPagesFree = (s32) gControllerPakNumPagesFree >> 8; + goto block_27; } - D_800E86F8 = 1; - if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) == 0) { - return 0; - } - if (osPfsNumFiles(&D_8018E868, &D_8018EB78, &D_8018EB7C) != 0) { - return 2; - } - if (osPfsFreeBlocks(&D_8018E868, &gControllerPakNumPagesFree) != 0) { - return 2; - } - gControllerPakNumPagesFree = gControllerPakNumPagesFree >> 8; - goto block_27; - } block_27: - if (D_8018EB7C >= D_8018EB78) { - return 4; + if (D_8018EB7C >= D_8018EB78) { + return 4; + } + var_v0 = 4; + if (gControllerPakNumPagesFree >= 0x79) { + var_v0 = -1; + } + return var_v0; } - phi_v0_2 = 4; - if (gControllerPakNumPagesFree >= 0x79) { - phi_v0_2 = -1; - } - return phi_v0_2; } #else GLOBAL_ASM("asm/non_matchings/menus/func_800B5B94.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 check_for_controller_pak(?); // extern -s32 osPfsInit(? *, OSPfs *, ?); // extern -extern u16 D_800E86F0; -extern u32 D_800E86F4; -extern s8 D_800E86FC; -extern u8 D_800F2E64; -extern u8 D_800F2E74; -extern OSPfs D_8018E8D0; -extern s32 D_8018EB88; -extern OSMesgQueue gSIEventMesgQueue; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 +s32 check_for_controller_pak(?); /* extern */ -s8 func_800B5DA4(void) { +s32 func_800B5DA4(void) { + s32 temp_v0; s32 temp_v0_2; s32 temp_v0_3; - s32 temp_v0_4; - s8 temp_v0; - s8 phi_v0; - s8 phi_v0_2; + s8 var_v0; - temp_v0 = D_800E86FC; - phi_v0 = temp_v0; - if (temp_v0 != 0) { - temp_v0_2 = osPfsFindFile(&D_8018E8D0, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB88); - if (temp_v0_2 != 0) { - if (temp_v0_2 != 2) { - if (temp_v0_2 != 5) { - goto block_7; - } - return -1; - } -block_7: + var_v0 = D_800E86FC; + if (var_v0 != 0) { + temp_v0 = osPfsFindFile(&D_8018E8D0, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB88); + switch (temp_v0) { /* switch 1; irregular */ + case 0: /* switch 1 */ + return 0; + case 5: /* switch 1 */ + return -1; + default: /* switch 1 */ + case 2: /* switch 1 */ D_800E86FC = 0; - phi_v0 = 0; + var_v0 = 0; goto block_8; } - return 0; - } + } else { block_8: - phi_v0_2 = phi_v0; - if (phi_v0 == 0) { - if (check_for_controller_pak(1) == 0) { - return 1; - } - temp_v0_3 = osPfsInit(&gSIEventMesgQueue, &D_8018E8D0, 1); - if (temp_v0_3 != 0) { - if (temp_v0_3 != 1) { - if (temp_v0_3 != 4) { - if (temp_v0_3 != 0xA) { - if (temp_v0_3 == 0xB) { - goto block_16; + if (var_v0 == 0) { + if (check_for_controller_pak(1) == 0) { + return 1; + } + temp_v0_2 = osPfsInit(&gSIEventMesgQueue, &D_8018E8D0, 1); + if (temp_v0_2 != 0) { + if (temp_v0_2 != 1) { + if (temp_v0_2 != 4) { + if (temp_v0_2 != 0x0000000A) { + if (temp_v0_2 == 0x0000000B) { + goto block_16; + } + goto block_18; } - goto block_18; + goto block_25; } - goto block_25; - } block_18: - goto block_25; - } -block_16: - return 1; - } - D_800E86FC = 1; - temp_v0_4 = osPfsFindFile(&D_8018E8D0, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB88); - if (temp_v0_4 != 0) { - if (temp_v0_4 != 2) { - if (temp_v0_4 != 5) { goto block_25; } - return -1; +block_16: + return 1; } + D_800E86FC = 1; + temp_v0_3 = osPfsFindFile(&D_8018E8D0, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB88); + switch (temp_v0_3) { /* irregular */ + case 0: + return 0; + case 5: + return -1; + case 2: block_25: - phi_v0_2 = 2; - // Duplicate return node #26. Try simplifying control flow for better match - return phi_v0_2; + var_v0 = 2; + /* Duplicate return node #26. Try simplifying control flow for better match */ + return (s32) var_v0; + } + } else { + return (s32) var_v0; } - return 0; } - return phi_v0_2; } #else GLOBAL_ASM("asm/non_matchings/menus/func_800B5DA4.s") @@ -977,100 +949,90 @@ GLOBAL_ASM("asm/non_matchings/menus/func_800B60E8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_800051C4(); // extern -s32 func_800B6088(s32); // extern -s8 func_800B60E8(s32); // extern -extern u8 *D_800DC714; -extern s32 D_80162DFC; -extern OSPfs D_8018E868; -extern s32 D_8018EB84; -extern struct_8018EE10_entry D_8018EE10; -extern s8 gCupSelection; - +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 s32 func_800B6178(s32 arg0) { - s32 temp_s0_2; s32 temp_v0; - s32 temp_v0_2; - s32 temp_v0_3; - s32 temp_v1; - s8 temp_s0; - s8 temp_s0_3; - void *temp_s1; - void *temp_s3; - s8 phi_s0; - void *phi_s1; - s32 phi_s0_2; - void *phi_s1_2; - s32 phi_v0; - s8 phi_s0_3; - void *phi_s1_3; - s32 phi_v1; + s32 var_s0_2; + s32 var_v0; + s32 var_v1; + s8 temp_t0; + s8 temp_t1; + s8 temp_t3; + s8 temp_t4; + s8 temp_t5; + s8 temp_t9; + s8 var_s0; + s8 var_s0_3; + struct_8018EE10_entry *temp_s3; + struct_8018EE10_entry *var_s1; + struct_8018EE10_entry *var_s1_2; + struct_8018EE10_entry *var_s1_3; + u8 temp_v0_2; if ((arg0 != 0) && (arg0 != 1)) { return -1; } - if (gGamestate == RACING) { + if (gGamestate == 4) { func_800051C4(); } - temp_s3 = (arg0 << 7) + &D_8018EE10; - temp_s3->unk4 = 0; + temp_s3 = &D_8018EE10[arg0]; + temp_s3->ghostDataSaved = 0; temp_v0 = func_800B6088(arg0); - temp_v1 = temp_v0; - phi_v1 = temp_v1; + var_v1 = temp_v0; if (temp_v0 != 0) { - temp_s3->unk4 = 0; - phi_s0 = 0; - phi_s1 = temp_s3; + temp_s3->ghostDataSaved = 0; + var_s0 = 0; + var_s1 = temp_s3; do { - phi_s1->unk7 = phi_s0; - temp_s0 = phi_s0 + 4; - phi_s1->unkA = phi_s0 + 3; - phi_s1->unk9 = phi_s0 + 2; - phi_s1->unk8 = phi_s0 + 1; - phi_s0 = temp_s0; - phi_s1 += 4; - } while (temp_s0 != 0x3C); + temp_t9 = var_s0 + 1; + temp_t0 = var_s0 + 2; + temp_t1 = var_s0 + 3; + var_s1->unk_07[0] = var_s0; + var_s0 += 4; + var_s1->unk_07[3] = temp_t1; + var_s1->unk_07[2] = temp_t0; + var_s1->unk_07[1] = temp_t9; + var_s1 += 4; + } while (var_s0 != 0x3C); } else { - temp_v0_2 = osPfsReadWriteFile(&D_8018E868, D_8018EB84, 1, (arg0 * 0x3C00) + 0x100, 0x3C00, D_800DC714); - phi_v0 = temp_v0_2; - phi_v1 = temp_v0_2; - if (temp_v0_2 == 0) { - temp_s3->unk4 = 1; - if (gGamestate == RACING) { - temp_s3->unk5 = (gCupSelection * 4) + gCupCourseSelection; + var_v0 = osPfsReadWriteFile(&D_8018E868, D_8018EB84, 1U, (arg0 * 0x3C00) + 0x100, 0x00003C00, (u8 *) D_800DC714); + var_v1 = var_v0; + if (var_v0 == 0) { + temp_s3->ghostDataSaved = 1; + if (gGamestate == 4) { + temp_s3->courseIndex = (gCupSelection * 4) + gCupCourseSelection; } - temp_s3->unk0 = D_80162DFC; - temp_s3->unk6 = D_80162DE0; - phi_s0_2 = 0; - phi_s1_2 = temp_s3; + var_s0_2 = 0; + temp_s3->unk_00 = D_80162DFC; + var_s1_2 = temp_s3; + temp_s3->characterId = (u8) D_80162DE0; do { - temp_s0_2 = phi_s0_2 + 1; - temp_s1 = phi_s1_2 + 1; - temp_s1->unk6 = func_800B60E8(phi_s0_2); - phi_s0_2 = temp_s0_2; - phi_s1_2 = temp_s1; - } while (temp_s0_2 != 0x3C); - temp_v0_3 = func_800B6088(arg0); - phi_v0 = temp_v0_3; - phi_v1 = temp_v0_3; + temp_v0_2 = func_800B60E8(var_s0_2); + var_s0_2 += 1; + var_s1_2 += 1; + var_s1_2->characterId = temp_v0_2; + } while (var_s0_2 != 0x0000003C); + var_v0 = func_800B6088(arg0); + var_v1 = var_v0; } - if (phi_v0 != 0) { - temp_s3->unk4 = 0; - phi_s0_3 = 0; - phi_s1_3 = temp_s3; + if (var_v0 != 0) { + temp_s3->ghostDataSaved = 0; + var_s0_3 = 0; + var_s1_3 = temp_s3; do { - phi_s1_3->unk7 = phi_s0_3; - temp_s0_3 = phi_s0_3 + 4; - phi_s1_3->unkA = phi_s0_3 + 3; - phi_s1_3->unk9 = phi_s0_3 + 2; - phi_s1_3->unk8 = phi_s0_3 + 1; - phi_s0_3 = temp_s0_3; - phi_s1_3 += 4; - } while (temp_s0_3 != 0x3C); + temp_t3 = var_s0_3 + 1; + temp_t4 = var_s0_3 + 2; + temp_t5 = var_s0_3 + 3; + var_s1_3->unk_07[0] = var_s0_3; + var_s0_3 += 4; + var_s1_3->unk_07[3] = temp_t5; + var_s1_3->unk_07[2] = temp_t4; + var_s1_3->unk_07[1] = temp_t3; + var_s1_3 += 4; + } while (var_s0_3 != 0x3C); } } - return phi_v1; + return var_v1; } #else GLOBAL_ASM("asm/non_matchings/menus/func_800B6178.s") @@ -1169,44 +1131,36 @@ s32 func_800B64EC(s32 arg0) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_800B60E8(s32); // extern -extern u8 *D_800DC714; -extern s32 D_80162DFC; -extern s32 D_8018D9C0; -extern OSPfs D_8018E8D0; -extern s32 D_8018EB88; -extern ? D_8018EE15; - +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022 s32 func_800B65F4(s32 arg0, s32 arg1) { s32 sp34; - s32 temp_s0; s32 temp_v0; - void *temp_s3; - s32 phi_s0; - void *phi_s1; + s32 var_s0; + struct_8018EE10_entry *temp_s3; + struct_8018EE10_entry *var_s1; + u8 temp_v0_2; if ((arg0 != 0) && (arg0 != 1)) { return -1; } - temp_v0 = osPfsReadWriteFile(&D_8018E8D0, D_8018EB88, 0, (arg0 * 0x3C00) + 0x100, 0x3C00, D_800DC714); + temp_v0 = osPfsReadWriteFile(&D_8018E8D0, D_8018EB88, 0U, (arg0 * 0x3C00) + 0x100, 0x00003C00, (u8 *) D_800DC714); sp34 = temp_v0; if (temp_v0 == 0) { - temp_s3 = D_8018D9C0 + (arg0 << 7); - phi_s0 = 0; - phi_s1 = temp_s3; + temp_s3 = &D_8018D9C0[arg0]; + var_s1 = temp_s3; + var_s0 = 0; loop_5: - temp_s0 = phi_s0 + 1; - phi_s0 = temp_s0; - if (phi_s1->unk7 != func_800B60E8(phi_s0)) { - temp_s3->unk4 = 0; + temp_v0_2 = func_800B60E8(var_s0); + var_s0 += 1; + if ((u8) var_s1->unk_07[0] != temp_v0_2) { + temp_s3->ghostDataSaved = 0; return -2; } - phi_s1 += 1; - if (temp_s0 == 0x3C) { - D_80162DE0 = temp_s3->unk6; - D_80162DFC = temp_s3->unk0; - *(&D_8018EE15 + (arg1 << 7)) = temp_s3->unk5; + var_s1 += 1; + if (var_s0 == 0x0000003C) { + D_80162DE0 = (s32) temp_s3->characterId; + D_80162DFC = temp_s3->unk_00; + *(&D_8018EE10->courseIndex + (arg1 << 7)) = temp_s3->courseIndex; goto block_9; } goto loop_5; diff --git a/src/code_80280650.c b/src/code_80280650.c index 44f59dc70..083cf5a89 100644 --- a/src/code_80280650.c +++ b/src/code_80280650.c @@ -211,67 +211,58 @@ GLOBAL_ASM("asm/non_matchings/code_80280650/func_80280B50.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80280B50(f32 *, f32, s32, s16); // extern -extern s32 D_80284E50; +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-10-2022 +static s32 D_80284E50[4] = { 0x007F2040, 0x0040207F, 0x00207F20, 0x007F7F20 }; void func_80280D1C(void *arg0) { f32 sp60; f32 sp5C; f32 sp58; - f32 *temp_s4; f32 temp_f0; - s32 temp_s0; s32 temp_v0; - s32 temp_v1; - s32 temp_v1_2; - s32 phi_s1; - s32 phi_s0; - s32 phi_v1; + s32 var_s0; + s32 var_s1; + s32 var_v1; - phi_s1 = 0; - phi_s0 = 0; + var_s0 = 0; + var_s1 = 0; if (arg0->unk44 < 0x1E) { - temp_s4 = &sp58; do { sp58 = arg0->unk10; - sp5C = arg0->unk14 - phi_s1; + sp5C = arg0->unk14 - (f32) var_s1; sp60 = arg0->unk18; - func_80280B50(temp_s4, ((0xA - phi_s0) / 10.0f) * 2.0f, *(&D_80284E50 + (arg0->unk48 * 4)), ((0x1E - arg0->unk44) * 0x64) / 30.0f); - temp_s0 = phi_s0 + 1; - phi_s1 += 2; - phi_s0 = temp_s0; - } while (temp_s0 != 0xA); + func_80280B50(&sp58, ((f32) (0xA - var_s0) / 10.0f) * 2.0f, D_80284E50[arg0->unk48], (s16) (s32) ((f32) ((0x1E - arg0->unk44) * 0x64) / 30.0f)); + var_s0 += 1; + var_s1 += 2; + } while (var_s0 != 0xA); } else { temp_v0 = arg0->unk2C; if (temp_v0 < 5) { - temp_v1 = arg0->unk3C + (arg0->unk40 * 2); - arg0->unk3C = temp_v1; - arg0->unk34 = arg0->unk34 + (arg0->unk38 * 2.0f); - phi_v1 = temp_v1; + var_v1 = arg0->unk3C + (arg0->unk40 * 2); + arg0->unk3C = var_v1; + arg0->unk34 = (f32) (arg0->unk34 + (arg0->unk38 * 2.0f)); } else { - temp_f0 = 1.0f + (((temp_v0 * 7) - 0x23) / 10.0f); - temp_v1_2 = arg0->unk3C + (arg0->unk40 / temp_f0); - arg0->unk3C = temp_v1_2; - arg0->unk34 = arg0->unk34 + (arg0->unk38 / temp_f0); - phi_v1 = temp_v1_2; - if (temp_v1_2 < 0) { + temp_f0 = 1.0f + ((f32) ((temp_v0 * 7) - 0x23) / 10.0f); + var_v1 = (s32) ((f32) arg0->unk3C + ((f32) arg0->unk40 / temp_f0)); + arg0->unk3C = var_v1; + arg0->unk34 = (f32) (arg0->unk34 + (arg0->unk38 / temp_f0)); + if (var_v1 < 0) { arg0->unk3C = 0; - phi_v1 = 0; + var_v1 = 0; } } - arg0->unk2C = arg0->unk2C + 1; - if ((phi_v1 <= 0) || !(arg0->unk34 > 0.0f)) { + arg0->unk2C = (s32) (arg0->unk2C + 1); + if ((var_v1 <= 0) || !(arg0->unk34 > 0.0f)) { if (arg0->unk2C < 0x1E) { goto block_12; } arg0->unk0 = 0; } else { block_12: - func_80280B50(arg0 + 0x10, arg0->unk34, arg0->unk30, phi_v1); + func_80280B50(arg0 + 0x10, arg0->unk34, arg0->unk30, (s16) var_v1); } } - arg0->unk44 = arg0->unk44 + 1; + arg0->unk44 = (s32) (arg0->unk44 + 1); } #else GLOBAL_ASM("asm/non_matchings/code_80280650/func_80280D1C.s") diff --git a/src/memory.c b/src/memory.c index f735db9c2..397a3fc37 100644 --- a/src/memory.c +++ b/src/memory.c @@ -1307,28 +1307,23 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802AA7C8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void dma_copy(u8 *, s32, s32, s32); // extern -extern u8 *gPrevLoadedAddress; - -s32 func_802AA88C(s32 arg0, s32 arg1) { +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-09-2022 +void *func_802AA88C(u8 *arg0, u8 *arg1) { s32 sp28; u8 *sp20; - u8 *sp1C; - s32 temp_t6; + u32 sp1C; + u32 temp_t6; u8 *temp_a0; - u8 *temp_a1; temp_t6 = ((arg1 - arg0) + 0xF) & ~0xF; temp_a0 = gHeapEndPtr - temp_t6; sp20 = temp_a0; - dma_copy(temp_a0, arg0, temp_t6, arg1); - temp_a1 = gPrevLoadedAddress; - sp1C = temp_a1; + dma_copy(temp_a0, arg0, temp_t6); + sp1C = gPrevLoadedAddress; sp28 = (temp_a0->unk4 + 0xF) & ~0xF; - mio0decode(temp_a0, temp_a1); - gPrevLoadedAddress = &gPrevLoadedAddress[sp28]; - return sp1C; + mio0decode(temp_a0, (u8 *) gPrevLoadedAddress); + gPrevLoadedAddress += sp28; + return (void *) sp1C; } #else GLOBAL_ASM("asm/non_matchings/memory/func_802AA88C.s") @@ -3153,15 +3148,10 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802ADDC8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-09-2022 s32 func_802ABB04(f32, f32, s32); /* extern */ -f32 func_802ABE30(f32, f32, f32, s32); /* extern */ -extern u8 D_8014F110; +extern ? D_8014F110; extern s32 D_8015F584; -extern s16 D_8015F6E8; -extern s16 D_8015F6EA; -extern s16 D_8015F6F0; -extern s16 D_8015F6F2; static f32 D_802B9E4C = -3000.0f; static f32 D_802B9E50 = 3000.0f; static f32 D_802B9E54 = 3000.0f; @@ -3171,39 +3161,31 @@ static f32 D_802B9E60 = 3000.0f; f32 func_802AE1C0(f32 arg0, f32 arg1, f32 arg2) { f32 temp_f0; - f32 temp_f20; - s16 temp_v0; - s16 temp_v1; + f32 var_f20; + s32 temp_at; s32 temp_f4; s32 temp_f6; s32 temp_t0; s32 temp_t9; + s32 var_s2; u16 temp_s0; u16 temp_t1; + u16 var_s1; void *temp_t2; - u16 phi_s1; - f32 phi_f20; - s32 phi_s2; - f32 phi_f20_2; - f32 phi_f20_3; - temp_v0 = D_8015F6EA; - temp_f20 = D_802B9E4C; - temp_v1 = D_8015F6F2; - temp_f4 = (s32) ((arg0 - (f32) temp_v0) / (f32) ((s32) (D_8015F6E8 - temp_v0) / 32)); - temp_f6 = (s32) ((arg2 - (f32) temp_v1) / (f32) ((s32) (D_8015F6F0 - temp_v1) / 32)); + var_f20 = D_802B9E4C; + temp_f4 = (s32) ((arg0 - (f32) D_8015F6EA) / (f32) ((s32) (D_8015F6E8 - D_8015F6EA) / 32)); + temp_f6 = (s32) ((arg2 - (f32) D_8015F6F2) / (f32) ((s32) (D_8015F6F0 - D_8015F6F2) / 32)); temp_t0 = (s16) temp_f6 << 5; temp_t2 = ((s16) ((s16) temp_f4 + temp_t0) * 4) + &D_8014F110; temp_t1 = temp_t2->unk2; - phi_f20 = temp_f20; - phi_f20_2 = temp_f20; - if ((s32) (s16) temp_f4 < 0) { + if ((s16) temp_f4 < 0) { return D_802B9E50; } if ((s16) temp_f6 & 0x04000000) { return D_802B9E54; } - if ((s32) (s16) temp_f4 >= 0x20) { + if ((s16) temp_f4 >= 0x20) { return D_802B9E58; } if (temp_t0 >= 0x400) { @@ -3212,26 +3194,24 @@ f32 func_802AE1C0(f32 arg0, f32 arg1, f32 arg2) { if (temp_t1 == 0) { return D_802B9E60; } - phi_s1 = temp_t2->unk0; - phi_s2 = 0; + var_s1 = temp_t2->unk0; + var_s2 = 0; if ((s32) temp_t1 > 0) { do { - temp_s0 = *(D_8015F584 + (phi_s1 * 2)); - phi_f20_3 = phi_f20; - if ((((*D_8015F580)[temp_s0].flags & 0x4000) != 0) && (func_802ABB04(arg0, arg2, temp_s0 & 0xFFFF) == 1)) { + temp_s0 = *(D_8015F584 + (var_s1 * 2)); + if ((D_8015F580[temp_s0].flags & 0x4000) && (func_802ABB04(arg0, arg2, temp_s0 & 0xFFFF) == 1)) { temp_f0 = func_802ABE30(arg0, arg1, arg2, temp_s0 & 0xFFFF); - if ((temp_f0 <= arg1) && (phi_f20 < temp_f0)) { - phi_f20_3 = temp_f0; + if ((temp_f0 <= arg1) && (var_f20 < temp_f0)) { + var_f20 = temp_f0; } } - temp_t9 = (phi_s2 + 1) & 0xFFFF; - phi_s1 = (phi_s1 + 1) & 0xFFFF; - phi_f20 = phi_f20_3; - phi_s2 = temp_t9; - phi_f20_2 = phi_f20_3; - } while (temp_t9 < (s32) temp_t1); + temp_t9 = (var_s2 + 1) & 0xFFFF; + temp_at = temp_t9 < (s32) temp_t1; + var_s2 = temp_t9; + var_s1 = (var_s1 + 1) & 0xFFFF; + } while (temp_at != 0); } - return phi_f20_2; + return var_f20; } #else GLOBAL_ASM("asm/non_matchings/memory/func_802AE1C0.s") diff --git a/src/menus.c b/src/menus.c index b1c4fa946..e11cd468c 100644 --- a/src/menus.c +++ b/src/menus.c @@ -19,7 +19,6 @@ /** Externs to be put into headers **/ extern s16 D_8015F892; // bss unknown extern u32 D_800DC5AC; // data? from this file or another (main.c?)? -extern void func_800C3448(s32); extern void rmonPrintf(const char *, ...); // not in a libultra header? /** BSS **/ @@ -91,25 +90,27 @@ u32 sVIGammaOffDitherOn = OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON; /*** Const/rodata Data ***/ // used to set gScreenModeSelection; might be smaller; could be function static data -const s8 D_800F2B50[] = {0, 1, 2, 3, 3, 0, 0, 0}; +const s8 D_800F2B50[] = {0, 1, 2, 3, 3}; // set to D_8018EDF3, then that sets gPlayerCountSelection1 -const s8 D_800F2B58[] = {1, 2, 2, 3, 4, 0, 0, 0}; +const s8 D_800F2B58[] = {1, 2, 2, 3, 4}; // Limit for each column in one-two-three-four players selection -const s8 D_800F2B60[4] = {1, 2, 1, 1}; - -// Limit in each column -const s8 D_800F2B64[4][3] = { - {2, 1, 0}, - {2, 2, 0}, - {2, 0, 0}, - {2, 0, 0} +const s8 D_800F2B60[5][3] = { + {1, 2, 1}, + {1, 2, 1}, + {0, 2, 2}, + {0, 2, 0}, + {0, 2, 0}, + // {0, 3, 1}, + // {0, 3, 3}, + // {0, 3, 0}, + // {0, 3, 0}, }; // is this another union GameModePack? Figure out when decomping. const s32 gGameModeFromNumPlayersAndRowSelection[5][3] = { - { 0x03010003, 0x03000300, 0x00030000 }, + { 0x03010003, 0x03000300, 0x00030000 }, // Despite this matching, there is no way this line belongs in this array { GRAND_PRIX, TIME_TRIALS, 0x00000000 }, //first column { GRAND_PRIX, VERSUS, BATTLE }, //second { VERSUS, BATTLE, 0x00000000 }, //third @@ -151,17 +152,6 @@ union GameModePack { }; const union GameModePack D_800F2BE4 = { {0, 1, 2, 3} }; -/** forward decs **/ -void options_menu_act(struct Controller *, u16); -void data_menu_act(struct Controller *, u16); -void course_data_menu_act(struct Controller *, u16); -void logo_intro_menu_act(struct Controller *, u16); -void controller_pak_menu_act(struct Controller *, u16); -void splash_menu_act(struct Controller *, u16); -void main_menu_act(struct Controller *, u16); -void player_select_menu_act(struct Controller *, u16); -void course_select_menu_act(struct Controller *, u16); -void func_800B44AC(void); /**************************/ /** @@ -234,14 +224,6 @@ void update_menus(void) { } } - -// D_8018EDEC is position on options screen? -#ifndef NON_MATCHING -// issue is regalloc starting at the 0x32 0x33 case -enum MenuOptionsCursorPositions { - MENU_OPTIONS_CSRPOS_SOUNDMODE = 0x16 -}; - // navigation of the options menu void options_menu_act(struct Controller *controller, u16 arg1) { u16 btnAndStick; // sp3E @@ -276,7 +258,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) { sp38->unk8 = 1; sp2C = TRUE; } - // L800B066C if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x16)) { D_8018EDEC -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); @@ -286,14 +267,12 @@ void options_menu_act(struct Controller *controller, u16 arg1) { sp2C = TRUE; sp38->unk8 = -1; } - // L800B06FC if (sp2C && gSoundMode != sp38->unk4) { gSaveDataSoundMode = gSoundMode; write_save_data_grand_prix_points_and_sound_mode(); update_save_data_backup(); sp38->unk4 = gSoundMode; } - // L800B0758 if (btnAndStick & CONT_B) { func_8009E280(); play_sound2(SOUND_MENU_GO_BACK); @@ -305,7 +284,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } return; } - // L800B07C8 if (btnAndStick & CONT_A) { switch (D_8018EDEC) { case 0x16: @@ -357,20 +335,16 @@ void options_menu_act(struct Controller *controller, u16 arg1) { play_sound2(SOUND_MENU_FILE_NOT_FOUND); break; } - // L800B09DC - // definitely reading u8 at 0x84 from struct_8018EE10_entry, - // but that is too big for the size of the struct... unsized array off the end? - if (sp2C == -1 && !sp30->ghostDataSaved && !((u8 *)sp30)[0x84]) { + if (sp2C == -1 && !sp30[0].ghostDataSaved && !sp30[1].ghostDataSaved) { D_8018EDEC = 0x2A; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } - // L800B0A20 if (sp2C == 0) { - if (sp30->ghostDataSaved) { + if (sp30[0].ghostDataSaved) { D_8018EDEC = 0x28; play_sound2(SOUND_MENU_SELECT); - } else if (((u8 *)sp30)[0x84]) { + } else if (sp30[1].ghostDataSaved) { D_8018EDEC = 0x29; play_sound2(SOUND_MENU_SELECT); } else { @@ -418,7 +392,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } sp38->unk8 = 1; } - // L800B0B74 if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x1F)) { D_8018EDEC -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); @@ -427,13 +400,11 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } sp38->unk8 = -1; } - // L800B0BF8 if (btnAndStick & CONT_B) { D_8018EDEC = 0x18; play_sound2(SOUND_MENU_GO_BACK); return; } - // L800B0C20 if (btnAndStick & CONT_A) { switch (D_8018EDEC) { case 0x1E: @@ -469,8 +440,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } sp38->unk8 = 1; } - // L800B0D38 - if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x29) && sp30->ghostDataSaved) { + if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x29) && sp30[0].ghostDataSaved) { D_8018EDEC -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { @@ -478,13 +448,11 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } sp38->unk8 = -1; } - // L800B0DD0 if (btnAndStick & CONT_B) { D_8018EDEC = 0x17; play_sound2(SOUND_MENU_GO_BACK); return; } - // L800B0DF4 if (btnAndStick & CONT_A) { sp38->unk20 = D_8018EDEC - 0x28; if (sp30[sp38->unk20].courseIndex == D_8018EE10[1].courseIndex && D_8018EE10[1].ghostDataSaved) { @@ -518,12 +486,10 @@ void options_menu_act(struct Controller *controller, u16 arg1) { sp38->unk8 = -1; } } - // L800B0FA4 if (btnAndStick & CONT_B) { D_8018EDEC = sp38->unk20 + 0x28; play_sound2(SOUND_MENU_GO_BACK); } else if (btnAndStick & CONT_A) { - // L800B0FCC sp38->unk1C = D_8018EDEC - 0x32; if (D_8018EE10[(sp38->unk1C)].ghostDataSaved) { D_8018EDEC = 0x38; @@ -563,7 +529,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } sp38->unk8 = 1; } - // L800B10C4 if ((btnAndStick & CONT_LEFT) && D_8018EDEC >= 0x39) { D_8018EDEC -= 1; play_sound2(SOUND_MENU_CURSOR_MOVE); @@ -572,7 +537,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } sp38->unk8 = -1; } - // L800B114C if (btnAndStick & CONT_B) { D_8018EDEC = sp38->unk1C + 0x32; play_sound2(SOUND_MENU_GO_BACK); @@ -607,13 +571,11 @@ void options_menu_act(struct Controller *controller, u16 arg1) { if (res == 0) { res = func_800B65F4(sp38->unk20, sp38->unk1C); } - // L800B1230 if (res != 0) { D_8018EDEC = 0x42; play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } - // L800B1254 res = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, (u8 *)D_800F2E64, (u8 *)D_800F2E74, &D_8018EB84); if (res == 0) { res = func_800B6178(sp38->unk1C); @@ -623,7 +585,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) { play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } - // L800B12DC D_8018EDEC = 0x3C; D_8018EE10[sp38->unk1C].courseIndex = (sp30 + sp38->unk20)->courseIndex; func_800B6088(sp38->unk1C); @@ -644,7 +605,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { if (func_800B6A68()) { D_8018EDEC = 0x36; play_sound2(SOUND_MENU_FILE_NOT_FOUND); - } else if (sp30->ghostDataSaved) { + } else if (sp30[0].ghostDataSaved) { D_8018EDEC = 0x28; } else { D_8018EDEC = 0x29; @@ -654,11 +615,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { default: break; } } - // L800B13A0 return -} -#else -GLOBAL_ASM("asm/non_matchings/menus/options_menu_act.s") -#endif +} // Handle navigating the data menu interface void data_menu_act(struct Controller *controller, UNUSED u16 arg1) { @@ -1435,12 +1392,12 @@ void main_menu_act(struct Controller *controller, u16 arg1) { if (btnAndStick & CONT_DOWN) { sp24 = FALSE; if (func_800B555C()) { - if (sp28 < D_800F2B64[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1] + 1]) { + if (sp28 < D_800F2B60[D_8018EDF3 + 4][D_800E86AC[D_8018EDF3 - 1] + 1]) { sp24 = TRUE; } } else { // L800B30D4 - if (sp28 < D_800F2B60[D_8018EDF3]) { + if (sp28 < D_800F2B60[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1] + 1]) { sp24 = TRUE; } } diff --git a/src/menus.h b/src/menus.h index 8ea82436c..79293f7fc 100644 --- a/src/menus.h +++ b/src/menus.h @@ -6,11 +6,29 @@ #include #include +// D_8018EDEC is position on options screen? +enum MenuOptionsCursorPositions { + MENU_OPTIONS_CSRPOS_SOUNDMODE = 0x16 +}; + /* functions */ void update_menus(void); -void func_800B3F74(s32 menuSelection); +void options_menu_act(struct Controller *, u16); +void data_menu_act(struct Controller *, u16); +void course_data_menu_act(struct Controller *, u16); +void logo_intro_menu_act(struct Controller *, u16); +void controller_pak_menu_act(struct Controller *, u16); +void splash_menu_act(struct Controller *, u16); +void func_800B28C8(void); +void main_menu_act(struct Controller *, u16); +s32 is_character_spot_free(s32); +void player_select_menu_act(struct Controller *, u16); +void course_select_menu_act(struct Controller *, u16); +void func_800B3F74(s32); +void func_800B44AC(void); void func_800B44BC(void); s32 func_800B4520(void); +void func_800B4560(s32, s32); /* data */ extern s32 gMenuSelection; @@ -23,7 +41,7 @@ extern s8 gControllerPakSelectedTableRow; extern s8 D_800E86C4[12]; extern s8 D_800E86D0[16]; -extern const s8 D_800F2B60[4]; +extern const s8 D_800F2B60[5][3]; extern const s32 gGameModeFromNumPlayersAndRowSelection[5][3]; extern const s16 gCupCourseOrder[5][4];