diff --git a/asm/non_matchings/code_8001F980/func_8001FB0C.s b/asm/non_matchings/code_8001F980/func_8001FB0C.s deleted file mode 100644 index 2f424bb96..000000000 --- a/asm/non_matchings/code_8001F980/func_8001FB0C.s +++ /dev/null @@ -1,165 +0,0 @@ -glabel func_8001FB0C -/* 02070C 8001FB0C 27BDFF80 */ addiu $sp, $sp, -0x80 -/* 020710 8001FB10 3C02800E */ lui $v0, %hi(gActiveScreenMode) # $v0, 0x800e -/* 020714 8001FB14 8C42C52C */ lw $v0, %lo(gActiveScreenMode)($v0) -/* 020718 8001FB18 AFB00018 */ sw $s0, 0x18($sp) -/* 02071C 8001FB1C 00A08025 */ move $s0, $a1 -/* 020720 8001FB20 AFBF001C */ sw $ra, 0x1c($sp) -/* 020724 8001FB24 AFA40080 */ sw $a0, 0x80($sp) -/* 020728 8001FB28 AFA60088 */ sw $a2, 0x88($sp) -/* 02072C 8001FB2C AFA7008C */ sw $a3, 0x8c($sp) -/* 020730 8001FB30 1040000A */ beqz $v0, .L8001FB5C -/* 020734 8001FB34 A7A00040 */ sh $zero, 0x40($sp) -/* 020738 8001FB38 24010001 */ li $at, 1 -/* 02073C 8001FB3C 10410009 */ beq $v0, $at, .L8001FB64 -/* 020740 8001FB40 24010002 */ li $at, 2 -/* 020744 8001FB44 10410007 */ beq $v0, $at, .L8001FB64 -/* 020748 8001FB48 24010003 */ li $at, 3 -/* 02074C 8001FB4C 10410007 */ beq $v0, $at, .L8001FB6C -/* 020750 8001FB50 00000000 */ nop -/* 020754 8001FB54 10000007 */ b .L8001FB74 -/* 020758 8001FB58 24021FFE */ li $v0, 8190 -.L8001FB5C: -/* 02075C 8001FB5C 10000005 */ b .L8001FB74 -/* 020760 8001FB60 2402293C */ li $v0, 10556 -.L8001FB64: -/* 020764 8001FB64 10000003 */ b .L8001FB74 -/* 020768 8001FB68 24023058 */ li $v0, 12376 -.L8001FB6C: -/* 02076C 8001FB6C 10000001 */ b .L8001FB74 -/* 020770 8001FB70 24021FFE */ li $v0, 8190 -.L8001FB74: -/* 020774 8001FB74 860E0026 */ lh $t6, 0x26($s0) -/* 020778 8001FB78 A7A20042 */ sh $v0, 0x42($sp) -/* 02077C 8001FB7C 01C22023 */ subu $a0, $t6, $v0 -/* 020780 8001FB80 308FFFFF */ andi $t7, $a0, 0xffff -/* 020784 8001FB84 0C0AE00E */ jal coss -/* 020788 8001FB88 01E02025 */ move $a0, $t7 -/* 02078C 8001FB8C C7A60088 */ lwc1 $f6, 0x88($sp) -/* 020790 8001FB90 C6040008 */ lwc1 $f4, 8($s0) -/* 020794 8001FB94 87A20042 */ lh $v0, 0x42($sp) -/* 020798 8001FB98 46003202 */ mul.s $f8, $f6, $f0 -/* 02079C 8001FB9C 46082280 */ add.s $f10, $f4, $f8 -/* 0207A0 8001FBA0 E7AA004C */ swc1 $f10, 0x4c($sp) -/* 0207A4 8001FBA4 86180026 */ lh $t8, 0x26($s0) -/* 0207A8 8001FBA8 03022023 */ subu $a0, $t8, $v0 -/* 0207AC 8001FBAC 3099FFFF */ andi $t9, $a0, 0xffff -/* 0207B0 8001FBB0 0C0AE006 */ jal sins -/* 0207B4 8001FBB4 03202025 */ move $a0, $t9 -/* 0207B8 8001FBB8 C7A40088 */ lwc1 $f4, 0x88($sp) -/* 0207BC 8001FBBC C6060000 */ lwc1 $f6, ($s0) -/* 0207C0 8001FBC0 87A20042 */ lh $v0, 0x42($sp) -/* 0207C4 8001FBC4 46002202 */ mul.s $f8, $f4, $f0 -/* 0207C8 8001FBC8 46083280 */ add.s $f10, $f6, $f8 -/* 0207CC 8001FBCC E7AA0058 */ swc1 $f10, 0x58($sp) -/* 0207D0 8001FBD0 86080026 */ lh $t0, 0x26($s0) -/* 0207D4 8001FBD4 01022021 */ addu $a0, $t0, $v0 -/* 0207D8 8001FBD8 3089FFFF */ andi $t1, $a0, 0xffff -/* 0207DC 8001FBDC 0C0AE00E */ jal coss -/* 0207E0 8001FBE0 01202025 */ move $a0, $t1 -/* 0207E4 8001FBE4 C7A60088 */ lwc1 $f6, 0x88($sp) -/* 0207E8 8001FBE8 C6040008 */ lwc1 $f4, 8($s0) -/* 0207EC 8001FBEC 87A20042 */ lh $v0, 0x42($sp) -/* 0207F0 8001FBF0 46003202 */ mul.s $f8, $f6, $f0 -/* 0207F4 8001FBF4 46082280 */ add.s $f10, $f4, $f8 -/* 0207F8 8001FBF8 E7AA0048 */ swc1 $f10, 0x48($sp) -/* 0207FC 8001FBFC 860A0026 */ lh $t2, 0x26($s0) -/* 020800 8001FC00 01422021 */ addu $a0, $t2, $v0 -/* 020804 8001FC04 308BFFFF */ andi $t3, $a0, 0xffff -/* 020808 8001FC08 0C0AE006 */ jal sins -/* 02080C 8001FC0C 01602025 */ move $a0, $t3 -/* 020810 8001FC10 C7A40088 */ lwc1 $f4, 0x88($sp) -/* 020814 8001FC14 C6060000 */ lwc1 $f6, ($s0) -/* 020818 8001FC18 46002202 */ mul.s $f8, $f4, $f0 -/* 02081C 8001FC1C 46083280 */ add.s $f10, $f6, $f8 -/* 020820 8001FC20 E7AA0054 */ swc1 $f10, 0x54($sp) -/* 020824 8001FC24 86040026 */ lh $a0, 0x26($s0) -/* 020828 8001FC28 24845FFA */ addiu $a0, $a0, 0x5ffa -/* 02082C 8001FC2C 308CFFFF */ andi $t4, $a0, 0xffff -/* 020830 8001FC30 0C0AE00E */ jal coss -/* 020834 8001FC34 01802025 */ move $a0, $t4 -/* 020838 8001FC38 C7A6008C */ lwc1 $f6, 0x8c($sp) -/* 02083C 8001FC3C C6040008 */ lwc1 $f4, 8($s0) -/* 020840 8001FC40 46003202 */ mul.s $f8, $f6, $f0 -/* 020844 8001FC44 46082280 */ add.s $f10, $f4, $f8 -/* 020848 8001FC48 E7AA0044 */ swc1 $f10, 0x44($sp) -/* 02084C 8001FC4C 86040026 */ lh $a0, 0x26($s0) -/* 020850 8001FC50 24845FFA */ addiu $a0, $a0, 0x5ffa -/* 020854 8001FC54 308DFFFF */ andi $t5, $a0, 0xffff -/* 020858 8001FC58 0C0AE006 */ jal sins -/* 02085C 8001FC5C 01A02025 */ move $a0, $t5 -/* 020860 8001FC60 C7A4008C */ lwc1 $f4, 0x8c($sp) -/* 020864 8001FC64 C6060000 */ lwc1 $f6, ($s0) -/* 020868 8001FC68 8FA20080 */ lw $v0, 0x80($sp) -/* 02086C 8001FC6C 46002202 */ mul.s $f8, $f4, $f0 -/* 020870 8001FC70 C7A4004C */ lwc1 $f4, 0x4c($sp) -/* 020874 8001FC74 44800000 */ mtc1 $zero, $f0 -/* 020878 8001FC78 46083280 */ add.s $f10, $f6, $f8 -/* 02087C 8001FC7C C7A60054 */ lwc1 $f6, 0x54($sp) -/* 020880 8001FC80 C7A80058 */ lwc1 $f8, 0x58($sp) -/* 020884 8001FC84 E7AA0050 */ swc1 $f10, 0x50($sp) -/* 020888 8001FC88 C44C0014 */ lwc1 $f12, 0x14($v0) -/* 02088C 8001FC8C C442001C */ lwc1 $f2, 0x1c($v0) -/* 020890 8001FC90 C7AA0048 */ lwc1 $f10, 0x48($sp) -/* 020894 8001FC94 460C3401 */ sub.s $f16, $f6, $f12 -/* 020898 8001FC98 46022381 */ sub.s $f14, $f4, $f2 -/* 02089C 8001FC9C 460C4481 */ sub.s $f18, $f8, $f12 -/* 0208A0 8001FCA0 46107182 */ mul.s $f6, $f14, $f16 -/* 0208A4 8001FCA4 46025101 */ sub.s $f4, $f10, $f2 -/* 0208A8 8001FCA8 46049202 */ mul.s $f8, $f18, $f4 -/* 0208AC 8001FCAC E7A40020 */ swc1 $f4, 0x20($sp) -/* 0208B0 8001FCB0 46083281 */ sub.s $f10, $f6, $f8 -/* 0208B4 8001FCB4 C7A60050 */ lwc1 $f6, 0x50($sp) -/* 0208B8 8001FCB8 460C3201 */ sub.s $f8, $f6, $f12 -/* 0208BC 8001FCBC C7A60044 */ lwc1 $f6, 0x44($sp) -/* 0208C0 8001FCC0 E7AA0064 */ swc1 $f10, 0x64($sp) -/* 0208C4 8001FCC4 460A003E */ c.le.s $f0, $f10 -/* 0208C8 8001FCC8 E7A8002C */ swc1 $f8, 0x2c($sp) -/* 0208CC 8001FCCC 46023181 */ sub.s $f6, $f6, $f2 -/* 0208D0 8001FCD0 E7A60034 */ swc1 $f6, 0x34($sp) -/* 0208D4 8001FCD4 46082182 */ mul.s $f6, $f4, $f8 -/* 0208D8 8001FCD8 C7A40034 */ lwc1 $f4, 0x34($sp) -/* 0208DC 8001FCDC 46048102 */ mul.s $f4, $f16, $f4 -/* 0208E0 8001FCE0 46043181 */ sub.s $f6, $f6, $f4 -/* 0208E4 8001FCE4 C7A40034 */ lwc1 $f4, 0x34($sp) -/* 0208E8 8001FCE8 E7A60060 */ swc1 $f6, 0x60($sp) -/* 0208EC 8001FCEC 46122182 */ mul.s $f6, $f4, $f18 -/* 0208F0 8001FCF0 00000000 */ nop -/* 0208F4 8001FCF4 460E4102 */ mul.s $f4, $f8, $f14 -/* 0208F8 8001FCF8 46043201 */ sub.s $f8, $f6, $f4 -/* 0208FC 8001FCFC C7A60060 */ lwc1 $f6, 0x60($sp) -/* 020900 8001FD00 45000009 */ bc1f .L8001FD28 -/* 020904 8001FD04 E7A8005C */ swc1 $f8, 0x5c($sp) -/* 020908 8001FD08 4606003E */ c.le.s $f0, $f6 -/* 02090C 8001FD0C C7A4005C */ lwc1 $f4, 0x5c($sp) -/* 020910 8001FD10 45020006 */ bc1fl .L8001FD2C -/* 020914 8001FD14 C7A80064 */ lwc1 $f8, 0x64($sp) -/* 020918 8001FD18 4604003E */ c.le.s $f0, $f4 -/* 02091C 8001FD1C 00000000 */ nop -/* 020920 8001FD20 4503000F */ bc1tl .L8001FD60 -/* 020924 8001FD24 240E0001 */ li $t6, 1 -.L8001FD28: -/* 020928 8001FD28 C7A80064 */ lwc1 $f8, 0x64($sp) -.L8001FD2C: -/* 02092C 8001FD2C C7AA0060 */ lwc1 $f10, 0x60($sp) -/* 020930 8001FD30 4600403E */ c.le.s $f8, $f0 -/* 020934 8001FD34 00000000 */ nop -/* 020938 8001FD38 4502000B */ bc1fl .L8001FD68 -/* 02093C 8001FD3C 8FBF001C */ lw $ra, 0x1c($sp) -/* 020940 8001FD40 4600503E */ c.le.s $f10, $f0 -/* 020944 8001FD44 C7A6005C */ lwc1 $f6, 0x5c($sp) -/* 020948 8001FD48 45020007 */ bc1fl .L8001FD68 -/* 02094C 8001FD4C 8FBF001C */ lw $ra, 0x1c($sp) -/* 020950 8001FD50 4600303E */ c.le.s $f6, $f0 -/* 020954 8001FD54 00000000 */ nop -/* 020958 8001FD58 45000002 */ bc1f .L8001FD64 -/* 02095C 8001FD5C 240E0001 */ li $t6, 1 -.L8001FD60: -/* 020960 8001FD60 A7AE0040 */ sh $t6, 0x40($sp) -.L8001FD64: -/* 020964 8001FD64 8FBF001C */ lw $ra, 0x1c($sp) -.L8001FD68: -/* 020968 8001FD68 97A20040 */ lhu $v0, 0x40($sp) -/* 02096C 8001FD6C 8FB00018 */ lw $s0, 0x18($sp) -/* 020970 8001FD70 03E00008 */ jr $ra -/* 020974 8001FD74 27BD0080 */ addiu $sp, $sp, 0x80 diff --git a/asm/non_matchings/code_8001F980/func_8001FD78.s b/asm/non_matchings/code_8001F980/func_8001FD78.s deleted file mode 100644 index ac1d3c434..000000000 --- a/asm/non_matchings/code_8001F980/func_8001FD78.s +++ /dev/null @@ -1,168 +0,0 @@ -glabel func_8001FD78 -/* 020978 8001FD78 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 02097C 8001FD7C AFBF001C */ sw $ra, 0x1c($sp) -/* 020980 8001FD80 AFB00018 */ sw $s0, 0x18($sp) -/* 020984 8001FD84 AFA5006C */ sw $a1, 0x6c($sp) -/* 020988 8001FD88 AFA60070 */ sw $a2, 0x70($sp) -/* 02098C 8001FD8C AFA70074 */ sw $a3, 0x74($sp) -/* 020990 8001FD90 A7A00042 */ sh $zero, 0x42($sp) -/* 020994 8001FD94 848E002E */ lh $t6, 0x2e($a0) -/* 020998 8001FD98 848D00C0 */ lh $t5, 0xc0($a0) -/* 02099C 8001FD9C 00808025 */ move $s0, $a0 -/* 0209A0 8001FDA0 01AE2023 */ subu $a0, $t5, $t6 -/* 0209A4 8001FDA4 2484F8E4 */ addiu $a0, $a0, -0x71c -/* 0209A8 8001FDA8 308FFFFF */ andi $t7, $a0, 0xffff -/* 0209AC 8001FDAC 0C0AE00E */ jal coss -/* 0209B0 8001FDB0 01E02025 */ move $a0, $t7 -/* 0209B4 8001FDB4 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0209B8 8001FDB8 44815000 */ mtc1 $at, $f10 -/* 0209BC 8001FDBC C604001C */ lwc1 $f4, 0x1c($s0) -/* 0209C0 8001FDC0 46005182 */ mul.s $f6, $f10, $f0 -/* 0209C4 8001FDC4 46062200 */ add.s $f8, $f4, $f6 -/* 0209C8 8001FDC8 E7A80058 */ swc1 $f8, 0x58($sp) -/* 0209CC 8001FDCC 8619002E */ lh $t9, 0x2e($s0) -/* 0209D0 8001FDD0 861800C0 */ lh $t8, 0xc0($s0) -/* 0209D4 8001FDD4 03192023 */ subu $a0, $t8, $t9 -/* 0209D8 8001FDD8 2484F8E4 */ addiu $a0, $a0, -0x71c -/* 0209DC 8001FDDC 3088FFFF */ andi $t0, $a0, 0xffff -/* 0209E0 8001FDE0 0C0AE006 */ jal sins -/* 0209E4 8001FDE4 01002025 */ move $a0, $t0 -/* 0209E8 8001FDE8 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0209EC 8001FDEC 44812000 */ mtc1 $at, $f4 -/* 0209F0 8001FDF0 C60A0014 */ lwc1 $f10, 0x14($s0) -/* 0209F4 8001FDF4 46002182 */ mul.s $f6, $f4, $f0 -/* 0209F8 8001FDF8 46065200 */ add.s $f8, $f10, $f6 -/* 0209FC 8001FDFC E7A80064 */ swc1 $f8, 0x64($sp) -/* 020A00 8001FE00 860A002E */ lh $t2, 0x2e($s0) -/* 020A04 8001FE04 860900C0 */ lh $t1, 0xc0($s0) -/* 020A08 8001FE08 012A2023 */ subu $a0, $t1, $t2 -/* 020A0C 8001FE0C 2484071C */ addiu $a0, $a0, 0x71c -/* 020A10 8001FE10 308BFFFF */ andi $t3, $a0, 0xffff -/* 020A14 8001FE14 0C0AE00E */ jal coss -/* 020A18 8001FE18 01602025 */ move $a0, $t3 -/* 020A1C 8001FE1C 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 020A20 8001FE20 44815000 */ mtc1 $at, $f10 -/* 020A24 8001FE24 C604001C */ lwc1 $f4, 0x1c($s0) -/* 020A28 8001FE28 46005182 */ mul.s $f6, $f10, $f0 -/* 020A2C 8001FE2C 46062200 */ add.s $f8, $f4, $f6 -/* 020A30 8001FE30 E7A80054 */ swc1 $f8, 0x54($sp) -/* 020A34 8001FE34 860D002E */ lh $t5, 0x2e($s0) -/* 020A38 8001FE38 860C00C0 */ lh $t4, 0xc0($s0) -/* 020A3C 8001FE3C 018D2023 */ subu $a0, $t4, $t5 -/* 020A40 8001FE40 2484071C */ addiu $a0, $a0, 0x71c -/* 020A44 8001FE44 308EFFFF */ andi $t6, $a0, 0xffff -/* 020A48 8001FE48 0C0AE006 */ jal sins -/* 020A4C 8001FE4C 01C02025 */ move $a0, $t6 -/* 020A50 8001FE50 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 020A54 8001FE54 44812000 */ mtc1 $at, $f4 -/* 020A58 8001FE58 C60A0014 */ lwc1 $f10, 0x14($s0) -/* 020A5C 8001FE5C 46002182 */ mul.s $f6, $f4, $f0 -/* 020A60 8001FE60 46065200 */ add.s $f8, $f10, $f6 -/* 020A64 8001FE64 E7A80060 */ swc1 $f8, 0x60($sp) -/* 020A68 8001FE68 8618002E */ lh $t8, 0x2e($s0) -/* 020A6C 8001FE6C 860F00C0 */ lh $t7, 0xc0($s0) -/* 020A70 8001FE70 01F82023 */ subu $a0, $t7, $t8 -/* 020A74 8001FE74 24841C70 */ addiu $a0, $a0, 0x1c70 -/* 020A78 8001FE78 3099FFFF */ andi $t9, $a0, 0xffff -/* 020A7C 8001FE7C 0C0AE00E */ jal coss -/* 020A80 8001FE80 03202025 */ move $a0, $t9 -/* 020A84 8001FE84 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 020A88 8001FE88 44815000 */ mtc1 $at, $f10 -/* 020A8C 8001FE8C C604001C */ lwc1 $f4, 0x1c($s0) -/* 020A90 8001FE90 46005182 */ mul.s $f6, $f10, $f0 -/* 020A94 8001FE94 46062200 */ add.s $f8, $f4, $f6 -/* 020A98 8001FE98 E7A80050 */ swc1 $f8, 0x50($sp) -/* 020A9C 8001FE9C 8609002E */ lh $t1, 0x2e($s0) -/* 020AA0 8001FEA0 860800C0 */ lh $t0, 0xc0($s0) -/* 020AA4 8001FEA4 01092023 */ subu $a0, $t0, $t1 -/* 020AA8 8001FEA8 24841C70 */ addiu $a0, $a0, 0x1c70 -/* 020AAC 8001FEAC 308AFFFF */ andi $t2, $a0, 0xffff -/* 020AB0 8001FEB0 0C0AE006 */ jal sins -/* 020AB4 8001FEB4 01402025 */ move $a0, $t2 -/* 020AB8 8001FEB8 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 020ABC 8001FEBC 44812000 */ mtc1 $at, $f4 -/* 020AC0 8001FEC0 C60A0014 */ lwc1 $f10, 0x14($s0) -/* 020AC4 8001FEC4 44806000 */ mtc1 $zero, $f12 -/* 020AC8 8001FEC8 46002182 */ mul.s $f6, $f4, $f0 -/* 020ACC 8001FECC C7A40058 */ lwc1 $f4, 0x58($sp) -/* 020AD0 8001FED0 46065200 */ add.s $f8, $f10, $f6 -/* 020AD4 8001FED4 C7AA0074 */ lwc1 $f10, 0x74($sp) -/* 020AD8 8001FED8 C7A60060 */ lwc1 $f6, 0x60($sp) -/* 020ADC 8001FEDC E7A8005C */ swc1 $f8, 0x5c($sp) -/* 020AE0 8001FEE0 460A2401 */ sub.s $f16, $f4, $f10 -/* 020AE4 8001FEE4 C7A8006C */ lwc1 $f8, 0x6c($sp) -/* 020AE8 8001FEE8 C7A40054 */ lwc1 $f4, 0x54($sp) -/* 020AEC 8001FEEC E7AA0020 */ swc1 $f10, 0x20($sp) -/* 020AF0 8001FEF0 46083481 */ sub.s $f18, $f6, $f8 -/* 020AF4 8001FEF4 E7A80024 */ swc1 $f8, 0x24($sp) -/* 020AF8 8001FEF8 460A2181 */ sub.s $f6, $f4, $f10 -/* 020AFC 8001FEFC C7A40064 */ lwc1 $f4, 0x64($sp) -/* 020B00 8001FF00 46082101 */ sub.s $f4, $f4, $f8 -/* 020B04 8001FF04 E7A60030 */ swc1 $f6, 0x30($sp) -/* 020B08 8001FF08 46043282 */ mul.s $f10, $f6, $f4 -/* 020B0C 8001FF0C E7A4002C */ swc1 $f4, 0x2c($sp) -/* 020B10 8001FF10 46128202 */ mul.s $f8, $f16, $f18 -/* 020B14 8001FF14 460A4381 */ sub.s $f14, $f8, $f10 -/* 020B18 8001FF18 C7AA0024 */ lwc1 $f10, 0x24($sp) -/* 020B1C 8001FF1C C7A8005C */ lwc1 $f8, 0x5c($sp) -/* 020B20 8001FF20 460E603E */ c.le.s $f12, $f14 -/* 020B24 8001FF24 00000000 */ nop -/* 020B28 8001FF28 45020016 */ bc1fl .L8001FF84 -/* 020B2C 8001FF2C 460C703E */ c.le.s $f14, $f12 -/* 020B30 8001FF30 460A4001 */ sub.s $f0, $f8, $f10 -/* 020B34 8001FF34 C7AA0020 */ lwc1 $f10, 0x20($sp) -/* 020B38 8001FF38 C7A80050 */ lwc1 $f8, 0x50($sp) -/* 020B3C 8001FF3C 460A4081 */ sub.s $f2, $f8, $f10 -/* 020B40 8001FF40 46003202 */ mul.s $f8, $f6, $f0 -/* 020B44 8001FF44 00000000 */ nop -/* 020B48 8001FF48 46121282 */ mul.s $f10, $f2, $f18 -/* 020B4C 8001FF4C 460A4181 */ sub.s $f6, $f8, $f10 -/* 020B50 8001FF50 4606603E */ c.le.s $f12, $f6 -/* 020B54 8001FF54 00000000 */ nop -/* 020B58 8001FF58 45000009 */ bc1f .L8001FF80 -/* 020B5C 8001FF5C 00000000 */ nop -/* 020B60 8001FF60 46041202 */ mul.s $f8, $f2, $f4 -/* 020B64 8001FF64 00000000 */ nop -/* 020B68 8001FF68 46008282 */ mul.s $f10, $f16, $f0 -/* 020B6C 8001FF6C 460A4181 */ sub.s $f6, $f8, $f10 -/* 020B70 8001FF70 4606603E */ c.le.s $f12, $f6 -/* 020B74 8001FF74 00000000 */ nop -/* 020B78 8001FF78 4501001A */ bc1t .L8001FFE4 -/* 020B7C 8001FF7C 00000000 */ nop -.L8001FF80: -/* 020B80 8001FF80 460C703E */ c.le.s $f14, $f12 -.L8001FF84: -/* 020B84 8001FF84 C7A4005C */ lwc1 $f4, 0x5c($sp) -/* 020B88 8001FF88 C7A8006C */ lwc1 $f8, 0x6c($sp) -/* 020B8C 8001FF8C C7AA0050 */ lwc1 $f10, 0x50($sp) -/* 020B90 8001FF90 45000016 */ bc1f .L8001FFEC -/* 020B94 8001FF94 C7A60074 */ lwc1 $f6, 0x74($sp) -/* 020B98 8001FF98 46082001 */ sub.s $f0, $f4, $f8 -/* 020B9C 8001FF9C C7A40030 */ lwc1 $f4, 0x30($sp) -/* 020BA0 8001FFA0 46065081 */ sub.s $f2, $f10, $f6 -/* 020BA4 8001FFA4 46002202 */ mul.s $f8, $f4, $f0 -/* 020BA8 8001FFA8 C7A4002C */ lwc1 $f4, 0x2c($sp) -/* 020BAC 8001FFAC 46121282 */ mul.s $f10, $f2, $f18 -/* 020BB0 8001FFB0 460A4181 */ sub.s $f6, $f8, $f10 -/* 020BB4 8001FFB4 460C303E */ c.le.s $f6, $f12 -/* 020BB8 8001FFB8 00000000 */ nop -/* 020BBC 8001FFBC 4502000C */ bc1fl .L8001FFF0 -/* 020BC0 8001FFC0 8FBF001C */ lw $ra, 0x1c($sp) -/* 020BC4 8001FFC4 46041202 */ mul.s $f8, $f2, $f4 -/* 020BC8 8001FFC8 00000000 */ nop -/* 020BCC 8001FFCC 46008282 */ mul.s $f10, $f16, $f0 -/* 020BD0 8001FFD0 460A4181 */ sub.s $f6, $f8, $f10 -/* 020BD4 8001FFD4 460C303E */ c.le.s $f6, $f12 -/* 020BD8 8001FFD8 00000000 */ nop -/* 020BDC 8001FFDC 45000003 */ bc1f .L8001FFEC -/* 020BE0 8001FFE0 00000000 */ nop -.L8001FFE4: -/* 020BE4 8001FFE4 240B0001 */ li $t3, 1 -/* 020BE8 8001FFE8 A7AB0042 */ sh $t3, 0x42($sp) -.L8001FFEC: -/* 020BEC 8001FFEC 8FBF001C */ lw $ra, 0x1c($sp) -.L8001FFF0: -/* 020BF0 8001FFF0 97A20042 */ lhu $v0, 0x42($sp) -/* 020BF4 8001FFF4 8FB00018 */ lw $s0, 0x18($sp) -/* 020BF8 8001FFF8 03E00008 */ jr $ra -/* 020BFC 8001FFFC 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/asm/non_matchings/code_8001F980/func_8002276C.s b/asm/non_matchings/code_8001F980/func_8002276C.s deleted file mode 100644 index 05ef5ed7f..000000000 --- a/asm/non_matchings/code_8001F980/func_8002276C.s +++ /dev/null @@ -1,218 +0,0 @@ -glabel func_8002276C -/* 02336C 8002276C 3C02800E */ lui $v0, %hi(gActiveScreenMode) # $v0, 0x800e -/* 023370 80022770 8C42C52C */ lw $v0, %lo(gActiveScreenMode)($v0) -/* 023374 80022774 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 023378 80022778 AFBF0014 */ sw $ra, 0x14($sp) -/* 02337C 8002277C 1040000B */ beqz $v0, .L800227AC -/* 023380 80022780 24030001 */ li $v1, 1 -/* 023384 80022784 1043006A */ beq $v0, $v1, .L80022930 -/* 023388 80022788 24040002 */ li $a0, 2 -/* 02338C 8002278C 24040002 */ li $a0, 2 -/* 023390 80022790 10440067 */ beq $v0, $a0, .L80022930 -/* 023394 80022794 00000000 */ nop -/* 023398 80022798 24030003 */ li $v1, 3 -/* 02339C 8002279C 104300A1 */ beq $v0, $v1, .L80022A24 -/* 0233A0 800227A0 00000000 */ nop -/* 0233A4 800227A4 100000B9 */ b .L80022A8C -/* 0233A8 800227A8 8FBF0014 */ lw $ra, 0x14($sp) -.L800227AC: -/* 0233AC 800227AC 3C02800E */ lui $v0, %hi(gModeSelection) # $v0, 0x800e -/* 0233B0 800227B0 8C42C53C */ lw $v0, %lo(gModeSelection)($v0) -/* 0233B4 800227B4 24030001 */ li $v1, 1 -/* 0233B8 800227B8 3C04800E */ lui $a0, %hi(gPlayerOne) # 0x800e -/* 0233BC 800227BC 1040000A */ beqz $v0, .L800227E8 -/* 0233C0 800227C0 00002825 */ move $a1, $zero -/* 0233C4 800227C4 10430028 */ beq $v0, $v1, .L80022868 -/* 0233C8 800227C8 3C04800E */ lui $a0, %hi(gPlayerOne) # $a0, 0x800e -/* 0233CC 800227CC 24040002 */ li $a0, 2 -/* 0233D0 800227D0 1044003C */ beq $v0, $a0, .L800228C4 -/* 0233D4 800227D4 24030003 */ li $v1, 3 -/* 0233D8 800227D8 1043003A */ beq $v0, $v1, .L800228C4 -/* 0233DC 800227DC 00000000 */ nop -/* 0233E0 800227E0 100000AA */ b .L80022A8C -/* 0233E4 800227E4 8FBF0014 */ lw $ra, 0x14($sp) -.L800227E8: -/* 0233E8 800227E8 0C008AA6 */ jal func_80022A98 -/* 0233EC 800227EC 8C84C4DC */ lw $a0, %lo(gPlayerOne)($a0) -/* 0233F0 800227F0 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 0233F4 800227F4 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 0233F8 800227F8 0C008AA6 */ jal func_80022A98 -/* 0233FC 800227FC 24050001 */ li $a1, 1 -/* 023400 80022800 3C04800E */ lui $a0, %hi(gPlayerThree) # $a0, 0x800e -/* 023404 80022804 8C84C4E4 */ lw $a0, %lo(gPlayerThree)($a0) -/* 023408 80022808 0C008AA6 */ jal func_80022A98 -/* 02340C 8002280C 24050002 */ li $a1, 2 -/* 023410 80022810 3C04800E */ lui $a0, %hi(gPlayerFour) # $a0, 0x800e -/* 023414 80022814 8C84C4E8 */ lw $a0, %lo(gPlayerFour)($a0) -/* 023418 80022818 0C008AA6 */ jal func_80022A98 -/* 02341C 8002281C 24050003 */ li $a1, 3 -/* 023420 80022820 3C04800E */ lui $a0, %hi(gPlayerFive) # $a0, 0x800e -/* 023424 80022824 8C84C4EC */ lw $a0, %lo(gPlayerFive)($a0) -/* 023428 80022828 0C008AA6 */ jal func_80022A98 -/* 02342C 8002282C 24050004 */ li $a1, 4 -/* 023430 80022830 3C04800E */ lui $a0, %hi(gPlayerSix) # $a0, 0x800e -/* 023434 80022834 8C84C4F0 */ lw $a0, %lo(gPlayerSix)($a0) -/* 023438 80022838 0C008AA6 */ jal func_80022A98 -/* 02343C 8002283C 24050005 */ li $a1, 5 -/* 023440 80022840 3C04800E */ lui $a0, %hi(gPlayerSeven) # $a0, 0x800e -/* 023444 80022844 8C84C4F4 */ lw $a0, %lo(gPlayerSeven)($a0) -/* 023448 80022848 0C008AA6 */ jal func_80022A98 -/* 02344C 8002284C 24050006 */ li $a1, 6 -/* 023450 80022850 3C04800E */ lui $a0, %hi(gPlayerEight) # $a0, 0x800e -/* 023454 80022854 8C84C4F8 */ lw $a0, %lo(gPlayerEight)($a0) -/* 023458 80022858 0C008AA6 */ jal func_80022A98 -/* 02345C 8002285C 24050007 */ li $a1, 7 -/* 023460 80022860 1000008A */ b .L80022A8C -/* 023464 80022864 8FBF0014 */ lw $ra, 0x14($sp) -.L80022868: -/* 023468 80022868 8C84C4DC */ lw $a0, %lo(gPlayerOne)($a0) # -0x3b24($a0) -/* 02346C 8002286C 0C008AA6 */ jal func_80022A98 -/* 023470 80022870 00002825 */ move $a1, $zero -/* 023474 80022874 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 023478 80022878 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 02347C 8002287C 24010100 */ li $at, 256 -/* 023480 80022880 948E0000 */ lhu $t6, ($a0) -/* 023484 80022884 31CF0100 */ andi $t7, $t6, 0x100 -/* 023488 80022888 15E10003 */ bne $t7, $at, .L80022898 -/* 02348C 8002288C 00000000 */ nop -/* 023490 80022890 0C008AA6 */ jal func_80022A98 -/* 023494 80022894 24050001 */ li $a1, 1 -.L80022898: -/* 023498 80022898 3C04800E */ lui $a0, %hi(gPlayerThree) # $a0, 0x800e -/* 02349C 8002289C 8C84C4E4 */ lw $a0, %lo(gPlayerThree)($a0) -/* 0234A0 800228A0 24010100 */ li $at, 256 -/* 0234A4 800228A4 94980000 */ lhu $t8, ($a0) -/* 0234A8 800228A8 33190100 */ andi $t9, $t8, 0x100 -/* 0234AC 800228AC 57210077 */ bnel $t9, $at, .L80022A8C -/* 0234B0 800228B0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0234B4 800228B4 0C008AA6 */ jal func_80022A98 -/* 0234B8 800228B8 24050002 */ li $a1, 2 -/* 0234BC 800228BC 10000073 */ b .L80022A8C -/* 0234C0 800228C0 8FBF0014 */ lw $ra, 0x14($sp) -.L800228C4: -/* 0234C4 800228C4 3C04800E */ lui $a0, %hi(gPlayerOne) # $a0, 0x800e -/* 0234C8 800228C8 8C84C4DC */ lw $a0, %lo(gPlayerOne)($a0) -/* 0234CC 800228CC 0C008AA6 */ jal func_80022A98 -/* 0234D0 800228D0 00002825 */ move $a1, $zero -/* 0234D4 800228D4 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 0234D8 800228D8 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 0234DC 800228DC 0C008AA6 */ jal func_80022A98 -/* 0234E0 800228E0 24050001 */ li $a1, 1 -/* 0234E4 800228E4 3C02800E */ lui $v0, %hi(gPlayerCountSelection1) # $v0, 0x800e -/* 0234E8 800228E8 8C42C538 */ lw $v0, %lo(gPlayerCountSelection1)($v0) -/* 0234EC 800228EC 3C04800E */ lui $a0, %hi(gPlayerThree) # $a0, 0x800e -/* 0234F0 800228F0 24050002 */ li $a1, 2 -/* 0234F4 800228F4 28410003 */ slti $at, $v0, 3 -/* 0234F8 800228F8 54200006 */ bnel $at, $zero, .L80022914 -/* 0234FC 800228FC 24010004 */ li $at, 4 -/* 023500 80022900 0C008AA6 */ jal func_80022A98 -/* 023504 80022904 8C84C4E4 */ lw $a0, %lo(gPlayerThree)($a0) -/* 023508 80022908 3C02800E */ lui $v0, %hi(gPlayerCountSelection1) # $v0, 0x800e -/* 02350C 8002290C 8C42C538 */ lw $v0, %lo(gPlayerCountSelection1)($v0) -/* 023510 80022910 24010004 */ li $at, 4 -.L80022914: -/* 023514 80022914 1441005C */ bne $v0, $at, .L80022A88 -/* 023518 80022918 3C04800E */ lui $a0, %hi(gPlayerFour) # $a0, 0x800e -/* 02351C 8002291C 8C84C4E8 */ lw $a0, %lo(gPlayerFour)($a0) -/* 023520 80022920 0C008AA6 */ jal func_80022A98 -/* 023524 80022924 24050003 */ li $a1, 3 -/* 023528 80022928 10000058 */ b .L80022A8C -/* 02352C 8002292C 8FBF0014 */ lw $ra, 0x14($sp) -.L80022930: -/* 023530 80022930 3C02800E */ lui $v0, %hi(gModeSelection) # $v0, 0x800e -/* 023534 80022934 8C42C53C */ lw $v0, %lo(gModeSelection)($v0) -/* 023538 80022938 00002825 */ move $a1, $zero -/* 02353C 8002293C 10400009 */ beqz $v0, .L80022964 -/* 023540 80022940 00000000 */ nop -/* 023544 80022944 10430032 */ beq $v0, $v1, .L80022A10 -/* 023548 80022948 00002825 */ move $a1, $zero -/* 02354C 8002294C 10440026 */ beq $v0, $a0, .L800229E8 -/* 023550 80022950 24030003 */ li $v1, 3 -/* 023554 80022954 10430024 */ beq $v0, $v1, .L800229E8 -/* 023558 80022958 00000000 */ nop -/* 02355C 8002295C 1000004B */ b .L80022A8C -/* 023560 80022960 8FBF0014 */ lw $ra, 0x14($sp) -.L80022964: -/* 023564 80022964 3C04800E */ lui $a0, %hi(gPlayerOne) # $a0, 0x800e -/* 023568 80022968 0C008AA6 */ jal func_80022A98 -/* 02356C 8002296C 8C84C4DC */ lw $a0, %lo(gPlayerOne)($a0) -/* 023570 80022970 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 023574 80022974 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 023578 80022978 0C008AA6 */ jal func_80022A98 -/* 02357C 8002297C 24050001 */ li $a1, 1 -/* 023580 80022980 3C04800E */ lui $a0, %hi(gPlayerThree) # $a0, 0x800e -/* 023584 80022984 8C84C4E4 */ lw $a0, %lo(gPlayerThree)($a0) -/* 023588 80022988 0C008AA6 */ jal func_80022A98 -/* 02358C 8002298C 24050002 */ li $a1, 2 -/* 023590 80022990 3C04800E */ lui $a0, %hi(gPlayerFour) # $a0, 0x800e -/* 023594 80022994 8C84C4E8 */ lw $a0, %lo(gPlayerFour)($a0) -/* 023598 80022998 0C008AA6 */ jal func_80022A98 -/* 02359C 8002299C 24050003 */ li $a1, 3 -/* 0235A0 800229A0 3C04800E */ lui $a0, %hi(gPlayerFive) # $a0, 0x800e -/* 0235A4 800229A4 8C84C4EC */ lw $a0, %lo(gPlayerFive)($a0) -/* 0235A8 800229A8 0C008AA6 */ jal func_80022A98 -/* 0235AC 800229AC 24050004 */ li $a1, 4 -/* 0235B0 800229B0 3C04800E */ lui $a0, %hi(gPlayerSix) # $a0, 0x800e -/* 0235B4 800229B4 8C84C4F0 */ lw $a0, %lo(gPlayerSix)($a0) -/* 0235B8 800229B8 0C008AA6 */ jal func_80022A98 -/* 0235BC 800229BC 24050005 */ li $a1, 5 -/* 0235C0 800229C0 3C04800E */ lui $a0, %hi(gPlayerSeven) # $a0, 0x800e -/* 0235C4 800229C4 8C84C4F4 */ lw $a0, %lo(gPlayerSeven)($a0) -/* 0235C8 800229C8 0C008AA6 */ jal func_80022A98 -/* 0235CC 800229CC 24050006 */ li $a1, 6 -/* 0235D0 800229D0 3C04800E */ lui $a0, %hi(gPlayerEight) # $a0, 0x800e -/* 0235D4 800229D4 8C84C4F8 */ lw $a0, %lo(gPlayerEight)($a0) -/* 0235D8 800229D8 0C008AA6 */ jal func_80022A98 -/* 0235DC 800229DC 24050007 */ li $a1, 7 -/* 0235E0 800229E0 1000002A */ b .L80022A8C -/* 0235E4 800229E4 8FBF0014 */ lw $ra, 0x14($sp) -.L800229E8: -/* 0235E8 800229E8 3C04800E */ lui $a0, %hi(gPlayerOne) # $a0, 0x800e -/* 0235EC 800229EC 8C84C4DC */ lw $a0, %lo(gPlayerOne)($a0) -/* 0235F0 800229F0 0C008AA6 */ jal func_80022A98 -/* 0235F4 800229F4 00002825 */ move $a1, $zero -/* 0235F8 800229F8 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 0235FC 800229FC 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 023600 80022A00 0C008AA6 */ jal func_80022A98 -/* 023604 80022A04 24050001 */ li $a1, 1 -/* 023608 80022A08 10000020 */ b .L80022A8C -/* 02360C 80022A0C 8FBF0014 */ lw $ra, 0x14($sp) -.L80022A10: -/* 023610 80022A10 3C04800E */ lui $a0, %hi(gPlayerOne) # $a0, 0x800e -/* 023614 80022A14 0C008AA6 */ jal func_80022A98 -/* 023618 80022A18 8C84C4DC */ lw $a0, %lo(gPlayerOne)($a0) -/* 02361C 80022A1C 1000001B */ b .L80022A8C -/* 023620 80022A20 8FBF0014 */ lw $ra, 0x14($sp) -.L80022A24: -/* 023624 80022A24 3C02800E */ lui $v0, %hi(gModeSelection) # $v0, 0x800e -/* 023628 80022A28 8C42C53C */ lw $v0, %lo(gModeSelection)($v0) -/* 02362C 80022A2C 00002825 */ move $a1, $zero -/* 023630 80022A30 10440002 */ beq $v0, $a0, .L80022A3C -/* 023634 80022A34 00000000 */ nop -/* 023638 80022A38 14430013 */ bne $v0, $v1, .L80022A88 -.L80022A3C: -/* 02363C 80022A3C 3C04800E */ lui $a0, %hi(gPlayerOne) # $a0, 0x800e -/* 023640 80022A40 0C008AA6 */ jal func_80022A98 -/* 023644 80022A44 8C84C4DC */ lw $a0, %lo(gPlayerOne)($a0) -/* 023648 80022A48 3C04800E */ lui $a0, %hi(gPlayerTwo) # $a0, 0x800e -/* 02364C 80022A4C 8C84C4E0 */ lw $a0, %lo(gPlayerTwo)($a0) -/* 023650 80022A50 0C008AA6 */ jal func_80022A98 -/* 023654 80022A54 24050001 */ li $a1, 1 -/* 023658 80022A58 3C04800E */ lui $a0, %hi(gPlayerThree) # $a0, 0x800e -/* 02365C 80022A5C 8C84C4E4 */ lw $a0, %lo(gPlayerThree)($a0) -/* 023660 80022A60 0C008AA6 */ jal func_80022A98 -/* 023664 80022A64 24050002 */ li $a1, 2 -/* 023668 80022A68 3C08800E */ lui $t0, %hi(gPlayerCountSelection1) # $t0, 0x800e -/* 02366C 80022A6C 8D08C538 */ lw $t0, %lo(gPlayerCountSelection1)($t0) -/* 023670 80022A70 24010004 */ li $at, 4 -/* 023674 80022A74 3C04800E */ lui $a0, %hi(gPlayerFour) # $a0, 0x800e -/* 023678 80022A78 15010003 */ bne $t0, $at, .L80022A88 -/* 02367C 80022A7C 24050003 */ li $a1, 3 -/* 023680 80022A80 0C008AA6 */ jal func_80022A98 -/* 023684 80022A84 8C84C4E8 */ lw $a0, %lo(gPlayerFour)($a0) -.L80022A88: -/* 023688 80022A88 8FBF0014 */ lw $ra, 0x14($sp) -.L80022A8C: -/* 02368C 80022A8C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 023690 80022A90 03E00008 */ jr $ra -/* 023694 80022A94 00000000 */ nop diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index bbad6f004..97f6ccf2a 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -125,12 +125,12 @@ s32 func_800061DC(Vec3f arg0, f32 arg1, s32 arg2) { } #ifdef MIPS_TO_C -//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9 +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de extern ? D_80163258; extern ? D_80163270; extern ? D_80163288; -void func_800065D0(s32 arg0, void *arg1) { +void func_800065D0(s32 arg0, Player *player) { Player *temp_a3; Player *temp_a3_2; s16 temp_t2; @@ -142,7 +142,7 @@ void func_800065D0(s32 arg0, void *arg1) { u16 temp_t9; temp_v0 = arg0 * 2; - temp_t2 = (s16) ((s16) arg1->unk2E / 182) - (s16) ((s16) D_80164590[(s16) gPathIndexByPlayerId[arg0]][gNearestWaypointByPlayerId[arg0]] / 182); + temp_t2 = (s16) ((s16) player->unk_02E / 182) - (s16) ((s16) D_80164590[(s16) gPathIndexByPlayerId[arg0]][gNearestWaypointByPlayerId[arg0]] / 182); var_t1 = temp_t2; if (temp_t2 < 0) { var_t1 = temp_t2 * -1; @@ -934,7 +934,7 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800070F4.s") #endif #ifdef MIPS_TO_C -//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9 +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de extern ? D_801643D8; extern ? D_801643E0; @@ -1025,25 +1025,25 @@ void func_800074D4(void) { var_t0 = 0; var_a0_2 = &gPlayers[0]; do { - if ((var_a0_2->unk_000 & 0x800) != 0) { + if (var_a0_2->unk_000 & 0x800) { (&sp68[0])[var_v0] = var_t0; temp_t9 = &gCourseCompletionPercentByRank[var_v0]; var_v0 += 1; *temp_t9 = -gTimePlayerLastTouchedFinishLine[var_t0].unk0; } - if ((var_a0_2->unkDD8 & 0x800) != 0) { + if (var_a0_2->unkDD8 & 0x800) { (&sp68[0])[var_v0] = var_t0 + 1; temp_t8 = &gCourseCompletionPercentByRank[var_v0]; var_v0 += 1; *temp_t8 = -gTimePlayerLastTouchedFinishLine[var_t0].unk4; } - if ((var_a0_2->unk1BB0 & 0x800) != 0) { + if (var_a0_2->unk1BB0 & 0x800) { (&sp68[0])[var_v0] = var_t0 + 2; temp_t7 = &gCourseCompletionPercentByRank[var_v0]; var_v0 += 1; *temp_t7 = -gTimePlayerLastTouchedFinishLine[var_t0].unk8; } - if ((var_a0_2->unk2988 & 0x800) != 0) { + if (var_a0_2->unk2988 & 0x800) { (&sp68[0])[var_v0] = var_t0 + 3; temp_t6 = &gCourseCompletionPercentByRank[var_v0]; var_v0 += 1; @@ -1056,25 +1056,25 @@ void func_800074D4(void) { temp_t1 = var_v0; var_a0_3 = &gPlayers[0]; do { - if ((var_a0_3->unk_000 & 0x800) == 0) { + if (!(var_a0_3->unk_000 & 0x800)) { (&sp68[0])[var_v0] = var_t0_2; temp_t6_2 = &gCourseCompletionPercentByRank[var_v0]; var_v0 += 1; *temp_t6_2 = gCourseCompletionPercentByPlayerId[var_t0_2].unk0; } - if ((var_a0_3->unkDD8 & 0x800) == 0) { + if (!(var_a0_3->unkDD8 & 0x800)) { (&sp68[0])[var_v0] = var_t0_2 + 1; temp_t9_2 = &gCourseCompletionPercentByRank[var_v0]; var_v0 += 1; *temp_t9_2 = gCourseCompletionPercentByPlayerId[var_t0_2].unk4; } - if ((var_a0_3->unk1BB0 & 0x800) == 0) { + if (!(var_a0_3->unk1BB0 & 0x800)) { (&sp68[0])[var_v0] = var_t0_2 + 2; temp_t8_2 = &gCourseCompletionPercentByRank[var_v0]; var_v0 += 1; *temp_t8_2 = gCourseCompletionPercentByPlayerId[var_t0_2].unk8; } - if ((var_a0_3->unk2988 & 0x800) == 0) { + if (!(var_a0_3->unk2988 & 0x800)) { (&sp68[0])[var_v0] = var_t0_2 + 3; temp_t7_2 = &gCourseCompletionPercentByRank[var_v0]; var_v0 += 1; @@ -1091,7 +1091,7 @@ void func_800074D4(void) { var_v0_2 = var_a3_2; if (var_a3_2 < temp_t1) { temp_a0 = &gCourseCompletionPercentByRank[var_t0_3]; - if (((temp_t1 - var_a3_2) & 1) != 0) { + if ((temp_t1 - var_a3_2) & 1) { temp_t4 = &gCourseCompletionPercentByRank[var_a3_2]; temp_f2 = *temp_t4; temp_f0 = *temp_a0; @@ -1151,7 +1151,7 @@ block_41: var_v0_3 = var_a3_3; if (var_a3_3 < 8) { temp_a0_2 = &gCourseCompletionPercentByRank[var_t0_4]; - if (((8 - var_a3_3) & 1) != 0) { + if ((8 - var_a3_3) & 1) { temp_t4_2 = &gCourseCompletionPercentByRank[var_a3_3]; temp_f2_4 = *temp_t4_2; temp_f0_3 = *temp_a0_2; @@ -1454,176 +1454,147 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80007FA4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80007D04(f32, s32, void *, s32, void *); // extern -? func_80007FA4(f32, void *, f32, void *); // extern -s32 func_800088D8(f32, s32, s16, s16, void *); // extern -? func_80030FC8(f32, void *, void *, s32, void *); // extern -? func_80031F48(f32, void *, ?, s32, void *); // extern -extern f32 D_800ECF9C; -extern f32 D_800ECFA0; +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_80007D04(f32, s32, Player *, s32, Player *); /* extern */ +? func_80007FA4(f32, Player *, f32, Player *); /* extern */ +s32 func_800088D8(f32, s32, s16, s16, Player *); /* extern */ extern ? D_801631E0; extern ? D_80163330; extern ? D_80163350; extern ? D_801634D8; extern ? D_80164392; extern ? D_8016440A; +s16 gCurrentCourseId; /* unable to generate initializer */ -void func_80008424(s32 arg0, f32 arg1, void *arg2) { +void func_80008424(s32 arg0, f32 arg1, Player *player) { f32 sp34; - void *sp28; + s32 sp28; s32 sp1C; - f32 temp_f12; f32 temp_f2; + f32 var_f0; + f32 var_f12; s32 temp_t5; s32 temp_v0; s32 temp_v0_2; s32 temp_v0_3; s32 temp_v0_5; s32 temp_v1; + s32 var_a1; u16 temp_v0_4; - void *temp_a0; - void *temp_a3; - f32 phi_f0; - void *phi_a1; - f32 phi_f12; - void *phi_a3; - temp_v1 = arg2->unkBC; - temp_f12 = arg1; - temp_a3 = arg2; - temp_f2 = arg2->unk94; - phi_a3 = temp_a3; - phi_f12 = temp_f12; - phi_f12 = temp_f12; - if (((temp_v1 & 0x80) == 0) && ((temp_v1 & 0x40) == 0) && ((temp_v1 << 0xE) >= 0) && (temp_v0 = arg2->unkC, ((temp_v0 << 9) >= 0)) && ((temp_v0 << 7) >= 0) && ((temp_v0 & 2) == 0) && ((temp_v0 & 4) == 0)) { - if (gCurrentCourseId == 0x14) { - func_80007FA4(temp_f12, arg2, temp_f2, temp_a3); + temp_v1 = player->unk_0BC; + var_f12 = arg1; + temp_f2 = player->unk_094; + if (!(temp_v1 & 0x80) && !(temp_v1 & 0x40) && ((temp_v1 << 0xE) >= 0) && (temp_v0 = player->unk_00C, ((temp_v0 << 9) >= 0)) && ((temp_v0 << 7) >= 0) && !(temp_v0 & 2) && !(temp_v0 & 4)) { + if (gCurrentCourseId == 0x0014) { + func_80007FA4(var_f12, player, temp_f2, player); return; } temp_t5 = arg0 * 2; - if ((*(&D_801634D8 + temp_t5) == 1) && (temp_a0 = temp_a3, ((temp_v1 & 0x80000200) == 0))) { - arg2 = temp_a3; - func_80031F48(temp_f12, temp_a0, 0x41200000, temp_t5, temp_a3); - if (arg2->unk9C == 0.0) { - arg2->unk34 = 0.0f; - arg2->unk3C = 0.0f; - return; - } - // Duplicate return node #55. Try simplifying control flow for better match - return; - } - temp_v0_2 = gCCSelection; - phi_f0 = D_800ECF9C; - if (temp_v0_2 != CC_50) { - if (temp_v0_2 != CC_100) { - if (temp_v0_2 != CC_150) { - if (temp_v0_2 != CC_EXTRA) { - - } - } else { - phi_f0 = 3.75f; - } + if ((*(&D_801634D8 + temp_t5) == (s16) 1) && !(temp_v1 & 0x80000200)) { + func_80031F48(player, 10.0f); + if ((f64) player->unk_09C == 0.0) { + player->unk_034[0] = 0.0f; + player->unk_034[2] = 0.0f; } } else { - phi_f0 = 2.5f; - } - if (temp_f2 < phi_f0) { - temp_a3->unkBC = temp_v1 & 0xFFDFFFFF; - func_80030FC8(temp_f12, temp_a3, arg2, temp_t5, temp_a3); - return; - } - if ((temp_a3->unk0 & 0x800) != 0) { - if (temp_f2 < temp_f12) { - temp_a3->unkBC = temp_v1 & 0xFFDFFFFF; - func_80030FC8(temp_f12, temp_a3, arg2, temp_t5, temp_a3); + temp_v0_2 = gCCSelection; + var_f0 = 3.3333333f; + switch (temp_v0_2) { /* irregular */ + case 1: + case 3: + break; + case 0: + var_f0 = 2.5f; + break; + case 2: + var_f0 = 3.75f; + break; + } + if (temp_f2 < var_f0) { + player->unk_0BC = temp_v1 & 0xFFDFFFFF; + func_80030FC8(player); return; } - temp_a3->unkBC = temp_v1 & 0xFFDFFFFF; - func_80031F48(temp_f12, temp_a3, 0x3F800000, temp_t5, temp_a3); - return; - } - if ((*(&D_801631E0 + temp_t5) == 1) && (*(&D_80163330 + temp_t5) != 1)) { - temp_v0_3 = arg0 * 4; - arg2 = temp_a3; - if (func_800088D8(temp_f12, arg0, *(&D_80164392 + temp_v0_3), *(&D_8016440A + temp_v0_3), temp_a3) == 1) { - arg2->unkBC = arg2->unkBC | 0x200000; - func_80030FC8((bitwise f32) arg2); - return; - } - arg2->unkBC = arg2->unkBC & 0xFFDFFFFF; - func_80031F48((bitwise f32) arg2, 0x3F800000); - return; - } - temp_v0_4 = *(&D_80163350 + temp_t5); - phi_a1 = 1; - if (temp_v0_4 != 0) { - if (temp_v0_4 != 1) { - if (temp_v0_4 != 2) { - if (temp_v0_4 != 3) { - goto block_41; - } - temp_a3->unkBC = temp_v1 | 0x200000; - arg1 = temp_f12; - sp34 = temp_f2; - arg2 = temp_a3; - sp1C = temp_t5; - sp28 = 1; - func_80030FC8(temp_f12, temp_a3, 1, temp_t5, temp_a3); - phi_f12 = arg1; - phi_a3 = arg2; - } else { - if (((temp_f2 / 18.0f) * 216.0f) > 20.0f) { - phi_f12 = D_800ECFA0; - } - goto block_41; + if (player->unk_000 & 0x800) { + if (temp_f2 < var_f12) { + player->unk_0BC = temp_v1 & 0xFFDFFFFF; + func_80030FC8(player); + return; } - } else { - temp_a3->unkBC = temp_v1 & 0xFFDFFFFF; - arg1 = temp_f12; + player->unk_0BC = temp_v1 & 0xFFDFFFFF; + func_80031F48(player, 1.0f); + return; + } + if ((*(&D_801631E0 + temp_t5) == (u16) 1) && (*(&D_80163330 + temp_t5) != (u16) 1)) { + temp_v0_3 = arg0 * 4; + if (func_800088D8(var_f12, arg0, *(&D_80164392 + temp_v0_3), *(&D_8016440A + temp_v0_3), player) == 1) { + player->unk_0BC |= 0x200000; + func_80030FC8(player); + return; + } + player->unk_0BC &= 0xFFDFFFFF; + func_80031F48(player, 1.0f); + return; + } + temp_v0_4 = *(&D_80163350 + temp_t5); + switch (temp_v0_4) { /* switch 1; irregular */ + case 1: /* switch 1 */ + player->unk_0BC = temp_v1 & 0xFFDFFFFF; sp34 = temp_f2; - arg2 = temp_a3; sp1C = temp_t5; sp28 = 1; - func_80030FC8(temp_f12, temp_a3, 1, temp_t5, temp_a3); - phi_f12 = arg1; - phi_a3 = arg2; + func_80030FC8(player); + var_a1 = 1; + var_f12 = arg1; + break; + case 3: /* switch 1 */ + player->unk_0BC = temp_v1 | 0x200000; + sp34 = temp_f2; + sp1C = temp_t5; + sp28 = 1; + func_80030FC8(player); + var_a1 = 1; + var_f12 = arg1; + break; + case 2: /* switch 1 */ + if (((temp_f2 / 18.0f) * 216.0f) > 20.0f) { + var_f12 = 1.6666666f; + } + /* fallthrough */ + default: /* switch 1 */ + case 0: /* switch 1 */ + var_a1 = 0; + break; + } + if (var_a1 != 1) { + if (temp_f2 < var_f12) { + if ((D_800DC51C == (u16) 1) && (gCurrentCourseId != 0x0014)) { + func_80030FC8(player); + return; + } + temp_v0_5 = arg0 * 4; + if (*(&D_80163330 + temp_t5) == (u16) 1) { + func_80007D04(var_f12, arg0, player, temp_t5, player); + return; + } + if (func_800088D8(var_f12, arg0, *(&D_80164392 + temp_v0_5), *(&D_8016440A + temp_v0_5), player) == 1) { + player->unk_0BC |= 0x200000; + func_80030FC8(player); + return; + } + player->unk_0BC &= 0xFFDFFFFF; + func_80031F48(player, 1.0f); + return; + } + player->unk_0BC &= 0xFFDFFFFF; + if (var_f12 > 1.0f) { + func_80031F48(player, 2.0f); + return; + } + func_80031F48(player, 5.0f); } - } else { -block_41: - phi_a1 = NULL; } - if (phi_a1 != 1) { - if (arg2->unk94 < phi_f12) { - if ((D_800DC51C == 1) && (gCurrentCourseId != 0x14)) { - func_80030FC8(phi_f12, phi_a3, phi_a1, arg0 * 2, phi_a3); - return; - } - temp_v0_5 = arg0 * 4; - if (*(&D_80163330 + (arg0 * 2)) == 1) { - func_80007D04(phi_f12, arg0, phi_a3, arg0 * 2, phi_a3); - return; - } - arg2 = phi_a3; - if (func_800088D8(phi_f12, arg0, *(&D_80164392 + temp_v0_5), *(&D_8016440A + temp_v0_5), phi_a3) == 1) { - arg2->unkBC = arg2->unkBC | 0x200000; - func_80030FC8((bitwise f32) arg2); - return; - } - arg2->unkBC = arg2->unkBC & 0xFFDFFFFF; - func_80031F48((bitwise f32) arg2, 0x3F800000); - return; - } - phi_a3->unkBC = phi_a3->unkBC & 0xFFDFFFFF; - if (phi_f12 > 1.0f) { - func_80031F48(phi_f12, phi_a3, 0x40000000, arg0 * 2, phi_a3); - return; - } - func_80031F48(phi_f12, phi_a3, 0x40A00000, arg0 * 2, phi_a3); - // Duplicate return node #55. Try simplifying control flow for better match - return; - } - // Duplicate return node #55. Try simplifying control flow for better match } } #else @@ -3763,17 +3734,13 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D3B8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_8000B820(s32); // extern -? func_8000BBD8(s32, f32, s16, u16); // extern -f32 func_8000D3B8(s32, u16); // extern +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_8000BBD8(s32, f32, s16, u16); /* extern */ +f32 func_8000D3B8(s32, u16); /* extern */ extern ? D_80162FA0; -extern ? D_80163068; -extern s32 D_801631D8; extern ? D_80163380; extern s16 D_8016344A; -extern u16 D_80164430; -extern s32 D_801645E0; +s16 gCurrentCourseId; /* unable to generate initializer */ void func_8000D438(s32 arg0, u16 arg1) { f32 sp48; @@ -3789,74 +3756,66 @@ void func_8000D438(s32 arg0, u16 arg1) { s16 temp_v1; s32 temp_a0; s32 temp_hi; - s32 temp_t0; + s32 var_a2; + s32 var_a2_2; u16 temp_a3; u16 temp_a3_2; - s32 phi_a2; - s32 phi_a2_2; - s32 phi_a2_3; - s32 phi_v0; temp_a3 = arg1 & 0xFFFF; - temp_t0 = temp_a3 * 2; - temp_v1 = *(D_801645E0 + temp_t0); + temp_v1 = D_801645E0[temp_a3]; sp28 = 6; - sp1C = temp_t0; + sp1C = temp_a3 * 2; arg1 = temp_a3; sp26 = temp_v1; temp_v0 = gCurrentCourseId; + var_a2 = 6; sp2C = func_8000D3B8(6, temp_a3); - phi_a2 = 6; if (temp_v0 != 4) { - if (temp_v0 != 0xA) { - if (temp_v0 == 0x14) { - phi_a2 = 1; + if (temp_v0 != 0x000A) { + if (temp_v0 == 0x0014) { + var_a2 = 1; } else if (temp_v1 < 6) { - phi_a2 = 8; + var_a2 = 8; } else if (temp_v1 >= 0x15) { - phi_a2 = 0x14; + var_a2 = 0x00000014; } } else { - phi_a2 = 7; + var_a2 = 7; } } - phi_a2_2 = phi_a2; - phi_a2_2 = phi_a2; - if (phi_a2 >= 8) { - temp_f0 = *(&D_80163068 + (arg0 * 4)); - if ((temp_f0 > 0.75f) && (*(D_801631D8 + temp_t0) == 0)) { - phi_a2_2 = 7; + if (var_a2 >= 8) { + temp_f0 = D_80163068[arg0]; + if ((temp_f0 > 0.75f) && (D_801631D8[temp_a3] == 0)) { + var_a2 = 7; } - if ((temp_f0 < -0.75f) && (*(D_801631D8 + temp_t0) == 1)) { - phi_a2_2 = 7; + if ((temp_f0 < -0.75f) && (D_801631D8[temp_a3] == 1)) { + var_a2 = 7; } } - sp28 = phi_a2_2; + sp28 = var_a2; arg1 = arg1; + var_a2_2 = var_a2; temp_a3_2 = arg1; - phi_a2_3 = phi_a2_2; if (func_8000B820(arg0) == 1) { - phi_a2_3 = 5; + var_a2_2 = 5; } temp_v1_2 = (arg0 * 2) + &D_80163380; temp_v0_2 = *temp_v1_2; - if (temp_v0_2 < phi_a2_3) { + if (temp_v0_2 < var_a2_2) { *temp_v1_2 = temp_v0_2 + 1; } - phi_v0 = *temp_v1_2; - if (phi_a2_3 < *temp_v1_2) { - *temp_v1_2 = *temp_v1_2 - 1; - phi_v0 = *temp_v1_2; + if (var_a2_2 < *temp_v1_2) { + *temp_v1_2 -= 1; } - temp_hi = (phi_v0 + temp_a3_2) % D_80164430; + temp_hi = (s32) (*temp_v1_2 + temp_a3_2) % (s32) D_80164430; temp_a0 = temp_hi & 0xFFFF; - arg1 = temp_hi; + arg1 = (u16) temp_hi; func_8000BBD8(temp_a0, sp2C, D_8016344A, temp_a3_2); sp48 = D_80162FA0.unk0; sp44 = D_80162FA0.unk8; - func_8000BBD8(((arg1 + 1) % D_80164430) & 0xFFFF, sp2C, D_8016344A, arg1); - D_80162FA0.unk0 = (sp48 + D_80162FA0.unk0) * 0.5f; - D_80162FA0.unk8 = (sp44 + D_80162FA0.unk8) * 0.5f; + func_8000BBD8(((s32) (arg1 + 1) % (s32) D_80164430) & 0xFFFF, sp2C, D_8016344A, arg1); + D_80162FA0.unk0 = (f32) ((sp48 + D_80162FA0.unk0) * 0.5f); + D_80162FA0.unk8 = (f32) ((sp44 + D_80162FA0.unk8) * 0.5f); } #else GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D438.s") @@ -3940,15 +3899,11 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D6D0.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80005FD0(f32, f32, f32 *, void *); // extern -? func_8000BBD8(u16, s32, s16, s32); // extern -s16 func_8000D2B4(f32, f32, f32, s16, s32); // extern -extern f32 D_800ED000; +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_8000BBD8(u16, s32, s16, s32); /* extern */ extern ? D_80162FA0; -extern ? gWaypointCountByPathIndex; -void func_8000D940(void *arg0, s16 *arg1, f32 arg2, s32 arg3, s16 arg4) { +void func_8000D940(Vec3f arg0, s16 *arg1, f32 arg2, s32 arg3, s16 pathIndex) { s16 spA8; u16 spA6; f32 spA0; @@ -3968,71 +3923,69 @@ void func_8000D940(void *arg0, s16 *arg1, f32 arg2, s32 arg3, s16 arg4) { f32 temp_f24; f32 temp_f4; f32 temp_f4_2; - s16 *temp_v0_2; + f32 var_f12; + f32 var_f14; + f32 var_f2; s16 temp_v0; s32 temp_a3; s32 temp_t2; s32 temp_v1; + struct TrackWayPoint *temp_v0_2; u16 temp_t0; - f32 phi_f2; - f32 phi_f12; - f32 phi_f14; sp54 = arg0->unk0; sp58 = arg0->unk4; - temp_t0 = *(&gWaypointCountByPathIndex + (arg4 * 2)); + temp_t0 = gWaypointCountByPathIndex[pathIndex]; sp5C = arg0->unk8; temp_f24 = arg0->unk8; temp_f20 = arg0->unk0; temp_f22 = arg0->unk4; - sp60 = temp_t0; - temp_v0 = func_8000D2B4(temp_f20, temp_f22, temp_f24, *arg1, arg4); + sp60 = (s32) temp_t0; + temp_v0 = func_8000D2B4(temp_f20, temp_f22, temp_f24, *arg1, (s32) pathIndex); temp_v1 = temp_v0 + temp_t0; temp_t2 = temp_v1 - 4; - temp_a3 = (temp_v1 - 3) % temp_t0; + temp_a3 = (s32) (temp_v1 - 3) % (s32) temp_t0; *arg1 = temp_v0; - spA8 = temp_a3; - spA6 = temp_t2 % temp_t0; - func_8000BBD8(temp_a3 & 0xFFFF, arg3, arg4, temp_a3); + spA8 = (s16) temp_a3; + spA6 = (u16) (temp_t2 % (s32) temp_t0); + func_8000BBD8(temp_a3 & 0xFFFF, arg3, pathIndex, temp_a3); temp_f4 = D_80162FA0.unk8; spA0 = D_80162FA0.unk0; sp98 = temp_f4; - func_8000BBD8(spA6, arg3, arg4); - temp_v0_2 = (&D_80164550)[arg4]; - temp_f18 = (((temp_v0_2 + (spA6 * 8))->unk2 + (temp_v0_2 + (spA8 * 8))->unk2) * 0.5f) - temp_f22; + func_8000BBD8(spA6, arg3, pathIndex); + temp_v0_2 = D_80164550[pathIndex]; + temp_f18 = ((f32) (temp_v0_2[(s16) spA6].wayPointY + temp_v0_2[spA8].wayPointY) * 0.5f) - temp_f22; temp_f16 = ((spA0 + D_80162FA0.unk0) * 0.5f) - temp_f20; sp4C = temp_f18; sp50 = temp_f16; temp_f4_2 = ((temp_f4 + D_80162FA0.unk8) * 0.5f) - temp_f24; sp48 = temp_f4_2; temp_f0 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18) + (temp_f4_2 * temp_f4_2)); - if (D_800ED000 < temp_f0) { - phi_f2 = ((temp_f16 * arg2) / temp_f0) + temp_f20; - phi_f12 = ((temp_f18 * arg2) / temp_f0) + temp_f22; - phi_f14 = ((sp48 * arg2) / temp_f0) + temp_f24; + if (temp_f0 > 0.01f) { + var_f2 = ((temp_f16 * arg2) / temp_f0) + temp_f20; + var_f12 = ((temp_f18 * arg2) / temp_f0) + temp_f22; + var_f14 = ((sp48 * arg2) / temp_f0) + temp_f24; } else { - phi_f2 = temp_f20; - phi_f12 = temp_f22; - phi_f14 = temp_f24; + var_f2 = temp_f20; + var_f12 = temp_f22; + var_f14 = temp_f24; } - arg0->unk0 = phi_f2; - arg0->unk4 = phi_f12; - arg0->unk8 = phi_f14; - func_80005FD0(phi_f12, phi_f14, &sp54, arg0); + arg0->unk0 = var_f2; + arg0->unk4 = var_f12; + arg0->unk8 = var_f14; + func_80005FD0(&sp54, arg0); } #else GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D940.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80005FD0(f32, f32, f32 *, void *); // extern -s16 func_8000D100(f32, f32, f32, s16); // extern -extern f32 D_800ED004; +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +s16 func_8000D100(f32, f32, f32, s16); /* extern */ extern s32 D_80163598; extern s32 D_8016359C; -void func_8000DBAC(void *arg0, s16 *arg1, f32 arg2) { +void func_8000DBAC(Vec3f arg0, s16 *arg1, f32 arg2) { f32 sp98; f32 sp94; f32 sp40; @@ -4046,13 +3999,13 @@ void func_8000DBAC(void *arg0, s16 *arg1, f32 arg2) { f32 temp_f16; f32 temp_f18; f32 temp_f2; + f32 var_f12; + f32 var_f14; s16 temp_v0; s32 temp_a1; s32 temp_v1; void *temp_a0; void *temp_a2; - f32 phi_f12; - f32 phi_f14; temp_f12 = arg0->unk0; temp_f14 = arg0->unk4; @@ -4066,24 +4019,24 @@ void func_8000DBAC(void *arg0, s16 *arg1, f32 arg2) { *arg1 = temp_v0; temp_v1 = D_8016359C; temp_a1 = D_80163598; - temp_a0 = (((temp_v0 + 3) % temp_v1) * 4) + temp_a1; - temp_a2 = (((temp_v0 + 4) % temp_v1) * 4) + temp_a1; - temp_f16 = ((temp_a0->unk0 + temp_a2->unk0) * 0.5f) - temp_f12; - temp_f18 = ((temp_a0->unk2 + temp_a2->unk2) * 0.5f) - temp_f2; + temp_a0 = ((s16) ((s32) (temp_v0 + 3) % temp_v1) * 4) + temp_a1; + temp_a2 = ((s16) ((s32) (temp_v0 + 4) % temp_v1) * 4) + temp_a1; + temp_f16 = ((f32) (temp_a0->unk0 + temp_a2->unk0) * 0.5f) - temp_f12; + temp_f18 = ((f32) (temp_a0->unk2 + temp_a2->unk2) * 0.5f) - temp_f2; sp34 = temp_f16; sp30 = temp_f18; temp_f0 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18)); - if (D_800ED004 < temp_f0) { - phi_f12 = ((temp_f16 * arg2) / temp_f0) + temp_f12; - phi_f14 = ((temp_f18 * arg2) / temp_f0) + temp_f2; + if (temp_f0 > 0.01f) { + var_f12 = ((temp_f16 * arg2) / temp_f0) + temp_f12; + var_f14 = ((temp_f18 * arg2) / temp_f0) + temp_f2; } else { - phi_f12 = temp_f12; - phi_f14 = temp_f2; + var_f12 = temp_f12; + var_f14 = temp_f2; } - arg0->unk0 = phi_f12; - arg0->unk8 = phi_f14; + arg0->unk0 = var_f12; + arg0->unk8 = var_f14; arg0->unk4 = sp98; - func_80005FD0(phi_f12, phi_f14, &sp38, arg0); + func_80005FD0(&sp38, arg0); } #else GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000DBAC.s") diff --git a/src/code_8001F980.c b/src/code_8001F980.c index 94d33a8f3..46168199f 100644 --- a/src/code_8001F980.c +++ b/src/code_8001F980.c @@ -35,12 +35,8 @@ void func_8001F980(s32 *arg0, s32 *arg1) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_8001F980(s32 *, s32 *); // extern -s32 func_8001FB0C(void *, s32, f32, f32); // extern -? get_player_index_for_player(); // extern - -void func_8001F9E4(void *arg0, s32 arg1, s8 arg2) { +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +void func_8001F9E4(Player *player, Camera *camera, s8 arg2) { s32 sp30; s32 sp2C; s32 sp24; @@ -50,33 +46,29 @@ void func_8001F9E4(void *arg0, s32 arg1, s8 arg2) { s32 temp_v1; u16 temp_t3; - get_player_index_for_player(); + get_player_index_for_player(player); func_8001F980(&sp30, &sp2C); temp_t6 = arg2 * 4; temp_v1 = 2 << temp_t6; temp_t0 = 8 << temp_t6; - temp_t3 = arg0->unk2 & ~temp_v1; - arg0->unk2 = temp_t3; - arg0->unk2 = temp_t3 & ~temp_t0; + temp_t3 = player->unk_002 & ~temp_v1; + player->unk_002 = temp_t3; + player->unk_002 = temp_t3 & ~temp_t0; sp20 = temp_t0; sp24 = temp_v1; - if (func_8001FB0C(arg0, arg1, D_80165578 + sp30, D_8016557A + sp2C) == 1) { - arg0->unk2 = arg0->unk2 | temp_v1; + if (func_8001FB0C(player, camera, (f32) (D_80165578 + sp30), (f32) (D_8016557A + sp2C)) == 1) { + player->unk_002 |= temp_v1; } - if (func_8001FB0C(arg0, arg1, D_80165580, D_80165582) == 1) { - arg0->unk2 = arg0->unk2 | sp20; + if (func_8001FB0C(player, camera, (f32) D_80165580, (f32) D_80165582) == 1) { + player->unk_002 |= sp20; } } #else GLOBAL_ASM("asm/non_matchings/code_8001F980/func_8001F9E4.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -f32 sins(s32); // extern -f32 coss(s32); // extern - -u16 func_8001FB0C(void *arg0, void *arg1, f32 arg2, f32 arg3) { +u16 func_8001FB0C(Player *player, Camera *camera, f32 arg2, f32 arg3) { + f32 pad[6]; f32 sp64; f32 sp60; f32 sp5C; @@ -86,146 +78,90 @@ u16 func_8001FB0C(void *arg0, void *arg1, f32 arg2, f32 arg3) { f32 sp4C; f32 sp48; f32 sp44; - s16 sp42; - u16 sp40; - f32 sp34; - f32 sp2C; - f32 sp20; - f32 temp_f10; - f32 temp_f10_2; - f32 temp_f12; - f32 temp_f14; - f32 temp_f16; - f32 temp_f18; - f32 temp_f2; - f32 temp_f4; - f32 temp_f6; - f32 temp_f8; - s32 temp_v0; - s16 phi_v0; + s16 var_v0; + u16 ret; - temp_v0 = gActiveScreenMode; - sp40 = 0; - if (temp_v0 != 0) { - if ((temp_v0 != 1) && (temp_v0 != 2)) { - if (temp_v0 != 3) { - phi_v0 = 0x1FFE; - } else { - phi_v0 = 0x1FFE; - } - } else { - phi_v0 = 0x3058; - } - } else { - phi_v0 = 0x293C; + ret = 0; + switch (gActiveScreenMode) { /* irregular */ + case SCREEN_MODE_1P: + var_v0 = 0x293C; + break; + case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: + case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: + var_v0 = 0x3058; + break; + case SCREEN_MODE_3P_4P_SPLITSCREEN: + var_v0 = 0x1FFE; + break; + default: + if(1){} + var_v0 = 0x1FFE; + break; } - sp42 = phi_v0; - sp4C = arg1->unk8 + (arg2 * coss((arg1->unk26 - phi_v0) & 0xFFFF)); - sp58 = arg1->unk0 + (arg2 * sins((arg1->unk26 - phi_v0) & 0xFFFF)); - temp_f10 = arg1->unk8 + (arg2 * coss((arg1->unk26 + phi_v0) & 0xFFFF)); - sp48 = temp_f10; - sp54 = arg1->unk0 + (arg2 * sins((arg1->unk26 + phi_v0) & 0xFFFF)); - sp44 = arg1->unk8 + (arg3 * coss((arg1->unk26 + 0x5FFA) & 0xFFFF)); - sp50 = arg1->unk0 + (arg3 * sins((arg1->unk26 + 0x5FFA) & 0xFFFF)); - temp_f12 = arg0->unk14; - temp_f2 = arg0->unk1C; - temp_f16 = sp54 - temp_f12; - temp_f14 = sp4C - temp_f2; - temp_f18 = sp58 - temp_f12; - temp_f4 = temp_f10 - temp_f2; - sp20 = temp_f4; - temp_f10_2 = (temp_f14 * temp_f16) - (temp_f18 * temp_f4); - temp_f8 = sp50 - temp_f12; - sp64 = temp_f10_2; - sp2C = temp_f8; - sp34 = sp44 - temp_f2; - temp_f6 = (temp_f4 * temp_f8) - (temp_f16 * sp34); - sp60 = temp_f6; - sp5C = (sp34 * temp_f18) - (temp_f8 * temp_f14); - if (((temp_f10_2 >= 0.0f) && (temp_f6 >= 0.0f) && (sp5C >= 0.0f)) || ((sp64 <= 0.0f) && (sp60 <= 0.0f) && (sp5C <= 0.0f))) { - sp40 = 1; + sp4C = (arg2 * coss((camera->rot[1] - var_v0))) + camera->pos[2]; + sp58 = (arg2 * sins((camera->rot[1] - var_v0))) + camera->pos[0]; + sp48 = (arg2 * coss((camera->rot[1] + var_v0))) + camera->pos[2]; + sp54 = (arg2 * sins((camera->rot[1] + var_v0))) + camera->pos[0]; + sp44 = (arg3 * coss((camera->rot[1] + 0x5FFA))) + camera->pos[2]; + sp50 = (arg3 * sins((camera->rot[1] + 0x5FFA))) + camera->pos[0]; + sp64 = ((sp4C - player->pos[2]) * (sp54 - player->pos[0])) - ((sp48 - player->pos[2]) * (sp58 - player->pos[0])); + sp60 = ((sp48 - player->pos[2]) * (sp50 - player->pos[0])) - ((sp44 - player->pos[2]) * (sp54 - player->pos[0])); + sp5C = ((sp44 - player->pos[2]) * (sp58 - player->pos[0])) - ((sp4C - player->pos[2]) * (sp50 - player->pos[0])); + if (((sp64 >= 0) && (sp60 >= 0) && (sp5C >= 0)) || (((sp64) <= 0) && (sp60 <= 0) && (sp5C <= 0))) { + ret = 1; } - return sp40; + return ret; } -#else -GLOBAL_ASM("asm/non_matchings/code_8001F980/func_8001FB0C.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -f32 sins(s32); // extern -f32 coss(s32); // extern - -u16 func_8001FD78(void *arg0, f32 arg1, ? arg2, f32 arg3) { +u16 func_8001FD78(Player *player, f32 posX, f32 arg2, f32 posZ) { f32 sp64; f32 sp60; - f32 sp5C; + f32 sp5c; f32 sp58; f32 sp54; f32 sp50; - u16 sp42; - f32 sp30; - f32 sp2C; - f32 sp24; - f32 sp20; - f32 temp_f0; - f32 temp_f0_2; f32 temp_f14; - f32 temp_f16; - f32 temp_f18; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f4; - f32 temp_f6; - f32 temp_f8; + f32 thing0; + f32 thing1; + u16 ret; - sp42 = 0; - sp58 = arg0->unk1C + (70.0f * coss(((arg0->unkC0 - arg0->unk2E) - 0x71C) & 0xFFFF)); - sp64 = arg0->unk14 + (70.0f * sins(((arg0->unkC0 - arg0->unk2E) - 0x71C) & 0xFFFF)); - sp54 = arg0->unk1C + (70.0f * coss(((arg0->unkC0 - arg0->unk2E) + 0x71C) & 0xFFFF)); - sp60 = arg0->unk14 + (70.0f * sins(((arg0->unkC0 - arg0->unk2E) + 0x71C) & 0xFFFF)); - sp50 = arg0->unk1C + (10.0f * coss(((arg0->unkC0 - arg0->unk2E) + 0x1C70) & 0xFFFF)); - temp_f8 = arg0->unk14 + (10.0f * sins(((arg0->unkC0 - arg0->unk2E) + 0x1C70) & 0xFFFF)); - sp5C = temp_f8; - temp_f16 = sp58 - arg3; - sp20 = arg3; - temp_f18 = sp60 - arg1; - sp24 = arg1; - temp_f6 = sp54 - arg3; - temp_f4 = sp64 - arg1; - sp30 = temp_f6; - sp2C = temp_f4; - temp_f14 = (temp_f16 * temp_f18) - (temp_f6 * temp_f4); - if (((temp_f14 >= 0.0f) && (temp_f0 = temp_f8 - sp24, temp_f2 = sp50 - sp20, (((temp_f6 * temp_f0) - (temp_f2 * temp_f18)) >= 0.0f)) && (((temp_f2 * temp_f4) - (temp_f16 * temp_f0)) >= 0.0f)) || ((temp_f14 <= 0.0f) && (temp_f0_2 = sp5C - arg1, temp_f2_2 = sp50 - arg3, (((sp30 * temp_f0_2) - (temp_f2_2 * temp_f18)) <= 0.0f)) && (((temp_f2_2 * sp2C) - (temp_f16 * temp_f0_2)) <= 0.0f))) { - sp42 = 1; + ret = 0; + sp58 = (70.0f * coss(((player->unk_0C0 - player->unk_02E) - 0x71C))) + player->pos[2]; + sp64 = (70.0f * sins(((player->unk_0C0 - player->unk_02E) - 0x71C))) + player->pos[0]; + sp54 = (70.0f * coss(((player->unk_0C0 - player->unk_02E) + 0x71C))) + player->pos[2]; + sp60 = (70.0f * sins(((player->unk_0C0 - player->unk_02E) + 0x71C))) + player->pos[0]; + sp50 = (10.0f * coss(((player->unk_0C0 - player->unk_02E) + 0x1C70))) + player->pos[2]; + sp5c = (10.0f * sins(((player->unk_0C0 - player->unk_02E) + 0x1C70))) + player->pos[0]; + temp_f14 = ((sp58 - posZ) * (sp60 - posX)) - ((sp54 - posZ) * (sp64 - posX)); + thing0 = ((sp54 - posZ) * (sp5c - posX)) - ((sp50 - posZ) * (sp60 - posX)); + thing1 = ((sp50 - posZ) * (sp64 - posX)) - ((sp58 - posZ) * (sp5c - posX)); + if (((temp_f14 >= 0) && (thing0 >= 0) && (thing1 >= 0)) || ((temp_f14 <= 0) && (thing0 <= 0) && (thing1 <= 0))) { + ret = 1; } - return sp42; + return ret; } -#else -GLOBAL_ASM("asm/non_matchings/code_8001F980/func_8001FD78.s") -#endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_8001F980(s32 *, s32 *); // extern -? func_8001F9E4(s8); // extern -s32 func_8001FB0C(Player *, s32, f32, f32); // extern -extern ? D_800DDB50; -extern s32 D_800DDB58; +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_8001F9E4(s8); /* extern */ +? func_8002934C(Player *, Camera *, s8, s8); /* extern */ extern ? D_80164AB0; extern ? D_80164AC0; extern ? D_80164AD0; +extern ? gFramebuffer0; +extern ? gFramebuffer1; +extern ? gFramebuffer2; extern u16 sRenderingFramebuffer; +static ? D_800DDB50; /* unable to generate initializer */ +static s32 D_800DDB58[4] = { 0, (s32) &gFramebuffer0, (s32) &gFramebuffer1, (s32) &gFramebuffer2 }; -void func_80020000(Player *arg0, s32 arg1, s8 arg2, s8 arg3) { +void func_80020000(Player *player, Camera *camera, u8 arg2, u8 arg3) { s32 sp4C; s32 sp48; - s32 sp38; + s32 sp38; /* compiler-managed */ s32 sp34; - s16 *temp_a0; - s16 *temp_a0_2; - s16 *temp_a0_3; s16 *temp_a2; + s16 *var_a0; s32 temp_a1; s32 temp_a1_2; s32 temp_a1_3; @@ -245,96 +181,92 @@ void func_80020000(Player *arg0, s32 arg1, s8 arg2, s8 arg3) { s32 temp_v1_5; u16 temp_v1; void *temp_t0; - s16 *phi_a0; - if ((arg0->unk_000 & PLAYER_EXISTS) == 0x8000) { - func_8001F9E4(arg3); - temp_t3 = arg3 * 4; + if ((player->unk_000 & 0x8000) == 0x8000) { + func_8001F9E4((s8) arg3); + temp_t3 = (s8) arg3 * 4; sp38 = temp_t3; temp_v0 = 2 << temp_t3; - if (temp_v0 == (arg0->unk_002 & temp_v0)) { - if ((arg0->unk_000 & PLAYER_START_SEQUENCE) == 0) { + if (temp_v0 == (player->unk_002 & temp_v0)) { + if (!(player->unk_000 & 0x2000)) { sp34 = temp_v0; - func_8002934C(arg0, arg1, arg3, arg2); + func_8002934C(player, camera, (s8) arg3, (s8) arg2); } else { sp34 = temp_v0; - func_8002934C(arg0, arg1, arg3, arg2); - arg0->unk_0C4 = 0; - arg0->unk_206 = 0; - (arg0 + (arg3 * 2))->unk50 = 0; + func_8002934C(player, camera, (s8) arg3, (s8) arg2); + player->unk_0C4 = 0; + player->unk_206 = 0; + (player + ((s8) arg3 * 2))->unk50 = 0; } } - sp34 = 2 << temp_t3; + sp34 = temp_v0; func_8001F980(&sp4C, &sp48); - temp_v1 = arg0->unk_002; + temp_v1 = player->unk_002; temp_v0_2 = 1 << sp38; - if (((2 << temp_t3) == (temp_v1 & (2 << temp_t3))) && (temp_v0_2 == (temp_v1 & temp_v0_2))) { - temp_t0 = arg0 + (arg3 * 2); + if ((sp34 == (temp_v1 & sp34)) && (temp_v0_2 == (temp_v1 & temp_v0_2))) { + temp_t0 = player + ((s8) arg3 * 2); sp38 = temp_t0; - if (((func_8001FB0C(arg0, arg1, D_80165570 + sp4C, D_80165572 + sp48) == 1) & 0xFFFF) != 0) { - temp_v0_3 = D_800DDB58; - temp_v1_2 = arg2 * 2; + if ((func_8001FB0C(player, camera, (f32) (D_80165570 + sp4C), (f32) (D_80165572 + sp48)) == 1) & 0xFFFF) { + temp_v0_3 = *D_800DDB58; + temp_v1_2 = (s8) arg2 * 2; temp_a1 = temp_v0_3 * 2; - *(&D_80164AB0 + temp_a1) = arg2; - *(&D_80164AC0 + temp_a1) = arg3; - *(&D_80164AD0 + (temp_v0_3 * 4)) = arg0; - D_800DDB58 = temp_v0_3 + 1; - *(D_80165190 + ((arg3 * 0x10) + temp_v1_2)) = 0; - *(D_801650D0 + ((arg3 * 0x10) + temp_v1_2)) = arg0->unk_244[arg3]; - *(D_80165110 + ((arg3 * 0x10) + temp_v1_2)) = arg0->unk_24C[arg3]; - temp_a0 = (arg3 * 0x10) + temp_v1_2 + D_801651D0; - *(D_80165150 + ((arg3 * 0x10) + temp_v1_2)) = arg0->unk_0A8; - *temp_a0 = *temp_a0 + 1; - phi_a0 = temp_a0; - if (*temp_a0 == 2) { + *(&D_80164AB0 + temp_a1) = (s16) (s8) arg2; + *(&D_80164AC0 + temp_a1) = (s16) (s8) arg3; + *(&D_80164AD0 + (temp_v0_3 * 4)) = player; + *D_800DDB58 = temp_v0_3 + 1; + *(D_80165190 + (((s8) arg3 * 0x10) + temp_v1_2)) = 0; + *(D_801650D0 + (((s8) arg3 * 0x10) + temp_v1_2)) = player->unk_244[(s8) arg3]; + *(D_80165110 + (((s8) arg3 * 0x10) + temp_v1_2)) = player->unk_24C[(s8) arg3]; + var_a0 = ((s8) arg3 * 0x10) + temp_v1_2 + D_801651D0; + *(D_80165150 + (((s8) arg3 * 0x10) + temp_v1_2)) = player->unk_0A8; + *var_a0 += 1; + if (*var_a0 == 2) { goto block_21; } } else { sp38 = temp_t0; - if (((func_8001FB0C(arg0, arg1, D_80165574 + sp4C, D_80165576) == 1) & 0xFFFF) != 0) { - temp_v1_3 = arg2 * 2; - if ((sRenderingFramebuffer == *(&D_800DDB50 + arg2)) || (temp_v0_4 = *(D_801650D0 + ((arg3 * 0x10) + temp_v1_3)) - arg0->unk_244[arg3], ((temp_v0_4 < 0x14) == 0)) || (temp_v0_4 < -0x13) || (*(D_80165190 + ((arg3 * 0x10) + temp_v1_3)) == 1)) { - temp_v0_5 = D_800DDB58; - temp_v1_4 = arg2 * 2; + if ((func_8001FB0C(player, camera, (f32) (D_80165574 + sp4C), (f32) D_80165576) == 1) & 0xFFFF) { + temp_v1_3 = (s8) arg2 * 2; + if ((sRenderingFramebuffer == *(&D_800DDB50 + (s8) arg2)) || (temp_v0_4 = *(D_801650D0 + (((s8) arg3 * 0x10) + temp_v1_3)) - player->unk_244[(s8) arg3], ((temp_v0_4 < 0x14) == 0)) || (temp_v0_4 < -0x13) || (*(D_80165190 + (((s8) arg3 * 0x10) + temp_v1_3)) == (s16) 1U)) { + temp_v0_5 = *D_800DDB58; + temp_v1_4 = (s8) arg2 * 2; temp_a1_2 = temp_v0_5 * 2; - *(&D_80164AB0 + temp_a1_2) = arg2; - *(&D_80164AC0 + temp_a1_2) = arg3; - *(&D_80164AD0 + (temp_v0_5 * 4)) = arg0; - D_800DDB58 = temp_v0_5 + 1; - *(D_801650D0 + ((arg3 * 0x10) + temp_v1_4)) = arg0->unk_244[arg3]; - temp_t5 = arg3 * 0x10; - *(D_80165110 + (temp_t5 + temp_v1_4)) = arg0->unk_24C[arg3]; - *(D_80165150 + ((arg3 * 0x10) + temp_v1_4)) = arg0->unk_0A8; - *(D_80165190 + ((arg3 * 0x10) + temp_v1_4)) = 0; - temp_a0_2 = temp_t5 + temp_v1_4 + D_801651D0; - *temp_a0_2 = *temp_a0_2 + 1; - phi_a0 = temp_a0_2; - if (*temp_a0_2 == 2) { + *(&D_80164AB0 + temp_a1_2) = (s16) (s8) arg2; + *(&D_80164AC0 + temp_a1_2) = (s16) (s8) arg3; + *(&D_80164AD0 + (temp_v0_5 * 4)) = player; + *D_800DDB58 = temp_v0_5 + 1; + *(D_801650D0 + (((s8) arg3 * 0x10) + temp_v1_4)) = player->unk_244[(s8) arg3]; + temp_t5 = (s8) arg3 * 0x10; + *(D_80165110 + (temp_t5 + temp_v1_4)) = player->unk_24C[(s8) arg3]; + *(D_80165150 + (((s8) arg3 * 0x10) + temp_v1_4)) = player->unk_0A8; + *(D_80165190 + (((s8) arg3 * 0x10) + temp_v1_4)) = 0; + var_a0 = temp_t5 + temp_v1_4 + D_801651D0; + *var_a0 += 1; + if (*var_a0 == 2) { goto block_21; } } } else { - temp_v1_5 = arg2 * 2; - temp_a2 = (arg3 * 0x10) + temp_v1_5 + D_801650D0; - temp_v0_6 = *temp_a2 - arg0->unk_244[arg3]; - temp_t6 = arg3 * 0x10; - if ((temp_v0_6 >= 0x14) || (temp_v0_6 < -0x13) || (*(D_80165190 + ((arg3 * 0x10) + temp_v1_5)) == 1)) { - temp_v0_7 = D_800DDB58; + temp_v1_5 = (s8) arg2 * 2; + temp_a2 = ((s8) arg3 * 0x10) + temp_v1_5 + D_801650D0; + temp_v0_6 = *temp_a2 - player->unk_244[(s8) arg3]; + temp_t6 = (s8) arg3 * 0x10; + if ((temp_v0_6 >= 0x14) || (temp_v0_6 < -0x13) || (*(D_80165190 + (((s8) arg3 * 0x10) + temp_v1_5)) == (s16) 1U)) { + temp_v0_7 = *D_800DDB58; temp_a1_3 = temp_v0_7 * 2; - *(&D_80164AB0 + temp_a1_3) = arg2; - *(&D_80164AC0 + temp_a1_3) = arg3; - *(&D_80164AD0 + (temp_v0_7 * 4)) = arg0; - D_800DDB58 = temp_v0_7 + 1; - *temp_a2 = arg0->unk_244[arg3]; - *(D_80165110 + (temp_t6 + temp_v1_5)) = arg0->unk_24C[arg3]; - *(D_80165150 + ((arg3 * 0x10) + temp_v1_5)) = arg0->unk_0A8; - *(D_80165190 + ((arg3 * 0x10) + temp_v1_5)) = 0; - temp_a0_3 = temp_t6 + temp_v1_5 + D_801651D0; - *temp_a0_3 = *temp_a0_3 + 1; - phi_a0 = temp_a0_3; - if (*temp_a0_3 == 2) { + *(&D_80164AB0 + temp_a1_3) = (s16) (s8) arg2; + *(&D_80164AC0 + temp_a1_3) = (s16) (s8) arg3; + *(&D_80164AD0 + (temp_v0_7 * 4)) = player; + *D_800DDB58 = temp_v0_7 + 1; + *temp_a2 = (s16) player->unk_244[(s8) arg3]; + *(D_80165110 + (temp_t6 + temp_v1_5)) = player->unk_24C[(s8) arg3]; + *(D_80165150 + (((s8) arg3 * 0x10) + temp_v1_5)) = player->unk_0A8; + *(D_80165190 + (((s8) arg3 * 0x10) + temp_v1_5)) = 0; + var_a0 = temp_t6 + temp_v1_5 + D_801651D0; + *var_a0 += 1; + if (*var_a0 == 2) { block_21: - *phi_a0 = 0; + *var_a0 = 0; } } } @@ -1035,106 +967,77 @@ void func_80022744(void) { func_8002276C(); } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80022A98(Player *, ?); // extern - void func_8002276C(void) { - Player *temp_a0; - Player *temp_a0_2; - s32 temp_v0; - s32 temp_v0_2; - s32 temp_v0_3; - s32 temp_v0_4; - s32 temp_v0_5; - s32 phi_v0; - - temp_v0 = gActiveScreenMode; - if (temp_v0 != 0) { - if ((temp_v0 != 1) && (temp_v0 != 2)) { - if (temp_v0 != 3) { - return; - } - temp_v0_2 = gModeSelection; - if ((temp_v0_2 == VERSUS) || (temp_v0_2 == BATTLE)) { - func_80022A98(gPlayerOne, 0); - func_80022A98(gPlayerTwo, 1); - func_80022A98(gPlayerThree, 2); - if (gPlayerCountSelection1 == 4) { - func_80022A98(gPlayerFour, 3); - } - } - // Duplicate return node #31. Try simplifying control flow for better match - return; - } - temp_v0_3 = gModeSelection; - if (temp_v0_3 != GRAND_PRIX) { - if (temp_v0_3 != TIME_TRIALS) { - if ((temp_v0_3 != VERSUS) && (temp_v0_3 != BATTLE)) { - return; - } - func_80022A98(gPlayerOne, 0); - func_80022A98(gPlayerTwo, 1); - return; - } - func_80022A98(gPlayerOne, 0); - return; - } - func_80022A98(gPlayerOne, 0); - func_80022A98(gPlayerTwo, 1); - func_80022A98(gPlayerThree, 2); - func_80022A98(gPlayerFour, 3); - func_80022A98(gPlayerFive, 4); - func_80022A98(gPlayerSix, 5); - func_80022A98(gPlayerSeven, 6); - func_80022A98(gPlayerEight, 7); - return; - } - temp_v0_4 = gModeSelection; - if (temp_v0_4 != GRAND_PRIX) { - if (temp_v0_4 != TIME_TRIALS) { - if ((temp_v0_4 != VERSUS) && (temp_v0_4 != BATTLE)) { - return; - } + switch (gActiveScreenMode) { /* irregular */ + case SCREEN_MODE_1P: + switch (gModeSelection) { /* switch 1; irregular */ + case GRAND_PRIX: /* switch 1 */ func_80022A98(gPlayerOne, 0); func_80022A98(gPlayerTwo, 1); - temp_v0_5 = gPlayerCountSelection1; - phi_v0 = temp_v0_5; - if (temp_v0_5 >= 3) { + func_80022A98(gPlayerThree, 2); + func_80022A98(gPlayerFour, 3); + func_80022A98(gPlayerFive, 4); + func_80022A98(gPlayerSix, 5); + func_80022A98(gPlayerSeven, 6); + func_80022A98(gPlayerEight, 7); + break; + case TIME_TRIALS: /* switch 1 */ + func_80022A98(gPlayerOne, 0); + if ((gPlayerTwo->unk_000 & 0x100) == 0x100) { + func_80022A98(gPlayerTwo, 1); + } + if ((gPlayerThree->unk_000 & 0x100) == 0x100) { func_80022A98(gPlayerThree, 2); - phi_v0 = gPlayerCountSelection1; } - if (phi_v0 == 4) { + break; + case VERSUS: /* switch 1 */ + case BATTLE: /* switch 1 */ + func_80022A98(gPlayerOne, 0); + func_80022A98(gPlayerTwo, 1); + if (gPlayerCountSelection1 >= 3) { + func_80022A98(gPlayerThree, 2); + } + if (gPlayerCountSelection1 == 4) { func_80022A98(gPlayerFour, 3); - return; } - // Duplicate return node #31. Try simplifying control flow for better match - return; + break; } - func_80022A98(gPlayerOne, 0); - temp_a0 = gPlayerTwo; - if ((temp_a0->unk_000 & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) { - func_80022A98(temp_a0, 1); + break; + case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: + case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: + switch (gModeSelection) { /* switch 2; irregular */ + case GRAND_PRIX: /* switch 2 */ + func_80022A98(gPlayerOne, 0); + func_80022A98(gPlayerTwo, 1); + func_80022A98(gPlayerThree, 2); + func_80022A98(gPlayerFour, 3); + func_80022A98(gPlayerFive, 4); + func_80022A98(gPlayerSix, 5); + func_80022A98(gPlayerSeven, 6); + func_80022A98(gPlayerEight, 7); + break; + case VERSUS: /* switch 2 */ + case BATTLE: /* switch 2 */ + func_80022A98(gPlayerOne, 0); + func_80022A98(gPlayerTwo, 1); + break; + case TIME_TRIALS: /* switch 2 */ + func_80022A98(gPlayerOne, 0); + break; } - temp_a0_2 = gPlayerThree; - if ((temp_a0_2->unk_000 & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) { - func_80022A98(temp_a0_2, 2); - return; + break; + case SCREEN_MODE_3P_4P_SPLITSCREEN: + if ((VERSUS == gModeSelection) || (BATTLE == gModeSelection)) { + func_80022A98(gPlayerOne, 0); + func_80022A98(gPlayerTwo, 1); + func_80022A98(gPlayerThree, 2); + if (gPlayerCountSelection1 == 4) { + func_80022A98(gPlayerFour, 3); + } } - return; + break; } - func_80022A98(gPlayerOne, 0); - func_80022A98(gPlayerTwo, 1); - func_80022A98(gPlayerThree, 2); - func_80022A98(gPlayerFour, 3); - func_80022A98(gPlayerFive, 4); - func_80022A98(gPlayerSix, 5); - func_80022A98(gPlayerSeven, 6); - func_80022A98(gPlayerEight, 7); } -#else -GLOBAL_ASM("asm/non_matchings/code_8001F980/func_8002276C.s") -#endif void func_80022A98(Player* player, s8 arg1) { if ((player->unk_000 & PLAYER_EXISTS) == PLAYER_EXISTS) { @@ -1155,23 +1058,21 @@ void func_80022A98(Player* player, s8 arg1) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern f64 D_800ED690; +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +extern f64 D_800ED690;// = 0.7; -void func_80022B50(void *arg0, ? arg1) { +void func_80022B50(Player *player, s32 unused) { f32 temp_f0; - s16 temp_v0; - s16 phi_v0; + s16 var_v0; - temp_v0 = arg0->unkDB6; - temp_f0 = arg0->unkDC4; - phi_v0 = temp_v0; - if (temp_v0 < 5) { - phi_v0 = temp_v0 + 1; + var_v0 = player->unk_DB6; + temp_f0 = player->unk_DC4; + if (var_v0 < 5) { + var_v0 += 1; } - arg0->unkDC4 = temp_f0; - arg0->unkDB6 = phi_v0; - arg0->unkDA4 = (phi_v0 * temp_f0) - (D_800ED690 * (phi_v0 * phi_v0)); + player->unk_DC4 = temp_f0; + player->unk_DB6 = var_v0; + player->unk_DA4 = (s16) (s32) ((f64) ((f32) var_v0 * temp_f0) - (0.7 * (f64) (var_v0 * var_v0))); } #else GLOBAL_ASM("asm/non_matchings/code_8001F980/func_80022B50.s") @@ -1657,25 +1558,16 @@ GLOBAL_ASM("asm/non_matchings/code_8001F980/func_80023BF0.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80021E10(? *, f32 *, s16 *); // extern -? func_80021F84(? *, f32); // extern -? func_80022180(void *, ? *); // extern -? func_80042A20(? *, f32 *, f32 *, s32, f32); // extern -? func_8004B414(?, ?, ?, ?); // extern -f32 sins(u16, s32); // extern -f32 coss(s32, s32); // extern +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_8004B414(?, ?, ?, ?); /* extern */ extern ? D_0D008C78; extern ? D_0D008D58; -extern ? D_800DDBD4; -extern ? D_800E51D0; -extern ? D_800E5210; -extern f64 D_800ED6C8; -extern s32 D_8018D474; -extern void *gDisplayListHead; +extern u32 D_8018D474; +static f32 D_800DDBD4[8] = { 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f }; +static ? D_800E51D0; /* unable to generate initializer */ +static ? D_800E5210; /* unable to generate initializer */ -void func_80023C84(void *arg0, s8 arg1, s8 arg2) { - ? sp118; +void func_80023C84(Player *player, s8 arg1, s8 arg2) { f32 spD4; f32 spD0; f32 spCC; @@ -1690,208 +1582,197 @@ void func_80023C84(void *arg0, s8 arg1, s8 arg2) { f32 spAC; f32 sp9C; f32 sp38; - f32 temp_f2; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; + f32 var_f2; s16 temp_v0; s16 temp_v1; s32 temp_s0; - s32 temp_t7; + s32 temp_s0_2; s32 temp_t9; s32 temp_v0_2; s32 temp_v1_2; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_14; - void *temp_v0_15; - void *temp_v0_16; - void *temp_v0_17; - void *temp_v0_18; - void *temp_v0_19; - void *temp_v0_20; - void *temp_v0_21; - void *temp_v0_22; - void *temp_v0_23; - void *temp_v0_24; - void *temp_v0_25; - void *temp_v0_26; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - f32 phi_f2; - f32 phi_f2_2; - temp_v0 = arg0->unk2E; - temp_v1 = arg0->unkC0; - temp_t7 = (temp_v0 + (arg0 + (arg2 * 2))->unk48 + temp_v1) & 0xFFFF; - temp_t9 = ((temp_t7 / 0x80) << 7) & 0xFFFF; + temp_v0 = player->unk_02E; + temp_v1 = player->unk_0C0; + temp_t9 = (((s32) ((temp_v0 + (player + (arg2 * 2))->unk48 + temp_v1) & 0xFFFF) / 128) << 7) & 0xFFFF; spC0 = -temp_v0 - temp_v1; - spB0 = -coss(temp_t9 & 0xFFFF, temp_t7) * 2.0f; - spAC = -sins(temp_t9 & 0xFFFF) * 2.0f; - temp_v0_2 = arg0->unkBC; + temp_s0 = temp_t9; + spB0 = -coss(temp_t9 & 0xFFFF) * 2.0f; + spAC = -sins(temp_s0 & 0xFFFF) * 2.0f; + temp_v0_2 = player->unk_0BC; temp_v1_2 = temp_v0_2 & 0x400; - if (((temp_v0_2 & 0x1000000) == 0x1000000) || (temp_v1_2 == 0x400) || ((temp_v0_2 & 0x80000) == 0x80000) || ((temp_v0_2 & 0x800000) == 0x800000) || (temp_v1_2 == 0x400) || ((arg0->unkCA & 2) == 2) || ((temp_v0_2 & 0x2000000) == 0x2000000) || ((temp_v0_2 & 0x10000) == 0x10000) || ((temp_v0_2 & 8) == 8)) { - temp_f2 = 1.0 - (arg0->unk124 * D_800ED6C8); - phi_f2 = temp_f2; - if (temp_f2 < 0.0f) { - phi_f2 = 0.0f; + if (((temp_v0_2 & 0x01000000) == 0x01000000) || (temp_v1_2 == 0x400) || ((temp_v0_2 & 0x80000) == 0x80000) || ((temp_v0_2 & 0x800000) == 0x800000) || (temp_v1_2 == 0x400) || ((player->unk_0CA & 2) == 2) || ((temp_v0_2 & 0x02000000) == 0x02000000) || ((temp_v0_2 & 0x10000) == 0x10000) || ((temp_v0_2 & 8) == 8)) { + var_f2 = (f32) (1.0 - ((f64) player->unk_110.unk44 * 0.02)); + if (var_f2 < 0.0f) { + var_f2 = 0.0f; } - phi_f2_2 = phi_f2; - if (phi_f2 > 1.0f) { - phi_f2_2 = 1.0f; + if (var_f2 > 1.0f) { + var_f2 = 1.0f; } - spB4 = arg0->unk140; - spBC = arg0->unk148; - sp9C = phi_f2_2; - spB8 = arg0->unk144; - sp38 = sins(spC0, 0x400); - spCC = (coss(spC0 & 0xFFFF) * spAC) + (spB0 * sp38) + arg0->unk14; - spD0 = arg0->unk74 + 1.0f; - sp38 = coss(spC0 & 0xFFFF); - spD4 = ((spB0 * sp38) - (sins(spC0 & 0xFFFF) * spAC)) + arg0->unk1C; - func_80042A20(&sp118, &spB4, &spCC, (spC0 + arg0->unk42) & 0xFFFF, *(&D_800DDBD4 + (arg0->unk254 * 4)) * arg0->unk224 * phi_f2_2); + spB4 = player->unk_110.unk60[0]; + spBC = player->unk_110.unk60[2]; + sp9C = var_f2; + spB8 = player->unk_110.unk60[1]; + sp38 = sins((u16) spC0); + spCC = (coss((u16) spC0 & 0xFFFF) * spAC) + (spB0 * sp38) + player->pos[0]; + spD0 = player->unk_074 + 1.0f; + sp38 = coss((u16) spC0 & 0xFFFF); + spD4 = ((spB0 * sp38) - (sins((u16) spC0 & 0xFFFF) * spAC)) + player->pos[2]; + func_80042A20((f32 (*)[4]) &sp118[0], &spB4, &spCC, (spC0 + player->unk_042) & 0xFFFF, D_800DDBD4[player->characterId] * player->unk_224 * var_f2); } else { - spC4 = arg0->unkC4; + spC4 = player->unk_0C4; spC6 = spC0; - spC8 = arg0->unk206 * 2; - sp38 = sins(spC0, 0x400); - spCC = (coss(spC0 & 0xFFFF) * spAC) + (spB0 * sp38) + arg0->unk14; - spD0 = arg0->unk74 + 1.0f; - sp38 = coss(spC0 & 0xFFFF); - spD4 = ((spB0 * sp38) - (sins(spC0 & 0xFFFF) * spAC)) + arg0->unk1C; - func_80021E10(&sp118, &spCC, &spC4); - func_80021F84(&sp118, *(&D_800DDBD4 + (arg0->unk254 * 4)) * arg0->unk224); + spC8 = player->unk_206 * 2; + sp38 = sins((u16) spC0); + spCC = (coss((u16) spC0 & 0xFFFF) * spAC) + (spB0 * sp38) + player->pos[0]; + spD0 = player->unk_074 + 1.0f; + sp38 = coss((u16) spC0 & 0xFFFF); + spD4 = ((spB0 * sp38) - (sins((u16) spC0 & 0xFFFF) * spAC)) + player->pos[2]; + func_80021E10((f32 (*)[4]) &sp118[0], &spCC, &spC4); + func_80021F84((f32 (*)[4]) &sp118[0], D_800DDBD4[player->characterId] * player->unk_224); } - temp_s0 = arg2 << 9; - func_80022180(gGfxPool + (arg1 << 6) + temp_s0 + 0xEAC0, &sp118); + temp_s0_2 = arg2 << 9; + func_80022180(&gGfxPool->mtxPool[arg1] + temp_s0_2 + 0xEAC0, (f32 (*)[4]) &sp118[0]); temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0x1020040; - temp_v0_3->unk4 = (gGfxPool + (arg1 << 6) + temp_s0 + 0xEAC0) & 0x1FFFFFFF; + temp_v0_3->words.w0 = 0x01020040; + temp_v0_3->words.w1 = (s32) (&gGfxPool->mtxPool[arg1] + temp_s0_2 + 0xEAC0) & 0x1FFFFFFF; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = &D_0D008D58; - temp_v0_4->unk0 = 0x6000000; + temp_v0_4->words.w1 = (u32) &D_0D008D58; + temp_v0_4->words.w0 = 0x06000000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xBA000E02; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xBA000E02; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xFD900000; - temp_v0_6->unk4 = D_8018D474; + temp_v0_6->words.w0 = 0xFD900000; + temp_v0_6->words.w1 = D_8018D474; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x7080200; - temp_v0_7->unk0 = 0xF5900000; + temp_v0_7->words.w1 = 0x07080200; + temp_v0_7->words.w0 = 0xF5900000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE6000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE6000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x73FF100; - temp_v0_9->unk0 = 0xF3000000; + temp_v0_9->words.w1 = 0x073FF100; + temp_v0_9->words.w0 = 0xF3000000; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = 0; - temp_v0_10->unk0 = 0xE7000000; + temp_v0_10->words.w1 = 0; + temp_v0_10->words.w0 = 0xE7000000; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xF5881000; - temp_v0_11->unk4 = 0x80200; + temp_v0_11->words.w0 = 0xF5881000; + temp_v0_11->words.w1 = 0x00080200; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0xF2000000; - temp_v0_12->unk4 = 0xFC07C; + temp_v0_12->words.w0 = 0xF2000000; + temp_v0_12->words.w1 = 0x000FC07C; func_8004B414(0, 0, 0, 0xFF); temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0xB900031D; - temp_v0_13->unk4 = 0x504B50; + temp_v0_13->words.w0 = 0xB900031D; + temp_v0_13->words.w1 = 0x00504B50; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = &D_800E51D0; - temp_v0_14->unk0 = 0x400103F; + temp_v0_14->words.w1 = (u32) &D_800E51D0; + temp_v0_14->words.w0 = 0x0400103F; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = &D_0D008C78; - temp_v0_15->unk0 = 0x6000000; + temp_v0_15->words.w1 = (u32) &D_0D008C78; + temp_v0_15->words.w0 = 0x06000000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk0 = 0xFD900000; - temp_v0_16->unk4 = D_8018D474 + 0x800; + temp_v0_16->words.w0 = 0xFD900000; + temp_v0_16->words.w1 = D_8018D474 + 0x800; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0x7080200; - temp_v0_17->unk0 = 0xF5900000; + temp_v0_17->words.w1 = 0x07080200; + temp_v0_17->words.w0 = 0xF5900000; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = 0; - temp_v0_18->unk0 = 0xE6000000; + temp_v0_18->words.w1 = 0; + temp_v0_18->words.w0 = 0xE6000000; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = 0x73FF100; - temp_v0_19->unk0 = 0xF3000000; + temp_v0_19->words.w1 = 0x073FF100; + temp_v0_19->words.w0 = 0xF3000000; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = 0; - temp_v0_20->unk0 = 0xE7000000; + temp_v0_20->words.w1 = 0; + temp_v0_20->words.w0 = 0xE7000000; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk0 = 0xF5881000; - temp_v0_21->unk4 = 0x80200; + temp_v0_21->words.w0 = 0xF5881000; + temp_v0_21->words.w1 = 0x00080200; temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk0 = 0xF2000000; - temp_v0_22->unk4 = 0xFC07C; + temp_v0_22->words.w0 = 0xF2000000; + temp_v0_22->words.w1 = 0x000FC07C; func_8004B414(0, 0, 0, 0xFF); temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk0 = 0xB900031D; - temp_v0_23->unk4 = 0x504B50; + temp_v0_23->words.w0 = 0xB900031D; + temp_v0_23->words.w1 = 0x00504B50; temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = &D_800E5210; - temp_v0_24->unk0 = 0x400103F; + temp_v0_24->words.w1 = (u32) &D_800E5210; + temp_v0_24->words.w0 = 0x0400103F; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = &D_0D008C78; - temp_v0_25->unk0 = 0x6000000; + temp_v0_25->words.w1 = (u32) &D_0D008C78; + temp_v0_25->words.w0 = 0x06000000; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk4 = 0x10001; - temp_v0_26->unk0 = 0xBB000000; + temp_v0_26->words.w1 = 0x00010001; + temp_v0_26->words.w0 = 0xBB000000; } #else GLOBAL_ASM("asm/non_matchings/code_8001F980/func_80023C84.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80021E10(? *, f32 *, s16 *); // extern -? func_80021F84(? *, f32); // extern -? func_80022180(void *, ? *); // extern -? func_8004B414(?, ?, ?, ?); // extern -f32 sins(s32); // extern -f32 coss(s32, s32); // extern +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_8004B414(?, ?, ?, ?); /* extern */ extern ? D_0D008C78; extern ? D_0D008D58; -extern ? D_800DDBD4; -extern ? D_800DDE9C; -extern ? D_800E51D0; -extern ? D_800E5210; extern ? D_80165C20; extern ? D_80183EA0; -extern s32 D_8018D474; -extern void *gDisplayListHead; +extern u32 D_8018D474; +static f32 D_800DDBD4[8] = { 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f }; +static ? D_800DDE9C; /* unable to generate initializer */ +static ? D_800E51D0; /* unable to generate initializer */ +static ? D_800E5210; /* unable to generate initializer */ -void func_80024374(void *arg0, s8 arg1, s8 arg2) { - ? sp118; +void func_80024374(Player *player, s8 arg1, s8 arg2) { f32 spD4; f32 spD0; f32 spCC; @@ -1903,181 +1784,173 @@ void func_80024374(void *arg0, s8 arg1, s8 arg2) { f32 spAC; ? sp94; f32 sp30; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; f32 temp_f18; s16 temp_v0; s16 temp_v1; s32 temp_s0; s32 temp_s0_2; - s32 temp_t6; + s32 temp_s0_3; s32 temp_t8; s32 temp_t9; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_14; - void *temp_v0_15; - void *temp_v0_16; - void *temp_v0_17; - void *temp_v0_18; - void *temp_v0_19; - void *temp_v0_20; - void *temp_v0_21; - void *temp_v0_22; - void *temp_v0_23; - void *temp_v0_24; - void *temp_v0_25; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - sp94.unk0 = D_800DDE9C.unk0; - sp94.unk4 = D_800DDE9C.unk4; - sp94.unk8 = D_800DDE9C.unk8; - temp_v0 = arg0->unk2E; - temp_v1 = arg0->unkC0; - temp_t6 = (temp_v0 + (arg0 + (arg2 * 2))->unk48 + temp_v1) & 0xFFFF; - temp_t9 = ((temp_t6 / 0x80) << 7) & 0xFFFF; + sp94.unk0 = (s32) D_800DDE9C.unk0; + sp94.unk4 = (s32) D_800DDE9C.unk4; + sp94.unk8 = (s32) D_800DDE9C.unk8; + temp_v0 = player->unk_02E; + temp_v1 = player->unk_0C0; + temp_t9 = (((s32) ((temp_v0 + (player + (arg2 * 2))->unk48 + temp_v1) & 0xFFFF) / 128) << 7) & 0xFFFF; spC0 = -temp_v0 - temp_v1; - spB0 = -coss(temp_t9 & 0xFFFF, temp_t6) * 3.0f; - temp_f18 = -sins(temp_t9 & 0xFFFF) * 3.0f; + temp_s0 = temp_t9; + spB0 = -coss(temp_t9 & 0xFFFF) * 3.0f; + temp_f18 = -sins(temp_s0 & 0xFFFF) * 3.0f; spC4 = 0; - temp_s0 = spC0 & 0xFFFF; + temp_s0_2 = spC0 & 0xFFFF; spC8 = 0; spC6 = spC0; spAC = temp_f18; - sp30 = sins(temp_s0 & 0xFFFF); - spCC = (coss(temp_s0 & 0xFFFF) * spAC) + (spB0 * sp30) + arg0->unk14; - sp30 = coss(temp_s0 & 0xFFFF); + sp30 = sins(temp_s0_2 & 0xFFFF); + spCC = (coss(temp_s0_2 & 0xFFFF) * spAC) + (spB0 * sp30) + player->pos[0]; + sp30 = coss(temp_s0_2 & 0xFFFF); temp_t8 = arg1 * 4; - spD4 = ((spB0 * sp30) - (sins(temp_s0 & 0xFFFF) * temp_f18)) + arg0->unk1C; + spD4 = ((spB0 * sp30) - (sins(temp_s0_2 & 0xFFFF) * temp_f18)) + player->pos[2]; spD0 = (sp + temp_t8)->unk94 + *(&D_80165C20 + (*(&D_80183EA0 + temp_t8) * 0xE0)); - func_80021E10(&sp118, &spCC, &spC4); - func_80021F84(&sp118, *(&D_800DDBD4 + (arg0->unk254 * 4)) * arg0->unk224); - temp_s0_2 = arg2 << 9; - func_80022180(gGfxPool + (arg1 << 6) + temp_s0_2 + 0xEAC0, &sp118); + func_80021E10((f32 (*)[4]) &sp118[0], &spCC, &spC4); + func_80021F84((f32 (*)[4]) &sp118[0], D_800DDBD4[player->characterId] * player->unk_224); + temp_s0_3 = arg2 << 9; + func_80022180(&gGfxPool->mtxPool[arg1] + temp_s0_3 + 0xEAC0, (f32 (*)[4]) &sp118[0]); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x1020040; - temp_v0_2->unk4 = (gGfxPool + (arg1 << 6) + temp_s0_2 + 0xEAC0) & 0x1FFFFFFF; + temp_v0_2->words.w0 = 0x01020040; + temp_v0_2->words.w1 = (s32) (&gGfxPool->mtxPool[arg1] + temp_s0_3 + 0xEAC0) & 0x1FFFFFFF; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = &D_0D008D58; - temp_v0_3->unk0 = 0x6000000; + temp_v0_3->words.w1 = (u32) &D_0D008D58; + temp_v0_3->words.w0 = 0x06000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0; - temp_v0_4->unk0 = 0xBA000E02; + temp_v0_4->words.w1 = 0; + temp_v0_4->words.w0 = 0xBA000E02; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xFD900000; - temp_v0_5->unk4 = D_8018D474; + temp_v0_5->words.w0 = 0xFD900000; + temp_v0_5->words.w1 = D_8018D474; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x7080200; - temp_v0_6->unk0 = 0xF5900000; + temp_v0_6->words.w1 = 0x07080200; + temp_v0_6->words.w0 = 0xF5900000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE6000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE6000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0x73FF100; - temp_v0_8->unk0 = 0xF3000000; + temp_v0_8->words.w1 = 0x073FF100; + temp_v0_8->words.w0 = 0xF3000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0; - temp_v0_9->unk0 = 0xE7000000; + temp_v0_9->words.w1 = 0; + temp_v0_9->words.w0 = 0xE7000000; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0xF5881000; - temp_v0_10->unk4 = 0x80200; + temp_v0_10->words.w0 = 0xF5881000; + temp_v0_10->words.w1 = 0x00080200; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xF2000000; - temp_v0_11->unk4 = 0xFC07C; + temp_v0_11->words.w0 = 0xF2000000; + temp_v0_11->words.w1 = 0x000FC07C; func_8004B414(0, 0, 0, 0xD0); temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0xB900031D; - temp_v0_12->unk4 = 0x504B50; + temp_v0_12->words.w0 = 0xB900031D; + temp_v0_12->words.w1 = 0x00504B50; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = &D_800E51D0; - temp_v0_13->unk0 = 0x400103F; + temp_v0_13->words.w1 = (u32) &D_800E51D0; + temp_v0_13->words.w0 = 0x0400103F; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = &D_0D008C78; - temp_v0_14->unk0 = 0x6000000; + temp_v0_14->words.w1 = (u32) &D_0D008C78; + temp_v0_14->words.w0 = 0x06000000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk0 = 0xFD900000; - temp_v0_15->unk4 = D_8018D474 + 0x800; + temp_v0_15->words.w0 = 0xFD900000; + temp_v0_15->words.w1 = D_8018D474 + 0x800; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0x7080200; - temp_v0_16->unk0 = 0xF5900000; + temp_v0_16->words.w1 = 0x07080200; + temp_v0_16->words.w0 = 0xF5900000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0; - temp_v0_17->unk0 = 0xE6000000; + temp_v0_17->words.w1 = 0; + temp_v0_17->words.w0 = 0xE6000000; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = 0x73FF100; - temp_v0_18->unk0 = 0xF3000000; + temp_v0_18->words.w1 = 0x073FF100; + temp_v0_18->words.w0 = 0xF3000000; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = 0; - temp_v0_19->unk0 = 0xE7000000; + temp_v0_19->words.w1 = 0; + temp_v0_19->words.w0 = 0xE7000000; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk0 = 0xF5881000; - temp_v0_20->unk4 = 0x80200; + temp_v0_20->words.w0 = 0xF5881000; + temp_v0_20->words.w1 = 0x00080200; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk0 = 0xF2000000; - temp_v0_21->unk4 = 0xFC07C; + temp_v0_21->words.w0 = 0xF2000000; + temp_v0_21->words.w1 = 0x000FC07C; func_8004B414(0, 0, 0, 0xD0); temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk0 = 0xB900031D; - temp_v0_22->unk4 = 0x504B50; + temp_v0_22->words.w0 = 0xB900031D; + temp_v0_22->words.w1 = 0x00504B50; temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = &D_800E5210; - temp_v0_23->unk0 = 0x400103F; + temp_v0_23->words.w1 = (u32) &D_800E5210; + temp_v0_23->words.w0 = 0x0400103F; temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = &D_0D008C78; - temp_v0_24->unk0 = 0x6000000; + temp_v0_24->words.w1 = (u32) &D_0D008C78; + temp_v0_24->words.w0 = 0x06000000; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = 0x10001; - temp_v0_25->unk0 = 0xBB000000; + temp_v0_25->words.w1 = 0x00010001; + temp_v0_25->words.w0 = 0xBB000000; } #else GLOBAL_ASM("asm/non_matchings/code_8001F980/func_80024374.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80021E10(? *, f32 *, s16 *); // extern -? func_80021F84(? *, f32); // extern -? func_80022180(void *, ? *); // extern -? func_8004B614(u16, u16, u16, u16, s32, s32, s32); // extern -? func_80062B18(f32 *, f32 *, f32 *, f32, f32, f32, s32, s32); // extern -f32 sins(s32); // extern +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_8004B614(u16, u16, u16, u16, s32, s32, s32); /* extern */ +? func_80062B18(f32 *, f32 *, f32 *, f32, f32, f32, s32, s32); /* extern */ extern ? D_0D008C78; extern ? D_0D008CD8; -extern ? D_800DDBB4; -extern ? D_800DDBD4; -extern f64 D_800ED6D0; -extern ? D_80164714; extern void *D_80164B04; extern u8 *D_80164B08; extern u8 *D_80164B0C; @@ -2088,10 +1961,10 @@ extern ? D_80164B40; extern ? D_80164B50; extern ? D_80164B60; extern ? D_8018D970; -extern s32 *gDisplayListHead; +static ? D_800DDBB4; /* unable to generate initializer */ +static f32 D_800DDBD4[8] = { 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f }; -void func_800248D0(void *arg0, s8 arg1, s8 arg2, s8 arg3) { - ? sp1A4; +void func_800248D0(Player *player, s8 arg1, s8 arg2, s8 arg3) { f32 sp15C; f32 sp158; f32 sp154; @@ -2101,421 +1974,404 @@ void func_800248D0(void *arg0, s8 arg1, s8 arg2, s8 arg3) { f32 sp148; f32 sp144; f32 sp140; - void *sp44; + void *sp44; /* compiler-managed */ s32 sp40; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_27; + Gfx *temp_v0_28; + Gfx *temp_v0_29; + Gfx *temp_v0_30; + Gfx *temp_v0_31; + Gfx *temp_v0_32; + Gfx *temp_v0_33; + Gfx *temp_v0_34; + Gfx *temp_v0_35; + Gfx *temp_v0_36; + Gfx *temp_v0_37; + Gfx *temp_v0_38; + Gfx *temp_v0_39; + Gfx *temp_v0_40; + Gfx *temp_v0_41; + Gfx *temp_v0_42; + Gfx *temp_v0_43; + Gfx *temp_v0_44; + Gfx *temp_v0_45; + Gfx *temp_v0_46; + Gfx *temp_v0_47; + Gfx *temp_v0_48; + Gfx *temp_v0_49; + Gfx *temp_v0_50; + Gfx *temp_v0_51; + Gfx *temp_v0_52; + Gfx *temp_v0_53; + Gfx *temp_v0_54; + Gfx *temp_v0_55; + Gfx *temp_v0_56; + Gfx *temp_v0_57; + Gfx *temp_v0_58; + Gfx *temp_v0_59; + Gfx *temp_v0_5; + Gfx *temp_v0_60; + Gfx *temp_v0_61; + Gfx *temp_v0_62; + Gfx *temp_v0_63; + Gfx *temp_v0_64; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; + Gfx *var_v0; s16 temp_v1; s32 *temp_t5; - s32 *temp_v0_10; - s32 *temp_v0_11; - s32 *temp_v0_12; - s32 *temp_v0_13; - s32 *temp_v0_14; - s32 *temp_v0_15; - s32 *temp_v0_16; - s32 *temp_v0_17; - s32 *temp_v0_18; - s32 *temp_v0_19; - s32 *temp_v0_20; - s32 *temp_v0_21; - s32 *temp_v0_22; - s32 *temp_v0_23; - s32 *temp_v0_24; - s32 *temp_v0_26; - s32 *temp_v0_27; - s32 *temp_v0_28; - s32 *temp_v0_29; - s32 *temp_v0_30; - s32 *temp_v0_31; - s32 *temp_v0_32; - s32 *temp_v0_33; - s32 *temp_v0_34; - s32 *temp_v0_35; - s32 *temp_v0_36; - s32 *temp_v0_37; - s32 *temp_v0_38; - s32 *temp_v0_39; - s32 *temp_v0_40; - s32 *temp_v0_41; - s32 *temp_v0_42; - s32 *temp_v0_43; - s32 *temp_v0_44; - s32 *temp_v0_45; - s32 *temp_v0_46; - s32 *temp_v0_47; - s32 *temp_v0_48; - s32 *temp_v0_49; - s32 *temp_v0_50; - s32 *temp_v0_51; - s32 *temp_v0_52; - s32 *temp_v0_53; - s32 *temp_v0_54; - s32 *temp_v0_55; - s32 *temp_v0_56; - s32 *temp_v0_57; - s32 *temp_v0_58; - s32 *temp_v0_59; - s32 *temp_v0_5; - s32 *temp_v0_60; - s32 *temp_v0_61; - s32 *temp_v0_62; - s32 *temp_v0_63; - s32 *temp_v0_64; - s32 *temp_v0_65; - s32 *temp_v0_66; - s32 *temp_v0_6; - s32 *temp_v0_7; - s32 *temp_v0_8; - s32 *temp_v0_9; - s32 temp_s0; s32 temp_t0; s32 temp_t7; - s32 temp_v0_25; + s32 temp_v0_24; + s32 var_s0; + u32 var_t7; u8 *temp_v0_3; u8 *temp_v0_4; + u8 *var_t9; void *temp_v0; void *temp_v0_2; - u8 *phi_t9; - s32 phi_t7; - s32 *phi_v0; - s32 **phi_v1; - s32 phi_s0; - if ((arg0->unk44 & 0x2000) != 0) { + if (player->unk_044 & 0x2000) { sp14C = 0; - temp_v0 = arg0 + (arg2 * 2); + temp_v0 = player + (arg2 * 2); sp150 = 0; sp14E = temp_v0->unk48; - func_80062B18(&sp148, &sp144, &sp140, 0.0f, 1.5f, 0.0f, -temp_v0->unk48, temp_v0->unk50); - sp158 = (arg0->unk18 - arg0->unk70) + (sp144 - 2.0); - sp154 = arg0->unk14 + sp148; - sp15C = arg0->unk1C + sp140; + func_80062B18(&sp148, &sp144, &sp140, 0.0f, 1.5f, 0.0f, (s32) -temp_v0->unk48, (s32) temp_v0->unk50); + sp158 = (f32) ((f64) (player->pos[1] - player->boundingBoxSize) + ((f64) sp144 - 2.0)); + sp154 = player->pos[0] + sp148; + sp15C = player->pos[2] + sp140; } else { - temp_v0_2 = arg0 + (arg2 * 2); + temp_v0_2 = player + (arg2 * 2); sp44 = temp_v0_2; - if ((arg0->unkBC & 8) == 8) { - sp14C = *(&D_80164714 + (arg2 * 0xB8)) - 0x4000; + if ((player->unk_0BC & 8) == 8) { + sp14C = *(cameras->rot + (arg2 * 0xB8)) - 0x4000; } else { - sp14C = -(sins((arg0->unk2E + temp_v0_2->unk48 + arg0->unkC0) & 0xFFFF) * temp_v0_2->unkCC) * D_800ED6D0; + sp14C = (s16) (s32) ((f64) -(s16) (s32) (sins((player->unk_02E + temp_v0_2->unk48 + player->unk_0C0) & 0xFFFF) * (f32) temp_v0_2->unkCC) * 0.8); } sp14E = temp_v0_2->unk48; sp150 = temp_v0_2->unk50; - if ((arg0->unkBC & 0x4000000) == 0x4000000) { - func_80062B18(&sp148, &sp144, &sp140, 0.0f, 8.0f, 0.0f, -temp_v0_2->unk48, temp_v0_2->unk50); - sp158 = (arg0->unk18 - arg0->unk70) + arg0->unk108; - sp154 = arg0->unk14 + sp148; - sp15C = arg0->unk1C + sp140; + if ((player->unk_0BC & 0x04000000) == 0x04000000) { + func_80062B18(&sp148, &sp144, &sp140, 0.0f, 8.0f, 0.0f, (s32) -temp_v0_2->unk48, (s32) temp_v0_2->unk50); + sp158 = (player->pos[1] - player->boundingBoxSize) + player->unk_108; + sp154 = player->pos[0] + sp148; + sp15C = player->pos[2] + sp140; } else { - func_80062B18(&sp148, &sp144, &sp140, 0.0f, 1.5f, 0.0f, -temp_v0_2->unk48, temp_v0_2->unk50); - sp158 = ((arg0->unk18 - arg0->unk70) + arg0->unk108) + (sp144 - 2.0); - sp154 = arg0->unk14 + sp148; - sp15C = arg0->unk1C + sp140; + func_80062B18(&sp148, &sp144, &sp140, 0.0f, 1.5f, 0.0f, (s32) -temp_v0_2->unk48, (s32) temp_v0_2->unk50); + sp158 = (f32) ((f64) ((player->pos[1] - player->boundingBoxSize) + player->unk_108) + ((f64) sp144 - 2.0)); + sp154 = player->pos[0] + sp148; + sp15C = player->pos[2] + sp140; } } temp_t0 = arg1 * 2; temp_v1 = *(D_801651D0 + ((arg2 * 0x10) + temp_t0)); D_80164B04 = (temp_v1 << 0xE) + (arg2 << 0xC) + (arg1 << 9) + D_802F1F80; if ((arg2 == 0) || (arg2 == 1)) { - temp_v0_4 = &D_802BFB80[(temp_v1 << 0x10) + (arg2 << 0xF) + (arg1 << 0xC)]; - D_80164B08 = temp_v0_4; - phi_t9 = temp_v0_4 + 0x7C0; + temp_v0_3 = &D_802BFB80[0][0][0].pixel_index_array[(temp_v1 << 0x10) + (arg2 << 0xF) + (arg1 << 0xC)]; + D_80164B08 = temp_v0_3; + var_t9 = temp_v0_3 + 0x7C0; } else { - temp_v0_3 = &D_802BFB80[(temp_v1 << 0x10) + (arg2 << 0xF) + (arg1 << 0xC)]; - D_80164B08 = temp_v0_3 + 0xFFFF4000; - phi_t9 = temp_v0_3 + 0xFFFF47C0; + temp_v0_4 = &D_802BFB80[0][0][0].pixel_index_array[(temp_v1 << 0x10) + (arg2 << 0xF) + (arg1 << 0xC)]; + D_80164B08 = temp_v0_4 + 0xFFFF4000; + var_t9 = temp_v0_4 + 0xFFFF47C0; } - D_80164B0C = phi_t9; + D_80164B0C = var_t9; sp44 = temp_t0; - func_80021E10(&sp1A4, &sp154, &sp14C); - func_80021F84(&sp1A4, *(&D_800DDBD4 + (arg0->unk254 * 4)) * arg0->unk224); + func_80021E10((f32 (*)[4]) &sp1A4[0], &sp154, &sp14C); + func_80021F84((f32 (*)[4]) &sp1A4[0], D_800DDBD4[player->characterId] * player->unk_224); temp_t7 = arg2 << 9; sp40 = temp_t7; - func_80022180(gGfxPool + (arg1 << 6) + temp_t7 + 0xF2C0, &sp1A4); - if ((arg0->unkBC & 0x80000000) == 0x80000000) { + func_80022180(&gGfxPool->mtxPool[arg1] + temp_t7 + 0xF2C0, (f32 (*)[4]) &sp1A4[0]); + if ((player->unk_0BC & 0x80000000) == 0x80000000) { if (arg2 == arg1) { temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0x1020040; - temp_v0_5->unk4 = (gGfxPool + (arg1 << 6) + sp40 + 0xF2C0) & 0x1FFFFFFF; + temp_v0_5->words.w0 = 0x01020040; + temp_v0_5->words.w1 = (s32) (&gGfxPool->mtxPool[arg1] + sp40 + 0xF2C0) & 0x1FFFFFFF; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0x6000000; - temp_v0_6->unk4 = &D_0D008CD8; + temp_v0_6->words.w0 = 0x06000000; + temp_v0_6->words.w1 = (u32) &D_0D008CD8; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk0 = 0xFD100000; - temp_v0_7->unk4 = D_80164B04; + temp_v0_7->words.w0 = 0xFD100000; + temp_v0_7->words.w1 = (u32) D_80164B04; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE8000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE8000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x7000000; - temp_v0_9->unk0 = 0xF5000100; + temp_v0_9->words.w1 = 0x07000000; + temp_v0_9->words.w0 = 0xF5000100; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = 0; - temp_v0_10->unk0 = 0xE6000000; + temp_v0_10->words.w1 = 0; + temp_v0_10->words.w0 = 0xE6000000; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0x73FC000; - temp_v0_11->unk0 = 0xF0000000; + temp_v0_11->words.w1 = 0x073FC000; + temp_v0_11->words.w0 = 0xF0000000; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = 0; - temp_v0_12->unk0 = 0xE7000000; + temp_v0_12->words.w1 = 0; + temp_v0_12->words.w0 = 0xE7000000; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0x8000; - temp_v0_13->unk0 = 0xBA000E02; - func_8004B614(*(&D_80164B10 + temp_t0), *(&D_80164B20 + temp_t0), *(&D_80164B30 + temp_t0), *(&D_80164B40 + temp_t0), *(&D_80164B50 + temp_t0), *(&D_80164B60 + temp_t0), arg0->unkC6); - temp_v0_14 = gDisplayListHead; - gDisplayListHead = temp_v0_14 + 8; - *temp_v0_14 = 0xB900031D; - phi_t7 = 0x505978; - phi_v0 = temp_v0_14; - phi_s0 = arg1 * 4; + temp_v0_13->words.w1 = 0x00008000; + temp_v0_13->words.w0 = 0xBA000E02; + func_8004B614(*(&D_80164B10 + sp44), *(&D_80164B20 + sp44), *(&D_80164B30 + sp44), *(&D_80164B40 + sp44), (s32) *(&D_80164B50 + sp44), (s32) *(&D_80164B60 + sp44), (s32) player->unk_0C6); + var_v0 = gDisplayListHead; + gDisplayListHead = var_v0 + 8; + var_t7 = 0x00505978; + var_s0 = arg1 * 4; + var_v0->words.w0 = 0xB900031D; goto block_21; } + temp_v0_14 = gDisplayListHead; + gDisplayListHead = temp_v0_14 + 8; + temp_v0_14->words.w0 = 0x01020040; + temp_v0_14->words.w1 = (s32) (&gGfxPool->mtxPool[arg1] + sp40 + 0xF2C0) & 0x1FFFFFFF; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk0 = 0x1020040; - temp_v0_15->unk4 = (gGfxPool + (arg1 << 6) + sp40 + 0xF2C0) & 0x1FFFFFFF; + temp_v0_15->words.w0 = 0x06000000; + temp_v0_15->words.w1 = (u32) &D_0D008CD8; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk0 = 0x6000000; - temp_v0_16->unk4 = &D_0D008CD8; + temp_v0_16->words.w0 = 0xFD100000; + var_s0 = arg1 * 4; + temp_v0_16->words.w1 = (u32) D_80164B04; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk0 = 0xFD100000; - temp_s0 = arg1 * 4; - temp_v0_17->unk4 = D_80164B04; + temp_v0_17->words.w1 = 0; + temp_v0_17->words.w0 = 0xE8000000; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = 0; - temp_v0_18->unk0 = 0xE8000000; + temp_v0_18->words.w1 = 0x07000000; + temp_v0_18->words.w0 = 0xF5000100; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = 0x7000000; - temp_v0_19->unk0 = 0xF5000100; + temp_v0_19->words.w1 = 0; + temp_v0_19->words.w0 = 0xE6000000; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = 0; - temp_v0_20->unk0 = 0xE6000000; + temp_v0_20->words.w1 = 0x073FC000; + temp_v0_20->words.w0 = 0xF0000000; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = 0x73FC000; - temp_v0_21->unk0 = 0xF0000000; + temp_v0_21->words.w1 = 0; + temp_v0_21->words.w0 = 0xE7000000; temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = 0; - temp_v0_22->unk0 = 0xE7000000; + temp_v0_22->words.w0 = 0xBA000E02; + temp_v0_22->words.w1 = 0x00008000; + func_8004B614(*(&D_80164B10 + sp44), *(&D_80164B20 + sp44), *(&D_80164B30 + sp44), *(&D_80164B40 + sp44), (s32) *(&D_80164B50 + sp44), (s32) *(&D_80164B60 + sp44), *(&D_8018D970 + var_s0)); temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk0 = 0xBA000E02; - temp_v0_23->unk4 = 0x8000; - func_8004B614(*(&D_80164B10 + temp_t0), *(&D_80164B20 + temp_t0), *(&D_80164B30 + temp_t0), *(&D_80164B40 + temp_t0), *(&D_80164B50 + temp_t0), *(&D_80164B60 + temp_t0), *(&D_8018D970 + temp_s0)); - temp_v0_24 = gDisplayListHead; - gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk0 = 0xB900031D; - temp_v0_24->unk4 = 0x505978; - phi_v1 = &gDisplayListHead; - phi_s0 = temp_s0; - } else if (((arg0->unkCA & 4) == 4) || (temp_v0_25 = arg0->unkC, ((temp_v0_25 * 0x10) < 0)) || (temp_v0_25 & 0x4000000)) { - temp_v0_36 = gDisplayListHead; - gDisplayListHead = temp_v0_36 + 8; - temp_v0_36->unk0 = 0x1020040; - temp_v0_36->unk4 = (gGfxPool + (arg1 << 6) + sp40 + 0xF2C0) & 0x1FFFFFFF; - temp_v0_37 = gDisplayListHead; - gDisplayListHead = temp_v0_37 + 8; - temp_v0_37->unk0 = 0x6000000; - temp_v0_37->unk4 = &D_0D008CD8; - temp_v0_38 = gDisplayListHead; - gDisplayListHead = temp_v0_38 + 8; - temp_v0_38->unk0 = 0xFD100000; - temp_v0_38->unk4 = D_80164B04; - temp_v0_39 = gDisplayListHead; - gDisplayListHead = temp_v0_39 + 8; - temp_v0_39->unk4 = 0; - temp_v0_39->unk0 = 0xE8000000; - temp_v0_40 = gDisplayListHead; - gDisplayListHead = temp_v0_40 + 8; - temp_v0_40->unk4 = 0x7000000; - temp_v0_40->unk0 = 0xF5000100; - temp_v0_41 = gDisplayListHead; - gDisplayListHead = temp_v0_41 + 8; - temp_v0_41->unk4 = 0; - temp_v0_41->unk0 = 0xE6000000; - temp_v0_42 = gDisplayListHead; - gDisplayListHead = temp_v0_42 + 8; - temp_v0_42->unk4 = 0x73FC000; - temp_v0_42->unk0 = 0xF0000000; - temp_v0_43 = gDisplayListHead; - gDisplayListHead = temp_v0_43 + 8; - temp_v0_43->unk4 = 0; - temp_v0_43->unk0 = 0xE7000000; - temp_v0_44 = gDisplayListHead; - gDisplayListHead = temp_v0_44 + 8; - temp_v0_44->unk4 = 0x8000; - temp_v0_44->unk0 = 0xBA000E02; - func_8004B614(*(&D_80164B10 + temp_t0), *(&D_80164B20 + temp_t0), *(&D_80164B30 + temp_t0), *(&D_80164B40 + temp_t0), *(&D_80164B50 + temp_t0), *(&D_80164B60 + temp_t0), arg0->unkC6); - temp_v0_45 = gDisplayListHead; - gDisplayListHead = temp_v0_45 + 8; - temp_v0_45->unk4 = 3; - temp_v0_45->unk0 = 0xB9000002; - temp_v0_46 = gDisplayListHead; - gDisplayListHead = temp_v0_46 + 8; - temp_v0_46->unk4 = 0x504A50; - temp_v0_46->unk0 = 0xB900031D; - phi_v1 = &gDisplayListHead; - phi_s0 = arg1 * 4; - } else { + temp_v0_23->words.w0 = 0xB900031D; + temp_v0_23->words.w1 = 0x00505978; + } else if (((player->unk_0CA & 4) == 4) || (temp_v0_24 = player->unk_00C, ((temp_v0_24 * 0x10) < 0)) || (temp_v0_24 & 0x04000000)) { + temp_v0_25 = gDisplayListHead; + gDisplayListHead = temp_v0_25 + 8; + temp_v0_25->words.w0 = 0x01020040; + temp_v0_25->words.w1 = (s32) (&gGfxPool->mtxPool[arg1] + sp40 + 0xF2C0) & 0x1FFFFFFF; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk0 = 0x1020040; - temp_v0_26->unk4 = (gGfxPool + (arg1 << 6) + sp40 + 0xF2C0) & 0x1FFFFFFF; + temp_v0_26->words.w0 = 0x06000000; + temp_v0_26->words.w1 = (u32) &D_0D008CD8; temp_v0_27 = gDisplayListHead; gDisplayListHead = temp_v0_27 + 8; - temp_v0_27->unk0 = 0x6000000; - temp_v0_27->unk4 = &D_0D008CD8; + temp_v0_27->words.w0 = 0xFD100000; + temp_v0_27->words.w1 = (u32) D_80164B04; temp_v0_28 = gDisplayListHead; gDisplayListHead = temp_v0_28 + 8; - temp_v0_28->unk0 = 0xFD100000; - temp_v0_28->unk4 = D_80164B04; + temp_v0_28->words.w1 = 0; + temp_v0_28->words.w0 = 0xE8000000; temp_v0_29 = gDisplayListHead; gDisplayListHead = temp_v0_29 + 8; - temp_v0_29->unk4 = 0; - temp_v0_29->unk0 = 0xE8000000; + temp_v0_29->words.w1 = 0x07000000; + temp_v0_29->words.w0 = 0xF5000100; temp_v0_30 = gDisplayListHead; gDisplayListHead = temp_v0_30 + 8; - temp_v0_30->unk4 = 0x7000000; - temp_v0_30->unk0 = 0xF5000100; + temp_v0_30->words.w1 = 0; + temp_v0_30->words.w0 = 0xE6000000; temp_v0_31 = gDisplayListHead; gDisplayListHead = temp_v0_31 + 8; - temp_v0_31->unk4 = 0; - temp_v0_31->unk0 = 0xE6000000; + temp_v0_31->words.w1 = 0x073FC000; + temp_v0_31->words.w0 = 0xF0000000; temp_v0_32 = gDisplayListHead; gDisplayListHead = temp_v0_32 + 8; - temp_v0_32->unk4 = 0x73FC000; - temp_v0_32->unk0 = 0xF0000000; + temp_v0_32->words.w1 = 0; + temp_v0_32->words.w0 = 0xE7000000; temp_v0_33 = gDisplayListHead; gDisplayListHead = temp_v0_33 + 8; - temp_v0_33->unk4 = 0; - temp_v0_33->unk0 = 0xE7000000; + temp_v0_33->words.w1 = 0x00008000; + temp_v0_33->words.w0 = 0xBA000E02; + func_8004B614(*(&D_80164B10 + sp44), *(&D_80164B20 + sp44), *(&D_80164B30 + sp44), *(&D_80164B40 + sp44), (s32) *(&D_80164B50 + sp44), (s32) *(&D_80164B60 + sp44), (s32) player->unk_0C6); temp_v0_34 = gDisplayListHead; gDisplayListHead = temp_v0_34 + 8; - temp_v0_34->unk4 = 0x8000; - temp_v0_34->unk0 = 0xBA000E02; - func_8004B614(*(&D_80164B10 + temp_t0), *(&D_80164B20 + temp_t0), *(&D_80164B30 + temp_t0), *(&D_80164B40 + temp_t0), *(&D_80164B50 + temp_t0), *(&D_80164B60 + temp_t0), arg0->unkC6); + temp_v0_34->words.w1 = 3; + temp_v0_34->words.w0 = 0xB9000002; temp_v0_35 = gDisplayListHead; gDisplayListHead = temp_v0_35 + 8; - *temp_v0_35 = 0xB900031D; - phi_t7 = 0x553078; - phi_v0 = temp_v0_35; - phi_s0 = arg1 * 4; + var_s0 = arg1 * 4; + temp_v0_35->words.w1 = 0x00504A50; + temp_v0_35->words.w0 = 0xB900031D; + } else { + temp_v0_36 = gDisplayListHead; + gDisplayListHead = temp_v0_36 + 8; + temp_v0_36->words.w0 = 0x01020040; + temp_v0_36->words.w1 = (s32) (&gGfxPool->mtxPool[arg1] + sp40 + 0xF2C0) & 0x1FFFFFFF; + temp_v0_37 = gDisplayListHead; + gDisplayListHead = temp_v0_37 + 8; + temp_v0_37->words.w0 = 0x06000000; + temp_v0_37->words.w1 = (u32) &D_0D008CD8; + temp_v0_38 = gDisplayListHead; + gDisplayListHead = temp_v0_38 + 8; + temp_v0_38->words.w0 = 0xFD100000; + temp_v0_38->words.w1 = (u32) D_80164B04; + temp_v0_39 = gDisplayListHead; + gDisplayListHead = temp_v0_39 + 8; + temp_v0_39->words.w1 = 0; + temp_v0_39->words.w0 = 0xE8000000; + temp_v0_40 = gDisplayListHead; + gDisplayListHead = temp_v0_40 + 8; + temp_v0_40->words.w1 = 0x07000000; + temp_v0_40->words.w0 = 0xF5000100; + temp_v0_41 = gDisplayListHead; + gDisplayListHead = temp_v0_41 + 8; + temp_v0_41->words.w1 = 0; + temp_v0_41->words.w0 = 0xE6000000; + temp_v0_42 = gDisplayListHead; + gDisplayListHead = temp_v0_42 + 8; + temp_v0_42->words.w1 = 0x073FC000; + temp_v0_42->words.w0 = 0xF0000000; + temp_v0_43 = gDisplayListHead; + gDisplayListHead = temp_v0_43 + 8; + temp_v0_43->words.w1 = 0; + temp_v0_43->words.w0 = 0xE7000000; + temp_v0_44 = gDisplayListHead; + gDisplayListHead = temp_v0_44 + 8; + temp_v0_44->words.w1 = 0x00008000; + temp_v0_44->words.w0 = 0xBA000E02; + func_8004B614(*(&D_80164B10 + sp44), *(&D_80164B20 + sp44), *(&D_80164B30 + sp44), *(&D_80164B40 + sp44), (s32) *(&D_80164B50 + sp44), (s32) *(&D_80164B60 + sp44), (s32) player->unk_0C6); + var_v0 = gDisplayListHead; + gDisplayListHead = var_v0 + 8; + var_t7 = 0x00553078; + var_s0 = arg1 * 4; + var_v0->words.w0 = 0xB900031D; block_21: - phi_v0->unk4 = phi_t7; - phi_v1 = &gDisplayListHead; + var_v0->words.w1 = var_t7; } - temp_v0_47 = *phi_v1; - *phi_v1 = temp_v0_47 + 8; - temp_v0_47->unk0 = 0xFD500000; - temp_v0_47->unk4 = D_80164B08; - temp_v0_48 = *phi_v1; - *phi_v1 = temp_v0_48 + 8; - temp_v0_48->unk4 = 0x7080200; - temp_v0_48->unk0 = 0xF5500000; - temp_v0_49 = *phi_v1; - *phi_v1 = temp_v0_49 + 8; - temp_v0_49->unk4 = 0; - temp_v0_49->unk0 = 0xE6000000; - temp_v0_50 = *phi_v1; - *phi_v1 = temp_v0_50 + 8; - temp_v0_50->unk4 = 0x73FF100; - temp_v0_50->unk0 = 0xF3000000; - temp_v0_51 = *phi_v1; - *phi_v1 = temp_v0_51 + 8; - temp_v0_51->unk4 = 0; - temp_v0_51->unk0 = 0xE7000000; - temp_v0_52 = *phi_v1; - *phi_v1 = temp_v0_52 + 8; - temp_v0_52->unk0 = 0xF5481000; - temp_v0_52->unk4 = 0x80200; - temp_v0_53 = *phi_v1; - *phi_v1 = temp_v0_53 + 8; - temp_v0_53->unk0 = 0xF2000000; - temp_v0_53->unk4 = 0xFC07C; - temp_v0_54 = *phi_v1; - *phi_v1 = temp_v0_54 + 8; - temp_v0_54->unk0 = 0x400103F; - temp_t5 = phi_s0 + &D_800DDBB4; - temp_v0_54->unk4 = *temp_t5 + (arg3 * 0x10); - temp_v0_55 = *phi_v1; - *phi_v1 = temp_v0_55 + 8; - temp_v0_55->unk4 = &D_0D008C78; - temp_v0_55->unk0 = 0x6000000; - temp_v0_56 = *phi_v1; - *phi_v1 = temp_v0_56 + 8; - temp_v0_56->unk0 = 0xFD500000; - temp_v0_56->unk4 = D_80164B0C; - temp_v0_57 = *phi_v1; - *phi_v1 = temp_v0_57 + 8; - temp_v0_57->unk4 = 0x7080200; - temp_v0_57->unk0 = 0xF5500000; - temp_v0_58 = *phi_v1; - *phi_v1 = temp_v0_58 + 8; - temp_v0_58->unk4 = 0; - temp_v0_58->unk0 = 0xE6000000; - temp_v0_59 = *phi_v1; - *phi_v1 = temp_v0_59 + 8; - temp_v0_59->unk4 = 0x73FF100; - temp_v0_59->unk0 = 0xF3000000; - temp_v0_60 = *phi_v1; - *phi_v1 = temp_v0_60 + 8; - temp_v0_60->unk4 = 0; - temp_v0_60->unk0 = 0xE7000000; - temp_v0_61 = *phi_v1; - *phi_v1 = temp_v0_61 + 8; - temp_v0_61->unk0 = 0xF5481000; - temp_v0_61->unk4 = 0x80200; - temp_v0_62 = *phi_v1; - *phi_v1 = temp_v0_62 + 8; - temp_v0_62->unk0 = 0xF2000000; - temp_v0_62->unk4 = 0xFC07C; - temp_v0_63 = *phi_v1; - *phi_v1 = temp_v0_63 + 8; - temp_v0_63->unk0 = 0x400103F; - temp_v0_63->unk4 = *temp_t5 + ((arg3 + 4) * 0x10); - temp_v0_64 = *phi_v1; - *phi_v1 = temp_v0_64 + 8; - temp_v0_64->unk4 = &D_0D008C78; - temp_v0_64->unk0 = 0x6000000; - temp_v0_65 = *phi_v1; - *phi_v1 = temp_v0_65 + 8; - temp_v0_65->unk4 = 0x10001; - temp_v0_65->unk0 = 0xBB000000; - temp_v0_66 = *phi_v1; - *phi_v1 = temp_v0_66 + 8; - temp_v0_66->unk4 = 0; - temp_v0_66->unk0 = 0xB9000002; + temp_v0_45 = gDisplayListHead; + gDisplayListHead = temp_v0_45 + 8; + temp_v0_45->words.w0 = 0xFD500000; + temp_v0_45->words.w1 = D_80164B08; + temp_v0_46 = gDisplayListHead; + gDisplayListHead = temp_v0_46 + 8; + temp_v0_46->words.w1 = 0x07080200; + temp_v0_46->words.w0 = 0xF5500000; + temp_v0_47 = gDisplayListHead; + gDisplayListHead = temp_v0_47 + 8; + temp_v0_47->words.w1 = 0; + temp_v0_47->words.w0 = 0xE6000000; + temp_v0_48 = gDisplayListHead; + gDisplayListHead = temp_v0_48 + 8; + temp_v0_48->words.w1 = 0x073FF100; + temp_v0_48->words.w0 = 0xF3000000; + temp_v0_49 = gDisplayListHead; + gDisplayListHead = temp_v0_49 + 8; + temp_v0_49->words.w1 = 0; + temp_v0_49->words.w0 = 0xE7000000; + temp_v0_50 = gDisplayListHead; + gDisplayListHead = temp_v0_50 + 8; + temp_v0_50->words.w0 = 0xF5481000; + temp_v0_50->words.w1 = 0x00080200; + temp_v0_51 = gDisplayListHead; + gDisplayListHead = temp_v0_51 + 8; + temp_v0_51->words.w0 = 0xF2000000; + temp_v0_51->words.w1 = 0x000FC07C; + temp_v0_52 = gDisplayListHead; + gDisplayListHead = temp_v0_52 + 8; + temp_v0_52->words.w0 = 0x0400103F; + temp_t5 = var_s0 + &D_800DDBB4; + temp_v0_52->words.w1 = *temp_t5 + (arg3 * 0x10); + temp_v0_53 = gDisplayListHead; + gDisplayListHead = temp_v0_53 + 8; + temp_v0_53->words.w1 = &D_0D008C78; + temp_v0_53->words.w0 = 0x06000000; + temp_v0_54 = gDisplayListHead; + gDisplayListHead = temp_v0_54 + 8; + temp_v0_54->words.w0 = 0xFD500000; + temp_v0_54->words.w1 = D_80164B0C; + temp_v0_55 = gDisplayListHead; + gDisplayListHead = temp_v0_55 + 8; + temp_v0_55->words.w1 = 0x07080200; + temp_v0_55->words.w0 = 0xF5500000; + temp_v0_56 = gDisplayListHead; + gDisplayListHead = temp_v0_56 + 8; + temp_v0_56->words.w1 = 0; + temp_v0_56->words.w0 = 0xE6000000; + temp_v0_57 = gDisplayListHead; + gDisplayListHead = temp_v0_57 + 8; + temp_v0_57->words.w1 = 0x073FF100; + temp_v0_57->words.w0 = 0xF3000000; + temp_v0_58 = gDisplayListHead; + gDisplayListHead = temp_v0_58 + 8; + temp_v0_58->words.w1 = 0; + temp_v0_58->words.w0 = 0xE7000000; + temp_v0_59 = gDisplayListHead; + gDisplayListHead = temp_v0_59 + 8; + temp_v0_59->words.w0 = 0xF5481000; + temp_v0_59->words.w1 = 0x00080200; + temp_v0_60 = gDisplayListHead; + gDisplayListHead = temp_v0_60 + 8; + temp_v0_60->words.w0 = 0xF2000000; + temp_v0_60->words.w1 = 0x000FC07C; + temp_v0_61 = gDisplayListHead; + gDisplayListHead = temp_v0_61 + 8; + temp_v0_61->words.w0 = 0x0400103F; + temp_v0_61->words.w1 = *temp_t5 + ((arg3 + 4) * 0x10); + temp_v0_62 = gDisplayListHead; + gDisplayListHead = temp_v0_62 + 8; + temp_v0_62->words.w1 = &D_0D008C78; + temp_v0_62->words.w0 = 0x06000000; + temp_v0_63 = gDisplayListHead; + gDisplayListHead = temp_v0_63 + 8; + temp_v0_63->words.w1 = 0x00010001; + temp_v0_63->words.w0 = 0xBB000000; + temp_v0_64 = gDisplayListHead; + gDisplayListHead = temp_v0_64 + 8; + temp_v0_64->words.w1 = 0; + temp_v0_64->words.w0 = 0xB9000002; } #else GLOBAL_ASM("asm/non_matchings/code_8001F980/func_800248D0.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80021E10(? *, f32 *, s16 *); // extern -? func_80021F84(? *, f32); // extern -? func_80022180(void *, ? *); // extern -? func_8004B614(u16, u16, u16, u16, s32, s32, s32); // extern -? func_80062B18(f32 *, f32 *, f32 *, f32, f32, f32, s32, s32); // extern -f32 sins(s32); // extern +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_8004B614(u16, u16, u16, u16, s32, s32, s32); /* extern */ +? func_80062B18(f32 *, f32 *, f32 *, f32, f32, f32, s32, s32); /* extern */ extern ? D_0D008C78; extern ? D_0D008CD8; -extern ? D_800DDBB4; -extern ? D_800DDBD4; -extern f64 D_800ED6D8; extern void *D_80164B04; extern u8 *D_80164B08; extern u8 *D_80164B0C; @@ -2525,10 +2381,27 @@ extern ? D_80164B30; extern ? D_80164B40; extern ? D_80164B50; extern ? D_80164B60; -extern void *gDisplayListHead; +static ? *D_800DDBB4[8] = { + &D_800E49C0, + &D_800E4AC0, + &D_800E4BC0, + &D_800E4CC0, + &D_800E4DC0, + &D_800E4EC0, + &D_800E4FD0, + &D_800E50D0, +}; +static f32 D_800DDBD4[8] = { 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f }; +static ? D_800E49C0; /* unable to generate initializer */ +static ? D_800E4AC0; /* unable to generate initializer */ +static ? D_800E4BC0; /* unable to generate initializer */ +static ? D_800E4CC0; /* unable to generate initializer */ +static ? D_800E4DC0; /* unable to generate initializer */ +static ? D_800E4EC0; /* unable to generate initializer */ +static ? D_800E4FD0; /* unable to generate initializer */ +static ? D_800E50D0; /* unable to generate initializer */ -void func_800256F4(void *arg0, s8 arg1, s8 arg2, s8 arg3) { - ? sp12C; +void func_800256F4(Player *player, s8 arg1, s8 arg2, s8 arg3) { f32 spE4; f32 spE0; f32 spDC; @@ -2539,546 +2412,563 @@ void func_800256F4(void *arg0, s8 arg1, s8 arg2, s8 arg3) { f32 spCC; f32 spC8; s16 spC2; - void *sp44; + void *sp44; /* compiler-managed */ + ? **temp_t5_2; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_27; + Gfx *temp_v0_28; + Gfx *temp_v0_29; + Gfx *temp_v0_30; + Gfx *temp_v0_31; + Gfx *temp_v0_32; + Gfx *temp_v0_33; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; s16 temp_v1; - s32 *temp_t5_2; s32 temp_t5; s32 temp_t7; u8 *temp_v0_2; u8 *temp_v0_3; + u8 *var_t9; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_14; - void *temp_v0_15; - void *temp_v0_16; - void *temp_v0_17; - void *temp_v0_18; - void *temp_v0_19; - void *temp_v0_20; - void *temp_v0_21; - void *temp_v0_22; - void *temp_v0_23; - void *temp_v0_24; - void *temp_v0_25; - void *temp_v0_26; - void *temp_v0_27; - void *temp_v0_28; - void *temp_v0_29; - void *temp_v0_30; - void *temp_v0_31; - void *temp_v0_32; - void *temp_v0_33; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - u8 *phi_t9; if (D_8015F890 == 1) { - spC2 = 0xFF; + spC2 = 0x00FF; } else { - spC2 = 0x70; + spC2 = 0x0070; } - temp_v0 = arg0 + (arg2 * 2); + temp_v0 = player + (arg2 * 2); sp44 = temp_v0; - spD4 = -(sins((temp_v0->unk48 - arg0->unk2E) & 0xFFFF) * 0.0f) * D_800ED6D8; + spD4 = (s16) (s32) ((f64) -(s16) (s32) (sins((temp_v0->unk48 - player->unk_02E) & 0xFFFF) * 0.0f) * 0.8); spD6 = temp_v0->unk48; spD8 = temp_v0->unk50; - func_80062B18(&spD0, &spCC, &spC8, 0.0f, 1.5f, 0.0f, -temp_v0->unk48, temp_v0->unk50); + func_80062B18(&spD0, &spCC, &spC8, 0.0f, 1.5f, 0.0f, (s32) -temp_v0->unk48, (s32) temp_v0->unk50); temp_t5 = arg1 * 2; temp_v1 = *(D_801651D0 + ((arg2 * 0x10) + temp_t5)); - spE0 = (arg0->unk18 - arg0->unk70) + (spCC - 2.0); - spDC = arg0->unk14 + spD0; + spE0 = (f32) ((f64) (player->pos[1] - player->boundingBoxSize) + ((f64) spCC - 2.0)); + spDC = player->pos[0] + spD0; D_80164B04 = (temp_v1 << 0xE) + (arg2 << 0xC) + (arg1 << 9) + D_802F1F80; - spE4 = arg0->unk1C + spC8; + spE4 = player->pos[2] + spC8; if ((arg2 == 0) || (arg2 == 1)) { - temp_v0_3 = &D_802BFB80[(temp_v1 << 0x10) + (arg2 << 0xF) + (arg1 << 0xC)]; - D_80164B08 = temp_v0_3; - phi_t9 = temp_v0_3 + 0x7C0; + temp_v0_2 = &D_802BFB80[0][0][0].pixel_index_array[(temp_v1 << 0x10) + (arg2 << 0xF) + (arg1 << 0xC)]; + D_80164B08 = temp_v0_2; + var_t9 = temp_v0_2 + 0x7C0; } else { - temp_v0_2 = &D_802BFB80[(temp_v1 << 0x10) + (arg2 << 0xF) + (arg1 << 0xC)]; - D_80164B08 = temp_v0_2 + 0xFFFF4000; - phi_t9 = temp_v0_2 + 0xFFFF47C0; + temp_v0_3 = &D_802BFB80[0][0][0].pixel_index_array[(temp_v1 << 0x10) + (arg2 << 0xF) + (arg1 << 0xC)]; + D_80164B08 = temp_v0_3 + 0xFFFF4000; + var_t9 = temp_v0_3 + 0xFFFF47C0; } - D_80164B0C = phi_t9; + D_80164B0C = var_t9; sp44 = temp_t5; - func_80021E10(&sp12C, &spDC, &spD4); - func_80021F84(&sp12C, *(&D_800DDBD4 + (arg0->unk254 * 4)) * arg0->unk224); + func_80021E10((f32 (*)[4]) &sp12C[0], &spDC, &spD4); + func_80021F84((f32 (*)[4]) &sp12C[0], D_800DDBD4[player->characterId] * player->unk_224); temp_t7 = arg2 << 9; - func_80022180(gGfxPool + (arg1 << 6) + temp_t7 + 0xF2C0, &sp12C); + func_80022180(&gGfxPool->mtxPool[arg1] + temp_t7 + 0xF2C0, (f32 (*)[4]) &sp12C[0]); temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0x1020040; - temp_v0_4->unk4 = (gGfxPool + (arg1 << 6) + temp_t7 + 0xF2C0) & 0x1FFFFFFF; + temp_v0_4->words.w0 = 0x01020040; + temp_v0_4->words.w1 = (s32) (&gGfxPool->mtxPool[arg1] + temp_t7 + 0xF2C0) & 0x1FFFFFFF; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = &D_0D008CD8; - temp_v0_5->unk0 = 0x6000000; + temp_v0_5->words.w1 = (u32) &D_0D008CD8; + temp_v0_5->words.w0 = 0x06000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xFD100000; - temp_v0_6->unk4 = D_80164B04; + temp_v0_6->words.w0 = 0xFD100000; + temp_v0_6->words.w1 = (u32) D_80164B04; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE8000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE8000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0x7000000; - temp_v0_8->unk0 = 0xF5000100; + temp_v0_8->words.w1 = 0x07000000; + temp_v0_8->words.w0 = 0xF5000100; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0; - temp_v0_9->unk0 = 0xE6000000; + temp_v0_9->words.w1 = 0; + temp_v0_9->words.w0 = 0xE6000000; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = 0x73FC000; - temp_v0_10->unk0 = 0xF0000000; + temp_v0_10->words.w1 = 0x073FC000; + temp_v0_10->words.w0 = 0xF0000000; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0; - temp_v0_11->unk0 = 0xE7000000; + temp_v0_11->words.w1 = 0; + temp_v0_11->words.w0 = 0xE7000000; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = 0x8000; - temp_v0_12->unk0 = 0xBA000E02; - func_8004B614(*(&D_80164B10 + temp_t5), *(&D_80164B20 + temp_t5), *(&D_80164B30 + temp_t5), *(&D_80164B40 + temp_t5), *(&D_80164B50 + temp_t5), *(&D_80164B60 + temp_t5), spC2); + temp_v0_12->words.w1 = 0x00008000; + temp_v0_12->words.w0 = 0xBA000E02; + func_8004B614(*(&D_80164B10 + sp44), *(&D_80164B20 + sp44), *(&D_80164B30 + sp44), *(&D_80164B40 + sp44), (s32) *(&D_80164B50 + sp44), (s32) *(&D_80164B60 + sp44), (s32) spC2); temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0xB900031D; - temp_v0_13->unk4 = 0x505978; + temp_v0_13->words.w0 = 0xB900031D; + temp_v0_13->words.w1 = 0x00505978; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk0 = 0xFD500000; - temp_v0_14->unk4 = D_80164B08; + temp_v0_14->words.w0 = 0xFD500000; + temp_v0_14->words.w1 = (u32) D_80164B08; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x7080200; - temp_v0_15->unk0 = 0xF5500000; + temp_v0_15->words.w1 = 0x07080200; + temp_v0_15->words.w0 = 0xF5500000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0; - temp_v0_16->unk0 = 0xE6000000; + temp_v0_16->words.w1 = 0; + temp_v0_16->words.w0 = 0xE6000000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0x73FF100; - temp_v0_17->unk0 = 0xF3000000; + temp_v0_17->words.w1 = 0x073FF100; + temp_v0_17->words.w0 = 0xF3000000; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = 0; - temp_v0_18->unk0 = 0xE7000000; + temp_v0_18->words.w1 = 0; + temp_v0_18->words.w0 = 0xE7000000; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk0 = 0xF5481000; - temp_v0_19->unk4 = 0x80200; + temp_v0_19->words.w0 = 0xF5481000; + temp_v0_19->words.w1 = 0x00080200; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk0 = 0xF2000000; - temp_v0_20->unk4 = 0xFC07C; + temp_v0_20->words.w0 = 0xF2000000; + temp_v0_20->words.w1 = 0x000FC07C; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk0 = 0x400103F; - temp_t5_2 = (arg1 * 4) + &D_800DDBB4; - temp_v0_21->unk4 = *temp_t5_2 + (arg3 * 0x10); + temp_v0_21->words.w0 = 0x0400103F; + temp_t5_2 = &D_800DDBB4[arg1]; + temp_v0_21->words.w1 = (u32) (*temp_t5_2 + (arg3 * 0x10)); temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = &D_0D008C78; - temp_v0_22->unk0 = 0x6000000; + temp_v0_22->words.w1 = (u32) &D_0D008C78; + temp_v0_22->words.w0 = 0x06000000; temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk0 = 0xFD500000; - temp_v0_23->unk4 = D_80164B0C; + temp_v0_23->words.w0 = 0xFD500000; + temp_v0_23->words.w1 = (u32) D_80164B0C; temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = 0x7080200; - temp_v0_24->unk0 = 0xF5500000; + temp_v0_24->words.w1 = 0x07080200; + temp_v0_24->words.w0 = 0xF5500000; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = 0; - temp_v0_25->unk0 = 0xE6000000; + temp_v0_25->words.w1 = 0; + temp_v0_25->words.w0 = 0xE6000000; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk4 = 0x73FF100; - temp_v0_26->unk0 = 0xF3000000; + temp_v0_26->words.w1 = 0x073FF100; + temp_v0_26->words.w0 = 0xF3000000; temp_v0_27 = gDisplayListHead; gDisplayListHead = temp_v0_27 + 8; - temp_v0_27->unk4 = 0; - temp_v0_27->unk0 = 0xE7000000; + temp_v0_27->words.w1 = 0; + temp_v0_27->words.w0 = 0xE7000000; temp_v0_28 = gDisplayListHead; gDisplayListHead = temp_v0_28 + 8; - temp_v0_28->unk0 = 0xF5481000; - temp_v0_28->unk4 = 0x80200; + temp_v0_28->words.w0 = 0xF5481000; + temp_v0_28->words.w1 = 0x00080200; temp_v0_29 = gDisplayListHead; gDisplayListHead = temp_v0_29 + 8; - temp_v0_29->unk0 = 0xF2000000; - temp_v0_29->unk4 = 0xFC07C; + temp_v0_29->words.w0 = 0xF2000000; + temp_v0_29->words.w1 = 0x000FC07C; temp_v0_30 = gDisplayListHead; gDisplayListHead = temp_v0_30 + 8; - temp_v0_30->unk0 = 0x400103F; - temp_v0_30->unk4 = *temp_t5_2 + ((arg3 + 4) * 0x10); + temp_v0_30->words.w0 = 0x0400103F; + temp_v0_30->words.w1 = (u32) (*temp_t5_2 + ((arg3 + 4) * 0x10)); temp_v0_31 = gDisplayListHead; gDisplayListHead = temp_v0_31 + 8; - temp_v0_31->unk4 = &D_0D008C78; - temp_v0_31->unk0 = 0x6000000; + temp_v0_31->words.w1 = (u32) &D_0D008C78; + temp_v0_31->words.w0 = 0x06000000; temp_v0_32 = gDisplayListHead; gDisplayListHead = temp_v0_32 + 8; - temp_v0_32->unk4 = 0x10001; - temp_v0_32->unk0 = 0xBB000000; + temp_v0_32->words.w1 = 0x00010001; + temp_v0_32->words.w0 = 0xBB000000; temp_v0_33 = gDisplayListHead; gDisplayListHead = temp_v0_33 + 8; - temp_v0_33->unk4 = 0; - temp_v0_33->unk0 = 0xB9000002; + temp_v0_33->words.w1 = 0; + temp_v0_33->words.w0 = 0xB9000002; } #else GLOBAL_ASM("asm/non_matchings/code_8001F980/func_800256F4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80021E10(? *, f32 *, s16 *); // extern -? func_80021F84(? *, f32); // extern -? func_80022180(void *, ? *); // extern -? func_8004B614(u16, u16, u16, u16, s32, s32, s32); // extern -f32 sins(s32); // extern -f32 coss(s32); // extern +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_8004B614(u16, u16, u16, u16, s32, s32, s32); /* extern */ extern ? D_0D008C78; extern ? D_0D008D10; -extern ? D_800DDBB4; -extern ? D_800DDBD4; -extern f64 D_800ED6E0; -extern s16 D_80164AF0; -extern s32 D_80164B08; -extern s32 D_80164B0C; +extern u32 D_80164B08; +extern u32 D_80164B0C; extern ? D_80164B10; extern ? D_80164B20; extern ? D_80164B30; extern ? D_80164B40; extern ? D_80164B50; extern ? D_80164B60; -extern void *gDisplayListHead; +static ? *D_800DDBB4[8] = { + &D_800E49C0, + &D_800E4AC0, + &D_800E4BC0, + &D_800E4CC0, + &D_800E4DC0, + &D_800E4EC0, + &D_800E4FD0, + &D_800E50D0, +}; +static f32 D_800DDBD4[8] = { 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f }; +static ? D_800E49C0; /* unable to generate initializer */ +static ? D_800E4AC0; /* unable to generate initializer */ +static ? D_800E4BC0; /* unable to generate initializer */ +static ? D_800E4CC0; /* unable to generate initializer */ +static ? D_800E4DC0; /* unable to generate initializer */ +static ? D_800E4EC0; /* unable to generate initializer */ +static ? D_800E4FD0; /* unable to generate initializer */ +static ? D_800E50D0; /* unable to generate initializer */ -void func_80025DE8(void *arg0, s8 arg1, s8 arg2, s8 arg3) { - ? spA8; +void func_80025DE8(Player *player, s8 arg1, s8 arg2, s8 arg3) { f32 spA4; f32 spA0; f32 sp9C; s16 sp98; s16 sp96; s16 sp94; + ? **temp_t5; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; f64 temp_f4; - s32 *temp_t5; s32 temp_t9; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_14; - void *temp_v0_15; - void *temp_v0_16; - void *temp_v0_17; - void *temp_v0_18; - void *temp_v0_19; - void *temp_v0_20; - void *temp_v0_21; - void *temp_v0_22; - void *temp_v0_23; - void *temp_v0_24; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - sp9C = (sins(-arg0->unk2E & 0xFFFF) * -1.5) + arg0->unk14; - spA0 = ((arg0->unk18 - arg0->unk70) + arg0->unk108) + D_800ED6E0; - temp_f4 = coss(-arg0->unk2E & 0xFFFF) * -1.5; - sp94 = -0xB6; - temp_v0 = arg0 + (arg2 * 2); - spA4 = temp_f4 + arg0->unk1C; + sp9C = (f32) (((f64) sins(-player->unk_02E & 0xFFFF) * -1.5) + (f64) player->pos[0]); + spA0 = (f32) ((f64) ((player->pos[1] - player->boundingBoxSize) + player->unk_108) + 0.1); + temp_f4 = (f64) coss(-player->unk_02E & 0xFFFF) * -1.5; + sp94 = -0x00B6; + temp_v0 = player + (arg2 * 2); + spA4 = (f32) (temp_f4 + (f64) player->pos[2]); sp96 = temp_v0->unk48; sp98 = temp_v0->unk50; - func_80021E10(&spA8, &sp9C, &sp94); - func_80021F84(&spA8, *(&D_800DDBD4 + (arg0->unk254 * 4)) * arg0->unk224); - func_80022180(gGfxPool + (D_80164AF0 << 6) + 0xFAC0, &spA8); + func_80021E10((f32 (*)[4]) &spA8[0], &sp9C, &sp94); + func_80021F84((f32 (*)[4]) &spA8[0], D_800DDBD4[player->characterId] * player->unk_224); + func_80022180(&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0, (f32 (*)[4]) &spA8[0]); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x1020040; - temp_v0_2->unk4 = (gGfxPool + (D_80164AF0 << 6) + 0xFAC0) & 0x1FFFFFFF; + temp_v0_2->words.w0 = 0x01020040; + temp_v0_2->words.w1 = (s32) (&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0) & 0x1FFFFFFF; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0x6000000; - temp_v0_3->unk4 = &D_0D008D10; + temp_v0_3->words.w0 = 0x06000000; + temp_v0_3->words.w1 = (u32) &D_0D008D10; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x8000; - temp_v0_4->unk0 = 0xBA000E02; + temp_v0_4->words.w1 = 0x00008000; + temp_v0_4->words.w0 = 0xBA000E02; temp_t9 = arg1 * 2; - func_8004B614(*(&D_80164B10 + temp_t9), *(&D_80164B20 + temp_t9), *(&D_80164B30 + temp_t9), *(&D_80164B40 + temp_t9), *(&D_80164B50 + temp_t9), *(&D_80164B60 + temp_t9), 0x40); + func_8004B614(*(&D_80164B10 + temp_t9), *(&D_80164B20 + temp_t9), *(&D_80164B30 + temp_t9), *(&D_80164B40 + temp_t9), (s32) *(&D_80164B50 + temp_t9), (s32) *(&D_80164B60 + temp_t9), 0x00000040); temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xB900031D; - temp_v0_5->unk4 = 0x505978; + temp_v0_5->words.w0 = 0xB900031D; + temp_v0_5->words.w1 = 0x00505978; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xFD500000; - temp_v0_6->unk4 = D_80164B08; + temp_v0_6->words.w0 = 0xFD500000; + temp_v0_6->words.w1 = D_80164B08; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x7080200; - temp_v0_7->unk0 = 0xF5500000; + temp_v0_7->words.w1 = 0x07080200; + temp_v0_7->words.w0 = 0xF5500000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE6000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE6000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x73FF100; - temp_v0_9->unk0 = 0xF3000000; + temp_v0_9->words.w1 = 0x073FF100; + temp_v0_9->words.w0 = 0xF3000000; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = 0; - temp_v0_10->unk0 = 0xE7000000; + temp_v0_10->words.w1 = 0; + temp_v0_10->words.w0 = 0xE7000000; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xF5481000; - temp_v0_11->unk4 = 0x80200; + temp_v0_11->words.w0 = 0xF5481000; + temp_v0_11->words.w1 = 0x00080200; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0xF2000000; - temp_v0_12->unk4 = 0xFC07C; + temp_v0_12->words.w0 = 0xF2000000; + temp_v0_12->words.w1 = 0x000FC07C; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0x400103F; - temp_t5 = (arg1 * 4) + &D_800DDBB4; - temp_v0_13->unk4 = *temp_t5 + (arg3 * 0x10); + temp_v0_13->words.w0 = 0x0400103F; + temp_t5 = &D_800DDBB4[arg1]; + temp_v0_13->words.w1 = (u32) (*temp_t5 + (arg3 * 0x10)); temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = &D_0D008C78; - temp_v0_14->unk0 = 0x6000000; + temp_v0_14->words.w1 = (u32) &D_0D008C78; + temp_v0_14->words.w0 = 0x06000000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk0 = 0xFD500000; - temp_v0_15->unk4 = D_80164B0C; + temp_v0_15->words.w0 = 0xFD500000; + temp_v0_15->words.w1 = D_80164B0C; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0x7080200; - temp_v0_16->unk0 = 0xF5500000; + temp_v0_16->words.w1 = 0x07080200; + temp_v0_16->words.w0 = 0xF5500000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0; - temp_v0_17->unk0 = 0xE6000000; + temp_v0_17->words.w1 = 0; + temp_v0_17->words.w0 = 0xE6000000; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = 0x73FF100; - temp_v0_18->unk0 = 0xF3000000; + temp_v0_18->words.w1 = 0x073FF100; + temp_v0_18->words.w0 = 0xF3000000; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = 0; - temp_v0_19->unk0 = 0xE7000000; + temp_v0_19->words.w1 = 0; + temp_v0_19->words.w0 = 0xE7000000; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk0 = 0xF5481000; - temp_v0_20->unk4 = 0x80200; + temp_v0_20->words.w0 = 0xF5481000; + temp_v0_20->words.w1 = 0x00080200; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk0 = 0xF2000000; - temp_v0_21->unk4 = 0xFC07C; + temp_v0_21->words.w0 = 0xF2000000; + temp_v0_21->words.w1 = 0x000FC07C; temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk0 = 0x400103F; - temp_v0_22->unk4 = *temp_t5 + ((arg3 + 4) * 0x10); + temp_v0_22->words.w0 = 0x0400103F; + temp_v0_22->words.w1 = (u32) (*temp_t5 + ((arg3 + 4) * 0x10)); temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = &D_0D008C78; - temp_v0_23->unk0 = 0x6000000; + temp_v0_23->words.w1 = (u32) &D_0D008C78; + temp_v0_23->words.w0 = 0x06000000; temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = 0x10001; - temp_v0_24->unk0 = 0xBB000000; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_24->words.w1 = 0x00010001; + temp_v0_24->words.w0 = 0xBB000000; + D_80164AF0 += 1; } #else GLOBAL_ASM("asm/non_matchings/code_8001F980/func_80025DE8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80021E10(? *, f32 *, s16 *); // extern -? func_80021F84(? *, f32); // extern -? func_80022180(void *, ? *); // extern -? func_8004B614(u16, u16, u16, u16, s32, s32, s32); // extern +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_8004B614(u16, u16, u16, u16, s32, s32, s32); /* extern */ extern ? D_0D008C78; extern ? D_0D008CD8; -extern ? D_800DDBB4; -extern ? D_800DDBD4; -extern s16 D_80164AF0; -extern s32 D_80164B08; -extern s32 D_80164B0C; +extern u32 D_80164B08; +extern u32 D_80164B0C; extern ? D_80164B10; extern ? D_80164B20; extern ? D_80164B30; extern ? D_80164B40; extern ? D_80164B50; extern ? D_80164B60; -extern void *gDisplayListHead; +static ? *D_800DDBB4[8] = { + &D_800E49C0, + &D_800E4AC0, + &D_800E4BC0, + &D_800E4CC0, + &D_800E4DC0, + &D_800E4EC0, + &D_800E4FD0, + &D_800E50D0, +}; +static f32 D_800DDBD4[8] = { 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f, 0.75f }; +static ? D_800E49C0; /* unable to generate initializer */ +static ? D_800E4AC0; /* unable to generate initializer */ +static ? D_800E4BC0; /* unable to generate initializer */ +static ? D_800E4CC0; /* unable to generate initializer */ +static ? D_800E4DC0; /* unable to generate initializer */ +static ? D_800E4EC0; /* unable to generate initializer */ +static ? D_800E4FD0; /* unable to generate initializer */ +static ? D_800E50D0; /* unable to generate initializer */ -void func_800262E0(void *arg0, s8 arg1, s8 arg2, s8 arg3) { - ? spA8; +void func_800262E0(Player *player, s8 arg1, s8 arg2, s8 arg3) { f32 spA4; f32 spA0; f32 sp9C; s16 sp98; s16 sp96; s16 sp94; - f32 *temp_a1; - s32 *temp_t5; + ? **temp_t5; + Gfx *temp_t1; + Gfx *temp_t2; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; s32 temp_t8; - void *temp_t1; - void *temp_t2; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_14; - void *temp_v0_15; - void *temp_v0_16; - void *temp_v0_17; - void *temp_v0_18; - void *temp_v0_19; - void *temp_v0_20; - void *temp_v0_21; - void *temp_v0_22; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; sp94 = 0; - temp_v0 = arg0 + (arg2 * 2); + temp_v0 = player + (arg2 * 2); sp96 = temp_v0->unk48; - temp_a1 = &sp9C; sp98 = temp_v0->unk50 + 0x8000; - sp9C = arg0->unk14; - spA0 = arg0->unk74 + (4.0f * arg0->unk224); - spA4 = arg0->unk1C; - if ((arg0->unk2 & (4 << (arg2 * 4))) == 0) { + sp9C = player->pos[0]; + spA0 = player->unk_074 + (4.0f * player->unk_224); + spA4 = player->pos[2]; + if (!(player->unk_002 & (4 << (arg2 * 4)))) { arg3 = 8; } else { arg3 = 0; } - func_80021E10(&spA8, temp_a1, &sp94); - func_80021F84(&spA8, *(&D_800DDBD4 + (arg0->unk254 * 4)) * arg0->unk224); - func_80022180(gGfxPool + (D_80164AF0 << 6) + 0xFAC0, &spA8); + func_80021E10((f32 (*)[4]) &spA8[0], &sp9C, &sp94); + func_80021F84((f32 (*)[4]) &spA8[0], D_800DDBD4[player->characterId] * player->unk_224); + func_80022180(&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0, (f32 (*)[4]) &spA8[0]); temp_t1 = gDisplayListHead; gDisplayListHead = temp_t1 + 8; - temp_t1->unk0 = 0x1020040; - temp_t1->unk4 = (gGfxPool + (D_80164AF0 << 6) + 0xFAC0) & 0x1FFFFFFF; + temp_t1->words.w0 = 0x01020040; + temp_t1->words.w1 = (s32) (&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0) & 0x1FFFFFFF; temp_t2 = gDisplayListHead; gDisplayListHead = temp_t2 + 8; - temp_t2->unk0 = 0x6000000; - temp_t2->unk4 = &D_0D008CD8; + temp_t2->words.w0 = 0x06000000; + temp_t2->words.w1 = (u32) &D_0D008CD8; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = 0x8000; - temp_v0_2->unk0 = 0xBA000E02; + temp_v0_2->words.w1 = 0x00008000; + temp_v0_2->words.w0 = 0xBA000E02; temp_t8 = arg1 * 2; - func_8004B614(*(&D_80164B10 + temp_t8), *(&D_80164B20 + temp_t8), *(&D_80164B30 + temp_t8), *(&D_80164B40 + temp_t8), *(&D_80164B50 + temp_t8), *(&D_80164B60 + temp_t8), arg0->unkC6 / 2); + func_8004B614(*(&D_80164B10 + temp_t8), *(&D_80164B20 + temp_t8), *(&D_80164B30 + temp_t8), *(&D_80164B40 + temp_t8), (s32) *(&D_80164B50 + temp_t8), (s32) *(&D_80164B60 + temp_t8), (s16) player->unk_0C6 / 2); temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xB900031D; - temp_v0_3->unk4 = 0x504A50; + temp_v0_3->words.w0 = 0xB900031D; + temp_v0_3->words.w1 = 0x00504A50; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD500000; - temp_v0_4->unk4 = D_80164B08; + temp_v0_4->words.w0 = 0xFD500000; + temp_v0_4->words.w1 = D_80164B08; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x7080200; - temp_v0_5->unk0 = 0xF5500000; + temp_v0_5->words.w1 = 0x07080200; + temp_v0_5->words.w0 = 0xF5500000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x73FF100; - temp_v0_7->unk0 = 0xF3000000; + temp_v0_7->words.w1 = 0x073FF100; + temp_v0_7->words.w0 = 0xF3000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk0 = 0xF5481000; - temp_v0_9->unk4 = 0x80200; + temp_v0_9->words.w0 = 0xF5481000; + temp_v0_9->words.w1 = 0x00080200; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0xF2000000; - temp_v0_10->unk4 = 0xFC07C; + temp_v0_10->words.w0 = 0xF2000000; + temp_v0_10->words.w1 = 0x000FC07C; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0x400103F; - temp_t5 = (arg1 * 4) + &D_800DDBB4; - temp_v0_11->unk4 = *temp_t5 + (arg3 * 0x10); + temp_v0_11->words.w0 = 0x0400103F; + temp_t5 = &D_800DDBB4[arg1]; + temp_v0_11->words.w1 = (u32) (*temp_t5 + (arg3 * 0x10)); temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_0D008C78; - temp_v0_12->unk0 = 0x6000000; + temp_v0_12->words.w1 = (u32) &D_0D008C78; + temp_v0_12->words.w0 = 0x06000000; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0xFD500000; - temp_v0_13->unk4 = D_80164B0C; + temp_v0_13->words.w0 = 0xFD500000; + temp_v0_13->words.w1 = D_80164B0C; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0x7080200; - temp_v0_14->unk0 = 0xF5500000; + temp_v0_14->words.w1 = 0x07080200; + temp_v0_14->words.w0 = 0xF5500000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0; - temp_v0_15->unk0 = 0xE6000000; + temp_v0_15->words.w1 = 0; + temp_v0_15->words.w0 = 0xE6000000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0x73FF100; - temp_v0_16->unk0 = 0xF3000000; + temp_v0_16->words.w1 = 0x073FF100; + temp_v0_16->words.w0 = 0xF3000000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0; - temp_v0_17->unk0 = 0xE7000000; + temp_v0_17->words.w1 = 0; + temp_v0_17->words.w0 = 0xE7000000; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk0 = 0xF5481000; - temp_v0_18->unk4 = 0x80200; + temp_v0_18->words.w0 = 0xF5481000; + temp_v0_18->words.w1 = 0x00080200; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk0 = 0xF2000000; - temp_v0_19->unk4 = 0xFC07C; + temp_v0_19->words.w0 = 0xF2000000; + temp_v0_19->words.w1 = 0x000FC07C; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk0 = 0x400103F; - temp_v0_20->unk4 = *temp_t5 + ((arg3 + 4) * 0x10); + temp_v0_20->words.w0 = 0x0400103F; + temp_v0_20->words.w1 = (u32) (*temp_t5 + ((arg3 + 4) * 0x10)); temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = &D_0D008C78; - temp_v0_21->unk0 = 0x6000000; + temp_v0_21->words.w1 = (u32) &D_0D008C78; + temp_v0_21->words.w0 = 0x06000000; temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = 0x10001; - temp_v0_22->unk0 = 0xBB000000; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_22->words.w1 = 0x00010001; + temp_v0_22->words.w0 = 0xBB000000; + D_80164AF0 += 1; } #else GLOBAL_ASM("asm/non_matchings/code_8001F980/func_800262E0.s") diff --git a/src/code_8001F980.h b/src/code_8001F980.h index eb81e5e74..d2b6c1c7d 100644 --- a/src/code_8001F980.h +++ b/src/code_8001F980.h @@ -7,7 +7,9 @@ /* Function Prototypes */ void func_8001F980(s32*, s32*); -void func_80020000(Player*, struct Camera*, u8, u8); +u16 func_8001FB0C(Player*, Camera*, f32, f32); +u16 func_8001FD78(Player*, f32, f32, f32); +void func_80020000(Player*, Camera*, u8, u8); void func_8002088C(); void func_80020F1C(); void func_80021244(Player*, u8, u8); @@ -22,6 +24,7 @@ void func_80021F84(Mat4, f32); void func_80021FF8(Mtx*, Mat4); void func_80022180(Mtx*, Mat4); s32 func_800224F0(s16*, s16, s16); +void func_8002276C(); void move_s32_towards(s32*, s32, f32); void move_f32_towards(f32*, f32, f32); void move_s16_towards(s16*, s16, f32); diff --git a/src/code_80281FA0.c b/src/code_80281FA0.c index 5cc7a27f6..d0ad9db7b 100644 --- a/src/code_80281FA0.c +++ b/src/code_80281FA0.c @@ -245,10 +245,10 @@ GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_80282700.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80282700(f32, f32, s32, s32, f32 *, f32 *, f32 *, f32 *); // extern +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +? func_80282700(f32, f32, f32 *, f32 *, f32 *, f32 *, f32 *, f32 *); /* extern */ -s32 func_802828C8(s32 arg0, s32 arg1, s32 arg2, s16 *arg3, f32 *arg4) { +s32 func_802828C8(f32 *arg0, f32 *arg1, s32 arg2, s16 *arg3, f32 *arg4) { s32 sp94; f32 sp90; f32 sp8C; @@ -268,76 +268,71 @@ s32 func_802828C8(s32 arg0, s32 arg1, s32 arg2, s16 *arg3, f32 *arg4) { f32 sp54; f32 sp44; f32 sp40; - f32 *temp_a3; - f32 *temp_t9; f32 temp_f0; + f32 var_f12; + f32 var_f14; + f32 var_f16; s16 temp_v1; + s32 var_t1; u16 temp_v1_2; u16 temp_v1_3; void *temp_v0; void *temp_v0_2; void *temp_v0_3; - f32 phi_f12; - f32 phi_f16; - f32 phi_f14; - s32 phi_t1; temp_v1 = *arg3; - phi_f12 = *arg4; - phi_f16 = 0.0f; - phi_f14 = 0.0f; - phi_t1 = 0; - phi_t1 = 0; + var_f12 = *arg4; if (temp_v1 < 0) { - phi_f12 = 0.0f; + var_f12 = 0.0f; } temp_v0 = arg2 + (temp_v1 * 0xC); if ((temp_v0->unk0 == -1) || (temp_v0->unkC == -1) || (temp_v0->unk18 == -1)) { return 1; } temp_v0_2 = arg2 + (temp_v1 * 0xC); - temp_a3 = &sp54; - sp54 = temp_v0_2->unk6; - sp58 = temp_v0_2->unk8; - sp5C = temp_v0_2->unkA; - sp60 = temp_v0_2->unk4 * 256.0f; - sp64 = temp_v0_2->unk12; - sp68 = temp_v0_2->unk14; - sp6C = temp_v0_2->unk16; - sp70 = temp_v0_2->unk10 * 256.0f; - sp74 = temp_v0_2->unk1E; - sp78 = temp_v0_2->unk20; - sp7C = temp_v0_2->unk22; - temp_t9 = &sp84; - sp80 = temp_v0_2->unk1C * 256.0f; - sp84 = temp_v0_2->unk2A; - sp88 = temp_v0_2->unk2C; - sp8C = temp_v0_2->unk2E; + sp54 = (f32) temp_v0_2->unk6; + sp58 = (f32) temp_v0_2->unk8; + sp5C = (f32) temp_v0_2->unkA; + sp60 = (f32) temp_v0_2->unk4 * 256.0f; + sp64 = (f32) temp_v0_2->unk12; + sp68 = (f32) temp_v0_2->unk14; + sp6C = (f32) temp_v0_2->unk16; + sp70 = (f32) temp_v0_2->unk10 * 256.0f; + sp74 = (f32) temp_v0_2->unk1E; + sp78 = (f32) temp_v0_2->unk20; + sp7C = (f32) temp_v0_2->unk22; + sp80 = (f32) temp_v0_2->unk1C * 256.0f; + sp84 = (f32) temp_v0_2->unk2A; + sp88 = (f32) temp_v0_2->unk2C; + sp8C = (f32) temp_v0_2->unk2E; sp40 = 0.0f; sp44 = 0.0f; sp94 = 0; - sp90 = temp_v0_2->unk28 * 256.0f; - func_80282700(phi_f12, 0.0f, arg0, arg1, temp_a3, &sp64, &sp74, temp_t9); + sp90 = (f32) temp_v0_2->unk28 * 256.0f; + func_80282700(var_f12, 0.0f, arg0, arg1, &sp54, &sp64, &sp74, &sp84); + var_t1 = sp94; + var_f14 = sp44; + var_f16 = sp40; temp_v0_3 = arg2 + (*arg3 * 0xC); temp_v1_2 = temp_v0_3->unkE; if (temp_v1_2 != 0) { - phi_f14 = 1.0f / temp_v1_2; + var_f14 = 1.0f / (f32) temp_v1_2; } temp_v1_3 = temp_v0_3->unk1A; if (temp_v1_3 != 0) { - phi_f16 = 1.0f / temp_v1_3; + var_f16 = 1.0f / (f32) temp_v1_3; } temp_f0 = *arg4; - *arg4 = temp_f0 + ((temp_f0 * (phi_f16 - phi_f14)) + phi_f14); + *arg4 = temp_f0 + ((temp_f0 * (var_f16 - var_f14)) + var_f14); if (*arg4 >= 1.0f) { - *arg3 = *arg3 + 1; + *arg3 += 1; if ((arg2 + (*arg3 * 0xC))->unk24 == -1) { *arg3 = 0; - phi_t1 = 1; + var_t1 = 1; } - *arg4 = *arg4 - 1.0f; + *arg4 -= 1.0f; } - return phi_t1; + return var_t1; } #else GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_802828C8.s") @@ -409,23 +404,23 @@ loop_1: GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_80282C40.s") #endif -s32 func_80282D90(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { +s32 func_80282D90(Camera *camera, s32 arg1, s32 arg2, s32 arg3) { s32 res; - func_802832C4(&func_80282434, arg0, 0, 0); + func_802832C4(&func_80282434, camera, 0, 0); func_80282C40(&D_80287818, arg1, arg3); func_80282C40(&D_80287998, arg2, arg3); if (0) {}; // debug stub? - res = func_802828C8(arg0 + 0xC, arg0 + 0x18, &D_80287818, &D_80287B1C, &D_80287B18) | - func_802828C8(arg0, arg0 + 0x18, &D_80287998, &D_80287B1C, &D_80287B18); + res = func_802828C8(camera->lookAt, camera->up, &D_80287818, &D_80287B1C, &D_80287B18) | + func_802828C8(camera->pos, camera->up, &D_80287998, &D_80287B1C, &D_80287B18); return res; } -void func_80282E58(s32 arg0, s32 arg1, s32 arg2) { +void func_80282E58(Camera *camera, s32 arg1, s32 arg2) { func_80282C40(&D_80287818, arg1, arg2); - func_802828C8(arg0 + 0xC, arg0 + 0x18, &D_80287818, &D_80287B1C, &D_80287B18); + func_802828C8(camera->lookAt, camera->up, &D_80287818, &D_80287B1C, &D_80287B18); } #ifdef MIPS_TO_C @@ -545,9 +540,9 @@ void func_80283240(s16 arg0) { } } -s32 func_802832C4(void (*func_ptr)(s32), s32 arg1, s16 arg2, s16 arg3) { +s32 func_802832C4(void (*func_ptr)(s32), Camera *camera, s16 arg2, s16 arg3) { if ((D_802876D2 >= arg2) && ((arg3 == -1) || (arg3 >= D_802876D2))) { - func_ptr(arg1); + func_ptr(camera); } return 0; } @@ -683,7 +678,7 @@ GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_80283430.s") #endif #ifdef MIPS_TO_C -//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9 +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de ? func_80282F44(?, s32 *, Camera *); /* extern */ ? func_80283100(s32 *, f32 *); /* extern */ s32 func_8028336C(s32 *, Camera *); /* extern */ @@ -716,10 +711,10 @@ s32 func_80283648(Camera *camera) { func_80283428(); vec3f_copy_dupe(&sp58, camera->pos); - temp_a1 = &camera->unk; + temp_a1 = camera->lookAt; sp34 = temp_a1; vec3f_copy_dupe(&sp4C, temp_a1); - temp_a1_2 = &camera->angleX; + temp_a1_2 = camera->up; sp30 = temp_a1_2; vec3f_copy_dupe(&sp40, temp_a1_2); temp_v1 = func_8028336C(&D_802876E0, camera) & 0xFF; @@ -755,15 +750,15 @@ s32 func_80283648(Camera *camera) { temp_t9 = (u32) var_f0 & 0xFFFF; sp2C = temp_t9; sp38 = sins((u16) temp_t9); - camera->angleX = coss((u16) sp6C) * sp38; - camera->angleY = coss(unksp2E); + camera->up[0] = coss((u16) sp6C) * sp38; + camera->up[1] = coss(unksp2E); sp38 = sins(unksp2E); - camera->angleZ = sins((u16) sp6C) * -sp38; + camera->up[2] = sins((u16) sp6C) * -sp38; vec3f_copy_dupe(camera->pos, &D_802876EC); vec3f_copy_dupe(sp34, (f32 *) &D_802876E0); if ((gGamestate == 9) && (gIsMirrorMode != 0)) { camera->pos[0] = -camera->pos[0]; - camera->unk = -camera->unk; + camera->lookAt[0] = -camera->lookAt[0]; } } func_80282F44(0, &D_802876E0, camera); @@ -884,77 +879,77 @@ void func_80283D04(s32 arg0) { play_sound2(0x49008026); } -void func_80283D2C(s32 arg0) { +void func_80283D2C(Camera *camera) { D_802856B8 = 120.0f; - func_802832C4(&func_80283CA8, arg0, 0, 0); - func_802832C4(&func_80283A34, arg0, 1, 1); - func_802832C4(&func_80283BF0, arg0, 0, 0); - func_802832C4(&func_80283A7C, arg0, 0x2D, 0x2D); - func_802832C4(&func_80283A7C, arg0, 0x41, 0x41); - func_802832C4(&func_80283A7C, arg0, 0x46, 0x46); - func_802832C4(&func_80283A7C, arg0, 0x5E, 0x5E); - func_802832C4(&func_80283A7C, arg0, 0x6E, 0x6E); - func_802832C4(&func_80283A7C, arg0, 0x82, 0x82); - func_802832C4(&func_80283A7C, arg0, 0x98, 0x98); - func_802832C4(&func_80283A7C, arg0, 0xA0, 0xA0); - func_802832C4(&func_80283994, arg0, D_80285D14 - 0x3C, D_80285D14 - 0x3C); - func_80282D90(arg0, &D_802856DC, &D_80285718, 0); + func_802832C4(&func_80283CA8, camera, 0, 0); + func_802832C4(&func_80283A34, camera, 1, 1); + func_802832C4(&func_80283BF0, camera, 0, 0); + func_802832C4(&func_80283A7C, camera, 0x2D, 0x2D); + func_802832C4(&func_80283A7C, camera, 0x41, 0x41); + func_802832C4(&func_80283A7C, camera, 0x46, 0x46); + func_802832C4(&func_80283A7C, camera, 0x5E, 0x5E); + func_802832C4(&func_80283A7C, camera, 0x6E, 0x6E); + func_802832C4(&func_80283A7C, camera, 0x82, 0x82); + func_802832C4(&func_80283A7C, camera, 0x98, 0x98); + func_802832C4(&func_80283A7C, camera, 0xA0, 0xA0); + func_802832C4(&func_80283994, camera, D_80285D14 - 0x3C, D_80285D14 - 0x3C); + func_80282D90(camera, &D_802856DC, &D_80285718, 0); } -void func_80283EA0(s32 arg0) { - func_80282D90(arg0, &D_80285754, &D_80285784, 0); +void func_80283EA0(Camera *camera) { + func_80282D90(camera, &D_80285754, &D_80285784, 0); } -void func_80283ED0(Vec3f arg0) { - vec3f_copy_dupe(arg0, &gPlayerTwo->pos[0]); +void func_80283ED0(Camera *camera) { + vec3f_copy_dupe(camera->pos, gPlayerTwo->pos); } -void func_80283EF8(Vec3f arg0) { - func_802821A0(&arg0[0], gPlayerTwo->pos[0], 0.12f); - func_802821A0(&arg0[1], gPlayerTwo->pos[1], 0.12f); - func_802821A0(&arg0[2], gPlayerTwo->pos[2], 0.12f); +void func_80283EF8(Camera *camera) { + func_802821A0(&camera->pos[0], gPlayerTwo->pos[0], 0.12f); + func_802821A0(&camera->pos[1], gPlayerTwo->pos[1], 0.12f); + func_802821A0(&camera->pos[2], gPlayerTwo->pos[2], 0.12f); } -void func_80283F6C(s32 arg0) { - func_802832C4(&func_80283ED0, arg0, 0, 0); - func_802832C4(&func_80283EF8, arg0, 0, -1); - func_80282E58(arg0, &D_802857B4, 0); +void func_80283F6C(Camera *camera) { + func_802832C4(&func_80283ED0, camera, 0, 0); + func_802832C4(&func_80283EF8, camera, 0, -1); + func_80282E58(camera, &D_802857B4, 0); } -void func_80283FCC(Vec3f arg0) { - vec3f_copy_dupe(arg0, &gPlayerThree->pos[0]); +void func_80283FCC(Camera *camera) { + vec3f_copy_dupe(camera->pos, gPlayerThree->pos); } -void func_80283FF4(Vec3f arg0) { - func_802821A0(&arg0[0], gPlayerThree->pos[0], 0.12f); - func_802821A0(&arg0[1], gPlayerThree->pos[1], 0.12f); - func_802821A0(&arg0[2], gPlayerThree->pos[2], 0.12f); +void func_80283FF4(Camera *camera) { + func_802821A0(&camera->pos[0], gPlayerThree->pos[0], 0.12f); + func_802821A0(&camera->pos[1], gPlayerThree->pos[1], 0.12f); + func_802821A0(&camera->pos[2], gPlayerThree->pos[2], 0.12f); } -void func_80284068(s32 arg0) { - func_802832C4(&func_80283FCC, arg0, 0, 0); - func_802832C4(&func_80283FF4, arg0, 0, -1); - func_80282E58(arg0, &D_802857CC, 0); +void func_80284068(Camera *camera) { + func_802832C4(&func_80283FCC, camera, 0, 0); + func_802832C4(&func_80283FF4, camera, 0, -1); + func_80282E58(camera, &D_802857CC, 0); } -void func_802840C8(s32 arg0) { - func_802832C4(&func_80283C14, arg0, 5, 5); +void func_802840C8(Camera *camera) { + func_802832C4(&func_80283C14, camera, 5, 5); switch(D_802876D8) { case 2: - func_80283EA0(arg0); + func_80283EA0(camera); break; case 3: - func_80283F6C(arg0); + func_80283F6C(camera); break; case 4: - func_80284068(arg0); + func_80284068(camera); break; } } -void func_80284154(s32 arg0) { - func_80282D90(arg0, &D_80285910, &D_80285928, 0); +void func_80284154(Camera *camera) { + func_80282D90(camera, &D_80285910, &D_80285928, 0); } #ifdef MIPS_TO_C @@ -974,16 +969,16 @@ void func_80284184(s32 *arg0) { GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_80284184.s") #endif -void func_802841E8(Vec3f arg0) { - func_80282E58(arg0, &D_80285940, 0); - vec3f_set_dupe(arg0, -3202.0f, 90.0f, -478.0f); +void func_802841E8(Camera *camera) { + func_80282E58(camera, &D_80285940, 0); + vec3f_set_dupe(camera->pos, -3202.0f, 90.0f, -478.0f); } -void func_8028422C(s32 arg0) { - func_802832C4(&func_80283AF4, arg0, 6, 6); - func_802832C4(&func_80283B44, arg0, 0x1E, 0x1E); - func_802832C4(&func_802841E8, arg0, 0, 0); - func_802832C4(&func_80284184, arg0, 6, -1); +void func_8028422C(Camera *camera) { + func_802832C4(&func_80283AF4, camera, 6, 6); + func_802832C4(&func_80283B44, camera, 0x1E, 0x1E); + func_802832C4(&func_802841E8, camera, 0, 0); + func_802832C4(&func_80284184, camera, 6, -1); } void func_802842A8(s32 arg0) { @@ -995,39 +990,36 @@ void func_802842D8(s32 arg0) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80282D90(void *, ? *, ? *, ?); // extern -? func_802832C4(? *, void *, ?, ?); // extern -extern ? D_802858E0; -extern ? D_802858F8; -extern ? D_80285A00; -extern s8 D_802874F5; +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +static ? D_802858E0; /* unable to generate initializer */ +static ? D_802858F8; /* unable to generate initializer */ +static ? D_80285A00; /* unable to generate initializer */ -void func_80284308(void *arg0) { +void func_80284308(Camera *camera) { s32 sp30; - Player *player = &gPlayerOne; + Player *temp_v1; f32 temp_f0; f32 temp_f12; f32 temp_f2; void *temp_v0; sp30.unk0 = D_80285A00.unk0; - sp30.unk4 = D_80285A00.unk4; - sp30.unkC = D_80285A00.unkC; - sp30.unk8 = D_80285A00.unk8; - func_802832C4(&func_80283A54, arg0, 0x8C, 0x8C); - func_80282D90(arg0, &D_802858E0, &D_802858F8, 0); + sp30.unk4 = (s32) D_80285A00.unk4; + sp30.unkC = (s32) D_80285A00.unkC; + sp30.unk8 = (s32) D_80285A00.unk8; + func_802832C4(func_80283A54, (s32) camera, 0x008C, 0x008C); + func_80282D90((s32) camera, (s32) &D_802858E0, (s32) &D_802858F8, 0); temp_v0 = *(sp30 + (D_802874F5 * 4)); - //player = gPlayerOne; - temp_f0 = temp_v0->unk14 - player->pos[0]; - temp_f12 = temp_v0->unk1C - player->pos[2]; - temp_f2 = temp_v0->unk18 - player->pos[1]; - arg0->unkC = arg0->unkC + temp_f0; - arg0->unk0 = arg0->unk0 + temp_f0; - arg0->unk14 = arg0->unk14 + temp_f12; - arg0->unk8 = arg0->unk8 + temp_f12; - arg0->unk4 = arg0->unk4 + temp_f2; - arg0->unk10 = arg0->unk10 + temp_f2; + temp_v1 = gPlayerOne; + temp_f0 = temp_v0->unk14 - temp_v1->pos[0]; + temp_f12 = temp_v0->unk1C - temp_v1->pos[2]; + temp_f2 = temp_v0->unk18 - temp_v1->pos[1]; + camera->lookAt[0] += temp_f0; + camera->pos[0] += temp_f0; + camera->lookAt[2] += temp_f12; + camera->pos[2] += temp_f12; + camera->pos[1] += temp_f2; + camera->lookAt[1] += temp_f2; } #else GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_80284308.s") diff --git a/src/code_80281FA0.h b/src/code_80281FA0.h index 6326ba569..6a6ad0ebf 100644 --- a/src/code_80281FA0.h +++ b/src/code_80281FA0.h @@ -24,11 +24,11 @@ void func_80282434(s32); void func_80282454(Vec3f, Vec3f, f32*, s16*, s16*); void func_80282504(Vec3f, Vec3f, f32, s16, s16); void func_802825C8(Vec3f, Vec3f, Vec3f, Vec3s); -s32 func_80282D90(s32, s32, s32, s32); -void func_80282E58(s32, s32, s32); +s32 func_80282D90(Camera*, s32, s32, s32); +void func_80282E58(Camera*, s32, s32); void func_80282F00(s16*, s16); void func_80283240(s16); -s32 func_802832C4(void (*)(s32), s32, s16, s16); +s32 func_802832C4(void (*)(s32), Camera*, s16, s16); s32 func_80283330(s32); s32 func_80283428(); void func_80283968(s32); @@ -55,19 +55,19 @@ void func_80283C78(s32); void func_80283CA8(s32); void func_80283CD0(s32); void func_80283D04(s32); -void func_80283D2C(s32); -void func_80283EA0(s32); -void func_80283ED0(Vec3f); -void func_80283EF8(Vec3f); -void func_80283F6C(s32); -void func_80283FCC(Vec3f); -void func_80283FF4(Vec3f); -void func_80284068(s32); -void func_802840C8(s32); -void func_80284154(s32); +void func_80283D2C(Camera*); +void func_80283EA0(Camera*); +void func_80283ED0(Camera*); +void func_80283EF8(Camera*); +void func_80283F6C(Camera*); +void func_80283FCC(Camera*); +void func_80283FF4(Camera*); +void func_80284068(Camera*); +void func_802840C8(Camera*); +void func_80284154(Camera*); void func_80284184(); -void func_802841E8(Vec3f); -void func_8028422C(s32); +void func_802841E8(Camera*); +void func_8028422C(Camera*); void func_802842A8(s32); void func_802842D8(s32); void func_80284418(s32 arg0); diff --git a/src/crash_screen.c b/src/crash_screen.c index 1a0a31bcb..7d42e3f86 100644 --- a/src/crash_screen.c +++ b/src/crash_screen.c @@ -83,120 +83,38 @@ void crash_screen_draw_glyph(u16 *framebuffer, s32 x, s32 y, s32 glyph) { } } -#ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 +#ifdef NON_MATCHING +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de #define WHITE_COLOUR 0xFFFF #define RED_COLOUR 0xF801 -void crash_screen_draw_square(u16 *framebuffer) { - s32 temp_a0; - s32 temp_a1; - s32 temp_a1_2; - s32 temp_ra; - s32 temp_s0; - s32 temp_s1; - s32 temp_t0; - s32 temp_v1; - s32 phi_s2; - s32 phi_s0; - s16 *phi_v0; - s32 phi_v1; - void *phi_v0_2; - s32 phi_a1; - s32 phi_s1; - s32 phi_a0; - s32 phi_a1_2; - s32 phi_v1_2; - s32 phi_a0_2; - s32 phi_a0_3; - s32 phi_a1_3; - s32 phi_a1_4; - s32 i, j, k; - //phi_s2 = 0x28; - //phi_s0 = 0x2E; - phi_a0_2 = framebuffer; - //phi_a1_3 = arg1; - for (i = 46; i > 44; i--) { - //phi_s1 = phi_s2; - //phi_a0 = phi_a0_2; - //phi_a1_2 = phi_a1_3; - // phi_a0_3 = phi_a0_2; - //phi_a1_4 = phi_a1_3; - //if (phi_s2 < phi_s0) { - for (j = 40; j < i; j++) { - //phi_v1 = phi_s2; - //phi_v1_2 = phi_s2; - if (phi_s2 < phi_s0) { - //temp_a0 = i - j; - temp_t0 = (i - j) & 3; - //temp_ra = framebuffer + (phi_s1 * 0x280); - //phi_a0_3 = temp_a0; - if (temp_t0 != 0) { - phi_v0 = temp_ra + (phi_s2 * 2); - do { // (temp_t0 + j;) { - j++; - //temp_v1 = phi_v1 + 1; - //phi_v1 = temp_v1; - //phi_v1_2 = temp_v1; - if (i - j == 6) { - framebuffer[i * 640 + j * 2] = RED_COLOUR; - } else { - framebuffer[i * 640 + j * 2] = WHITE_COLOUR; - } - j += 2; - } while ((temp_t0 + j) != j); - phi_a1_4 = temp_v1 * 2; - if (temp_v1 != phi_s0) { - break; // goto 10 - } - } else { -//block_10: - //temp_a1 = phi_v1_2 * 2; - phi_v0_2 = framebuffer[i * 640 + j * 2]; - phi_a1 = temp_a1; - for (k = j + 8; k < j * 2; k += 8) { - //do { - //temp_a1_2 = phi_a1 + 8; - //phi_a1 = temp_a1_2; - //phi_a1_4 = temp_a1_2; - if (temp_a0 == 6) { - framebuffer[i * 640 + j * 2] = RED_COLOUR; - } else { - framebuffer[i * 640 + j * 2] = WHITE_COLOUR; - } - //if (temp_a0 == 6) { - // phi_v0_2->unk2 = RED_COLOUR; - //} else { - // phi_v0_2->unk2 = WHITE_COLOUR; - //} - //if (temp_a0 == 6) { - // phi_v0_2->unk4 = RED_COLOUR; - //} else { - // phi_v0_2->unk4 = WHITE_COLOUR; - //} - //if (temp_a0 == 6) { - // phi_v0_2->unk6 = RED_COLOUR; - //} else { - // phi_v0_2->unk6 = WHITE_COLOUR; - //} - //phi_v0_2 += 8; - } //while (temp_a1_2 != (phi_s0 * 2)); - } +/** + * The big mismatch is the handling of the '6' used in the if statement + * In the target assembly that 6 is saved to 5 different temp registers, + * while in this non-matching decomp its only saved to one temp register. + * This seems to be related to how the innermost for loop is unrolled, but + * its not clear why the target assembley would save the same immediate to + * 5 different registers instead of just re-using one + * There's some stack related differences too, maybe that's related? + **/ +void crash_screen_draw_square(u16 *framebuffer) { + s32 var_s0; + s32 var_s2; + s32 row; + s32 column; + + for (var_s0 = 0x2E, var_s2 = 0x28; var_s0 > 0x2C; var_s0--, var_s2++) { + for (row = var_s2; row < var_s0; row++) { + for (column = var_s2; column < var_s0; column++) { + if ((var_s0 - var_s2) == 6) { + framebuffer[(row * 320) + column] = RED_COLOUR; + } else { + framebuffer[(row * 320) + column] = WHITE_COLOUR; } - //temp_s1 = phi_s1 + 1; - //phi_s1 = temp_s1; - //phi_a0 = phi_a0_3; - //phi_a1_2 = phi_a1_4; - } //while (temp_s1 != phi_s0); - - //temp_s0 = phi_s0 - 1; - //phi_s2 += 1; - //phi_s0 = temp_s0; - //phi_a0_2 = phi_a0; - //phi_a1_3 = phi_a1_2; - //i--; - } //while (temp_s0 != 44); + } + } + } osWritebackDCacheAll(); osViSwapBuffer(framebuffer); } diff --git a/src/data_segment2.h b/src/data_segment2.h index 223c098ec..b7159be29 100644 --- a/src/data_segment2.h +++ b/src/data_segment2.h @@ -3,7 +3,7 @@ #include -extern s32 D_02007B38[]; +extern Vtx D_02007B38[]; extern Gfx D_02007650[]; extern Gfx D_020076B0[]; diff --git a/src/data_segment2.inc.c b/src/data_segment2.inc.c index a01b732ae..d08474c40 100644 --- a/src/data_segment2.inc.c +++ b/src/data_segment2.inc.c @@ -269,25 +269,15 @@ Gfx D_02007B18[] = { gsSPEndDisplayList(), }; -// gfx data? -UNUSED s32 D_02007B38[] = { -0x00000000, 0x00000000, - 0x00000000, 0xffffffff, - 0x00100000, 0x00000000, - 0x00000000, 0xffffffff, - 0x00100010, 0x00000000, - 0x00000000, 0xffffffff, - 0x00000010, 0x00000000, - 0x00000000, 0xffffffff, - 0x0000fff8, 0x00000000, - 0x00000000, 0xffffffff, - 0x0008fff8, 0x00000000, - 0x01c00000, 0xffffffff, - 0x00080000, 0x00000000, - 0x01c001c0, 0xff0000ff, - 0x00000000, 0x00000000, - 0x000001c0, 0xff0000ff, - +UNUSED Vtx D_02007B38[] = { + {{{ 0, 0, 0}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ 16, 0, 0}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ 16, 16, 0}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ 0, 16, 0}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ 0, -8, 0}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ 8, -8, 0}, 0, {448, 0}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ 8, 0, 0}, 0, {448, 448}, {0xff, 0x00, 0x00, 0xff}}}, + {{{ 0, 0, 0}, 0, { 0, 448}, {0xff, 0x00, 0x00, 0xff}}}, }; // Todo: Place all theces vertices in a single array diff --git a/src/render_courses.c b/src/render_courses.c index c60669c2f..c87c9b18d 100644 --- a/src/render_courses.c +++ b/src/render_courses.c @@ -229,21 +229,20 @@ void func_802911C4(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -? init_rdp(); /* extern */ -? func_802B4FF8(? *, ?); /* extern */ -? mtxf_identity(? *, s32 *, Gfx **); /* extern */ -? mtxf_translate(? *, f32 *, Gfx **); /* extern */ -? load_surface_map(? *, void *, Gfx **); /* extern */ +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +s32 func_80290C20(Camera *); /* extern */ +f32 func_802AAB4C(Player *); /* extern */ +? init_rdp(); /* extern */ +? load_surface_map(? *, struct UnkStruct_800DC5EC *, Gfx **); /* extern */ extern ? D_06009228; extern ? D_060164B8; extern ? D_06019578; extern ? D_090001D0; +extern f32 D_8015F8E4; s16 gCurrentCourseId; /* unable to generate initializer */ -void func_8029122C(void *arg0, s32 *arg1) { - void *sp268; - ? sp228; +void func_8029122C(struct UnkStruct_800DC5EC *arg0, s32 arg1) { + Player *sp268; f32 sp224; f32 sp220; f32 sp21C; @@ -258,26 +257,8 @@ void func_8029122C(void *arg0, s32 *arg1) { Gfx *temp_v1_102; Gfx *temp_v1_103; Gfx *temp_v1_104; - Gfx *temp_v1_105; - Gfx *temp_v1_106; - Gfx *temp_v1_107; - Gfx *temp_v1_108; - Gfx *temp_v1_109; Gfx *temp_v1_10; - Gfx *temp_v1_110; - Gfx *temp_v1_111; - Gfx *temp_v1_112; - Gfx *temp_v1_113; - Gfx *temp_v1_114; - Gfx *temp_v1_115; - Gfx *temp_v1_116; - Gfx *temp_v1_117; - Gfx *temp_v1_118; - Gfx *temp_v1_119; Gfx *temp_v1_11; - Gfx *temp_v1_120; - Gfx *temp_v1_121; - Gfx *temp_v1_122; Gfx *temp_v1_12; Gfx *temp_v1_13; Gfx *temp_v1_14; @@ -374,149 +355,130 @@ void func_8029122C(void *arg0, s32 *arg1) { Gfx *temp_v1_98; Gfx *temp_v1_99; Gfx *temp_v1_9; - f32 *temp_a1; - s16 temp_t3; + Gfx *var_v1; + Gfx *var_v1_2; + Gfx *var_v1_3; s16 temp_t7; - s32 phi_t6; - Gfx *phi_v1; - s32 *phi_a1; - Gfx **phi_a2; - Gfx *phi_v1_2; - Gfx *phi_v1_3; + u32 var_t6; - sp268 = arg0->unk8; + sp268 = arg0->player; init_rdp(); - sp21A = arg0->unk38; - sp218 = arg0->unk4->unk26; - temp_t3 = arg0->unk36; - phi_a1 = arg1; - phi_a2 = &gDisplayListHead; - if (arg1 != 0) { - if (arg1 != 1) { - if (arg1 != 2) { - phi_a2 = &gDisplayListHead; - if (arg1 != 3) { - - } else { - temp_v1 = gDisplayListHead; - gDisplayListHead = temp_v1 + 8; - temp_v1->words.w0 = 0x1030040; - temp_v1->words.w1 = (gGfxPool + 0x100) & 0x1FFFFFFF; - temp_v1_2 = gDisplayListHead; - gDisplayListHead = temp_v1_2 + 8; - temp_v1_2->words.w0 = 0x1010040; - phi_t6 = (gGfxPool + 0x280) & 0x1FFFFFFF; - phi_v1 = temp_v1_2; - goto block_9; - } - } else { - temp_v1_3 = gDisplayListHead; - gDisplayListHead = temp_v1_3 + 8; - temp_v1_3->words.w0 = 0x1030040; - temp_v1_3->words.w1 = (gGfxPool + 0xC0) & 0x1FFFFFFF; - temp_v1_4 = gDisplayListHead; - gDisplayListHead = temp_v1_4 + 8; - temp_v1_4->words.w0 = 0x1010040; - temp_v1_4->words.w1 = (gGfxPool + 0x240) & 0x1FFFFFFF; - phi_a1 = &gGfxPool; - phi_a2 = &gDisplayListHead; - } - } else { - temp_v1_5 = gDisplayListHead; - gDisplayListHead = temp_v1_5 + 8; - temp_v1_5->words.w0 = 0x1030040; - temp_v1_5->words.w1 = (gGfxPool + 0x80) & 0x1FFFFFFF; - temp_v1_6 = gDisplayListHead; - gDisplayListHead = temp_v1_6 + 8; - temp_v1_6->words.w0 = 0x1010040; - phi_t6 = (gGfxPool + 0x200) & 0x1FFFFFFF; - phi_v1 = temp_v1_6; + sp21A = arg0->pathCounter; + sp218 = arg0->camera->rot[1]; + switch (arg1) { /* switch 4; irregular */ + case 0: /* switch 4 */ + temp_v1 = gDisplayListHead; + gDisplayListHead = temp_v1 + 8; + temp_v1->words.w0 = 0x01030040; + temp_v1->words.w1 = (s32) &gGfxPool->mtxPool[1] & 0x1FFFFFFF; + temp_v1_2 = gDisplayListHead; + gDisplayListHead = temp_v1_2 + 8; + temp_v1_2->words.w0 = 0x01010040; + temp_v1_2->words.w1 = (s32) &gGfxPool->mtxPool[7] & 0x1FFFFFFF; + break; + case 1: /* switch 4 */ + temp_v1_3 = gDisplayListHead; + gDisplayListHead = temp_v1_3 + 8; + temp_v1_3->words.w0 = 0x01030040; + temp_v1_3->words.w1 = (s32) &gGfxPool->mtxPool[2] & 0x1FFFFFFF; + var_v1 = gDisplayListHead; + gDisplayListHead = var_v1 + 8; + var_v1->words.w0 = 0x01010040; + var_t6 = (s32) &gGfxPool->mtxPool[8] & 0x1FFFFFFF; block_9: - phi_v1->words.w1 = phi_t6; - phi_a1 = &gGfxPool; - phi_a2 = &gDisplayListHead; - } - } else { - temp_v1_7 = gDisplayListHead; - gDisplayListHead = temp_v1_7 + 8; - temp_v1_7->words.w0 = 0x1030040; - temp_v1_7->words.w1 = (gGfxPool + 0x40) & 0x1FFFFFFF; - temp_v1_8 = gDisplayListHead; - gDisplayListHead = temp_v1_8 + 8; - temp_v1_8->words.w0 = 0x1010040; - temp_v1_8->words.w1 = (gGfxPool + 0x1C0) & 0x1FFFFFFF; - phi_a1 = &gGfxPool; + var_v1->words.w1 = var_t6; + break; + case 2: /* switch 4 */ + temp_v1_4 = gDisplayListHead; + gDisplayListHead = temp_v1_4 + 8; + temp_v1_4->words.w0 = 0x01030040; + temp_v1_4->words.w1 = (s32) &gGfxPool->mtxPool[3] & 0x1FFFFFFF; + temp_v1_5 = gDisplayListHead; + gDisplayListHead = temp_v1_5 + 8; + temp_v1_5->words.w0 = 0x01010040; + temp_v1_5->words.w1 = (s32) &gGfxPool->mtxPool[9] & 0x1FFFFFFF; + break; + case 3: /* switch 4 */ + temp_v1_6 = gDisplayListHead; + gDisplayListHead = temp_v1_6 + 8; + temp_v1_6->words.w0 = 0x01030040; + temp_v1_6->words.w1 = (s32) &gGfxPool->mtxPool[4] & 0x1FFFFFFF; + var_v1 = gDisplayListHead; + gDisplayListHead = var_v1 + 8; + var_v1->words.w0 = 0x01010040; + var_t6 = (s32) &gGfxPool->mtxPool[0xA] & 0x1FFFFFFF; + goto block_9; } - sp216 = temp_t3; - mtxf_identity(&sp228, phi_a1, phi_a2); - func_802B4FF8(&sp228, 0); + sp216 = arg0->playerDirection; + mtxf_identity((f32 (*)[4]) &sp228[0]); + func_802B4FF8((f32 (*)[4]) &sp228[0], 0); temp_t7 = gCurrentCourseId; switch (temp_t7) { /* switch 1 */ case 2: /* switch 1 */ - if ((gActiveScreenMode == 0) && (sp21A >= 6) && (sp21A < 0xA) && ((sp21A != 9) || ((sp218 >= 0xA000) && (sp218 < 0xE001)))) { - temp_v1_9 = gDisplayListHead; - gDisplayListHead = temp_v1_9 + 8; - temp_v1_9->words.w1 = &D_06009228; - temp_v1_9->words.w0 = 0x6000000; + if ((gActiveScreenMode == 0) && ((s32) (u16) sp21A >= 6) && ((s32) (u16) sp21A < 0xA) && (((u16) sp21A != 9) || (((s32) (u16) sp218 >= 0xA000) && ((s32) (u16) sp218 < 0xE001)))) { + temp_v1_7 = gDisplayListHead; + gDisplayListHead = temp_v1_7 + 8; + temp_v1_7->words.w1 = (u32) &D_06009228; + temp_v1_7->words.w0 = 0x06000000; return; } default: /* switch 1 */ return; case 3: /* switch 1 */ + temp_v1_8 = gDisplayListHead; + gDisplayListHead = temp_v1_8 + 8; + temp_v1_8->words.w1 = 0; + temp_v1_8->words.w0 = 0xE7000000; + temp_v1_9 = gDisplayListHead; + gDisplayListHead = temp_v1_9 + 8; + temp_v1_9->words.w1 = -1U; + temp_v1_9->words.w0 = 0xBB000001; temp_v1_10 = gDisplayListHead; gDisplayListHead = temp_v1_10 + 8; - temp_v1_10->words.w1 = 0; - temp_v1_10->words.w0 = 0xE7000000; + temp_v1_10->words.w1 = 0x00020000; + temp_v1_10->words.w0 = 0xB6000000; temp_v1_11 = gDisplayListHead; gDisplayListHead = temp_v1_11 + 8; - temp_v1_11->words.w1 = -1; - temp_v1_11->words.w0 = 0xBB000001; + temp_v1_11->words.w1 = 0x004045D8; + temp_v1_11->words.w0 = 0xB900031D; temp_v1_12 = gDisplayListHead; gDisplayListHead = temp_v1_12 + 8; - temp_v1_12->words.w1 = 0x20000; - temp_v1_12->words.w0 = 0xB6000000; + temp_v1_12->words.w1 = 0; + temp_v1_12->words.w0 = 0xC0000000; temp_v1_13 = gDisplayListHead; gDisplayListHead = temp_v1_13 + 8; - temp_v1_13->words.w1 = 0x4045D8; - temp_v1_13->words.w0 = 0xB900031D; + temp_v1_13->words.w1 = 0xFF33FFFF; + temp_v1_13->words.w0 = 0xFC121824; temp_v1_14 = gDisplayListHead; gDisplayListHead = temp_v1_14 + 8; - temp_v1_14->words.w1 = 0; - temp_v1_14->words.w0 = 0xC0000000; + temp_v1_14->words.w1 = 0x07000878; + temp_v1_14->words.w0 = 0x06000000; temp_v1_15 = gDisplayListHead; gDisplayListHead = temp_v1_15 + 8; - temp_v1_15->words.w1 = 0xFF33FFFF; - temp_v1_15->words.w0 = 0xFC121824; + temp_v1_15->words.w1 = 0; + temp_v1_15->words.w0 = 0xB9000002; temp_v1_16 = gDisplayListHead; gDisplayListHead = temp_v1_16 + 8; - temp_v1_16->words.w1 = 0x7000878; - temp_v1_16->words.w0 = 0x6000000; + temp_v1_16->words.w1 = 0; + temp_v1_16->words.w0 = 0xE7000000; + return; + case 6: /* switch 1 */ temp_v1_17 = gDisplayListHead; gDisplayListHead = temp_v1_17 + 8; temp_v1_17->words.w1 = 0; - temp_v1_17->words.w0 = 0xB9000002; + temp_v1_17->words.w0 = 0xE7000000; temp_v1_18 = gDisplayListHead; gDisplayListHead = temp_v1_18 + 8; - temp_v1_18->words.w1 = 0; - temp_v1_18->words.w0 = 0xE7000000; - return; - case 6: /* switch 1 */ + temp_v1_18->words.w1 = -1U; + temp_v1_18->words.w0 = 0xBB000001; temp_v1_19 = gDisplayListHead; gDisplayListHead = temp_v1_19 + 8; - temp_v1_19->words.w1 = 0; - temp_v1_19->words.w0 = 0xE7000000; + temp_v1_19->words.w1 = 0x00020000; + temp_v1_19->words.w0 = 0xB6000000; temp_v1_20 = gDisplayListHead; gDisplayListHead = temp_v1_20 + 8; - temp_v1_20->words.w1 = -1; - temp_v1_20->words.w0 = 0xBB000001; - temp_v1_21 = gDisplayListHead; - gDisplayListHead = temp_v1_21 + 8; - temp_v1_21->words.w1 = 0x20000; - temp_v1_21->words.w0 = 0xB6000000; - temp_v1_22 = gDisplayListHead; - gDisplayListHead = temp_v1_22 + 8; - temp_v1_22->words.w1 = 0x4045D8; - temp_v1_22->words.w0 = 0xB900031D; + temp_v1_20->words.w1 = 0x004045D8; + temp_v1_20->words.w0 = 0xB900031D; temp_t0 = gDisplayListHead; gDisplayListHead = temp_t0 + 8; temp_t0->words.w1 = 0; @@ -525,527 +487,497 @@ block_9: gDisplayListHead = temp_t1 + 8; temp_t1->words.w1 = 0xFF33FFFF; temp_t1->words.w0 = 0xFC121824; - switch (sp21A) { /* switch 2 */ + switch ((u16) sp21A) { /* switch 2 */ case 22: /* switch 2 */ case 23: /* switch 2 */ case 29: /* switch 2 */ case 30: /* switch 2 */ case 31: /* switch 2 */ case 37: /* switch 2 */ + temp_v1_21 = gDisplayListHead; + gDisplayListHead = temp_v1_21 + 8; + temp_v1_21->words.w1 = 0x00002000; + temp_v1_21->words.w0 = 0xB6000000; + temp_v1_22 = gDisplayListHead; + gDisplayListHead = temp_v1_22 + 8; + temp_v1_22->words.w1 = 0x07009E70; + temp_v1_22->words.w0 = 0x06000000; temp_v1_23 = gDisplayListHead; gDisplayListHead = temp_v1_23 + 8; - temp_v1_23->words.w1 = 0x2000; - temp_v1_23->words.w0 = 0xB6000000; - temp_v1_24 = gDisplayListHead; - gDisplayListHead = temp_v1_24 + 8; - temp_v1_24->words.w1 = 0x7009E70; - temp_v1_24->words.w0 = 0x6000000; - temp_v1_25 = gDisplayListHead; - gDisplayListHead = temp_v1_25 + 8; - temp_v1_25->words.w1 = 0x2000; - temp_v1_25->words.w0 = 0xB7000000; + temp_v1_23->words.w1 = 0x00002000; + temp_v1_23->words.w0 = 0xB7000000; break; } - temp_a1 = &sp21C; sp21C = 0.0f; sp224 = 0.0f; sp220 = D_8015F8E4; - mtxf_translate(&sp228, temp_a1, &gDisplayListHead); - func_802B4FF8(&sp228, 0); + mtxf_translate((f32 (*)[4]) &sp228[0], &sp21C); + func_802B4FF8((f32 (*)[4]) &sp228[0], 0); + temp_v1_24 = gDisplayListHead; + gDisplayListHead = temp_v1_24 + 8; + temp_v1_24->words.w0 = 0xB900031D; + temp_v1_24->words.w1 = 0x004045D8; + temp_v1_25 = gDisplayListHead; + gDisplayListHead = temp_v1_25 + 8; + temp_v1_25->words.w1 = 0; + temp_v1_25->words.w0 = 0xC0000000; temp_v1_26 = gDisplayListHead; gDisplayListHead = temp_v1_26 + 8; - temp_v1_26->words.w0 = 0xB900031D; - temp_v1_26->words.w1 = 0x4045D8; + temp_v1_26->words.w1 = 0xFF33FFFF; + temp_v1_26->words.w0 = 0xFC121824; temp_v1_27 = gDisplayListHead; gDisplayListHead = temp_v1_27 + 8; - temp_v1_27->words.w1 = 0; - temp_v1_27->words.w0 = 0xC0000000; + temp_v1_27->words.w1 = 0x00002000; + temp_v1_27->words.w0 = 0xB6000000; + load_surface_map(&D_06019578, arg0, &gDisplayListHead); temp_v1_28 = gDisplayListHead; gDisplayListHead = temp_v1_28 + 8; - temp_v1_28->words.w1 = 0xFF33FFFF; - temp_v1_28->words.w0 = 0xFC121824; + temp_v1_28->words.w1 = -1U; + temp_v1_28->words.w0 = 0xBB000900; temp_v1_29 = gDisplayListHead; gDisplayListHead = temp_v1_29 + 8; - temp_v1_29->words.w1 = 0x2000; - temp_v1_29->words.w0 = 0xB6000000; - load_surface_map(&D_06019578, arg0, &gDisplayListHead); + temp_v1_29->words.w1 = 0x00002000; + temp_v1_29->words.w0 = 0xB7000000; temp_v1_30 = gDisplayListHead; gDisplayListHead = temp_v1_30 + 8; - temp_v1_30->words.w1 = -1; - temp_v1_30->words.w0 = 0xBB000900; + temp_v1_30->words.w1 = 0; + temp_v1_30->words.w0 = 0xB9000002; temp_v1_31 = gDisplayListHead; gDisplayListHead = temp_v1_31 + 8; - temp_v1_31->words.w1 = 0x2000; - temp_v1_31->words.w0 = 0xB7000000; + temp_v1_31->words.w1 = 0; + temp_v1_31->words.w0 = 0xE7000000; + return; + case 12: /* switch 1 */ temp_v1_32 = gDisplayListHead; gDisplayListHead = temp_v1_32 + 8; temp_v1_32->words.w1 = 0; - temp_v1_32->words.w0 = 0xB9000002; + temp_v1_32->words.w0 = 0xE7000000; temp_v1_33 = gDisplayListHead; gDisplayListHead = temp_v1_33 + 8; - temp_v1_33->words.w1 = 0; - temp_v1_33->words.w0 = 0xE7000000; - return; - case 12: /* switch 1 */ + temp_v1_33->words.w1 = 0x00020000; + temp_v1_33->words.w0 = 0xB6000000; temp_v1_34 = gDisplayListHead; gDisplayListHead = temp_v1_34 + 8; - temp_v1_34->words.w1 = 0; - temp_v1_34->words.w0 = 0xE7000000; + temp_v1_34->words.w1 = -1U; + temp_v1_34->words.w0 = 0xBB000001; temp_v1_35 = gDisplayListHead; gDisplayListHead = temp_v1_35 + 8; - temp_v1_35->words.w1 = 0x20000; - temp_v1_35->words.w0 = 0xB6000000; + temp_v1_35->words.w1 = 0; + temp_v1_35->words.w0 = 0xC0000000; temp_v1_36 = gDisplayListHead; gDisplayListHead = temp_v1_36 + 8; - temp_v1_36->words.w1 = -1; - temp_v1_36->words.w0 = 0xBB000001; + temp_v1_36->words.w1 = 0xFF33FFFF; + temp_v1_36->words.w0 = 0xFC121824; temp_v1_37 = gDisplayListHead; gDisplayListHead = temp_v1_37 + 8; - temp_v1_37->words.w1 = 0; - temp_v1_37->words.w0 = 0xC0000000; + temp_v1_37->words.w1 = 0x00002000; + temp_v1_37->words.w0 = 0xBA000C02; temp_v1_38 = gDisplayListHead; gDisplayListHead = temp_v1_38 + 8; - temp_v1_38->words.w1 = 0xFF33FFFF; - temp_v1_38->words.w0 = 0xFC121824; + temp_v1_38->words.w1 = 0x00080000; + temp_v1_38->words.w0 = 0xBA001301; + mtxf_identity((f32 (*)[4]) &sp228[0]); + func_802B4FF8((f32 (*)[4]) &sp228[0], 0); + load_surface_map(&D_090001D0, arg0); temp_v1_39 = gDisplayListHead; gDisplayListHead = temp_v1_39 + 8; - temp_v1_39->words.w1 = 0x2000; - temp_v1_39->words.w0 = 0xBA000C02; - temp_v1_40 = gDisplayListHead; - gDisplayListHead = temp_v1_40 + 8; - temp_v1_40->words.w1 = 0x80000; - temp_v1_40->words.w0 = 0xBA001301; - mtxf_identity(&sp228); - func_802B4FF8(&sp228, 0); - load_surface_map(&D_090001D0, arg0); - temp_v1_41 = gDisplayListHead; - gDisplayListHead = temp_v1_41 + 8; - temp_v1_41->words.w1 = 0; - temp_v1_41->words.w0 = 0xB9000002; - if ((func_80290C20(arg0->unk4) == 1) && (func_802AAB4C(sp268) < sp268->unk18)) { + temp_v1_39->words.w1 = 0; + temp_v1_39->words.w0 = 0xB9000002; + if ((func_80290C20(arg0->camera) == 1) && (func_802AAB4C(sp268) < sp268->pos[1])) { + temp_v1_40 = gDisplayListHead; + gDisplayListHead = temp_v1_40 + 8; + temp_v1_40->words.w1 = 1; + temp_v1_40->words.w0 = 0xB7000000; + temp_v1_41 = gDisplayListHead; + gDisplayListHead = temp_v1_41 + 8; + temp_v1_41->words.w1 = 0xFFFE793C; + temp_v1_41->words.w0 = 0xFCFFFFFF; temp_v1_42 = gDisplayListHead; gDisplayListHead = temp_v1_42 + 8; - temp_v1_42->words.w1 = 1; - temp_v1_42->words.w0 = 0xB7000000; + temp_v1_42->words.w1 = 0x00552078; + temp_v1_42->words.w0 = 0xB900031D; temp_v1_43 = gDisplayListHead; gDisplayListHead = temp_v1_43 + 8; - temp_v1_43->words.w1 = 0xFFFE793C; - temp_v1_43->words.w0 = 0xFCFFFFFF; - temp_v1_44 = gDisplayListHead; - gDisplayListHead = temp_v1_44 + 8; - temp_v1_44->words.w1 = 0x552078; - temp_v1_44->words.w0 = 0xB900031D; - temp_v1_45 = gDisplayListHead; - gDisplayListHead = temp_v1_45 + 8; - temp_v1_45->words.w1 = 0x7002B48; - temp_v1_45->words.w0 = 0x6000000; + temp_v1_43->words.w1 = 0x07002B48; + temp_v1_43->words.w0 = 0x06000000; } - temp_v1_46 = gDisplayListHead; - gDisplayListHead = temp_v1_46 + 8; - temp_v1_46->words.w1 = 0; - temp_v1_46->words.w0 = 0xE7000000; + temp_v1_44 = gDisplayListHead; + gDisplayListHead = temp_v1_44 + 8; + temp_v1_44->words.w1 = 0; + temp_v1_44->words.w0 = 0xE7000000; return; case 13: /* switch 1 */ + temp_v1_45 = gDisplayListHead; + gDisplayListHead = temp_v1_45 + 8; + temp_v1_45->words.w1 = 0; + temp_v1_45->words.w0 = 0xE7000000; + mtxf_identity((f32 (*)[4]) &sp228[0]); + func_802B4FF8((f32 (*)[4]) &sp228[0], 0); + temp_v1_46 = gDisplayListHead; + gDisplayListHead = temp_v1_46 + 8; + temp_v1_46->words.w1 = 0x00002000; + temp_v1_46->words.w0 = 0xB6000000; + load_surface_map(&D_060164B8, arg0, &gDisplayListHead); temp_v1_47 = gDisplayListHead; gDisplayListHead = temp_v1_47 + 8; - temp_v1_47->words.w1 = 0; - temp_v1_47->words.w0 = 0xE7000000; - mtxf_identity(&sp228); - func_802B4FF8(&sp228, 0); + temp_v1_47->words.w1 = 0x00002000; + temp_v1_47->words.w0 = 0xB7000000; temp_v1_48 = gDisplayListHead; gDisplayListHead = temp_v1_48 + 8; - temp_v1_48->words.w1 = 0x2000; - temp_v1_48->words.w0 = 0xB6000000; - load_surface_map(&D_060164B8, arg0, &gDisplayListHead); + temp_v1_48->words.w1 = 0; + temp_v1_48->words.w0 = 0xB9000002; temp_v1_49 = gDisplayListHead; gDisplayListHead = temp_v1_49 + 8; - temp_v1_49->words.w1 = 0x2000; - temp_v1_49->words.w0 = 0xB7000000; + temp_v1_49->words.w1 = 0; + temp_v1_49->words.w0 = 0xE7000000; + return; + case 14: /* switch 1 */ temp_v1_50 = gDisplayListHead; gDisplayListHead = temp_v1_50 + 8; temp_v1_50->words.w1 = 0; - temp_v1_50->words.w0 = 0xB9000002; + temp_v1_50->words.w0 = 0xE7000000; temp_v1_51 = gDisplayListHead; gDisplayListHead = temp_v1_51 + 8; - temp_v1_51->words.w1 = 0; - temp_v1_51->words.w0 = 0xE7000000; - return; - case 14: /* switch 1 */ + temp_v1_51->words.w1 = -1U; + temp_v1_51->words.w0 = 0xBB000001; temp_v1_52 = gDisplayListHead; gDisplayListHead = temp_v1_52 + 8; - temp_v1_52->words.w1 = 0; - temp_v1_52->words.w0 = 0xE7000000; + temp_v1_52->words.w1 = 0x00020000; + temp_v1_52->words.w0 = 0xB6000000; temp_v1_53 = gDisplayListHead; gDisplayListHead = temp_v1_53 + 8; - temp_v1_53->words.w1 = -1; - temp_v1_53->words.w0 = 0xBB000001; + temp_v1_53->words.w1 = 0x004045D8; + temp_v1_53->words.w0 = 0xB900031D; temp_v1_54 = gDisplayListHead; gDisplayListHead = temp_v1_54 + 8; - temp_v1_54->words.w1 = 0x20000; - temp_v1_54->words.w0 = 0xB6000000; + temp_v1_54->words.w1 = 0; + temp_v1_54->words.w0 = 0xC0000000; temp_v1_55 = gDisplayListHead; gDisplayListHead = temp_v1_55 + 8; - temp_v1_55->words.w1 = 0x4045D8; - temp_v1_55->words.w0 = 0xB900031D; + temp_v1_55->words.w1 = 0xFF33FFFF; + temp_v1_55->words.w0 = 0xFC121824; temp_v1_56 = gDisplayListHead; gDisplayListHead = temp_v1_56 + 8; - temp_v1_56->words.w1 = 0; - temp_v1_56->words.w0 = 0xC0000000; + temp_v1_56->words.w1 = 0x00002000; + temp_v1_56->words.w0 = 0xBA000C02; temp_v1_57 = gDisplayListHead; gDisplayListHead = temp_v1_57 + 8; - temp_v1_57->words.w1 = 0xFF33FFFF; - temp_v1_57->words.w0 = 0xFC121824; + temp_v1_57->words.w1 = 0x00080000; + temp_v1_57->words.w0 = 0xBA001301; + mtxf_identity((f32 (*)[4]) &sp228[0]); + func_802B4FF8((f32 (*)[4]) &sp228[0], 0); temp_v1_58 = gDisplayListHead; gDisplayListHead = temp_v1_58 + 8; - temp_v1_58->words.w1 = 0x2000; - temp_v1_58->words.w0 = 0xBA000C02; + temp_v1_58->words.w1 = 0x00002000; + temp_v1_58->words.w0 = 0xB6000000; temp_v1_59 = gDisplayListHead; gDisplayListHead = temp_v1_59 + 8; - temp_v1_59->words.w1 = 0x80000; - temp_v1_59->words.w0 = 0xBA001301; - mtxf_identity(&sp228); - func_802B4FF8(&sp228, 0); + temp_v1_59->words.w1 = -0x00000C07U; + temp_v1_59->words.w0 = 0xFC127E24; temp_v1_60 = gDisplayListHead; gDisplayListHead = temp_v1_60 + 8; - temp_v1_60->words.w1 = 0x2000; - temp_v1_60->words.w0 = 0xB6000000; + temp_v1_60->words.w1 = 0x005049D8; + temp_v1_60->words.w0 = 0xB900031D; temp_v1_61 = gDisplayListHead; gDisplayListHead = temp_v1_61 + 8; - temp_v1_61->words.w1 = -0xC07; - temp_v1_61->words.w0 = 0xFC127E24; + temp_v1_61->words.w0 = 0xFA000000; + temp_v1_61->words.w1 = 0xFFFF00FF; temp_v1_62 = gDisplayListHead; gDisplayListHead = temp_v1_62 + 8; - temp_v1_62->words.w1 = 0x5049D8; - temp_v1_62->words.w0 = 0xB900031D; + temp_v1_62->words.w1 = 0x07000EC0; + temp_v1_62->words.w0 = 0x06000000; temp_v1_63 = gDisplayListHead; gDisplayListHead = temp_v1_63 + 8; - temp_v1_63->words.w0 = 0xFA000000; - temp_v1_63->words.w1 = 0xFFFF00FF; + temp_v1_63->words.w1 = -1U; + temp_v1_63->words.w0 = 0xBB000900; temp_v1_64 = gDisplayListHead; gDisplayListHead = temp_v1_64 + 8; - temp_v1_64->words.w1 = 0x7000EC0; - temp_v1_64->words.w0 = 0x6000000; + temp_v1_64->words.w1 = 0x00002000; + temp_v1_64->words.w0 = 0xB7000000; temp_v1_65 = gDisplayListHead; gDisplayListHead = temp_v1_65 + 8; - temp_v1_65->words.w1 = -1; - temp_v1_65->words.w0 = 0xBB000900; + temp_v1_65->words.w1 = 0; + temp_v1_65->words.w0 = 0xB9000002; temp_v1_66 = gDisplayListHead; gDisplayListHead = temp_v1_66 + 8; - temp_v1_66->words.w1 = 0x2000; - temp_v1_66->words.w0 = 0xB7000000; + temp_v1_66->words.w1 = 0; + temp_v1_66->words.w0 = 0xE7000000; + return; + case 18: /* switch 1 */ temp_v1_67 = gDisplayListHead; gDisplayListHead = temp_v1_67 + 8; temp_v1_67->words.w1 = 0; - temp_v1_67->words.w0 = 0xB9000002; + temp_v1_67->words.w0 = 0xE7000000; temp_v1_68 = gDisplayListHead; gDisplayListHead = temp_v1_68 + 8; - temp_v1_68->words.w1 = 0; - temp_v1_68->words.w0 = 0xE7000000; - return; - case 18: /* switch 1 */ + temp_v1_68->words.w1 = 0x00020000; + temp_v1_68->words.w0 = 0xB6000000; temp_v1_69 = gDisplayListHead; gDisplayListHead = temp_v1_69 + 8; - temp_v1_69->words.w1 = 0; - temp_v1_69->words.w0 = 0xE7000000; + temp_v1_69->words.w1 = -1U; + temp_v1_69->words.w0 = 0xBB000001; temp_v1_70 = gDisplayListHead; gDisplayListHead = temp_v1_70 + 8; - temp_v1_70->words.w1 = 0x20000; - temp_v1_70->words.w0 = 0xB6000000; + temp_v1_70->words.w1 = 0; + temp_v1_70->words.w0 = 0xC0000000; temp_v1_71 = gDisplayListHead; gDisplayListHead = temp_v1_71 + 8; - temp_v1_71->words.w1 = -1; - temp_v1_71->words.w0 = 0xBB000001; + temp_v1_71->words.w1 = 0x00002000; + temp_v1_71->words.w0 = 0xBA000C02; temp_v1_72 = gDisplayListHead; gDisplayListHead = temp_v1_72 + 8; - temp_v1_72->words.w1 = 0; - temp_v1_72->words.w0 = 0xC0000000; + temp_v1_72->words.w1 = 0x00080000; + temp_v1_72->words.w0 = 0xBA001301; + sp216 = sp216; + mtxf_identity((f32 (*)[4]) &sp228[0]); + func_802B4FF8((f32 (*)[4]) &sp228[0], 0); temp_v1_73 = gDisplayListHead; gDisplayListHead = temp_v1_73 + 8; - temp_v1_73->words.w1 = 0x2000; - temp_v1_73->words.w0 = 0xBA000C02; + temp_v1_73->words.w1 = 0xFF33FFFF; + temp_v1_73->words.w0 = 0xFC121824; temp_v1_74 = gDisplayListHead; gDisplayListHead = temp_v1_74 + 8; - temp_v1_74->words.w1 = 0x80000; - temp_v1_74->words.w0 = 0xBA001301; - sp216 = temp_t3; - mtxf_identity(&sp228); - func_802B4FF8(&sp228, 0); - temp_v1_75 = gDisplayListHead; - gDisplayListHead = temp_v1_75 + 8; - temp_v1_75->words.w1 = 0xFF33FFFF; - temp_v1_75->words.w0 = 0xFC121824; - temp_v1_76 = gDisplayListHead; - gDisplayListHead = temp_v1_76 + 8; - temp_v1_76->words.w1 = 0x4045D8; - temp_v1_76->words.w0 = 0xB900031D; - if (sp21A < 0x11) { + temp_v1_74->words.w1 = 0x004045D8; + temp_v1_74->words.w0 = 0xB900031D; + if ((s32) (u16) sp21A < 0x11) { + temp_v1_75 = gDisplayListHead; + gDisplayListHead = temp_v1_75 + 8; + temp_v1_75->words.w1 = 0xFF33FFFF; + temp_v1_75->words.w0 = 0xFC121824; + temp_v1_76 = gDisplayListHead; + gDisplayListHead = temp_v1_76 + 8; + temp_v1_76->words.w1 = 0x07003E40; + temp_v1_76->words.w0 = 0x06000000; temp_v1_77 = gDisplayListHead; gDisplayListHead = temp_v1_77 + 8; - temp_v1_77->words.w1 = 0xFF33FFFF; - temp_v1_77->words.w0 = 0xFC121824; - temp_v1_78 = gDisplayListHead; - gDisplayListHead = temp_v1_78 + 8; - temp_v1_78->words.w1 = 0x7003E40; - temp_v1_78->words.w0 = 0x6000000; - temp_v1_79 = gDisplayListHead; - gDisplayListHead = temp_v1_79 + 8; - temp_v1_79->words.w1 = 0x7003EB0; - temp_v1_79->words.w0 = 0x6000000; - if ((sp21A >= 6) && (sp21A < 0xD)) { - temp_v1_80 = gDisplayListHead; - gDisplayListHead = temp_v1_80 + 8; - temp_v1_80->words.w1 = 0xFF33FFFF; - temp_v1_80->words.w0 = 0xFC121824; - temp_v1_81 = gDisplayListHead; - gDisplayListHead = temp_v1_81 + 8; - temp_v1_81->words.w1 = 0x7003DD0; - temp_v1_81->words.w0 = 0x6000000; + temp_v1_77->words.w1 = 0x07003EB0; + temp_v1_77->words.w0 = 0x06000000; + if (((s32) (u16) sp21A >= 6) && ((s32) (u16) sp21A < 0xD)) { + temp_v1_78 = gDisplayListHead; + gDisplayListHead = temp_v1_78 + 8; + temp_v1_78->words.w1 = 0xFF33FFFF; + temp_v1_78->words.w0 = 0xFC121824; + temp_v1_79 = gDisplayListHead; + gDisplayListHead = temp_v1_79 + 8; + temp_v1_79->words.w1 = 0x07003DD0; + temp_v1_79->words.w0 = 0x06000000; } } else { - if ((sp21A == 0x15) || (sp21A == 0x16)) { - if (temp_t3 == 3) { - temp_v1_88 = gDisplayListHead; - gDisplayListHead = temp_v1_88 + 8; - temp_v1_88->words.w1 = -0xC07; - temp_v1_88->words.w0 = 0xFC127E24; - temp_v1_89 = gDisplayListHead; - gDisplayListHead = temp_v1_89 + 8; - temp_v1_89->words.w1 = 0x70036A8; - temp_v1_89->words.w0 = 0x6000000; + if (((u16) sp21A == 0x0015) || ((u16) sp21A == 0x0016)) { + if (sp216 == 3) { + temp_v1_80 = gDisplayListHead; + gDisplayListHead = temp_v1_80 + 8; + temp_v1_80->words.w1 = -0x00000C07U; + temp_v1_80->words.w0 = 0xFC127E24; + temp_v1_81 = gDisplayListHead; + gDisplayListHead = temp_v1_81 + 8; + temp_v1_81->words.w1 = 0x070036A8; + temp_v1_81->words.w0 = 0x06000000; } - if ((temp_t3 == 1) || (temp_t3 == 0)) { - temp_v1_93 = gDisplayListHead; - gDisplayListHead = temp_v1_93 + 8; - temp_v1_93->words.w1 = -0xC07; - temp_v1_93->words.w0 = 0xFC127E24; - temp_v1_94 = gDisplayListHead; - gDisplayListHead = temp_v1_94 + 8; - temp_v1_94->words.w1 = 0x70036A8; - phi_v1_2 = temp_v1_94; + if ((sp216 == 1) || (sp216 == 0)) { + temp_v1_82 = gDisplayListHead; + gDisplayListHead = temp_v1_82 + 8; + temp_v1_82->words.w1 = -0x00000C07U; + temp_v1_82->words.w0 = 0xFC127E24; + var_v1_2 = gDisplayListHead; + gDisplayListHead = var_v1_2 + 8; + var_v1_2->words.w1 = 0x070036A8; } else { - temp_v1_90 = gDisplayListHead; - gDisplayListHead = temp_v1_90 + 8; - temp_v1_90->words.w1 = 0xFF33FFFF; - temp_v1_90->words.w0 = 0xFC121824; - temp_v1_91 = gDisplayListHead; - gDisplayListHead = temp_v1_91 + 8; - temp_v1_91->words.w1 = 0x7003F30; - temp_v1_91->words.w0 = 0x6000000; - temp_v1_92 = gDisplayListHead; - gDisplayListHead = temp_v1_92 + 8; - temp_v1_92->words.w1 = 0x70036A8; - phi_v1_2 = temp_v1_92; + temp_v1_83 = gDisplayListHead; + gDisplayListHead = temp_v1_83 + 8; + temp_v1_83->words.w1 = 0xFF33FFFF; + temp_v1_83->words.w0 = 0xFC121824; + temp_v1_84 = gDisplayListHead; + gDisplayListHead = temp_v1_84 + 8; + temp_v1_84->words.w1 = 0x07003F30; + temp_v1_84->words.w0 = 0x06000000; + var_v1_2 = gDisplayListHead; + gDisplayListHead = var_v1_2 + 8; + var_v1_2->words.w1 = 0x070036A8; } goto block_53; } - if (sp21A == 0x18) { - if ((temp_t3 == 0) || (temp_t3 == 3)) { - temp_v1_82 = gDisplayListHead; - gDisplayListHead = temp_v1_82 + 8; - temp_v1_82->words.w1 = -0xC07; - temp_v1_82->words.w0 = 0xFC127E24; - temp_v1_83 = gDisplayListHead; - gDisplayListHead = temp_v1_83 + 8; - temp_v1_83->words.w0 = 0x6000000; - temp_v1_83->words.w1 = 0x70036A8; - } - } else if (sp21A == 0x17) { - if (temp_t3 == 3) { - temp_v1_84 = gDisplayListHead; - gDisplayListHead = temp_v1_84 + 8; - temp_v1_84->words.w1 = -0xC07; - temp_v1_84->words.w0 = 0xFC127E24; + if ((u16) sp21A == 0x0018) { + if ((sp216 == 0) || (sp216 == 3)) { temp_v1_85 = gDisplayListHead; gDisplayListHead = temp_v1_85 + 8; - temp_v1_85->words.w1 = 0x70036A8; - phi_v1_2 = temp_v1_85; - goto block_53; - } - if (temp_t3 == 0) { + temp_v1_85->words.w1 = -0x00000C07U; + temp_v1_85->words.w0 = 0xFC127E24; temp_v1_86 = gDisplayListHead; gDisplayListHead = temp_v1_86 + 8; - temp_v1_86->words.w1 = -0xC07; - temp_v1_86->words.w0 = 0xFC127E24; + temp_v1_86->words.w0 = 0x06000000; + temp_v1_86->words.w1 = 0x070036A8; + } + } else if ((u16) sp21A == 0x0017) { + if (sp216 == 3) { temp_v1_87 = gDisplayListHead; gDisplayListHead = temp_v1_87 + 8; - temp_v1_87->words.w1 = 0x70036A8; - phi_v1_2 = temp_v1_87; + temp_v1_87->words.w1 = -0x00000C07U; + temp_v1_87->words.w0 = 0xFC127E24; + var_v1_2 = gDisplayListHead; + gDisplayListHead = var_v1_2 + 8; + var_v1_2->words.w1 = 0x070036A8; + goto block_53; + } + if (sp216 == 0) { + temp_v1_88 = gDisplayListHead; + gDisplayListHead = temp_v1_88 + 8; + temp_v1_88->words.w1 = -0x00000C07U; + temp_v1_88->words.w0 = 0xFC127E24; + var_v1_2 = gDisplayListHead; + gDisplayListHead = var_v1_2 + 8; + var_v1_2->words.w1 = 0x070036A8; block_53: - phi_v1_2->words.w0 = 0x6000000; + var_v1_2->words.w0 = 0x06000000; } } } - temp_v1_95 = gDisplayListHead; - gDisplayListHead = temp_v1_95 + 8; - temp_v1_95->words.w1 = 0xFF33FFFF; - temp_v1_95->words.w0 = 0xFC121824; - switch (sp21A) { /* switch 3 */ + temp_v1_89 = gDisplayListHead; + gDisplayListHead = temp_v1_89 + 8; + temp_v1_89->words.w1 = 0xFF33FFFF; + temp_v1_89->words.w0 = 0xFC121824; + switch ((u16) sp21A) { /* switch 3 */ case 5: /* switch 3 */ - if (temp_t3 != 3) { - temp_v1_96 = gDisplayListHead; - gDisplayListHead = temp_v1_96 + 8; - temp_v1_96->words.w1 = 0x7003DD0; - phi_v1_3 = temp_v1_96; + if (sp216 != 3) { + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003DD0; block_82: - phi_v1_3->words.w0 = 0x6000000; + var_v1_3->words.w0 = 0x06000000; } break; case 17: /* switch 3 */ - if (temp_t3 != 0) { - if (temp_t3 != 1) { - if (temp_t3 != 2) { - if (temp_t3 != 3) { - - } else { - temp_v1_97 = gDisplayListHead; - gDisplayListHead = temp_v1_97 + 8; - temp_v1_97->words.w1 = 0x7003EB0; - temp_v1_97->words.w0 = 0x6000000; - temp_v1_98 = gDisplayListHead; - gDisplayListHead = temp_v1_98 + 8; - temp_v1_98->words.w1 = 0x7003F30; - phi_v1_3 = temp_v1_98; - goto block_82; - } - } else { - temp_v1_99 = gDisplayListHead; - gDisplayListHead = temp_v1_99 + 8; - temp_v1_99->words.w1 = 0x7003E40; - temp_v1_99->words.w0 = 0x6000000; - temp_v1_100 = gDisplayListHead; - gDisplayListHead = temp_v1_100 + 8; - temp_v1_100->words.w1 = 0x7003EB0; - temp_v1_100->words.w0 = 0x6000000; - temp_v1_101 = gDisplayListHead; - gDisplayListHead = temp_v1_101 + 8; - temp_v1_101->words.w1 = 0x7003F30; - phi_v1_3 = temp_v1_101; - goto block_82; - } - } else { - temp_v1_102 = gDisplayListHead; - gDisplayListHead = temp_v1_102 + 8; - temp_v1_102->words.w1 = 0x7003DD0; - temp_v1_102->words.w0 = 0x6000000; - temp_v1_103 = gDisplayListHead; - gDisplayListHead = temp_v1_103 + 8; - temp_v1_103->words.w1 = 0x7003E40; - temp_v1_103->words.w0 = 0x6000000; - temp_v1_104 = gDisplayListHead; - gDisplayListHead = temp_v1_104 + 8; - temp_v1_104->words.w1 = 0x7003EB0; - phi_v1_3 = temp_v1_104; - goto block_82; - } - } else { - temp_v1_105 = gDisplayListHead; - gDisplayListHead = temp_v1_105 + 8; - temp_v1_105->words.w1 = 0x7003E40; - temp_v1_105->words.w0 = 0x6000000; - temp_v1_106 = gDisplayListHead; - gDisplayListHead = temp_v1_106 + 8; - temp_v1_106->words.w1 = 0x7003EB0; - phi_v1_3 = temp_v1_106; + switch (sp216) { /* switch 5; irregular */ + case 0: /* switch 5 */ + temp_v1_90 = gDisplayListHead; + gDisplayListHead = temp_v1_90 + 8; + temp_v1_90->words.w1 = 0x07003E40; + temp_v1_90->words.w0 = 0x06000000; + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003EB0; + goto block_82; + case 1: /* switch 5 */ + temp_v1_91 = gDisplayListHead; + gDisplayListHead = temp_v1_91 + 8; + temp_v1_91->words.w1 = 0x07003DD0; + temp_v1_91->words.w0 = 0x06000000; + temp_v1_92 = gDisplayListHead; + gDisplayListHead = temp_v1_92 + 8; + temp_v1_92->words.w1 = 0x07003E40; + temp_v1_92->words.w0 = 0x06000000; + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003EB0; + goto block_82; + case 2: /* switch 5 */ + temp_v1_93 = gDisplayListHead; + gDisplayListHead = temp_v1_93 + 8; + temp_v1_93->words.w1 = 0x07003E40; + temp_v1_93->words.w0 = 0x06000000; + temp_v1_94 = gDisplayListHead; + gDisplayListHead = temp_v1_94 + 8; + temp_v1_94->words.w1 = 0x07003EB0; + temp_v1_94->words.w0 = 0x06000000; + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003F30; + goto block_82; + case 3: /* switch 5 */ + temp_v1_95 = gDisplayListHead; + gDisplayListHead = temp_v1_95 + 8; + temp_v1_95->words.w1 = 0x07003EB0; + temp_v1_95->words.w0 = 0x06000000; + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003F30; goto block_82; } break; case 18: /* switch 3 */ - if (temp_t3 != 0) { - if (temp_t3 != 1) { - if (temp_t3 != 2) { - - } else { - temp_v1_107 = gDisplayListHead; - gDisplayListHead = temp_v1_107 + 8; - temp_v1_107->words.w1 = 0x7003E40; - temp_v1_107->words.w0 = 0x6000000; - temp_v1_108 = gDisplayListHead; - gDisplayListHead = temp_v1_108 + 8; - temp_v1_108->words.w1 = 0x7003EB0; - phi_v1_3 = temp_v1_108; - goto block_82; - } - } else { - temp_v1_109 = gDisplayListHead; - gDisplayListHead = temp_v1_109 + 8; - temp_v1_109->words.w1 = 0x7003DD0; - temp_v1_109->words.w0 = 0x6000000; - temp_v1_110 = gDisplayListHead; - gDisplayListHead = temp_v1_110 + 8; - temp_v1_110->words.w1 = 0x7003E40; - temp_v1_110->words.w0 = 0x6000000; - temp_v1_111 = gDisplayListHead; - gDisplayListHead = temp_v1_111 + 8; - temp_v1_111->words.w1 = 0x7003EB0; - phi_v1_3 = temp_v1_111; - goto block_82; - } - } else { - temp_v1_112 = gDisplayListHead; - gDisplayListHead = temp_v1_112 + 8; - temp_v1_112->words.w1 = 0x7003E40; - temp_v1_112->words.w0 = 0x6000000; - temp_v1_113 = gDisplayListHead; - gDisplayListHead = temp_v1_113 + 8; - temp_v1_113->words.w1 = 0x7003EB0; - phi_v1_3 = temp_v1_113; + switch (sp216) { /* switch 6; irregular */ + case 0: /* switch 6 */ + temp_v1_96 = gDisplayListHead; + gDisplayListHead = temp_v1_96 + 8; + temp_v1_96->words.w1 = 0x07003E40; + temp_v1_96->words.w0 = 0x06000000; + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003EB0; + goto block_82; + case 1: /* switch 6 */ + temp_v1_97 = gDisplayListHead; + gDisplayListHead = temp_v1_97 + 8; + temp_v1_97->words.w1 = 0x07003DD0; + temp_v1_97->words.w0 = 0x06000000; + temp_v1_98 = gDisplayListHead; + gDisplayListHead = temp_v1_98 + 8; + temp_v1_98->words.w1 = 0x07003E40; + temp_v1_98->words.w0 = 0x06000000; + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003EB0; + goto block_82; + case 2: /* switch 6 */ + temp_v1_99 = gDisplayListHead; + gDisplayListHead = temp_v1_99 + 8; + temp_v1_99->words.w1 = 0x07003E40; + temp_v1_99->words.w0 = 0x06000000; + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003EB0; goto block_82; } break; case 21: /* switch 3 */ - if ((temp_t3 == 0) || (temp_t3 == 1)) { - temp_v1_115 = gDisplayListHead; - gDisplayListHead = temp_v1_115 + 8; - temp_v1_115->words.w1 = 0x7003E40; - temp_v1_115->words.w0 = 0x6000000; - temp_v1_116 = gDisplayListHead; - gDisplayListHead = temp_v1_116 + 8; - temp_v1_116->words.w1 = 0x7003EB0; - temp_v1_116->words.w0 = 0x6000000; - temp_v1_117 = gDisplayListHead; - gDisplayListHead = temp_v1_117 + 8; - temp_v1_117->words.w1 = 0x7003F30; - phi_v1_3 = temp_v1_117; + if ((sp216 == 0) || (sp216 == 1)) { + temp_v1_100 = gDisplayListHead; + gDisplayListHead = temp_v1_100 + 8; + temp_v1_100->words.w1 = 0x07003E40; + temp_v1_100->words.w0 = 0x06000000; + temp_v1_101 = gDisplayListHead; + gDisplayListHead = temp_v1_101 + 8; + temp_v1_101->words.w1 = 0x07003EB0; + temp_v1_101->words.w0 = 0x06000000; + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003F30; } else { - temp_v1_114 = gDisplayListHead; - gDisplayListHead = temp_v1_114 + 8; - temp_v1_114->words.w1 = 0x7003EB0; - phi_v1_3 = temp_v1_114; + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003EB0; } goto block_82; case 22: /* switch 3 */ - if (temp_t3 == 0) { - temp_v1_118 = gDisplayListHead; - gDisplayListHead = temp_v1_118 + 8; - temp_v1_118->words.w1 = 0x7003F30; - phi_v1_3 = temp_v1_118; + if (sp216 == 0) { + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003F30; goto block_82; } break; case 23: /* switch 3 */ - if (temp_t3 != 1) { - temp_v1_119 = gDisplayListHead; - gDisplayListHead = temp_v1_119 + 8; - temp_v1_119->words.w1 = 0x7003F30; - phi_v1_3 = temp_v1_119; + if (sp216 != 1) { + var_v1_3 = gDisplayListHead; + gDisplayListHead = var_v1_3 + 8; + var_v1_3->words.w1 = 0x07003F30; goto block_82; } break; } - temp_v1_120 = gDisplayListHead; - gDisplayListHead = temp_v1_120 + 8; - temp_v1_120->words.w1 = -1; - temp_v1_120->words.w0 = 0xBB000900; - temp_v1_121 = gDisplayListHead; - gDisplayListHead = temp_v1_121 + 8; - temp_v1_121->words.w1 = 0; - temp_v1_121->words.w0 = 0xB9000002; - temp_v1_122 = gDisplayListHead; - gDisplayListHead = temp_v1_122 + 8; - temp_v1_122->words.w1 = 0; - temp_v1_122->words.w0 = 0xE7000000; - /* Duplicate return node #84. Try simplifying control flow for better match */ - return; + temp_v1_102 = gDisplayListHead; + gDisplayListHead = temp_v1_102 + 8; + temp_v1_102->words.w1 = -1U; + temp_v1_102->words.w0 = 0xBB000900; + temp_v1_103 = gDisplayListHead; + gDisplayListHead = temp_v1_103 + 8; + temp_v1_103->words.w1 = 0; + temp_v1_103->words.w0 = 0xB9000002; + temp_v1_104 = gDisplayListHead; + gDisplayListHead = temp_v1_104 + 8; + temp_v1_104->words.w1 = 0; + temp_v1_104->words.w0 = 0xE7000000; + break; } } #else