diff --git a/asm/non_matchings/camera/func_8001CA78.s b/asm/non_matchings/camera/func_8001CA78.s deleted file mode 100644 index 372ce8626..000000000 --- a/asm/non_matchings/camera/func_8001CA78.s +++ /dev/null @@ -1,162 +0,0 @@ -glabel func_8001CA78 -/* 01D678 8001CA78 27BDFF68 */ addiu $sp, $sp, -0x98 -/* 01D67C 8001CA7C AFBF0034 */ sw $ra, 0x34($sp) -/* 01D680 8001CA80 AFB20030 */ sw $s2, 0x30($sp) -/* 01D684 8001CA84 AFB1002C */ sw $s1, 0x2c($sp) -/* 01D688 8001CA88 AFB00028 */ sw $s0, 0x28($sp) -/* 01D68C 8001CA8C F7B40020 */ sdc1 $f20, 0x20($sp) -/* 01D690 8001CA90 AFA40098 */ sw $a0, 0x98($sp) -/* 01D694 8001CA94 AFA700A4 */ sw $a3, 0xa4($sp) -/* 01D698 8001CA98 C4A40030 */ lwc1 $f4, 0x30($a1) -/* 01D69C 8001CA9C 3C0E8016 */ lui $t6, %hi(gWaypointCountByPathIndex) # $t6, 0x8016 -/* 01D6A0 8001CAA0 3C198016 */ lui $t9, %hi(D_80164550) # $t9, 0x8016 -/* 01D6A4 8001CAA4 E7A40068 */ swc1 $f4, 0x68($sp) -/* 01D6A8 8001CAA8 C4A60034 */ lwc1 $f6, 0x34($a1) -/* 01D6AC 8001CAAC 8F394550 */ lw $t9, %lo(D_80164550)($t9) -/* 01D6B0 8001CAB0 95CE45C8 */ lhu $t6, %lo(gWaypointCountByPathIndex)($t6) -/* 01D6B4 8001CAB4 E7A6006C */ swc1 $f6, 0x6c($sp) -/* 01D6B8 8001CAB8 C4A80038 */ lwc1 $f8, 0x38($a1) -/* 01D6BC 8001CABC 44800000 */ mtc1 $zero, $f0 -/* 01D6C0 8001CAC0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 01D6C4 8001CAC4 E7A80070 */ swc1 $f8, 0x70($sp) -/* 01D6C8 8001CAC8 C4AA003C */ lwc1 $f10, 0x3c($a1) -/* 01D6CC 8001CACC 4481A000 */ mtc1 $at, $f20 -/* 01D6D0 8001CAD0 00A08025 */ move $s0, $a1 -/* 01D6D4 8001CAD4 E7AA005C */ swc1 $f10, 0x5c($sp) -/* 01D6D8 8001CAD8 C4A40040 */ lwc1 $f4, 0x40($a1) -/* 01D6DC 8001CADC 00C08825 */ move $s1, $a2 -/* 01D6E0 8001CAE0 25CFFFF6 */ addiu $t7, $t6, -0xa -/* 01D6E4 8001CAE4 E7A40060 */ swc1 $f4, 0x60($sp) -/* 01D6E8 8001CAE8 C4A60044 */ lwc1 $f6, 0x44($a1) -/* 01D6EC 8001CAEC 000FC0C0 */ sll $t8, $t7, 3 -/* 01D6F0 8001CAF0 24088000 */ li $t0, -32768 -/* 01D6F4 8001CAF4 E7A60064 */ swc1 $f6, 0x64($sp) -/* 01D6F8 8001CAF8 C4A8000C */ lwc1 $f8, 0xc($a1) -/* 01D6FC 8001CAFC 44070000 */ mfc1 $a3, $f0 -/* 01D700 8001CB00 27A40074 */ addiu $a0, $sp, 0x74 -/* 01D704 8001CB04 E4C80000 */ swc1 $f8, ($a2) -/* 01D708 8001CB08 C4AA0010 */ lwc1 $f10, 0x10($a1) -/* 01D70C 8001CB0C 03199021 */ addu $s2, $t8, $t9 -/* 01D710 8001CB10 E4CA0004 */ swc1 $f10, 4($a2) -/* 01D714 8001CB14 C4A40014 */ lwc1 $f4, 0x14($a1) -/* 01D718 8001CB18 44050000 */ mfc1 $a1, $f0 -/* 01D71C 8001CB1C E4C40008 */ swc1 $f4, 8($a2) -/* 01D720 8001CB20 4406A000 */ mfc1 $a2, $f20 -/* 01D724 8001CB24 0C0AD950 */ jal func_802B6540 -/* 01D728 8001CB28 AFA80010 */ sw $t0, 0x10($sp) -/* 01D72C 8001CB2C 27A4005C */ addiu $a0, $sp, 0x5c -/* 01D730 8001CB30 0C0AD8EE */ jal func_802B63B8 -/* 01D734 8001CB34 27A50074 */ addiu $a1, $sp, 0x74 -/* 01D738 8001CB38 3C09800E */ lui $t1, %hi(gCurrentCourseId) # $t1, 0x800e -/* 01D73C 8001CB3C 8529C5A0 */ lh $t1, %lo(gCurrentCourseId)($t1) -/* 01D740 8001CB40 2401000A */ li $at, 10 -/* 01D744 8001CB44 C7A40064 */ lwc1 $f4, 0x64($sp) -/* 01D748 8001CB48 55210004 */ bnel $t1, $at, .L8001CB5C -/* 01D74C 8001CB4C 864A0000 */ lh $t2, ($s2) -/* 01D750 8001CB50 10000007 */ b .L8001CB70 -/* 01D754 8001CB54 C7AE005C */ lwc1 $f14, 0x5c($sp) -/* 01D758 8001CB58 864A0000 */ lh $t2, ($s2) -.L8001CB5C: -/* 01D75C 8001CB5C C7A6005C */ lwc1 $f6, 0x5c($sp) -/* 01D760 8001CB60 448A4000 */ mtc1 $t2, $f8 -/* 01D764 8001CB64 00000000 */ nop -/* 01D768 8001CB68 468042A0 */ cvt.s.w $f10, $f8 -/* 01D76C 8001CB6C 460A3380 */ add.s $f14, $f6, $f10 -.L8001CB70: -/* 01D770 8001CB70 864B0002 */ lh $t3, 2($s2) -/* 01D774 8001CB74 3C018016 */ lui $at, %hi(D_8016524C) # $at, 0x8016 -/* 01D778 8001CB78 C428524C */ lwc1 $f8, %lo(D_8016524C)($at) -/* 01D77C 8001CB7C 448B3000 */ mtc1 $t3, $f6 -/* 01D780 8001CB80 3C018016 */ lui $at, %hi(D_80164A30) # $at, 0x8016 -/* 01D784 8001CB84 46082400 */ add.s $f16, $f4, $f8 -/* 01D788 8001CB88 C4244A30 */ lwc1 $f4, %lo(D_80164A30)($at) -/* 01D78C 8001CB8C 27A40068 */ addiu $a0, $sp, 0x68 -/* 01D790 8001CB90 468032A0 */ cvt.s.w $f10, $f6 -/* 01D794 8001CB94 C7A60060 */ lwc1 $f6, 0x60($sp) -/* 01D798 8001CB98 27A50074 */ addiu $a1, $sp, 0x74 -/* 01D79C 8001CB9C 46045200 */ add.s $f8, $f10, $f4 -/* 01D7A0 8001CBA0 C604000C */ lwc1 $f4, 0xc($s0) -/* 01D7A4 8001CBA4 C62A0000 */ lwc1 $f10, ($s1) -/* 01D7A8 8001CBA8 46083480 */ add.s $f18, $f6, $f8 -/* 01D7AC 8001CBAC 46047181 */ sub.s $f6, $f14, $f4 -/* 01D7B0 8001CBB0 46143202 */ mul.s $f8, $f6, $f20 -/* 01D7B4 8001CBB4 C6260004 */ lwc1 $f6, 4($s1) -/* 01D7B8 8001CBB8 46085100 */ add.s $f4, $f10, $f8 -/* 01D7BC 8001CBBC E6240000 */ swc1 $f4, ($s1) -/* 01D7C0 8001CBC0 C60A0010 */ lwc1 $f10, 0x10($s0) -/* 01D7C4 8001CBC4 460A9201 */ sub.s $f8, $f18, $f10 -/* 01D7C8 8001CBC8 46144102 */ mul.s $f4, $f8, $f20 -/* 01D7CC 8001CBCC C6280008 */ lwc1 $f8, 8($s1) -/* 01D7D0 8001CBD0 46043280 */ add.s $f10, $f6, $f4 -/* 01D7D4 8001CBD4 E62A0004 */ swc1 $f10, 4($s1) -/* 01D7D8 8001CBD8 C6060014 */ lwc1 $f6, 0x14($s0) -/* 01D7DC 8001CBDC 46068101 */ sub.s $f4, $f16, $f6 -/* 01D7E0 8001CBE0 46142282 */ mul.s $f10, $f4, $f20 -/* 01D7E4 8001CBE4 460A4180 */ add.s $f6, $f8, $f10 -/* 01D7E8 8001CBE8 0C0AD8EE */ jal func_802B63B8 -/* 01D7EC 8001CBEC E6260008 */ swc1 $f6, 8($s1) -/* 01D7F0 8001CBF0 3C0C800E */ lui $t4, %hi(gCurrentCourseId) # $t4, 0x800e -/* 01D7F4 8001CBF4 858CC5A0 */ lh $t4, %lo(gCurrentCourseId)($t4) -/* 01D7F8 8001CBF8 3C048016 */ lui $a0, %hi(D_80164A30) # $a0, 0x8016 -/* 01D7FC 8001CBFC 2401000A */ li $at, 10 -/* 01D800 8001CC00 15810003 */ bne $t4, $at, .L8001CC10 -/* 01D804 8001CC04 24844A30 */ addiu $a0, %lo(D_80164A30) # addiu $a0, $a0, 0x4a30 -/* 01D808 8001CC08 10000007 */ b .L8001CC28 -/* 01D80C 8001CC0C C7AE0068 */ lwc1 $f14, 0x68($sp) -.L8001CC10: -/* 01D810 8001CC10 864D0000 */ lh $t5, ($s2) -/* 01D814 8001CC14 C7A40068 */ lwc1 $f4, 0x68($sp) -/* 01D818 8001CC18 448D4000 */ mtc1 $t5, $f8 -/* 01D81C 8001CC1C 00000000 */ nop -/* 01D820 8001CC20 468042A0 */ cvt.s.w $f10, $f8 -/* 01D824 8001CC24 460A2380 */ add.s $f14, $f4, $f10 -.L8001CC28: -/* 01D828 8001CC28 864E0002 */ lh $t6, 2($s2) -/* 01D82C 8001CC2C 3C018016 */ lui $at, %hi(D_8016524C) # $at, 0x8016 -/* 01D830 8001CC30 C428524C */ lwc1 $f8, %lo(D_8016524C)($at) -/* 01D834 8001CC34 448E2000 */ mtc1 $t6, $f4 -/* 01D838 8001CC38 C7A60070 */ lwc1 $f6, 0x70($sp) -/* 01D83C 8001CC3C 3C0140C0 */ li $at, 0x40C00000 # 6.000000 -/* 01D840 8001CC40 468022A0 */ cvt.s.w $f10, $f4 -/* 01D844 8001CC44 44812000 */ mtc1 $at, $f4 -/* 01D848 8001CC48 3C063CA3 */ lui $a2, (0x3CA3D70A >> 16) # lui $a2, 0x3ca3 -/* 01D84C 8001CC4C 34C6D70A */ ori $a2, (0x3CA3D70A & 0xFFFF) # ori $a2, $a2, 0xd70a -/* 01D850 8001CC50 E7AE004C */ swc1 $f14, 0x4c($sp) -/* 01D854 8001CC54 46083400 */ add.s $f16, $f6, $f8 -/* 01D858 8001CC58 C4860000 */ lwc1 $f6, ($a0) -/* 01D85C 8001CC5C 24050000 */ li $a1, 0 -/* 01D860 8001CC60 46065200 */ add.s $f8, $f10, $f6 -/* 01D864 8001CC64 C7A6006C */ lwc1 $f6, 0x6c($sp) -/* 01D868 8001CC68 E7B00044 */ swc1 $f16, 0x44($sp) -/* 01D86C 8001CC6C 46044280 */ add.s $f10, $f8, $f4 -/* 01D870 8001CC70 460A3480 */ add.s $f18, $f6, $f10 -/* 01D874 8001CC74 0C008973 */ jal move_f32_towards -/* 01D878 8001CC78 E7B20048 */ swc1 $f18, 0x48($sp) -/* 01D87C 8001CC7C C7AE004C */ lwc1 $f14, 0x4c($sp) -/* 01D880 8001CC80 C6000000 */ lwc1 $f0, ($s0) -/* 01D884 8001CC84 8FAF00A4 */ lw $t7, 0xa4($sp) -/* 01D888 8001CC88 C7B00044 */ lwc1 $f16, 0x44($sp) -/* 01D88C 8001CC8C 46007201 */ sub.s $f8, $f14, $f0 -/* 01D890 8001CC90 C7B20048 */ lwc1 $f18, 0x48($sp) -/* 01D894 8001CC94 46144102 */ mul.s $f4, $f8, $f20 -/* 01D898 8001CC98 46002180 */ add.s $f6, $f4, $f0 -/* 01D89C 8001CC9C E5E60000 */ swc1 $f6, ($t7) -/* 01D8A0 8001CCA0 C6020004 */ lwc1 $f2, 4($s0) -/* 01D8A4 8001CCA4 8FB800A8 */ lw $t8, 0xa8($sp) -/* 01D8A8 8001CCA8 46029281 */ sub.s $f10, $f18, $f2 -/* 01D8AC 8001CCAC 46145202 */ mul.s $f8, $f10, $f20 -/* 01D8B0 8001CCB0 46024100 */ add.s $f4, $f8, $f2 -/* 01D8B4 8001CCB4 E7040000 */ swc1 $f4, ($t8) -/* 01D8B8 8001CCB8 C60C0008 */ lwc1 $f12, 8($s0) -/* 01D8BC 8001CCBC 8FB900AC */ lw $t9, 0xac($sp) -/* 01D8C0 8001CCC0 460C8181 */ sub.s $f6, $f16, $f12 -/* 01D8C4 8001CCC4 46143282 */ mul.s $f10, $f6, $f20 -/* 01D8C8 8001CCC8 460C5200 */ add.s $f8, $f10, $f12 -/* 01D8CC 8001CCCC E7280000 */ swc1 $f8, ($t9) -/* 01D8D0 8001CCD0 8FBF0034 */ lw $ra, 0x34($sp) -/* 01D8D4 8001CCD4 8FB20030 */ lw $s2, 0x30($sp) -/* 01D8D8 8001CCD8 8FB1002C */ lw $s1, 0x2c($sp) -/* 01D8DC 8001CCDC 8FB00028 */ lw $s0, 0x28($sp) -/* 01D8E0 8001CCE0 D7B40020 */ ldc1 $f20, 0x20($sp) -/* 01D8E4 8001CCE4 03E00008 */ jr $ra -/* 01D8E8 8001CCE8 27BD0098 */ addiu $sp, $sp, 0x98 diff --git a/asm/non_matchings/camera/func_8001E0C4.s b/asm/non_matchings/camera/func_8001E0C4.s deleted file mode 100644 index d133d696d..000000000 --- a/asm/non_matchings/camera/func_8001E0C4.s +++ /dev/null @@ -1,238 +0,0 @@ -glabel func_8001E0C4 -/* 01ECC4 8001E0C4 27BDFF60 */ addiu $sp, $sp, -0xa0 -/* 01ECC8 8001E0C8 AFBF002C */ sw $ra, 0x2c($sp) -/* 01ECCC 8001E0CC AFB00028 */ sw $s0, 0x28($sp) -/* 01ECD0 8001E0D0 AFA600A8 */ sw $a2, 0xa8($sp) -/* 01ECD4 8001E0D4 84A20078 */ lh $v0, 0x78($a1) -/* 01ECD8 8001E0D8 00808025 */ move $s0, $a0 -/* 01ECDC 8001E0DC 00A03825 */ move $a3, $a1 -/* 01ECE0 8001E0E0 14400003 */ bnez $v0, .L8001E0F0 -/* 01ECE4 8001E0E4 2604002C */ addiu $a0, $s0, 0x2c -/* 01ECE8 8001E0E8 10000010 */ b .L8001E12C -/* 01ECEC 8001E0EC 24060064 */ li $a2, 100 -.L8001E0F0: -/* 01ECF0 8001E0F0 04410009 */ bgez $v0, .L8001E118 -/* 01ECF4 8001E0F4 24010003 */ li $at, 3 -/* 01ECF8 8001E0F8 24010003 */ li $at, 3 -/* 01ECFC 8001E0FC 0041001A */ div $zero, $v0, $at -/* 01ED00 8001E100 00007012 */ mflo $t6 -/* 01ED04 8001E104 240F0087 */ li $t7, 135 -/* 01ED08 8001E108 01EE3023 */ subu $a2, $t7, $t6 -/* 01ED0C 8001E10C 0006C400 */ sll $t8, $a2, 0x10 -/* 01ED10 8001E110 10000006 */ b .L8001E12C -/* 01ED14 8001E114 00183403 */ sra $a2, $t8, 0x10 -.L8001E118: -/* 01ED18 8001E118 0041001A */ div $zero, $v0, $at -/* 01ED1C 8001E11C 00003012 */ mflo $a2 -/* 01ED20 8001E120 24C60087 */ addiu $a2, $a2, 0x87 -/* 01ED24 8001E124 00064400 */ sll $t0, $a2, 0x10 -/* 01ED28 8001E128 00083403 */ sra $a2, $t0, 0x10 -.L8001E12C: -/* 01ED2C 8001E12C 84E5002E */ lh $a1, 0x2e($a3) -/* 01ED30 8001E130 0C00893C */ jal func_800224F0 -/* 01ED34 8001E134 AFA700A4 */ sw $a3, 0xa4($sp) -/* 01ED38 8001E138 27AA0070 */ addiu $t2, $sp, 0x70 -/* 01ED3C 8001E13C 27AB006C */ addiu $t3, $sp, 0x6c -/* 01ED40 8001E140 AFAB0014 */ sw $t3, 0x14($sp) -/* 01ED44 8001E144 AFAA0010 */ sw $t2, 0x10($sp) -/* 01ED48 8001E148 860C002C */ lh $t4, 0x2c($s0) -/* 01ED4C 8001E14C 83AD00AB */ lb $t5, 0xab($sp) -/* 01ED50 8001E150 8FA400A4 */ lw $a0, 0xa4($sp) -/* 01ED54 8001E154 02002825 */ move $a1, $s0 -/* 01ED58 8001E158 27A60060 */ addiu $a2, $sp, 0x60 -/* 01ED5C 8001E15C 27A70074 */ addiu $a3, $sp, 0x74 -/* 01ED60 8001E160 AFAC0018 */ sw $t4, 0x18($sp) -/* 01ED64 8001E164 0C00729E */ jal func_8001CA78 -/* 01ED68 8001E168 AFAD001C */ sw $t5, 0x1c($sp) -/* 01ED6C 8001E16C 24180003 */ li $t8, 3 -/* 01ED70 8001E170 44982000 */ mtc1 $t8, $f4 -/* 01ED74 8001E174 960F002A */ lhu $t7, 0x2a($s0) -/* 01ED78 8001E178 26040054 */ addiu $a0, $s0, 0x54 -/* 01ED7C 8001E17C 46802120 */ cvt.s.w $f4, $f4 -/* 01ED80 8001E180 31EEFFFB */ andi $t6, $t7, 0xfffb -/* 01ED84 8001E184 A60E002A */ sh $t6, 0x2a($s0) -/* 01ED88 8001E188 C7A6006C */ lwc1 $f6, 0x6c($sp) -/* 01ED8C 8001E18C 8FA70070 */ lw $a3, 0x70($sp) -/* 01ED90 8001E190 8FA60074 */ lw $a2, 0x74($sp) -/* 01ED94 8001E194 44052000 */ mfc1 $a1, $f4 -/* 01ED98 8001E198 0C0AB772 */ jal func_802ADDC8 -/* 01ED9C 8001E19C E7A60010 */ swc1 $f6, 0x10($sp) -/* 01EDA0 8001E1A0 44806000 */ mtc1 $zero, $f12 -/* 01EDA4 8001E1A4 C6000068 */ lwc1 $f0, 0x68($s0) -/* 01EDA8 8001E1A8 00026C00 */ sll $t5, $v0, 0x10 -/* 01EDAC 8001E1AC 000D7C03 */ sra $t7, $t5, 0x10 -/* 01EDB0 8001E1B0 460C003C */ c.lt.s $f0, $f12 -/* 01EDB4 8001E1B4 00000000 */ nop -/* 01EDB8 8001E1B8 45020022 */ bc1fl .L8001E244 -/* 01EDBC 8001E1BC C6020060 */ lwc1 $f2, 0x60($s0) -/* 01EDC0 8001E1C0 C60A0084 */ lwc1 $f10, 0x84($s0) -/* 01EDC4 8001E1C4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 01EDC8 8001E1C8 44817000 */ mtc1 $at, $f14 -/* 01EDCC 8001E1CC 46005407 */ neg.s $f16, $f10 -/* 01EDD0 8001E1D0 C7A80074 */ lwc1 $f8, 0x74($sp) -/* 01EDD4 8001E1D4 46008482 */ mul.s $f18, $f16, $f0 -/* 01EDD8 8001E1D8 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 -/* 01EDDC 8001E1DC 460E9102 */ mul.s $f4, $f18, $f14 -/* 01EDE0 8001E1E0 46044180 */ add.s $f6, $f8, $f4 -/* 01EDE4 8001E1E4 44813800 */ mtc1 $at, $f7 -/* 01EDE8 8001E1E8 E7A60074 */ swc1 $f6, 0x74($sp) -/* 01EDEC 8001E1EC C60A0088 */ lwc1 $f10, 0x88($s0) -/* 01EDF0 8001E1F0 C6120068 */ lwc1 $f18, 0x68($s0) -/* 01EDF4 8001E1F4 44803000 */ mtc1 $zero, $f6 -/* 01EDF8 8001E1F8 46005407 */ neg.s $f16, $f10 -/* 01EDFC 8001E1FC 46128202 */ mul.s $f8, $f16, $f18 -/* 01EE00 8001E200 C7B00070 */ lwc1 $f16, 0x70($sp) -/* 01EE04 8001E204 460084A1 */ cvt.d.s $f18, $f16 -/* 01EE08 8001E208 46004121 */ cvt.d.s $f4, $f8 -/* 01EE0C 8001E20C 46262282 */ mul.d $f10, $f4, $f6 -/* 01EE10 8001E210 462A9200 */ add.d $f8, $f18, $f10 -/* 01EE14 8001E214 46204120 */ cvt.s.d $f4, $f8 -/* 01EE18 8001E218 E7A40070 */ swc1 $f4, 0x70($sp) -/* 01EE1C 8001E21C C606008C */ lwc1 $f6, 0x8c($s0) -/* 01EE20 8001E220 C6120068 */ lwc1 $f18, 0x68($s0) -/* 01EE24 8001E224 C7A4006C */ lwc1 $f4, 0x6c($sp) -/* 01EE28 8001E228 46003407 */ neg.s $f16, $f6 -/* 01EE2C 8001E22C 46128282 */ mul.s $f10, $f16, $f18 -/* 01EE30 8001E230 00000000 */ nop -/* 01EE34 8001E234 460E5202 */ mul.s $f8, $f10, $f14 -/* 01EE38 8001E238 46082180 */ add.s $f6, $f4, $f8 -/* 01EE3C 8001E23C E7A6006C */ swc1 $f6, 0x6c($sp) -/* 01EE40 8001E240 C6020060 */ lwc1 $f2, 0x60($s0) -.L8001E244: -/* 01EE44 8001E244 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 01EE48 8001E248 44817000 */ mtc1 $at, $f14 -/* 01EE4C 8001E24C 460C103C */ c.lt.s $f2, $f12 -/* 01EE50 8001E250 00000000 */ nop -/* 01EE54 8001E254 45020026 */ bc1fl .L8001E2F0 -/* 01EE58 8001E258 C6020064 */ lwc1 $f2, 0x64($s0) -/* 01EE5C 8001E25C C60A006C */ lwc1 $f10, 0x6c($s0) -/* 01EE60 8001E260 9608002A */ lhu $t0, 0x2a($s0) -/* 01EE64 8001E264 3C013FF8 */ li $at, 0x3FF80000 # 1.937500 -/* 01EE68 8001E268 46005107 */ neg.s $f4, $f10 -/* 01EE6C 8001E26C 35090006 */ ori $t1, $t0, 6 -/* 01EE70 8001E270 46022202 */ mul.s $f8, $f4, $f2 -/* 01EE74 8001E274 A609002A */ sh $t1, 0x2a($s0) -/* 01EE78 8001E278 C7B00074 */ lwc1 $f16, 0x74($sp) -/* 01EE7C 8001E27C 44810800 */ mtc1 $at, $f1 -/* 01EE80 8001E280 44800000 */ mtc1 $zero, $f0 -/* 01EE84 8001E284 460084A1 */ cvt.d.s $f18, $f16 -/* 01EE88 8001E288 460041A1 */ cvt.d.s $f6, $f8 -/* 01EE8C 8001E28C 46203402 */ mul.d $f16, $f6, $f0 -/* 01EE90 8001E290 46309280 */ add.d $f10, $f18, $f16 -/* 01EE94 8001E294 46205120 */ cvt.s.d $f4, $f10 -/* 01EE98 8001E298 E7A40074 */ swc1 $f4, 0x74($sp) -/* 01EE9C 8001E29C C6080070 */ lwc1 $f8, 0x70($s0) -/* 01EEA0 8001E2A0 C6120060 */ lwc1 $f18, 0x60($s0) -/* 01EEA4 8001E2A4 C7A40070 */ lwc1 $f4, 0x70($sp) -/* 01EEA8 8001E2A8 46004187 */ neg.s $f6, $f8 -/* 01EEAC 8001E2AC 46123402 */ mul.s $f16, $f6, $f18 -/* 01EEB0 8001E2B0 00000000 */ nop -/* 01EEB4 8001E2B4 460E8282 */ mul.s $f10, $f16, $f14 -/* 01EEB8 8001E2B8 460A2200 */ add.s $f8, $f4, $f10 -/* 01EEBC 8001E2BC E7A80070 */ swc1 $f8, 0x70($sp) -/* 01EEC0 8001E2C0 C6060074 */ lwc1 $f6, 0x74($s0) -/* 01EEC4 8001E2C4 C6100060 */ lwc1 $f16, 0x60($s0) -/* 01EEC8 8001E2C8 46003487 */ neg.s $f18, $f6 -/* 01EECC 8001E2CC C7A6006C */ lwc1 $f6, 0x6c($sp) -/* 01EED0 8001E2D0 46109102 */ mul.s $f4, $f18, $f16 -/* 01EED4 8001E2D4 460034A1 */ cvt.d.s $f18, $f6 -/* 01EED8 8001E2D8 460022A1 */ cvt.d.s $f10, $f4 -/* 01EEDC 8001E2DC 46205202 */ mul.d $f8, $f10, $f0 -/* 01EEE0 8001E2E0 46289400 */ add.d $f16, $f18, $f8 -/* 01EEE4 8001E2E4 46208120 */ cvt.s.d $f4, $f16 -/* 01EEE8 8001E2E8 E7A4006C */ swc1 $f4, 0x6c($sp) -/* 01EEEC 8001E2EC C6020064 */ lwc1 $f2, 0x64($s0) -.L8001E2F0: -/* 01EEF0 8001E2F0 3C013FF8 */ li $at, 0x3FF80000 # 1.937500 -/* 01EEF4 8001E2F4 44810800 */ mtc1 $at, $f1 -/* 01EEF8 8001E2F8 460C103C */ c.lt.s $f2, $f12 -/* 01EEFC 8001E2FC 44800000 */ mtc1 $zero, $f0 -/* 01EF00 8001E300 45000022 */ bc1f .L8001E38C -/* 01EF04 8001E304 00000000 */ nop -/* 01EF08 8001E308 C6120078 */ lwc1 $f18, 0x78($s0) -/* 01EF0C 8001E30C 960B002A */ lhu $t3, 0x2a($s0) -/* 01EF10 8001E310 46009207 */ neg.s $f8, $f18 -/* 01EF14 8001E314 356C0006 */ ori $t4, $t3, 6 -/* 01EF18 8001E318 46024402 */ mul.s $f16, $f8, $f2 -/* 01EF1C 8001E31C A60C002A */ sh $t4, 0x2a($s0) -/* 01EF20 8001E320 C7AA0074 */ lwc1 $f10, 0x74($sp) -/* 01EF24 8001E324 460051A1 */ cvt.d.s $f6, $f10 -/* 01EF28 8001E328 46008121 */ cvt.d.s $f4, $f16 -/* 01EF2C 8001E32C 46202282 */ mul.d $f10, $f4, $f0 -/* 01EF30 8001E330 462A3480 */ add.d $f18, $f6, $f10 -/* 01EF34 8001E334 46209220 */ cvt.s.d $f8, $f18 -/* 01EF38 8001E338 E7A80074 */ swc1 $f8, 0x74($sp) -/* 01EF3C 8001E33C C610007C */ lwc1 $f16, 0x7c($s0) -/* 01EF40 8001E340 C6060064 */ lwc1 $f6, 0x64($s0) -/* 01EF44 8001E344 C7A80070 */ lwc1 $f8, 0x70($sp) -/* 01EF48 8001E348 46008107 */ neg.s $f4, $f16 -/* 01EF4C 8001E34C 46062282 */ mul.s $f10, $f4, $f6 -/* 01EF50 8001E350 00000000 */ nop -/* 01EF54 8001E354 460E5482 */ mul.s $f18, $f10, $f14 -/* 01EF58 8001E358 46124400 */ add.s $f16, $f8, $f18 -/* 01EF5C 8001E35C E7B00070 */ swc1 $f16, 0x70($sp) -/* 01EF60 8001E360 C6040080 */ lwc1 $f4, 0x80($s0) -/* 01EF64 8001E364 C60A0064 */ lwc1 $f10, 0x64($s0) -/* 01EF68 8001E368 46002187 */ neg.s $f6, $f4 -/* 01EF6C 8001E36C C7A4006C */ lwc1 $f4, 0x6c($sp) -/* 01EF70 8001E370 460A3202 */ mul.s $f8, $f6, $f10 -/* 01EF74 8001E374 460021A1 */ cvt.d.s $f6, $f4 -/* 01EF78 8001E378 460044A1 */ cvt.d.s $f18, $f8 -/* 01EF7C 8001E37C 46209402 */ mul.d $f16, $f18, $f0 -/* 01EF80 8001E380 46303280 */ add.d $f10, $f6, $f16 -/* 01EF84 8001E384 46205220 */ cvt.s.d $f8, $f10 -/* 01EF88 8001E388 E7A8006C */ swc1 $f8, 0x6c($sp) -.L8001E38C: -/* 01EF8C 8001E38C 55E00009 */ bnel $t7, $zero, .L8001E3B4 -/* 01EF90 8001E390 C7B20060 */ lwc1 $f18, 0x60($sp) -/* 01EF94 8001E394 960E002A */ lhu $t6, 0x2a($s0) -/* 01EF98 8001E398 24010002 */ li $at, 2 -/* 01EF9C 8001E39C 31D80002 */ andi $t8, $t6, 2 -/* 01EFA0 8001E3A0 53010004 */ beql $t8, $at, .L8001E3B4 -/* 01EFA4 8001E3A4 C7B20060 */ lwc1 $f18, 0x60($sp) -/* 01EFA8 8001E3A8 8619002C */ lh $t9, 0x2c($s0) -/* 01EFAC 8001E3AC A61900AC */ sh $t9, 0xac($s0) -/* 01EFB0 8001E3B0 C7B20060 */ lwc1 $f18, 0x60($sp) -.L8001E3B4: -/* 01EFB4 8001E3B4 E612000C */ swc1 $f18, 0xc($s0) -/* 01EFB8 8001E3B8 C7A40064 */ lwc1 $f4, 0x64($sp) -/* 01EFBC 8001E3BC C612000C */ lwc1 $f18, 0xc($s0) -/* 01EFC0 8001E3C0 E6040010 */ swc1 $f4, 0x10($s0) -/* 01EFC4 8001E3C4 C7A60068 */ lwc1 $f6, 0x68($sp) -/* 01EFC8 8001E3C8 E6060014 */ swc1 $f6, 0x14($s0) -/* 01EFCC 8001E3CC C7B00074 */ lwc1 $f16, 0x74($sp) -/* 01EFD0 8001E3D0 C6060010 */ lwc1 $f6, 0x10($s0) -/* 01EFD4 8001E3D4 E6100000 */ swc1 $f16, ($s0) -/* 01EFD8 8001E3D8 C7AA0070 */ lwc1 $f10, 0x70($sp) -/* 01EFDC 8001E3DC C6040000 */ lwc1 $f4, ($s0) -/* 01EFE0 8001E3E0 E60A0004 */ swc1 $f10, 4($s0) -/* 01EFE4 8001E3E4 C6100004 */ lwc1 $f16, 4($s0) -/* 01EFE8 8001E3E8 C7A8006C */ lwc1 $f8, 0x6c($sp) -/* 01EFEC 8001E3EC 46049301 */ sub.s $f12, $f18, $f4 -/* 01EFF0 8001E3F0 E6080008 */ swc1 $f8, 8($s0) -/* 01EFF4 8001E3F4 46103281 */ sub.s $f10, $f6, $f16 -/* 01EFF8 8001E3F8 E7AA0080 */ swc1 $f10, 0x80($sp) -/* 01EFFC 8001E3FC C6120008 */ lwc1 $f18, 8($s0) -/* 01F000 8001E400 C6080014 */ lwc1 $f8, 0x14($s0) -/* 01F004 8001E404 E7AC0084 */ swc1 $f12, 0x84($sp) -/* 01F008 8001E408 46124381 */ sub.s $f14, $f8, $f18 -/* 01F00C 8001E40C 0C0ADE0C */ jal atan2s -/* 01F010 8001E410 E7AE007C */ swc1 $f14, 0x7c($sp) -/* 01F014 8001E414 C7A00084 */ lwc1 $f0, 0x84($sp) -/* 01F018 8001E418 C7AE007C */ lwc1 $f14, 0x7c($sp) -/* 01F01C 8001E41C A6020026 */ sh $v0, 0x26($s0) -/* 01F020 8001E420 46000102 */ mul.s $f4, $f0, $f0 -/* 01F024 8001E424 00000000 */ nop -/* 01F028 8001E428 460E7182 */ mul.s $f6, $f14, $f14 -/* 01F02C 8001E42C 0C033850 */ jal sqrtf -/* 01F030 8001E430 46062300 */ add.s $f12, $f4, $f6 -/* 01F034 8001E434 46000306 */ mov.s $f12, $f0 -/* 01F038 8001E438 0C0ADE0C */ jal atan2s -/* 01F03C 8001E43C C7AE0080 */ lwc1 $f14, 0x80($sp) -/* 01F040 8001E440 A6020024 */ sh $v0, 0x24($s0) -/* 01F044 8001E444 A6000028 */ sh $zero, 0x28($s0) -/* 01F048 8001E448 8FBF002C */ lw $ra, 0x2c($sp) -/* 01F04C 8001E44C 8FB00028 */ lw $s0, 0x28($sp) -/* 01F050 8001E450 27BD00A0 */ addiu $sp, $sp, 0xa0 -/* 01F054 8001E454 03E00008 */ jr $ra -/* 01F058 8001E458 00000000 */ nop diff --git a/asm/non_matchings/camera/func_8001F87C.s b/asm/non_matchings/camera/func_8001F87C.s deleted file mode 100644 index 60e72bceb..000000000 --- a/asm/non_matchings/camera/func_8001F87C.s +++ /dev/null @@ -1,70 +0,0 @@ -glabel func_8001F87C -/* 02047C 8001F87C 3C0E800E */ lui $t6, %hi(gActiveScreenMode) # $t6, 0x800e -/* 020480 8001F880 8DCEC52C */ lw $t6, %lo(gActiveScreenMode)($t6) -/* 020484 8001F884 27BDFFF0 */ addiu $sp, $sp, -0x10 -/* 020488 8001F888 3C02800E */ lui $v0, %hi(gPlayerOne) # $v0, 0x800e -/* 02048C 8001F88C AFB2000C */ sw $s2, 0xc($sp) -/* 020490 8001F890 AFB10008 */ sw $s1, 8($sp) -/* 020494 8001F894 AFB00004 */ sw $s0, 4($sp) -/* 020498 8001F898 15C00033 */ bnez $t6, .L8001F968 -/* 02049C 8001F89C 8C42C4DC */ lw $v0, %lo(gPlayerOne)($v0) -/* 0204A0 8001F8A0 3C0F800E */ lui $t7, %hi(gModeSelection) # $t7, 0x800e -/* 0204A4 8001F8A4 8DEFC53C */ lw $t7, %lo(gModeSelection)($t7) -/* 0204A8 8001F8A8 00002825 */ move $a1, $zero -/* 0204AC 8001F8AC 00403025 */ move $a2, $v0 -/* 0204B0 8001F8B0 15E0002D */ bnez $t7, .L8001F968 -/* 0204B4 8001F8B4 24126EC0 */ li $s2, 28352 -/* 0204B8 8001F8B8 3C108016 */ lui $s0, %hi(cameras) # $s0, 0x8016 -/* 0204BC 8001F8BC 3C0C8015 */ lui $t4, %hi(D_80152300) # $t4, 0x8015 -/* 0204C0 8001F8C0 3C0A8016 */ lui $t2, %hi(D_80164A28) # $t2, 0x8016 -/* 0204C4 8001F8C4 3C078016 */ lui $a3, %hi(D_80164A2C) # $a3, 0x8016 -/* 0204C8 8001F8C8 24E74A2C */ addiu $a3, %lo(D_80164A2C) # addiu $a3, $a3, 0x4a2c -/* 0204CC 8001F8CC 254A4A28 */ addiu $t2, %lo(D_80164A28) # addiu $t2, $t2, 0x4a28 -/* 0204D0 8001F8D0 258C2300 */ addiu $t4, %lo(D_80152300) # addiu $t4, $t4, 0x2300 -/* 0204D4 8001F8D4 261046F0 */ addiu $s0, %lo(cameras) # addiu $s0, $s0, 0x46f0 -/* 0204D8 8001F8D8 241100B8 */ li $s1, 184 -/* 0204DC 8001F8DC 240D0001 */ li $t5, 1 -/* 0204E0 8001F8E0 240B0002 */ li $t3, 2 -/* 0204E4 8001F8E4 2409003C */ li $t1, 60 -/* 0204E8 8001F8E8 240860E8 */ li $t0, 24808 -/* 0204EC 8001F8EC 240360E8 */ li $v1, 24808 -.L8001F8F0: -/* 0204F0 8001F8F0 94C20000 */ lhu $v0, ($a2) -/* 0204F4 8001F8F4 30580200 */ andi $t8, $v0, 0x200 -/* 0204F8 8001F8F8 1700001B */ bnez $t8, .L8001F968 -/* 0204FC 8001F8FC 30590080 */ andi $t9, $v0, 0x80 -/* 020500 8001F900 5720001A */ bnel $t9, $zero, .L8001F96C -/* 020504 8001F904 8FB00004 */ lw $s0, 4($sp) -/* 020508 8001F908 14A30004 */ bne $a1, $v1, .L8001F91C -/* 02050C 8001F90C 00000000 */ nop -/* 020510 8001F910 8CEE0000 */ lw $t6, ($a3) -/* 020514 8001F914 25CF0001 */ addiu $t7, $t6, 1 -/* 020518 8001F918 ACEF0000 */ sw $t7, ($a3) -.L8001F91C: -/* 02051C 8001F91C 54A80010 */ bnel $a1, $t0, .L8001F960 -/* 020520 8001F920 24A50DD8 */ addiu $a1, $a1, 0xdd8 -/* 020524 8001F924 8CF80000 */ lw $t8, ($a3) -/* 020528 8001F928 5538000D */ bnel $t1, $t8, .L8001F960 -/* 02052C 8001F92C 24A50DD8 */ addiu $a1, $a1, 0xdd8 -/* 020530 8001F930 00910019 */ multu $a0, $s1 -/* 020534 8001F934 0004C840 */ sll $t9, $a0, 1 -/* 020538 8001F938 01997021 */ addu $t6, $t4, $t9 -/* 02053C 8001F93C AD4B0000 */ sw $t3, ($t2) -/* 020540 8001F940 A5CD0000 */ sh $t5, ($t6) -/* 020544 8001F944 84D8002E */ lh $t8, 0x2e($a2) -/* 020548 8001F948 00007812 */ mflo $t7 -/* 02054C 8001F94C 020F1021 */ addu $v0, $s0, $t7 -/* 020550 8001F950 A4580026 */ sh $t8, 0x26($v0) -/* 020554 8001F954 84D9002E */ lh $t9, 0x2e($a2) -/* 020558 8001F958 A459002C */ sh $t9, 0x2c($v0) -/* 02055C 8001F95C 24A50DD8 */ addiu $a1, $a1, 0xdd8 -.L8001F960: -/* 020560 8001F960 14B2FFE3 */ bne $a1, $s2, .L8001F8F0 -/* 020564 8001F964 24C60DD8 */ addiu $a2, $a2, 0xdd8 -.L8001F968: -/* 020568 8001F968 8FB00004 */ lw $s0, 4($sp) -.L8001F96C: -/* 02056C 8001F96C 8FB10008 */ lw $s1, 8($sp) -/* 020570 8001F970 8FB2000C */ lw $s2, 0xc($sp) -/* 020574 8001F974 03E00008 */ jr $ra -/* 020578 8001F978 27BD0010 */ addiu $sp, $sp, 0x10 diff --git a/asm/non_matchings/code_80005FD0/func_80012DC0.s b/asm/non_matchings/code_80005FD0/func_80012DC0.s deleted file mode 100644 index aa7174b36..000000000 --- a/asm/non_matchings/code_80005FD0/func_80012DC0.s +++ /dev/null @@ -1,173 +0,0 @@ -glabel func_80012DC0 -/* 0139C0 80012DC0 27BDFF58 */ addiu $sp, $sp, -0xa8 -/* 0139C4 80012DC4 00047040 */ sll $t6, $a0, 1 -/* 0139C8 80012DC8 3C0F8016 */ lui $t7, %hi(D_801631E0) # 0x8016 -/* 0139CC 80012DCC 01EE7821 */ addu $t7, $t7, $t6 -/* 0139D0 80012DD0 95EF31E0 */ lhu $t7, %lo(D_801631E0)($t7) # 0x31e0($t7) -/* 0139D4 80012DD4 AFB30064 */ sw $s3, 0x64($sp) -/* 0139D8 80012DD8 24130001 */ li $s3, 1 -/* 0139DC 80012DDC AFB20060 */ sw $s2, 0x60($sp) -/* 0139E0 80012DE0 00A09025 */ move $s2, $a1 -/* 0139E4 80012DE4 AFBF007C */ sw $ra, 0x7c($sp) -/* 0139E8 80012DE8 AFBE0078 */ sw $fp, 0x78($sp) -/* 0139EC 80012DEC AFB70074 */ sw $s7, 0x74($sp) -/* 0139F0 80012DF0 AFB60070 */ sw $s6, 0x70($sp) -/* 0139F4 80012DF4 AFB5006C */ sw $s5, 0x6c($sp) -/* 0139F8 80012DF8 AFB40068 */ sw $s4, 0x68($sp) -/* 0139FC 80012DFC AFB1005C */ sw $s1, 0x5c($sp) -/* 013A00 80012E00 AFB00058 */ sw $s0, 0x58($sp) -/* 013A04 80012E04 F7BE0050 */ sdc1 $f30, 0x50($sp) -/* 013A08 80012E08 F7BC0048 */ sdc1 $f28, 0x48($sp) -/* 013A0C 80012E0C F7BA0040 */ sdc1 $f26, 0x40($sp) -/* 013A10 80012E10 F7B80038 */ sdc1 $f24, 0x38($sp) -/* 013A14 80012E14 F7B60030 */ sdc1 $f22, 0x30($sp) -/* 013A18 80012E18 126F007C */ beq $s3, $t7, .L8001300C -/* 013A1C 80012E1C F7B40028 */ sdc1 $f20, 0x28($sp) -/* 013A20 80012E20 8CB800BC */ lw $t8, 0xbc($a1) -/* 013A24 80012E24 3C088016 */ lui $t0, %hi(D_801635A0) # 0x8016 -/* 013A28 80012E28 251735A0 */ addiu $s7, $t0, %lo(D_801635A0) # 0x35a0 -/* 013A2C 80012E2C 0018C9C0 */ sll $t9, $t8, 7 -/* 013A30 80012E30 07200076 */ bltz $t9, .L8001300C -/* 013A34 80012E34 02E0B025 */ move $s6, $s7 -/* 013A38 80012E38 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 013A3C 80012E3C 4481F000 */ mtc1 $at, $f30 -/* 013A40 80012E40 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 013A44 80012E44 4481E000 */ mtc1 $at, $f28 -/* 013A48 80012E48 3C014059 */ li $at, 0x40590000 # 3.390625 -/* 013A4C 80012E4C 4481B800 */ mtc1 $at, $f23 -/* 013A50 80012E50 3C01C059 */ li $at, 0xC0590000 # -3.390625 -/* 013A54 80012E54 3C1E8016 */ lui $fp, %hi(D_801637B8) # $fp, 0x8016 -/* 013A58 80012E58 4481A800 */ mtc1 $at, $f21 -/* 013A5C 80012E5C 4480B000 */ mtc1 $zero, $f22 -/* 013A60 80012E60 4480A000 */ mtc1 $zero, $f20 -/* 013A64 80012E64 C4B80014 */ lwc1 $f24, 0x14($a1) -/* 013A68 80012E68 C4BA001C */ lwc1 $f26, 0x1c($a1) -/* 013A6C 80012E6C 27DE37B8 */ addiu $fp, %lo(D_801637B8) # addiu $fp, $fp, 0x37b8 -/* 013A70 80012E70 241500B4 */ li $s5, 180 -/* 013A74 80012E74 3C140040 */ lui $s4, 0x40 -.L80012E78: -/* 013A78 80012E78 C6D00004 */ lwc1 $f16, 4($s6) -/* 013A7C 80012E7C C6CE000C */ lwc1 $f14, 0xc($s6) -/* 013A80 80012E80 4610C081 */ sub.s $f2, $f24, $f16 -/* 013A84 80012E84 E7B00084 */ swc1 $f16, 0x84($sp) -/* 013A88 80012E88 460ED301 */ sub.s $f12, $f26, $f14 -/* 013A8C 80012E8C 46001021 */ cvt.d.s $f0, $f2 -/* 013A90 80012E90 4620A03C */ c.lt.d $f20, $f0 -/* 013A94 80012E94 00000000 */ nop -/* 013A98 80012E98 4502002F */ bc1fl .L80012F58 -/* 013A9C 80012E9C 00008825 */ move $s1, $zero -/* 013AA0 80012EA0 4636003C */ c.lt.d $f0, $f22 -/* 013AA4 80012EA4 00000000 */ nop -/* 013AA8 80012EA8 4502002B */ bc1fl .L80012F58 -/* 013AAC 80012EAC 00008825 */ move $s1, $zero -/* 013AB0 80012EB0 46006021 */ cvt.d.s $f0, $f12 -/* 013AB4 80012EB4 4620A03C */ c.lt.d $f20, $f0 -/* 013AB8 80012EB8 00000000 */ nop -/* 013ABC 80012EBC 45020026 */ bc1fl .L80012F58 -/* 013AC0 80012EC0 00008825 */ move $s1, $zero -/* 013AC4 80012EC4 4636003C */ c.lt.d $f0, $f22 -/* 013AC8 80012EC8 C7AC0084 */ lwc1 $f12, 0x84($sp) -/* 013ACC 80012ECC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 013AD0 80012ED0 45020021 */ bc1fl .L80012F58 -/* 013AD4 80012ED4 00008825 */ move $s1, $zero -/* 013AD8 80012ED8 44812000 */ mtc1 $at, $f4 -/* 013ADC 80012EDC 8EC60010 */ lw $a2, 0x10($s6) -/* 013AE0 80012EE0 8EC70018 */ lw $a3, 0x18($s6) -/* 013AE4 80012EE4 E7BC0014 */ swc1 $f28, 0x14($sp) -/* 013AE8 80012EE8 E7B80018 */ swc1 $f24, 0x18($sp) -/* 013AEC 80012EEC E7BA001C */ swc1 $f26, 0x1c($sp) -/* 013AF0 80012EF0 0C001806 */ jal func_80006018 -/* 013AF4 80012EF4 E7A40010 */ swc1 $f4, 0x10($sp) -/* 013AF8 80012EF8 54530005 */ bnel $v0, $s3, .L80012F10 -/* 013AFC 80012EFC 86CB0024 */ lh $t3, 0x24($s6) -/* 013B00 80012F00 8E49000C */ lw $t1, 0xc($s2) -/* 013B04 80012F04 01345025 */ or $t2, $t1, $s4 -/* 013B08 80012F08 AE4A000C */ sw $t2, 0xc($s2) -/* 013B0C 80012F0C 86CB0024 */ lh $t3, 0x24($s6) -.L80012F10: -/* 013B10 80012F10 26C20024 */ addiu $v0, $s6, 0x24 -/* 013B14 80012F14 566B0010 */ bnel $s3, $t3, .L80012F58 -/* 013B18 80012F18 00008825 */ move $s1, $zero -/* 013B1C 80012F1C C44C0004 */ lwc1 $f12, 4($v0) -/* 013B20 80012F20 C44E000C */ lwc1 $f14, 0xc($v0) -/* 013B24 80012F24 8C460010 */ lw $a2, 0x10($v0) -/* 013B28 80012F28 8C470018 */ lw $a3, 0x18($v0) -/* 013B2C 80012F2C E7BA001C */ swc1 $f26, 0x1c($sp) -/* 013B30 80012F30 E7B80018 */ swc1 $f24, 0x18($sp) -/* 013B34 80012F34 E7BC0014 */ swc1 $f28, 0x14($sp) -/* 013B38 80012F38 0C001806 */ jal func_80006018 -/* 013B3C 80012F3C E7BE0010 */ swc1 $f30, 0x10($sp) -/* 013B40 80012F40 54530005 */ bnel $v0, $s3, .L80012F58 -/* 013B44 80012F44 00008825 */ move $s1, $zero -/* 013B48 80012F48 8E4C000C */ lw $t4, 0xc($s2) -/* 013B4C 80012F4C 01946825 */ or $t5, $t4, $s4 -/* 013B50 80012F50 AE4D000C */ sw $t5, 0xc($s2) -/* 013B54 80012F54 00008825 */ move $s1, $zero -.L80012F58: -/* 013B58 80012F58 02E08025 */ move $s0, $s7 -.L80012F5C: -/* 013B5C 80012F5C 860E0048 */ lh $t6, 0x48($s0) -/* 013B60 80012F60 C606004C */ lwc1 $f6, 0x4c($s0) -/* 013B64 80012F64 C6080054 */ lwc1 $f8, 0x54($s0) -/* 013B68 80012F68 4606C081 */ sub.s $f2, $f24, $f6 -/* 013B6C 80012F6C 166E0021 */ bne $s3, $t6, .L80012FF4 -/* 013B70 80012F70 4608D301 */ sub.s $f12, $f26, $f8 -/* 013B74 80012F74 46001021 */ cvt.d.s $f0, $f2 -/* 013B78 80012F78 4620A03C */ c.lt.d $f20, $f0 -/* 013B7C 80012F7C 00000000 */ nop -/* 013B80 80012F80 4502001D */ bc1fl .L80012FF8 -/* 013B84 80012F84 26310024 */ addiu $s1, $s1, 0x24 -/* 013B88 80012F88 4636003C */ c.lt.d $f0, $f22 -/* 013B8C 80012F8C 00000000 */ nop -/* 013B90 80012F90 45020019 */ bc1fl .L80012FF8 -/* 013B94 80012F94 26310024 */ addiu $s1, $s1, 0x24 -/* 013B98 80012F98 46006021 */ cvt.d.s $f0, $f12 -/* 013B9C 80012F9C 4620A03C */ c.lt.d $f20, $f0 -/* 013BA0 80012FA0 00000000 */ nop -/* 013BA4 80012FA4 45020014 */ bc1fl .L80012FF8 -/* 013BA8 80012FA8 26310024 */ addiu $s1, $s1, 0x24 -/* 013BAC 80012FAC 4636003C */ c.lt.d $f0, $f22 -/* 013BB0 80012FB0 26020048 */ addiu $v0, $s0, 0x48 -/* 013BB4 80012FB4 45020010 */ bc1fl .L80012FF8 -/* 013BB8 80012FB8 26310024 */ addiu $s1, $s1, 0x24 -/* 013BBC 80012FBC C44C0004 */ lwc1 $f12, 4($v0) -/* 013BC0 80012FC0 C44E000C */ lwc1 $f14, 0xc($v0) -/* 013BC4 80012FC4 8C460010 */ lw $a2, 0x10($v0) -/* 013BC8 80012FC8 8C470018 */ lw $a3, 0x18($v0) -/* 013BCC 80012FCC E7BA001C */ swc1 $f26, 0x1c($sp) -/* 013BD0 80012FD0 E7B80018 */ swc1 $f24, 0x18($sp) -/* 013BD4 80012FD4 E7BC0014 */ swc1 $f28, 0x14($sp) -/* 013BD8 80012FD8 0C001806 */ jal func_80006018 -/* 013BDC 80012FDC E7BE0010 */ swc1 $f30, 0x10($sp) -/* 013BE0 80012FE0 54530005 */ bnel $v0, $s3, .L80012FF8 -/* 013BE4 80012FE4 26310024 */ addiu $s1, $s1, 0x24 -/* 013BE8 80012FE8 8E4F000C */ lw $t7, 0xc($s2) -/* 013BEC 80012FEC 01F4C025 */ or $t8, $t7, $s4 -/* 013BF0 80012FF0 AE58000C */ sw $t8, 0xc($s2) -.L80012FF4: -/* 013BF4 80012FF4 26310024 */ addiu $s1, $s1, 0x24 -.L80012FF8: -/* 013BF8 80012FF8 1635FFD8 */ bne $s1, $s5, .L80012F5C -/* 013BFC 80012FFC 26100024 */ addiu $s0, $s0, 0x24 -/* 013C00 80013000 26F7010C */ addiu $s7, $s7, 0x10c -/* 013C04 80013004 16FEFF9C */ bne $s7, $fp, .L80012E78 -/* 013C08 80013008 26D6010C */ addiu $s6, $s6, 0x10c -.L8001300C: -/* 013C0C 8001300C 8FBF007C */ lw $ra, 0x7c($sp) -/* 013C10 80013010 D7B40028 */ ldc1 $f20, 0x28($sp) -/* 013C14 80013014 D7B60030 */ ldc1 $f22, 0x30($sp) -/* 013C18 80013018 D7B80038 */ ldc1 $f24, 0x38($sp) -/* 013C1C 8001301C D7BA0040 */ ldc1 $f26, 0x40($sp) -/* 013C20 80013020 D7BC0048 */ ldc1 $f28, 0x48($sp) -/* 013C24 80013024 D7BE0050 */ ldc1 $f30, 0x50($sp) -/* 013C28 80013028 8FB00058 */ lw $s0, 0x58($sp) -/* 013C2C 8001302C 8FB1005C */ lw $s1, 0x5c($sp) -/* 013C30 80013030 8FB20060 */ lw $s2, 0x60($sp) -/* 013C34 80013034 8FB30064 */ lw $s3, 0x64($sp) -/* 013C38 80013038 8FB40068 */ lw $s4, 0x68($sp) -/* 013C3C 8001303C 8FB5006C */ lw $s5, 0x6c($sp) -/* 013C40 80013040 8FB60070 */ lw $s6, 0x70($sp) -/* 013C44 80013044 8FB70074 */ lw $s7, 0x74($sp) -/* 013C48 80013048 8FBE0078 */ lw $fp, 0x78($sp) -/* 013C4C 8001304C 03E00008 */ jr $ra -/* 013C50 80013050 27BD00A8 */ addiu $sp, $sp, 0xa8 diff --git a/asm/non_matchings/code_80005FD0/func_80015390.s b/asm/non_matchings/code_80005FD0/func_80015390.s deleted file mode 100644 index cce02d2b0..000000000 --- a/asm/non_matchings/code_80005FD0/func_80015390.s +++ /dev/null @@ -1,116 +0,0 @@ -glabel func_80015390 -/* 015F90 80015390 27BDFF50 */ addiu $sp, $sp, -0xb0 -/* 015F94 80015394 AFBF002C */ sw $ra, 0x2c($sp) -/* 015F98 80015398 AFB10028 */ sw $s1, 0x28($sp) -/* 015F9C 8001539C AFB00024 */ sw $s0, 0x24($sp) -/* 015FA0 800153A0 AFA500B4 */ sw $a1, 0xb4($sp) -/* 015FA4 800153A4 AFA600B8 */ sw $a2, 0xb8($sp) -/* 015FA8 800153A8 848E00AE */ lh $t6, 0xae($a0) -/* 015FAC 800153AC 3C11800E */ lui $s1, %hi(gPlayerOne) -/* 015FB0 800153B0 8E31C4DC */ lw $s1, %lo(gPlayerOne)($s1) -/* 015FB4 800153B4 000E78C0 */ sll $t7, $t6, 3 -/* 015FB8 800153B8 01EE7823 */ subu $t7, $t7, $t6 -/* 015FBC 800153BC 000F7900 */ sll $t7, $t7, 4 -/* 015FC0 800153C0 01EE7823 */ subu $t7, $t7, $t6 -/* 015FC4 800153C4 000F7880 */ sll $t7, $t7, 2 -/* 015FC8 800153C8 01EE7823 */ subu $t7, $t7, $t6 -/* 015FCC 800153CC 000F78C0 */ sll $t7, $t7, 3 -/* 015FD0 800153D0 022F8821 */ addu $s1, $s1, $t7 -/* 015FD4 800153D4 86220078 */ lh $v0, 0x78($s1) -/* 015FD8 800153D8 00808025 */ move $s0, $a0 -/* 015FDC 800153DC 14400003 */ bnez $v0, .L800153EC -/* 015FE0 800153E0 00000000 */ nop -/* 015FE4 800153E4 10000012 */ b .L80015430 -/* 015FE8 800153E8 24060064 */ li $a2, 100 -.L800153EC: -/* 015FEC 800153EC 04410009 */ bgez $v0, .L80015414 -/* 015FF0 800153F0 241900A0 */ li $t9, 160 -/* 015FF4 800153F4 04410003 */ bgez $v0, .L80015404 -/* 015FF8 800153F8 0002C103 */ sra $t8, $v0, 4 -/* 015FFC 800153FC 2441000F */ addiu $at, $v0, 0xf -/* 016000 80015400 0001C103 */ sra $t8, $at, 4 -.L80015404: -/* 016004 80015404 03383023 */ subu $a2, $t9, $t8 -/* 016008 80015408 00064400 */ sll $t0, $a2, 0x10 -/* 01600C 8001540C 10000008 */ b .L80015430 -/* 016010 80015410 00083403 */ sra $a2, $t0, 0x10 -.L80015414: -/* 016014 80015414 04410003 */ bgez $v0, .L80015424 -/* 016018 80015418 00023103 */ sra $a2, $v0, 4 -/* 01601C 8001541C 2441000F */ addiu $at, $v0, 0xf -/* 016020 80015420 00013103 */ sra $a2, $at, 4 -.L80015424: -/* 016024 80015424 24C600A0 */ addiu $a2, $a2, 0xa0 -/* 016028 80015428 00065400 */ sll $t2, $a2, 0x10 -/* 01602C 8001542C 000A3403 */ sra $a2, $t2, 0x10 -.L80015430: -/* 016030 80015430 8E2200BC */ lw $v0, 0xbc($s1) -/* 016034 80015434 304C0080 */ andi $t4, $v0, 0x80 -/* 016038 80015438 15800005 */ bnez $t4, .L80015450 -/* 01603C 8001543C 304D0040 */ andi $t5, $v0, 0x40 -/* 016040 80015440 15A00003 */ bnez $t5, .L80015450 -/* 016044 80015444 2604002C */ addiu $a0, $s0, 0x2c -/* 016048 80015448 0C00893C */ jal func_800224F0 -/* 01604C 8001544C 8625002E */ lh $a1, 0x2e($s1) -.L80015450: -/* 016050 80015450 27AE0080 */ addiu $t6, $sp, 0x80 -/* 016054 80015454 27AF007C */ addiu $t7, $sp, 0x7c -/* 016058 80015458 AFAF0014 */ sw $t7, 0x14($sp) -/* 01605C 8001545C AFAE0010 */ sw $t6, 0x10($sp) -/* 016060 80015460 8619002C */ lh $t9, 0x2c($s0) -/* 016064 80015464 02202025 */ move $a0, $s1 -/* 016068 80015468 02002825 */ move $a1, $s0 -/* 01606C 8001546C 27A60064 */ addiu $a2, $sp, 0x64 -/* 016070 80015470 27A70084 */ addiu $a3, $sp, 0x84 -/* 016074 80015474 0C0075E5 */ jal func_8001D794 -/* 016078 80015478 AFB90018 */ sw $t9, 0x18($sp) -/* 01607C 8001547C C7A4007C */ lwc1 $f4, 0x7c($sp) -/* 016080 80015480 26040054 */ addiu $a0, $s0, 0x54 -/* 016084 80015484 3C054120 */ lui $a1, 0x4120 -/* 016088 80015488 8FA60084 */ lw $a2, 0x84($sp) -/* 01608C 8001548C 8FA70080 */ lw $a3, 0x80($sp) -/* 016090 80015490 0C0AB772 */ jal func_802ADDC8 -/* 016094 80015494 E7A40010 */ swc1 $f4, 0x10($sp) -/* 016098 80015498 C7A60064 */ lwc1 $f6, 0x64($sp) -/* 01609C 8001549C E606000C */ swc1 $f6, 0xc($s0) -/* 0160A0 800154A0 C7A80068 */ lwc1 $f8, 0x68($sp) -/* 0160A4 800154A4 C606000C */ lwc1 $f6, 0xc($s0) -/* 0160A8 800154A8 E6080010 */ swc1 $f8, 0x10($s0) -/* 0160AC 800154AC C7AA006C */ lwc1 $f10, 0x6c($sp) -/* 0160B0 800154B0 E60A0014 */ swc1 $f10, 0x14($s0) -/* 0160B4 800154B4 C7B00084 */ lwc1 $f16, 0x84($sp) -/* 0160B8 800154B8 C60A0010 */ lwc1 $f10, 0x10($s0) -/* 0160BC 800154BC E6100000 */ swc1 $f16, ($s0) -/* 0160C0 800154C0 C7B20080 */ lwc1 $f18, 0x80($sp) -/* 0160C4 800154C4 C6080000 */ lwc1 $f8, ($s0) -/* 0160C8 800154C8 E6120004 */ swc1 $f18, 4($s0) -/* 0160CC 800154CC C6100004 */ lwc1 $f16, 4($s0) -/* 0160D0 800154D0 C7A4007C */ lwc1 $f4, 0x7c($sp) -/* 0160D4 800154D4 46083301 */ sub.s $f12, $f6, $f8 -/* 0160D8 800154D8 E6040008 */ swc1 $f4, 8($s0) -/* 0160DC 800154DC 46105481 */ sub.s $f18, $f10, $f16 -/* 0160E0 800154E0 E7B20090 */ swc1 $f18, 0x90($sp) -/* 0160E4 800154E4 C6060008 */ lwc1 $f6, 8($s0) -/* 0160E8 800154E8 C6040014 */ lwc1 $f4, 0x14($s0) -/* 0160EC 800154EC E7AC0094 */ swc1 $f12, 0x94($sp) -/* 0160F0 800154F0 46062381 */ sub.s $f14, $f4, $f6 -/* 0160F4 800154F4 0C0ADE0C */ jal atan2s -/* 0160F8 800154F8 E7AE008C */ swc1 $f14, 0x8c($sp) -/* 0160FC 800154FC C7A00094 */ lwc1 $f0, 0x94($sp) -/* 016100 80015500 C7AE008C */ lwc1 $f14, 0x8c($sp) -/* 016104 80015504 A6020026 */ sh $v0, 0x26($s0) -/* 016108 80015508 46000202 */ mul.s $f8, $f0, $f0 -/* 01610C 8001550C 00000000 */ nop -/* 016110 80015510 460E7282 */ mul.s $f10, $f14, $f14 -/* 016114 80015514 0C033850 */ jal sqrtf -/* 016118 80015518 460A4300 */ add.s $f12, $f8, $f10 -/* 01611C 8001551C 46000306 */ mov.s $f12, $f0 -/* 016120 80015520 0C0ADE0C */ jal atan2s -/* 016124 80015524 C7AE0090 */ lwc1 $f14, 0x90($sp) -/* 016128 80015528 A6020024 */ sh $v0, 0x24($s0) -/* 01612C 8001552C A6000028 */ sh $zero, 0x28($s0) -/* 016130 80015530 8FBF002C */ lw $ra, 0x2c($sp) -/* 016134 80015534 8FB10028 */ lw $s1, 0x28($sp) -/* 016138 80015538 8FB00024 */ lw $s0, 0x24($sp) -/* 01613C 8001553C 03E00008 */ jr $ra -/* 016140 80015540 27BD00B0 */ addiu $sp, $sp, 0xb0 diff --git a/asm/non_matchings/code_80027D00/func_80036CB4.s b/asm/non_matchings/code_80027D00/func_80036CB4.s deleted file mode 100644 index b6b2f2de0..000000000 --- a/asm/non_matchings/code_80027D00/func_80036CB4.s +++ /dev/null @@ -1,69 +0,0 @@ -glabel func_80036CB4 -/* 0378B4 80036CB4 8C8200BC */ lw $v0, 0xbc($a0) -/* 0378B8 80036CB8 24050010 */ li $a1, 16 -/* 0378BC 80036CBC 30430010 */ andi $v1, $v0, 0x10 -/* 0378C0 80036CC0 14A30031 */ bne $a1, $v1, .L80036D88 -/* 0378C4 80036CC4 00000000 */ nop -/* 0378C8 80036CC8 948E0000 */ lhu $t6, ($a0) -/* 0378CC 80036CCC 24014000 */ li $at, 16384 -/* 0378D0 80036CD0 31CF4000 */ andi $t7, $t6, 0x4000 -/* 0378D4 80036CD4 15E1002C */ bne $t7, $at, .L80036D88 -/* 0378D8 80036CD8 00000000 */ nop -/* 0378DC 80036CDC 848200C0 */ lh $v0, 0xc0($a0) -/* 0378E0 80036CE0 240100B6 */ li $at, 182 -/* 0378E4 80036CE4 0041001A */ div $zero, $v0, $at -/* 0378E8 80036CE8 00001012 */ mflo $v0 -/* 0378EC 80036CEC 18400012 */ blez $v0, .L80036D38 -/* 0378F0 80036CF0 00000000 */ nop -/* 0378F4 80036CF4 8C83007C */ lw $v1, 0x7c($a0) -/* 0378F8 80036CF8 2401006A */ li $at, 106 -/* 0378FC 80036CFC 848200C0 */ lh $v0, 0xc0($a0) -/* 037900 80036D00 0003CC03 */ sra $t9, $v1, 0x10 -/* 037904 80036D04 00194080 */ sll $t0, $t9, 2 -/* 037908 80036D08 01194023 */ subu $t0, $t0, $t9 -/* 03790C 80036D0C 00084080 */ sll $t0, $t0, 2 -/* 037910 80036D10 01194021 */ addu $t0, $t0, $t9 -/* 037914 80036D14 250302B1 */ addiu $v1, $t0, 0x2b1 -/* 037918 80036D18 0061001A */ div $zero, $v1, $at -/* 03791C 80036D1C 00004812 */ mflo $t1 -/* 037920 80036D20 240100B6 */ li $at, 182 -/* 037924 80036D24 25230028 */ addiu $v1, $t1, 0x28 -/* 037928 80036D28 0041001A */ div $zero, $v0, $at -/* 03792C 80036D2C 00001012 */ mflo $v0 -/* 037930 80036D30 00035400 */ sll $t2, $v1, 0x10 -/* 037934 80036D34 AC8A007C */ sw $t2, 0x7c($a0) -.L80036D38: -/* 037938 80036D38 0443000F */ bgezl $v0, .L80036D78 -/* 03793C 80036D3C 8C9800BC */ lw $t8, 0xbc($a0) -/* 037940 80036D40 8C83007C */ lw $v1, 0x7c($a0) -/* 037944 80036D44 2401006A */ li $at, 106 -/* 037948 80036D48 00036403 */ sra $t4, $v1, 0x10 -/* 03794C 80036D4C 000C6880 */ sll $t5, $t4, 2 -/* 037950 80036D50 01AC6823 */ subu $t5, $t5, $t4 -/* 037954 80036D54 000D6880 */ sll $t5, $t5, 2 -/* 037958 80036D58 01AC6821 */ addu $t5, $t5, $t4 -/* 03795C 80036D5C 25A302B1 */ addiu $v1, $t5, 0x2b1 -/* 037960 80036D60 0061001A */ div $zero, $v1, $at -/* 037964 80036D64 00007012 */ mflo $t6 -/* 037968 80036D68 25C3FFCB */ addiu $v1, $t6, -0x35 -/* 03796C 80036D6C 00037C00 */ sll $t7, $v1, 0x10 -/* 037970 80036D70 AC8F007C */ sw $t7, 0x7c($a0) -/* 037974 80036D74 8C9800BC */ lw $t8, 0xbc($a0) -.L80036D78: -/* 037978 80036D78 2401FFEF */ li $at, -17 -/* 03797C 80036D7C 03011024 */ and $v0, $t8, $at -/* 037980 80036D80 AC8200BC */ sw $v0, 0xbc($a0) -/* 037984 80036D84 30430010 */ andi $v1, $v0, 0x10 -.L80036D88: -/* 037988 80036D88 14A30008 */ bne $a1, $v1, .L80036DAC -/* 03798C 80036D8C 00000000 */ nop -/* 037990 80036D90 94880000 */ lhu $t0, ($a0) -/* 037994 80036D94 24014000 */ li $at, 16384 -/* 037998 80036D98 31094000 */ andi $t1, $t0, 0x4000 -/* 03799C 80036D9C 11210003 */ beq $t1, $at, .L80036DAC -/* 0379A0 80036DA0 2401FFEF */ li $at, -17 -/* 0379A4 80036DA4 00415024 */ and $t2, $v0, $at -/* 0379A8 80036DA8 AC8A00BC */ sw $t2, 0xbc($a0) -.L80036DAC: -/* 0379AC 80036DAC 03E00008 */ jr $ra -/* 0379B0 80036DB0 00000000 */ nop diff --git a/asm/non_matchings/code_80071F00/func_80071F6C.s b/asm/non_matchings/code_80071F00/func_80071F6C.s deleted file mode 100644 index 5b47f2921..000000000 --- a/asm/non_matchings/code_80071F00/func_80071F6C.s +++ /dev/null @@ -1,21 +0,0 @@ -glabel func_80071F6C -/* 072B6C 80071F6C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 072B70 80071F70 AFBF0014 */ sw $ra, 0x14($sp) -/* 072B74 80071F74 00802825 */ move $a1, $a0 -/* 072B78 80071F78 8C840000 */ lw $a0, ($a0) -/* 072B7C 80071F7C 0C01C90A */ jal func_80072428 -/* 072B80 80071F80 AFA50018 */ sw $a1, 0x18($sp) -/* 072B84 80071F84 8FA50018 */ lw $a1, 0x18($sp) -/* 072B88 80071F88 3C018016 */ lui $at, %hi(D_80165CE2) # 0x8016 -/* 072B8C 80071F8C 2418FFFF */ li $t8, -1 -/* 072B90 80071F90 8CAE0000 */ lw $t6, ($a1) -/* 072B94 80071F94 000E78C0 */ sll $t7, $t6, 3 -/* 072B98 80071F98 01EE7823 */ subu $t7, $t7, $t6 -/* 072B9C 80071F9C 000F7940 */ sll $t7, $t7, 5 -/* 072BA0 80071FA0 002F0821 */ addu $at, $at, $t7 -/* 072BA4 80071FA4 A0205CE2 */ sb $zero, %lo(D_80165CE2)($at) # 0x5ce2($at) -/* 072BA8 80071FA8 ACB80000 */ sw $t8, ($a1) -/* 072BAC 80071FAC 8FBF0014 */ lw $ra, 0x14($sp) -/* 072BB0 80071FB0 27BD0018 */ addiu $sp, $sp, 0x18 -/* 072BB4 80071FB4 03E00008 */ jr $ra -/* 072BB8 80071FB8 00000000 */ nop diff --git a/asm/non_matchings/code_80071F00/func_80077450.s b/asm/non_matchings/code_80071F00/func_80077450.s deleted file mode 100644 index 22e2ce13d..000000000 --- a/asm/non_matchings/code_80071F00/func_80077450.s +++ /dev/null @@ -1,83 +0,0 @@ -glabel func_80077450 -/* 078050 80077450 000470C0 */ sll $t6, $a0, 3 -/* 078054 80077454 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 078058 80077458 01C47023 */ subu $t6, $t6, $a0 -/* 07805C 8007745C 3C0F8016 */ lui $t7, %hi(D_80165C18) # $t7, 0x8016 -/* 078060 80077460 AFB00028 */ sw $s0, 0x28($sp) -/* 078064 80077464 25EF5C18 */ addiu $t7, %lo(D_80165C18) # addiu $t7, $t7, 0x5c18 -/* 078068 80077468 000E7140 */ sll $t6, $t6, 5 -/* 07806C 8007746C 01CF8021 */ addu $s0, $t6, $t7 -/* 078070 80077470 860200A6 */ lh $v0, 0xa6($s0) -/* 078074 80077474 AFBF002C */ sw $ra, 0x2c($sp) -/* 078078 80077478 00803825 */ move $a3, $a0 -/* 07807C 8007747C 10400028 */ beqz $v0, .L80077520 -/* 078080 80077480 24010001 */ li $at, 1 -/* 078084 80077484 10410005 */ beq $v0, $at, .L8007749C -/* 078088 80077488 24010002 */ li $at, 2 -/* 07808C 8007748C 10410007 */ beq $v0, $at, .L800774AC -/* 078090 80077490 02002025 */ move $a0, $s0 -/* 078094 80077494 10000023 */ b .L80077524 -/* 078098 80077498 8E080048 */ lw $t0, 0x48($s0) -.L8007749C: -/* 07809C 8007749C 0C01DD0A */ jal func_80077428 -/* 0780A0 800774A0 00E02025 */ move $a0, $a3 -/* 0780A4 800774A4 1000001F */ b .L80077524 -/* 0780A8 800774A8 8E080048 */ lw $t0, 0x48($s0) -.L800774AC: -/* 0780AC 800774AC 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc -/* 0780B0 800774B0 3C063C23 */ lui $a2, (0x3C23D70A >> 16) # lui $a2, 0x3c23 -/* 0780B4 800774B4 34C6D70A */ ori $a2, (0x3C23D70A & 0xFFFF) # ori $a2, $a2, 0xd70a -/* 0780B8 800774B8 34A5CCCD */ ori $a1, (0x3DCCCCCD & 0xFFFF) # ori $a1, $a1, 0xcccd -/* 0780BC 800774BC 0C0103B8 */ jal f32_step_up_towards -/* 0780C0 800774C0 AFA70040 */ sw $a3, 0x40($sp) -/* 0780C4 800774C4 8618008E */ lh $t8, 0x8e($s0) -/* 0780C8 800774C8 C6080008 */ lwc1 $f8, 8($s0) -/* 0780CC 800774CC 8FA40040 */ lw $a0, 0x40($sp) -/* 0780D0 800774D0 44982000 */ mtc1 $t8, $f4 -/* 0780D4 800774D4 260500A0 */ addiu $a1, $s0, 0xa0 -/* 0780D8 800774D8 240600FF */ li $a2, 255 -/* 0780DC 800774DC 468021A0 */ cvt.s.w $f6, $f4 -/* 0780E0 800774E0 00003825 */ move $a3, $zero -/* 0780E4 800774E4 24190010 */ li $t9, 16 -/* 0780E8 800774E8 4606403E */ c.le.s $f8, $f6 -/* 0780EC 800774EC 00000000 */ nop -/* 0780F0 800774F0 4502000C */ bc1fl .L80077524 -/* 0780F4 800774F4 8E080048 */ lw $t0, 0x48($s0) -/* 0780F8 800774F8 AFB90010 */ sw $t9, 0x10($sp) -/* 0780FC 800774FC AFA00014 */ sw $zero, 0x14($sp) -/* 078100 80077500 0C01CEC0 */ jal func_80073B00 -/* 078104 80077504 AFA00018 */ sw $zero, 0x18($sp) -/* 078108 80077508 50400006 */ beql $v0, $zero, .L80077524 -/* 07810C 8007750C 8E080048 */ lw $t0, 0x48($s0) -/* 078110 80077510 0C021BD8 */ jal func_80086F60 -/* 078114 80077514 8FA40040 */ lw $a0, 0x40($sp) -/* 078118 80077518 0C01C90A */ jal func_80072428 -/* 07811C 8007751C 8FA40040 */ lw $a0, 0x40($sp) -.L80077520: -/* 078120 80077520 8E080048 */ lw $t0, 0x48($s0) -.L80077524: -/* 078124 80077524 24010003 */ li $at, 3 -/* 078128 80077528 27A5003C */ addiu $a1, $sp, 0x3c -/* 07812C 8007752C 51000011 */ beql $t0, $zero, .L80077574 -/* 078130 80077530 8FBF002C */ lw $ra, 0x2c($sp) -/* 078134 80077534 8609008C */ lh $t1, 0x8c($s0) -/* 078138 80077538 27A6003A */ addiu $a2, $sp, 0x3a -/* 07813C 8007753C 27A70038 */ addiu $a3, $sp, 0x38 -/* 078140 80077540 252A0001 */ addiu $t2, $t1, 1 -/* 078144 80077544 0141001A */ div $zero, $t2, $at -/* 078148 80077548 00005810 */ mfhi $t3 -/* 07814C 8007754C A60B008C */ sh $t3, 0x8c($s0) -/* 078150 80077550 0C0171AD */ jal func_8005C6B4 -/* 078154 80077554 8204008D */ lb $a0, 0x8d($s0) -/* 078158 80077558 87AC003C */ lh $t4, 0x3c($sp) -/* 07815C 8007755C 87AD003A */ lh $t5, 0x3a($sp) -/* 078160 80077560 87AE0038 */ lh $t6, 0x38($sp) -/* 078164 80077564 A60C0084 */ sh $t4, 0x84($s0) -/* 078168 80077568 A60D0086 */ sh $t5, 0x86($s0) -/* 07816C 8007756C A60E0088 */ sh $t6, 0x88($s0) -/* 078170 80077570 8FBF002C */ lw $ra, 0x2c($sp) -.L80077574: -/* 078174 80077574 8FB00028 */ lw $s0, 0x28($sp) -/* 078178 80077578 27BD0040 */ addiu $sp, $sp, 0x40 -/* 07817C 8007757C 03E00008 */ jr $ra -/* 078180 80077580 00000000 */ nop diff --git a/asm/non_matchings/code_80071F00/func_80080A4C.s b/asm/non_matchings/code_80071F00/func_80080A4C.s deleted file mode 100644 index 9822a8ff5..000000000 --- a/asm/non_matchings/code_80071F00/func_80080A4C.s +++ /dev/null @@ -1,58 +0,0 @@ -glabel func_80080A4C -/* 08164C 80080A4C 0005C8C0 */ sll $t9, $a1, 3 -/* 081650 80080A50 00057080 */ sll $t6, $a1, 2 -/* 081654 80080A54 0325C823 */ subu $t9, $t9, $a1 -/* 081658 80080A58 01C57023 */ subu $t6, $t6, $a1 -/* 08165C 80080A5C 3C0F800E */ lui $t7, %hi(camera1) # $t7, 0x800e -/* 081660 80080A60 0019C900 */ sll $t9, $t9, 4 -/* 081664 80080A64 8DEFDB40 */ lw $t7, %lo(camera1)($t7) -/* 081668 80080A68 000E70C0 */ sll $t6, $t6, 3 -/* 08166C 80080A6C 0325C823 */ subu $t9, $t9, $a1 -/* 081670 80080A70 3C09800E */ lui $t1, %hi(gScreenModeSelection) # $t1, 0x800e -/* 081674 80080A74 8D29C530 */ lw $t1, %lo(gScreenModeSelection)($t1) -/* 081678 80080A78 01C57023 */ subu $t6, $t6, $a1 -/* 08167C 80080A7C 0019C880 */ sll $t9, $t9, 2 -/* 081680 80080A80 3C08800E */ lui $t0, %hi(gPlayerOne) # $t0, 0x800e -/* 081684 80080A84 8D08C4DC */ lw $t0, %lo(gPlayerOne)($t0) -/* 081688 80080A88 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 08168C 80080A8C 000E70C0 */ sll $t6, $t6, 3 -/* 081690 80080A90 0325C823 */ subu $t9, $t9, $a1 -/* 081694 80080A94 0019C8C0 */ sll $t9, $t9, 3 -/* 081698 80080A98 24010003 */ li $at, 3 -/* 08169C 80080A9C 01CFC021 */ addu $t8, $t6, $t7 -/* 0816A0 80080AA0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0816A4 80080AA4 AFA40020 */ sw $a0, 0x20($sp) -/* 0816A8 80080AA8 AFB8001C */ sw $t8, 0x1c($sp) -/* 0816AC 80080AAC 1121001A */ beq $t1, $at, .L80080B18 -/* 0816B0 80080AB0 03283821 */ addu $a3, $t9, $t0 -/* 0816B4 80080AB4 24050010 */ li $a1, 16 -/* 0816B8 80080AB8 0C01C8C8 */ jal func_80072320 -/* 0816BC 80080ABC AFA70018 */ sw $a3, 0x18($sp) -/* 0816C0 80080AC0 10400015 */ beqz $v0, .L80080B18 -/* 0816C4 80080AC4 8FA70018 */ lw $a3, 0x18($sp) -/* 0816C8 80080AC8 8FA40020 */ lw $a0, 0x20($sp) -/* 0816CC 80080ACC 00E02825 */ move $a1, $a3 -/* 0816D0 80080AD0 0C022296 */ jal func_80088A58 -/* 0816D4 80080AD4 3C0643FA */ lui $a2, 0x43fa -/* 0816D8 80080AD8 50400010 */ beql $v0, $zero, .L80080B1C -/* 0816DC 80080ADC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0816E0 80080AE0 0C007284 */ jal func_8001CA10 -/* 0816E4 80080AE4 8FA4001C */ lw $a0, 0x1c($sp) -/* 0816E8 80080AE8 8FAA0020 */ lw $t2, 0x20($sp) -/* 0816EC 80080AEC 3C0C8016 */ lui $t4, %hi(D_80165C18) # $t4, 0x8016 -/* 0816F0 80080AF0 258C5C18 */ addiu $t4, %lo(D_80165C18) # addiu $t4, $t4, 0x5c18 -/* 0816F4 80080AF4 000A58C0 */ sll $t3, $t2, 3 -/* 0816F8 80080AF8 016A5823 */ subu $t3, $t3, $t2 -/* 0816FC 80080AFC 000B5940 */ sll $t3, $t3, 5 -/* 081700 80080B00 016C1021 */ addu $v0, $t3, $t4 -/* 081704 80080B04 3C061900 */ lui $a2, (0x1900800F >> 16) # lui $a2, 0x1900 -/* 081708 80080B08 34C6800F */ ori $a2, (0x1900800F & 0xFFFF) # ori $a2, $a2, 0x800f -/* 08170C 80080B0C 24440004 */ addiu $a0, $v0, 4 -/* 081710 80080B10 0C03262E */ jal func_800C98B8 -/* 081714 80080B14 24450038 */ addiu $a1, $v0, 0x38 -.L80080B18: -/* 081718 80080B18 8FBF0014 */ lw $ra, 0x14($sp) -.L80080B1C: -/* 08171C 80080B1C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 081720 80080B20 03E00008 */ jr $ra -/* 081724 80080B24 00000000 */ nop diff --git a/asm/non_matchings/code_80091750/func_800A2D1C.s b/asm/non_matchings/code_80091750/func_800A2D1C.s deleted file mode 100644 index d1cdb9147..000000000 --- a/asm/non_matchings/code_80091750/func_800A2D1C.s +++ /dev/null @@ -1,112 +0,0 @@ -glabel func_800A2D1C -/* 0A391C 800A2D1C 3C028016 */ lui $v0, %hi(D_80164A28) # $v0, 0x8016 -/* 0A3920 800A2D20 8C424A28 */ lw $v0, %lo(D_80164A28)($v0) -/* 0A3924 800A2D24 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 0A3928 800A2D28 AFB10020 */ sw $s1, 0x20($sp) -/* 0A392C 800A2D2C 24030001 */ li $v1, 1 -/* 0A3930 800A2D30 00808825 */ move $s1, $a0 -/* 0A3934 800A2D34 AFBF0024 */ sw $ra, 0x24($sp) -/* 0A3938 800A2D38 10430006 */ beq $v0, $v1, .L800A2D54 -/* 0A393C 800A2D3C AFB0001C */ sw $s0, 0x1c($sp) -/* 0A3940 800A2D40 24010002 */ li $at, 2 -/* 0A3944 800A2D44 10410018 */ beq $v0, $at, .L800A2DA8 -/* 0A3948 800A2D48 3C0C800E */ lui $t4, %hi(gModeSelection) # $t4, 0x800e -/* 0A394C 800A2D4C 10000030 */ b .L800A2E10 -/* 0A3950 800A2D50 3C0D800E */ lui $t5, %hi(gPlayerCountSelection1) # $t5, 0x800e -.L800A2D54: -/* 0A3954 800A2D54 3C108015 */ lui $s0, %hi(gDisplayListHead) # $s0, 0x8015 -/* 0A3958 800A2D58 26100298 */ addiu $s0, %lo(gDisplayListHead) # addiu $s0, $s0, 0x298 -/* 0A395C 800A2D5C 240E0028 */ li $t6, 40 -/* 0A3960 800A2D60 AFAE0010 */ sw $t6, 0x10($sp) -/* 0A3964 800A2D64 8E040000 */ lw $a0, ($s0) -/* 0A3968 800A2D68 00002825 */ move $a1, $zero -/* 0A396C 800A2D6C 00003025 */ move $a2, $zero -/* 0A3970 800A2D70 0C0263F2 */ jal func_80098FC8 -/* 0A3974 800A2D74 2407013F */ li $a3, 319 -/* 0A3978 800A2D78 240F00EF */ li $t7, 239 -/* 0A397C 800A2D7C AE020000 */ sw $v0, ($s0) -/* 0A3980 800A2D80 AFAF0010 */ sw $t7, 0x10($sp) -/* 0A3984 800A2D84 00402025 */ move $a0, $v0 -/* 0A3988 800A2D88 00002825 */ move $a1, $zero -/* 0A398C 800A2D8C 240600C7 */ li $a2, 199 -/* 0A3990 800A2D90 0C0263F2 */ jal func_80098FC8 -/* 0A3994 800A2D94 2407013F */ li $a3, 319 -/* 0A3998 800A2D98 AE020000 */ sw $v0, ($s0) -/* 0A399C 800A2D9C 24180028 */ li $t8, 40 -/* 0A39A0 800A2DA0 10000040 */ b .L800A2EA4 -/* 0A39A4 800A2DA4 AE38001C */ sw $t8, 0x1c($s1) -.L800A2DA8: -/* 0A39A8 800A2DA8 8E39001C */ lw $t9, 0x1c($s1) -/* 0A39AC 800A2DAC 2728FFFE */ addiu $t0, $t9, -2 -/* 0A39B0 800A2DB0 19000015 */ blez $t0, .L800A2E08 -/* 0A39B4 800A2DB4 AE28001C */ sw $t0, 0x1c($s1) -/* 0A39B8 800A2DB8 3C108015 */ lui $s0, %hi(gDisplayListHead) # $s0, 0x8015 -/* 0A39BC 800A2DBC 26100298 */ addiu $s0, %lo(gDisplayListHead) # addiu $s0, $s0, 0x298 -/* 0A39C0 800A2DC0 8E040000 */ lw $a0, ($s0) -/* 0A39C4 800A2DC4 00002825 */ move $a1, $zero -/* 0A39C8 800A2DC8 00003025 */ move $a2, $zero -/* 0A39CC 800A2DCC 2407013F */ li $a3, 319 -/* 0A39D0 800A2DD0 0C0263F2 */ jal func_80098FC8 -/* 0A39D4 800A2DD4 AFA80010 */ sw $t0, 0x10($sp) -/* 0A39D8 800A2DD8 AE020000 */ sw $v0, ($s0) -/* 0A39DC 800A2DDC 8E29001C */ lw $t1, 0x1c($s1) -/* 0A39E0 800A2DE0 240A00EF */ li $t2, 239 -/* 0A39E4 800A2DE4 240B00EF */ li $t3, 239 -/* 0A39E8 800A2DE8 AFAB0010 */ sw $t3, 0x10($sp) -/* 0A39EC 800A2DEC 00402025 */ move $a0, $v0 -/* 0A39F0 800A2DF0 00002825 */ move $a1, $zero -/* 0A39F4 800A2DF4 2407013F */ li $a3, 319 -/* 0A39F8 800A2DF8 0C0263F2 */ jal func_80098FC8 -/* 0A39FC 800A2DFC 01493023 */ subu $a2, $t2, $t1 -/* 0A3A00 800A2E00 10000028 */ b .L800A2EA4 -/* 0A3A04 800A2E04 AE020000 */ sw $v0, ($s0) -.L800A2E08: -/* 0A3A08 800A2E08 10000026 */ b .L800A2EA4 -/* 0A3A0C 800A2E0C AE200000 */ sw $zero, ($s1) -.L800A2E10: -/* 0A3A10 800A2E10 8D8CC53C */ lw $t4, %lo(gModeSelection)($t4) -/* 0A3A14 800A2E14 15800008 */ bnez $t4, .L800A2E38 -/* 0A3A18 800A2E18 00000000 */ nop -/* 0A3A1C 800A2E1C 8DADC538 */ lw $t5, %lo(gPlayerCountSelection1)($t5) -/* 0A3A20 800A2E20 3C0E8019 */ lui $t6, %hi(D_8018EE08) # $t6, 0x8019 -/* 0A3A24 800A2E24 146D0004 */ bne $v1, $t5, .L800A2E38 -/* 0A3A28 800A2E28 00000000 */ nop -/* 0A3A2C 800A2E2C 81CEEE08 */ lb $t6, %lo(D_8018EE08)($t6) -/* 0A3A30 800A2E30 51C00004 */ beql $t6, $zero, .L800A2E44 -/* 0A3A34 800A2E34 8E2F001C */ lw $t7, 0x1c($s1) -.L800A2E38: -/* 0A3A38 800A2E38 1000001A */ b .L800A2EA4 -/* 0A3A3C 800A2E3C AE200000 */ sw $zero, ($s1) -/* 0A3A40 800A2E40 8E2F001C */ lw $t7, 0x1c($s1) -.L800A2E44: -/* 0A3A44 800A2E44 3C108015 */ lui $s0, %hi(gDisplayListHead) # $s0, 0x8015 -/* 0A3A48 800A2E48 26100298 */ addiu $s0, %lo(gDisplayListHead) # addiu $s0, $s0, 0x298 -/* 0A3A4C 800A2E4C 25F8FFFE */ addiu $t8, $t7, -2 -/* 0A3A50 800A2E50 1B000013 */ blez $t8, .L800A2EA0 -/* 0A3A54 800A2E54 AE38001C */ sw $t8, 0x1c($s1) -/* 0A3A58 800A2E58 8E040000 */ lw $a0, ($s0) -/* 0A3A5C 800A2E5C 00002825 */ move $a1, $zero -/* 0A3A60 800A2E60 00003025 */ move $a2, $zero -/* 0A3A64 800A2E64 2407013F */ li $a3, 319 -/* 0A3A68 800A2E68 0C0263F2 */ jal func_80098FC8 -/* 0A3A6C 800A2E6C AFB80010 */ sw $t8, 0x10($sp) -/* 0A3A70 800A2E70 AE020000 */ sw $v0, ($s0) -/* 0A3A74 800A2E74 8E39001C */ lw $t9, 0x1c($s1) -/* 0A3A78 800A2E78 240800EF */ li $t0, 239 -/* 0A3A7C 800A2E7C 240A00EF */ li $t2, 239 -/* 0A3A80 800A2E80 AFAA0010 */ sw $t2, 0x10($sp) -/* 0A3A84 800A2E84 00402025 */ move $a0, $v0 -/* 0A3A88 800A2E88 00002825 */ move $a1, $zero -/* 0A3A8C 800A2E8C 2407013F */ li $a3, 319 -/* 0A3A90 800A2E90 0C0263F2 */ jal func_80098FC8 -/* 0A3A94 800A2E94 01193023 */ subu $a2, $t0, $t9 -/* 0A3A98 800A2E98 10000002 */ b .L800A2EA4 -/* 0A3A9C 800A2E9C AE020000 */ sw $v0, ($s0) -.L800A2EA0: -/* 0A3AA0 800A2EA0 AE200000 */ sw $zero, ($s1) -.L800A2EA4: -/* 0A3AA4 800A2EA4 8FBF0024 */ lw $ra, 0x24($sp) -/* 0A3AA8 800A2EA8 8FB0001C */ lw $s0, 0x1c($sp) -/* 0A3AAC 800A2EAC 8FB10020 */ lw $s1, 0x20($sp) -/* 0A3AB0 800A2EB0 03E00008 */ jr $ra -/* 0A3AB4 800A2EB4 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/non_matchings/code_80091750/func_800ABF68.s b/asm/non_matchings/code_80091750/func_800ABF68.s index ea3b6bace..06901d81a 100644 --- a/asm/non_matchings/code_80091750/func_800ABF68.s +++ b/asm/non_matchings/code_80091750/func_800ABF68.s @@ -120,129 +120,3 @@ glabel func_800ABF68 /* 0ACD1C 800AC11C 27BD0020 */ addiu $sp, $sp, 0x20 /* 0ACD20 800AC120 03E00008 */ jr $ra /* 0ACD24 800AC124 00000000 */ nop - -/* 0ACD28 800AC128 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0ACD2C 800AC12C AFBF0014 */ sw $ra, 0x14($sp) -/* 0ACD30 800AC130 8C820004 */ lw $v0, 4($a0) -/* 0ACD34 800AC134 24010001 */ li $at, 1 -/* 0ACD38 800AC138 240E0140 */ li $t6, 320 -/* 0ACD3C 800AC13C 10400009 */ beqz $v0, .L800AC164 -/* 0ACD40 800AC140 240F0001 */ li $t7, 1 -/* 0ACD44 800AC144 10410009 */ beq $v0, $at, .L800AC16C -/* 0ACD48 800AC148 24010002 */ li $at, 2 -/* 0ACD4C 800AC14C 10410027 */ beq $v0, $at, .L800AC1EC -/* 0ACD50 800AC150 24010003 */ li $at, 3 -/* 0ACD54 800AC154 50410046 */ beql $v0, $at, .L800AC270 -/* 0ACD58 800AC158 8C8E0018 */ lw $t6, 0x18($a0) -/* 0ACD5C 800AC15C 10000065 */ b .L800AC2F4 -/* 0ACD60 800AC160 8FBF0014 */ lw $ra, 0x14($sp) -.L800AC164: -/* 0ACD64 800AC164 AC8E000C */ sw $t6, 0xc($a0) -/* 0ACD68 800AC168 AC8F0004 */ sw $t7, 4($a0) -.L800AC16C: -/* 0ACD6C 800AC16C 24050064 */ li $a1, 100 -/* 0ACD70 800AC170 0C02A503 */ jal func_800A940C -/* 0ACD74 800AC174 AFA40018 */ sw $a0, 0x18($sp) -/* 0ACD78 800AC178 8FA40018 */ lw $a0, 0x18($sp) -/* 0ACD7C 800AC17C 24010006 */ li $at, 6 -/* 0ACD80 800AC180 24190008 */ li $t9, 8 -/* 0ACD84 800AC184 8C83000C */ lw $v1, 0xc($a0) -/* 0ACD88 800AC188 24090002 */ li $t1, 2 -/* 0ACD8C 800AC18C 2462FF9C */ addiu $v0, $v1, -0x64 -/* 0ACD90 800AC190 0041001A */ div $zero, $v0, $at -/* 0ACD94 800AC194 0000C012 */ mflo $t8 -/* 0ACD98 800AC198 2B010009 */ slti $at, $t8, 9 -/* 0ACD9C 800AC19C 14200003 */ bnez $at, .L800AC1AC -/* 0ACDA0 800AC1A0 AC98001C */ sw $t8, 0x1c($a0) -/* 0ACDA4 800AC1A4 AC99001C */ sw $t9, 0x1c($a0) -/* 0ACDA8 800AC1A8 8C83000C */ lw $v1, 0xc($a0) -.L800AC1AC: -/* 0ACDAC 800AC1AC 8C88001C */ lw $t0, 0x1c($a0) -/* 0ACDB0 800AC1B0 3C01800F */ lui $at, %hi(D_800F2660) -/* 0ACDB4 800AC1B4 D4282660 */ ldc1 $f8, %lo(D_800F2660)($at) -/* 0ACDB8 800AC1B8 44882000 */ mtc1 $t0, $f4 -/* 0ACDBC 800AC1BC 3C01800F */ lui $at, %hi(D_800F2668) -/* 0ACDC0 800AC1C0 D4302668 */ ldc1 $f16, %lo(D_800F2668)($at) -/* 0ACDC4 800AC1C4 468021A1 */ cvt.d.w $f6, $f4 -/* 0ACDC8 800AC1C8 24010064 */ li $at, 100 -/* 0ACDCC 800AC1CC 46283282 */ mul.d $f10, $f6, $f8 -/* 0ACDD0 800AC1D0 46305480 */ add.d $f18, $f10, $f16 -/* 0ACDD4 800AC1D4 46209120 */ cvt.s.d $f4, $f18 -/* 0ACDD8 800AC1D8 14610045 */ bne $v1, $at, .L800AC2F0 -/* 0ACDDC 800AC1DC E4840024 */ swc1 $f4, 0x24($a0) -/* 0ACDE0 800AC1E0 AC890004 */ sw $t1, 4($a0) -/* 0ACDE4 800AC1E4 10000042 */ b .L800AC2F0 -/* 0ACDE8 800AC1E8 AC800018 */ sw $zero, 0x18($a0) -.L800AC1EC: -/* 0ACDEC 800AC1EC 8C8A0018 */ lw $t2, 0x18($a0) -/* 0ACDF0 800AC1F0 3C013FF8 */ li $at, 0x3FF80000 # 1.937500 -/* 0ACDF4 800AC1F4 44814800 */ mtc1 $at, $f9 -/* 0ACDF8 800AC1F8 254B0001 */ addiu $t3, $t2, 1 -/* 0ACDFC 800AC1FC 256CFFF1 */ addiu $t4, $t3, -0xf -/* 0ACE00 800AC200 448C3000 */ mtc1 $t4, $f6 -/* 0ACE04 800AC204 AC8B0018 */ sw $t3, 0x18($a0) -/* 0ACE08 800AC208 AC80001C */ sw $zero, 0x1c($a0) -/* 0ACE0C 800AC20C 46803021 */ cvt.d.w $f0, $f6 -/* 0ACE10 800AC210 3C01800F */ lui $at, %hi(D_800F2670) -/* 0ACE14 800AC214 D42A2670 */ ldc1 $f10, %lo(D_800F2670)($at) -/* 0ACE18 800AC218 44804000 */ mtc1 $zero, $f8 -/* 0ACE1C 800AC21C 29610010 */ slti $at, $t3, 0x10 -/* 0ACE20 800AC220 462A0402 */ mul.d $f16, $f0, $f10 -/* 0ACE24 800AC224 00000000 */ nop -/* 0ACE28 800AC228 46208482 */ mul.d $f18, $f16, $f0 -/* 0ACE2C 800AC22C 46324101 */ sub.d $f4, $f8, $f18 -/* 0ACE30 800AC230 462021A0 */ cvt.s.d $f6, $f4 -/* 0ACE34 800AC234 1420002E */ bnez $at, .L800AC2F0 -/* 0ACE38 800AC238 E4860024 */ swc1 $f6, 0x24($a0) -/* 0ACE3C 800AC23C C48A0024 */ lwc1 $f10, 0x24($a0) -/* 0ACE40 800AC240 3C01800F */ lui $at, %hi(D_800F2678) -/* 0ACE44 800AC244 D4282678 */ ldc1 $f8, %lo(D_800F2678)($at) -/* 0ACE48 800AC248 46005421 */ cvt.d.s $f16, $f10 -/* 0ACE4C 800AC24C 240D0003 */ li $t5, 3 -/* 0ACE50 800AC250 4628803C */ c.lt.d $f16, $f8 -/* 0ACE54 800AC254 00000000 */ nop -/* 0ACE58 800AC258 45020026 */ bc1fl .L800AC2F4 -/* 0ACE5C 800AC25C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0ACE60 800AC260 AC8D0004 */ sw $t5, 4($a0) -/* 0ACE64 800AC264 10000022 */ b .L800AC2F0 -/* 0ACE68 800AC268 AC800018 */ sw $zero, 0x18($a0) -/* 0ACE6C 800AC26C 8C8E0018 */ lw $t6, 0x18($a0) -.L800AC270: -/* 0ACE70 800AC270 3C013FF4 */ li $at, 0x3FF40000 # 1.906250 -/* 0ACE74 800AC274 44812800 */ mtc1 $at, $f5 -/* 0ACE78 800AC278 25CF0001 */ addiu $t7, $t6, 1 -/* 0ACE7C 800AC27C 25F8FFF1 */ addiu $t8, $t7, -0xf -/* 0ACE80 800AC280 44989000 */ mtc1 $t8, $f18 -/* 0ACE84 800AC284 AC8F0018 */ sw $t7, 0x18($a0) -/* 0ACE88 800AC288 AC80001C */ sw $zero, 0x1c($a0) -/* 0ACE8C 800AC28C 46809021 */ cvt.d.w $f0, $f18 -/* 0ACE90 800AC290 3C01800F */ lui $at, %hi(D_800F2680) -/* 0ACE94 800AC294 D4262680 */ ldc1 $f6, %lo(D_800F2680)($at) -/* 0ACE98 800AC298 44802000 */ mtc1 $zero, $f4 -/* 0ACE9C 800AC29C 29E1000D */ slti $at, $t7, 0xd -/* 0ACEA0 800AC2A0 46260282 */ mul.d $f10, $f0, $f6 -/* 0ACEA4 800AC2A4 00000000 */ nop -/* 0ACEA8 800AC2A8 46205402 */ mul.d $f16, $f10, $f0 -/* 0ACEAC 800AC2AC 46302201 */ sub.d $f8, $f4, $f16 -/* 0ACEB0 800AC2B0 462044A0 */ cvt.s.d $f18, $f8 -/* 0ACEB4 800AC2B4 1420000E */ bnez $at, .L800AC2F0 -/* 0ACEB8 800AC2B8 E4920024 */ swc1 $f18, 0x24($a0) -/* 0ACEBC 800AC2BC C4860024 */ lwc1 $f6, 0x24($a0) -/* 0ACEC0 800AC2C0 3C013FF0 */ li $at, 0x3FF00000 # 1.875000 -/* 0ACEC4 800AC2C4 44812800 */ mtc1 $at, $f5 -/* 0ACEC8 800AC2C8 44802000 */ mtc1 $zero, $f4 -/* 0ACECC 800AC2CC 460032A1 */ cvt.d.s $f10, $f6 -/* 0ACED0 800AC2D0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0ACED4 800AC2D4 4624503C */ c.lt.d $f10, $f4 -/* 0ACED8 800AC2D8 00000000 */ nop -/* 0ACEDC 800AC2DC 45020005 */ bc1fl .L800AC2F4 -/* 0ACEE0 800AC2E0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0ACEE4 800AC2E4 44818000 */ mtc1 $at, $f16 -/* 0ACEE8 800AC2E8 00000000 */ nop -/* 0ACEEC 800AC2EC E4900024 */ swc1 $f16, 0x24($a0) -.L800AC2F0: -/* 0ACEF0 800AC2F0 8FBF0014 */ lw $ra, 0x14($sp) -.L800AC2F4: -/* 0ACEF4 800AC2F4 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0ACEF8 800AC2F8 03E00008 */ jr $ra -/* 0ACEFC 800AC2FC 00000000 */ nop diff --git a/asm/non_matchings/code_80091750/func_800AC128.s b/asm/non_matchings/code_80091750/func_800AC128.s new file mode 100644 index 000000000..3855af7b2 --- /dev/null +++ b/asm/non_matchings/code_80091750/func_800AC128.s @@ -0,0 +1,126 @@ +glabel func_800AC128 +/* 0ACD28 800AC128 27BDFFE8 */ addiu $sp, $sp, -0x18 +/* 0ACD2C 800AC12C AFBF0014 */ sw $ra, 0x14($sp) +/* 0ACD30 800AC130 8C820004 */ lw $v0, 4($a0) +/* 0ACD34 800AC134 24010001 */ li $at, 1 +/* 0ACD38 800AC138 240E0140 */ li $t6, 320 +/* 0ACD3C 800AC13C 10400009 */ beqz $v0, .L800AC164 +/* 0ACD40 800AC140 240F0001 */ li $t7, 1 +/* 0ACD44 800AC144 10410009 */ beq $v0, $at, .L800AC16C +/* 0ACD48 800AC148 24010002 */ li $at, 2 +/* 0ACD4C 800AC14C 10410027 */ beq $v0, $at, .L800AC1EC +/* 0ACD50 800AC150 24010003 */ li $at, 3 +/* 0ACD54 800AC154 50410046 */ beql $v0, $at, .L800AC270 +/* 0ACD58 800AC158 8C8E0018 */ lw $t6, 0x18($a0) +/* 0ACD5C 800AC15C 10000065 */ b .L800AC2F4 +/* 0ACD60 800AC160 8FBF0014 */ lw $ra, 0x14($sp) +.L800AC164: +/* 0ACD64 800AC164 AC8E000C */ sw $t6, 0xc($a0) +/* 0ACD68 800AC168 AC8F0004 */ sw $t7, 4($a0) +.L800AC16C: +/* 0ACD6C 800AC16C 24050064 */ li $a1, 100 +/* 0ACD70 800AC170 0C02A503 */ jal func_800A940C +/* 0ACD74 800AC174 AFA40018 */ sw $a0, 0x18($sp) +/* 0ACD78 800AC178 8FA40018 */ lw $a0, 0x18($sp) +/* 0ACD7C 800AC17C 24010006 */ li $at, 6 +/* 0ACD80 800AC180 24190008 */ li $t9, 8 +/* 0ACD84 800AC184 8C83000C */ lw $v1, 0xc($a0) +/* 0ACD88 800AC188 24090002 */ li $t1, 2 +/* 0ACD8C 800AC18C 2462FF9C */ addiu $v0, $v1, -0x64 +/* 0ACD90 800AC190 0041001A */ div $zero, $v0, $at +/* 0ACD94 800AC194 0000C012 */ mflo $t8 +/* 0ACD98 800AC198 2B010009 */ slti $at, $t8, 9 +/* 0ACD9C 800AC19C 14200003 */ bnez $at, .L800AC1AC +/* 0ACDA0 800AC1A0 AC98001C */ sw $t8, 0x1c($a0) +/* 0ACDA4 800AC1A4 AC99001C */ sw $t9, 0x1c($a0) +/* 0ACDA8 800AC1A8 8C83000C */ lw $v1, 0xc($a0) +.L800AC1AC: +/* 0ACDAC 800AC1AC 8C88001C */ lw $t0, 0x1c($a0) +/* 0ACDB0 800AC1B0 3C01800F */ lui $at, %hi(D_800F2660) +/* 0ACDB4 800AC1B4 D4282660 */ ldc1 $f8, %lo(D_800F2660)($at) +/* 0ACDB8 800AC1B8 44882000 */ mtc1 $t0, $f4 +/* 0ACDBC 800AC1BC 3C01800F */ lui $at, %hi(D_800F2668) +/* 0ACDC0 800AC1C0 D4302668 */ ldc1 $f16, %lo(D_800F2668)($at) +/* 0ACDC4 800AC1C4 468021A1 */ cvt.d.w $f6, $f4 +/* 0ACDC8 800AC1C8 24010064 */ li $at, 100 +/* 0ACDCC 800AC1CC 46283282 */ mul.d $f10, $f6, $f8 +/* 0ACDD0 800AC1D0 46305480 */ add.d $f18, $f10, $f16 +/* 0ACDD4 800AC1D4 46209120 */ cvt.s.d $f4, $f18 +/* 0ACDD8 800AC1D8 14610045 */ bne $v1, $at, .L800AC2F0 +/* 0ACDDC 800AC1DC E4840024 */ swc1 $f4, 0x24($a0) +/* 0ACDE0 800AC1E0 AC890004 */ sw $t1, 4($a0) +/* 0ACDE4 800AC1E4 10000042 */ b .L800AC2F0 +/* 0ACDE8 800AC1E8 AC800018 */ sw $zero, 0x18($a0) +.L800AC1EC: +/* 0ACDEC 800AC1EC 8C8A0018 */ lw $t2, 0x18($a0) +/* 0ACDF0 800AC1F0 3C013FF8 */ li $at, 0x3FF80000 # 1.937500 +/* 0ACDF4 800AC1F4 44814800 */ mtc1 $at, $f9 +/* 0ACDF8 800AC1F8 254B0001 */ addiu $t3, $t2, 1 +/* 0ACDFC 800AC1FC 256CFFF1 */ addiu $t4, $t3, -0xf +/* 0ACE00 800AC200 448C3000 */ mtc1 $t4, $f6 +/* 0ACE04 800AC204 AC8B0018 */ sw $t3, 0x18($a0) +/* 0ACE08 800AC208 AC80001C */ sw $zero, 0x1c($a0) +/* 0ACE0C 800AC20C 46803021 */ cvt.d.w $f0, $f6 +/* 0ACE10 800AC210 3C01800F */ lui $at, %hi(D_800F2670) +/* 0ACE14 800AC214 D42A2670 */ ldc1 $f10, %lo(D_800F2670)($at) +/* 0ACE18 800AC218 44804000 */ mtc1 $zero, $f8 +/* 0ACE1C 800AC21C 29610010 */ slti $at, $t3, 0x10 +/* 0ACE20 800AC220 462A0402 */ mul.d $f16, $f0, $f10 +/* 0ACE24 800AC224 00000000 */ nop +/* 0ACE28 800AC228 46208482 */ mul.d $f18, $f16, $f0 +/* 0ACE2C 800AC22C 46324101 */ sub.d $f4, $f8, $f18 +/* 0ACE30 800AC230 462021A0 */ cvt.s.d $f6, $f4 +/* 0ACE34 800AC234 1420002E */ bnez $at, .L800AC2F0 +/* 0ACE38 800AC238 E4860024 */ swc1 $f6, 0x24($a0) +/* 0ACE3C 800AC23C C48A0024 */ lwc1 $f10, 0x24($a0) +/* 0ACE40 800AC240 3C01800F */ lui $at, %hi(D_800F2678) +/* 0ACE44 800AC244 D4282678 */ ldc1 $f8, %lo(D_800F2678)($at) +/* 0ACE48 800AC248 46005421 */ cvt.d.s $f16, $f10 +/* 0ACE4C 800AC24C 240D0003 */ li $t5, 3 +/* 0ACE50 800AC250 4628803C */ c.lt.d $f16, $f8 +/* 0ACE54 800AC254 00000000 */ nop +/* 0ACE58 800AC258 45020026 */ bc1fl .L800AC2F4 +/* 0ACE5C 800AC25C 8FBF0014 */ lw $ra, 0x14($sp) +/* 0ACE60 800AC260 AC8D0004 */ sw $t5, 4($a0) +/* 0ACE64 800AC264 10000022 */ b .L800AC2F0 +/* 0ACE68 800AC268 AC800018 */ sw $zero, 0x18($a0) +/* 0ACE6C 800AC26C 8C8E0018 */ lw $t6, 0x18($a0) +.L800AC270: +/* 0ACE70 800AC270 3C013FF4 */ li $at, 0x3FF40000 # 1.906250 +/* 0ACE74 800AC274 44812800 */ mtc1 $at, $f5 +/* 0ACE78 800AC278 25CF0001 */ addiu $t7, $t6, 1 +/* 0ACE7C 800AC27C 25F8FFF1 */ addiu $t8, $t7, -0xf +/* 0ACE80 800AC280 44989000 */ mtc1 $t8, $f18 +/* 0ACE84 800AC284 AC8F0018 */ sw $t7, 0x18($a0) +/* 0ACE88 800AC288 AC80001C */ sw $zero, 0x1c($a0) +/* 0ACE8C 800AC28C 46809021 */ cvt.d.w $f0, $f18 +/* 0ACE90 800AC290 3C01800F */ lui $at, %hi(D_800F2680) +/* 0ACE94 800AC294 D4262680 */ ldc1 $f6, %lo(D_800F2680)($at) +/* 0ACE98 800AC298 44802000 */ mtc1 $zero, $f4 +/* 0ACE9C 800AC29C 29E1000D */ slti $at, $t7, 0xd +/* 0ACEA0 800AC2A0 46260282 */ mul.d $f10, $f0, $f6 +/* 0ACEA4 800AC2A4 00000000 */ nop +/* 0ACEA8 800AC2A8 46205402 */ mul.d $f16, $f10, $f0 +/* 0ACEAC 800AC2AC 46302201 */ sub.d $f8, $f4, $f16 +/* 0ACEB0 800AC2B0 462044A0 */ cvt.s.d $f18, $f8 +/* 0ACEB4 800AC2B4 1420000E */ bnez $at, .L800AC2F0 +/* 0ACEB8 800AC2B8 E4920024 */ swc1 $f18, 0x24($a0) +/* 0ACEBC 800AC2BC C4860024 */ lwc1 $f6, 0x24($a0) +/* 0ACEC0 800AC2C0 3C013FF0 */ li $at, 0x3FF00000 # 1.875000 +/* 0ACEC4 800AC2C4 44812800 */ mtc1 $at, $f5 +/* 0ACEC8 800AC2C8 44802000 */ mtc1 $zero, $f4 +/* 0ACECC 800AC2CC 460032A1 */ cvt.d.s $f10, $f6 +/* 0ACED0 800AC2D0 3C013F80 */ li $at, 0x3F800000 # 1.000000 +/* 0ACED4 800AC2D4 4624503C */ c.lt.d $f10, $f4 +/* 0ACED8 800AC2D8 00000000 */ nop +/* 0ACEDC 800AC2DC 45020005 */ bc1fl .L800AC2F4 +/* 0ACEE0 800AC2E0 8FBF0014 */ lw $ra, 0x14($sp) +/* 0ACEE4 800AC2E4 44818000 */ mtc1 $at, $f16 +/* 0ACEE8 800AC2E8 00000000 */ nop +/* 0ACEEC 800AC2EC E4900024 */ swc1 $f16, 0x24($a0) +.L800AC2F0: +/* 0ACEF0 800AC2F0 8FBF0014 */ lw $ra, 0x14($sp) +.L800AC2F4: +/* 0ACEF4 800AC2F4 27BD0018 */ addiu $sp, $sp, 0x18 +/* 0ACEF8 800AC2F8 03E00008 */ jr $ra +/* 0ACEFC 800AC2FC 00000000 */ nop diff --git a/asm/non_matchings/code_80091750/func_800AC324.s b/asm/non_matchings/code_80091750/func_800AC324.s deleted file mode 100644 index a00e63ff2..000000000 --- a/asm/non_matchings/code_80091750/func_800AC324.s +++ /dev/null @@ -1,87 +0,0 @@ -glabel func_800AC324 -/* 0ACF24 800AC324 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0ACF28 800AC328 AFBF001C */ sw $ra, 0x1c($sp) -/* 0ACF2C 800AC32C AFB00018 */ sw $s0, 0x18($sp) -/* 0ACF30 800AC330 8C820004 */ lw $v0, 4($a0) -/* 0ACF34 800AC334 00808025 */ move $s0, $a0 -/* 0ACF38 800AC338 240E014A */ li $t6, 330 -/* 0ACF3C 800AC33C 1040000B */ beqz $v0, .L800AC36C -/* 0ACF40 800AC340 240F0001 */ li $t7, 1 -/* 0ACF44 800AC344 24010001 */ li $at, 1 -/* 0ACF48 800AC348 1041000D */ beq $v0, $at, .L800AC380 -/* 0ACF4C 800AC34C 02002025 */ move $a0, $s0 -/* 0ACF50 800AC350 24010002 */ li $at, 2 -/* 0ACF54 800AC354 10410014 */ beq $v0, $at, .L800AC3A8 -/* 0ACF58 800AC358 24010003 */ li $at, 3 -/* 0ACF5C 800AC35C 5041002B */ beql $v0, $at, .L800AC40C -/* 0ACF60 800AC360 8E02001C */ lw $v0, 0x1c($s0) -/* 0ACF64 800AC364 10000038 */ b .L800AC448 -/* 0ACF68 800AC368 8FBF001C */ lw $ra, 0x1c($sp) -.L800AC36C: -/* 0ACF6C 800AC36C AE0E000C */ sw $t6, 0xc($s0) -/* 0ACF70 800AC370 0C02486D */ jal func_800921B4 -/* 0ACF74 800AC374 AE0F0004 */ sw $t7, 4($s0) -/* 0ACF78 800AC378 10000033 */ b .L800AC448 -/* 0ACF7C 800AC37C 8FBF001C */ lw $ra, 0x1c($sp) -.L800AC380: -/* 0ACF80 800AC380 0C02A482 */ jal func_800A9208 -/* 0ACF84 800AC384 240500A0 */ li $a1, 160 -/* 0ACF88 800AC388 8E18000C */ lw $t8, 0xc($s0) -/* 0ACF8C 800AC38C 240100A0 */ li $at, 160 -/* 0ACF90 800AC390 24190002 */ li $t9, 2 -/* 0ACF94 800AC394 5701002C */ bnel $t8, $at, .L800AC448 -/* 0ACF98 800AC398 8FBF001C */ lw $ra, 0x1c($sp) -/* 0ACF9C 800AC39C AE190004 */ sw $t9, 4($s0) -/* 0ACFA0 800AC3A0 10000028 */ b .L800AC444 -/* 0ACFA4 800AC3A4 AE000020 */ sw $zero, 0x20($s0) -.L800AC3A8: -/* 0ACFA8 800AC3A8 8E080020 */ lw $t0, 0x20($s0) -/* 0ACFAC 800AC3AC 3C0A8019 */ lui $t2, %hi(D_8018D9D8) # $t2, 0x8019 -/* 0ACFB0 800AC3B0 3C0C800E */ lui $t4, %hi(D_800DDB24) # $t4, 0x800e -/* 0ACFB4 800AC3B4 25090001 */ addiu $t1, $t0, 1 -/* 0ACFB8 800AC3B8 AE090020 */ sw $t1, 0x20($s0) -/* 0ACFBC 800AC3BC 814AD9D8 */ lb $t2, %lo(D_8018D9D8)($t2) -/* 0ACFC0 800AC3C0 2921005B */ slti $at, $t1, 0x5b -/* 0ACFC4 800AC3C4 15400003 */ bnez $t2, .L800AC3D4 -/* 0ACFC8 800AC3C8 00000000 */ nop -/* 0ACFCC 800AC3CC 5420001E */ bnel $at, $zero, .L800AC448 -/* 0ACFD0 800AC3D0 8FBF001C */ lw $ra, 0x1c($sp) -.L800AC3D4: -/* 0ACFD4 800AC3D4 8D8CDB24 */ lw $t4, %lo(D_800DDB24)($t4) -/* 0ACFD8 800AC3D8 240D0003 */ li $t5, 3 -/* 0ACFDC 800AC3DC 240400AB */ li $a0, 171 -/* 0ACFE0 800AC3E0 11800018 */ beqz $t4, .L800AC444 -/* 0ACFE4 800AC3E4 00002825 */ move $a1, $zero -/* 0ACFE8 800AC3E8 8E0E000C */ lw $t6, 0xc($s0) -/* 0ACFEC 800AC3EC AE0D0004 */ sw $t5, 4($s0) -/* 0ACFF0 800AC3F0 00003025 */ move $a2, $zero -/* 0ACFF4 800AC3F4 00003825 */ move $a3, $zero -/* 0ACFF8 800AC3F8 0C027994 */ jal add_8018D9E0_entry -/* 0ACFFC 800AC3FC AE0E001C */ sw $t6, 0x1c($s0) -/* 0AD000 800AC400 10000011 */ b .L800AC448 -/* 0AD004 800AC404 8FBF001C */ lw $ra, 0x1c($sp) -/* 0AD008 800AC408 8E02001C */ lw $v0, 0x1c($s0) -.L800AC40C: -/* 0AD00C 800AC40C 3C0F8019 */ lui $t7, %hi(D_8018D9D8) # $t7, 0x8019 -/* 0AD010 800AC410 2841014A */ slti $at, $v0, 0x14a -/* 0AD014 800AC414 1020000A */ beqz $at, .L800AC440 -/* 0AD018 800AC418 AE02000C */ sw $v0, 0xc($s0) -/* 0AD01C 800AC41C 81EFD9D8 */ lb $t7, %lo(D_8018D9D8)($t7) -/* 0AD020 800AC420 24580020 */ addiu $t8, $v0, 0x20 -/* 0AD024 800AC424 24590010 */ addiu $t9, $v0, 0x10 -/* 0AD028 800AC428 11E00003 */ beqz $t7, .L800AC438 -/* 0AD02C 800AC42C 00000000 */ nop -/* 0AD030 800AC430 10000004 */ b .L800AC444 -/* 0AD034 800AC434 AE18001C */ sw $t8, 0x1c($s0) -.L800AC438: -/* 0AD038 800AC438 10000002 */ b .L800AC444 -/* 0AD03C 800AC43C AE19001C */ sw $t9, 0x1c($s0) -.L800AC440: -/* 0AD040 800AC440 AE000000 */ sw $zero, ($s0) -.L800AC444: -/* 0AD044 800AC444 8FBF001C */ lw $ra, 0x1c($sp) -.L800AC448: -/* 0AD048 800AC448 8FB00018 */ lw $s0, 0x18($sp) -/* 0AD04C 800AC44C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0AD050 800AC450 03E00008 */ jr $ra -/* 0AD054 800AC454 00000000 */ nop diff --git a/asm/non_matchings/memory/func_802AEE1C.s b/asm/non_matchings/memory/func_802AEE1C.s deleted file mode 100644 index 3fda7fb86..000000000 --- a/asm/non_matchings/memory/func_802AEE1C.s +++ /dev/null @@ -1,210 +0,0 @@ -glabel func_802AEE1C -/* 11842C 802AEE1C 87AC001A */ lh $t4, 0x1a($sp) -/* 118430 802AEE20 87AD0012 */ lh $t5, 0x12($sp) -/* 118434 802AEE24 00047400 */ sll $t6, $a0, 0x10 -/* 118438 802AEE28 000E7C03 */ sra $t7, $t6, 0x10 -/* 11843C 802AEE2C 018D7023 */ subu $t6, $t4, $t5 -/* 118440 802AEE30 448E2000 */ mtc1 $t6, $f4 -/* 118444 802AEE34 44806000 */ mtc1 $zero, $f12 -/* 118448 802AEE38 AFA40000 */ sw $a0, ($sp) -/* 11844C 802AEE3C 46802020 */ cvt.s.w $f0, $f4 -/* 118450 802AEE40 AFA50004 */ sw $a1, 4($sp) -/* 118454 802AEE44 0005C400 */ sll $t8, $a1, 0x10 -/* 118458 802AEE48 AFA60008 */ sw $a2, 8($sp) -/* 11845C 802AEE4C 00064400 */ sll $t0, $a2, 0x10 -/* 118460 802AEE50 AFA7000C */ sw $a3, 0xc($sp) -/* 118464 802AEE54 46006032 */ c.eq.s $f12, $f0 -/* 118468 802AEE58 00075400 */ sll $t2, $a3, 0x10 -/* 11846C 802AEE5C 000A3C03 */ sra $a3, $t2, 0x10 -/* 118470 802AEE60 00083403 */ sra $a2, $t0, 0x10 -/* 118474 802AEE64 00182C03 */ sra $a1, $t8, 0x10 -/* 118478 802AEE68 45000022 */ bc1f .L802AEEF4 -/* 11847C 802AEE6C 01E02025 */ move $a0, $t7 -/* 118480 802AEE70 01AF082A */ slt $at, $t5, $t7 -/* 118484 802AEE74 10200003 */ beqz $at, .L802AEE84 -/* 118488 802AEE78 87AF0012 */ lh $t7, 0x12($sp) -/* 11848C 802AEE7C 03E00008 */ jr $ra -/* 118490 802AEE80 00001025 */ move $v0, $zero - -.L802AEE84: -/* 118494 802AEE84 00AF082A */ slt $at, $a1, $t7 -/* 118498 802AEE88 10200003 */ beqz $at, .L802AEE98 -/* 11849C 802AEE8C 87A2001E */ lh $v0, 0x1e($sp) -/* 1184A0 802AEE90 03E00008 */ jr $ra -/* 1184A4 802AEE94 00001025 */ move $v0, $zero - -.L802AEE98: -/* 1184A8 802AEE98 87A30016 */ lh $v1, 0x16($sp) -/* 1184AC 802AEE9C 0046082A */ slt $at, $v0, $a2 -/* 1184B0 802AEEA0 0043C023 */ subu $t8, $v0, $v1 -/* 1184B4 802AEEA4 44983000 */ mtc1 $t8, $f6 -/* 1184B8 802AEEA8 00000000 */ nop -/* 1184BC 802AEEAC 46803220 */ cvt.s.w $f8, $f6 -/* 1184C0 802AEEB0 4608603C */ c.lt.s $f12, $f8 -/* 1184C4 802AEEB4 00000000 */ nop -/* 1184C8 802AEEB8 45000008 */ bc1f .L802AEEDC -/* 1184CC 802AEEBC 00000000 */ nop -/* 1184D0 802AEEC0 0066082A */ slt $at, $v1, $a2 -/* 1184D4 802AEEC4 1020008A */ beqz $at, .L802AF0F0 -/* 1184D8 802AEEC8 00E2082A */ slt $at, $a3, $v0 -/* 1184DC 802AEECC 50200089 */ beql $at, $zero, .L802AF0F4 -/* 1184E0 802AEED0 00001025 */ move $v0, $zero -/* 1184E4 802AEED4 03E00008 */ jr $ra -/* 1184E8 802AEED8 24020001 */ li $v0, 1 - -.L802AEEDC: -/* 1184EC 802AEEDC 10200084 */ beqz $at, .L802AF0F0 -/* 1184F0 802AEEE0 00E3082A */ slt $at, $a3, $v1 -/* 1184F4 802AEEE4 50200083 */ beql $at, $zero, .L802AF0F4 -/* 1184F8 802AEEE8 00001025 */ move $v0, $zero -/* 1184FC 802AEEEC 03E00008 */ jr $ra -/* 118500 802AEEF0 24020001 */ li $v0, 1 - -.L802AEEF4: -/* 118504 802AEEF4 87A2001E */ lh $v0, 0x1e($sp) -/* 118508 802AEEF8 87A30016 */ lh $v1, 0x16($sp) -/* 11850C 802AEEFC 87AC0012 */ lh $t4, 0x12($sp) -/* 118510 802AEF00 0043C823 */ subu $t9, $v0, $v1 -/* 118514 802AEF04 44995000 */ mtc1 $t9, $f10 -/* 118518 802AEF08 0066082A */ slt $at, $v1, $a2 -/* 11851C 802AEF0C 468050A0 */ cvt.s.w $f2, $f10 -/* 118520 802AEF10 460C1032 */ c.eq.s $f2, $f12 -/* 118524 802AEF14 00000000 */ nop -/* 118528 802AEF18 4502001F */ bc1fl .L802AEF98 -/* 11852C 802AEF1C 46020403 */ div.s $f16, $f0, $f2 -/* 118530 802AEF20 50200004 */ beql $at, $zero, .L802AEF34 -/* 118534 802AEF24 00E3082A */ slt $at, $a3, $v1 -/* 118538 802AEF28 03E00008 */ jr $ra -/* 11853C 802AEF2C 00001025 */ move $v0, $zero - -/* 118540 802AEF30 00E3082A */ slt $at, $a3, $v1 -.L802AEF34: -/* 118544 802AEF34 50200004 */ beql $at, $zero, .L802AEF48 -/* 118548 802AEF38 4600603C */ c.lt.s $f12, $f0 -/* 11854C 802AEF3C 03E00008 */ jr $ra -/* 118550 802AEF40 00001025 */ move $v0, $zero - -/* 118554 802AEF44 4600603C */ c.lt.s $f12, $f0 -.L802AEF48: -/* 118558 802AEF48 87AA001A */ lh $t2, 0x1a($sp) -/* 11855C 802AEF4C 87A80012 */ lh $t0, 0x12($sp) -/* 118560 802AEF50 45000009 */ bc1f .L802AEF78 -/* 118564 802AEF54 0144082A */ slt $at, $t2, $a0 -/* 118568 802AEF58 0104082A */ slt $at, $t0, $a0 -/* 11856C 802AEF5C 10200064 */ beqz $at, .L802AF0F0 -/* 118570 802AEF60 87A9001A */ lh $t1, 0x1a($sp) -/* 118574 802AEF64 00A9082A */ slt $at, $a1, $t1 -/* 118578 802AEF68 50200062 */ beql $at, $zero, .L802AF0F4 -/* 11857C 802AEF6C 00001025 */ move $v0, $zero -/* 118580 802AEF70 03E00008 */ jr $ra -/* 118584 802AEF74 24020001 */ li $v0, 1 - -.L802AEF78: -/* 118588 802AEF78 1020005D */ beqz $at, .L802AF0F0 -/* 11858C 802AEF7C 87AB0012 */ lh $t3, 0x12($sp) -/* 118590 802AEF80 00AB082A */ slt $at, $a1, $t3 -/* 118594 802AEF84 5020005B */ beql $at, $zero, .L802AF0F4 -/* 118598 802AEF88 00001025 */ move $v0, $zero -/* 11859C 802AEF8C 03E00008 */ jr $ra -/* 1185A0 802AEF90 24020001 */ li $v0, 1 - -/* 1185A4 802AEF94 46020403 */ div.s $f16, $f0, $f2 -.L802AEF98: -/* 1185A8 802AEF98 00C37023 */ subu $t6, $a2, $v1 -/* 1185AC 802AEF9C 448E3000 */ mtc1 $t6, $f6 -/* 1185B0 802AEFA0 448C2000 */ mtc1 $t4, $f4 -/* 1185B4 802AEFA4 00E36823 */ subu $t5, $a3, $v1 -/* 1185B8 802AEFA8 46803220 */ cvt.s.w $f8, $f6 -/* 1185BC 802AEFAC 46802320 */ cvt.s.w $f12, $f4 -/* 1185C0 802AEFB0 44842000 */ mtc1 $a0, $f4 -/* 1185C4 802AEFB4 00000000 */ nop -/* 1185C8 802AEFB8 468023A0 */ cvt.s.w $f14, $f4 -/* 1185CC 802AEFBC 46088282 */ mul.s $f10, $f16, $f8 -/* 1185D0 802AEFC0 460C5480 */ add.s $f18, $f10, $f12 -/* 1185D4 802AEFC4 4612703E */ c.le.s $f14, $f18 -/* 1185D8 802AEFC8 00000000 */ nop -/* 1185DC 802AEFCC 4502000B */ bc1fl .L802AEFFC -/* 1185E0 802AEFD0 448D5000 */ mtc1 $t5, $f10 -/* 1185E4 802AEFD4 44853000 */ mtc1 $a1, $f6 -/* 1185E8 802AEFD8 00000000 */ nop -/* 1185EC 802AEFDC 46803220 */ cvt.s.w $f8, $f6 -/* 1185F0 802AEFE0 4608903E */ c.le.s $f18, $f8 -/* 1185F4 802AEFE4 00000000 */ nop -/* 1185F8 802AEFE8 45020004 */ bc1fl .L802AEFFC -/* 1185FC 802AEFEC 448D5000 */ mtc1 $t5, $f10 -/* 118600 802AEFF0 03E00008 */ jr $ra -/* 118604 802AEFF4 24020001 */ li $v0, 1 - -/* 118608 802AEFF8 448D5000 */ mtc1 $t5, $f10 -.L802AEFFC: -/* 11860C 802AEFFC 00000000 */ nop -/* 118610 802AF000 46805120 */ cvt.s.w $f4, $f10 -/* 118614 802AF004 46048182 */ mul.s $f6, $f16, $f4 -/* 118618 802AF008 460C3480 */ add.s $f18, $f6, $f12 -/* 11861C 802AF00C 4612703E */ c.le.s $f14, $f18 -/* 118620 802AF010 00000000 */ nop -/* 118624 802AF014 4502000B */ bc1fl .L802AF044 -/* 118628 802AF018 46001403 */ div.s $f16, $f2, $f0 -/* 11862C 802AF01C 44854000 */ mtc1 $a1, $f8 -/* 118630 802AF020 00000000 */ nop -/* 118634 802AF024 468042A0 */ cvt.s.w $f10, $f8 -/* 118638 802AF028 460A903E */ c.le.s $f18, $f10 -/* 11863C 802AF02C 00000000 */ nop -/* 118640 802AF030 45020004 */ bc1fl .L802AF044 -/* 118644 802AF034 46001403 */ div.s $f16, $f2, $f0 -/* 118648 802AF038 03E00008 */ jr $ra -/* 11864C 802AF03C 24020001 */ li $v0, 1 - -/* 118650 802AF040 46001403 */ div.s $f16, $f2, $f0 -.L802AF044: -/* 118654 802AF044 87AF0012 */ lh $t7, 0x12($sp) -/* 118658 802AF048 44832000 */ mtc1 $v1, $f4 -/* 11865C 802AF04C 87B90012 */ lh $t9, 0x12($sp) -/* 118660 802AF050 008FC023 */ subu $t8, $a0, $t7 -/* 118664 802AF054 44983000 */ mtc1 $t8, $f6 -/* 118668 802AF058 46802320 */ cvt.s.w $f12, $f4 -/* 11866C 802AF05C 44862000 */ mtc1 $a2, $f4 -/* 118670 802AF060 46803220 */ cvt.s.w $f8, $f6 -/* 118674 802AF064 468023A0 */ cvt.s.w $f14, $f4 -/* 118678 802AF068 46088282 */ mul.s $f10, $f16, $f8 -/* 11867C 802AF06C 460C5480 */ add.s $f18, $f10, $f12 -/* 118680 802AF070 4612703E */ c.le.s $f14, $f18 -/* 118684 802AF074 00000000 */ nop -/* 118688 802AF078 4502000B */ bc1fl .L802AF0A8 -/* 11868C 802AF07C 00B94023 */ subu $t0, $a1, $t9 -/* 118690 802AF080 44873000 */ mtc1 $a3, $f6 -/* 118694 802AF084 00000000 */ nop -/* 118698 802AF088 46803220 */ cvt.s.w $f8, $f6 -/* 11869C 802AF08C 4608903E */ c.le.s $f18, $f8 -/* 1186A0 802AF090 00000000 */ nop -/* 1186A4 802AF094 45020004 */ bc1fl .L802AF0A8 -/* 1186A8 802AF098 00B94023 */ subu $t0, $a1, $t9 -/* 1186AC 802AF09C 03E00008 */ jr $ra -/* 1186B0 802AF0A0 24020001 */ li $v0, 1 - -/* 1186B4 802AF0A4 00B94023 */ subu $t0, $a1, $t9 -.L802AF0A8: -/* 1186B8 802AF0A8 44885000 */ mtc1 $t0, $f10 -/* 1186BC 802AF0AC 00000000 */ nop -/* 1186C0 802AF0B0 46805120 */ cvt.s.w $f4, $f10 -/* 1186C4 802AF0B4 46048182 */ mul.s $f6, $f16, $f4 -/* 1186C8 802AF0B8 460C3000 */ add.s $f0, $f6, $f12 -/* 1186CC 802AF0BC 4600703E */ c.le.s $f14, $f0 -/* 1186D0 802AF0C0 00000000 */ nop -/* 1186D4 802AF0C4 4502000B */ bc1fl .L802AF0F4 -/* 1186D8 802AF0C8 00001025 */ move $v0, $zero -/* 1186DC 802AF0CC 44874000 */ mtc1 $a3, $f8 -/* 1186E0 802AF0D0 00000000 */ nop -/* 1186E4 802AF0D4 468042A0 */ cvt.s.w $f10, $f8 -/* 1186E8 802AF0D8 460A003E */ c.le.s $f0, $f10 -/* 1186EC 802AF0DC 00000000 */ nop -/* 1186F0 802AF0E0 45020004 */ bc1fl .L802AF0F4 -/* 1186F4 802AF0E4 00001025 */ move $v0, $zero -/* 1186F8 802AF0E8 03E00008 */ jr $ra -/* 1186FC 802AF0EC 24020001 */ li $v0, 1 - -.L802AF0F0: -/* 118700 802AF0F0 00001025 */ move $v0, $zero -.L802AF0F4: -/* 118704 802AF0F4 03E00008 */ jr $ra -/* 118708 802AF0F8 00000000 */ nop diff --git a/data/data_0DD0A0_3_0.s b/data/data_0DD0A0_3_0.s index 284bb3798..a19e08296 100644 --- a/data/data_0DD0A0_3_0.s +++ b/data/data_0DD0A0_3_0.s @@ -2980,6 +2980,9 @@ glabel D_800F0C78 .balign 4 +# D_800F0C7C, D_800F0C80, D_800F0C88, and D_800F0C90 are strings with +# some weird encoding +# See data_credits_128480_2.s for more details glabel D_800F0C7C # "ー" .byte 0xa1, 0xbc, 0x00 .balign 4 diff --git a/include/objects.h b/include/objects.h index d51f88455..16992c750 100644 --- a/include/objects.h +++ b/include/objects.h @@ -23,13 +23,13 @@ typedef struct /* 0x54 */ s32 unk_054; /* 0x58 */ s32 unk_058; /* 0x5C */ s32 unk_05C; - /* 0x60 */ s32* unk_060; - /* 0x64 */ s32* unk_064; - /* 0x68 */ s32* unk_068; - /* 0x6C */ s32 unk_06C; + /* 0x60 */ s32 *unk_060; + /* 0x64 */ s8 *unk_064; + /* 0x68 */ s32 *unk_068; + /* 0x6C */ s8 *unk_06C; /* 0x70 */ s32 unk_070; // For at least 1 object type this is meant to be a Vtx*. See func_800555BC - /* 0x74 */ s32 unk_074; + /* 0x74 */ Vtx *unk_074; /* 0x78 */ s8 unk_078[0x04]; /* 0x7C */ s32 unk_07C; /* 0x80 */ s32 unk_080; diff --git a/src/actors.h b/src/actors.h index 0c9603ae8..885f19c22 100644 --- a/src/actors.h +++ b/src/actors.h @@ -112,7 +112,6 @@ void update_simple_objects(); // audio/external.c extern void func_800C98B8(Vec3f, Vec3f, u32); -extern void func_800C9060(u8, s32); extern void func_800C90F4(u8, uintptr_t); extern void func_800C99E0(Vec3f, s32); extern void func_800C9D80(Vec3f, Vec3f, u32); diff --git a/src/audio/external.h b/src/audio/external.h index e2f290bbf..0cabd6841 100644 --- a/src/audio/external.h +++ b/src/audio/external.h @@ -6,6 +6,7 @@ void play_sound2(s32); void func_800C8EAC(u16); void func_800C8EF8(); +void func_800C9060(u8, u32); void func_800C90F4(u8, uintptr_t); void func_800CA008(u8, u8); void func_800CA0A0(); diff --git a/src/camera.c b/src/camera.c index d768b6562..d8a3ce6e6 100644 --- a/src/camera.c +++ b/src/camera.c @@ -4,6 +4,10 @@ #include #include "camera.h" #include "math_util.h" +#include "memory.h" +#include "waypoints.h" +#include "variables.h" +#include "code_8001F980.h" Camera cameras[4]; Camera *camera1 = &cameras[0]; @@ -11,6 +15,11 @@ Camera *camera2 = &cameras[1]; Camera *camera3 = &cameras[2]; Camera *camera4 = &cameras[3]; +// Future BSS section, replaces unknown amount of stuff in bss_8001C4D0.s +// f32 D_80164A30; +// s32 D_80164A2C; +// f32 D_8016524C; <- could maybe, maybe be part of spawn_players' bss stuff? + #ifdef MIPS_TO_C //generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de void func_80014DE4(s32, s32, s32, Camera *); /* extern */ @@ -67,7 +76,7 @@ void func_8001C4D0(f32 posX, f32 posY, f32 posZ, s16 rot, u32 arg4, s32 cameraId temp_a3->pos[0] = posX; temp_a3->pos[1] = posY; temp_a3->pos[2] = posZ; - temp_a3->rotZ = 0; + temp_a3->someBitFlags = 0; temp_a3->lookAt[2] = 150.0f; temp_a3->lookAt[1] = (f32) ((f64) posY - 3.0); temp_a3->lookAt[0] = 0.0f; @@ -221,74 +230,57 @@ void func_8001CA24(Player *player, f32 arg1) { camera->unk_94 = arg1; } -#ifdef MIPS_TO_C -//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9 -void func_802B6540(f32 *, ?, f32, ?, s32); /* extern */ -extern f32 D_80164A30; -s16 gCurrentCourseId; /* unable to generate initializer */ - -void func_8001CA78(s32 arg0, Camera *camera, f32 *arg2, f32 *arg3, f32 *arg4, f32 *arg5) { - f32 sp74; - f32 sp70; - f32 sp6C; - f32 sp68; - f32 sp64; - f32 sp60; - f32 sp5C; - f32 sp4C; - f32 sp48; - f32 sp44; - f32 temp_f0; - f32 temp_f12; - f32 temp_f16; - f32 temp_f18; - f32 temp_f2; +void func_8001CA78(Player *player, Camera *camera, Vec3f arg2, f32 *arg3, f32 *arg4, f32 *arg5, s16 huh, s8 wut) { + Mat3 sp74; + Vec3f sp68; + Vec3f sp5C; + f32 posX; + f32 posY; + f32 posZ; f32 var_f14; - f32 var_f14_2; + f32 temp_f18; + f32 temp_f16; + s32 stackPadding0; struct TrackWayPoint *temp_s2; - sp68 = camera->unk_30[0]; - sp6C = camera->unk_30[1]; - sp70 = camera->unk_30[2]; - sp5C = camera->unk_3C[0]; - sp60 = camera->unk_3C[1]; - sp64 = camera->unk_3C[2]; - arg2->unk0 = camera->lookAt[0]; - temp_s2 = &(*D_80164550)[*gWaypointCountByPathIndex - 0xA]; - arg2->unk4 = (f32) camera->lookAt[1]; - arg2->unk8 = (f32) camera->lookAt[2]; - func_802B6540(&sp74, 0, 1.0f, 0, -0x00008000); - func_802B63B8(&sp5C, &sp74); - if (gCurrentCourseId == 0x000A) { - var_f14 = sp5C; + temp_s2 = &D_80164550[0][gWaypointCountByPathIndex[0] - 10]; + sp68[0] = camera->unk_30[0]; + sp68[1] = camera->unk_30[1]; + sp68[2] = camera->unk_30[2]; + sp5C[0] = camera->unk_3C[0]; + sp5C[1] = camera->unk_3C[1]; + sp5C[2] = camera->unk_3C[2]; + arg2[0] = camera->lookAt[0]; + arg2[1] = camera->lookAt[1]; + arg2[2] = camera->lookAt[2]; + func_802B6540(sp74, 0, 1, 0, -0x00008000); + func_802B63B8(sp5C, sp74); + if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) { + var_f14 = sp5C[0]; } else { - var_f14 = sp5C + (f32) temp_s2->wayPointX; + var_f14 = sp5C[0] + temp_s2->wayPointX; } - arg2->unk0 += (var_f14 - camera->lookAt[0]) * 1.0f; - arg2->unk4 = (f32) (arg2->unk4 + (((sp60 + ((f32) temp_s2->wayPointY + D_80164A30)) - camera->lookAt[1]) * 1.0f)); - arg2->unk8 = (f32) (arg2->unk8 + (((sp64 + (bitwise f32) D_8016524C) - camera->lookAt[2]) * 1.0f)); - func_802B63B8(&sp68, &sp74); - if (gCurrentCourseId == 0x000A) { - var_f14_2 = sp68; + temp_f16 = sp5C[2] + D_8016524C; + temp_f18 = sp5C[1] + (temp_s2->wayPointY + D_80164A30); + arg2[0] += (var_f14 - camera->lookAt[0]) * 1; + arg2[1] += (temp_f18 - camera->lookAt[1]) * 1; + arg2[2] += (temp_f16 - camera->lookAt[2]) * 1; + func_802B63B8(sp68, sp74); + if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) { + var_f14 = sp68[0]; } else { - var_f14_2 = sp68 + (f32) temp_s2->wayPointX; + var_f14 = sp68[0] + temp_s2->wayPointX; } - sp4C = var_f14_2; - temp_f16 = sp70 + (bitwise f32) D_8016524C; - sp44 = temp_f16; - temp_f18 = sp6C + ((f32) temp_s2->wayPointY + D_80164A30 + 6.0f); - sp48 = temp_f18; - move_f32_towards(&D_80164A30, 0.0f, 0.02f); - temp_f0 = camera->pos[0]; - *arg3 = ((var_f14_2 - temp_f0) * 1.0f) + temp_f0; - temp_f2 = camera->pos[1]; - *arg4 = ((temp_f18 - temp_f2) * 1.0f) + temp_f2; - temp_f12 = camera->pos[2]; - *arg5 = ((temp_f16 - temp_f12) * 1.0f) + temp_f12; + temp_f16 = sp68[2] + D_8016524C; + temp_f18 = sp68[1] + (temp_s2->wayPointY + D_80164A30 + 6.0f); + move_f32_towards(&D_80164A30, 0, 0.02f); + posX = camera->pos[0]; + *arg3 = ((var_f14 - posX) * 1) + posX; + posY = camera->pos[1]; + *arg4 = ((temp_f18 - posY) * 1) + posY; + posZ = camera->pos[2]; + *arg5 = ((temp_f16 - posZ) * 1) + posZ; } -#else -GLOBAL_ASM("asm/non_matchings/camera/func_8001CA78.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9 @@ -496,13 +488,11 @@ GLOBAL_ASM("asm/non_matchings/camera/func_8001CCEC.s") #endif #ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -void func_802B6540(f32 *, f32, ?, f32, s32); /* extern */ +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c extern ? D_80164A90; extern ? D_80164AA0; void func_8001D53C(Player *player, Camera *camera, f32 *arg2, f32 *arg3, f32 *arg4, f32 *arg5, s16 arg6, s16 arg7) { - f32 sp74; f32 sp70; f32 sp6C; f32 sp68; @@ -532,12 +522,12 @@ void func_8001D53C(Player *player, Camera *camera, f32 *arg2, f32 *arg3, f32 *ar arg2->unk4 = (f32) camera->lookAt[1]; arg2->unk8 = (f32) camera->lookAt[2]; sp38 = arg7 * 4; - func_802B6540(&sp74, 0.0f, 0x3F800000, 0.0f, (s32) arg6); - func_802B63B8(&sp5C, &sp74); + func_802B6540((f32 (*)[3]) &sp74[0], 0.0f, 1.0f, 0.0f, (s16) (s32) arg6); + func_802B63B8(&sp5C, (f32 (*)[3]) &sp74[0]); arg2->unk0 += ((sp5C + player->pos[0]) - camera->lookAt[0]) * 1.0f; arg2->unk8 = (f32) (arg2->unk8 + (((sp64 + player->pos[2]) - camera->lookAt[2]) * 1.0f)); arg2->unk4 = (f32) (arg2->unk4 + (((sp60 + player->pos[1]) - camera->lookAt[1]) * 1.0f)); - func_802B63B8(&sp68, &sp74); + func_802B63B8(&sp68, (f32 (*)[3]) &sp74[0]); var_f0 = (f32) ((f64) sp6C + ((f64) player->unk_074 + 1.5)); if ((player->unk_0CA & 1) == 1) { var_f0 = sp6C + (sp3C + 10.0f); @@ -776,79 +766,66 @@ void func_8001D944(Player *player, Camera *camera, f32 *arg2, f32 *arg3, f32 *ar GLOBAL_ASM("asm/non_matchings/camera/func_8001D944.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -void func_8001CA78(Player *, Camera *, f32 *, f32 *, f32 *, f32 *, s32, s32); /* extern */ - void func_8001E0C4(Camera *camera, Player *player, s8 arg2) { - f32 sp84; + s32 stackPadding0[6]; + f32 temp_f12; f32 sp80; - f32 sp7C; + f32 temp_f14; + s32 stackPadding1; f32 sp74; f32 sp70; f32 sp6C; - f32 sp60; - f32 temp_f0; - f32 temp_f12; - f32 temp_f14; - f32 temp_f2; - f32 temp_f2_2; - s16 temp_v0; + Vec3f sp60; + s16 temp_t7; s16 var_a2; + s32 stackPadding2[5]; + s32 stackPadding3[3]; + s32 test = 3; - temp_v0 = player->unk_078; - if (temp_v0 == 0) { + if (player->unk_078 == 0) { var_a2 = 0x0064; - } else if (temp_v0 < 0) { - var_a2 = 0x87 - (temp_v0 / 3); + } else if (player->unk_078 < 0) { + var_a2 = 0x87 - (player->unk_078 / 3); } else { - var_a2 = (temp_v0 / 3) + 0x87; + var_a2 = (player->unk_078 / 3) + 0x87; } func_800224F0(&camera->unk_2C, player->unk_02C[1], var_a2); - func_8001CA78(player, camera, &sp60, &sp74, &sp70, &sp6C, (s32) camera->unk_2C, (s32) arg2); - camera->rotZ = (u16) camera->rotZ & 0xFFFB; - func_802ADDC8(&camera->unk_54, (f32) 3, sp74, sp70, sp6C); - temp_f0 = camera->unk_54.unk44; - if (temp_f0 < 0.0f) { - sp74 += -camera->unk_54.unk60[0] * temp_f0 * 1.0f; - sp70 = (f32) ((f64) sp70 + ((f64) (-camera->unk_54.unk60[1] * camera->unk_54.unk44) * 0.5)); - sp6C += -camera->unk_54.unk60[2] * camera->unk_54.unk44 * 1.0f; + func_8001CA78(player, camera, sp60, &sp74, &sp70, &sp6C, camera->unk_2C, arg2); + camera->someBitFlags &= ~0x0004; + temp_t7 = func_802ADDC8(&camera->unk_54, test, sp74, sp70, sp6C); + if (camera->unk_54.unk3C[2] < 0.0f) { + sp74 += -camera->unk_54.unk60[0] * camera->unk_54.unk3C[2] * 1; + sp70 += -camera->unk_54.unk60[1] * camera->unk_54.unk3C[2] * 0.5; + sp6C += -camera->unk_54.unk60[2] * camera->unk_54.unk3C[2] * 1; } - temp_f2 = camera->unk_54.unk3C; - if (temp_f2 < 0.0f) { - camera->rotZ = (u16) camera->rotZ | 6; - sp74 = (f32) ((f64) sp74 + ((f64) (-camera->unk_54.unk48[0] * temp_f2) * 1.5)); - sp70 += -camera->unk_54.unk48[1] * camera->unk_54.unk3C * 1.0f; - sp6C = (f32) ((f64) sp6C + ((f64) (-camera->unk_54.unk48[2] * camera->unk_54.unk3C) * 1.5)); + if (camera->unk_54.unk3C[0] < 0.0f) { + camera->someBitFlags = camera->someBitFlags | 4 | 2; + sp74 += -camera->unk_54.unk48[0] * camera->unk_54.unk3C[0] * 1.5; + sp70 += -camera->unk_54.unk48[1] * camera->unk_54.unk3C[0] * 1; + sp6C += -camera->unk_54.unk48[2] * camera->unk_54.unk3C[0] * 1.5; } - temp_f2_2 = camera->unk_54.unk40; - if (temp_f2_2 < 0.0f) { - camera->rotZ = (u16) camera->rotZ | 6; - sp74 = (f32) ((f64) sp74 + ((f64) (-camera->unk_54.unk54[0] * temp_f2_2) * 1.5)); - sp70 += -camera->unk_54.unk54[1] * camera->unk_54.unk40 * 1.0f; - sp6C = (f32) ((f64) sp6C + ((f64) (-camera->unk_54.unk54[2] * camera->unk_54.unk40) * 1.5)); + if (camera->unk_54.unk3C[1] < 0.0f) { + camera->someBitFlags = camera->someBitFlags | 4 | 2; + sp74 += -camera->unk_54.unk54[0] * camera->unk_54.unk3C[1] * 1.5; + sp70 += -camera->unk_54.unk54[1] * camera->unk_54.unk3C[1] * 1; + sp6C += -camera->unk_54.unk54[2] * camera->unk_54.unk3C[1] * 1.5; } - if (((s16) M2C_ERROR(Read from unset register $v0) == 0) && (((u16) camera->rotZ & 2) != 2)) { + if ((temp_t7 == 0) && ((camera->someBitFlags & 2) != 2)) { camera->unk_AC = camera->unk_2C; } - camera->lookAt[0] = sp60; - camera->lookAt[1] = sp64; - camera->lookAt[2] = sp68; + camera->lookAt[0] = sp60[0]; + camera->lookAt[1] = sp60[1]; + camera->lookAt[2] = sp60[2]; camera->pos[0] = sp74; camera->pos[1] = sp70; - temp_f12 = camera->lookAt[0] - camera->pos[0]; camera->pos[2] = sp6C; + temp_f12 = camera->lookAt[0] - camera->pos[0]; sp80 = camera->lookAt[1] - camera->pos[1]; - sp84 = temp_f12; temp_f14 = camera->lookAt[2] - camera->pos[2]; - sp7C = temp_f14; camera->rot[1] = atan2s(temp_f12, temp_f14); - camera->rot[0] = atan2s(sqrtf((sp84 * sp84) + (temp_f14 * temp_f14)), sp80); + camera->rot[0] = atan2s(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), sp80); camera->rot[2] = 0; } -#else -GLOBAL_ASM("asm/non_matchings/camera/func_8001E0C4.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de @@ -930,7 +907,7 @@ void func_8001E45C(Camera *camera, Player *player, s8 arg2) { func_800224F0(&camera->unk_2C, (s16) (player->unk_02C[1] + camera->unk_B0), var_a3); func_8001CCEC(player, camera, &sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2); } - camera->rotZ = (u16) camera->rotZ & 0xFFFB; + camera->someBitFlags = (u16) camera->someBitFlags & 0xFFFB; func_802ADDC8(&camera->unk_54, (f32) 3, sp84, sp80, sp7C); camera->pos[0] = sp84; camera->pos[1] = sp80; @@ -1069,7 +1046,7 @@ void func_8001EA0C(Camera *camera, Player *player, s8 arg2) { func_800224F0(&camera->unk_2C, (s16) (player->unk_02C[1] + camera->unk_B0), var_a3); func_8001D944(player, camera, &sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2); } - camera->rotZ = (u16) camera->rotZ & 0xFFFB; + camera->someBitFlags = (u16) camera->someBitFlags & 0xFFFB; func_802ADDC8(&camera->unk_54, (f32) 3, sp84, sp80, sp7C); camera->pos[0] = sp84; camera->pos[1] = sp80; @@ -1417,43 +1394,26 @@ block_66: GLOBAL_ASM("asm/non_matchings/camera/func_8001F394.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -extern u16 D_80152300; -extern s32 D_80164A2C; - void func_8001F87C(s32 cameraId) { - Camera *temp_v0_2; - Player *var_a2; - s32 var_a1; - u16 temp_v0; + s32 playerIndex; + // Why? + s32 test = cameraId; - if (gActiveScreenMode == SCREEN_MODE_1P) { - var_a1 = 0; - var_a2 = gPlayerOne; - if (gModeSelection == GRAND_PRIX) { -loop_3: - temp_v0 = var_a2->unk_000; - if (!(temp_v0 & 0x200) && !(temp_v0 & 0x80)) { - if (var_a1 == 0x60E8) { + if(gPlayerOne){} + if (gActiveScreenMode == 0) { + if (gModeSelection == 0) { + for (playerIndex = 0; playerIndex < 8; playerIndex++) { + if ((gPlayerOne[playerIndex].unk_000 & 0x200) || (gPlayerOne[playerIndex].unk_000 & 0x80)) break; + if (playerIndex == 7) { D_80164A2C += 1; } - if ((var_a1 == 0x60E8) && (D_80164A2C == 0x0000003C)) { + if ((playerIndex == 7) && (D_80164A2C == 0x0000003C)) { D_80164A28 = 2; - *(&D_80152300 + (cameraId * 2)) = 1; - temp_v0_2 = &cameras[cameraId]; - temp_v0_2->rot[1] = var_a2->unk_02E; - temp_v0_2->unk2C = (s16) var_a2->unk_02E; - } - var_a1 += 0xDD8; - var_a2 += 0xDD8; - if (var_a1 != 0x6EC0) { - goto loop_3; + D_80152300[test] = 1; + cameras[test].rot[1] = gPlayerOne[playerIndex].unk_02C[1]; + cameras[test].unk_2C = gPlayerOne[playerIndex].unk_02C[1]; } } } } } -#else -GLOBAL_ASM("asm/non_matchings/camera/func_8001F87C.s") -#endif diff --git a/src/camera.h b/src/camera.h index 0b4227671..143f89746 100644 --- a/src/camera.h +++ b/src/camera.h @@ -11,7 +11,7 @@ typedef struct { // I think these are the "nautical angles" between pos and lookAt // rot[0] = pitch, rot[1] = yaw, rot[2] = roll? /* 0x24 */ Vec3s rot; - /* 0x2A */ s16 rotZ; + /* 0x2A */ u16 someBitFlags; /* 0x2C */ s16 unk_2C; /* 0x2E */ s16 unk_2E; /* 0x30 */ Vec3f unk_30; @@ -41,7 +41,13 @@ typedef struct { void func_8001CA10(Camera*); void func_8001CA24(Player*, f32); +void func_8001CA78(Player*, Camera*, Vec3f, f32*, f32*, f32*, s16, s8); void func_8001D794(Player*, Camera*, Vec3f, f32*, f32*, f32*, s16); +void func_8001E0C4(Camera*, Player*, s8); +void func_8001F87C(s32); + +extern s32 D_80164A2C; +extern f32 D_80164A30; extern Camera cameras[]; extern Camera *camera1; @@ -53,4 +59,7 @@ extern Player *gPlayerTwo; extern Player *gPlayerThree; extern Player *gPlayerFour; +// Actually define in main.c, probably need to add to main.h +extern u16 D_80152300[]; + #endif diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index e86520a35..d062fdf09 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -3474,10 +3474,7 @@ s16 func_8000CC88(f32 posX, f32 posY, f32 posZ, Player *player, s32 playerId, s3 } #ifdef MIPS_TO_C -//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9 -extern s16 D_801631E0; -extern s32 D_80163488; - +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *player, s32 playerId, s32 pathIndex) { s16 sp5E; s32 sp48; @@ -3494,20 +3491,14 @@ s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *playe s16 temp_v0_6; s16 temp_v0_7; s16 var_v0; - s32 temp_t0; - s32 temp_t2; - s32 temp_t4; - s32 temp_t8; struct TrackWayPoint *temp_v1; - u16 temp_v0; - void *temp_v1_3; - void *temp_v1_4; + struct TrackWayPoint *temp_v1_3; + struct TrackWayPoint *temp_v1_4; - temp_v0 = player->unk_000; var_f24 = posZ; var_f20 = posX; var_f22 = posY; - if (((temp_v0 & 0x4000) != 0) && ((temp_v0 & 0x1000) == 0)) { + if ((player->unk_000 & 0x4000) && !(player->unk_000 & 0x1000)) { temp_v0_2 = func_8000C884(var_f20, var_f22, var_f24, wayPointIndex, pathIndex, (u16) func_802ABD40(player->unk_110.unk3A)); sp5E = temp_v0_2; if (temp_v0_2 == -1) { @@ -3515,11 +3506,10 @@ s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *playe } goto block_17; } - temp_t0 = playerId * 2; - sp48 = temp_t0; - if (*(&D_801631E0 + temp_t0) == 1) { + sp48 = playerId * 2; + if (D_801631E0[playerId] == 1) { temp_a0 = player->unk_0CA; - if ((temp_a0 & 1) != 0) { + if (temp_a0 & 1) { temp_v1 = &D_80164550[pathIndex][wayPointIndex]; player->pos[0] = (f32) temp_v1->wayPointX; player->pos[1] = (f32) temp_v1->wayPointY; @@ -3530,11 +3520,10 @@ s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *playe if (playerId == ((s32) D_80163488 % 8)) { func_802ADDC8(&player->unk_110, 10.0f, var_f20, var_f22, var_f24); temp_v0_3 = func_802ABD40(player->unk_110.unk3A); - temp_t8 = temp_v0_3 & 0xFFFF; temp_v1_2 = sp48 + D_80163318; *temp_v1_2 = temp_v0_3; sp44 = temp_v1_2; - var_v0 = func_8000C884(var_f20, var_f22, var_f24, wayPointIndex, pathIndex, (u16) temp_t8); + var_v0 = func_8000C884(var_f20, var_f22, var_f24, wayPointIndex, pathIndex, (u16) (temp_v0_3 & 0xFFFF)); sp5E = var_v0; if (var_v0 == -1) { sp44 = temp_v1_2; @@ -3543,25 +3532,23 @@ s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *playe } if (var_v0 == -1) { temp_v0_4 = func_8000C0BC(var_f20, var_f22, var_f24, (u16) *temp_v1_2, &pathIndex); - temp_t4 = temp_v0_4 * 8; sp5E = temp_v0_4; - temp_v1_3 = D_80164550[pathIndex] + temp_t4; - player->pos[0] = (f32) temp_v1_3->unk0; - player->pos[1] = (f32) temp_v1_3->unk2; - player->pos[2] = (f32) temp_v1_3->unk4; + temp_v1_3 = &D_80164550[pathIndex][temp_v0_4]; + player->pos[0] = (f32) temp_v1_3->wayPointX; + player->pos[1] = (f32) temp_v1_3->wayPointY; + player->pos[2] = (f32) temp_v1_3->wayPointZ; } } else { temp_v0_5 = func_8000C9DC(var_f20, var_f22, var_f24, wayPointIndex, pathIndex); sp5E = temp_v0_5; if (temp_v0_5 == -1) { temp_v0_6 = func_8000BD94(var_f20, var_f22, var_f24, pathIndex); - temp_t2 = temp_v0_6 * 8; sp5E = temp_v0_6; - temp_v1_4 = D_80164550[pathIndex] + temp_t2; - var_f20 = (f32) temp_v1_4->unk0; - var_f22 = (f32) temp_v1_4->unk2; + temp_v1_4 = &D_80164550[pathIndex][temp_v0_6]; + var_f20 = (f32) temp_v1_4->wayPointX; + var_f22 = (f32) temp_v1_4->wayPointY; player->pos[0] = var_f20; - var_f24 = (f32) temp_v1_4->unk4; + var_f24 = (f32) temp_v1_4->wayPointZ; player->pos[1] = var_f22; player->pos[2] = var_f24; func_802ADDC8(&player->unk_110, 10.0f, var_f20, var_f22, var_f24); @@ -6697,79 +6684,55 @@ loop_13: GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012AC0.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern s16 D_801631E0; - void func_80012DC0(s32 playerId, Player *player) { - f32 sp84; - TrainCarStuff *temp_v0; - TrainCarStuff *temp_v0_2; - TrainStuff *var_s0; - TrainStuff *var_s6; - TrainStuff *var_s7; - f32 temp_f14; - f32 temp_f16; - f32 temp_f24; - f32 temp_f26; - f64 temp_f0; - f64 temp_f0_2; - f64 temp_f0_3; - f64 temp_f0_4; - s32 var_s1; + TrainCarStuff *trainCar; + f32 playerPosX; + f32 playerPosZ; + f32 x_dist; + f32 z_dist; + s32 trainIndex; + s32 passengerCarIndex; - if (*(&D_801631E0 + (playerId * 2)) != 1) { - var_s7 = D_801635A0; - var_s6 = D_801635A0; - if ((player->unk_0BC << 7) >= 0) { - temp_f24 = player->pos[0]; - temp_f26 = player->pos[2]; - do { - temp_f16 = var_s6->locomotive.position[0]; - temp_f14 = var_s6->locomotive.position[2]; - sp84 = temp_f16; - temp_f0 = (f64) (temp_f24 - temp_f16); - if ((temp_f0 > -100.0) && (temp_f0 < 100.0)) { - temp_f0_2 = (f64) (temp_f26 - temp_f14); - if ((temp_f0_2 > -100.0) && (temp_f0_2 < 100.0)) { - if (func_80006018(sp84, temp_f14, var_s6->locomotive.velocity[0], var_s6->locomotive.velocity[2], 60.0f, 20.0f, temp_f24, temp_f26) == (s32) 1U) { + if (D_801631E0[playerId] != 1) { + if (!(player->unk_0BC & 0x01000000)) { + playerPosX = player->pos[0]; + playerPosZ = player->pos[2]; + for (trainIndex = 0; trainIndex < NUM_TRAINS; trainIndex++) { + trainCar = &D_801635A0[trainIndex].locomotive; + x_dist = playerPosX - trainCar->position[0]; + z_dist = playerPosZ - trainCar->position[2]; + if ((x_dist > -100.0) && (x_dist < 100.0)) { + if ((z_dist > -100.0) && (z_dist < 100.0)) { + if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], trainCar->velocity[2], 60.0f, 20.0f, playerPosX, playerPosZ) == 1) { player->statusEffects |= 0x400000; } - temp_v0 = &var_s6->tender; - if ((var_s6->tender.isActive == (s16) 1U) && (func_80006018(temp_v0->position[0], temp_v0->position[2], temp_v0->velocity[0], temp_v0->velocity[2], 30.0f, 20.0f, temp_f24, temp_f26) == (s32) 1U)) { - player->statusEffects |= 0x400000; - } - } - } - var_s1 = 0; - var_s0 = var_s7; -loop_13: - if (var_s0->passengerCars[0].isActive == (s16) 1U) { - temp_f0_3 = (f64) (temp_f24 - var_s0->passengerCars[0].position[0]); - if ((temp_f0_3 > -100.0) && (temp_f0_3 < 100.0)) { - temp_f0_4 = (f64) (temp_f26 - var_s0->passengerCars[0].position[2]); - if (temp_f0_4 > -100.0) { - temp_v0_2 = var_s0->passengerCars; - if ((temp_f0_4 < 100.0) && (func_80006018(temp_v0_2->position[0], temp_v0_2->position[2], temp_v0_2->velocity[0], temp_v0_2->velocity[2], 30.0f, 20.0f, temp_f24, temp_f26) == (s32) 1U)) { + trainCar = &D_801635A0[trainIndex].tender; + if (trainCar->isActive == 1) { + if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { player->statusEffects |= 0x400000; } } } } - var_s1 += 0x24; - var_s0 += 0x24; - if (var_s1 != 0xB4) { - goto loop_13; + + for (passengerCarIndex = 0; passengerCarIndex < NUM_PASSENGER_CAR_ENTRIES; passengerCarIndex++) { + trainCar = &D_801635A0[trainIndex].passengerCars[passengerCarIndex]; + x_dist = playerPosX - trainCar->position[0]; + z_dist = playerPosZ - trainCar->position[2]; + if (trainCar->isActive == 1) { + if ((x_dist > -100.0) && (x_dist < 100.0)) { + if ((z_dist > -100.0) && (z_dist < 100.0)) { + if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { + player->statusEffects |= 0x400000; + } + } + } + } } - var_s7 += 0x10C; - var_s6 += 0x10C; - } while (var_s7 != D_801637B8); + } } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012DC0.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc @@ -7030,47 +6993,40 @@ void func_800133C4(void) { GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800133C4.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern ? D_801637EC; +#ifdef NEEDS_RODATA +// data_0DD0A0_3.s +extern f64 D_800ED158;// = 300.0; +extern f64 D_800ED160;// = -300.0; void func_80013854(Player *player) { - f32 sp70; - PaddleWheelBoatStuff *var_s0; - f32 temp_f12; - f32 temp_f14; - f32 temp_f24; - f32 temp_f26; - f32 temp_f28; - f32 var_f18; - f64 temp_f0; - f64 temp_f0_2; - s32 temp_v0; + s32 someIndex; + PaddleWheelBoatStuff *tempPaddleWheelBoat; + f32 x_diff; + f32 y_diff; + f32 z_diff; + f32 playerX; + f32 playerZ; + f32 playerY; - temp_v0 = player->unk_0BC; - if (((temp_v0 << 7) >= 0) && ((temp_v0 << 6) >= 0)) { - temp_f26 = player->pos[0]; - var_f18 = player->pos[1]; - temp_f28 = player->pos[2]; - var_s0 = D_801637C0; - do { - if (var_s0->isActive == 1) { - temp_f12 = var_s0->position[0]; - temp_f14 = var_s0->position[2]; - temp_f24 = var_f18 - var_s0->position[1]; - temp_f0 = (f64) (temp_f26 - temp_f12); - if ((temp_f0 > -300.0) && (temp_f0 < 300.0)) { - temp_f0_2 = (f64) (temp_f28 - temp_f14); - if ((temp_f0_2 > -300.0) && (temp_f0_2 < 300.0)) { - sp70 = var_f18; - if ((func_80006018(temp_f12, temp_f14, var_s0->velocity[0], var_s0->velocity[2], 200.0f, 60.0f, temp_f26, temp_f28) == (s32) 1) && ((f64) temp_f24 < 60.0)) { + if (((player->unk_0BC << 7) >= 0) && ((player->unk_0BC << 6) >= 0)) { + playerX = player->pos[0]; + playerY = player->pos[1]; + playerZ = player->pos[2]; + for (someIndex = 0; someIndex < NUM_PADDLE_WHEEL_BOATS; someIndex++) { + tempPaddleWheelBoat = &D_801637C0[someIndex]; + if (tempPaddleWheelBoat->isActive == 1) { + x_diff = playerX - tempPaddleWheelBoat->position[0]; + y_diff = playerY - tempPaddleWheelBoat->position[1]; + z_diff = playerZ - tempPaddleWheelBoat->position[2]; + if ((x_diff > -300.0) && (x_diff < 300.0)) { + if ((z_diff > -300.0) && (z_diff < 300.0)) { + if ((func_80006018(tempPaddleWheelBoat->position[0], tempPaddleWheelBoat->position[2], tempPaddleWheelBoat->velocity[0], tempPaddleWheelBoat->velocity[2], 200.0f, 60.0f, playerX, playerZ) == 1) && (y_diff < 60.0)) { player->statusEffects |= 0x80000; } } } } - var_s0 += 0x2C; - } while (var_s0 != &D_801637EC); + } } } #else @@ -7892,75 +7848,69 @@ UNUSED void func_8001530C(void) { } -#ifdef NON_MATCHING -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -//void func_80015390(Camera *, Player *, ?, s32); /* extern */ -void func_80015390(Camera*, Player*, s32,s32); void func_80015314(s32 playerId, s32 arg1, s32 cameraId) { - Camera *temp_a0 = &camera1[cameraId]; - Player *player = &gPlayerOne[playerId]; + Camera *temp_a0; + Player *temp_a1; - //temp_a1 = &gPlayerOne[playerId]; - //temp_a0 = &camera1[cameraId]; - temp_a0->unk_2C = player->unk_02C[1]; - func_80015390(temp_a0, player, 0, playerId); + // wtf is up with the pointer accesses here? + // What aren't they just doing thing = &some_pointer[some_index]? + temp_a1 = gPlayerOne; + temp_a0 = camera1; + temp_a1 += playerId; + temp_a0 += cameraId; + temp_a0->unk_2C = temp_a1->unk_02C[1]; + func_80015390(temp_a0, temp_a1, 0); } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80015314.s") -#endif -#ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -void func_8001D794(Player *, Camera *, f32 *, f32 *, f32 *, f32 *, s32); /* extern */ - -void func_80015390(Camera *camera, s32 arg1, s32 arg2) { - f32 sp94; +void func_80015390(Camera *camera, Player *player, s32 arg2) { + s32 stackPadding0[3]; + s32 stackPadding1[3]; + f32 temp_f12; f32 sp90; - f32 sp8C; + f32 temp_f14; + Player *temp_s1; f32 sp84; f32 sp80; f32 sp7C; - f32 sp64; - Player *temp_s1; - f32 temp_f12; - f32 temp_f14; - s16 temp_v0; + s32 stackPadding2[3]; + Vec3f sp64; + s32 stackPadding3[3]; + s32 stackPadding4[3]; + s32 stackPadding5[3]; s16 var_a2; - s32 temp_v0_2; + /* + Doing the more sensible: temp_s1 = &gPlayerOne[camera->playerId]; - temp_v0 = temp_s1->unk_078; - if (temp_v0 == 0) { + leads to some regalloc differences + */ + temp_s1 = gPlayerOne; + temp_s1 += camera->playerId; + if (temp_s1->unk_078 == 0) { var_a2 = 0x0064; - } else if (temp_v0 < 0) { - var_a2 = 0xA0 - (temp_v0 / 16); + } else if (temp_s1->unk_078 < 0) { + var_a2 = 0xA0 - (temp_s1->unk_078 / 16); } else { - var_a2 = (temp_v0 / 16) + 0xA0; + var_a2 = 0xA0 + (temp_s1->unk_078 / 16); } - temp_v0_2 = temp_s1->unk_0BC; - if (!(temp_v0_2 & 0x80) && !(temp_v0_2 & 0x40)) { + if (!((temp_s1->unk_0BC & 0x80) || (temp_s1->unk_0BC & 0x40))) { func_800224F0(&camera->unk_2C, temp_s1->unk_02C[1], var_a2); } - func_8001D794(temp_s1, camera, &sp64, &sp84, &sp80, &sp7C, (s32) camera->unk_2C); + func_8001D794(temp_s1, camera, sp64, &sp84, &sp80, &sp7C, camera->unk_2C); func_802ADDC8(&camera->unk_54, 10.0f, sp84, sp80, sp7C); - camera->lookAt[0] = sp64; - camera->lookAt[1] = sp68; - camera->lookAt[2] = sp6C; + camera->lookAt[0] = sp64[0]; + camera->lookAt[1] = sp64[1]; + camera->lookAt[2] = sp64[2]; camera->pos[0] = sp84; camera->pos[1] = sp80; - temp_f12 = camera->lookAt[0] - camera->pos[0]; camera->pos[2] = sp7C; - sp90 = camera->lookAt[1] - camera->pos[1]; - sp94 = temp_f12; + temp_f12 = camera->lookAt[0] - camera->pos[0]; + sp90 = camera->lookAt[1] - camera->pos[1]; temp_f14 = camera->lookAt[2] - camera->pos[2]; - sp8C = temp_f14; camera->rot[1] = atan2s(temp_f12, temp_f14); - camera->rot[0] = atan2s(sqrtf((sp94 * sp94) + (temp_f14 * temp_f14)), sp90); + camera->rot[0] = atan2s(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), sp90); camera->rot[2] = 0; } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80015390.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de @@ -10727,20 +10677,17 @@ void func_8001ABEC(struct struct_801642D8 *arg0) { } #ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -void func_8001AB74(s32, void *, s32); /* extern */ -void func_8001ABE0(s32, void *, s32 *); /* extern */ -void func_8001ABEC(void *, s16); /* extern */ -s32 func_8007AF78(s16, s16, s32 *); /* extern */ -void func_800C92CC(s32, ?, s32, struct Actor *); /* extern */ -void func_800CAC60(s32); /* extern */ -void func_800CAD40(u8, s16); /* extern */ -extern s16 D_801631E0; +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +? func_8001AB74(s32, struct struct_801642D8 *, u8); /* extern */ +? func_800C92CC(s32, ?, s32, struct Actor *); /* extern */ +? func_800CAC60(s32); /* extern */ +? func_800CAD40(u8, s16); /* extern */ +extern ? D_801631E0; extern s16 D_80163478; extern ? D_801642D8; extern u16 D_801646CC; -void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) { +void func_8001AC10(s32 playerId) { Player *sp2C; struct Actor *sp28; Player *temp_t9; @@ -10755,7 +10702,6 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) { s16 temp_v1_8; s16 temp_v1_9; s16 var_v0; - s32 *var_a2; s32 temp_a0; s32 temp_v1; s32 var_v1; @@ -10773,22 +10719,21 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) { struct Actor *temp_a3_8; struct Actor *temp_a3_9; struct TrackWayPoint *temp_v0_2; + struct struct_801642D8 *temp_s0; u16 temp_v0; - void *temp_s0; - var_a2 = arg2; temp_t9 = &gPlayerOne[playerId]; sp2C = temp_t9; - if ((gModeSelection != (s32) TIME_TRIALS) && (D_801646CC != (u16) 1) && !(temp_t9->unk_000 & 0x800)) { + if ((gModeSelection != (s32) 1) && (D_801646CC != (u16) 1) && !(temp_t9->unk_000 & 0x800)) { temp_s0 = (playerId * 0x10) + &D_801642D8; temp_a1 = temp_s0->unk0; switch (temp_a1) { /* switch 1 */ case 0: /* switch 1 */ - temp_s0->unk2 = -1; - if ((((playerId * 0x14) + 0x64) < D_80164450[playerId]) && (temp_s0->unk4 >= 0x259) && (temp_s0->unk6 < 3) && (temp_v1 = gLapCountByPlayerId[playerId], var_a2 = gPlayerPositions, ((temp_v1 < 3) != 0))) { - func_8001AB74(playerId, temp_s0, func_8007AF78((s16) temp_v1, gPlayerPositions[playerId].unk2, gPlayerPositions)); + temp_s0->ffff = -1; + if ((((playerId * 0x14) + 0x64) < D_80164450[playerId]) && (temp_s0->timer >= 0x259) && (temp_s0->laps < 3) && (temp_v1 = gLapCountByPlayerId[playerId], ((temp_v1 < 3) != 0))) { + func_8001AB74(playerId, temp_s0, func_8007AF78((s32) (s16) temp_v1, gPlayerPositions[playerId].unk2)); } else { - func_8001ABE0(playerId, temp_s0, var_a2); + func_8001ABE0(playerId, (s32) temp_s0); } default: /* switch 1 */ break; @@ -10813,32 +10758,32 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) { break; } } else if (temp_a1 == 1) { - temp_s0->unk2 = func_802B2D70(sp2C); - temp_v1_3 = temp_s0->unk2; + temp_s0->ffff = func_802B2D70(sp2C); + temp_v1_3 = temp_s0->ffff; if ((temp_v1_3 >= 0) && (temp_v1_3 < 0x64)) { sp2C->statusEffects |= 0x40000; temp_s0->unk0 = 2; - temp_s0->unk4 = 0; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->timer = 0; + temp_s0->laps += 1; temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0xA); } else { temp_s0->unk0 = 0; - temp_s0->unk4 = 0; + temp_s0->timer = 0; } } break; case 2: /* switch 1 */ - temp_a3 = &gActorList[temp_s0->unk2]; + temp_a3 = &gActorList[temp_s0->ffff]; if (!(temp_a3->flags & 0x8000) || (temp_a3->type != 6) || (temp_a3->state != 0) || (playerId != temp_a3->rot[0])) { temp_s0->unk0 = 0; - temp_s0->unk4 = 0; + temp_s0->timer = 0; sp2C->statusEffects &= 0xFFFBFFFF; - } else if (temp_s0->unkE < temp_s0->unk4) { + } else if (temp_s0->unkE < temp_s0->timer) { temp_s0->unk0 = 3; } break; case 3: /* switch 1 */ - temp_a3_2 = &gActorList[temp_s0->unk2]; + temp_a3_2 = &gActorList[temp_s0->ffff]; if (!(temp_a3_2->flags & 0x8000) || (temp_a3_2->type != 6) || (temp_a3_2->state != 0) || (playerId != temp_a3_2->rot[0])) { if (playerId != temp_a3_2->rot[0]) { @@ -10854,19 +10799,19 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) { } } sp2C->statusEffects &= 0xFFFBFFFF; - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; break; case 34: /* switch 1 */ - temp_s0->unk2 = func_802B2D70(sp2C); - temp_v1_4 = temp_s0->unk2; + temp_s0->ffff = func_802B2D70(sp2C); + temp_v1_4 = temp_s0->ffff; if ((temp_v1_4 >= 0) && (temp_v1_4 < 0x64)) { temp_a3_3 = &gActorList[temp_v1_4]; temp_a3_3->state = 4; sp2C->statusEffects |= 0x40000; temp_s0->unk0 = 0x0023; - temp_s0->unk4 = 0; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->timer = 0; + temp_s0->laps += 1; temp_a2 = D_80163478; temp_v0_2 = &D_80164550[*gPathIndexByPlayerId][(s32) (gNearestWaypointByPlayerId[temp_a2] + 0x1E) % (s32) gWaypointCountByPathIndex[gPathIndexByPlayerId[temp_a2]]]; temp_a3_3->velocity[0] = (f32) ((f64) ((f32) temp_v0_2->wayPointX - sp2C->pos[0]) / 20.0); @@ -10876,14 +10821,14 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) { func_800C92CC(playerId & 0xFF, 0x29008009, temp_a2 * 2, temp_a3_3); func_800C98B8(sp2C->pos, sp2C->unk_034, 0x19018014U); } else { - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; } break; case 35: /* switch 1 */ - temp_a3_4 = &gActorList[temp_s0->unk2]; + temp_a3_4 = &gActorList[temp_s0->ffff]; if (!(temp_a3_4->flags & 0x8000) || (temp_a3_4->type != 6) || (temp_a3_4->state != 4) || (playerId != temp_a3_4->rot[0])) { - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; sp2C->statusEffects &= 0xFFFBFFFF; } else { @@ -10891,13 +10836,13 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) { temp_a3_4->velocity[1] = (f32) ((f64) temp_a3_4->velocity[1] - 0.4); temp_a3_4->pos[2] += temp_a3_4->velocity[2]; temp_a3_4->pos[1] += temp_a3_4->velocity[1]; - if (temp_s0->unk4 >= 0x15) { + if (temp_s0->timer >= 0x15) { temp_s0->unk0 = 0x0024; } } break; case 36: /* switch 1 */ - temp_a3_5 = &gActorList[temp_s0->unk2]; + temp_a3_5 = &gActorList[temp_s0->ffff]; if (!(temp_a3_5->flags & 0x8000) || (temp_a3_5->type != 6) || (temp_a3_5->state != 4) || (playerId != temp_a3_5->rot[0])) { if (playerId != temp_a3_5->rot[0]) { @@ -10911,17 +10856,17 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) { temp_a3_5->pos[1] = func_802AE1C0(temp_a3_5->pos[0], (f32) ((f64) temp_a3_5->pos[1] + 30.0), temp_a3_5->pos[2]) + (temp_a3_5->boundingBoxSize + 1.0f); } sp2C->statusEffects &= 0xFFFBFFFF; - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; break; case 4: /* switch 1 */ if ((s32) gNumActors < 0x50) { - temp_s0->unk2 = func_802B1C9C(sp2C); - temp_v1_5 = temp_s0->unk2; + temp_s0->ffff = func_802B1C9C(sp2C); + temp_v1_5 = temp_s0->ffff; if ((temp_v1_5 >= 0) && (temp_v1_5 < 0x64)) { temp_s0->unk0 = 5; - temp_s0->unk4 = 0; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->timer = 0; + temp_s0->laps += 1; temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0xA); } else { goto block_71; @@ -10932,34 +10877,34 @@ block_71: } break; case 5: /* switch 1 */ - temp_a3_6 = &gActorList[temp_s0->unk2]; + temp_a3_6 = &gActorList[temp_s0->ffff]; if (!(temp_a3_6->flags & 0x8000) || (temp_a3_6->type != 7) || (temp_a3_6->state != 0) || (playerId != temp_a3_6->rot[2])) { - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; - } else if (temp_s0->unkE < temp_s0->unk4) { - temp_s0->unk4 = 0; + } else if (temp_s0->unkE < temp_s0->timer) { + temp_s0->timer = 0; temp_s0->unk0 = 6; } break; case 6: /* switch 1 */ - temp_a3_7 = &gActorList[temp_s0->unk2]; + temp_a3_7 = &gActorList[temp_s0->ffff]; if (!(temp_a3_7->flags & 0x8000) || (temp_a3_7->type != 7) || (temp_a3_7->state != 0) || (playerId != temp_a3_7->rot[2])) { temp_s0->unk0 = 0; - temp_s0->unk4 = 0; + temp_s0->timer = 0; } else { temp_a3_7->state = 1; - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; } break; case 7: /* switch 1 */ if ((s32) gNumActors < 0x50) { - temp_s0->unk2 = func_802B1E48(sp2C); - temp_v1_6 = temp_s0->unk2; + temp_s0->ffff = func_802B1E48(sp2C); + temp_v1_6 = temp_s0->ffff; if ((temp_v1_6 >= 0) && (temp_v1_6 < 0x64)) { temp_s0->unk0 = 8; - temp_s0->unk4 = 0; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->timer = 0; + temp_s0->laps += 1; temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0xA); } else { goto block_92; @@ -10970,34 +10915,34 @@ block_92: } break; case 8: /* switch 1 */ - temp_a3_8 = &gActorList[temp_s0->unk2]; + temp_a3_8 = &gActorList[temp_s0->ffff]; if (!(temp_a3_8->flags & 0x8000) || (temp_a3_8->type != 8) || (temp_a3_8->state != 0) || (playerId != temp_a3_8->rot[2])) { - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; - } else if (temp_s0->unkE < temp_s0->unk4) { + } else if (temp_s0->unkE < temp_s0->timer) { temp_s0->unk0 = 9; } break; case 9: /* switch 1 */ - func_8001ABEC(temp_s0, temp_a1); - temp_a3_9 = &gActorList[temp_s0->unk2]; + func_8001ABEC(temp_s0); + temp_a3_9 = &gActorList[temp_s0->ffff]; if (!(temp_a3_9->flags & 0x8000) || (temp_a3_9->type != 8) || (temp_a3_9->state != 0) || (playerId != temp_a3_9->rot[2])) { temp_s0->unk0 = 0; - temp_s0->unk4 = 0; + temp_s0->timer = 0; } else { temp_a3_9->state = 1; - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; } break; case 10: /* switch 1 */ if ((s32) gNumActors < 0x50) { - temp_s0->unk2 = func_802B17F4(sp2C); - temp_v1_7 = temp_s0->unk2; + temp_s0->ffff = func_802B17F4(sp2C); + temp_v1_7 = temp_s0->ffff; if ((temp_v1_7 >= 0) && (temp_v1_7 < 0x64)) { temp_s0->unk0 = 0x000B; - temp_s0->unk4 = 0; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->timer = 0; + temp_s0->laps += 1; temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0x3C); } else { goto block_113; @@ -11008,7 +10953,7 @@ block_113: } break; case 11: /* switch 1 */ - temp_a3_10 = &gActorList[temp_s0->unk2]; + temp_a3_10 = &gActorList[temp_s0->ffff]; if (temp_a3_10->state == 6) { var_v1 = 0; if (temp_a3_10->unk1A != -1) { @@ -11030,20 +10975,20 @@ block_113: temp_s0->unk0 = 0; goto block_131; } - if (temp_s0->unkE < temp_s0->unk4) { + if (temp_s0->unkE < temp_s0->timer) { temp_s0->unk0 = 0x000C; temp_s0->unk8 = 0; block_131: - temp_s0->unk4 = 0; + temp_s0->timer = 0; } } break; case 12: /* switch 1 */ - if (((s16) temp_s0->unk4 % 10) == 0) { + if (((s16) temp_s0->timer % 10) == 0) { temp_v1_8 = temp_s0->unk8; if (temp_v1_8 < 5) { var_v0 = 0; - temp_a3_11 = &gActorList[temp_s0->unk2]; + temp_a3_11 = &gActorList[temp_s0->ffff]; switch (temp_v1_8) { /* switch 2 */ case 0: /* switch 2 */ if (temp_a3_11->unk1A != -1) { @@ -11077,34 +11022,34 @@ block_146: } temp_s0->unk8 = (s16) (temp_s0->unk8 + 1); } else { - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; } } break; case 13: /* switch 1 */ - temp_s0->unk2 = func_802B2C40(sp2C); - temp_v1_9 = temp_s0->unk2; + temp_s0->ffff = func_802B2C40(sp2C); + temp_v1_9 = temp_s0->ffff; if ((temp_v1_9 >= 0) && (temp_v1_9 < 0x64)) { temp_s0->unk0 = 0x000E; - temp_s0->unk4 = 0; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->timer = 0; + temp_s0->laps += 1; temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0xA); } else { temp_s0->unk0 = 0; } break; case 14: /* switch 1 */ - temp_a3_12 = &gActorList[temp_s0->unk2]; + temp_a3_12 = &gActorList[temp_s0->ffff]; if (!(temp_a3_12->flags & 0x8000) || (temp_a3_12->type != 0x000D) || (temp_a3_12->state != 0) || (playerId != (s32) temp_a3_12->velocity[0])) { - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; - } else if (temp_s0->unkE < temp_s0->unk4) { + } else if (temp_s0->unkE < temp_s0->timer) { temp_s0->unk0 = 0x000F; } break; case 15: /* switch 1 */ - temp_a3_13 = &gActorList[temp_s0->unk2]; + temp_a3_13 = &gActorList[temp_s0->ffff]; if (!(temp_a3_13->flags & 0x8000) || (temp_a3_13->type != 0x000D) || (temp_a3_13->state != 0) || (playerId != (s32) temp_a3_13->velocity[0])) { if (playerId != temp_a3_13->rot[0]) { @@ -11117,88 +11062,88 @@ block_146: temp_a3_13->pos[1] = func_802AE1C0(temp_a3_13->pos[0], (f32) ((f64) temp_a3_13->pos[1] + 30.0), temp_a3_13->pos[2]) + temp_a3_13->boundingBoxSize; } } - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; break; case 22: /* switch 1 */ func_802B2EBC(sp2C); func_800CAC60(playerId & 0xFF); func_8009E5BC(); - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0x0017; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->laps += 1; break; case 23: /* switch 1 */ - if (temp_s0->unk4 >= 0xF1) { + if (temp_s0->timer >= 0xF1) { func_800CAD40((u8) playerId, temp_a1); - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; } break; case 25: /* switch 1 */ sp2C->statusEffects |= 0x2000; - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0x001A; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->laps += 1; break; case 26: /* switch 1 */ if (!(sp2C->unk_0BC & 0x200)) { temp_s0->unk0 = 0; } - temp_s0->unk4 = 0; + temp_s0->timer = 0; break; case 27: /* switch 1 */ sp2C->statusEffects |= 0x800; - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0x001C; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->laps += 1; break; case 28: /* switch 1 */ - if ((sp2C->unk_0BC << 0) >= 0) { + if (!(sp2C->unk_0BC & 0x80000000)) { temp_s0->unk0 = 0; } - temp_s0->unk4 = 0; + temp_s0->timer = 0; break; case 29: /* switch 1 */ sp2C->statusEffects |= 0x200; - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0; - temp_s0->unk6 = (s16) (temp_s0->unk6 + 1); + temp_s0->laps += 1; break; case 30: /* switch 1 */ - if (temp_s0->unk4 >= 0x3D) { + if (temp_s0->timer >= 0x3D) { sp2C->statusEffects |= 0x200; - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0x001D; } break; case 31: /* switch 1 */ - if (temp_s0->unk4 >= 0x3D) { + if (temp_s0->timer >= 0x3D) { sp2C->statusEffects |= 0x200; - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0x001E; } break; case 32: /* switch 1 */ - temp_s0->unk4 = 0; + temp_s0->timer = 0; temp_s0->unk0 = 0x0021; temp_s0->unkE = 0x0258; break; case 33: /* switch 1 */ - if (((s16) temp_s0->unk4 % 60) == 0) { + if (((s16) temp_s0->timer % 60) == 0) { sp2C->statusEffects |= 0x200; - if (temp_s0->unkE < temp_s0->unk4) { - temp_s0->unk4 = 0; + if (temp_s0->unkE < temp_s0->timer) { + temp_s0->timer = 0; temp_s0->unk0 = 0; } } break; } - if (temp_s0->unk4 < 0x2710) { - temp_s0->unk4 = (s16) (temp_s0->unk4 + 1); + if (temp_s0->timer < 0x2710) { + temp_s0->timer += 1; } if (sp2C->unk_0BC & 0x80002200) { - temp_s0->unk4 = 0; + temp_s0->timer = 0; } } } diff --git a/src/code_80005FD0.h b/src/code_80005FD0.h index 616e900e0..828fc1d3e 100644 --- a/src/code_80005FD0.h +++ b/src/code_80005FD0.h @@ -82,13 +82,15 @@ void func_80011AE4(s32); void func_80012220(VehicleStuff*); void func_800122D8(); void func_80012A48(TrainCarStuff*, s16); +void func_80012AC0(); +void func_80012DC0(s32, Player*); +void func_800133C4(); +void func_80013854(Player*); f32 func_80013C74(s16, s16); void func_80013D20(VehicleStuff*); void func_80013F7C(s32, Player*, VehicleStuff*, f32, f32, s32, u32); f32 func_800145A8(s16, f32, s16); void func_800146B8(s32, s32, VehicleStuff*); -void func_80012AC0(); -void func_800133C4(); void func_8001487C(); void func_800148C4(s32, Player*); void func_8001490C(s32); @@ -103,6 +105,8 @@ void func_80014CC0(s32, Player*); void func_80014D08(s32); void func_80014D30(s32, s32); void func_8001530C(); +void func_80015314(s32, s32, s32); +void func_80015390(Camera*, Player*, s32); void func_8001968C(); void func_8001C05C(); void func_80019DE4(); @@ -125,6 +129,9 @@ extern f32 D_800DCA4C[]; // See bss_80005FD0.s extern UnkActorInner D_80162E70; +extern s16 D_80162EB0; +extern u16 D_801631E0[8]; +extern s32 D_80163488; extern s32 D_8016337C; extern s32 gModeSelection; diff --git a/src/code_80027D00.c b/src/code_80027D00.c index e15be8bdb..8333e733d 100644 --- a/src/code_80027D00.c +++ b/src/code_80027D00.c @@ -757,10 +757,10 @@ void func_80029200(Player *player, s8 arg1) { } #ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c static f32 D_800DDBD4[8] = { 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f }; -void func_8002934C(Player *player, struct Camera *arg1, s8 arg2, s8 arg3) { +void func_8002934C(Player *player, Camera *camera, s8 arg2, s8 arg3) { f32 sp50; f32 sp28; void *sp24; @@ -798,8 +798,8 @@ void func_8002934C(Player *player, struct Camera *arg1, s8 arg2, s8 arg3) { void *temp_a3; temp_a3 = player + (arg2 * 2); - temp_a3->unk48 = atan2s(player->pos[0] - arg1->unk0, player->pos[2] - arg1->unk8); - player->unk_244[arg2] = (u16) ((s32) ((player->unk_02E + (s16) temp_a3->unk48 + player->unk_0C0) & 0xFFFF) / 128); + player->unk_048[arg2] = atan2s(player->pos[0] - camera->pos[0], player->pos[2] - camera->pos[2]); + player->unk_244[arg2] = (u16) ((s32) ((player->unk_02C[1] + player->unk_048[arg2] + player->unk_0C0) & 0xFFFF) / 128); temp_v1 = player->unk_0BC; temp_f0 = player->unk_230 - player->unk_23C; temp_f2 = D_800DDBD4[player->characterId] * 18.0f * player->unk_224; @@ -835,7 +835,7 @@ void func_8002934C(Player *player, struct Camera *arg1, s8 arg2, s8 arg3) { } sp24 = temp_a3; func_80029200(player, arg2); - temp_a0 = (player->unk_02E + temp_a3->unk48 + player->unk_0C0) & 0xFFFF; + temp_a0 = (player->unk_02C[1] + temp_a3->unk48 + player->unk_0C0) & 0xFFFF; sp20 = temp_a0; sp28 = sins((u16) temp_a0); move_s16_towards(temp_a3 + 0x50, (s16) (s32) ((coss((u16) temp_a0) * (f32) temp_a3->unkCC) + ((f32) temp_a3->unkD4 * sp28)), 0.5f); @@ -868,7 +868,7 @@ block_28: if (((player->unk_0BC & 8) == 8) && ((player->unk_0CA & 2) == 2)) { temp_a3->unk50 = 0; } - temp_t9 = (player->unk_02E + temp_a3->unk48 + player->unk_0C0) & 0xFFFF; + temp_t9 = (player->unk_02C[1] + temp_a3->unk48 + player->unk_0C0) & 0xFFFF; if (((player->unk_0BC & 0x80) == 0x80) || ((player->unk_0BC & 0x40) == 0x40) || ((player->unk_0BC & 0x80000) == 0x80000) || ((player->unk_0BC & 0x800000) == 0x800000) || ((player->unk_0BC & 0x20000) == 0x20000) || (player->unk_044 & 0x800)) { if (temp_t9 >= 0x7FF9) { temp_t6 = ((s32) (-temp_t9 & 0xFFFF) / var_a1) & 0xFFFF; @@ -902,7 +902,7 @@ block_28: if (((temp_v1_5 & 0x80000) == 0x80000) || ((temp_v1_5 & 0x800000) == 0x800000) || (player->unk_044 & 0x800)) { temp_a3->unk24C = 4U; } - if (((player->unk_0BC & 0x400) == 0x400) || ((player->unk_0BC & 0x01000000) == 0x01000000) || ((player->unk_0BC & 0x02000000) == 0x02000000) || ((player->unk_0BC << 0xF) < 0) || (player->unk_0BC & 0x80) || (player->unk_0BC & 0x40)) { + if (((player->unk_0BC & 0x400) == 0x400) || ((player->unk_0BC & 0x01000000) == 0x01000000) || ((player->unk_0BC & 0x02000000) == 0x02000000) || (player->unk_0BC & 0x10000) || (player->unk_0BC & 0x80) || (player->unk_0BC & 0x40)) { var_a2 = 1 << temp_t3; player->unk_002 |= var_a2; temp_t9_2 = arg3 * 2; @@ -935,7 +935,6 @@ block_28: player->unk_002 |= var_a2; } } -/* Warning: struct Camera is not defined (only forward-declared) */ #else GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002934C.s") #endif @@ -5551,140 +5550,119 @@ void func_80036C5C(Player *arg0) { } } -#ifdef MIPS_TO_C -//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b void func_80036CB4(Player *player) { - s32 var_v0; - s32 var_v0_2; - s32 var_v1; + s32 test; - var_v0 = player->unk_0BC; - var_v1 = var_v0 & 0x10; - if ((var_v1 == 0x10) && ((player->unk_000 & 0x4000) == 0x4000)) { - var_v0_2 = (s16) player->unk_0C0 / 182; - if (var_v0_2 > 0) { - var_v0_2 = (s16) player->unk_0C0 / 182; - player->unk_07C = (((s32) ((((s32) player->unk_07C >> 0x10) * 0xD) + 0x2B1) / 106) + 0x28) << 0x10; + if (((player->unk_0BC & 0x10) == 0x10) && ((player->unk_000 & 0x4000) == 0x4000)) { + if ((player->unk_0C0 / 182) > 0) { + test = ((((player->unk_07C >> 0x10) * 0xD) + 0x2B1) / 106) + 0x28; + player->unk_07C = test << 0x10; } - if (var_v0_2 < 0) { - player->unk_07C = (((s32) ((((s32) player->unk_07C >> 0x10) * 0xD) + 0x2B1) / 106) - 0x35) << 0x10; + if ((player->unk_0C0 / 182) < 0) { + test = ((((player->unk_07C >> 0x10) * 0xD) + 0x2B1) / 106) - 0x35; + player->unk_07C = test << 0x10; } - var_v0 = player->unk_0BC & ~0x10; - player->unk_0BC = var_v0; - var_v1 = var_v0 & 0x10; + player->unk_0BC &= ~0x10; } - if ((var_v1 == 0x10) && ((player->unk_000 & 0x4000) != 0x4000)) { - player->unk_0BC = var_v0 & ~0x10; + if (((player->unk_0BC & 0x10) == 0x10) && ((player->unk_000 & 0x4000) != 0x4000)) { + player->unk_0BC &= ~0x10; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80036CB4.s") -#endif -#ifdef MIPS_TO_C -//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b -void func_80036DB4(Player *player, f32 *arg1, f32 *arg2) { +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0_0.s +extern f64 D_800EDD90;// = 0.02; +extern f64 D_800EDD98;// = 0.01; +extern f64 D_800EDDA0;// = 0.05; +extern f64 D_800EDDA8;// = 0.1; +extern f64 D_800EDDB0;// = 0.15; +extern f64 D_800EDDB8;// = 0.1; +extern f64 D_800EDDC0;// = 0.05; + +void func_80036DB4(Player *player, Vec3f arg1, Vec3f arg2) { + s16 thing; + s16 stackPadding0; f32 sp20; - f32 var_f14; f32 var_f18; - f32 var_f2; - f64 var_f10; - s16 var_v0; - s32 temp_a0; - s32 temp_t0; s32 temp_t6; - temp_t0 = player->unk_0BC; - if (((temp_t0 & 0x1000) == 0x1000) || ((temp_t0 & 0x20) == 0x20)) { - arg1->unk0 = 0.0f; - arg1->unk4 = 0.0f; - arg1->unk8 = 0.0f; - func_802B63B8(arg1, (f32 (*)[3]) player->unk_174[0]); + if (((player->unk_0BC & 0x1000) == 0x1000) || ((player->unk_0BC & 0x20) == 0x20)) { + arg1[0] = 0.0f; + arg1[1] = 0.0f; + arg1[2] = 0.0f; + func_802B63B8(arg1, player->unk_174); } else { - temp_a0 = temp_t0 & 0x10; - if ((temp_a0 == 0x10) && ((temp_t0 & 2) != 2)) { - var_f14 = -player->unk_20C; - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; - var_f18 = player->unk_208 + (var_f2 * 3.0f) + (var_f14 * 10.0f); + if (((player->unk_0BC & 0x10) == 0x10) && ((player->unk_0BC & 2) != 2)) { + var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 10.0f); sp20 = player->unk_084 * 3.0f; - } else if (!(temp_t0 & 0x800) && !(player->unk_044 & 0x4000)) { - var_v0 = player->unk_0FA; - if (var_v0 > 0) { - var_v0 *= -1; + } else if (!(player->unk_0BC & 0x800) && !(player->unk_044 & 0x4000)) { + thing = player->unk_0FA; + if (thing > 0) { + thing *= -1; } - temp_t6 = (s32) player->unk_07C >> 0x10; + temp_t6 = player->unk_07C >> 0x10; if ((temp_t6 < 0x15) && (temp_t6 >= -0x14)) { - if (var_v0 < 0x14) { - var_f14 = -player->unk_20C; - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; - var_f10 = (f64) (player->unk_208 + (var_f2 / 3.0f)) + ((f64) -player->unk_09C * 0.02) + (f64) (var_f14 * 50.0f); - goto block_16; + if (thing < 0x14) { + var_f18 = (player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) + (-player->unk_09C * 0.02) + (-player->unk_20C * 50.0f); + } else { + var_f18 = (player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) + ((temp_t6 * 0.01) + (-player->unk_09C * 0.05)) + (-player->unk_20C * 50.0f); } - var_f14 = -player->unk_20C; - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; - var_f18 = (f32) ((f64) (player->unk_208 + (var_f2 / 3.0f)) + (((f64) temp_t6 * 0.01) + ((f64) -player->unk_09C * 0.05)) + (f64) (var_f14 * 50.0f)); } else { - var_f14 = -player->unk_20C; - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; - var_f10 = (f64) (player->unk_208 + (var_f2 / 3.0f)) + (((f64) temp_t6 * 0.1) + ((f64) -player->unk_09C * 0.15)) + (f64) (var_f14 * 50.0f); -block_16: - var_f18 = (f32) var_f10; + var_f18 = (player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) + ((temp_t6 * 0.1) + (-player->unk_09C * 0.15)) + (-player->unk_20C * 50.0f); } sp20 = player->unk_084; } else { - var_f14 = -player->unk_20C; - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; + var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 1.5) + (((player->unk_07C >> 0x10) * 0.1) + (-player->unk_09C * 0.05)) + (-player->unk_20C * 50.0f); sp20 = player->unk_084; - var_f18 = (f32) ((f64) player->unk_208 + ((f64) var_f2 * 1.5) + (((f64) ((s32) player->unk_07C >> 0x10) * 0.1) + ((f64) -player->unk_09C * 0.05)) + (f64) (var_f14 * 50.0f)); } - if ((temp_t0 & 0x200) == 0x200) { - if ((temp_a0 == 0x10) && ((temp_t0 & 2) != 2)) { - var_f18 = player->unk_208 + (var_f2 * 3.0f) + (var_f14 * 10.0f); + if ((player->unk_0BC & 0x200) == 0x200) { + if (((player->unk_0BC & 0x10) == 0x10) && ((player->unk_0BC & 2) != 2)) { + var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 10.0f); sp20 = player->unk_084 * 3.0f; } else { + var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f); sp20 = player->unk_084; - var_f18 = player->unk_208 + (var_f2 / 3.0f); } } - arg1->unk4 = 0.0f; - arg1->unk0 = (player->unk_090 + var_f18) * player->unk_094; - arg1->unk8 = (f32) (player->unk_094 * sp20); - func_802B63B8(arg1, (f32 (*)[3]) player->unk_174[0]); + arg1[0] = (player->unk_090 + var_f18) * player->unk_094; + arg1[1] = 0.0f; + arg1[2] = player->unk_094 * sp20; + func_802B63B8(arg1, player->unk_174); } - arg2->unk0 = arg1->unk0; - arg2->unk4 = (f32) arg1->unk4; - arg2->unk8 = (f32) arg1->unk8; + arg2[0] = arg1[0]; + arg2[1] = arg1[1]; + arg2[2] = arg1[2]; } #else GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80036DB4.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0_0.s +extern f64 D_800EDDC8;// = 0.02; +extern f64 D_800EDDD0;// = 0.01; +extern f64 D_800EDDD8;// = 0.05; +extern f64 D_800EDDE0;// = 0.1; +extern f64 D_800EDDE8;// = 0.15; +extern f64 D_800EDDF0;// = 0.1; +extern f64 D_800EDDF8;// = 0.05; + void func_800371F4(Player *player, f32 *arg1, f32 *arg2) { - f32 sp20; - f32 var_f14; - f32 var_f18; - f32 var_f2; s16 var_v0; - s32 temp_a0; - s32 temp_t0; + f32 sp20; + f32 var_f18; s32 temp_t6; - temp_t0 = player->unk_0BC; - if (((temp_t0 & 0x1000) == 0x1000) || ((temp_t0 & 0x20) == 0x20)) { - arg1->unk0 = 0.0f; - arg1->unk4 = 0.0f; - arg1->unk8 = 0.0f; - func_802B63B8(arg1, (f32 (*)[3]) player->unk_174[0]); + if (((player->unk_0BC & 0x1000) == 0x1000) || ((player->unk_0BC & 0x20) == 0x20)) { + arg1[0] = 0.0f; + arg1[1] = 0.0f; + arg1[2] = 0.0f; + func_802B63B8(arg1, player->unk_174); } else { - temp_a0 = temp_t0 & 0x10; - if ((temp_a0 == 0x10) && ((temp_t0 & 2) != 2)) { - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; - var_f14 = -player->unk_20C * 50.0f; - var_f18 = player->unk_208 + (var_f2 * 3.0f) + var_f14; + if (((player->unk_0BC & 0x10) == 0x10) && ((player->unk_0BC & 2) != 2)) { + var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 50.0f); sp20 = player->unk_084 * 3.0f; - } else if (!(temp_t0 & 0x800) && !(player->unk_044 & 0x4000)) { + } else if (!(player->unk_0BC & 0x800) && !(player->unk_044 & 0x4000)) { var_v0 = player->unk_0FA; if (var_v0 > 0) { var_v0 *= -1; @@ -5692,43 +5670,35 @@ void func_800371F4(Player *player, f32 *arg1, f32 *arg2) { temp_t6 = (s32) player->unk_07C >> 0x10; if ((temp_t6 < 0x15) && (temp_t6 >= -0x14)) { if (var_v0 < 0x14) { - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; - var_f14 = -player->unk_20C * 50.0f; - var_f18 = (f32) ((f64) (player->unk_208 + (var_f2 / 3.0f)) + ((f64) -player->unk_09C * 0.02) + (f64) var_f14); + var_f18 = (player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) + (-player->unk_09C * 0.02) + (-player->unk_20C * 50.0f); } else { - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; - var_f14 = -player->unk_20C * 50.0f; - var_f18 = (f32) (((f64) (player->unk_208 + (var_f2 / 3.0f)) - (((f64) temp_t6 * 0.01) + ((f64) player->unk_09C * 0.05))) + (f64) var_f14); + var_f18 = ((player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) - ((temp_t6 * 0.01) + (player->unk_09C * 0.05))) + (-player->unk_20C * 50.0f); } } else { - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; - var_f14 = -player->unk_20C * 50.0f; - var_f18 = (f32) (((f64) (player->unk_208 + (var_f2 / 3.0f)) - (((f64) temp_t6 * 0.1) + ((f64) player->unk_09C * 0.15))) + (f64) var_f14); + var_f18 = ((player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f)) - ((temp_t6 * 0.1) + (player->unk_09C * 0.15))) + (-player->unk_20C * 50.0f); } sp20 = player->unk_084; } else { - var_f2 = -(player->unk_094 / 18.0f) * 216.0f; - var_f14 = -player->unk_20C * 50.0f; + var_f18 = ((player->unk_208 + ((f64) (-(player->unk_094 / 18.0f) * 216.0f) * 1.5)) - (((player->unk_07C >> 0x10) * 0.1) + (player->unk_09C * 0.05))) + (-player->unk_20C * 50.0f); sp20 = player->unk_084; - var_f18 = (f32) ((((f64) player->unk_208 + ((f64) var_f2 * 1.5)) - (((f64) ((s32) player->unk_07C >> 0x10) * 0.1) + ((f64) player->unk_09C * 0.05))) + (f64) var_f14); } - if ((temp_t0 & 0x200) == 0x200) { - if ((temp_a0 == 0x10) && ((temp_t0 & 2) != 2)) { - var_f18 = player->unk_208 + (var_f2 * 3.0f) + var_f14; + if ((player->unk_0BC & 0x200) == 0x200) { + if (((player->unk_0BC & 0x10) == 0x10) && ((player->unk_0BC & 2) != 2)) { + var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 50.0f); sp20 = player->unk_084 * 3.0f; } else { + var_f18 = player->unk_208 + ((-(player->unk_094 / 18.0f) * 216.0f) / 3.0f); sp20 = player->unk_084; - var_f18 = player->unk_208 + (var_f2 / 3.0f); } } - arg1->unk4 = 0.0f; - arg1->unk0 = -(player->unk_090 + var_f18) * player->unk_094; - arg1->unk8 = (f32) (player->unk_094 * sp20); - func_802B63B8(arg1, (f32 (*)[3]) player->unk_174[0]); + arg1[0] = -(player->unk_090 + var_f18) * player->unk_094; + arg1[1] = 0.0f; + arg1[2] = player->unk_094 * sp20; + func_802B63B8(arg1, player->unk_174); } - arg2->unk0 = arg1->unk0; - arg2->unk4 = (f32) arg1->unk4; - arg2->unk8 = (f32) arg1->unk8; + arg2[0] = arg1[0]; + arg2[1] = arg1[1]; + arg2[2] = arg1[2]; } #else GLOBAL_ASM("asm/non_matchings/code_80027D00/func_800371F4.s") diff --git a/src/code_80027D00.h b/src/code_80027D00.h index 26c7ae7f6..e63ce019c 100644 --- a/src/code_80027D00.h +++ b/src/code_80027D00.h @@ -51,6 +51,8 @@ void func_800332E8(Player*, s32); void func_800337CC(Player*, f32, s32); void func_80033850(Player*, f32); void func_80036C5C(Player*); +void func_80036CB4(Player*); +void func_80036DB4(Player*, Vec3f, Vec3f); void func_80037614(Player*, Vec3f, Vec3f); void func_8003777C(Player*, Vec3f, Vec3f); void func_800378E8(Player*, Vec3f, Vec3f); diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index b6b101af4..a91c41249 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -190,25 +190,22 @@ void func_8006ED60() { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern OSMesgQueue gDmaMesgQueue; -extern void *gMainReceivedMesg; -extern OSIoMesg gDmaIoMesg; -extern s8 _other_texturesSegmentRomStart; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +extern ? _other_texturesSegmentRomStart; -u8 *func_8006ED94(s32 arg0, u8 *arg1, u32 arg2, s32 arg3) { - void *sp28; - u32 temp_a1; - void *temp_a0; +s32 func_8006ED94(s32 *arg0, s32 arg1, s32 arg2, s32 arg3) { + u8 *sp28; + s32 temp_a1; + u8 *temp_a0; temp_a0 = arg1 + arg3; temp_a1 = (arg2 + 0xF) & ~0xF; arg2 = temp_a1; sp28 = temp_a0; - osInvalDCache(temp_a0, temp_a1); - osPiStartDma(&gDmaIoMesg, 0, 0, (arg0 & 0xFFFFFF) + &_other_texturesSegmentRomStart, sp28, arg2, &gDmaMesgQueue); + osInvalDCache(temp_a0, (u32) temp_a1); + osPiStartDma(&gDmaIoMesg, 0, 0, (u32) (((s32) arg0 & 0xFFFFFF) + &_other_texturesSegmentRomStart), sp28, (u32) arg2, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); - mio0decode(temp_a0, arg1); + mio0decode(temp_a0, (u8 *) arg1); return arg1; } #else @@ -719,18 +716,25 @@ GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006F8CC.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8006F008(); // extern -void func_8006F8CC(); // extern +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +typedef struct { + /* 0x00 */ char pad0[4]; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk8; /* inferred */ + /* 0x0C */ f32 unk_0C; + /* 0x10 */ char pad10[0x10]; /* maybe part of unk_0C[5]? */ +} struct_D_8018CE10; /* size = 0x20 */ + +? func_8006F008(); /* extern */ +? func_8006F8CC(); /* extern */ extern s32 D_801655D8; extern s32 D_801655E8; extern s32 D_801655F8; extern s32 D_80165608; extern s32 D_80165618; extern s32 D_80165628; -extern s32 D_80165658; +extern ? D_80165658; extern s16 D_801656F0; -extern s16 D_80165730; extern s8 D_8016576A; extern s8 D_8016579C; extern s8 D_801657AE; @@ -754,14 +758,13 @@ extern s8 D_801658DC; extern s8 D_801658E4; extern s8 D_801658EC; extern s8 D_801658F4; -extern s8 D_801658FE; extern ? D_8018CF28; extern ? D_8018CF50; extern ? D_8018CFAC; extern ? D_8018CFB4; extern ? D_8018CFBC; extern ? D_8018CFC4; -extern f32 D_8018D050; +extern ? D_8018D050; extern ? D_8018D0F0; extern s32 D_8018D114; extern s32 D_8018D160; @@ -793,40 +796,35 @@ extern s32 D_8018D2A4; extern s32 D_8018D2AC; extern s32 D_8018D2B4; extern s32 D_8018D2BC; -extern s32 D_8018D2C8; +extern ? D_8018D2C8; extern s16 D_8018D2F0; extern s16 D_8018D2F8; extern s32 D_8018D320; void func_8006FA94(void) { - ? *temp_a1; - ? *temp_a2; - ? *temp_v1; - s16 temp_a0_2; + ? *var_a0_2; + ? *var_a1; + ? *var_a1_2; + ? *var_a2; + ? *var_a2_2; + ? *var_a3; + ? *var_t0; + ? *var_v1; + Player *temp_v0_3; + Player *temp_v0_4; + Player *temp_v0_5; + Player *var_v0; s16 temp_t7; + s16 var_a0; s32 temp_t6; s32 temp_v0; s32 temp_v0_2; s8 temp_ra; - u32 temp_a0; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - ? *phi_v1; - ? *phi_a1; - ? *phi_a2; - ? *phi_a0; - ? *phi_a1_2; - ? *phi_a2_2; - struct_D_8018CE10 *phi_v1_2; - s16 phi_a0_2; - ? *phi_a3; - Player *phi_v0; - ? *phi_t0; + struct_D_8018CE10 *var_v1_2; func_8006F8CC(); func_8006F008(); - osSetTime(0, 0); + osSetTime(/* u64+0x0 */ 0, /* u64+0x4 */ 0); D_8018D170 = 0; D_8018D190 = 0; D_8018D188 = 0; @@ -850,94 +848,95 @@ void func_8006FA94(void) { D_80165658.unk0 = 0; temp_ra = D_8018EDF3; D_801658BC = D_801658C6; - if (temp_ra != ONE_PLAYERS_SELECTED) { - if (temp_ra != TWO_PLAYERS_SELECTED) { - if (temp_ra != THREE_PLAYERS_SELECTED) { - if (temp_ra != FOUR_PLAYERS_SELECTED) { - - } else { - if (gModeSelection == VERSUS) { - D_8018D114 = 0xA; - D_8018D178 = 0x1E; - D_8018D180 = 0x1E; - } else { - D_8018D114 = 0xB; - D_8018D178 = 0x1E; - D_8018D180 = 0x1E; - } - D_8018D2AC = 0xA; - } - } else if (gModeSelection == VERSUS) { - D_8018D114 = 8; - D_8018D178 = 0x64; - D_8018D180 = 0x96; - D_8018D2AC = 0x3C; - } else { - D_8018D180 = 9; - D_8018D178 = 0x64; - D_8018D180 = 0x96; - D_8018D2AC = 0x3C; - } - } else if (gScreenModeSelection == SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL) { + switch (temp_ra) { /* irregular */ + case 1: + if (gModeSelection == 0) { + D_8018D114 = 0; + D_8018D178 = 0x00000096; + D_8018D114 = 0x000000F0; + } else { + D_8018D114 = 1; + D_8018D178 = 0x0000000A; + D_8018D180 = 0; + } + break; + case 2: + if (gScreenModeSelection == 1) { temp_v0 = gModeSelection; - if (temp_v0 == GRAND_PRIX) { + if (temp_v0 == 0) { D_8018D114 = 2; - D_8018D178 = 0x96; - D_8018D180 = 0xF0; - D_8018D2AC = 0x3C; - } else if (temp_v0 == VERSUS) { + D_8018D178 = 0x00000096; + D_8018D180 = 0x000000F0; + D_8018D2AC = 0x0000003C; + } else if (temp_v0 == 2) { D_8018D114 = 3; - D_8018D178 = 0x1E; - D_8018D180 = 0x1E; - D_8018D2AC = 0x3C; + D_8018D178 = 0x0000001E; + D_8018D180 = 0x0000001E; + D_8018D2AC = 0x0000003C; } else { D_8018D114 = 4; - D_8018D178 = 0x28; - D_8018D180 = 0x28; - D_8018D2AC = 0x3C; + D_8018D178 = 0x00000028; + D_8018D180 = 0x00000028; + D_8018D2AC = 0x0000003C; } } else { temp_v0_2 = gModeSelection; - if (temp_v0_2 == GRAND_PRIX) { + if (temp_v0_2 == 0) { D_8018D114 = 5; - } else if (temp_v0_2 == VERSUS) { + } else if (temp_v0_2 == 2) { D_8018D114 = 6; } else { D_8018D114 = 7; } } - } else if (gModeSelection == GRAND_PRIX) { - D_8018D114 = 0; - D_8018D178 = 0x96; - D_8018D114 = 0xF0; - } else { - D_8018D114 = 1; - D_8018D178 = 0xA; - D_8018D180 = 0; + break; + case 3: + if (gModeSelection == 2) { + D_8018D114 = 8; + D_8018D178 = 0x00000064; + D_8018D180 = 0x00000096; + D_8018D2AC = 0x0000003C; + } else { + D_8018D180 = 9; + D_8018D178 = 0x00000064; + D_8018D180 = 0x00000096; + D_8018D2AC = 0x0000003C; + } + break; + case 4: + if (gModeSelection == 2) { + D_8018D114 = 0x0000000A; + D_8018D178 = 0x0000001E; + D_8018D180 = 0x0000001E; + } else { + D_8018D114 = 0x0000000B; + D_8018D178 = 0x0000001E; + D_8018D180 = 0x0000001E; + } + D_8018D2AC = 0x0000000A; + break; } if (gEnableDebugMode == 0) { D_8016576A = 0; D_8016579C = 0; } + var_a0 = 0; if (temp_ra > 0) { - phi_v1 = &D_8018CFBC; - phi_a1 = &D_8018CFAC; - phi_a2 = &D_8018CFC4; - phi_a0 = &D_8018CFB4; + var_a0_2 = &D_8018CFB4; + var_a2 = &D_8018CFC4; + var_a1 = &D_8018CFAC; + var_v1 = &D_8018CFBC; do { - temp_a0 = phi_a0 + 1; - temp_v1 = phi_v1 + 1; - temp_a1 = phi_a1 + 1; - temp_a2 = phi_a2 + 1; - temp_v1->unk-1 = 0; - temp_a1->unk-1 = 0; - temp_a2->unk-1 = 0; - temp_a0->unk-1 = 0; - phi_v1 = temp_v1; - phi_a1 = temp_a1; - phi_a2 = temp_a2; - phi_a0 = temp_a0; - } while (temp_a0 < (temp_ra + &D_8018CFB4)); + var_a0_2 += 1; + var_v1 += 1; + var_a1 += 1; + var_a2 += 1; + var_v1->unk-1 = 0; + var_a1->unk-1 = 0; + var_a2->unk-1 = 0; + var_a0_2->unk-1 = 0; + } while ((u32) var_a0_2 < (u32) (temp_ra + &D_8018CFB4)); + var_a0 = 0; } D_8018D204 = 1; D_8018D1FC = 0; @@ -961,8 +960,8 @@ void func_8006FA94(void) { D_801656F0 = 0; D_801657B2 = 0; D_801657D8 = D_801657B2; - D_8018D214 = D_801657D8; - D_801657B0 = D_8018D214; + D_8018D214 = (s32) D_801657D8; + D_801657B0 = (s8) D_8018D214; D_801657AE = D_801657B0; D_8018D20C = 0; D_8018D2F8 = 0; @@ -987,58 +986,56 @@ void func_8006FA94(void) { D_8018D16C = temp_t7; D_8018D17C = temp_t7; D_8018D174 = temp_t7; - phi_a1_2 = &D_8018D050; - phi_a2_2 = &D_8018D0F0; - phi_v1_2 = D_8018CE10; - phi_a0_2 = 0; - phi_a3 = &D_8018CF50; - phi_v0 = gPlayerOne; - phi_t0 = &D_8018CF28; + var_v0 = gPlayerOne; + var_t0 = &D_8018CF28; + var_a3 = &D_8018CF50; + var_v1_2 = D_8018CE10; + var_a2_2 = &D_8018D0F0; + var_a1_2 = &D_8018D050; do { - phi_a1_2->unk0 = -32.0f; - phi_a2_2->unk0 = -32.0f; - phi_v1_2->unk_0C = 0.0f; - phi_v1_2->unk_08 = 0.0f; - phi_v1_2->unk_04 = 0.0f; - phi_a3->unk0 = phi_a0_2; - phi_t0->unk0 = phi_v0; - phi_v0->unk_040 = -1; - temp_v0_3 = phi_v0 + 0xDD8; - phi_t0->unk4 = temp_v0_3; - phi_a3->unk2 = phi_a0_2 + 1; - phi_v1_2->unk24 = 0.0f; - phi_v1_2->unk28 = 0.0f; - phi_v1_2->unk2C = 0.0f; - phi_a2_2->unk4 = -32.0f; - phi_a1_2->unk4 = -32.0f; - temp_v0_3->unk40 = -1; + var_a1_2->unk0 = -32.0f; + var_a2_2->unk0 = -32.0f; + var_v1_2->unk_0C = 0.0f; + var_v1_2->unk8 = 0.0f; + var_v1_2->unk_04 = 0.0f; + var_a3->unk0 = var_a0; + var_t0->unk0 = var_v0; + var_v0->unk_040 = -1; + temp_v0_3 = var_v0 + 0xDD8; + var_t0->unk4 = temp_v0_3; + var_a3->unk2 = (s16) (var_a0 + 1); + var_v1_2->unk24 = 0.0f; + var_v1_2->unk28 = 0.0f; + var_v1_2->unk2C = 0.0f; + var_a2_2->unk4 = -32.0f; + var_a1_2->unk4 = -32.0f; + temp_v0_3->unk_040 = -1; temp_v0_4 = temp_v0_3 + 0xDD8; - phi_a3->unk4 = phi_a0_2 + 2; - phi_t0->unk8 = temp_v0_4; - phi_v1_2->unk44 = 0.0f; - phi_v1_2->unk48 = 0.0f; - phi_v1_2->unk4C = 0.0f; - phi_a2_2->unk8 = -32.0f; - phi_a1_2->unk8 = -32.0f; - temp_v0_4->unk40 = -1; + var_a3->unk4 = (s16) (var_a0 + 2); + var_t0->unk8 = temp_v0_4; + var_v1_2->unk44 = 0.0f; + var_v1_2->unk48 = 0.0f; + var_v1_2->unk4C = 0.0f; + var_a2_2->unk8 = -32.0f; + var_a1_2->unk8 = -32.0f; + temp_v0_4->unk_040 = -1; temp_v0_5 = temp_v0_4 + 0xDD8; - phi_t0->unkC = temp_v0_5; - phi_a3->unk6 = phi_a0_2 + 3; - temp_a0_2 = phi_a0_2 + 4; - phi_v1_2->unk64 = 0.0f; - phi_v1_2->unk68 = 0.0f; - phi_v1_2->unk6C = 0.0f; - phi_a2_2->unkC = -32.0f; - phi_a1_2->unkC = -32.0f; - temp_v0_5->unk40 = -1; - phi_a1_2 += 0x10; - phi_a2_2 += 0x10; - phi_v1_2 += 0x80; - phi_a0_2 = temp_a0_2; - phi_a3 += 8; - phi_v0 = temp_v0_5 + 0xDD8; - phi_t0 += 0x10; - } while (temp_a0_2 != 8); + var_t0->unkC = temp_v0_5; + var_a3->unk6 = (s16) (var_a0 + 3); + var_a0 += 4; + var_v1_2->unk64 = 0.0f; + var_v1_2->unk68 = 0.0f; + var_v1_2->unk6C = 0.0f; + var_a2_2->unkC = -32.0f; + var_a1_2->unkC = -32.0f; + temp_v0_5->unk_040 = -1; + var_v0 = temp_v0_5 + 0xDD8; + var_a1_2 += 0x10; + var_a2_2 += 0x10; + var_v1_2 += 0x80; + var_a3 += 8; + var_t0 += 0x10; + } while (var_a0 != (s16) 8); } #else GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006FA94.s") diff --git a/src/code_80071F00.c b/src/code_80071F00.c index 30506df05..49778d1a8 100644 --- a/src/code_80071F00.c +++ b/src/code_80071F00.c @@ -10,6 +10,7 @@ #include "code_80057C60.h" #include "code_80071F00.h" #include "code_80086E70.h" +#include "common_textures.h" s32 find_unused_obj_index(s32* arg0) { s32 temp_v0; @@ -34,25 +35,12 @@ s32 find_unused_obj_index(s32* arg0) { return temp_v1; } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -//void func_80072428(s32, s32 *); // extern -extern s8 D_80165CE2[]; - -void func_80071F6C(s32 arg0, s32 arg1) { - s32 temp_a0; - s32 temp_a1; - - temp_a1 = arg0; - temp_a0 = arg0; - arg0 = temp_a1; - func_80072428(arg0); - D_80165CE2[0xE0] = 0; - arg0 = -1; +// Not actually sure about the pointer type, but its definitely SOME type of pointer +void func_80071F6C(s32 *arg0) { + func_80072428(*arg0); + D_80165C18[*arg0].unk_0CA = 0; + *arg0 = -1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80071F6C.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc @@ -147,7 +135,7 @@ loop_3: GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80072044.s") #endif -void func_80072100(s32 arg0) { +void func_80072100(s32 *arg0) { func_80071F6C(arg0); } @@ -2776,62 +2764,50 @@ void func_80077428(s32 arg0) { func_80086E70(arg0); } -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc void func_80077450(s32 objectIndex) { + s16 stackPadding0; s16 sp3C; s16 sp3A; s16 sp38; - s16 temp_v0; - struct_80165C18_entry *temp_s0; - temp_s0 = &D_80165C18[objectIndex]; - temp_v0 = temp_s0->unk_0A6; - switch (temp_v0) { /* irregular */ + switch (D_80165C18[objectIndex].unk_0A6) { case 0: break; case 1: func_80077428(objectIndex); break; case 2: - f32_step_up_towards(&temp_s0->unk_000, 0.1f, 0.01f); - if ((temp_s0->unk_004[1] <= (f32) temp_s0->unk_084[5]) && (func_80073B00(objectIndex, &temp_s0->unk_0A0, 0x000000FF, 0, 0x00000010, 0, 0) != 0)) { + f32_step_up_towards(&D_80165C18[objectIndex].unk_000, 0.1f, 0.01f); + if ((D_80165C18[objectIndex].unk_004[1] <= D_80165C18[objectIndex].unk_084[5]) && (func_80073B00(objectIndex, &D_80165C18[objectIndex].unk_0A0, 0x000000FF, 0, 0x00000010, 0, 0) != 0)) { func_80086F60(objectIndex); func_80072428(objectIndex); } break; } - if (temp_s0->unk_048 != 0) { - temp_s0->unk_084[4] = (s16) ((s32) (temp_s0->unk_084[4] + 1) % 3); - func_8005C6B4(temp_s0->unk8D, &sp3C, &sp3A, &sp38); - temp_s0->unk_084[0] = sp3C; - temp_s0->unk_084[1] = sp3A; - temp_s0->unk_084[2] = sp38; + if (D_80165C18[objectIndex].unk_048 != 0) { + D_80165C18[objectIndex].unk_084[4] = (s16) ((s32) (D_80165C18[objectIndex].unk_084[4] + 1) % 3); + func_8005C6B4(D_80165C18[objectIndex].unk_084[4], &sp3C, &sp3A, &sp38); + D_80165C18[objectIndex].unk_084[0] = sp3C; + D_80165C18[objectIndex].unk_084[1] = sp3A; + D_80165C18[objectIndex].unk_084[2] = sp38; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077450.s") -#endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc +#ifdef NEEDS_RODATA + void func_80077584(s32 objectIndex) { - f64 temp_f0; - s16 temp_v1; struct_80165C18_entry *temp_v0; temp_v0 = &D_80165C18[objectIndex]; - temp_v1 = temp_v0->unk_0AE; - if ((temp_v1 != 0) && (temp_v1 == 1) && ((u8) temp_v0->unk_0D8 != 0)) { - temp_f0 = (f64) temp_v0->unk_038[1]; - if (temp_f0 >= -0.5) { - temp_v0->unk_038[1] = (f32) (temp_f0 - 0.15); + if ((temp_v0->unk_0AE != 0) && (temp_v0->unk_0AE == 1) && ((u8) temp_v0->unk_0D8 != 0)) { + if (temp_v0->unk_038[1] >= -0.5) { + temp_v0->unk_038[1] -= 0.15; } else { temp_v0->unk_038[2] = 0.0f; temp_v0->unk_038[0] = 0.0f; } } - temp_v0->unk_0B2[2] = (u16) temp_v0->unk_0B2[2] + temp_v0->unk_084[3]; + temp_v0->unk_0B2[2] += temp_v0->unk_084[3]; func_80087710(objectIndex); func_8008BF18(objectIndex); } @@ -2840,9 +2816,7 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077584.s") #endif #ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -void func_80077450(s32); /* extern */ -void func_80077584(s32); /* extern */ +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern s32 D_8018C630; extern ? D_8018C830; @@ -2860,7 +2834,7 @@ void func_80077640(void) { func_80077450(temp_s0); func_80077584(temp_s0); if (temp_s2->unk_0A6 == 0) { - func_80072100((s32) var_s1); + func_80072100(var_s1); } } } @@ -2871,83 +2845,73 @@ void func_80077640(void) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077640.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern s32 D_0D028DD8; -s16 gCurrentCourseId; /* unable to generate initializer */ +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f32 D_800EEB38;// = 0.1f; -void func_80077700(s32 objectIndex, f32 *arg1, s32 arg2) { +void func_80077700(s32 objectIndex, Vec3f arg1, s32 arg2) { + s32 stackPadding1; + u16 stackPadding0; + u16 temp_s0; u16 sp3E; u16 sp3C; - struct_80165C18_entry *sp34; - s16 temp_v1; - s32 temp_s0; - struct_80165C18_entry *temp_v0; func_800723A4(objectIndex, 0); - temp_v0 = &D_80165C18[objectIndex]; - temp_v0->unk_0D5 = 7; - temp_v0->unk_060 = &D_0D028DD8; - temp_v0->unk_068 = &D_0D028DD8; - temp_v0->unk_000 = 0.1f; - temp_v0->unk_044 = arg1->unk4; - temp_v1 = gCurrentCourseId; - switch (temp_v1) { /* irregular */ - case 0: - sp34 = temp_v0; - func_8008BD14(objectIndex, (s16) (s32) arg1->unk0, (s16) (s32) ((f64) arg1->unk4 + 25.0), (s16) (s32) arg1->unk8, (u16) 0x00000014, (u16) 0x0000001E, (u16) 0x00000014); - temp_v0->unk_034 = 1.5f; - temp_v0->unk_038[1] = 1.5f; + D_80165C18[objectIndex].unk_0D5 = 7; + D_80165C18[objectIndex].unk_060 = (s32 *) D_0D028DD8; + D_80165C18[objectIndex].unk_068 = (s32 *) D_0D028DD8; + D_80165C18[objectIndex].unk_000 = 0.1f; + D_80165C18[objectIndex].unk_044 = arg1[1]; + switch (gCurrentCourseId) { + case COURSE_MARIO_RACEWAY: + func_8008BD14(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x00000014, 0x0000001E, 0x00000014); + D_80165C18[objectIndex].unk_034 = 1.5f; + D_80165C18[objectIndex].unk_038[1] = 1.5f; break; - case 4: - sp34 = temp_v0; - func_8008BD14(objectIndex, (s16) (s32) arg1->unk0, (s16) (s32) ((f64) arg1->unk4 + 25.0), (s16) (s32) arg1->unk8, (u16) 0x00000014, (u16) 0x0000001E, (u16) 0x00000014); - temp_v0->unk_034 = 2.0f; - temp_v0->unk_038[1] = 2.0f; + case COURSE_YOSHI_VALLEY: + func_8008BD14(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x00000014, 0x0000001E, 0x00000014); + D_80165C18[objectIndex].unk_034 = 2.0f; + D_80165C18[objectIndex].unk_038[1] = 2.0f; break; - case 7: - sp34 = temp_v0; - func_8008BD14(objectIndex, (s16) (s32) arg1->unk0, (s16) (s32) ((f64) arg1->unk4 + 30.0), (s16) (s32) arg1->unk8, (u16) 0x00000010, (u16) 0x00000028, (u16) 0x00000010); - temp_v0->unk_034 = 2.0f; - temp_v0->unk_038[1] = 2.0f; + case COURSE_ROYAL_RACEWAY: + func_8008BD14(objectIndex, arg1[0], arg1[1] + 30.0, arg1[2], 0x00000010, 0x00000028, 0x00000010); + D_80165C18[objectIndex].unk_034 = 2.0f; + D_80165C18[objectIndex].unk_038[1] = 2.0f; break; - case 8: - sp34 = temp_v0; - func_8008BD14(objectIndex, (s16) (s32) arg1->unk0, (s16) (s32) ((f64) arg1->unk4 + 25.0), (s16) (s32) arg1->unk8, (u16) 0x00000014, (u16) 0x0000001E, (u16) 0x00000014); - temp_v0->unk_034 = 1.5f; - temp_v0->unk_038[1] = 1.0f; + case COURSE_LUIGI_RACEWAY: + func_8008BD14(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x00000014, 0x0000001E, 0x00000014); + D_80165C18[objectIndex].unk_034 = 1.5f; + D_80165C18[objectIndex].unk_038[1] = 1.0f; break; } - temp_s0 = (random_int(0x0010U) << 0xC) & 0xFFFF; + temp_s0 = random_int(0x0010U) << 0xC; sp3E = random_int(0x0010U) << 0xC; sp3C = random_int(0x0010U) << 0xC; - func_8008B888(objectIndex, 0U, ((s32) (arg2 * 0xFFFF) / 20) & 0xFFFF, 0U); - func_8008B8BC(objectIndex, temp_s0 & 0xFFFF, sp3E, sp3C); + func_8008B888(objectIndex, 0U, (arg2 * 0xFFFF) / 20, 0U); + func_8008B8BC(objectIndex, temp_s0, sp3E, sp3C); } #else GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077700.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_80072044(? *, ? *, ?); // extern -void func_80077700(s32, s32, s32); // extern +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c extern s32 D_80183E7C; extern s32 D_8018C970; -s32 func_80077A54(s32 arg0, s32 arg1) { +s32 func_80077A54(Vec3f arg0, s32 arg1) { s32 sp1C; s32 temp_v0; - s32 phi_a0; + s32 var_a0; - temp_v0 = func_80072044(&D_8018C970, &D_80183E7C, 0x40); - phi_a0 = temp_v0; + temp_v0 = func_80072044(&D_8018C970, &D_80183E7C, 0x00000040); + var_a0 = temp_v0; if (temp_v0 != -1) { sp1C = temp_v0; - func_80077700(temp_v0, arg0, arg1); - phi_a0 = sp1C; + func_80077700(var_a0, arg0, arg1); + var_a0 = sp1C; } - return phi_a0; + return var_a0; } #else GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077A54.s") @@ -3081,22 +3045,20 @@ loop_3: GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077D5C.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern Vtx D_0D005770; -extern s32 D_0D0293D8; +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f32 D_800EEB3C;// = 0.15f; void func_80077E20(s32 objectIndex) { - struct_80165C18_entry *sp18; struct_80165C18_entry *temp_v0; temp_v0 = &D_80165C18[objectIndex]; - temp_v0->unk_064 = &D_0D0293D8; - temp_v0->unk_06C = (s32) &D_0D0293D8; - temp_v0->unk_074 = (s32) &D_0D005770; + temp_v0->unk_064 = D_0D0293D8; + temp_v0->unk_06C = D_0D0293D8; + // There's something up with the handling of D_0D005770 and the loading of 0x10 right here + temp_v0->unk_074 = D_0D005770; temp_v0->unk_0DA = 0x10; - temp_v0->unk_0D9 = 0x10; - sp18 = temp_v0; + temp_v0->unk_0D9 = temp_v0->unk_0DA; temp_v0->unk_000 = 0.15f; func_800721C0(objectIndex, 0x00000010); func_80086EF0(objectIndex); @@ -3250,10 +3212,9 @@ void func_80078170(s32 arg0, ? arg1) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80078170.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern Vtx D_0D005770; -extern s32 D_0D0293D8; +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.x +extern f32 D_800EEB48;// = 0.15f; void func_80078220(s32 objectIndex) { struct_80165C18_entry *temp_v0; @@ -3271,7 +3232,7 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80078220.s") #endif #ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c extern s32 gGamestate; void func_80078288(s32 objectIndex) { @@ -5547,19 +5508,18 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007C280.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8007BDA8(); // extern -void func_8007C280(); // extern +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +? func_8007C280(); /* extern */ void func_8007C2F8(s32 arg0) { - if (arg0 != 0) { - if (arg0 != 1) { - return; - } + switch (arg0) { /* irregular */ + case 0: + func_8007BDA8(); + return; + case 1: func_8007C280(); return; } - func_8007BDA8(); } #else GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007C2F8.s") @@ -5625,7 +5585,7 @@ UNUSED void func_8007C49C(void) { } #ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c void func_8007C4A4(s32 objectIndex) { struct_80165C18_entry *sp20; s32 sp1C; @@ -6282,10 +6242,8 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007D6A8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_80072044(? *, ? *, ?); // extern -void func_800723A4(s32, ?); // extern -void func_8007D6A8(s32, s32); // extern +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +? func_8007D6A8(s32, s32); /* extern */ extern s32 D_80183E4C; extern s32 D_80183E5C; extern s32 D_8018C3F0; @@ -6293,17 +6251,17 @@ extern s32 D_8018C630; void func_8007D714(s32 arg0) { s32 sp1C; - s32 phi_v0; + s32 var_v0; if (arg0 == 1) { - phi_v0 = func_80072044(&D_8018C3F0, &D_80183E4C, 0x28); + var_v0 = func_80072044(&D_8018C3F0, &D_80183E4C, 0x00000028); } else { - phi_v0 = func_80072044(&D_8018C630, &D_80183E5C, 0x1E); + var_v0 = func_80072044(&D_8018C630, &D_80183E5C, 0x0000001E); } - if (phi_v0 != -1) { - sp1C = phi_v0; - func_800723A4(phi_v0, 0); - func_8007D6A8(phi_v0, arg0); + if (var_v0 != -1) { + sp1C = var_v0; + func_800723A4(var_v0, 0); + func_8007D6A8(var_v0, arg0); } } #else @@ -8109,28 +8067,17 @@ void func_80080A14(s32 objectIndex, Player *player) { } } -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc void func_80080A4C(s32 objectIndex, s32 cameraPlayerId) { - Camera *sp1C; - Player *sp18; - Player *temp_a3; - struct_80165C18_entry *temp_v0; + Camera *camera = &camera1[cameraPlayerId]; + Player *player = &gPlayerOne[cameraPlayerId]; - sp1C = &camera1[cameraPlayerId]; - temp_a3 = &gPlayerOne[cameraPlayerId]; if (gScreenModeSelection != 3) { - sp18 = temp_a3; - if ((func_80072320(objectIndex, 0x00000010) != 0) && (func_80088A58(objectIndex, temp_a3, 500.0f) != 0)) { - func_8001CA10(sp1C); - temp_v0 = &D_80165C18[objectIndex]; - func_800C98B8(temp_v0->unk_004, temp_v0->unk_038, 0x1900800FU); + if ((func_80072320(objectIndex, 0x00000010) != 0) && (func_80088A58(objectIndex, player, 500.0f) != 0)) { + func_8001CA10(camera); + func_800C98B8(D_80165C18[objectIndex].unk_004, D_80165C18[objectIndex].unk_038, 0x1900800FU); } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80080A4C.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc @@ -10897,21 +10844,18 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80085F74.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80073444(s32, void *, void *, ?, s32); // extern -void func_80085BB4(s32); // extern -void func_8008B7D4(f32, s32, s32); // extern +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c extern ? D_06007200; extern ? D_0600B000; -extern ? D_800E6734; extern f32 D_8018D01C; +f32 D_800E6734[0][3]; /* unable to generate initializer */ void func_80086074(s32 arg0, s32 arg1) { - void *temp_v0; + f32 *temp_v0; - temp_v0 = (arg1 * 0xC) + &D_800E6734; - func_8008B7D4(temp_v0->unk0 * D_8018D01C, temp_v0->unk4, temp_v0->unk8); - func_80073444(arg0, (arg1 << 9) + &D_06007200, (arg1 << 0xC) + &D_0600B000, 0x40, 0x40); + temp_v0 = D_800E6734[arg1]; + func_8008B7D4(arg0, temp_v0->unk0 * D_8018D01C, temp_v0->unk4, temp_v0->unk8); + func_80073444(arg0, (arg1 << 9) + &D_06007200, (arg1 << 0xC) + &D_0600B000, 0x40U, (u16) 0x00000040); func_80085BB4(arg0); } #else @@ -10936,40 +10880,26 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80086110.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80085CA0(s32, s32); // extern -void func_80085E38(s32, s32); // extern -void func_80085F74(s32, s32); // extern -void func_80086110(s32, s32, s32); // extern +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +? func_80085CA0(s32, s32); /* extern */ +? func_80085E38(s32, s32); /* extern */ +? func_80085F74(s32, s32); /* extern */ +? func_80086110(s32, s32, s32); /* extern */ void func_80086158(s32 arg0, s32 arg1) { - s32 temp_a2; - s32 phi_a2; - - temp_a2 = arg1; - phi_a2 = temp_a2; - if (arg1 != 0) { - if (arg1 != 1) { - if (arg1 != 2) { - - } else { - arg1 = temp_a2; - func_80085F74(arg0, temp_a2); - goto block_7; - } - } else { - arg1 = temp_a2; - func_80085E38(arg0, temp_a2); - goto block_7; - } - } else { - arg1 = temp_a2; - func_80085CA0(arg0, temp_a2); -block_7: - phi_a2 = arg1; + switch (arg1) { /* irregular */ + case 0: + func_80085CA0(arg0, arg1); + break; + case 1: + func_80085E38(arg0, arg1); + break; + case 2: + func_80085F74(arg0, arg1); + break; } - if (phi_a2 >= 3) { - func_80086110(arg0, phi_a2 - 3, phi_a2); + if (arg1 >= 3) { + func_80086110(arg0, arg1 - 3, arg1); } } #else diff --git a/src/code_80071F00.h b/src/code_80071F00.h index 63ed36530..394629583 100644 --- a/src/code_80071F00.h +++ b/src/code_80071F00.h @@ -5,9 +5,9 @@ #include "camera.h" s32 find_unused_obj_index(s32*); -void func_80071F6C(s32); +void func_80071F6C(s32*); s32 func_80072044(s32*, s32*, s32); -void func_80072100(s32); +void func_80072100(s32*); void func_800721C0(s32, s32); void func_800721E8(s32, s32); void func_80072214(s32, s32); @@ -126,11 +126,16 @@ void func_80076E14(s32); void func_80076ED8(s32); void func_800773D8(s32, s32); void func_80077428(s32); +void func_80077450(s32); +void func_80077584(s32); void func_80077640(); +void func_80077700(s32, Vec3f, s32); void func_80077AB0(Vec3f, s32); void func_80077B14(s32); void func_80077B3C(s32); void func_80077BCC(s32); +void func_80077E20(s32); +void func_80078220(s32); void func_80078C68(); void func_80078C70(s32); void func_80078F64(); @@ -167,6 +172,7 @@ void func_800806BC(s32); void func_8008078C(s32); void func_8008085C(s32); void func_80080A14(s32, Player*); +void func_80080A4C(s32, s32); void func_80081208(); void func_80081210(); void func_80081790(s32); diff --git a/src/code_80091750.c b/src/code_80091750.c index 15de55d73..797bbb4a4 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -1308,7 +1308,7 @@ void func_800940EC(s32 arg0) { } #ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c f32 D_800E8530 = 0.0f; f32 D_800E8534 = 3.0f; @@ -6469,20 +6469,25 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009E2A8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 draw_box(s32, s32, s32, s32, u32, s32, s32, s32, s32); // extern -extern ? D_800E7AC8; -extern ? D_800F0B28; +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +struct _struct_D_800E7AC8_0x8 { + /* 0x0 */ u16 unk0; /* inferred */ + /* 0x2 */ u16 unk2; /* inferred */ + /* 0x4 */ u16 unk4; /* inferred */ + /* 0x6 */ u16 unk6; /* inferred */ +}; /* size = 0x8 */ + extern ? D_8018E7E8; extern ? D_8018E810; extern s8 D_8018E838; -extern s32 D_8018E840; -extern s32 gDisplayListHead; +extern ? D_8018E840; +static struct _struct_D_800E7AC8_0x8 D_800E7AC8[0]; /* unable to generate initializer */ +static ? D_800F0B28; /* unable to generate initializer; const */ void func_8009E2F0(s32 arg0) { s32 sp38; - f32 temp_f4; - f64 temp_f6; + f32 var_f4; + f64 var_f6; s16 temp_t2; s16 temp_t2_2; s16 temp_t4; @@ -6493,6 +6498,7 @@ void func_8009E2F0(s32 arg0) { s32 temp_t8; s32 temp_v1; s8 temp_t7; + struct _struct_D_800E7AC8_0x8 *temp_v0; u16 temp_t6_3; u32 *temp_s0; u32 temp_ra; @@ -6501,49 +6507,44 @@ void func_8009E2F0(s32 arg0) { void *temp_t0_2; void *temp_t1; void *temp_t1_2; - void *temp_v0; - f32 phi_f4; - f64 phi_f6; temp_s0 = (arg0 * 4) + &D_8018E840; temp_ra = *temp_s0; temp_t7 = *(&D_800F0B28 + temp_ra); - sp38 = temp_t7; + sp38 = (s32) temp_t7; if (temp_t7 != 0) { - if (temp_ra < 0x1B) { + if (temp_ra < 0x1BU) { temp_v1 = arg0 * 8; temp_t1 = temp_v1 + &D_8018E810; temp_t0 = temp_v1 + &D_8018E7E8; temp_t4 = temp_t0->unk2; temp_t2 = temp_t0->unk0; - temp_t6 = temp_t1->unk0 / 2; - temp_t8 = temp_t1->unk2 / 2; - temp_v0 = (temp_t7 * 8) + &D_800E7AC8; - gDisplayListHead = draw_box(gDisplayListHead, temp_t2 - temp_t6, temp_t4 - temp_t8, temp_t2 + temp_t6, temp_t4 + temp_t8, temp_v0->unk0, temp_v0->unk2, temp_v0->unk4, temp_v0->unk6); + temp_t6 = (s16) temp_t1->unk0 / 2; + temp_t8 = (s16) temp_t1->unk2 / 2; + temp_v0 = &D_800E7AC8[temp_t7]; + gDisplayListHead = draw_box(gDisplayListHead, temp_t2 - temp_t6, temp_t4 - temp_t8, temp_t2 + temp_t6, temp_t4 + temp_t8, (s32) temp_v0->unk0, (s32) temp_v0->unk2, (s32) temp_v0->unk4, (s32) temp_v0->unk6); } else { temp_t7_2 = 0x26 - temp_ra; - temp_f6 = temp_t7_2; - phi_f6 = temp_f6; + var_f6 = (f64) temp_t7_2; if (temp_t7_2 < 0) { - phi_f6 = temp_f6 + 4294967296.0; + var_f6 += 4294967296.0; } temp_t6_2 = arg0 * 8; temp_t1_2 = temp_t6_2 + &D_8018E810; temp_t0_2 = temp_t6_2 + &D_8018E7E8; temp_t2_2 = temp_t0_2->unk0; - temp_t7_3 = temp_t1_2->unk0 / 2; - temp_t6_3 = ((sp38 * 8) + &D_800E7AC8)->unk6; - temp_f4 = temp_t6_3; - phi_f4 = temp_f4; - if (temp_t6_3 < 0) { - phi_f4 = temp_f4 + 4294967296.0f; + temp_t7_3 = (s16) temp_t1_2->unk0 / 2; + temp_t6_3 = D_800E7AC8[sp38].unk6; + var_f4 = (f32) temp_t6_3; + if ((s32) temp_t6_3 < 0) { + var_f4 += 4294967296.0f; } - gDisplayListHead = draw_box(gDisplayListHead, temp_t2_2 - temp_t7_3, temp_t0_2->unk2 - (temp_t1_2->unk2 / 2), temp_t2_2 + temp_t7_3, phi_f4 * (phi_f6 / 11.0)); + gDisplayListHead = draw_box(gDisplayListHead, temp_t2_2 - temp_t7_3, temp_t0_2->unk2 - ((s16) temp_t1_2->unk2 / 2), temp_t2_2 + temp_t7_3, M2C_ERROR(Unable to find stack arg 0x10 in block), M2C_ERROR(Unable to find stack arg 0x14 in block), M2C_ERROR(Unable to find stack arg 0x18 in block), M2C_ERROR(Unable to find stack arg 0x1c in block), (s32) (u32) (var_f4 * (f32) (var_f6 / 11.0))); } } temp_t7_4 = *temp_s0 + 1; *temp_s0 = temp_t7_4; - if (temp_t7_4 >= 0x26) { + if (temp_t7_4 >= 0x26U) { D_8018E838 = 0; D_8018E838 = 0; D_8018E838 = 0; @@ -8392,33 +8393,36 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A0FA4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 0ca3d5f5fa5e3d957908269ac1535e7d4f12bce9 -extern s8 *D_800E7940[0x13]; +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +static ? D_800E7940; /* unable to generate initializer */ void func_800A10CC(struct_8018D9E0_entry *arg0) { - s32 temp_s1; s32 temp_s3; s32 temp_v0; - s32 phi_s0; - s8 **phi_s2; - s32 phi_s1; + s32 var_s0; + s32 var_s1; + s8 **var_s2; temp_v0 = arg0->unk4; - if ((temp_v0 == 2) || (temp_v0 == 3) || (temp_v0 == 4) || (temp_v0 == 5)) { - gDisplayListHead = func_80098C18(gDisplayListHead, 0x1E, 0x32, 0x122, 0x6E, 0, 0, 0, 0xFF); - temp_s3 = arg0->unk4 - 2; - set_text_color(3); - phi_s0 = 0x41; - phi_s2 = (temp_s3 * 0x10) + D_800E7940; - phi_s1 = 0; - do { - func_80093324(0x23, phi_s0, *phi_s2, 0, 0.65f, 0.65f); - temp_s1 = phi_s1 + 4; - phi_s0 += 0xD; - phi_s2 += 4; - phi_s1 = temp_s1; - } while (temp_s1 != 0x10); + if ((temp_v0 != 2) && (temp_v0 != 3) && (temp_v0 != 4)) { + if (temp_v0 == 5) { + goto block_6; + } + return; } +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_s0 = 0x00000041; + var_s1 = 0; + do { + func_80093324(0x00000023, var_s0, *var_s2, 0, 0.65f, 0.65f); + var_s1 += 4; + var_s0 += 0xD; + var_s2 += 4; + } while (var_s1 != 0x10); } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A10CC.s") @@ -8745,16 +8749,17 @@ void func_800A1DE0(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A1DE0.s") #endif -#ifdef NON_MATCHING -// Equivalent functionality, but the arguments to func_80093324 are -// handled in a slightly different order +#ifdef NEEDS_RODATA +// data_0DD0A0_2_0.s +extern char *D_800E7860[2];// = { "UNABLE TO ERASE ", "GHOST DATA" }; + void func_800A1F30(struct_8018D9E0_entry *unused) { s32 row; - char **text; + s32 text; set_text_color(TEXT_RED); - for(row = 0x49, text = D_800E7860; row < 0x69; row += 0x10, text++){ - func_80093324(0x2A, row, *text, 0, 0.75f, 0.75f); + for(row = 0x49, text = 0; row < 0x69; row += 0x10, text++){ + func_80093324(0x2A, row, D_800E7860[text], 0, 0.75f, 0.75f); } } #else @@ -9255,56 +9260,37 @@ loop_80: GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A1FB0.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -extern s8 D_8018EE08; - void func_800A2D1C(struct_8018D9E0_entry *arg0) { - Gfx *temp_v0_2; - Gfx *temp_v0_3; - Gfx *temp_v0_4; - s32 temp_t0; - s32 temp_t8; - s32 temp_v0; - - temp_v0 = D_80164A28; - switch (temp_v0) { /* irregular */ + switch (D_80164A28) { case 1: - temp_v0_2 = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, 0x28); - gDisplayListHead = temp_v0_2; - gDisplayListHead = func_80098FC8(temp_v0_2, 0, 0xC7, 0x13F, 0xEF); + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, 0x28); + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xC7, 0x13F, 0xEF); arg0->unk1C = 0x28; - return; + break; case 2: - temp_t0 = arg0->unk1C - 2; - arg0->unk1C = temp_t0; - if (temp_t0 > 0) { - temp_v0_3 = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, temp_t0); - gDisplayListHead = temp_v0_3; - gDisplayListHead = func_80098FC8(temp_v0_3, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF); - return; + arg0->unk1C -= 2; + if (arg0->unk1C > 0) { + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, arg0->unk1C); + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF); + } else { + arg0->type = 0; } -block_13: - arg0->type = 0; - return; + break; default: if ((gModeSelection != GRAND_PRIX) || (gPlayerCountSelection1 != 1) || (D_8018EE08 != 0)) { - goto block_13; + arg0->type = 0; + } else { + arg0->unk1C -= 2; + if (arg0->unk1C > 0) { + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, arg0->unk1C); + gDisplayListHead = func_80098FC8(gDisplayListHead, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF); + } else { + arg0->type = 0; + } } - temp_t8 = arg0->unk1C - 2; - arg0->unk1C = temp_t8; - if (temp_t8 > 0) { - temp_v0_4 = func_80098FC8(gDisplayListHead, 0, 0, 0x13F, temp_t8); - gDisplayListHead = temp_v0_4; - gDisplayListHead = func_80098FC8(temp_v0_4, 0, 0xEF - arg0->unk1C, 0x13F, 0xEF); - return; - } - goto block_13; + break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A2D1C.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda @@ -10201,23 +10187,26 @@ block_21: GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A474C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f32 D_800F1DCC;// = 0.85f; +extern f32 D_800F1DD0;// = 0.85f; +// data_0DD0A0_2_0.s +extern char D_800E7780[];// = "NOW-MEET THE COURSE GHOST!!!"; + void func_800A4A24(struct_8018D9E0_entry *arg0) { - s32 sp38; - s32 sp34; + s32 stackPadding0; s32 temp_t0; s32 temp_t1; s32 temp_t2; + f32 someMultiplier = 0.85f; + s32 thing = 24.0f * someMultiplier; - temp_t1 = arg0->row; temp_t0 = 0x140 - arg0->column; - sp38 = temp_t0; - arg0 = arg0; - sp34 = temp_t1; - temp_t2 = (s32) ((f32) (get_string_width("NOW-MEET THE COURSE GHOST!!!") + 8) * 0.85f) / 2; - gDisplayListHead = draw_box(gDisplayListHead, temp_t0 - temp_t2, (temp_t1 - (s32) (24.0f * 0.85f)) + 4, temp_t2 + temp_t0, temp_t1 + 4, 0, 0, 0, 0x64); - set_text_color(4); + temp_t1 = arg0->row; + temp_t2 = (s32) ((get_string_width("NOW-MEET THE COURSE GHOST!!!") + 8) * someMultiplier) / 2; + gDisplayListHead = draw_box(gDisplayListHead, temp_t0 - temp_t2, (temp_t1 - thing) + 4, temp_t2 + temp_t0, temp_t1 + 4, 0, 0, 0, 0x00000064); + set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_1); draw_text(arg0->column - 3, arg0->row, "NOW-MEET THE COURSE GHOST!!!", 0, 0.85f, 0.85f); } #else @@ -11380,41 +11369,35 @@ void func_800A6E94(s32 arg0, s32 arg1, s32 arg2) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A6E94.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -static s8 *D_800E7A34[2] = { "RACE DATA CANNOT ", "BE SAVED FOR GHOST" }; +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f32 D_800F1F2C;// = 0x45f; +// data_0DD0A0_2_0.s +extern char *D_800E7A34[2];// = { "RACE DATA CANNOT ", "BE SAVED FOR GHOST" }; void func_800A70E8(struct_8018D9E0_entry *arg0) { - Gfx *temp_v0; - s32 temp_f6; - s32 var_a1; s32 var_s0; - s32 var_s0_2; - s8 **var_s1; + s32 temp_f6; + s32 alpha; + s32 loopIndex; + s32 stringIndex; if (arg0->unk4 == 1) { - var_s0 = (s32) ((f32) get_string_width(D_800E7A34->unk0) * 0.45f); - temp_f6 = (s32) ((f32) get_string_width(D_800E7A34->unk4) * 0.45f); + var_s0 = get_string_width(D_800E7A34[0]) * 0.45f; + temp_f6 = get_string_width(D_800E7A34[1]) * 0.45f; if (var_s0 < temp_f6) { var_s0 = temp_f6; } gDisplayListHead = draw_box(gDisplayListHead, 0x000000C0, 0x00000022, var_s0 + 0xC6, 0x00000039, 0, 0, 0, 0x00000096); - var_a1 = 0x180 - (((s32) arg0->unk1C % 32) * 8); - if (var_a1 >= 0x100) { - var_a1 = 0xFF; + alpha = 0x180 - ((arg0->unk1C % 32) * 8); + if (alpha >= 0x100) { + alpha = 0xFF; + } + gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, alpha); + set_text_color(TEXT_RED); + for (loopIndex = 0x2C, stringIndex = 0; loopIndex < 0x40; loopIndex += 0xA, stringIndex++) { + func_80093358(0x000000C0, loopIndex, D_800E7A34[stringIndex], 0, 0.45f, 0.45f); } - temp_v0 = gDisplayListHead; - gDisplayListHead = temp_v0 + 8; - temp_v0->words.w1 = var_a1 & 0xFF; - temp_v0->words.w0 = 0xFA000000; - set_text_color(2); - var_s1 = D_800E7A34; - var_s0_2 = 0x0000002C; - do { - func_80093358(0x000000C0, var_s0_2, *var_s1, 0, 0.45f, 0.45f); - var_s0_2 += 0xA; - var_s1 += 4; - } while (var_s0_2 != 0x00000040); } } #else @@ -12202,63 +12185,59 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A8270.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c extern s8 D_8018EDEE; extern s8 gMainMenuSelectionDepth; void func_800A8564(struct_8018D9E0_entry *arg0) { s32 sp34; s32 sp30; + Gfx *var_v0; MkTexture *temp_v0_4; + MkTexture *var_a0; s32 temp_a2; s32 temp_t0; s32 temp_v0; s32 temp_v0_3; + s32 var_a1; s8 temp_v0_2; s8 temp_v0_5; - s32 phi_a1; - MkTexture *phi_a0; - Gfx *phi_v0; temp_v0 = arg0->type; - phi_a1 = 0; + var_a1 = 0; switch (temp_v0) { /* irregular */ case 0xF: temp_v0_2 = gMainMenuSelectionDepth; - phi_a0 = D_0200487C; - phi_a0 = D_0200487C; - if ((temp_v0_2 == CONFIRM_OK_SELECTION) || (temp_v0_2 == CONFIRM_OK_SELECTION_FROM_BACK_OUT)) { + var_a0 = D_0200487C; + if ((temp_v0_2 == 6) || (temp_v0_2 == 7)) { block_11: - phi_a1 = 1; + var_a1 = 1; } block_12: temp_v0_3 = arg0->unk1C; if (temp_v0_3 < 0x20) { sp34 = (s32) (temp_v0_3 << 5) / 64; - sp30 = phi_a1; - arg0 = arg0; - temp_v0_4 = segmented_to_virtual_dupe(phi_a0); + sp30 = var_a1; + temp_v0_4 = segmented_to_virtual_dupe(var_a0); temp_t0 = arg0->column + temp_v0_4->dX; temp_a2 = arg0->row + temp_v0_4->dY; - if (phi_a1 != 0) { - phi_v0 = func_800959A0(gDisplayListHead, temp_t0 + sp34, temp_a2, (temp_t0 - sp34) + 0x1E, temp_a2 + 0x12); + if (var_a1 != 0) { + var_v0 = func_800959A0(gDisplayListHead, temp_t0 + sp34, temp_a2, (temp_t0 - sp34) + 0x1E, temp_a2 + 0x12); } else { - phi_v0 = func_80098C18(gDisplayListHead, temp_t0 + sp34, temp_a2, (temp_t0 - sp34) + 0x1E, temp_a2 + 0x12, 1, 1, 1, 0xFF); + var_v0 = func_80098C18(gDisplayListHead, temp_t0 + sp34, temp_a2, (temp_t0 - sp34) + 0x1E, temp_a2 + 0x12, 1, 1, 1, 0x000000FF); } - gDisplayListHead = phi_v0; + gDisplayListHead = var_v0; } return; case 0x33: temp_v0_5 = D_8018EDEE; - phi_a0 = D_02004B74; - phi_a0 = D_02004B74; + var_a0 = D_02004B74; if ((temp_v0_5 == 2) || (temp_v0_5 == 3)) { goto block_11; } goto block_12; case 0x5D: - phi_a0 = D_02004E80; - phi_a0 = D_02004E80; + var_a0 = D_02004E80; if (D_8018EDEC == 3) { goto block_11; } @@ -12916,7 +12895,7 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A97BC.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c extern s8 D_8018EDEE; extern s8 gMainMenuSelectionDepth; static ? D_800F0CA7; /* unable to generate initializer; const */ @@ -12928,29 +12907,29 @@ void func_800A9A98(struct_8018D9E0_entry *arg0) { s32 temp_v0; s32 temp_v0_2; s32 temp_v0_3; - s32 phi_v0; + s32 var_v0; temp_v0 = arg0->type; switch (temp_v0) { /* irregular */ default: - phi_v0 = sp4; + var_v0 = sp4; break; case 0xF: - phi_v0 = (s32) *("\"\0\x03\x03\x03\x02\0\x02\x02" /* not null-terminated */ + 3 + gMainMenuSelectionDepth); + var_v0 = (s32) *("\"\0\x03\x03\x03\x02\0\x02\x02" /* not null-terminated */ + 3 + gMainMenuSelectionDepth); break; case 0x5D: - phi_v0 = (s32) *(&D_800F0CAB + D_8018EDEC); + var_v0 = (s32) *(&D_800F0CAB + D_8018EDEC); break; case 0x33: - phi_v0 = (s32) *(&D_800F0CA7 + D_8018EDEE); + var_v0 = (s32) *(&D_800F0CA7 + D_8018EDEE); break; } - switch (phi_v0) { /* switch 1; irregular */ + switch (var_v0) { /* switch 1; irregular */ case 0: /* switch 1 */ arg0->unk1C = 0; return; case 1: /* switch 1 */ - arg0->unk1C = 0x20; + arg0->unk1C = 0x00000020; return; case 2: /* switch 1 */ temp_v0_2 = arg0->unk1C; @@ -12969,7 +12948,7 @@ void func_800A9A98(struct_8018D9E0_entry *arg0) { if (temp_v0_3 < 0x20) { arg0->unk1C = temp_t4; if (temp_t4 >= 0x20) { - arg0->unk1C = 0x20; + arg0->unk1C = 0x00000020; } } break; @@ -13433,13 +13412,9 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AA2EC.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 054f217e0ef630f2a2a76ec70a84ce37369571c0 -s32 func_800AAFCC(s32); /* extern */ -s32 random_int(?, s32); /* extern */ +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c extern ? D_8018DEE4; -extern s8 D_8018EDE8; - -// head selection +extern ? D_8018EDE8; static MkAnimation *D_800E8360[8] = { D_02006708, D_020068F0, @@ -13449,20 +13424,7 @@ static MkAnimation *D_800E8360[8] = { D_02007280, D_02007468, D_02006AD8, -}; /* const */ - -static MkAnimation *gCharacterCelebrateAnimation[8] = { - D_02006718, - D_02006900, - D_02006CD0, - D_02006EB8, - D_020070A0, - D_02007290, - D_02007478, - D_02006AE8, -}; /* const */ - -// celebrate end +}; static MkAnimation *D_800E83A0[8] = { D_02006778, D_02006960, @@ -13472,8 +13434,39 @@ static MkAnimation *D_800E83A0[8] = { D_020072F0, D_020074D8, D_02006B48, -}; /* const */ - +}; +static s32 D_800E8440[8] = { + 0x0000000A, + 0x0000000A, + 0x0000000A, + 0x0000000A, + 0x0000000A, + 0x0000000A, + 0x0000000A, + 0x0000000A, +}; +static s32 D_800E8460[8] = { 9, 9, 9, 9, 0x0000000A, 9, 9, 9 }; +static s32 D_800E8480[8] = { 9, 9, 9, 9, 9, 9, 9, 9 }; +static s32 D_800E84A0[8] = { + 0x00000013, + 0x00000013, + 0x00000013, + 0x00000013, + 0x00000013, + 0x00000013, + 0x00000013, + 0x00000013, +}; +static MkAnimation *gCharacterCelebrateAnimation[8] = { + D_02006718, + D_02006900, + D_02006CD0, + D_02006EB8, + D_020070A0, + D_02007290, + D_02007478, + D_02006AE8, +}; static MkAnimation *gCharacterDeselectAnimation[8] = { D_02006788, D_02006970, @@ -13483,19 +13476,7 @@ static MkAnimation *gCharacterDeselectAnimation[8] = { D_02007300, D_020074E8, D_02006B58, -}; /* const */ - -static MkAnimation *gCharacterSingleBlinkAnimation[8] = { - D_020067E0, - D_020069C8, - D_02006D98, - D_02006F80, - D_02007170, - D_02007358, - D_02007540, - D_02006CB0, -}; /* const */ - +}; static MkAnimation *gCharacterDoubleBlinkAnimation[8] = { D_02006838, D_02006A20, @@ -13505,9 +13486,8 @@ static MkAnimation *gCharacterDoubleBlinkAnimation[8] = { D_020073B0, D_02007598, D_02006C08, -}; /* const */ - -static MkAnimation *D_800E8420[8] = { +}; +static MkAnimation *gCharacterSingleBlinkAnimation[8] = { D_020067E0, D_020069C8, D_02006D98, @@ -13515,12 +13495,8 @@ static MkAnimation *D_800E8420[8] = { D_02007170, D_02007358, D_02007540, - D_02006CB0, -}; /* const */ -static s32 D_800E8440[8] = { 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA }; /* const */ -static s32 D_800E8460[8] = { 9, 9, 9, 9, 0xA, 9, 9, 9 }; /* const */ -static s32 D_800E8480[8] = { 9, 9, 9, 9, 9, 9, 9, 9 }; /* const */ -static s32 D_800E84A0[8] = { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13 }; /* const */ + D_02006BB0, +}; void func_800AA69C(struct_8018D9E0_entry *arg0) { s32 sp30; @@ -13530,98 +13506,96 @@ void func_800AA69C(struct_8018D9E0_entry *arg0) { s32 temp_a0; s32 temp_a0_2; s32 temp_a0_3; - s32 temp_a1; s32 temp_v0; s32 temp_v0_2; s32 temp_v1; - s32 phi_a0; - s32 phi_v0; - s32 phi_v1; + s32 var_a0; + s32 var_v0; + s32 var_v1; temp_a0 = arg0->type - 0x2B; sp30 = temp_a0; temp_v0 = func_800AAFCC(temp_a0); - temp_a1 = sp30; if (temp_v0 >= 0) { - phi_a0 = 1; + var_a0 = 1; } else { - phi_a0 = 0; + var_a0 = 0; } temp_v1 = arg0->unk8; switch (temp_v1) { case 0: - if ((*(&D_8018EDE8 + temp_v0) != 0) && (phi_a0 != 0)) { + if ((*(&D_8018EDE8 + temp_v0) != 0) && (var_a0 != 0)) { arg0->unk8 = 1; - func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_a1])); + func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[sp30])); return; } - sp30 = temp_a1; - temp_v0_2 = random_int(0xC8, temp_a1); + sp30 = sp30; + temp_v0_2 = random_int(0x00C8U); if (temp_v0_2 >= 0xC6) { arg0->unk8 = 4; - func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterSingleBlinkAnimation[temp_a1])); + func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterSingleBlinkAnimation[sp30])); return; } if (temp_v0_2 >= 0xC5) { arg0->unk8 = 5; - func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterDoubleBlinkAnimation[temp_a1])); + func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterDoubleBlinkAnimation[sp30])); return; } default: return; case 1: - if (*(&D_8018DEE4 + (arg0->D_8018DEE0_index * 0x18)) >= D_800E8440[temp_a1]) { + if (*(&D_8018DEE4 + (arg0->D_8018DEE0_index * 0x18)) >= D_800E8440[sp30]) { arg0->unk8 = 2; - func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E83A0[temp_a1])); + func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E83A0[sp30])); return; } - if ((*(&D_8018EDE8 + temp_v0) == 0) && (phi_a0 != 0)) { + if ((*(&D_8018EDE8 + temp_v0) == 0) && (var_a0 != 0)) { arg0->unk8 = 3; - sp24 = temp_a1 * 4; + sp24 = sp30 * 4; temp_a0_2 = arg0->D_8018DEE0_index; - func_8009A594(temp_a0_2, D_800E8460[temp_a1] - *(&D_8018DEE4 + (temp_a0_2 * 0x18)), segmented_to_virtual_dupe_2(gCharacterDeselectAnimation[temp_a1])); + func_8009A594(temp_a0_2, D_800E8460[sp30] - *(&D_8018DEE4 + (temp_a0_2 * 0x18)), segmented_to_virtual_dupe_2(gCharacterDeselectAnimation[sp30])); return; } break; case 2: - if ((*(&D_8018EDE8 + temp_v0) == 0) && (phi_a0 != 0)) { + if ((*(&D_8018EDE8 + temp_v0) == 0) && (var_a0 != 0)) { arg0->unk8 = 3; - func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterDeselectAnimation[temp_a1])); + func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterDeselectAnimation[sp30])); return; } break; case 3: - temp_a3 = &D_800E8460[temp_a1]; + temp_a3 = &D_800E8460[sp30]; if (*(&D_8018DEE4 + (arg0->D_8018DEE0_index * 0x18)) >= *temp_a3) { arg0->unk8 = 0; - func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E8360[temp_a1])); + func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E8360[sp30])); return; } - if ((*(&D_8018EDE8 + temp_v0) != 0) && (phi_a0 != 0)) { + if ((*(&D_8018EDE8 + temp_v0) != 0) && (var_a0 != 0)) { arg0->unk8 = 1; sp20 = temp_a3; temp_a0_3 = arg0->D_8018DEE0_index; - func_8009A594(temp_a0_3, *temp_a3 - *(&D_8018DEE4 + (temp_a0_3 * 0x18)), segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_a1])); + func_8009A594(temp_a0_3, *temp_a3 - *(&D_8018DEE4 + (temp_a0_3 * 0x18)), segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[sp30])); return; } break; case 4: case 5: - if ((*(&D_8018EDE8 + temp_v0) != 0) && (phi_a0 != 0)) { + if ((*(&D_8018EDE8 + temp_v0) != 0) && (var_a0 != 0)) { arg0->unk8 = 1; - func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_a1])); + func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[sp30])); return; } if (temp_v1 == 4) { - phi_v0 = D_800E8480[temp_a1]; - phi_v1 = temp_a1 * 4; + var_v1 = sp30 * 4; + var_v0 = D_800E8480[sp30]; } else { - phi_v0 = D_800E84A0[temp_a1]; - phi_v1 = temp_a1 * 4; + var_v1 = sp30 * 4; + var_v0 = D_800E84A0[sp30]; } - if (*(&D_8018DEE4 + (arg0->D_8018DEE0_index * 0x18)) >= phi_v0) { + if (*(&D_8018DEE4 + (arg0->D_8018DEE0_index * 0x18)) >= var_v0) { arg0->unk8 = 0; - func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(*(D_800E8360 + phi_v1))); + func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(*(D_800E8360 + var_v1))); } break; } @@ -13630,57 +13604,44 @@ void func_800AA69C(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AA69C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 054f217e0ef630f2a2a76ec70a84ce37369571c0 -s32 func_800AAFCC(s32, struct_8018D9E0_entry *); /* extern */ -extern s8 D_8018EDEE; +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +// jpt_800F25B8 void func_800AAA9C(struct_8018D9E0_entry *arg0) { - s32 temp_a0; - s32 temp_t2; - s32 temp_t6; - s32 temp_v0; - struct_8018D9E0_entry *temp_a1; - - temp_t6 = arg0->unk4; - temp_a1 = arg0; - switch (temp_t6) { + switch (arg0->unk4) { case 3: - temp_a1->unk4 = 1; + arg0->unk4 = 1; /* fallthrough */ case 1: if (D_8018EDEE == 3) { - temp_a1->unk1C = 0x20; + arg0->unk1C = 0x00000020; } else { - temp_v0 = temp_a1->unk1C; - if (temp_v0 < 0x20) { - temp_t2 = temp_v0 + (temp_v0 / 12) + 2; - temp_a1->unk1C = temp_t2; - if (temp_t2 >= 0x20) { - temp_a1->unk1C = 0x20; + if (arg0->unk1C < 0x20) { + arg0->unk1C += (arg0->unk1C / 12) + 2; + if (arg0->unk1C >= 0x20) { + arg0->unk1C = 0x00000020; } } } /* fallthrough */ case 0: - temp_a0 = temp_a1->type; - arg0 = temp_a1; - if (func_800AAFCC(temp_a0 - 0x2B, temp_a1) >= 0) { + if (func_800AAFCC(arg0->type - 0x2B) >= 0) { arg0->unk4 = 2; -block_13: arg0->unk1C = 0; - default: - return; + } else { + arg0->unk4 = 1; } - arg0->unk4 = 1; - return; + break; case 4: - arg0 = temp_a1; - if (func_800AAFCC(temp_a1->type - 0x2B, temp_a1) >= 0) { + if (func_800AAFCC(arg0->type - 0x2B) >= 0) { arg0->unk4 = 2; - goto block_13; + arg0->unk1C = 0; } break; + case 2: + default: + break; } } #else @@ -13722,19 +13683,16 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AAB90.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 054f217e0ef630f2a2a76ec70a84ce37369571c0 +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c struct _struct_D_800E7108_0x8 { /* 0x0 */ s16 unk0; /* inferred */ /* 0x2 */ s16 unk2; /* inferred */ /* 0x4 */ char pad4[4]; /* maybe part of unk2[3]? */ }; /* size = 0x8 */ -void func_800A91D8(struct_8018D9E0_entry *, s16, s16, struct_8018D9E0_entry *); /* extern */ -s32 func_800AAFCC(s32, s32, s32, struct_8018D9E0_entry *); /* extern */ extern s8 D_8018EDEE; -extern s32 gScreenModeSelection; -static struct _struct_D_800E7108_0x8 D_800E7108[0]; /* unable to generate initializer; const */ -static ? D_800E7188; /* unable to generate initializer; const */ +static struct _struct_D_800E7108_0x8 D_800E7108[0]; /* unable to generate initializer */ +static ? D_800E7188; /* unable to generate initializer */ static MkAnimation *D_800E8340[8] = { D_02006778, D_02006960, @@ -13744,43 +13702,33 @@ static MkAnimation *D_800E8340[8] = { D_020072F0, D_020074D8, D_02006B48, -}; /* const */ +}; void func_800AAC18(struct_8018D9E0_entry *arg0) { s32 sp24; struct _struct_D_800E7108_0x8 *sp18; - s32 temp_a0; s32 temp_a1; s32 temp_v0; s32 temp_v0_3; - s32 temp_v1; + s32 var_v1; struct _struct_D_800E7108_0x8 *temp_v0_2; struct _struct_D_800E7108_0x8 *temp_v0_4; - struct_8018D9E0_entry *temp_a3; + struct _struct_D_800E7108_0x8 *var_t0; void *temp_t0; - s32 phi_v1; - struct_8018D9E0_entry *phi_a3; - struct _struct_D_800E7108_0x8 *phi_t0; - temp_v1 = arg0->unk4; - temp_a3 = arg0; + var_v1 = arg0->unk4; temp_a1 = arg0->type - 0x2B; - phi_v1 = temp_v1; - phi_a3 = temp_a3; - switch (temp_v1) { + switch (var_v1) { case 0: - temp_a0 = temp_a1; if (D_8018EDEE == 3) { sp24 = temp_a1; - arg0 = temp_a3; - temp_v0 = func_800AAFCC(temp_a0, temp_a1); + temp_v0 = func_800AAFCC(temp_a1); if (temp_v0 >= 0) { temp_t0 = (gScreenModeSelection << 5) + (temp_v0 * 8) + &D_800E7188; arg0->column = (s32) temp_t0->unk0; arg0->unk4 = 2; arg0->unk8 = 2; arg0->row = (s32) temp_t0->unk2; - arg0 = arg0; func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(D_800E8340[temp_a1])); return; } @@ -13790,31 +13738,29 @@ void func_800AAC18(struct_8018D9E0_entry *arg0) { case 1: case 3: temp_v0_2 = &D_800E7108[temp_a1]; - temp_a3->column = (s32) temp_v0_2->unk0; - temp_a3->row = (s32) temp_v0_2->unk2; + arg0->column = (s32) temp_v0_2->unk0; + arg0->row = (s32) temp_v0_2->unk2; return; case 2: case 4: - if (temp_v1 == 2) { - arg0 = temp_a3; - temp_v0_3 = func_800AAFCC(temp_a1, temp_a1, 2, temp_a3); - phi_a3 = arg0; + if (var_v1 == 2) { + temp_v0_3 = func_800AAFCC(temp_a1); if (temp_v0_3 >= 0) { sp18 = (gScreenModeSelection << 5) + (temp_v0_3 * 8) + &D_800E7188; } - phi_v1 = arg0->unk4; - phi_t0 = sp18; + var_t0 = sp18; + var_v1 = arg0->unk4; goto block_13; } temp_v0_4 = &D_800E7108[temp_a1]; - phi_t0 = temp_v0_4; - if ((temp_a3->column == temp_v0_4->unk0) && (temp_a3->row == temp_v0_4->unk2)) { - temp_a3->unk4 = 0; + var_t0 = temp_v0_4; + if ((arg0->column == temp_v0_4->unk0) && (arg0->row == temp_v0_4->unk2)) { + arg0->unk4 = 0; return; } block_13: - if ((phi_v1 != 2) || (phi_a3->unk8 != 1)) { - func_800A91D8(phi_a3, phi_t0->unk0, phi_t0->unk2, phi_a3); + if ((var_v1 != 2) || (arg0->unk8 != 1)) { + func_800A91D8(arg0, (s32) var_t0->unk0, (s32) var_t0->unk2); } break; } @@ -14603,41 +14549,16 @@ block_13: GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ABEAC.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 054f217e0ef630f2a2a76ec70a84ce37369571c0 -void func_800A9208(struct_8018D9E0_entry *, s32); /* extern */ -s16 gCurrentCourseId; /* unable to generate initializer */ -s8 *D_800E7524[0x14] = { - "mario raceway", - "choco mountain", - "bowser's castle", - "banshee boardwalk", - "yoshi valley", - "frappe snowland", - "koopa troopa beach", - "royal raceway", - "luigi raceway", - "moo moo farm", - "toad's turnpike", - "kalimari desert", - "sherbet land", - "rainbow road", - "wario stadium", - "block fort", - "skyscraper", - "double deck", - "d.k.'s jungle parkway", - "big donut", -}; /* const */ +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f64 D_800F2648;// = 0.05; +extern f64 D_800F2650;// = 0.0085; +extern f64 D_800F2658;// = 0.4; +// this is plain data? +extern char *D_800E7524[0x14]; void func_800ABF68(struct_8018D9E0_entry *arg0) { - f64 temp_f0; - s32 temp_t3; - s32 temp_t3_2; - s32 temp_v0; - - temp_v0 = arg0->unk4; - switch (temp_v0) { /* irregular */ + switch (arg0->unk4) { case 0: arg0->column = 0x140; arg0->unk4 = 1; @@ -14645,26 +14566,22 @@ void func_800ABF68(struct_8018D9E0_entry *arg0) { /* fallthrough */ case 1: func_800A9208(arg0, arg0->unk20); - temp_t3 = (s32) (arg0->column - arg0->unk20) / 4; - arg0->unk1C = temp_t3; - if (temp_t3 >= 9) { + arg0->unk1C = (arg0->column - arg0->unk20) / 4; + if (arg0->unk1C >= 9) { arg0->unk1C = 8; } - arg0->unk24 = (f32) (((f64) arg0->unk1C * 0.05) + 1.0); + arg0->unk24 = (arg0->unk1C * 0.05) + 1.0; if ((arg0->unk20 + 0x14) >= arg0->column) { arg0->unk4 = 2; arg0->D_8018DEE0_index = 0; - return; } - return; + break; case 2: func_800A9208(arg0, arg0->unk20); - temp_t3_2 = arg0->D_8018DEE0_index + 1; - temp_f0 = (f64) (temp_t3_2 - 0xA); - arg0->unk1C = (s32) (arg0->column - arg0->unk20) / 4; - arg0->D_8018DEE0_index = temp_t3_2; - arg0->unk24 = (f32) ((temp_f0 * 0.0085 * temp_f0) + 0.4); - if ((temp_t3_2 >= 9) && ((f64) arg0->unk24 > 1.0)) { + arg0->unk1C = (arg0->column - arg0->unk20) / 4; + arg0->D_8018DEE0_index++; + arg0->unk24 = ((arg0->D_8018DEE0_index - 0xA) * 0.0085 * (arg0->D_8018DEE0_index - 0xA)) + 0.4; + if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->unk24 > 1.0)) { arg0->unk24 = 1.0f; } break; @@ -14674,66 +14591,97 @@ void func_800ABF68(struct_8018D9E0_entry *arg0) { GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ABF68.s") #endif +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f64 D_800F2660;// = 0.07; +extern f64 D_800F2668;// = 0.6; +extern f64 D_800F2670;// = 0.004; +extern f64 D_800F2678;// = 0.8; +extern f64 D_800F2680;// = 0.002; + +void func_800AC128(struct_8018D9E0_entry *arg0) { + switch (arg0->unk4) { + case 0: + arg0->column = 0x00000140; + arg0->unk4 = 1; + /* fallthrough */ + case 1: + func_800A940C(arg0, 0x00000064); + arg0->unk1C = (s32) (arg0->column - 0x64) / 6; + if (arg0->unk1C >= 9) { + arg0->unk1C = 8; + } + arg0->unk24 = (f32) (((f64) arg0->unk1C * 0.07) + 0.6); + if (arg0->column == 0x00000064) { + arg0->unk4 = 2; + arg0->D_8018DEE0_index = 0; + } + break; + case 2: + arg0->D_8018DEE0_index++; + arg0->unk1C = 0; + arg0->unk24 = (f32) (1.5 - ((arg0->D_8018DEE0_index - 0xF) * 0.004 * (arg0->D_8018DEE0_index - 0xF))); + if ((arg0->D_8018DEE0_index >= 0x10) && ((f64) arg0->unk24 < 0.8)) { + arg0->unk4 = 3; + arg0->D_8018DEE0_index = 0; + } + break; + case 3: + arg0->D_8018DEE0_index++; + arg0->unk1C = 0; + arg0->unk24 = (f32) (1.25 - ((arg0->D_8018DEE0_index - 0xF) * 0.002 * (arg0->D_8018DEE0_index - 0xF))); + if ((arg0->D_8018DEE0_index >= 0xD) && ((f64) arg0->unk24 < 1.0)) { + arg0->unk24 = 1.0f; + } + break; + } +} +#else +GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AC128.s") +#endif + void func_800AC300(struct_8018D9E0_entry *arg0) { if (arg0->unk20 < ++arg0->unk1C) { arg0->type = 0; } } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_800A9208(struct_8018D9E0_entry *, ?); /* extern */ -extern s8 D_8018D9D8; -static s32 D_800DDB24 = 1; - void func_800AC324(struct_8018D9E0_entry *arg0) { - s32 temp_t1; - s32 temp_v0; - s32 temp_v0_2; - - temp_v0 = arg0->unk4; - switch (temp_v0) { /* irregular */ + switch (arg0->unk4) { case 0: arg0->column = 0x14A; arg0->unk4 = 1; func_800921B4(); - return; + break; case 1: func_800A9208(arg0, 0xA0); if (arg0->column == 0xA0) { arg0->unk4 = 2; arg0->unk20 = 0; - return; } - return; + break; case 2: - temp_t1 = arg0->unk20 + 1; - arg0->unk20 = temp_t1; - if (((D_8018D9D8 != 0) || (temp_t1 >= 0x5B)) && (D_800DDB24 != 0)) { + arg0->unk20++; + if (((D_8018D9D8 != 0) || (arg0->unk20 >= 0x5B)) && (D_800DDB24 != 0)) { arg0->unk4 = 3; arg0->unk1C = arg0->column; add_8018D9E0_entry(0xAB, 0, 0, 0); - return; } break; case 3: - temp_v0_2 = arg0->unk1C; - arg0->column = temp_v0_2; - if (temp_v0_2 < 0x14A) { + arg0->column = arg0->unk1C; + if (arg0->unk1C < 0x14A) { if (D_8018D9D8 != 0) { - arg0->unk1C = temp_v0_2 + 0x20; - return; + arg0->unk1C += 0x20; + } else { + arg0->unk1C += 0x10; } - arg0->unk1C = temp_v0_2 + 0x10; - return; + } else { + arg0->type = 0; } - arg0->type = 0; break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AC324.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda @@ -15374,39 +15322,29 @@ block_11: GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ACF40.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda -void func_800A9208(struct_8018D9E0_entry *, ?); /* extern */ -extern s8 D_8018D9D8; +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +// jpt_800F273C void func_800AD1A4(struct_8018D9E0_entry *arg0) { - s32 temp_t2; - s32 temp_t6; - s32 temp_v0; - - temp_t6 = arg0->unk4; - switch (temp_t6) { + switch (arg0->unk4) { case 0: - arg0->column = 0x14A; + arg0->column = 0x0000014A; arg0->unk4 = 1; func_800921B4(); - add_8018D9E0_entry(0xBB, 0, 0, 0); - return; + add_8018D9E0_entry(0x000000BB, 0, 0, 0); + break; case 1: - func_800A9208(arg0, 0xA0); - if (arg0->column == 0xA0) { + func_800A9208(arg0, 0x000000A0); + if (arg0->column == 0x000000A0) { arg0->unk4 = 2; arg0->unk20 = 0; - return; } - default: - return; + break; case 2: - temp_t2 = arg0->unk20 + 1; - arg0->unk20 = temp_t2; - if (temp_t2 >= 0x15) { + arg0->unk20++; + if (arg0->unk20 >= 0x15) { arg0->unk4 = 3; - return; } break; case 3: @@ -15414,22 +15352,22 @@ void func_800AD1A4(struct_8018D9E0_entry *arg0) { func_800921B4(); arg0->unk4 = 4; arg0->unk1C = arg0->column; - add_8018D9E0_entry(0xBA, 0, 0, 0); - return; + add_8018D9E0_entry(0x000000BA, 0, 0, 0); } break; case 4: - temp_v0 = arg0->unk1C; - arg0->column = temp_v0; - if (temp_v0 < 0x14A) { + arg0->column = arg0->unk1C; + if (arg0->unk1C < 0x14A) { if (D_8018D9D8 != 0) { - arg0->unk1C = temp_v0 + 0x20; - return; + arg0->unk1C += 0x20; + } else { + arg0->unk1C += 0x10; } - arg0->unk1C = temp_v0 + 0x10; - return; + } else { + arg0->type = 0; } - arg0->type = 0; + break; + default: break; } } @@ -16233,84 +16171,49 @@ block_107: GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AE218.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -static s8 D_800E7780[0x1D] = { - 0x4E, - 0x4F, - 0x57, - 0x2D, - 0x4D, - 0x45, - 0x45, - 0x54, - 0x20, - 0x54, - 0x48, - 0x45, - 0x20, - 0x43, - 0x4F, - 0x55, - 0x52, - 0x53, - 0x45, - 0x20, - 0x47, - 0x48, - 0x4F, - 0x53, - 0x54, - 0x21, - 0x21, - 0x21, - 0, -}; +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +// jpt_800F2A88 +// data_0DD0A0_2_0.s +extern char D_800E7780[];// = "NOW-MEET THE COURSE GHOST!!!"; void func_800AEC54(struct_8018D9E0_entry *arg0) { - s32 temp_t5; - s32 temp_t6; - s32 temp_t9; - - temp_t6 = arg0->unk4; - switch (temp_t6) { + switch (arg0->unk4) { case 0: arg0->column = (get_string_width("NOW-MEET THE COURSE GHOST!!!") / 2) + 0x140; arg0->row = 0x000000DA; arg0->unk4 = 1; func_800C90F4(0U, (D_80162DE4 * 0x10) + 0x29008001); - return; + break; case 1: func_800A9208(arg0, 0x000000A0); if (arg0->column == 0x000000A0) { arg0->unk4 = 2; arg0->unk1C = 0; - return; } - default: - return; + break; case 2: - temp_t5 = arg0->unk1C + 1; - arg0->unk1C = temp_t5; - if (temp_t5 >= 0x3D) { + arg0->unk1C++; + if (arg0->unk1C >= 0x3D) { arg0->unk4 = 3; arg0->unk1C = 0; - return; } break; case 4: - temp_t9 = arg0->unk1C + 1; - arg0->unk1C = temp_t9; - if (temp_t9 >= 6) { + arg0->unk1C++; + if (arg0->unk1C >= 6) { arg0->type = 0; - return; + break; } + // Purposeful fallthrough case 3: func_800A94C8(arg0, 0x000000A0, -1); if (((arg0->column + 0x14) == -(get_string_width("NOW-MEET THE COURSE GHOST!!!") / 2)) && (arg0->unk4 == 3)) { arg0->unk4 = 4; } break; + default: + break; } } #else @@ -16687,68 +16590,60 @@ void func_800AF480(struct_8018D9E0_entry *arg0) { } } -#ifdef MIPS_TO_C -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc +#ifdef NEEDS_RODATA +// Needs jpt_800F2AD0 +extern f64 D_800F2AE8;// 0.05; +extern f64 D_800F2AF0;// 0.0085; +extern f64 D_800F2AF8;// 0.4; void func_800AF4DC(struct_8018D9E0_entry *arg0) { - struct_802850C0_entry *sp20; - f64 temp_f0; - s32 temp_t6; - s32 temp_t6_2; - s32 temp_t9; + s32 pad; s32 temp_v0; struct_802850C0_entry *temp_v1; - temp_t9 = arg0->unk4; temp_v0 = arg0->type - 0x190; temp_v1 = &D_802850C0[temp_v0]; - arg0->row = (s32) temp_v1->row; - switch (temp_t9) { + arg0->row = temp_v1->row; + switch (arg0->unk4) { case 0: + arg0->column = temp_v1->startingColumn; arg0->unk4 = 1; - arg0->column = (s32) temp_v1->startingColumn; - sp20 = temp_v1; - arg0->unk20 = (s32) ((((f32) get_string_width(D_802854B0[temp_v0]) * temp_v1->textScaling) / 2.0f) + (f32) temp_v1->columnExtra); + arg0->unk20 = temp_v1->columnExtra + (get_string_width(D_802854B0[temp_v0]) * temp_v1->textScaling / 2); /* fallthrough */ case 1: func_800A9208(arg0, arg0->unk20); - temp_t6 = (s32) (arg0->unk20 - arg0->column) / 4; - arg0->unk1C = temp_t6; - if (temp_t6 >= 9) { + arg0->unk1C = (s32) (arg0->unk20 - arg0->column) / 4; + if (arg0->unk1C >= 9) { arg0->unk1C = 8; } - arg0->unk24 = (f32) (((f64) arg0->unk1C * 0.05) + 1.0); + arg0->unk24 = (arg0->unk1C * 0.05) + 1.0; if (arg0->column >= (arg0->unk20 - 0x14)) { arg0->unk4 = 2; arg0->D_8018DEE0_index = 0; - return; } - default: - return; + break; case 2: func_800A9208(arg0, arg0->unk20); - temp_t6_2 = arg0->D_8018DEE0_index + 1; - temp_f0 = (f64) (temp_t6_2 - 0xA); - arg0->unk1C = (s32) (arg0->unk20 - arg0->column) / 4; - arg0->D_8018DEE0_index = temp_t6_2; - arg0->unk24 = (f32) ((temp_f0 * 0.0085 * temp_f0) + 0.4); - if ((temp_t6_2 >= 9) && ((f64) arg0->unk24 > 1.0)) { - arg0->unk4 = 3; + arg0->unk1C = (arg0->unk20 - arg0->column) / 4; + arg0->D_8018DEE0_index += 1; + arg0->unk24 = ((arg0->D_8018DEE0_index - 0xA) * 0.0085 * (arg0->D_8018DEE0_index - 0xA)) + 0.4; + if ((arg0->D_8018DEE0_index >= 9) && ((f64) arg0->unk24 > 1)) { arg0->unk24 = 1.0f; - return; + arg0->unk4 = 3; } break; case 3: if ((u8) D_8018ED91 != 0) { arg0->unk4 = 4; - return; } break; case 4: func_800A94C8(arg0, arg0->unk20, 1); - if ((f64) arg0->row > 480.0) { + if (arg0->row > 480.0) { arg0->type = 0; } break; + default: + break; } } #else diff --git a/src/code_80091750.h b/src/code_80091750.h index b9958fb6b..a3695ecd6 100644 --- a/src/code_80091750.h +++ b/src/code_80091750.h @@ -155,9 +155,12 @@ void func_800A11D0(struct_8018D9E0_entry*, s32, s32); void func_800A15EC(struct_8018D9E0_entry*); void func_800A1924(struct_8018D9E0_entry*); void func_800A1A20(struct_8018D9E0_entry*); +void func_800A1F30(struct_8018D9E0_entry*); +void func_800A2D1C(struct_8018D9E0_entry*); void func_800A3C84(struct_8018D9E0_entry*); void func_800A4550(s32, s32, s32); void func_800A474C(s32, s32, s32); +void func_800A4A24(struct_8018D9E0_entry*); void func_800A4B38(struct_8018D9E0_entry*); void func_800A4BC8(struct_8018D9E0_entry*); void func_800A4EF8(struct_8018D9E0_entry*); @@ -165,6 +168,7 @@ void func_800A5084(struct_8018D9E0_entry*); void func_800A5360(struct_8018D9E0_entry*); void func_800A54EC(); void func_800A6034(struct_8018D9E0_entry*); +void func_800A70E8(struct_8018D9E0_entry*); void func_800A7258(struct_8018D9E0_entry*); void func_800A72FC(struct_8018D9E0_entry*); void func_800A7448(struct_8018D9E0_entry*); @@ -203,7 +207,12 @@ void func_800AB020(struct_8018D9E0_entry*); void func_800AB098(struct_8018D9E0_entry*); void func_800AB260(struct_8018D9E0_entry*); void func_800AB290(struct_8018D9E0_entry*); +void func_800ABF68(struct_8018D9E0_entry*); +void func_800AC128(struct_8018D9E0_entry*); +void func_800AC324(struct_8018D9E0_entry*); void func_800AC978(struct_8018D9E0_entry*); +void func_800AD1A4(struct_8018D9E0_entry*); +void func_800AEC54(struct_8018D9E0_entry*); void func_800AEE90(struct_8018D9E0_entry*); void func_800AEEBC(struct_8018D9E0_entry*); void func_800AEEE8(struct_8018D9E0_entry*); @@ -225,6 +234,8 @@ void func_80057CE4(); extern Gfx D_06009410[]; +extern s32 D_800DDB24; + extern Gfx *D_800E84CC[]; extern Gfx *D_800E84EC[]; extern Gfx *D_800E850C[]; @@ -271,6 +282,7 @@ extern f32 D_800F24B8; extern f64 D_800F24C0; extern s32 D_80165754; extern s32 D_8018D9B0; +extern s8 D_8018D9D8; extern s8 D_8018D9D9; extern struct_8018D9E0_entry D_8018D9E0[D_8018D9E0_SIZE]; // D_8018D9E0 extern struct_8018DEE0_entry D_8018DEE0[D_8018DEE0_SIZE]; // D_8018DEE0 @@ -294,6 +306,7 @@ extern f32 D_8018EDD0; extern f32 D_8018EDD4; extern f32 D_8018EDD8; extern f32 D_8018EDDC; +extern s8 D_8018EE08; extern s8 D_802874F5; extern u8 _textures_0aSegmentRomStart[]; diff --git a/src/code_80280650.c b/src/code_80280650.c index d8c5c1e6f..44f59dc70 100644 --- a/src/code_80280650.c +++ b/src/code_80280650.c @@ -4,7 +4,9 @@ #include #include "main.h" #include "variables.h" +#include "common_textures.h" #include "code_8001F980.h" +#include "code_800431B0.h" #include "code_80280650.h" void func_80280650(void) { @@ -177,100 +179,32 @@ void func_80280A28(Vec3f arg0, Vec3s arg1, f32 arg2) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -//void func_8004B35C(s16, s16, s16, s16); // extern -//void func_80280A28(?, f32 *, s16 *, ?); // extern -extern u8 D_0D008DB8; -extern u8 D_0D008E48; -extern s16 D_80164AF0; -extern s32 D_8018D48C; +#ifdef NON_MATCHING +extern u32 D_8018D48C; -struct UnkStruct80280B50 { - s32 unk0; - s32 unk4; - s32 unk8; -}; -extern Camera *camera1; - -void func_80280B50(struct UnkStruct80280B50 *arg0, s32 arg1, s32 arg2, s16 arg3) { - f32 sp54 = arg0->unk8; - f32 sp50 = arg0->unk4; - f32 sp4C = arg0->unk0; - s16 sp48 = 0; - s32 sp46 = camera1->unk26; - s16 sp44 = 0; - void *sp1C; - //s16 *temp_a1 = &sp44; - - //sp4C = arg0->unk0; - //temp_a1 = &sp44; - //sp50 = arg0->unk4; - //sp44 = 0; - //sp54 = arg0->unk8; - //sp48 = 0; - //sp46 = camera1->unk26; - func_80280A28(arg1, &sp4C, &sp44, arg1); +void func_80280B50(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha) { + Vec3f sp4C; + Vec3s sp44; + s16 red; + s16 green; + s16 blue; + sp4C[0] = arg0[0]; + sp4C[1] = arg0[1]; + sp4C[2] = arg0[2]; + sp44[0] = 0; + sp44[1] = camera1->rot[1]; + sp44[2] = 0; + func_80280A28(sp4C, sp44, arg1); gSPDisplayList(gDisplayListHead++, D_0D008DB8); - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, D_8018D48C); - gDPSetTile(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); - gDPLoadSync(gDisplayListHead++); - gDPLoadBlock(gDisplayListHead++, 1, 0, 0, 4082, 0); - gDPPipeSync(gDisplayListHead++); - gDPSetTile(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_8b, 4, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); - gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0x7C0, 0x7C0); - - func_8004B35C((arg2 >> 0x10) & 0xFF, (arg2 >> 8) & 0xFF, arg2 & 0xFF, arg3); - - gSPDisplayList(gDisplayListHead, D_0D008E48); - D_80164AF0++; -/* - temp_v0 = gDisplayListHead; - gDisplayListHead = temp_v0 + 8; - temp_v0->unk0 = 0x6000000; - temp_v0->unk4 = &D_0D008DB8; - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0xFD700000; - temp_v0_2->unk4 = D_8018D48C; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0x7000000; - temp_v0_3->unk0 = 0xF5700000; - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0; - temp_v0_4->unk0 = 0xE6000000; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x71FF200; - temp_v0_5->unk0 = 0xF3000000; - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE7000000; - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xF5680800; - temp_v0_8 = gDisplayListHead; - - - gDisplayListHead = temp_v0_8 + 8; - sp1C = temp_v0_8; - temp_v0_8->unk4 = 0x7C07C; - temp_v0_8->unk0 = 0xF2000000; - - - func_8004B35C((arg2 >> 0x10) & 0xFF, (arg2 >> 8) & 0xFF, arg2 & 0xFF, arg3); - - - temp_v0_9 = gDisplayListHead; - gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk0 = 0x6000000; - temp_v0_9->unk4 = &D_0D008E48; - */; + gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + // The exact order of operations for red/green/blue is slightly wrong... + red = (rgb >> 0x10) & 0xFF; + green = (rgb >> 0x08) & 0xFF; + blue = (rgb >> 0x00) & 0xFF; + func_8004B35C(red, green, blue, alpha); + gSPDisplayList(gDisplayListHead++, D_0D008E48); + D_80164AF0 += 1; } #else GLOBAL_ASM("asm/non_matchings/code_80280650/func_80280B50.s") diff --git a/src/code_80280650.h b/src/code_80280650.h index b8e8c0f47..e73e3e4e7 100644 --- a/src/code_80280650.h +++ b/src/code_80280650.h @@ -76,6 +76,7 @@ f32 func_80280850(f32); void func_80280884(); void func_8028093C(struct UnkStruct_80280658*); void func_80280A28(Vec3f, Vec3s, f32 ); +void func_80280B50(Vec3f, f32, s32, s16); void func_80280FA0(s32); void func_80280FA8(s32); void func_80280FB0(); diff --git a/src/code_80281FA0.c b/src/code_80281FA0.c index f68465e12..3a97c973f 100644 --- a/src/code_80281FA0.c +++ b/src/code_80281FA0.c @@ -503,30 +503,19 @@ GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_802830B4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_80282364(void *, ?, s16, void *); // extern -f32 coss(s32, void *); // extern - +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c void func_80283100(void *arg0, f32 *arg1) { f32 temp_f4; - s32 temp_a0; - void *temp_a3; - void *phi_a3; - temp_a3 = arg0; - phi_a3 = temp_a3; if (arg0->unk60 != 0) { - temp_a0 = arg0->unk64 & 0xFFFF; - arg0 = temp_a3; - temp_f4 = (coss(temp_a0, temp_a3) * arg0->unk60) / 256.0f; - arg0->unk64 = arg0->unk64 + arg0->unk68; - arg0->unk6E = temp_f4; - func_80282364(arg0 + 0x60, 0, arg0->unk6C, arg0); - phi_a3 = arg0; + temp_f4 = (coss((u32) arg0->unk64 & 0xFFFF) * (f32) arg0->unk60) / 256.0f; + arg0->unk64 = (f32) (arg0->unk64 + arg0->unk68); + arg0->unk6E = (s16) (s32) temp_f4; + func_80282364(arg0 + 0x60, 0, arg0->unk6C); } else { - temp_a3->unk64 = 0.0f; + arg0->unk64 = 0.0f; } - *arg1 = phi_a3->unk20 + phi_a3->unk6E; + *arg1 = arg0->unk20 + (f32) arg0->unk6E; } #else GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_80283100.s") diff --git a/src/memory.c b/src/memory.c index 36eb9408a..d16ca8f61 100644 --- a/src/memory.c +++ b/src/memory.c @@ -1589,10 +1589,10 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802AAB4C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern f32 D_802B9E48; +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +static f32 D_802B9E48 = -0.9f; -s32 func_802AAE4C(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { +s32 func_802AAE4C(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { f32 sp6C; f32 sp64; f32 sp3C; @@ -1606,6 +1606,9 @@ s32 func_802AAE4C(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) f32 sp10; f32 spC; f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; @@ -1622,54 +1625,48 @@ s32 func_802AAE4C(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) f32 temp_f2_3; f32 temp_f4; f32 temp_f8; - void *temp_a0; - void *temp_a2; - void *temp_a3; - void *temp_v1; - s32 phi_v0; - f32 phi_f18; - s32 phi_v0_2; + mk64_surface_map_ram *temp_v1; + s32 var_v0; + s32 var_v0_2; - temp_v1 = (arg5 * 0x2C) + D_8015F580; - temp_f0 = temp_v1->unk20; - phi_v0 = 1; - phi_v0_2 = 1; + temp_v1 = &D_8015F580[arg5]; + temp_f0 = temp_v1->gravity; + var_v0_2 = 1; if (temp_f0 < D_802B9E48) { return 0; } - if (arg2 < temp_v1->unk4) { + if (arg2 < (f32) temp_v1->vtx3[0]) { return 0; } - if (arg4 < temp_v1->unk8) { + if (arg4 < (f32) temp_v1->vtx3[2]) { return 0; } - if (temp_v1->unkA < arg2) { + if ((f32) temp_v1->vtx2[0] < arg2) { return 0; } - if (temp_v1->unkE < arg4) { + if ((f32) temp_v1->vtx2[2] < arg4) { return 0; } sp2C = temp_f0; - arg2 = arg2; - if (arg3 < (temp_v1->unk6 - (arg1 * 3.0f))) { + if (arg3 < ((f32) temp_v1->vtx3[1] - (arg1 * 3.0f))) { return 0; } - temp_a0 = temp_v1->unk10; - temp_a3 = temp_v1->unk18; - temp_a2 = temp_v1->unk14; - sp6C = temp_a3->unk0; + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp6C = (f32) temp_a3->v.ob[0]; sp8 = arg4; sp10 = arg2; - temp_f8 = temp_a0->unk4 - arg4; - sp64 = temp_a3->unk4; - temp_f4 = temp_a2->unk0 - arg2; + temp_f8 = (f32) temp_a0->v.ob[2] - arg4; + sp64 = (f32) temp_a3->v.ob[2]; + temp_f4 = (f32) temp_a2->v.ob[0] - arg2; sp28 = temp_f8; sp24 = temp_f4; - sp20 = temp_a0->unk0 - arg2; + sp20 = (f32) temp_a0->v.ob[0] - arg2; temp_f0_2 = temp_f8 * temp_f4; sp8 = temp_f8; spC = temp_f4; - sp1C = temp_a2->unk4 - arg4; + sp1C = (f32) temp_a2->v.ob[2] - arg4; temp_f2 = sp20 * sp1C; temp_f10 = temp_f0_2 - temp_f2; sp18 = temp_f10; @@ -1678,9 +1675,8 @@ s32 func_802AAE4C(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) sp14 = arg4; temp_f0_3 = sp6C - sp10; temp_f2_2 = sp64 - arg4; - phi_f18 = 0.0f; if ((((sp1C * temp_f0_3) - (spC * temp_f2_2)) * ((temp_f2_2 * sp20) - (temp_f0_3 * sp8))) < 0.0f) { - goto block_22; + var_v0_2 = 0; } } else { temp_f2_3 = sp64 - arg4; @@ -1688,61 +1684,56 @@ s32 func_802AAE4C(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) temp_f14 = sp24 * temp_f2_3; temp_f12 = sp1C * temp_f0_4; if (temp_f14 == temp_f12) { - phi_f18 = 0.0f; if ((sp3C * ((temp_f2_3 * sp20) - (temp_f0_4 * sp28))) < 0.0f) { - goto block_22; + var_v0_2 = 0; } } else { temp_f16 = temp_f12 - temp_f14; if ((sp18 * temp_f16) < 0.0f) { - goto block_22; - } - temp_f14_2 = temp_f0_4 * sp28; - temp_f12_2 = temp_f2_3 * sp20; - phi_f18 = 0.0f; - if (temp_f14_2 != temp_f12_2) { - phi_f18 = 0.0f; - if ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f) { -block_22: - phi_v0 = 0; - phi_f18 = 0.0f; + var_v0_2 = 0; + } else { + temp_f14_2 = temp_f0_4 * sp28; + temp_f12_2 = temp_f2_3 * sp20; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0_2 = 0; } } } } - if (phi_v0 == 0) { + if (var_v0_2 == 0) { return 0; } - temp_f0_5 = ((temp_v1->unk1C * arg2) + (sp2C * arg3) + (temp_v1->unk24 * arg4) + temp_v1->unk28) - arg1; - if (phi_f18 < temp_f0_5) { - if (temp_f0_5 < arg0->unk14) { - arg0->unk4 = 1; - arg0->unkA = arg5; - arg0->unk14 = temp_f0_5; - arg0->unk30 = temp_v1->unk1C; - arg0->unk34 = temp_v1->unk20; - arg0->unk38 = temp_v1->unk24; + temp_f0_5 = ((temp_v1->height * arg2) + (sp2C * arg3) + (temp_v1->rotation * arg4) + temp_v1->height2) - arg1; + if (temp_f0_5 > 0.0f) { + if (temp_f0_5 < arg0->unk3C[2]) { + arg0->unk34 = 1; + arg0->unk3A = arg5; + arg0->unk3C[2] = temp_f0_5; + arg0->unk60[0] = temp_v1->height; + arg0->unk60[1] = temp_v1->gravity; + arg0->unk60[2] = temp_v1->rotation; } return 0; } - phi_v0_2 = 0; + var_v0 = 0; if (temp_f0_5 > -16.0f) { - arg0->unk4 = 1; - arg0->unkA = arg5; - arg0->unk14 = temp_f0_5; - arg0->unk30 = temp_v1->unk1C; - arg0->unk34 = temp_v1->unk20; - arg0->unk38 = temp_v1->unk24; + arg0->unk34 = 1; + arg0->unk3A = arg5; + arg0->unk3C[2] = temp_f0_5; + var_v0 = 1; + arg0->unk60[0] = temp_v1->height; + arg0->unk60[1] = temp_v1->gravity; + arg0->unk60[2] = temp_v1->rotation; } - return phi_v0_2; + return var_v0; } #else GLOBAL_ASM("asm/non_matchings/memory/func_802AAE4C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802AB288(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802AB288(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { f32 sp70; f32 sp6C; f32 sp3C; @@ -1755,6 +1746,9 @@ s32 func_802AB288(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) f32 sp10; f32 spC; f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; @@ -1771,54 +1765,47 @@ s32 func_802AB288(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) f32 temp_f4; f32 temp_f6; f32 temp_f8; - void *temp_a0; - void *temp_a2; - void *temp_a3; - void *temp_v1; - s32 phi_v0; - f32 phi_f18; - s32 phi_v0_2; + mk64_surface_map_ram *temp_v1; + s32 var_v0; + s32 var_v0_2; - temp_v1 = (arg5 * 0x2C) + D_8015F580; - phi_v0 = 1; - phi_v0_2 = 1; - if (arg2 < temp_v1->unk4) { + temp_v1 = &D_8015F580[arg5]; + var_v0_2 = 1; + if (arg2 < (f32) temp_v1->vtx3[0]) { return 0; } - if (temp_v1->unkA < arg2) { + if ((f32) temp_v1->vtx2[0] < arg2) { return 0; } - if (temp_v1->unkC < arg3) { + if ((f32) temp_v1->vtx2[1] < arg3) { return 0; } - if (arg3 < temp_v1->unk6) { + if (arg3 < (f32) temp_v1->vtx3[1]) { return 0; } temp_f2 = arg1 * 3.0f; - if (arg4 < (temp_v1->unk8 - temp_f2)) { + if (arg4 < ((f32) temp_v1->vtx3[2] - temp_f2)) { return 0; } - arg2 = arg2; - arg3 = arg3; - if ((temp_v1->unkE + temp_f2) < arg4) { + if (((f32) temp_v1->vtx2[2] + temp_f2) < arg4) { return 0; } - temp_a0 = temp_v1->unk10; - temp_a3 = temp_v1->unk18; - temp_a2 = temp_v1->unk14; - sp70 = temp_a3->unk0; + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp70 = (f32) temp_a3->v.ob[0]; sp8 = arg3; sp10 = arg2; - temp_f4 = temp_a0->unk2 - arg3; - sp6C = temp_a3->unk2; - temp_f8 = temp_a2->unk0 - arg2; + temp_f4 = (f32) temp_a0->v.ob[1] - arg3; + sp6C = (f32) temp_a3->v.ob[1]; + temp_f8 = (f32) temp_a2->v.ob[0] - arg2; sp2C = temp_f4; sp28 = temp_f8; - sp24 = temp_a0->unk0 - arg2; + sp24 = (f32) temp_a0->v.ob[0] - arg2; temp_f0 = temp_f4 * temp_f8; sp8 = temp_f4; spC = temp_f8; - sp20 = temp_a2->unk2 - arg3; + sp20 = (f32) temp_a2->v.ob[1] - arg3; temp_f2_2 = sp24 * sp20; temp_f6 = temp_f0 - temp_f2_2; sp1C = temp_f6; @@ -1827,9 +1814,8 @@ s32 func_802AB288(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) sp14 = arg3; temp_f0_2 = sp70 - sp10; temp_f2_3 = sp6C - arg3; - phi_f18 = 0.0f; if ((((sp20 * temp_f0_2) - (spC * temp_f2_3)) * ((temp_f2_3 * sp24) - (temp_f0_2 * sp8))) < 0.0f) { - goto block_22; + var_v0_2 = 0; } } else { temp_f2_4 = sp6C - arg3; @@ -1837,61 +1823,56 @@ s32 func_802AB288(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) temp_f14 = sp28 * temp_f2_4; temp_f12 = sp20 * temp_f0_3; if (temp_f14 == temp_f12) { - phi_f18 = 0.0f; if ((sp3C * ((temp_f2_4 * sp24) - (temp_f0_3 * sp2C))) < 0.0f) { - goto block_22; + var_v0_2 = 0; } } else { temp_f16 = temp_f12 - temp_f14; if ((sp1C * temp_f16) < 0.0f) { - goto block_22; - } - temp_f14_2 = temp_f0_3 * sp2C; - temp_f12_2 = temp_f2_4 * sp24; - phi_f18 = 0.0f; - if (temp_f14_2 != temp_f12_2) { - phi_f18 = 0.0f; - if ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f) { -block_22: - phi_v0 = 0; - phi_f18 = 0.0f; + var_v0_2 = 0; + } else { + temp_f14_2 = temp_f0_3 * sp2C; + temp_f12_2 = temp_f2_4 * sp24; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0_2 = 0; } } } } - if (phi_v0 == 0) { + if (var_v0_2 == 0) { return 0; } - temp_f0_4 = ((temp_v1->unk1C * arg2) + (temp_v1->unk20 * arg3) + (temp_v1->unk24 * arg4) + temp_v1->unk28) - arg1; - if (phi_f18 < temp_f0_4) { - if (temp_f0_4 < arg0->unkC) { - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = temp_f0_4; - arg0->unk18 = temp_v1->unk1C; - arg0->unk1C = temp_v1->unk20; - arg0->unk20 = temp_v1->unk24; + temp_f0_4 = ((temp_v1->height * arg2) + (temp_v1->gravity * arg3) + (temp_v1->rotation * arg4) + temp_v1->height2) - arg1; + if (temp_f0_4 > 0.0f) { + if (temp_f0_4 < arg0->unk3C[0]) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; } return 0; } - phi_v0_2 = 0; + var_v0 = 0; if (temp_f0_4 > -16.0f) { - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = temp_f0_4; - arg0->unk18 = temp_v1->unk1C; - arg0->unk1C = temp_v1->unk20; - arg0->unk20 = temp_v1->unk24; + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4; + var_v0 = 1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; } - return phi_v0_2; + return var_v0; } #else GLOBAL_ASM("asm/non_matchings/memory/func_802AB288.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802AB6C4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802AB6C4(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { f32 sp68; f32 sp64; f32 sp38; @@ -1904,6 +1885,9 @@ s32 func_802AB6C4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) f32 sp10; f32 spC; f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; @@ -1920,53 +1904,47 @@ s32 func_802AB6C4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) f32 temp_f2_3; f32 temp_f4; f32 temp_f6; - void *temp_a0; - void *temp_a2; - void *temp_a3; - void *temp_v1; - s32 phi_v0; - f32 phi_f18; - s32 phi_v0_2; + mk64_surface_map_ram *temp_v1; + s32 var_v0; + s32 var_v0_2; - temp_v1 = (arg5 * 0x2C) + D_8015F580; - phi_v0 = 1; - phi_v0_2 = 1; - if (arg4 < temp_v1->unk8) { + temp_v1 = &D_8015F580[arg5]; + var_v0_2 = 1; + if (arg4 < (f32) temp_v1->vtx3[2]) { return 0; } - if (temp_v1->unkE < arg4) { + if ((f32) temp_v1->vtx2[2] < arg4) { return 0; } - if (temp_v1->unkC < arg3) { + if ((f32) temp_v1->vtx2[1] < arg3) { return 0; } - if (arg3 < temp_v1->unk6) { + if (arg3 < (f32) temp_v1->vtx3[1]) { return 0; } temp_f0 = arg1 * 3.0f; - if (arg2 < (temp_v1->unk4 - temp_f0)) { + if (arg2 < ((f32) temp_v1->vtx3[0] - temp_f0)) { return 0; } - arg3 = arg3; - if ((temp_v1->unkA + temp_f0) < arg2) { + if (((f32) temp_v1->vtx2[0] + temp_f0) < arg2) { return 0; } - temp_a0 = temp_v1->unk10; - temp_a3 = temp_v1->unk18; - temp_a2 = temp_v1->unk14; - sp64 = temp_a3->unk4; + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp64 = (f32) temp_a3->v.ob[2]; sp8 = arg3; sp10 = arg4; - temp_f6 = temp_a0->unk2 - arg3; - sp68 = temp_a3->unk2; - temp_f10 = temp_a2->unk4 - arg4; + temp_f6 = (f32) temp_a0->v.ob[1] - arg3; + sp68 = (f32) temp_a3->v.ob[1]; + temp_f10 = (f32) temp_a2->v.ob[2] - arg4; sp2C = temp_f6; sp28 = temp_f10; - sp24 = temp_a0->unk4 - arg4; + sp24 = (f32) temp_a0->v.ob[2] - arg4; temp_f0_2 = temp_f6 * temp_f10; sp8 = temp_f6; spC = temp_f10; - sp20 = temp_a2->unk2 - arg3; + sp20 = (f32) temp_a2->v.ob[1] - arg3; temp_f2 = sp24 * sp20; temp_f4 = temp_f0_2 - temp_f2; sp1C = temp_f4; @@ -1975,9 +1953,8 @@ s32 func_802AB6C4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) sp14 = arg3; temp_f0_3 = sp64 - sp10; temp_f2_2 = sp68 - arg3; - phi_f18 = 0.0f; if ((((sp20 * temp_f0_3) - (spC * temp_f2_2)) * ((temp_f2_2 * sp24) - (temp_f0_3 * sp8))) < 0.0f) { - goto block_22; + var_v0_2 = 0; } } else { temp_f2_3 = sp68 - arg3; @@ -1985,60 +1962,55 @@ s32 func_802AB6C4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) temp_f14 = sp28 * temp_f2_3; temp_f12 = sp20 * temp_f0_4; if (temp_f14 == temp_f12) { - phi_f18 = 0.0f; if ((sp38 * ((temp_f2_3 * sp24) - (temp_f0_4 * sp2C))) < 0.0f) { - goto block_22; + var_v0_2 = 0; } } else { temp_f16 = temp_f12 - temp_f14; if ((sp1C * temp_f16) < 0.0f) { - goto block_22; - } - temp_f14_2 = temp_f0_4 * sp2C; - temp_f12_2 = temp_f2_3 * sp24; - phi_f18 = 0.0f; - if (temp_f14_2 != temp_f12_2) { - phi_f18 = 0.0f; - if ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f) { -block_22: - phi_v0 = 0; - phi_f18 = 0.0f; + var_v0_2 = 0; + } else { + temp_f14_2 = temp_f0_4 * sp2C; + temp_f12_2 = temp_f2_3 * sp24; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0_2 = 0; } } } } - if (phi_v0 == 0) { + if (var_v0_2 == 0) { return 0; } - temp_f0_5 = ((temp_v1->unk1C * arg2) + (temp_v1->unk20 * arg3) + (temp_v1->unk24 * arg4) + temp_v1->unk28) - arg1; - if (phi_f18 < temp_f0_5) { - if (temp_f0_5 < arg0->unk10) { - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = temp_f0_5; - arg0->unk24 = temp_v1->unk1C; - arg0->unk28 = temp_v1->unk20; - arg0->unk2C = temp_v1->unk24; + temp_f0_5 = ((temp_v1->height * arg2) + (temp_v1->gravity * arg3) + (temp_v1->rotation * arg4) + temp_v1->height2) - arg1; + if (temp_f0_5 > 0.0f) { + if (temp_f0_5 < arg0->unk3C[1]) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; } return 0; } - phi_v0_2 = 0; + var_v0 = 0; if (temp_f0_5 > -16.0f) { - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = temp_f0_5; - arg0->unk24 = temp_v1->unk1C; - arg0->unk28 = temp_v1->unk20; - arg0->unk2C = temp_v1->unk24; + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5; + var_v0 = 1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; } - return phi_v0_2; + return var_v0; } #else GLOBAL_ASM("asm/non_matchings/memory/func_802AB6C4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c s32 func_802ABB04(f32 arg0, f32 arg1, s32 arg2) { f32 sp6C; f32 sp64; @@ -2048,6 +2020,9 @@ s32 func_802ABB04(f32 arg0, f32 arg1, s32 arg2) { f32 sp28; f32 sp20; f32 sp1C; + Vtx *temp_a0; + Vtx *temp_a1; + Vtx *temp_a3; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; @@ -2063,36 +2038,33 @@ s32 func_802ABB04(f32 arg0, f32 arg1, s32 arg2) { f32 temp_f2_2; f32 temp_f2_3; f32 temp_f6; - void *temp_a0; - void *temp_a1; - void *temp_a3; - void *temp_v0; - ? phi_v1; + mk64_surface_map_ram *temp_v0; + s32 var_v1; - temp_v0 = ((arg2 & 0xFFFF) * 0x2C) + D_8015F580; - temp_a1 = temp_v0->unk14; - temp_a0 = temp_v0->unk10; - sp60 = temp_a1->unk0; - temp_f20 = temp_a0->unk4 - arg1; - sp58 = temp_a1->unk4; - temp_a3 = temp_v0->unk18; - temp_f22 = temp_a0->unk0 - arg0; - sp6C = temp_a3->unk0; + temp_v0 = &D_8015F580[arg2 & 0xFFFF]; + temp_a1 = temp_v0->vtxs[1]; + temp_a0 = temp_v0->vtxs[0]; + var_v1 = 1; + sp60 = (f32) temp_a1->v.ob[0]; + temp_f20 = (f32) temp_a0->v.ob[2] - arg1; + sp58 = (f32) temp_a1->v.ob[2]; + temp_a3 = temp_v0->vtxs[2]; + temp_f22 = (f32) temp_a0->v.ob[0] - arg0; + sp6C = (f32) temp_a3->v.ob[0]; temp_f10 = sp60 - arg0; temp_f0 = temp_f20 * temp_f10; sp28 = temp_f10; - sp64 = temp_a3->unk4; + sp64 = (f32) temp_a3->v.ob[2]; temp_f6 = sp58 - arg1; temp_f2 = temp_f22 * temp_f6; sp20 = temp_f6; sp1C = temp_f0 - temp_f2; sp3C = sp1C; - phi_v1 = 1; if (temp_f2 == temp_f0) { temp_f0_2 = sp6C - arg0; temp_f2_2 = sp64 - arg1; if ((((temp_f6 * temp_f0_2) - (temp_f10 * temp_f2_2)) * ((temp_f2_2 * temp_f22) - (temp_f0_2 * temp_f20))) < 0.0f) { - goto block_10; + var_v1 = 0; } } else { temp_f2_3 = sp64 - arg1; @@ -2101,22 +2073,22 @@ s32 func_802ABB04(f32 arg0, f32 arg1, s32 arg2) { temp_f16 = sp20 * temp_f0_3; if (temp_f18 == temp_f16) { if ((sp3C * ((temp_f2_3 * temp_f22) - (temp_f0_3 * temp_f20))) < 0.0f) { - goto block_10; + var_v1 = 0; } } else { temp_f12 = temp_f16 - temp_f18; if ((sp1C * temp_f12) < 0.0f) { - goto block_10; - } - temp_f16_2 = temp_f0_3 * temp_f20; - temp_f14 = temp_f2_3 * temp_f22; - if ((temp_f16_2 != temp_f14) && ((temp_f12 * (temp_f14 - temp_f16_2)) < 0.0f)) { -block_10: - phi_v1 = 0; + var_v1 = 0; + } else { + temp_f16_2 = temp_f0_3 * temp_f20; + temp_f14 = temp_f2_3 * temp_f22; + if ((temp_f16_2 != temp_f14) && ((temp_f12 * (temp_f14 - temp_f16_2)) < 0.0f)) { + var_v1 = 0; + } } } } - return phi_v1; + return var_v1; } #else GLOBAL_ASM("asm/non_matchings/memory/func_802ABB04.s") @@ -2431,8 +2403,8 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802AC22C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802AC760(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802AC760(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { f32 sp6C; f32 sp64; f32 sp38; @@ -2444,6 +2416,9 @@ s32 func_802AC760(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 sp10; f32 spC; f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; @@ -2464,47 +2439,43 @@ s32 func_802AC760(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 temp_f2_4; f32 temp_f4; f32 temp_f6; - void *temp_a0; - void *temp_a2; - void *temp_a3; - void *temp_v1; - s32 phi_v0; + mk64_surface_map_ram *temp_v1; + s32 var_v0; - temp_v1 = (arg5 * 0x2C) + D_8015F580; - phi_v0 = 1; - if (arg2 < temp_v1->unk4) { + temp_v1 = &D_8015F580[arg5]; + var_v0 = 1; + if (arg2 < (f32) temp_v1->vtx3[0]) { return 0; } - if (arg4 < temp_v1->unk8) { + if (arg4 < (f32) temp_v1->vtx3[2]) { return 0; } - if (temp_v1->unkA < arg2) { + if ((f32) temp_v1->vtx2[0] < arg2) { return 0; } - if (temp_v1->unkE < arg4) { + if ((f32) temp_v1->vtx2[2] < arg4) { return 0; } - arg2 = arg2; - if (arg3 < (temp_v1->unk6 - (arg1 * 3.0f))) { + if (arg3 < ((f32) temp_v1->vtx3[1] - (arg1 * 3.0f))) { return 0; } - temp_a0 = temp_v1->unk10; - temp_a3 = temp_v1->unk18; - temp_a2 = temp_v1->unk14; - sp6C = temp_a3->unk0; + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp6C = (f32) temp_a3->v.ob[0]; sp8 = arg4; sp10 = arg2; - temp_f6 = temp_a0->unk4 - arg4; - sp64 = temp_a3->unk4; - temp_f4 = temp_a2->unk0 - arg2; + temp_f6 = (f32) temp_a0->v.ob[2] - arg4; + sp64 = (f32) temp_a3->v.ob[2]; + temp_f4 = (f32) temp_a2->v.ob[0] - arg2; sp28 = temp_f6; sp24 = temp_f4; - sp20 = temp_a0->unk0 - arg2; + sp20 = (f32) temp_a0->v.ob[0] - arg2; temp_f0 = temp_f6 * temp_f4; sp8 = temp_f6; spC = temp_f4; temp_f18 = sp8; - sp1C = temp_a2->unk4 - arg4; + sp1C = (f32) temp_a2->v.ob[2] - arg4; temp_f2 = sp20 * sp1C; temp_f10 = temp_f0 - temp_f2; sp18 = temp_f10; @@ -2514,7 +2485,7 @@ s32 func_802AC760(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, temp_f0_2 = sp6C - sp10; temp_f2_2 = sp64 - arg4; if ((((sp1C * temp_f0_2) - (spC * temp_f2_2)) * ((temp_f2_2 * sp20) - (temp_f0_2 * temp_f18))) < 0.0f) { - goto block_20; + var_v0 = 0; } } else { temp_f2_3 = sp64 - arg4; @@ -2523,49 +2494,49 @@ s32 func_802AC760(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, temp_f12 = sp1C * temp_f0_3; if (temp_f14 == temp_f12) { if ((sp38 * ((temp_f2_3 * sp20) - (temp_f0_3 * sp28))) < 0.0f) { - goto block_20; + var_v0 = 0; } } else { temp_f16 = temp_f12 - temp_f14; if ((sp18 * temp_f16) < 0.0f) { - goto block_20; - } - temp_f14_2 = temp_f0_3 * sp28; - temp_f12_2 = temp_f2_3 * sp20; - if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { -block_20: - phi_v0 = 0; + var_v0 = 0; + } else { + temp_f14_2 = temp_f0_3 * sp28; + temp_f12_2 = temp_f2_3 * sp20; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0 = 0; + } } } } - if (phi_v0 == 0) { + if (var_v0 == 0) { return 0; } - temp_f2_4 = temp_v1->unk1C; - temp_f12_3 = temp_v1->unk20; - temp_f14_3 = temp_v1->unk24; - temp_f16_2 = temp_v1->unk28; + temp_f2_4 = temp_v1->height; + temp_f12_3 = temp_v1->gravity; + temp_f14_3 = temp_v1->rotation; + temp_f16_2 = temp_v1->height2; temp_f0_4 = (temp_f2_4 * arg2) + (temp_f12_3 * arg3) + (temp_f14_3 * arg4) + temp_f16_2; if (arg1 < temp_f0_4) { - if (temp_f0_4 < arg0->unk14) { - arg0->unk4 = 1; - arg0->unkA = arg5; - arg0->unk14 = temp_f0_4 - arg1; - arg0->unk30 = temp_v1->unk1C; - arg0->unk34 = temp_v1->unk20; - arg0->unk38 = temp_v1->unk24; + if (temp_f0_4 < arg0->unk3C[2]) { + arg0->unk34 = 1; + arg0->unk3A = arg5; + arg0->unk3C[2] = temp_f0_4 - arg1; + arg0->unk60[0] = temp_v1->height; + arg0->unk60[1] = temp_v1->gravity; + arg0->unk60[2] = temp_v1->rotation; } return 0; } if (((temp_f2_4 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2) < 0.0f) { return 0; } - arg0->unk4 = 1; - arg0->unkA = arg5; - arg0->unk14 = temp_f0_4 - arg1; - arg0->unk30 = temp_v1->unk1C; - arg0->unk34 = temp_v1->unk20; - arg0->unk38 = temp_v1->unk24; + arg0->unk34 = 1; + arg0->unk3A = arg5; + arg0->unk3C[2] = temp_f0_4 - arg1; + arg0->unk60[0] = temp_v1->height; + arg0->unk60[1] = temp_v1->gravity; + arg0->unk60[2] = temp_v1->rotation; return 1; } #else @@ -2573,8 +2544,8 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802AC760.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802ACBA4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802ACBA4(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { f32 sp70; f32 sp6C; f32 sp48; @@ -2588,6 +2559,9 @@ s32 func_802ACBA4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 sp10; f32 spC; f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; @@ -2611,53 +2585,47 @@ s32 func_802ACBA4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 temp_f4_2; f32 temp_f6; f32 temp_f8; - void *temp_a0; - void *temp_a2; - void *temp_a3; - void *temp_v1; - s32 phi_v0; - f32 phi_f18; - f32 phi_f10; + f32 var_f10; + mk64_surface_map_ram *temp_v1; + s32 var_v0; - temp_v1 = (arg5 * 0x2C) + D_8015F580; - phi_v0 = 1; - if (arg2 < temp_v1->unk4) { + temp_v1 = &D_8015F580[arg5]; + var_v0 = 1; + if (arg2 < (f32) temp_v1->vtx3[0]) { return 0; } - if (temp_v1->unkA < arg2) { + if ((f32) temp_v1->vtx2[0] < arg2) { return 0; } - if (temp_v1->unkC < arg3) { + if ((f32) temp_v1->vtx2[1] < arg3) { return 0; } - if (arg3 < temp_v1->unk6) { + if (arg3 < (f32) temp_v1->vtx3[1]) { return 0; } temp_f2 = arg1 * 3.0f; - if (arg4 < (temp_v1->unk8 - temp_f2)) { + if (arg4 < ((f32) temp_v1->vtx3[2] - temp_f2)) { return 0; } - arg2 = arg2; - arg3 = arg3; - if ((temp_v1->unkE + temp_f2) < arg4) { + if (((f32) temp_v1->vtx2[2] + temp_f2) < arg4) { return 0; } - temp_a0 = temp_v1->unk10; - temp_a3 = temp_v1->unk18; - temp_a2 = temp_v1->unk14; - sp70 = temp_a3->unk0; + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp70 = (f32) temp_a3->v.ob[0]; sp8 = arg3; sp10 = arg2; - temp_f10 = temp_a0->unk2 - arg3; - sp6C = temp_a3->unk2; - temp_f6 = temp_a2->unk0 - arg2; + temp_f10 = (f32) temp_a0->v.ob[1] - arg3; + sp6C = (f32) temp_a3->v.ob[1]; + temp_f6 = (f32) temp_a2->v.ob[0] - arg2; sp2C = temp_f10; sp28 = temp_f6; - sp24 = temp_a0->unk0 - arg2; + sp24 = (f32) temp_a0->v.ob[0] - arg2; temp_f0 = temp_f10 * temp_f6; sp8 = temp_f10; spC = temp_f6; - sp20 = temp_a2->unk2 - arg3; + sp20 = (f32) temp_a2->v.ob[1] - arg3; temp_f2_2 = sp24 * sp20; temp_f4 = temp_f0 - temp_f2_2; sp1C = temp_f4; @@ -2666,9 +2634,8 @@ s32 func_802ACBA4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, sp14 = arg3; temp_f0_2 = sp70 - sp10; temp_f2_3 = sp6C - arg3; - phi_f18 = 0.0f; if ((((sp20 * temp_f0_2) - (spC * temp_f2_3)) * ((temp_f2_3 * sp24) - (temp_f0_2 * sp8))) < 0.0f) { - goto block_22; + var_v0 = 0; } } else { temp_f2_4 = sp6C - arg3; @@ -2676,126 +2643,122 @@ s32 func_802ACBA4(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, temp_f14 = sp28 * temp_f2_4; temp_f12 = sp20 * temp_f0_3; if (temp_f14 == temp_f12) { - phi_f18 = 0.0f; if ((sp3C * ((temp_f2_4 * sp24) - (temp_f0_3 * sp2C))) < 0.0f) { - goto block_22; + var_v0 = 0; } } else { temp_f16 = temp_f12 - temp_f14; if ((sp1C * temp_f16) < 0.0f) { - goto block_22; - } - temp_f14_2 = temp_f0_3 * sp2C; - temp_f12_2 = temp_f2_4 * sp24; - phi_f18 = 0.0f; - if (temp_f14_2 != temp_f12_2) { - phi_f18 = 0.0f; - if ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f) { -block_22: - phi_v0 = 0; - phi_f18 = 0.0f; + var_v0 = 0; + } else { + temp_f14_2 = temp_f0_3 * sp2C; + temp_f12_2 = temp_f2_4 * sp24; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0 = 0; } } } } - if (phi_v0 == 0) { + if (var_v0 == 0) { return 0; } - temp_f2_5 = temp_v1->unk1C; - temp_f12_3 = temp_v1->unk20; - temp_f14_3 = temp_v1->unk24; - temp_f16_2 = temp_v1->unk28; + temp_f2_5 = temp_v1->height; + temp_f12_3 = temp_v1->gravity; + temp_f14_3 = temp_v1->rotation; + temp_f16_2 = temp_v1->height2; temp_f0_4 = (temp_f2_5 * arg2) + (temp_f12_3 * arg3) + (temp_f14_3 * arg4) + temp_f16_2; - if ((temp_v1->unk0 & 0x200) != 0) { + if (temp_v1->flags & 0x200) { temp_f4_2 = (temp_f2_5 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; sp48 = temp_f4_2; - if ((phi_f18 < temp_f0_4) && (phi_f18 < temp_f4_2)) { + if ((temp_f0_4 > 0.0f) && (temp_f4_2 > 0.0f)) { if (temp_f0_4 < arg1) { - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = temp_f0_4 - arg1; - arg0->unk18 = temp_v1->unk1C; - arg0->unk1C = temp_v1->unk20; - arg0->unk20 = temp_v1->unk24; + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4 - arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; return 1; } return 0; } - if ((temp_f0_4 < phi_f18) && (sp48 < phi_f18)) { + if ((temp_f0_4 < 0.0f) && (sp48 < 0.0f)) { temp_f0_5 = temp_f0_4 * -1.0f; if (temp_f0_5 < arg1) { - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = temp_f0_5 - arg1; - arg0->unk18 = -temp_v1->unk1C; - arg0->unk1C = -temp_v1->unk20; - arg0->unk20 = -temp_v1->unk24; + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_5 - arg1; + arg0->unk48[0] = -temp_v1->height; + arg0->unk48[1] = -temp_v1->gravity; + arg0->unk48[2] = -temp_v1->rotation; return 1; } return 0; } - if ((phi_f18 < temp_f0_4) && (sp48 < phi_f18)) { - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = -(temp_f0_4 + arg1); - arg0->unk18 = -temp_v1->unk1C; - arg0->unk1C = -temp_v1->unk20; - phi_f10 = -temp_v1->unk24; - goto block_54; - } - if ((temp_f0_4 < phi_f18) && (phi_f18 < sp48)) { - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = temp_f0_4 + arg1; - arg0->unk18 = temp_v1->unk1C; - arg0->unk1C = temp_v1->unk20; - arg0->unk20 = temp_v1->unk24; + if ((temp_f0_4 > 0.0f) && (sp48 < 0.0f)) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = -(temp_f0_4 + arg1); + arg0->unk48[0] = -temp_v1->height; + arg0->unk48[1] = -temp_v1->gravity; + var_f10 = -temp_v1->rotation; + arg0->unk48[2] = var_f10; return 1; } - if (temp_f0_4 == phi_f18) { - if (phi_f18 <= sp48) { - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = sp48 + arg1; - arg0->unk18 = temp_v1->unk1C; - arg0->unk1C = temp_v1->unk20; - arg0->unk20 = temp_v1->unk24; + if ((temp_f0_4 < 0.0f) && (sp48 > 0.0f)) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4 + arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; + return 1; + } + if (temp_f0_4 == 0.0f) { + if (sp48 >= 0.0f) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = sp48 + arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; return 1; } - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = -(sp48 + arg1); - arg0->unk18 = temp_v1->unk1C; - arg0->unk1C = temp_v1->unk20; - phi_f10 = temp_v1->unk24; - goto block_54; + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = -(sp48 + arg1); + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + var_f10 = temp_v1->rotation; + arg0->unk48[2] = var_f10; + return 1; } return 0; } if (arg1 < temp_f0_4) { - if (temp_f0_4 < arg0->unkC) { - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = temp_f0_4 - arg1; - arg0->unk18 = temp_v1->unk1C; - arg0->unk1C = temp_v1->unk20; - arg0->unk20 = temp_v1->unk24; + if (temp_f0_4 < arg0->unk3C[0]) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4 - arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; } return 0; } temp_f8 = (temp_f2_5 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; sp48 = temp_f8; - if (temp_f8 < phi_f18) { + if (temp_f8 < 0.0f) { return 0; } - arg0->unk0 = 1; - arg0->unk6 = arg5; - arg0->unkC = temp_f0_4 - arg1; - arg0->unk18 = temp_v1->unk1C; - arg0->unk1C = temp_v1->unk20; - phi_f10 = temp_v1->unk24; + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4 - arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + var_f10 = temp_v1->rotation; block_54: - arg0->unk20 = phi_f10; + arg0->unk48[2] = var_f10; return 1; } #else @@ -2803,8 +2766,8 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802ACBA4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802AD278(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802AD278(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { f32 sp68; f32 sp64; f32 sp44; @@ -2818,6 +2781,9 @@ s32 func_802AD278(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 sp10; f32 spC; f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; @@ -2841,52 +2807,47 @@ s32 func_802AD278(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 temp_f4; f32 temp_f6; f32 temp_f8; - void *temp_a0; - void *temp_a2; - void *temp_a3; - void *temp_v1; - s32 phi_v0; - f32 phi_f18; - f32 phi_f8; + f32 var_f8; + mk64_surface_map_ram *temp_v1; + s32 var_v0; - temp_v1 = (arg5 * 0x2C) + D_8015F580; - phi_v0 = 1; - if (arg4 < temp_v1->unk8) { + temp_v1 = &D_8015F580[arg5]; + var_v0 = 1; + if (arg4 < (f32) temp_v1->vtx3[2]) { return 0; } - if (temp_v1->unkE < arg4) { + if ((f32) temp_v1->vtx2[2] < arg4) { return 0; } - if (temp_v1->unkC < arg3) { + if ((f32) temp_v1->vtx2[1] < arg3) { return 0; } - if (arg3 < temp_v1->unk6) { + if (arg3 < (f32) temp_v1->vtx3[1]) { return 0; } temp_f0 = arg1 * 3.0f; - if (arg2 < (temp_v1->unk4 - temp_f0)) { + if (arg2 < ((f32) temp_v1->vtx3[0] - temp_f0)) { return 0; } - arg3 = arg3; - if ((temp_v1->unkA + temp_f0) < arg2) { + if (((f32) temp_v1->vtx2[0] + temp_f0) < arg2) { return 0; } - temp_a0 = temp_v1->unk10; - temp_a3 = temp_v1->unk18; - temp_a2 = temp_v1->unk14; - sp64 = temp_a3->unk4; + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp64 = (f32) temp_a3->v.ob[2]; sp8 = arg3; sp10 = arg4; - temp_f8 = temp_a0->unk2 - arg3; - sp68 = temp_a3->unk2; - temp_f6 = temp_a2->unk4 - arg4; + temp_f8 = (f32) temp_a0->v.ob[1] - arg3; + sp68 = (f32) temp_a3->v.ob[1]; + temp_f6 = (f32) temp_a2->v.ob[2] - arg4; sp2C = temp_f8; sp28 = temp_f6; - sp24 = temp_a0->unk4 - arg4; + sp24 = (f32) temp_a0->v.ob[2] - arg4; temp_f0_2 = temp_f8 * temp_f6; sp8 = temp_f8; spC = temp_f6; - sp20 = temp_a2->unk2 - arg3; + sp20 = (f32) temp_a2->v.ob[1] - arg3; temp_f2 = sp24 * sp20; temp_f10 = temp_f0_2 - temp_f2; sp1C = temp_f10; @@ -2895,9 +2856,8 @@ s32 func_802AD278(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, sp14 = arg3; temp_f0_3 = sp64 - sp10; temp_f2_2 = sp68 - arg3; - phi_f18 = 0.0f; if ((((sp20 * temp_f0_3) - (spC * temp_f2_2)) * ((temp_f2_2 * sp24) - (temp_f0_3 * sp8))) < 0.0f) { - goto block_22; + var_v0 = 0; } } else { temp_f2_3 = sp68 - arg3; @@ -2905,126 +2865,121 @@ s32 func_802AD278(void *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, temp_f14 = sp28 * temp_f2_3; temp_f12 = sp20 * temp_f0_4; if (temp_f14 == temp_f12) { - phi_f18 = 0.0f; if ((sp38 * ((temp_f2_3 * sp24) - (temp_f0_4 * sp2C))) < 0.0f) { - goto block_22; + var_v0 = 0; } } else { temp_f16 = temp_f12 - temp_f14; if ((sp1C * temp_f16) < 0.0f) { - goto block_22; - } - temp_f14_2 = temp_f0_4 * sp2C; - temp_f12_2 = temp_f2_3 * sp24; - phi_f18 = 0.0f; - if (temp_f14_2 != temp_f12_2) { - phi_f18 = 0.0f; - if ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f) { -block_22: - phi_v0 = 0; - phi_f18 = 0.0f; + var_v0 = 0; + } else { + temp_f14_2 = temp_f0_4 * sp2C; + temp_f12_2 = temp_f2_3 * sp24; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0 = 0; } } } } - if (phi_v0 == 0) { + if (var_v0 == 0) { return 0; } - temp_f2_4 = temp_v1->unk1C; - temp_f12_3 = temp_v1->unk20; - temp_f14_3 = temp_v1->unk24; - temp_f16_2 = temp_v1->unk28; + temp_f2_4 = temp_v1->height; + temp_f12_3 = temp_v1->gravity; + temp_f14_3 = temp_v1->rotation; + temp_f16_2 = temp_v1->height2; temp_f0_5 = (temp_f2_4 * arg2) + (temp_f12_3 * arg3) + (temp_f14_3 * arg4) + temp_f16_2; - if ((temp_v1->unk0 & 0x200) != 0) { + if (temp_v1->flags & 0x200) { temp_f10_2 = (temp_f2_4 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; sp44 = temp_f10_2; - if ((phi_f18 < temp_f0_5) && (phi_f18 < temp_f10_2)) { + if ((temp_f0_5 > 0.0f) && (temp_f10_2 > 0.0f)) { if (temp_f0_5 < arg1) { - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = temp_f0_5 - arg1; - arg0->unk24 = temp_v1->unk1C; - arg0->unk28 = temp_v1->unk20; - arg0->unk2C = temp_v1->unk24; + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5 - arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; return 1; } return 0; } - if ((temp_f0_5 < phi_f18) && (sp44 < phi_f18)) { + if ((temp_f0_5 < 0.0f) && (sp44 < 0.0f)) { temp_f0_6 = temp_f0_5 * -1.0f; if (temp_f0_6 < arg1) { - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = temp_f0_6 - arg1; - arg0->unk24 = -temp_v1->unk1C; - arg0->unk28 = -temp_v1->unk20; - arg0->unk2C = -temp_v1->unk24; + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_6 - arg1; + arg0->unk54[0] = -temp_v1->height; + arg0->unk54[1] = -temp_v1->gravity; + arg0->unk54[2] = -temp_v1->rotation; return 1; } return 0; } - if ((phi_f18 < temp_f0_5) && (sp44 < phi_f18)) { - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = -(temp_f0_5 + arg1); - arg0->unk24 = -temp_v1->unk1C; - arg0->unk28 = -temp_v1->unk20; - phi_f8 = -temp_v1->unk24; - goto block_54; - } - if ((temp_f0_5 < phi_f18) && (phi_f18 < sp44)) { - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = temp_f0_5 + arg1; - arg0->unk24 = temp_v1->unk1C; - arg0->unk28 = temp_v1->unk20; - arg0->unk2C = temp_v1->unk24; + if ((temp_f0_5 > 0.0f) && (sp44 < 0.0f)) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = -(temp_f0_5 + arg1); + arg0->unk54[0] = -temp_v1->height; + arg0->unk54[1] = -temp_v1->gravity; + var_f8 = -temp_v1->rotation; + arg0->unk54[2] = var_f8; return 1; } - if (temp_f0_5 == phi_f18) { - if (phi_f18 <= sp44) { - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = sp44 + arg1; - arg0->unk24 = temp_v1->unk1C; - arg0->unk28 = temp_v1->unk20; - arg0->unk2C = temp_v1->unk24; + if ((temp_f0_5 < 0.0f) && (sp44 > 0.0f)) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5 + arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; + return 1; + } + if (temp_f0_5 == 0.0f) { + if (sp44 >= 0.0f) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = sp44 + arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; return 1; } - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = -(sp44 + arg1); - arg0->unk24 = temp_v1->unk1C; - arg0->unk28 = temp_v1->unk20; - phi_f8 = temp_v1->unk24; - goto block_54; + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = -(sp44 + arg1); + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + var_f8 = temp_v1->rotation; + arg0->unk54[2] = var_f8; + return 1; } return 0; } if (arg1 < temp_f0_5) { - if (temp_f0_5 < arg0->unk10) { - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = temp_f0_5 - arg1; - arg0->unk24 = temp_v1->unk1C; - arg0->unk28 = temp_v1->unk20; - arg0->unk2C = temp_v1->unk24; + if (temp_f0_5 < arg0->unk3C[1]) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5 - arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; } return 0; } temp_f4 = (temp_f2_4 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; sp44 = temp_f4; - if (temp_f4 < phi_f18) { + if (temp_f4 < 0.0f) { return 0; } - arg0->unk2 = 1; - arg0->unk8 = arg5; - arg0->unk10 = temp_f0_5 - arg1; - arg0->unk24 = temp_v1->unk1C; - arg0->unk28 = temp_v1->unk20; - phi_f8 = temp_v1->unk24; -block_54: - arg0->unk2C = phi_f8; + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5 - arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + var_f8 = temp_v1->rotation; + arg0->unk54[2] = var_f8; return 1; } #else @@ -3355,14 +3310,12 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802AE1C0.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c extern s32 D_8015F59C; extern s32 D_8015F5A0; extern s32 D_8015F5A4; extern s16 D_8015F6E8; extern s16 D_8015F6EA; -extern s16 D_8015F6EC; -extern s16 D_8015F6EE; extern s16 D_8015F6F0; extern s16 D_8015F6F2; extern s16 D_8015F6FA; @@ -3405,35 +3358,31 @@ void func_802AE434(Vtx *arg0, Vtx *arg1, Vtx *arg2, s8 arg3, u16 arg4) { f64 temp_f4; f64 temp_f8; mk64_surface_map_ram *temp_t0; - s16 temp_a0; - s16 temp_a1; - s16 temp_t3; - s16 temp_t4; - s32 temp_a0_2; - s32 temp_a1_2; + s16 var_a0; + s16 var_a1; + s16 var_a2; + s16 var_a3; + s16 var_t1; + s16 var_t2; + s16 var_t3; + s16 var_t4; + s16 var_t5; + s16 var_v0; + s16 var_v1; + s32 temp_a0; + s32 temp_a1; s32 temp_a2; s32 temp_a3; s32 temp_v0; s32 temp_v1; - u16 temp_a0_3; + u16 temp_a0_2; u16 temp_a3_2; u16 temp_v1_2; - s32 phi_a0; - s32 phi_t3; - s32 phi_t5; - s32 phi_a1; - s32 phi_t4; - s32 phi_v1; - s32 phi_a2; - s32 phi_a3; - s32 phi_v0; - s16 phi_t1; - s16 phi_t2; - u16 phi_a1_2; - u16 phi_t9; - u16 phi_t8; + u16 var_a1_2; + u16 var_t8; + u16 var_t9; - temp_t0 = &(*D_8015F580)[D_8015F588]; + temp_t0 = &D_8015F580[D_8015F588]; temp_t0->vtxs[0] = arg0; temp_t0->vtxs[1] = arg1; temp_t0->vtxs[2] = arg2; @@ -3442,151 +3391,148 @@ void func_802AE434(Vtx *arg0, Vtx *arg1, Vtx *arg2, s8 arg3, u16 arg4) { sp1C = temp_t6; temp_t1 = temp_t0->vtxs[1]; temp_t2 = temp_t0->vtxs[2]; - temp_a0 = temp_t6->v.ob[0]; - temp_t3 = temp_t1->v.ob[0]; - temp_a1 = temp_t6->v.ob[2]; - temp_t4 = temp_t1->v.ob[2]; - phi_a0 = (s32) temp_a0; - phi_t3 = (s32) temp_t3; - phi_t5 = (s32) temp_t2->v.ob[0]; - phi_a1 = (s32) temp_a1; - phi_t4 = (s32) temp_t4; - phi_v1 = (s32) temp_t2->v.ob[2]; - phi_a2 = (s32) temp_t6->v.ob[1]; - phi_a3 = (s32) temp_t1->v.ob[1]; - phi_v0 = (s32) temp_t2->v.ob[1]; - if ((temp_a0 == temp_t3) && (temp_a1 == temp_t4)) { + var_a0 = temp_t6->v.ob[0]; + var_t3 = temp_t1->v.ob[0]; + var_a2 = temp_t6->v.ob[1]; + var_a1 = temp_t6->v.ob[2]; + var_a3 = temp_t1->v.ob[1]; + var_t4 = temp_t1->v.ob[2]; + var_t5 = temp_t2->v.ob[0]; + var_v0 = temp_t2->v.ob[1]; + var_v1 = temp_t2->v.ob[2]; + if ((var_a0 == var_t3) && (var_a1 == var_t4)) { temp_t0->vtxs[2] = arg1; temp_t0->vtxs[1] = arg2; - phi_a0 = (s32) arg0->v.ob[0]; - phi_t3 = (s32) arg1->v.ob[0]; - phi_t5 = (s32) arg2->v.ob[0]; - phi_a1 = (s32) arg0->v.ob[2]; - phi_t4 = (s32) arg1->v.ob[2]; - phi_v1 = (s32) arg2->v.ob[2]; - phi_a2 = (s32) arg0->v.ob[1]; - phi_a3 = (s32) arg1->v.ob[1]; - phi_v0 = (s32) arg2->v.ob[1]; + var_a0 = arg0->v.ob[0]; + var_a2 = arg0->v.ob[1]; + var_a1 = arg0->v.ob[2]; + var_t3 = arg1->v.ob[0]; + var_a3 = arg1->v.ob[1]; + var_t4 = arg1->v.ob[2]; + var_t5 = arg2->v.ob[0]; + var_v0 = arg2->v.ob[1]; + var_v1 = arg2->v.ob[2]; } - if (phi_a0 >= phi_t3) { - if (phi_a0 >= phi_t5) { - sp4A = (s16) phi_a0; + if (var_a0 >= var_t3) { + if (var_a0 >= var_t5) { + sp4A = var_a0; } else { goto block_12; } - } else if (phi_t3 >= phi_t5) { - sp4A = (s16) phi_t3; + } else if (var_t3 >= var_t5) { + sp4A = var_t3; } else { block_12: - sp4A = (s16) phi_t5; + sp4A = var_t5; } - if (phi_a1 >= phi_t4) { - if (phi_a1 >= phi_v1) { - sp48 = (s16) phi_a1; + if (var_a1 >= var_t4) { + if (var_a1 >= var_v1) { + sp48 = var_a1; } else { goto block_19; } - } else if (phi_t4 >= phi_v1) { - sp48 = (s16) phi_t4; + } else if (var_t4 >= var_v1) { + sp48 = var_t4; } else { block_19: - sp48 = (s16) phi_v1; + sp48 = var_v1; } - if (phi_a2 >= phi_a3) { - if (phi_a2 >= phi_v0) { - sp42 = (s16) phi_a2; + if (var_a2 >= var_a3) { + if (var_a2 >= var_v0) { + sp42 = var_a2; } else { goto block_26; } - } else if (phi_a3 >= phi_v0) { - sp42 = (s16) phi_a3; + } else if (var_a3 >= var_v0) { + sp42 = var_a3; } else { block_26: - sp42 = (s16) phi_v0; + sp42 = var_v0; } - if (phi_t3 >= phi_a0) { - if (phi_t5 >= phi_a0) { - sp44 = (s16) phi_a0; + if (var_t3 >= var_a0) { + if (var_t5 >= var_a0) { + sp44 = var_a0; } else { goto block_33; } - } else if (phi_t5 >= phi_t3) { - sp44 = (s16) phi_t3; + } else if (var_t5 >= var_t3) { + sp44 = var_t3; } else { block_33: - sp44 = (s16) phi_t5; + sp44 = var_t5; } - if (phi_a3 >= phi_a2) { - if (phi_v0 >= phi_a2) { - phi_t2 = (s16) phi_a2; + if (var_a3 >= var_a2) { + if (var_v0 >= var_a2) { + var_t2 = var_a2; } else { - phi_t2 = (s16) phi_v0; + var_t2 = var_v0; } - } else if (phi_v0 >= phi_a3) { - phi_t2 = (s16) phi_a3; + } else if (var_v0 >= var_a3) { + var_t2 = var_a3; } else { - phi_t2 = (s16) phi_v0; + var_t2 = var_v0; } - if (phi_t4 >= phi_a1) { - if (phi_v1 >= phi_a1) { - phi_t1 = (s16) phi_a1; + if (var_t4 >= var_a1) { + if (var_v1 >= var_a1) { + var_t1 = var_a1; } else { - phi_t1 = (s16) phi_v1; + var_t1 = var_v1; } - } else if (phi_v1 >= phi_t4) { - phi_t1 = (s16) phi_t4; + } else if (var_v1 >= var_t4) { + var_t1 = var_t4; } else { - phi_t1 = (s16) phi_v1; + var_t1 = var_v1; } - spAA = (s16) phi_v1; - spB8 = (s16) phi_a2; - spB2 = (s16) phi_a3; - spAC = (s16) phi_v0; + spAA = var_v1; + spB8 = var_a2; + spB2 = var_a3; + spAC = var_v0; temp_v0 = spB2 - spB8; - temp_v1 = spAA - phi_t4; - spB6 = (s16) phi_a1; - spBA = (s16) phi_a0; - temp_a0_2 = phi_t4 - spB6; - temp_a1_2 = spAC - spB2; - temp_a2 = phi_t5 - phi_t3; - temp_a3 = phi_t3 - spBA; - temp_f12 = (f64) ((temp_v0 * temp_v1) - (temp_a0_2 * temp_a1_2)); + temp_v1 = spAA - var_t4; + spB6 = var_a1; + spBA = var_a0; + temp_a0 = var_t4 - spB6; + temp_a1 = spAC - spB2; + temp_a2 = var_t5 - var_t3; + temp_a3 = var_t3 - spBA; + temp_f12 = (f64) ((temp_v0 * temp_v1) - (temp_a0 * temp_a1)); temp_f18 = temp_f12 * temp_f12; sp10 = temp_f18; - temp_f14 = (f64) ((temp_a0_2 * temp_a2) - (temp_a3 * temp_v1)); + temp_f14 = (f64) ((temp_a0 * temp_a2) - (temp_a3 * temp_v1)); temp_f8 = temp_f14 * temp_f14; sp8 = temp_f8; - temp_f16 = (f64) ((temp_a3 * temp_a1_2) - (temp_v0 * temp_a2)); + temp_f16 = (f64) ((temp_a3 * temp_a1) - (temp_v0 * temp_a2)); temp_f4 = temp_f16 * temp_f16; sp0 = temp_f4; temp_f2 = (f64) sqrtf((f32) (temp_f18 + temp_f8 + temp_f4)); if ((temp_f2 != 0.0) && ((temp_f0 = (f32) ((f64) (f32) temp_f12 / temp_f2), sp58 = temp_f0, temp_f4_2 = (f32) ((f64) (f32) temp_f14 / temp_f2), sp1C = temp_f4_2, sp54 = temp_f4_2, temp_f18_2 = (f32) ((f64) (f32) temp_f16 / temp_f2), sp50 = temp_f18_2, sp4C = -(((f32) spBA * temp_f0) + (temp_f4_2 * (f32) spB8) + (temp_f18_2 * (f32) spB6)), (D_8015F59C == 0)) || (!(temp_f4_2 < D_802B9E64) && !(D_802B9E68 < temp_f4_2))) && ((D_8015F5A0 == 0) || !(sp1C < D_802B9E6C) || !(D_802B9E70 < sp1C))) { temp_t0->vtx2[0] = sp4A; - temp_t0->vtx3[2] = phi_t1; - temp_t0->vtx3[1] = phi_t2; + temp_t0->vtx3[2] = var_t1; + temp_t0->vtx3[1] = var_t2; temp_t0->vtx3[0] = sp44; temp_t0->vtx2[1] = sp42; temp_t0->vtx2[2] = sp48; - if ((s32) sp44 < (s32) D_8015F6EA) { + if (sp44 < D_8015F6EA) { D_8015F6EA = sp44; } - if ((s32) phi_t2 < (s32) D_8015F6EE) { - D_8015F6EE = phi_t2; + if (var_t2 < D_8015F6EE) { + D_8015F6EE = var_t2; } - if ((s32) phi_t1 < (s32) D_8015F6F2) { - D_8015F6F2 = phi_t1; + if (var_t1 < D_8015F6F2) { + D_8015F6F2 = var_t1; } - if ((s32) D_8015F6E8 < (s32) sp4A) { + if (D_8015F6E8 < sp4A) { D_8015F6E8 = sp4A; } - if ((s32) D_8015F6EC < (s32) sp42) { + if (D_8015F6EC < sp42) { D_8015F6EC = sp42; } - if ((s32) D_8015F6F0 < (s32) sp48) { + if (D_8015F6F0 < sp48) { D_8015F6F0 = sp48; } temp_t0->height = sp58; temp_t0->gravity = sp54; + var_a1_2 = arg4; temp_t0->rotation = sp50; temp_t0->height2 = sp4C; temp_t0->surfaceType = (u16) arg3; @@ -3594,24 +3540,23 @@ block_33: D_8015F6FC = 0; temp_a3_2 = temp_t0->vtxs[0]->v.flag; temp_v1_2 = temp_t0->vtxs[1]->v.flag; - temp_a0_3 = temp_t0->vtxs[2]->v.flag; - phi_a1_2 = arg4; - if ((temp_a3_2 == 1) && (temp_v1_2 == 1) && (temp_a0_3 == 1)) { - phi_t8 = (arg4 | 0x400) & 0xFFFF; + temp_a0_2 = temp_t0->vtxs[2]->v.flag; + if ((temp_a3_2 == 1) && (temp_v1_2 == 1) && (temp_a0_2 == 1)) { + var_t8 = (arg4 | 0x400) & 0xFFFF; goto block_81; } - if ((temp_a3_2 == 2) && (temp_v1_2 == 2) && (temp_a0_3 == 2)) { - phi_a1_2 = (arg4 | 0x800) & 0xFFFF; - } else if ((temp_a3_2 == 3) && (temp_v1_2 == 3) && (temp_a0_3 == 3)) { - phi_a1_2 = (arg4 | 0x1000) & 0xFFFF; + if ((temp_a3_2 == 2) && (temp_v1_2 == 2) && (temp_a0_2 == 2)) { + var_a1_2 = (arg4 | 0x800) & 0xFFFF; + } else if ((temp_a3_2 == 3) && (temp_v1_2 == 3) && (temp_a0_2 == 3)) { + var_a1_2 = (arg4 | 0x1000) & 0xFFFF; } else if (D_8015F5A4 != 0) { - phi_t8 = (arg4 | 0x200) & 0xFFFF; + var_t8 = (arg4 | 0x200) & 0xFFFF; block_81: - phi_a1_2 = phi_t8; + var_a1_2 = var_t8; } - temp_t0->flags = phi_a1_2; + temp_t0->flags = var_a1_2; if (sp10 <= sp8) { - phi_t9 = phi_a1_2 | 0x4000; + var_t9 = var_a1_2 | 0x4000; if (sp0 <= sp8) { goto block_89; } @@ -3619,11 +3564,11 @@ block_81: if ((sp8 < sp10) && (sp0 <= sp10)) { temp_t0->flags |= 0x8000; } else { - phi_t9 = temp_t0->flags | 0x2000; + var_t9 = temp_t0->flags | 0x2000; block_89: - temp_t0->flags = phi_t9; + temp_t0->flags = var_t9; } - D_8015F588 = D_8015F588 + 1; + D_8015F588 += 1; } } } @@ -3761,23 +3706,13 @@ block_5: GLOBAL_ASM("asm/non_matchings/memory/func_802AED6C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 s32 func_802AEE1C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7) { f32 temp_f0; - f32 temp_f0_2; - f32 temp_f12; - f32 temp_f12_2; - f32 temp_f14; - f32 temp_f14_2; - f32 temp_f16; - f32 temp_f16_2; f32 temp_f18; - f32 temp_f18_2; - f32 temp_f18_3; f32 temp_f2; temp_f0 = arg6 - arg4; + temp_f2 = arg7 - arg5; if (temp_f0 == 0.0f) { if (arg4 < arg0) { return 0; @@ -3785,67 +3720,49 @@ s32 func_802AEE1C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s1 if (arg1 < arg4) { return 0; } - if ((arg7 - arg5) > 0.0f) { + if (temp_f2 > 0.0f) { if ((arg5 < arg2) && (arg3 < arg7)) { return 1; } - // Duplicate return node #36. Try simplifying control flow for better match - return 0; - } - if ((arg7 < arg2) && (arg3 < arg5)) { + } else if ((arg7 < arg2) && (arg3 < arg5)) { return 1; } - // Duplicate return node #36. Try simplifying control flow for better match - return 0; - } - temp_f2 = arg7 - arg5; - if (temp_f2 == 0.0f) { - if (arg5 < arg2) { - return 0; - } - if (arg3 < arg5) { - return 0; - } - if (temp_f0 > 0.0f) { - if ((arg4 < arg0) && (arg1 < arg6)) { + } else { + if (temp_f2 == 0.0f) { + if (arg5 < arg2) { + return 0; + } + if (arg3 < arg5) { + return 0; + } + if (temp_f0 > 0.0f) { + if ((arg4 < arg0) && (arg1 < arg6)) { + return 1; + } + } else if ((arg6 < arg0) && (arg1 < arg4)) { + return 1; + } + } else { + temp_f18 = ((temp_f0 / temp_f2) * (arg2 - arg5)) + arg4; + if ((arg0 <= temp_f18) && (temp_f18 <= arg1)) { + return 1; + } + temp_f18 = ((temp_f0 / temp_f2) * (arg3 - arg5)) + arg4; + if ((arg0 <= temp_f18) && (temp_f18 <= arg1)) { + return 1; + } + temp_f18 = ((temp_f2 / temp_f0) * (arg0 - arg4)) + arg5; + if ((arg2 <= temp_f18) && (temp_f18 <= arg3)) { + return 1; + } + temp_f18 = ((temp_f2 / temp_f0) * (arg1 - arg4)) + arg5; + if ((arg2 <= temp_f18) && (temp_f18 <= arg3)) { return 1; } - // Duplicate return node #36. Try simplifying control flow for better match - return 0; } - if ((arg6 < arg0) && (arg1 < arg4)) { - return 1; - } - // Duplicate return node #36. Try simplifying control flow for better match - return 0; - } - temp_f16 = temp_f0 / temp_f2; - temp_f12 = arg4; - temp_f14 = arg0; - temp_f18 = (temp_f16 * (arg2 - arg5)) + temp_f12; - if ((temp_f14 <= temp_f18) && (temp_f18 <= arg1)) { - return 1; - } - temp_f18_2 = (temp_f16 * (arg3 - arg5)) + temp_f12; - if ((temp_f14 <= temp_f18_2) && (temp_f18_2 <= arg1)) { - return 1; - } - temp_f16_2 = temp_f2 / temp_f0; - temp_f12_2 = arg5; - temp_f14_2 = arg2; - temp_f18_3 = (temp_f16_2 * (arg0 - arg4)) + temp_f12_2; - if ((temp_f14_2 <= temp_f18_3) && (temp_f18_3 <= arg3)) { - return 1; - } - temp_f0_2 = (temp_f16_2 * (arg1 - arg4)) + temp_f12_2; - if ((temp_f14_2 <= temp_f0_2) && (temp_f0_2 <= arg3)) { - return 1; } return 0; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AEE1C.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda diff --git a/src/memory.h b/src/memory.h index 04597e7bf..ae89464bc 100644 --- a/src/memory.h +++ b/src/memory.h @@ -99,8 +99,9 @@ void process_shell_collision(Vec3f, f32, Vec3f, f32); void func_802AC098(UnkActorInner*, f32*); void func_802AC114(Vec3f, f32, Vec3f, f32); void func_802AD950(UnkActorInner*, f32, f32, f32, f32, f32, f32, f32); -void func_802ADDC8(UnkActorInner*, f32, f32, f32, f32); +s32 func_802ADDC8(UnkActorInner*, f32, f32, f32, f32); f32 func_802AE1C0(f32, f32, f32); +s32 func_802AEE1C(s16, s16, s16, s16, s16, s16, s16, s16); void func_802AF314(); void func_802AF588(s32); void func_802AF5AC(s32, s8);