diff --git a/Makefile b/Makefile index 0c536d21b4..f6498a6a9d 100644 --- a/Makefile +++ b/Makefile @@ -615,6 +615,8 @@ ifeq ($(COMPILER),ido) $(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2 -use_readwrite_const $(BUILD_DIR)/src/audio/port_eu.o: OPT_FLAGS := -O2 -framepointer $(BUILD_DIR)/src/audio/external.o: OPT_FLAGS := -O2 -framepointer +# No tab here required +$(BUILD_DIR)/src/code_8006E9C0.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0 endif diff --git a/asm/non_matchings/code_80005FD0/func_800065D0.s b/asm/non_matchings/code_80005FD0/func_800065D0.s deleted file mode 100644 index e1d2a1a606..0000000000 --- a/asm/non_matchings/code_80005FD0/func_800065D0.s +++ /dev/null @@ -1,134 +0,0 @@ -glabel func_800065D0 -/* 0071D0 800065D0 84AE002E */ lh $t6, 0x2e($a1) -/* 0071D4 800065D4 240C00B6 */ li $t4, 182 -/* 0071D8 800065D8 00041040 */ sll $v0, $a0, 1 -/* 0071DC 800065DC 01CC001A */ div $zero, $t6, $t4 -/* 0071E0 800065E0 3C038016 */ lui $v1, %hi(gPathIndexByPlayerId) # 0x8016 -/* 0071E4 800065E4 00621821 */ addu $v1, $v1, $v0 -/* 0071E8 800065E8 846345B0 */ lh $v1, %lo(gPathIndexByPlayerId)($v1) # 0x45b0($v1) -/* 0071EC 800065EC 3C068016 */ lui $a2, %hi(gNearestWaypointByPlayerId) # 0x8016 -/* 0071F0 800065F0 00C23021 */ addu $a2, $a2, $v0 -/* 0071F4 800065F4 3C0D8016 */ lui $t5, %hi(D_80164590) # 0x8016 -/* 0071F8 800065F8 0003C880 */ sll $t9, $v1, 2 -/* 0071FC 800065FC 94C64438 */ lhu $a2, %lo(gNearestWaypointByPlayerId)($a2) # 0x4438($a2) -/* 007200 80006600 01B96821 */ addu $t5, $t5, $t9 -/* 007204 80006604 00003812 */ mflo $a3 -/* 007208 80006608 8DAD4590 */ lw $t5, %lo(D_80164590)($t5) # 0x4590($t5) -/* 00720C 8000660C 15800002 */ bnez $t4, .L80006618 -/* 007210 80006610 00000000 */ nop -/* 007214 80006614 0007000D */ break 7 -.L80006618: -/* 007218 80006618 2401FFFF */ li $at, -1 -/* 00721C 8000661C 15810004 */ bne $t4, $at, .L80006630 -/* 007220 80006620 3C018000 */ lui $at, 0x8000 -/* 007224 80006624 15C10002 */ bne $t6, $at, .L80006630 -/* 007228 80006628 00000000 */ nop -/* 00722C 8000662C 0006000D */ break 6 -.L80006630: -/* 007230 80006630 00077C00 */ sll $t7, $a3, 0x10 -/* 007234 80006634 000F3C03 */ sra $a3, $t7, 0x10 -/* 007238 80006638 00067040 */ sll $t6, $a2, 1 -/* 00723C 8000663C 01AE7821 */ addu $t7, $t5, $t6 -/* 007240 80006640 85F80000 */ lh $t8, ($t7) -/* 007244 80006644 00041880 */ sll $v1, $a0, 2 -/* 007248 80006648 3C058016 */ lui $a1, %hi(D_80164450) # 0x8016 -/* 00724C 8000664C 030C001A */ div $zero, $t8, $t4 -/* 007250 80006650 00004012 */ mflo $t0 -/* 007254 80006654 0008CC00 */ sll $t9, $t0, 0x10 -/* 007258 80006658 00196C03 */ sra $t5, $t9, 0x10 -/* 00725C 8000665C 00ED5023 */ subu $t2, $a3, $t5 -/* 007260 80006660 000A4C00 */ sll $t1, $t2, 0x10 -/* 007264 80006664 000A5C00 */ sll $t3, $t2, 0x10 -/* 007268 80006668 00097403 */ sra $t6, $t1, 0x10 -/* 00726C 8000666C 000B7C03 */ sra $t7, $t3, 0x10 -/* 007270 80006670 15800002 */ bnez $t4, .L8000667C -/* 007274 80006674 00000000 */ nop -/* 007278 80006678 0007000D */ break 7 -.L8000667C: -/* 00727C 8000667C 2401FFFF */ li $at, -1 -/* 007280 80006680 15810004 */ bne $t4, $at, .L80006694 -/* 007284 80006684 3C018000 */ lui $at, 0x8000 -/* 007288 80006688 17010002 */ bne $t8, $at, .L80006694 -/* 00728C 8000668C 00000000 */ nop -/* 007290 80006690 0006000D */ break 6 -.L80006694: -/* 007294 80006694 01A04025 */ move $t0, $t5 -/* 007298 80006698 01C04825 */ move $t1, $t6 -/* 00729C 8000669C 05E10004 */ bgez $t7, .L800066B0 -/* 0072A0 800066A0 01E05825 */ move $t3, $t7 -/* 0072A4 800066A4 000F4823 */ negu $t1, $t7 -/* 0072A8 800066A8 0009C400 */ sll $t8, $t1, 0x10 -/* 0072AC 800066AC 00184C03 */ sra $t1, $t8, 0x10 -.L800066B0: -/* 0072B0 800066B0 3C0D8016 */ lui $t5, %hi(D_80163288) # $t5, 0x8016 -/* 0072B4 800066B4 25AD3288 */ addiu $t5, %lo(D_80163288) # addiu $t5, $t5, 0x3288 -/* 0072B8 800066B8 006D3021 */ addu $a2, $v1, $t5 -/* 0072BC 800066BC 00A32821 */ addu $a1, $a1, $v1 -/* 0072C0 800066C0 8CA54450 */ lw $a1, %lo(D_80164450)($a1) # 0x4450($a1) -/* 0072C4 800066C4 8CCE0000 */ lw $t6, ($a2) -/* 0072C8 800066C8 00AE082A */ slt $at, $a1, $t6 -/* 0072CC 800066CC 10200022 */ beqz $at, .L80006758 -/* 0072D0 800066D0 29210088 */ slti $at, $t1, 0x88 -/* 0072D4 800066D4 14200020 */ bnez $at, .L80006758 -/* 0072D8 800066D8 292100E1 */ slti $at, $t1, 0xe1 -/* 0072DC 800066DC 1020001E */ beqz $at, .L80006758 -/* 0072E0 800066E0 3C0F8016 */ lui $t7, %hi(D_80163258) # $t7, 0x8016 -/* 0072E4 800066E4 25EF3258 */ addiu $t7, %lo(D_80163258) # addiu $t7, $t7, 0x3258 -/* 0072E8 800066E8 004F1821 */ addu $v1, $v0, $t7 -/* 0072EC 800066EC 94780000 */ lhu $t8, ($v1) -/* 0072F0 800066F0 240E0001 */ li $t6, 1 -/* 0072F4 800066F4 240F0005 */ li $t7, 5 -/* 0072F8 800066F8 27190001 */ addiu $t9, $t8, 1 -/* 0072FC 800066FC 332DFFFF */ andi $t5, $t9, 0xffff -/* 007300 80006700 29A10005 */ slti $at, $t5, 5 -/* 007304 80006704 1420002D */ bnez $at, .L800067BC -/* 007308 80006708 A4790000 */ sh $t9, ($v1) -/* 00730C 8000670C 0004C0C0 */ sll $t8, $a0, 3 -/* 007310 80006710 0304C023 */ subu $t8, $t8, $a0 -/* 007314 80006714 0018C100 */ sll $t8, $t8, 4 -/* 007318 80006718 0304C023 */ subu $t8, $t8, $a0 -/* 00731C 8000671C 0018C080 */ sll $t8, $t8, 2 -/* 007320 80006720 3C018016 */ lui $at, %hi(D_80163270) # 0x8016 -/* 007324 80006724 0304C023 */ subu $t8, $t8, $a0 -/* 007328 80006728 3C19800F */ lui $t9, %hi(gPlayers) # $t9, 0x800f -/* 00732C 8000672C 00220821 */ addu $at, $at, $v0 -/* 007330 80006730 27396990 */ addiu $t9, %lo(gPlayers) # addiu $t9, $t9, 0x6990 -/* 007334 80006734 0018C0C0 */ sll $t8, $t8, 3 -/* 007338 80006738 A42E3270 */ sh $t6, %lo(D_80163270)($at) # 0x3270($at) -/* 00733C 8000673C 03193821 */ addu $a3, $t8, $t9 -/* 007340 80006740 8CED00BC */ lw $t5, 0xbc($a3) -/* 007344 80006744 3C010040 */ lui $at, 0x40 -/* 007348 80006748 A46F0000 */ sh $t7, ($v1) -/* 00734C 8000674C 01A17025 */ or $t6, $t5, $at -/* 007350 80006750 1000001A */ b .L800067BC -/* 007354 80006754 ACEE00BC */ sw $t6, 0xbc($a3) -.L80006758: -/* 007358 80006758 2921002D */ slti $at, $t1, 0x2d -/* 00735C 8000675C 14200003 */ bnez $at, .L8000676C -/* 007360 80006760 000478C0 */ sll $t7, $a0, 3 -/* 007364 80006764 2921013C */ slti $at, $t1, 0x13c -/* 007368 80006768 14200014 */ bnez $at, .L800067BC -.L8000676C: -/* 00736C 8000676C 01E47823 */ subu $t7, $t7, $a0 -/* 007370 80006770 3C018016 */ lui $at, %hi(D_80163270) # 0x8016 -/* 007374 80006774 000F7900 */ sll $t7, $t7, 4 -/* 007378 80006778 00220821 */ addu $at, $at, $v0 -/* 00737C 8000677C 01E47823 */ subu $t7, $t7, $a0 -/* 007380 80006780 A4203270 */ sh $zero, %lo(D_80163270)($at) # 0x3270($at) -/* 007384 80006784 000F7880 */ sll $t7, $t7, 2 -/* 007388 80006788 3C018016 */ lui $at, %hi(D_80163258) # 0x8016 -/* 00738C 8000678C 01E47823 */ subu $t7, $t7, $a0 -/* 007390 80006790 3C18800F */ lui $t8, %hi(gPlayers) # $t8, 0x800f -/* 007394 80006794 00220821 */ addu $at, $at, $v0 -/* 007398 80006798 27186990 */ addiu $t8, %lo(gPlayers) # addiu $t8, $t8, 0x6990 -/* 00739C 8000679C 000F78C0 */ sll $t7, $t7, 3 -/* 0073A0 800067A0 A4203258 */ sh $zero, %lo(D_80163258)($at) # 0x3258($at) -/* 0073A4 800067A4 01F83821 */ addu $a3, $t7, $t8 -/* 0073A8 800067A8 8CF900BC */ lw $t9, 0xbc($a3) -/* 0073AC 800067AC 3C01FFBF */ lui $at, (0xFFBFFFFF >> 16) # lui $at, 0xffbf -/* 0073B0 800067B0 3421FFFF */ ori $at, (0xFFBFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0073B4 800067B4 03216824 */ and $t5, $t9, $at -/* 0073B8 800067B8 ACED00BC */ sw $t5, 0xbc($a3) -.L800067BC: -/* 0073BC 800067BC 03E00008 */ jr $ra -/* 0073C0 800067C0 ACC50000 */ sw $a1, ($a2) diff --git a/asm/non_matchings/code_80005FD0/func_80010E6C.s b/asm/non_matchings/code_80005FD0/func_80010E6C.s deleted file mode 100644 index 37fb33522e..0000000000 --- a/asm/non_matchings/code_80005FD0/func_80010E6C.s +++ /dev/null @@ -1,62 +0,0 @@ -glabel func_80010E6C -/* 011A6C 80010E6C 00047040 */ sll $t6, $a0, 1 -/* 011A70 80010E70 3C028016 */ lui $v0, %hi(gWaypointCountByPathIndex) # 0x8016 -/* 011A74 80010E74 004E1021 */ addu $v0, $v0, $t6 -/* 011A78 80010E78 944245C8 */ lhu $v0, %lo(gWaypointCountByPathIndex)($v0) # 0x45c8($v0) -/* 011A7C 80010E7C 00042880 */ sll $a1, $a0, 2 -/* 011A80 80010E80 3C038016 */ lui $v1, %hi(D_80164580) # 0x8016 -/* 011A84 80010E84 3C068016 */ lui $a2, %hi(D_801645A0) # 0x8016 -/* 011A88 80010E88 00651821 */ addu $v1, $v1, $a1 -/* 011A8C 80010E8C 00C53021 */ addu $a2, $a2, $a1 -/* 011A90 80010E90 8C634580 */ lw $v1, %lo(D_80164580)($v1) # 0x4580($v1) -/* 011A94 80010E94 8CC645A0 */ lw $a2, %lo(D_801645A0)($a2) # 0x45a0($a2) -/* 011A98 80010E98 18400027 */ blez $v0, .L80010F38 -/* 011A9C 80010E9C 00003825 */ move $a3, $zero -/* 011AA0 80010EA0 240B0014 */ li $t3, 20 -/* 011AA4 80010EA4 240A0001 */ li $t2, 1 -.L80010EA8: -/* 011AA8 80010EA8 00002025 */ move $a0, $zero -/* 011AAC 80010EAC 1840001E */ blez $v0, .L80010F28 -/* 011AB0 80010EB0 00002825 */ move $a1, $zero -/* 011AB4 80010EB4 00E04825 */ move $t1, $a3 -.L80010EB8: -/* 011AB8 80010EB8 0122001A */ div $zero, $t1, $v0 -/* 011ABC 80010EBC 00007810 */ mfhi $t7 -/* 011AC0 80010EC0 000FC040 */ sll $t8, $t7, 1 -/* 011AC4 80010EC4 0078C821 */ addu $t9, $v1, $t8 -/* 011AC8 80010EC8 87280000 */ lh $t0, ($t9) -/* 011ACC 80010ECC 14400002 */ bnez $v0, .L80010ED8 -/* 011AD0 80010ED0 00000000 */ nop -/* 011AD4 80010ED4 0007000D */ break 7 -.L80010ED8: -/* 011AD8 80010ED8 2401FFFF */ li $at, -1 -/* 011ADC 80010EDC 14410004 */ bne $v0, $at, .L80010EF0 -/* 011AE0 80010EE0 3C018000 */ lui $at, 0x8000 -/* 011AE4 80010EE4 15210002 */ bne $t1, $at, .L80010EF0 -/* 011AE8 80010EE8 00000000 */ nop -/* 011AEC 80010EEC 0006000D */ break 6 -.L80010EF0: -/* 011AF0 80010EF0 24A50001 */ addiu $a1, $a1, 1 -/* 011AF4 80010EF4 110A0003 */ beq $t0, $t2, .L80010F04 -/* 011AF8 80010EF8 00000000 */ nop -/* 011AFC 80010EFC 5500000B */ bnel $t0, $zero, .L80010F2C -/* 011B00 80010F00 24E70001 */ addiu $a3, $a3, 1 -.L80010F04: -/* 011B04 80010F04 3C08800E */ lui $t0, %hi(gCurrentCourseId) -/* 011B08 80010F08 8508C5A0 */ lh $t0, %lo(gCurrentCourseId)($t0) -/* 011B0C 80010F0C 24840001 */ addiu $a0, $a0, 1 -/* 011B10 80010F10 00046400 */ sll $t4, $a0, 0x10 -/* 011B14 80010F14 000C6C03 */ sra $t5, $t4, 0x10 -/* 011B18 80010F18 11680003 */ beq $t3, $t0, .L80010F28 -/* 011B1C 80010F1C 01A02025 */ move $a0, $t5 -/* 011B20 80010F20 14A2FFE5 */ bne $a1, $v0, .L80010EB8 -/* 011B24 80010F24 25290001 */ addiu $t1, $t1, 1 -.L80010F28: -/* 011B28 80010F28 24E70001 */ addiu $a3, $a3, 1 -.L80010F2C: -/* 011B2C 80010F2C A4C40000 */ sh $a0, ($a2) -/* 011B30 80010F30 14E2FFDD */ bne $a3, $v0, .L80010EA8 -/* 011B34 80010F34 24C60002 */ addiu $a2, $a2, 2 -.L80010F38: -/* 011B38 80010F38 03E00008 */ jr $ra -/* 011B3C 80010F3C 00000000 */ nop diff --git a/asm/non_matchings/code_8006E9C0/func_8006EB10.s b/asm/non_matchings/code_8006E9C0/func_8006EB10.s deleted file mode 100644 index f8b07d3366..0000000000 --- a/asm/non_matchings/code_8006E9C0/func_8006EB10.s +++ /dev/null @@ -1,154 +0,0 @@ -glabel func_8006EB10 -/* 06F710 8006EB10 3C038019 */ lui $v1, %hi(D_8018C1B0) # $v1, 0x8019 -/* 06F714 8006EB14 3C028019 */ lui $v0, %hi(D_8018C3B0) # $v0, 0x8019 -/* 06F718 8006EB18 2442C3B0 */ addiu $v0, %lo(D_8018C3B0) # addiu $v0, $v0, -0x3c50 -/* 06F71C 8006EB1C 2463C1B0 */ addiu $v1, %lo(D_8018C1B0) # addiu $v1, $v1, -0x3e50 -/* 06F720 8006EB20 2404FFFF */ li $a0, -1 -.L8006EB24: -/* 06F724 8006EB24 24630004 */ addiu $v1, $v1, 4 -/* 06F728 8006EB28 0062082B */ sltu $at, $v1, $v0 -/* 06F72C 8006EB2C 1420FFFD */ bnez $at, .L8006EB24 -/* 06F730 8006EB30 AC64FFFC */ sw $a0, -4($v1) -/* 06F734 8006EB34 3C038019 */ lui $v1, %hi(D_8018C3F0) # $v1, 0x8019 -/* 06F738 8006EB38 3C028019 */ lui $v0, %hi(D_8018C5F0) # $v0, 0x8019 -/* 06F73C 8006EB3C 2442C5F0 */ addiu $v0, %lo(D_8018C5F0) # addiu $v0, $v0, -0x3a10 -/* 06F740 8006EB40 2463C3F0 */ addiu $v1, %lo(D_8018C3F0) # addiu $v1, $v1, -0x3c10 -.L8006EB44: -/* 06F744 8006EB44 24630004 */ addiu $v1, $v1, 4 -/* 06F748 8006EB48 0062082B */ sltu $at, $v1, $v0 -/* 06F74C 8006EB4C 1420FFFD */ bnez $at, .L8006EB44 -/* 06F750 8006EB50 AC64FFFC */ sw $a0, -4($v1) -/* 06F754 8006EB54 3C038019 */ lui $v1, %hi(D_8018C630) # $v1, 0x8019 -/* 06F758 8006EB58 3C028019 */ lui $v0, %hi(D_8018C830) # $v0, 0x8019 -/* 06F75C 8006EB5C 2442C830 */ addiu $v0, %lo(D_8018C830) # addiu $v0, $v0, -0x37d0 -/* 06F760 8006EB60 2463C630 */ addiu $v1, %lo(D_8018C630) # addiu $v1, $v1, -0x39d0 -.L8006EB64: -/* 06F764 8006EB64 24630004 */ addiu $v1, $v1, 4 -/* 06F768 8006EB68 0062082B */ sltu $at, $v1, $v0 -/* 06F76C 8006EB6C 1420FFFD */ bnez $at, .L8006EB64 -/* 06F770 8006EB70 AC64FFFC */ sw $a0, -4($v1) -/* 06F774 8006EB74 3C038019 */ lui $v1, %hi(D_8018C870) # $v1, 0x8019 -/* 06F778 8006EB78 3C028019 */ lui $v0, %hi(D_8018C970) # $v0, 0x8019 -/* 06F77C 8006EB7C 2442C970 */ addiu $v0, %lo(D_8018C970) # addiu $v0, $v0, -0x3690 -/* 06F780 8006EB80 2463C870 */ addiu $v1, %lo(D_8018C870) # addiu $v1, $v1, -0x3790 -.L8006EB84: -/* 06F784 8006EB84 24630004 */ addiu $v1, $v1, 4 -/* 06F788 8006EB88 0062082B */ sltu $at, $v1, $v0 -/* 06F78C 8006EB8C 1420FFFD */ bnez $at, .L8006EB84 -/* 06F790 8006EB90 AC64FFFC */ sw $a0, -4($v1) -/* 06F794 8006EB94 3C038019 */ lui $v1, %hi(D_8018C970) # $v1, 0x8019 -/* 06F798 8006EB98 3C028019 */ lui $v0, %hi(D_8018CA70) # $v0, 0x8019 -/* 06F79C 8006EB9C 2442CA70 */ addiu $v0, %lo(D_8018CA70) # addiu $v0, $v0, -0x3590 -/* 06F7A0 8006EBA0 2463C970 */ addiu $v1, %lo(D_8018C970) # addiu $v1, $v1, -0x3690 -.L8006EBA4: -/* 06F7A4 8006EBA4 24630010 */ addiu $v1, $v1, 0x10 -/* 06F7A8 8006EBA8 AC64FFF0 */ sw $a0, -0x10($v1) -/* 06F7AC 8006EBAC AC64FFF4 */ sw $a0, -0xc($v1) -/* 06F7B0 8006EBB0 AC64FFF8 */ sw $a0, -8($v1) -/* 06F7B4 8006EBB4 1462FFFB */ bne $v1, $v0, .L8006EBA4 -/* 06F7B8 8006EBB8 AC64FFFC */ sw $a0, -4($v1) -/* 06F7BC 8006EBBC 3C028019 */ lui $v0, %hi(D_8018CFA8) # $v0, 0x8019 -/* 06F7C0 8006EBC0 2442CFA8 */ addiu $v0, %lo(D_8018CFA8) # addiu $v0, $v0, -0x3058 -/* 06F7C4 8006EBC4 A4400000 */ sh $zero, ($v0) -/* 06F7C8 8006EBC8 844E0000 */ lh $t6, ($v0) -/* 06F7CC 8006EBCC 3C038019 */ lui $v1, %hi(D_8018CF90) # $v1, 0x8019 -/* 06F7D0 8006EBD0 2463CF90 */ addiu $v1, %lo(D_8018CF90) # addiu $v1, $v1, -0x3070 -/* 06F7D4 8006EBD4 A46E0000 */ sh $t6, ($v1) -/* 06F7D8 8006EBD8 846F0000 */ lh $t7, ($v1) -/* 06F7DC 8006EBDC 3C048019 */ lui $a0, %hi(D_8018CF78) # $a0, 0x8019 -/* 06F7E0 8006EBE0 2484CF78 */ addiu $a0, %lo(D_8018CF78) # addiu $a0, $a0, -0x3088 -/* 06F7E4 8006EBE4 A48F0000 */ sh $t7, ($a0) -/* 06F7E8 8006EBE8 84980000 */ lh $t8, ($a0) -/* 06F7EC 8006EBEC 3C058019 */ lui $a1, %hi(D_8018CF60) # $a1, 0x8019 -/* 06F7F0 8006EBF0 24A5CF60 */ addiu $a1, %lo(D_8018CF60) # addiu $a1, $a1, -0x30a0 -/* 06F7F4 8006EBF4 A4B80000 */ sh $t8, ($a1) -/* 06F7F8 8006EBF8 84B90000 */ lh $t9, ($a1) -/* 06F7FC 8006EBFC 3C068019 */ lui $a2, %hi(D_8018CF48) # $a2, 0x8019 -/* 06F800 8006EC00 24C6CF48 */ addiu $a2, %lo(D_8018CF48) # addiu $a2, $a2, -0x30b8 -/* 06F804 8006EC04 A4D90000 */ sh $t9, ($a2) -/* 06F808 8006EC08 84CE0000 */ lh $t6, ($a2) -/* 06F80C 8006EC0C 3C078019 */ lui $a3, %hi(D_8018CF20) # $a3, 0x8019 -/* 06F810 8006EC10 24E7CF20 */ addiu $a3, %lo(D_8018CF20) # addiu $a3, $a3, -0x30e0 -/* 06F814 8006EC14 A4EE0000 */ sh $t6, ($a3) -/* 06F818 8006EC18 84EF0000 */ lh $t7, ($a3) -/* 06F81C 8006EC1C 3C088019 */ lui $t0, %hi(D_8018CFE0) # $t0, 0x8019 -/* 06F820 8006EC20 3C018019 */ lui $at, %hi(D_8018CF18) # $at, 0x8019 -/* 06F824 8006EC24 2508CFE0 */ addiu $t0, %lo(D_8018CFE0) # addiu $t0, $t0, -0x3020 -/* 06F828 8006EC28 A42FCF18 */ sh $t7, %lo(D_8018CF18)($at) -/* 06F82C 8006EC2C A5000000 */ sh $zero, ($t0) -/* 06F830 8006EC30 85180000 */ lh $t8, ($t0) -/* 06F834 8006EC34 3C098019 */ lui $t1, %hi(D_8018CFD8) # $t1, 0x8019 -/* 06F838 8006EC38 2529CFD8 */ addiu $t1, %lo(D_8018CFD8) # addiu $t1, $t1, -0x3028 -/* 06F83C 8006EC3C A5380000 */ sh $t8, ($t1) -/* 06F840 8006EC40 85390000 */ lh $t9, ($t1) -/* 06F844 8006EC44 3C0A8019 */ lui $t2, %hi(D_8018CFD0) # $t2, 0x8019 -/* 06F848 8006EC48 254ACFD0 */ addiu $t2, %lo(D_8018CFD0) # addiu $t2, $t2, -0x3030 -/* 06F84C 8006EC4C A5590000 */ sh $t9, ($t2) -/* 06F850 8006EC50 854E0000 */ lh $t6, ($t2) -/* 06F854 8006EC54 3C0B8019 */ lui $t3, %hi(D_8018CFC8) # $t3, 0x8019 -/* 06F858 8006EC58 256BCFC8 */ addiu $t3, %lo(D_8018CFC8) # addiu $t3, $t3, -0x3038 -/* 06F85C 8006EC5C A56E0000 */ sh $t6, ($t3) -/* 06F860 8006EC60 856F0000 */ lh $t7, ($t3) -/* 06F864 8006EC64 3C0C8019 */ lui $t4, %hi(D_8018CFC0) # $t4, 0x8019 -/* 06F868 8006EC68 258CCFC0 */ addiu $t4, %lo(D_8018CFC0) # addiu $t4, $t4, -0x3040 -/* 06F86C 8006EC6C A58F0000 */ sh $t7, ($t4) -/* 06F870 8006EC70 85980000 */ lh $t8, ($t4) -/* 06F874 8006EC74 3C0D8019 */ lui $t5, %hi(D_8018CFB8) # $t5, 0x8019 -/* 06F878 8006EC78 25ADCFB8 */ addiu $t5, %lo(D_8018CFB8) # addiu $t5, $t5, -0x3048 -/* 06F87C 8006EC7C A5B80000 */ sh $t8, ($t5) -/* 06F880 8006EC80 85B90000 */ lh $t9, ($t5) -/* 06F884 8006EC84 3C018019 */ lui $at, %hi(D_8018CFB0) # $at, 0x8019 -/* 06F888 8006EC88 3C0E8019 */ lui $t6, %hi(D_8018D098) # $t6, 0x8019 -/* 06F88C 8006EC8C A439CFB0 */ sh $t9, %lo(D_8018CFB0)($at) -/* 06F890 8006EC90 3C018019 */ lui $at, %hi(D_8018D018) # $at, 0x8019 -/* 06F894 8006EC94 A420D018 */ sh $zero, %lo(D_8018D018)($at) -/* 06F898 8006EC98 3C018019 */ lui $at, %hi(D_8018D010) # $at, 0x8019 -/* 06F89C 8006EC9C A420D010 */ sh $zero, %lo(D_8018D010)($at) -/* 06F8A0 8006ECA0 3C018019 */ lui $at, %hi(D_8018D008) # $at, 0x8019 -/* 06F8A4 8006ECA4 A420D008 */ sh $zero, %lo(D_8018D008)($at) -/* 06F8A8 8006ECA8 3C018019 */ lui $at, %hi(D_8018D000) # $at, 0x8019 -/* 06F8AC 8006ECAC A420D000 */ sh $zero, %lo(D_8018D000)($at) -/* 06F8B0 8006ECB0 3C018019 */ lui $at, %hi(D_8018CFF8) # $at, 0x8019 -/* 06F8B4 8006ECB4 A420CFF8 */ sh $zero, %lo(D_8018CFF8)($at) -/* 06F8B8 8006ECB8 3C018019 */ lui $at, %hi(D_8018CFF0) # $at, 0x8019 -/* 06F8BC 8006ECBC A420CFF0 */ sh $zero, %lo(D_8018CFF0)($at) -/* 06F8C0 8006ECC0 3C018019 */ lui $at, %hi(D_8018CFE8) # $at, 0x8019 -/* 06F8C4 8006ECC4 A420CFE8 */ sh $zero, %lo(D_8018CFE8)($at) -/* 06F8C8 8006ECC8 3C018019 */ lui $at, %hi(D_8018D110) # $at, 0x8019 -/* 06F8CC 8006ECCC A420D110 */ sh $zero, %lo(D_8018D110)($at) -/* 06F8D0 8006ECD0 3C018019 */ lui $at, %hi(D_8018D0E8) # $at, 0x8019 -/* 06F8D4 8006ECD4 A420D0E8 */ sh $zero, %lo(D_8018D0E8)($at) -/* 06F8D8 8006ECD8 3C018019 */ lui $at, %hi(D_8018D0C0) # $at, 0x8019 -/* 06F8DC 8006ECDC A420D0C0 */ sh $zero, %lo(D_8018D0C0)($at) -/* 06F8E0 8006ECE0 3C018019 */ lui $at, %hi(D_8018D098) # $at, 0x8019 -/* 06F8E4 8006ECE4 A420D098 */ sh $zero, %lo(D_8018D098)($at) -/* 06F8E8 8006ECE8 85CED098 */ lh $t6, %lo(D_8018D098)($t6) -/* 06F8EC 8006ECEC 3C018019 */ lui $at, %hi(D_8018D070) # $at, 0x8019 -/* 06F8F0 8006ECF0 3C0F8019 */ lui $t7, %hi(D_8018D070) # $t7, 0x8019 -/* 06F8F4 8006ECF4 A42ED070 */ sh $t6, %lo(D_8018D070)($at) -/* 06F8F8 8006ECF8 85EFD070 */ lh $t7, %lo(D_8018D070)($t7) -/* 06F8FC 8006ECFC 3C018019 */ lui $at, %hi(D_8018D048) # $at, 0x8019 -/* 06F900 8006ED00 3C188019 */ lui $t8, %hi(D_8018D048) # $t8, 0x8019 -/* 06F904 8006ED04 A42FD048 */ sh $t7, %lo(D_8018D048)($at) -/* 06F908 8006ED08 8718D048 */ lh $t8, %lo(D_8018D048)($t8) -/* 06F90C 8006ED0C 3C018019 */ lui $at, %hi(D_8018D020) # $at, 0x8019 -/* 06F910 8006ED10 3C198018 */ lui $t9, %hi(D_80183E7C) # $t9, 0x8018 -/* 06F914 8006ED14 A438D020 */ sh $t8, %lo(D_8018D020)($at) -/* 06F918 8006ED18 3C018018 */ lui $at, %hi(D_80183E7C) # $at, 0x8018 -/* 06F91C 8006ED1C AC203E7C */ sw $zero, %lo(D_80183E7C)($at) -/* 06F920 8006ED20 8F393E7C */ lw $t9, %lo(D_80183E7C)($t9) -/* 06F924 8006ED24 3C018018 */ lui $at, %hi(D_80183E6C) # $at, 0x8018 -/* 06F928 8006ED28 3C0E8018 */ lui $t6, %hi(D_80183E6C) # $t6, 0x8018 -/* 06F92C 8006ED2C AC393E6C */ sw $t9, %lo(D_80183E6C)($at) -/* 06F930 8006ED30 8DCE3E6C */ lw $t6, %lo(D_80183E6C)($t6) -/* 06F934 8006ED34 3C018018 */ lui $at, %hi(D_80183E5C) # $at, 0x8018 -/* 06F938 8006ED38 3C0F8018 */ lui $t7, %hi(D_80183E5C) # $t7, 0x8018 -/* 06F93C 8006ED3C AC2E3E5C */ sw $t6, %lo(D_80183E5C)($at) -/* 06F940 8006ED40 8DEF3E5C */ lw $t7, %lo(D_80183E5C)($t7) -/* 06F944 8006ED44 3C018018 */ lui $at, %hi(D_80183E4C) # $at, 0x8018 -/* 06F948 8006ED48 3C188018 */ lui $t8, %hi(D_80183E4C) # $t8, 0x8018 -/* 06F94C 8006ED4C AC2F3E4C */ sw $t7, %lo(D_80183E4C)($at) -/* 06F950 8006ED50 8F183E4C */ lw $t8, %lo(D_80183E4C)($t8) -/* 06F954 8006ED54 3C018018 */ lui $at, %hi(D_80183E38) # 0x8018 -/* 06F958 8006ED58 03E00008 */ jr $ra -/* 06F95C 8006ED5C AC383E38 */ sw $t8, %lo(D_80183E38)($at) # 0x3e38($at) diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index a18952242b..c6693f8e1c 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -482,52 +482,43 @@ s32 func_800061DC(Vec3f arg0, f32 arg1, s32 arg2) { return var_v1; } -#ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -extern s16 D_80163258; -extern s16 D_80163270; -extern s32 D_80163288; +extern u16 D_80163258[]; +extern u16 D_80163270[]; +extern s32 D_80163288[]; -void func_800065D0(s32 arg0, Player *player) { - Player *temp_a3; - Player *temp_a3_2; +void func_800065D0(s32 playerId, Player *player) { s16 temp_t2; s16 var_t1; - s32 *temp_a2; - s32 temp_a1; - s32 temp_v0; - u16 *temp_v1; - u16 temp_t9; + s16 temp_t3; + s16 a; + u32 b; - temp_v0 = arg0 * 2; - temp_t2 = (s16) ((s16) player->unk_02C[1] / 182) - (s16) ((s16) D_80164590[(s16) gPathIndexByPlayerId[arg0]][gNearestWaypointByPlayerId[arg0]] / 182); - var_t1 = temp_t2; - if (temp_t2 < 0) { - var_t1 = temp_t2 * -1; - } - temp_a2 = (arg0 * 4) + &D_80163288; - temp_a1 = D_80164450[arg0]; - if ((temp_a1 < *temp_a2) && (var_t1 >= 0x88) && (var_t1 < 0xE1)) { - temp_v1 = temp_v0 + &D_80163258; - temp_t9 = *temp_v1 + 1; - *temp_v1 = temp_t9; - if ((temp_t9 & 0xFFFF) >= 5) { - *(&D_80163270 + temp_v0) = 1; - temp_a3 = &gPlayers[arg0]; - *temp_v1 = 5; - temp_a3->effects |= 0x400000; - } - } else if ((var_t1 < 0x2D) || (var_t1 >= 0x13C)) { - *(&D_80163270 + temp_v0) = 0; - *(&D_80163258 + temp_v0) = 0; - temp_a3_2 = &gPlayers[arg0]; - temp_a3_2->effects &= 0xFFBFFFFF; - } - *temp_a2 = temp_a1; + a = (s16) gPathIndexByPlayerId[playerId]; + b = gNearestWaypointByPlayerId[playerId]; + + temp_t2 = (s16) ((s16) player->unk_02C[1] / 182); + temp_t3 = (s16) ((s16) D_80164590[a][b] / 182); + + var_t1 = temp_t2 - temp_t3; + + if (var_t1 < 0) { + var_t1 = -var_t1; + } + + if ((D_80164450[playerId] < D_80163288[playerId]) && (var_t1 >= 136) && (var_t1 < 225)) { + D_80163258[playerId]++; + if ((D_80163258[playerId]) >= 5) { + D_80163270[playerId] = 1; + D_80163258[playerId] = 5; + gPlayers[playerId].effects |= 0x400000; + } + } else if ((var_t1 < 45) || (var_t1 >= 316)) { + D_80163270[playerId] = 0; + D_80163258[playerId] = 0; + gPlayers[playerId].effects &= 0xFFBFFFFF; + } + D_80163288[playerId] = D_80164450[playerId]; } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800065D0.s") -#endif void set_places(void) { s32 temp_s2; @@ -3370,7 +3361,7 @@ s16 func_8000DBAC(Vec3f pos, s16 *waypointIndex, f32 speed) { GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000DBAC.s") #endif -void func_8000DD78(void) { +void set_bomb_kart_spawn_positions(void) { Collision *var_s2; f32 startingXPos; f32 startingZPos; @@ -3521,7 +3512,7 @@ void func_8000DF8C(s32 arg0) { temp_t2 = temp_t9 & 0xFFFF; sp4C = temp_t2; sp7E = temp_t9; - if ((temp_t2 != 0) && (((u16) temp_s0->unk_4A != 1) || (gCurrentCourseId == 0x0014))) { + if ((temp_t2 != 0) && (((u16) temp_s0->unk_4A != 1) || (gCurrentCourseId == COURSE_AWARD_CEREMONY))) { var_f22 = temp_s0->bombPos[0]; var_f20 = temp_s0->bombPos[1]; var_f24 = temp_s0->bombPos[2]; @@ -4077,7 +4068,7 @@ void func_8000F2DC(void) { func_80014BDC(); break; } - func_8000DD78(); + set_bomb_kart_spawn_positions(); func_8000EEDC(); } @@ -4794,50 +4785,35 @@ void func_80010DBC(s32 pathIndex) { } } -#ifdef MIPS_TO_C -//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Oct-09-2023 -s16 gCurrentCourseId; /* unable to generate initializer */ - void func_80010E6C(s32 pathIndex) { s16 *var_a2; - s16 temp_t0; s16 var_a0; - s32 var_a1; - s32 var_a3; - s32 var_t1; - u16 temp_v0; + s16 temp_t0; + s32 temp_v0; + s16 *temp; + s32 i, j; temp_v0 = gWaypointCountByPathIndex[pathIndex]; + temp = D_80164580[pathIndex]; var_a2 = D_801645A0[pathIndex]; - var_a3 = 0; - if ((s32) temp_v0 > 0) { - do { - var_a0 = 0; - var_a1 = 0; - if ((s32) temp_v0 > 0) { - var_t1 = var_a3; -loop_4: - temp_t0 = D_80164580[pathIndex][var_t1 % (s32) temp_v0]; - var_a1 += 1; - if ((temp_t0 == 1) || (temp_t0 == 0)) { - var_a0 += 1; - if (gCurrentCourseId != 0x0014) { - var_t1 += 1; - if (var_a1 != temp_v0) { - goto loop_4; - } - } - } + + for (i = 0; i < temp_v0; i++) { + var_a0 = 0; + for (j = 0; j < temp_v0; j++) { + temp_t0 = temp[(i + j) % temp_v0]; + if ((temp_t0 == 1) || (temp_t0 == 0)) { + var_a0 += 1; + } else { + break; } - var_a3 += 1; - *var_a2 = var_a0; - var_a2 += 2; - } while (var_a3 != temp_v0); + if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { + break; + } + } + *var_a2 = var_a0; + var_a2++; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80010E6C.s") -#endif f32 func_80010F40(f32 arg0, f32 arg1, f32 arg2, UNUSED s32 arg3) { arg1 = func_802AE1C0(arg0, 2000.0f, arg2); diff --git a/src/code_80005FD0.h b/src/code_80005FD0.h index 4e96ee64d6..7901ac986f 100644 --- a/src/code_80005FD0.h +++ b/src/code_80005FD0.h @@ -67,7 +67,8 @@ s32 func_80006018(f32, f32, f32, f32, f32, f32, f32, f32); void func_80006114(Vec3f, Vec3f, s16); s32 func_800061DC(Vec3f, f32, s32); void set_places(void); - +void func_80010E6C(s32 pathIndex); +void set_bomb_kart_spawn_positions(void); void func_800070F4(void); void func_800074D4(void); s32 func_80007BF8(u16, u16, u16, u16, u16); @@ -104,7 +105,7 @@ f32 func_8000D3B8(s32); s16 func_8000D6D0(Vec3f, s16*, f32, f32, s16, s16); s16 func_8000D940(Vec3f, s16*, f32, f32, s16); s16 func_8000DBAC(Vec3f, s16*, f32); -void func_8000DD78(void); +void set_bomb_kart_spawn_positions(void); void func_8000DF8C(s32); s32 func_8000ED14(s32, s16); diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index 1f7764a580..ad3a233164 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -88,9 +88,7 @@ void func_8006EA5C(void) { **/ } -#ifdef MIPS_TO_C -//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-29-2022 -extern ? D_8018C5F0; + extern s16 D_8018CF18; extern s16 D_8018CF20; extern s16 D_8018CF48; @@ -120,40 +118,31 @@ extern s16 D_8018D0E8; extern s16 D_8018D110; void func_8006EB10(void) { - s32 *var_v1; - s32 *var_v1_2; - s32 *var_v1_3; - s32 *var_v1_4; - s32 *var_v1_5; + s32 i = 0; + + for (i = 0; i < 128; i++) { + D_8018C1B0[i] = -1; + } - var_v1 = D_8018C1B0; - do { - var_v1 += 4; - var_v1->unk-4 = -1; - } while ((u32) var_v1 < (u32) &D_8018C3B0); - var_v1_2 = D_8018C3F0; - do { - var_v1_2 += 4; - var_v1_2->unk-4 = -1; - } while ((u32) var_v1_2 < (u32) &D_8018C5F0); - var_v1_3 = D_8018C630; - do { - var_v1_3 += 4; - var_v1_3->unk-4 = -1; - } while ((u32) var_v1_3 < (u32) &D_8018C830); - var_v1_4 = D_8018C870; - do { - var_v1_4 += 4; - var_v1_4->unk-4 = -1; - } while ((u32) var_v1_4 < (u32) D_8018C970); - var_v1_5 = D_8018C970; - do { - var_v1_5 += 0x10; - var_v1_5->unk-10 = -1; - var_v1_5->unk-C = -1; - var_v1_5->unk-8 = -1; - var_v1_5->unk-4 = -1; - } while (var_v1_5 != D_8018CA70); + for (i = 0; i < 128; i++) { + D_8018C3F0[i] = -1; + } + + for (i = 0; i < 128; i++) { + D_8018C630[i] = -1; + } + + for (i = 0; i < 64; i++) { + D_8018C870[i] = -1; + } + + for (i = 0; i < 64; i += 4) { + D_8018C970[i + 0] = -1; + D_8018C970[i + 1] = -1; + D_8018C970[i + 2] = -1; + D_8018C970[i + 3] = -1; + } + D_8018CFA8 = 0; D_8018CF90 = D_8018CFA8; D_8018CF78 = D_8018CF90; @@ -188,9 +177,6 @@ void func_8006EB10(void) { D_80183E4C = D_80183E5C; D_80183E38 = D_80183E4C; } -#else -GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006EB10.s") -#endif void func_8006ED60() { bzero(gObjectList, OBJECT_LIST_SIZE * sizeof(Objects));