mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Match func_80026E54 and func_80026070 (#468)
This commit is contained in:
@@ -5,9 +5,9 @@ This repo contains a work-in-progress decompilation of Diddy Kong Racing for the
|
||||
Currently, only the US 1.0 version (SHA1 = 0cb115d8716dbbc2922fda38e533b9fe63bb9670) of the game is supported. US 1.1, EU 1.0, EU 1.1, and JP are not supported at this time.
|
||||
|
||||
<!-- README_SCORE_SUMMARY_BEGIN -->
|
||||
As of February 25, 2025, this is our current score:
|
||||
As of February 27, 2025, this is our current score:
|
||||
|
||||
    Decomp progress: 70.83%
|
||||
    Decomp progress: 71.03%
|
||||
|
||||
    Documentation progress: 49.99%
|
||||
<!-- README_SCORE_SUMMARY_END -->
|
||||
@@ -126,13 +126,13 @@ s32 is_drumstick_unlocked(void) {
|
||||
```
|
||||
|
||||
<!-- README_SCORE_BEGIN -->
|
||||
As of February 25th, 2025, this is our current score:
|
||||
As of February 27th, 2025, this is our current score:
|
||||
```
|
||||
===============================================
|
||||
ADVENTURE ONE (ASM -> C Decompilation)
|
||||
---- 70.83% Complete (73.99% NON_MATCHING) ----
|
||||
# Decompiled functions: 1808
|
||||
# GLOBAL_ASM remaining: 133
|
||||
---- 71.03% Complete (74.19% NON_MATCHING) ----
|
||||
# Decompiled functions: 1810
|
||||
# GLOBAL_ASM remaining: 131
|
||||
# NON_MATCHING functions: 15
|
||||
# NON_EQUIVALENT WIP functions: 44
|
||||
----------------- Game Status -----------------
|
||||
|
||||
@@ -1,258 +0,0 @@
|
||||
.late_rodata
|
||||
glabel D_800E5E68
|
||||
.double -300.0
|
||||
glabel D_800E5E70
|
||||
.double 300.0
|
||||
|
||||
.text
|
||||
glabel func_80026070
|
||||
/* 026C70 80026070 27BDFF70 */ addiu $sp, $sp, -0x90
|
||||
/* 026C74 80026074 AFBF001C */ sw $ra, 0x1c($sp)
|
||||
/* 026C78 80026078 E7B50010 */ swc1 $f21, 0x10($sp)
|
||||
/* 026C7C 8002607C E7B40014 */ swc1 $f20, 0x14($sp)
|
||||
/* 026C80 80026080 848E0000 */ lh $t6, ($a0)
|
||||
/* 026C84 80026084 44857000 */ mtc1 $a1, $f14
|
||||
/* 026C88 80026088 448E2000 */ mtc1 $t6, $f4
|
||||
/* 026C8C 8002608C 44866000 */ mtc1 $a2, $f12
|
||||
/* 026C90 80026090 468021A0 */ cvt.s.w $f6, $f4
|
||||
/* 026C94 80026094 4487A000 */ mtc1 $a3, $f20
|
||||
/* 026C98 80026098 44801800 */ mtc1 $zero, $f3
|
||||
/* 026C9C 8002609C E7A60080 */ swc1 $f6, 0x80($sp)
|
||||
/* 026CA0 800260A0 848F0004 */ lh $t7, 4($a0)
|
||||
/* 026CA4 800260A4 44801000 */ mtc1 $zero, $f2
|
||||
/* 026CA8 800260A8 448F4000 */ mtc1 $t7, $f8
|
||||
/* 026CAC 800260AC 00003025 */ move $a2, $zero
|
||||
/* 026CB0 800260B0 468042A0 */ cvt.s.w $f10, $f8
|
||||
/* 026CB4 800260B4 00002825 */ move $a1, $zero
|
||||
/* 026CB8 800260B8 27AC0040 */ addiu $t4, $sp, 0x40
|
||||
/* 026CBC 800260BC E7AA0070 */ swc1 $f10, 0x70($sp)
|
||||
/* 026CC0 800260C0 84980006 */ lh $t8, 6($a0)
|
||||
/* 026CC4 800260C4 27AB0080 */ addiu $t3, $sp, 0x80
|
||||
/* 026CC8 800260C8 44982000 */ mtc1 $t8, $f4
|
||||
/* 026CCC 800260CC 27AA0070 */ addiu $t2, $sp, 0x70
|
||||
/* 026CD0 800260D0 468021A0 */ cvt.s.w $f6, $f4
|
||||
/* 026CD4 800260D4 27A90060 */ addiu $t1, $sp, 0x60
|
||||
/* 026CD8 800260D8 E7A60084 */ swc1 $f6, 0x84($sp)
|
||||
/* 026CDC 800260DC 84990004 */ lh $t9, 4($a0)
|
||||
/* 026CE0 800260E0 00000000 */ nop
|
||||
/* 026CE4 800260E4 44994000 */ mtc1 $t9, $f8
|
||||
/* 026CE8 800260E8 00000000 */ nop
|
||||
/* 026CEC 800260EC 468042A0 */ cvt.s.w $f10, $f8
|
||||
/* 026CF0 800260F0 E7AA0074 */ swc1 $f10, 0x74($sp)
|
||||
/* 026CF4 800260F4 848E0006 */ lh $t6, 6($a0)
|
||||
/* 026CF8 800260F8 00000000 */ nop
|
||||
/* 026CFC 800260FC 448E2000 */ mtc1 $t6, $f4
|
||||
/* 026D00 80026100 00000000 */ nop
|
||||
/* 026D04 80026104 468021A0 */ cvt.s.w $f6, $f4
|
||||
/* 026D08 80026108 E7A60088 */ swc1 $f6, 0x88($sp)
|
||||
/* 026D0C 8002610C 848F000A */ lh $t7, 0xa($a0)
|
||||
/* 026D10 80026110 00000000 */ nop
|
||||
/* 026D14 80026114 448F4000 */ mtc1 $t7, $f8
|
||||
/* 026D18 80026118 00000000 */ nop
|
||||
/* 026D1C 8002611C 468042A0 */ cvt.s.w $f10, $f8
|
||||
/* 026D20 80026120 E7AA0078 */ swc1 $f10, 0x78($sp)
|
||||
/* 026D24 80026124 84980000 */ lh $t8, ($a0)
|
||||
/* 026D28 80026128 00000000 */ nop
|
||||
/* 026D2C 8002612C 44982000 */ mtc1 $t8, $f4
|
||||
/* 026D30 80026130 00000000 */ nop
|
||||
/* 026D34 80026134 468021A0 */ cvt.s.w $f6, $f4
|
||||
/* 026D38 80026138 E7A6008C */ swc1 $f6, 0x8c($sp)
|
||||
/* 026D3C 8002613C 8499000A */ lh $t9, 0xa($a0)
|
||||
/* 026D40 80026140 00000000 */ nop
|
||||
/* 026D44 80026144 44994000 */ mtc1 $t9, $f8
|
||||
/* 026D48 80026148 00000000 */ nop
|
||||
/* 026D4C 8002614C 468042A0 */ cvt.s.w $f10, $f8
|
||||
/* 026D50 80026150 E7AA007C */ swc1 $f10, 0x7c($sp)
|
||||
.L80026154:
|
||||
/* 026D54 80026154 00051080 */ sll $v0, $a1, 2
|
||||
/* 026D58 80026158 01427021 */ addu $t6, $t2, $v0
|
||||
/* 026D5C 8002615C C5C40000 */ lwc1 $f4, ($t6)
|
||||
/* 026D60 80026160 01627821 */ addu $t7, $t3, $v0
|
||||
/* 026D64 80026164 460C2182 */ mul.s $f6, $f4, $f12
|
||||
/* 026D68 80026168 C5E80000 */ lwc1 $f8, ($t7)
|
||||
/* 026D6C 8002616C 0122C021 */ addu $t8, $t1, $v0
|
||||
/* 026D70 80026170 0005C840 */ sll $t9, $a1, 1
|
||||
/* 026D74 80026174 46087282 */ mul.s $f10, $f14, $f8
|
||||
/* 026D78 80026178 24A50001 */ addiu $a1, $a1, 1
|
||||
/* 026D7C 8002617C 01991821 */ addu $v1, $t4, $t9
|
||||
/* 026D80 80026180 00007025 */ move $t6, $zero
|
||||
/* 026D84 80026184 460A3100 */ add.s $f4, $f6, $f10
|
||||
/* 026D88 80026188 46142000 */ add.s $f0, $f4, $f20
|
||||
/* 026D8C 8002618C 46000221 */ cvt.d.s $f8, $f0
|
||||
/* 026D90 80026190 4622403E */ c.le.d $f8, $f2
|
||||
/* 026D94 80026194 E7000000 */ swc1 $f0, ($t8)
|
||||
/* 026D98 80026198 45000002 */ bc1f .L800261A4
|
||||
/* 026D9C 8002619C 00000000 */ nop
|
||||
/* 026DA0 800261A0 240E0001 */ li $t6, 1
|
||||
.L800261A4:
|
||||
/* 026DA4 800261A4 A46E0000 */ sh $t6, ($v1)
|
||||
/* 026DA8 800261A8 846F0000 */ lh $t7, ($v1)
|
||||
/* 026DAC 800261AC 00057400 */ sll $t6, $a1, 0x10
|
||||
/* 026DB0 800261B0 00CF3021 */ addu $a2, $a2, $t7
|
||||
/* 026DB4 800261B4 000E2C03 */ sra $a1, $t6, 0x10
|
||||
/* 026DB8 800261B8 0006C400 */ sll $t8, $a2, 0x10
|
||||
/* 026DBC 800261BC 28A10004 */ slti $at, $a1, 4
|
||||
/* 026DC0 800261C0 0018CC03 */ sra $t9, $t8, 0x10
|
||||
/* 026DC4 800261C4 1420FFE3 */ bnez $at, .L80026154
|
||||
/* 026DC8 800261C8 03203025 */ move $a2, $t9
|
||||
/* 026DCC 800261CC 13200093 */ beqz $t9, .L8002641C
|
||||
/* 026DD0 800261D0 24010004 */ li $at, 4
|
||||
/* 026DD4 800261D4 13210091 */ beq $t9, $at, .L8002641C
|
||||
/* 026DD8 800261D8 00004025 */ move $t0, $zero
|
||||
/* 026DDC 800261DC 00002825 */ move $a1, $zero
|
||||
/* 026DE0 800261E0 27BF004C */ addiu $ra, $sp, 0x4c
|
||||
/* 026DE4 800261E4 27AD0054 */ addiu $t5, $sp, 0x54
|
||||
.L800261E8:
|
||||
/* 026DE8 800261E8 24A60001 */ addiu $a2, $a1, 1
|
||||
/* 026DEC 800261EC 0006CC00 */ sll $t9, $a2, 0x10
|
||||
/* 026DF0 800261F0 00063C00 */ sll $a3, $a2, 0x10
|
||||
/* 026DF4 800261F4 00197403 */ sra $t6, $t9, 0x10
|
||||
/* 026DF8 800261F8 0007C403 */ sra $t8, $a3, 0x10
|
||||
/* 026DFC 800261FC 29C10004 */ slti $at, $t6, 4
|
||||
/* 026E00 80026200 14200002 */ bnez $at, .L8002620C
|
||||
/* 026E04 80026204 03003825 */ move $a3, $t8
|
||||
/* 026E08 80026208 00003825 */ move $a3, $zero
|
||||
.L8002620C:
|
||||
/* 026E0C 8002620C 00077840 */ sll $t7, $a3, 1
|
||||
/* 026E10 80026210 018FC021 */ addu $t8, $t4, $t7
|
||||
/* 026E14 80026214 00057040 */ sll $t6, $a1, 1
|
||||
/* 026E18 80026218 87190000 */ lh $t9, ($t8)
|
||||
/* 026E1C 8002621C 018E7821 */ addu $t7, $t4, $t6
|
||||
/* 026E20 80026220 85F80000 */ lh $t8, ($t7)
|
||||
/* 026E24 80026224 00051080 */ sll $v0, $a1, 2
|
||||
/* 026E28 80026228 1338001D */ beq $t9, $t8, .L800262A0
|
||||
/* 026E2C 8002622C 01227821 */ addu $t7, $t1, $v0
|
||||
/* 026E30 80026230 00071880 */ sll $v1, $a3, 2
|
||||
/* 026E34 80026234 0123C821 */ addu $t9, $t1, $v1
|
||||
/* 026E38 80026238 C7260000 */ lwc1 $f6, ($t9)
|
||||
/* 026E3C 8002623C C5EC0000 */ lwc1 $f12, ($t7)
|
||||
/* 026E40 80026240 01637021 */ addu $t6, $t3, $v1
|
||||
/* 026E44 80026244 46066281 */ sub.s $f10, $f12, $f6
|
||||
/* 026E48 80026248 0162C021 */ addu $t8, $t3, $v0
|
||||
/* 026E4C 8002624C 460A6383 */ div.s $f14, $f12, $f10
|
||||
/* 026E50 80026250 C7020000 */ lwc1 $f2, ($t8)
|
||||
/* 026E54 80026254 C5C40000 */ lwc1 $f4, ($t6)
|
||||
/* 026E58 80026258 00082080 */ sll $a0, $t0, 2
|
||||
/* 026E5C 8002625C 46022201 */ sub.s $f8, $f4, $f2
|
||||
/* 026E60 80026260 01A47821 */ addu $t7, $t5, $a0
|
||||
/* 026E64 80026264 0143C021 */ addu $t8, $t2, $v1
|
||||
/* 026E68 80026268 0142C821 */ addu $t9, $t2, $v0
|
||||
/* 026E6C 8002626C 25080001 */ addiu $t0, $t0, 1
|
||||
/* 026E70 80026270 03E47021 */ addu $t6, $ra, $a0
|
||||
/* 026E74 80026274 460E4182 */ mul.s $f6, $f8, $f14
|
||||
/* 026E78 80026278 46023280 */ add.s $f10, $f6, $f2
|
||||
/* 026E7C 8002627C E5EA0000 */ swc1 $f10, ($t7)
|
||||
/* 026E80 80026280 C7040000 */ lwc1 $f4, ($t8)
|
||||
/* 026E84 80026284 C7200000 */ lwc1 $f0, ($t9)
|
||||
/* 026E88 80026288 00087C00 */ sll $t7, $t0, 0x10
|
||||
/* 026E8C 8002628C 46002201 */ sub.s $f8, $f4, $f0
|
||||
/* 026E90 80026290 000F4403 */ sra $t0, $t7, 0x10
|
||||
/* 026E94 80026294 460E4182 */ mul.s $f6, $f8, $f14
|
||||
/* 026E98 80026298 46003280 */ add.s $f10, $f6, $f0
|
||||
/* 026E9C 8002629C E5CA0000 */ swc1 $f10, ($t6)
|
||||
.L800262A0:
|
||||
/* 026EA0 800262A0 00062C00 */ sll $a1, $a2, 0x10
|
||||
/* 026EA4 800262A4 0005C403 */ sra $t8, $a1, 0x10
|
||||
/* 026EA8 800262A8 2B010004 */ slti $at, $t8, 4
|
||||
/* 026EAC 800262AC 1420FFCE */ bnez $at, .L800261E8
|
||||
/* 026EB0 800262B0 03002825 */ move $a1, $t8
|
||||
/* 026EB4 800262B4 24010002 */ li $at, 2
|
||||
/* 026EB8 800262B8 15010058 */ bne $t0, $at, .L8002641C
|
||||
/* 026EBC 800262BC 3C018012 */ lui $at, %hi(D_8011D4A4) # $at, 0x8012
|
||||
/* 026EC0 800262C0 C420D4A4 */ lwc1 $f0, %lo(D_8011D4A4)($at)
|
||||
/* 026EC4 800262C4 C7A4004C */ lwc1 $f4, 0x4c($sp)
|
||||
/* 026EC8 800262C8 3C018012 */ lui $at, %hi(D_8011D4A0) # $at, 0x8012
|
||||
/* 026ECC 800262CC 46002202 */ mul.s $f8, $f4, $f0
|
||||
/* 026ED0 800262D0 C422D4A0 */ lwc1 $f2, %lo(D_8011D4A0)($at)
|
||||
/* 026ED4 800262D4 C7A60054 */ lwc1 $f6, 0x54($sp)
|
||||
/* 026ED8 800262D8 3C018012 */ lui $at, %hi(D_8011D4A8) # $at, 0x8012
|
||||
/* 026EDC 800262DC 46061282 */ mul.s $f10, $f2, $f6
|
||||
/* 026EE0 800262E0 C7A60050 */ lwc1 $f6, 0x50($sp)
|
||||
/* 026EE4 800262E4 C42CD4A8 */ lwc1 $f12, %lo(D_8011D4A8)($at)
|
||||
/* 026EE8 800262E8 3C01800E */ lui $at, %hi(D_800E5E68 + 4) # $at, 0x800e
|
||||
/* 026EEC 800262EC 460A4100 */ add.s $f4, $f8, $f10
|
||||
/* 026EF0 800262F0 C7AA0058 */ lwc1 $f10, 0x58($sp)
|
||||
/* 026EF4 800262F4 46003202 */ mul.s $f8, $f6, $f0
|
||||
/* 026EF8 800262F8 460C2400 */ add.s $f16, $f4, $f12
|
||||
/* 026EFC 800262FC 460A1102 */ mul.s $f4, $f2, $f10
|
||||
/* 026F00 80026300 46044180 */ add.s $f6, $f8, $f4
|
||||
/* 026F04 80026304 460C3480 */ add.s $f18, $f6, $f12
|
||||
/* 026F08 80026308 4610903C */ c.lt.s $f18, $f16
|
||||
/* 026F0C 8002630C 00000000 */ nop
|
||||
/* 026F10 80026310 45000004 */ bc1f .L80026324
|
||||
/* 026F14 80026314 00000000 */ nop
|
||||
/* 026F18 80026318 46008386 */ mov.s $f14, $f16
|
||||
/* 026F1C 8002631C 46009406 */ mov.s $f16, $f18
|
||||
/* 026F20 80026320 46007486 */ mov.s $f18, $f14
|
||||
.L80026324:
|
||||
/* 026F24 80026324 C42D5E68 */ lwc1 $f13, %lo(D_800E5E68)($at)
|
||||
/* 026F28 80026328 C42C5E6C */ lwc1 $f12, %lo(D_800E5E68 + 4)($at)
|
||||
/* 026F2C 8002632C 46009021 */ cvt.d.s $f0, $f18
|
||||
/* 026F30 80026330 462C003C */ c.lt.d $f0, $f12
|
||||
/* 026F34 80026334 3C01800E */ lui $at, %hi(D_800E5E70 + 4) # $at, 0x800e
|
||||
/* 026F38 80026338 45010038 */ bc1t .L8002641C
|
||||
/* 026F3C 8002633C E7B20064 */ swc1 $f18, 0x64($sp)
|
||||
/* 026F40 80026340 C42F5E70 */ lwc1 $f15, %lo(D_800E5E70)($at)
|
||||
/* 026F44 80026344 C42E5E74 */ lwc1 $f14, %lo(D_800E5E70 + 4)($at)
|
||||
/* 026F48 80026348 460080A1 */ cvt.d.s $f2, $f16
|
||||
/* 026F4C 8002634C 4622703C */ c.lt.d $f14, $f2
|
||||
/* 026F50 80026350 E7B00060 */ swc1 $f16, 0x60($sp)
|
||||
/* 026F54 80026354 45010031 */ bc1t .L8002641C
|
||||
/* 026F58 80026358 3C18800E */ lui $t8, %hi(gCurrentLevelModel) # $t8, 0x800e
|
||||
/* 026F5C 8002635C 462C103C */ c.lt.d $f2, $f12
|
||||
/* 026F60 80026360 3C01C396 */ li $at, 0xC3960000 # -300.000000
|
||||
/* 026F64 80026364 45000004 */ bc1f .L80026378
|
||||
/* 026F68 80026368 00003025 */ move $a2, $zero
|
||||
/* 026F6C 8002636C 44818000 */ mtc1 $at, $f16
|
||||
/* 026F70 80026370 00000000 */ nop
|
||||
/* 026F74 80026374 E7B00060 */ swc1 $f16, 0x60($sp)
|
||||
.L80026378:
|
||||
/* 026F78 80026378 4620703C */ c.lt.d $f14, $f0
|
||||
/* 026F7C 8002637C 3C014396 */ li $at, 0x43960000 # 300.000000
|
||||
/* 026F80 80026380 45000004 */ bc1f .L80026394
|
||||
/* 026F84 80026384 00000000 */ nop
|
||||
/* 026F88 80026388 44819000 */ mtc1 $at, $f18
|
||||
/* 026F8C 8002638C 00000000 */ nop
|
||||
/* 026F90 80026390 E7B20064 */ swc1 $f18, 0x64($sp)
|
||||
.L80026394:
|
||||
/* 026F94 80026394 444EF800 */ cfc1 $t6, $31
|
||||
/* 026F98 80026398 C7AA0064 */ lwc1 $f10, 0x64($sp)
|
||||
/* 026F9C 8002639C 35C10003 */ ori $at, $t6, 3
|
||||
/* 026FA0 800263A0 38210002 */ xori $at, $at, 2
|
||||
/* 026FA4 800263A4 44C1F800 */ ctc1 $at, $31
|
||||
/* 026FA8 800263A8 8F18C918 */ lw $t8, %lo(gCurrentLevelModel)($t8)
|
||||
/* 026FAC 800263AC 46005224 */ cvt.w.s $f8, $f10
|
||||
/* 026FB0 800263B0 87050040 */ lh $a1, 0x40($t8)
|
||||
/* 026FB4 800263B4 44044000 */ mfc1 $a0, $f8
|
||||
/* 026FB8 800263B8 44CEF800 */ ctc1 $t6, $31
|
||||
/* 026FBC 800263BC 24A5FF3D */ addiu $a1, $a1, -0xc3
|
||||
/* 026FC0 800263C0 00057400 */ sll $t6, $a1, 0x10
|
||||
/* 026FC4 800263C4 00047C00 */ sll $t7, $a0, 0x10
|
||||
/* 026FC8 800263C8 000F2403 */ sra $a0, $t7, 0x10
|
||||
/* 026FCC 800263CC 0C009B05 */ jal func_80026C14
|
||||
/* 026FD0 800263D0 000E2C03 */ sra $a1, $t6, 0x10
|
||||
/* 026FD4 800263D4 4459F800 */ cfc1 $t9, $31
|
||||
/* 026FD8 800263D8 C7A40060 */ lwc1 $f4, 0x60($sp)
|
||||
/* 026FDC 800263DC 37210003 */ ori $at, $t9, 3
|
||||
/* 026FE0 800263E0 38210002 */ xori $at, $at, 2
|
||||
/* 026FE4 800263E4 44C1F800 */ ctc1 $at, $31
|
||||
/* 026FE8 800263E8 3C0F800E */ lui $t7, %hi(gCurrentLevelModel) # $t7, 0x800e
|
||||
/* 026FEC 800263EC 8DEFC918 */ lw $t7, %lo(gCurrentLevelModel)($t7)
|
||||
/* 026FF0 800263F0 460021A4 */ cvt.w.s $f6, $f4
|
||||
/* 026FF4 800263F4 85E50040 */ lh $a1, 0x40($t7)
|
||||
/* 026FF8 800263F8 44043000 */ mfc1 $a0, $f6
|
||||
/* 026FFC 800263FC 44D9F800 */ ctc1 $t9, $31
|
||||
/* 027000 80026400 24A5FF3D */ addiu $a1, $a1, -0xc3
|
||||
/* 027004 80026404 0005CC00 */ sll $t9, $a1, 0x10
|
||||
/* 027008 80026408 0004C400 */ sll $t8, $a0, 0x10
|
||||
/* 02700C 8002640C 00182403 */ sra $a0, $t8, 0x10
|
||||
/* 027010 80026410 00192C03 */ sra $a1, $t9, 0x10
|
||||
/* 027014 80026414 0C009B05 */ jal func_80026C14
|
||||
/* 027018 80026418 00003025 */ move $a2, $zero
|
||||
.L8002641C:
|
||||
/* 02701C 8002641C 8FBF001C */ lw $ra, 0x1c($sp)
|
||||
/* 027020 80026420 C7B50010 */ lwc1 $f21, 0x10($sp)
|
||||
/* 027024 80026424 C7B40014 */ lwc1 $f20, 0x14($sp)
|
||||
/* 027028 80026428 03E00008 */ jr $ra
|
||||
/* 02702C 8002642C 27BD0090 */ addiu $sp, $sp, 0x90
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
glabel func_80026E54
|
||||
/* 027A54 80026E54 27BDFEF8 */ addiu $sp, $sp, -0x108
|
||||
/* 027A58 80026E58 AFB5003C */ sw $s5, 0x3c($sp)
|
||||
/* 027A5C 80026E5C 0004AC00 */ sll $s5, $a0, 0x10
|
||||
/* 027A60 80026E60 00157403 */ sra $t6, $s5, 0x10
|
||||
/* 027A64 80026E64 E7B60024 */ swc1 $f22, 0x24($sp)
|
||||
/* 027A68 80026E68 E7B4001C */ swc1 $f20, 0x1c($sp)
|
||||
/* 027A6C 80026E6C 4487A000 */ mtc1 $a3, $f20
|
||||
/* 027A70 80026E70 4486B000 */ mtc1 $a2, $f22
|
||||
/* 027A74 80026E74 AFB30034 */ sw $s3, 0x34($sp)
|
||||
/* 027A78 80026E78 29C1000A */ slti $at, $t6, 0xa
|
||||
/* 027A7C 80026E7C 00A09825 */ move $s3, $a1
|
||||
/* 027A80 80026E80 01C0A825 */ move $s5, $t6
|
||||
/* 027A84 80026E84 AFBF0044 */ sw $ra, 0x44($sp)
|
||||
/* 027A88 80026E88 AFB60040 */ sw $s6, 0x40($sp)
|
||||
/* 027A8C 80026E8C AFB40038 */ sw $s4, 0x38($sp)
|
||||
/* 027A90 80026E90 AFB20030 */ sw $s2, 0x30($sp)
|
||||
/* 027A94 80026E94 AFB1002C */ sw $s1, 0x2c($sp)
|
||||
/* 027A98 80026E98 AFB00028 */ sw $s0, 0x28($sp)
|
||||
/* 027A9C 80026E9C E7B70020 */ swc1 $f23, 0x20($sp)
|
||||
/* 027AA0 80026EA0 E7B50018 */ swc1 $f21, 0x18($sp)
|
||||
/* 027AA4 80026EA4 102000A9 */ beqz $at, .L8002714C
|
||||
/* 027AA8 80026EA8 AFA40108 */ sw $a0, 0x108($sp)
|
||||
/* 027AAC 80026EAC 11C000A7 */ beqz $t6, .L8002714C
|
||||
/* 027AB0 80026EB0 00001025 */ move $v0, $zero
|
||||
/* 027AB4 80026EB4 19C0004D */ blez $t6, .L80026FEC
|
||||
/* 027AB8 80026EB8 00008025 */ move $s0, $zero
|
||||
/* 027ABC 80026EBC 3C088012 */ lui $t0, %hi(D_8011D47C) # $t0, 0x8012
|
||||
/* 027AC0 80026EC0 3C078012 */ lui $a3, %hi(D_8011D478) # $a3, 0x8012
|
||||
/* 027AC4 80026EC4 8CE7D478 */ lw $a3, %lo(D_8011D478)($a3)
|
||||
/* 027AC8 80026EC8 8D08D47C */ lw $t0, %lo(D_8011D47C)($t0)
|
||||
/* 027ACC 80026ECC 27B40094 */ addiu $s4, $sp, 0x94
|
||||
/* 027AD0 80026ED0 27B20060 */ addiu $s2, $sp, 0x60
|
||||
/* 027AD4 80026ED4 27A5006C */ addiu $a1, $sp, 0x6c
|
||||
.L80026ED8:
|
||||
/* 027AD8 80026ED8 02137821 */ addu $t7, $s0, $s3
|
||||
/* 027ADC 80026EDC 81F80000 */ lb $t8, ($t7)
|
||||
/* 027AE0 80026EE0 00000000 */ nop
|
||||
/* 027AE4 80026EE4 0018CC40 */ sll $t9, $t8, 0x11
|
||||
/* 027AE8 80026EE8 00195403 */ sra $t2, $t9, 0x10
|
||||
/* 027AEC 80026EEC 01482021 */ addu $a0, $t2, $t0
|
||||
/* 027AF0 80026EF0 808B0000 */ lb $t3, ($a0)
|
||||
/* 027AF4 80026EF4 808D0001 */ lb $t5, 1($a0)
|
||||
/* 027AF8 80026EF8 000B60C0 */ sll $t4, $t3, 3
|
||||
/* 027AFC 80026EFC 000D70C0 */ sll $t6, $t5, 3
|
||||
/* 027B00 80026F00 01871821 */ addu $v1, $t4, $a3
|
||||
/* 027B04 80026F04 01C73021 */ addu $a2, $t6, $a3
|
||||
/* 027B08 80026F08 846F0000 */ lh $t7, ($v1)
|
||||
/* 027B0C 80026F0C 84D90000 */ lh $t9, ($a2)
|
||||
/* 027B10 80026F10 448F2000 */ mtc1 $t7, $f4
|
||||
/* 027B14 80026F14 44994000 */ mtc1 $t9, $f8
|
||||
/* 027B18 80026F18 468020A0 */ cvt.s.w $f2, $f4
|
||||
/* 027B1C 80026F1C 84780002 */ lh $t8, 2($v1)
|
||||
/* 027B20 80026F20 84CA0002 */ lh $t2, 2($a2)
|
||||
/* 027B24 80026F24 468043A0 */ cvt.s.w $f14, $f8
|
||||
/* 027B28 80026F28 44983000 */ mtc1 $t8, $f6
|
||||
/* 027B2C 80026F2C 448A5000 */ mtc1 $t2, $f10
|
||||
/* 027B30 80026F30 460E1032 */ c.eq.s $f2, $f14
|
||||
/* 027B34 80026F34 46803320 */ cvt.s.w $f12, $f6
|
||||
/* 027B38 80026F38 45010084 */ bc1t .L8002714C
|
||||
/* 027B3C 80026F3C 46805420 */ cvt.s.w $f16, $f10
|
||||
/* 027B40 80026F40 460E1001 */ sub.s $f0, $f2, $f14
|
||||
/* 027B44 80026F44 00025880 */ sll $t3, $v0, 2
|
||||
/* 027B48 80026F48 46141101 */ sub.s $f4, $f2, $f20
|
||||
/* 027B4C 80026F4C 24420001 */ addiu $v0, $v0, 1
|
||||
/* 027B50 80026F50 46002183 */ div.s $f6, $f4, $f0
|
||||
/* 027B54 80026F54 460C8481 */ sub.s $f18, $f16, $f12
|
||||
/* 027B58 80026F58 00026C00 */ sll $t5, $v0, 0x10
|
||||
/* 027B5C 80026F5C 000D7403 */ sra $t6, $t5, 0x10
|
||||
/* 027B60 80026F60 028B6021 */ addu $t4, $s4, $t3
|
||||
/* 027B64 80026F64 000EC080 */ sll $t8, $t6, 2
|
||||
/* 027B68 80026F68 02981821 */ addu $v1, $s4, $t8
|
||||
/* 027B6C 80026F6C 00107880 */ sll $t7, $s0, 2
|
||||
/* 027B70 80026F70 00AF2021 */ addu $a0, $a1, $t7
|
||||
/* 027B74 80026F74 0250C821 */ addu $t9, $s2, $s0
|
||||
/* 027B78 80026F78 25C20001 */ addiu $v0, $t6, 1
|
||||
/* 027B7C 80026F7C 00025400 */ sll $t2, $v0, 0x10
|
||||
/* 027B80 80026F80 46069202 */ mul.s $f8, $f18, $f6
|
||||
/* 027B84 80026F84 460EB181 */ sub.s $f6, $f22, $f14
|
||||
/* 027B88 80026F88 000A1403 */ sra $v0, $t2, 0x10
|
||||
/* 027B8C 80026F8C 460C4280 */ add.s $f10, $f8, $f12
|
||||
/* 027B90 80026F90 00000000 */ nop
|
||||
/* 027B94 80026F94 46003203 */ div.s $f8, $f6, $f0
|
||||
/* 027B98 80026F98 46106481 */ sub.s $f18, $f12, $f16
|
||||
/* 027B9C 80026F9C E58A0000 */ swc1 $f10, ($t4)
|
||||
/* 027BA0 80026FA0 C464FFFC */ lwc1 $f4, -4($v1)
|
||||
/* 027BA4 80026FA4 A3300000 */ sb $s0, ($t9)
|
||||
/* 027BA8 80026FA8 E4840000 */ swc1 $f4, ($a0)
|
||||
/* 027BAC 80026FAC 00026080 */ sll $t4, $v0, 2
|
||||
/* 027BB0 80026FB0 028C6821 */ addu $t5, $s4, $t4
|
||||
/* 027BB4 80026FB4 26100001 */ addiu $s0, $s0, 1
|
||||
/* 027BB8 80026FB8 00107400 */ sll $t6, $s0, 0x10
|
||||
/* 027BBC 80026FBC 000E8403 */ sra $s0, $t6, 0x10
|
||||
/* 027BC0 80026FC0 0215082A */ slt $at, $s0, $s5
|
||||
/* 027BC4 80026FC4 46089282 */ mul.s $f10, $f18, $f8
|
||||
/* 027BC8 80026FC8 46105100 */ add.s $f4, $f10, $f16
|
||||
/* 027BCC 80026FCC E4640000 */ swc1 $f4, ($v1)
|
||||
/* 027BD0 80026FD0 C4860000 */ lwc1 $f6, ($a0)
|
||||
/* 027BD4 80026FD4 C5B2FFFC */ lwc1 $f18, -4($t5)
|
||||
/* 027BD8 80026FD8 00000000 */ nop
|
||||
/* 027BDC 80026FDC 46123200 */ add.s $f8, $f6, $f18
|
||||
/* 027BE0 80026FE0 1420FFBD */ bnez $at, .L80026ED8
|
||||
/* 027BE4 80026FE4 E4880000 */ swc1 $f8, ($a0)
|
||||
/* 027BE8 80026FE8 00008025 */ move $s0, $zero
|
||||
.L80026FEC:
|
||||
/* 027BEC 80026FEC 27A5006C */ addiu $a1, $sp, 0x6c
|
||||
/* 027BF0 80026FF0 27B20060 */ addiu $s2, $sp, 0x60
|
||||
/* 027BF4 80026FF4 27B40094 */ addiu $s4, $sp, 0x94
|
||||
/* 027BF8 80026FF8 26B1FFFF */ addiu $s1, $s5, -1
|
||||
.L80026FFC:
|
||||
/* 027BFC 80026FFC 1A20001F */ blez $s1, .L8002707C
|
||||
/* 027C00 80027000 24060001 */ li $a2, 1
|
||||
/* 027C04 80027004 02501821 */ addu $v1, $s2, $s0
|
||||
.L80027008:
|
||||
/* 027C08 80027008 80780001 */ lb $t8, 1($v1)
|
||||
/* 027C0C 8002700C 806B0000 */ lb $t3, ($v1)
|
||||
/* 027C10 80027010 0018C880 */ sll $t9, $t8, 2
|
||||
/* 027C14 80027014 000B6080 */ sll $t4, $t3, 2
|
||||
/* 027C18 80027018 00AC6821 */ addu $t5, $a1, $t4
|
||||
/* 027C1C 8002701C 00B95021 */ addu $t2, $a1, $t9
|
||||
/* 027C20 80027020 C54A0000 */ lwc1 $f10, ($t2)
|
||||
/* 027C24 80027024 C5A40000 */ lwc1 $f4, ($t5)
|
||||
/* 027C28 80027028 02132021 */ addu $a0, $s0, $s3
|
||||
/* 027C2C 8002702C 4604503C */ c.lt.s $f10, $f4
|
||||
/* 027C30 80027030 00000000 */ nop
|
||||
/* 027C34 80027034 4500000A */ bc1f .L80027060
|
||||
/* 027C38 80027038 00000000 */ nop
|
||||
/* 027C3C 8002703C 80820000 */ lb $v0, ($a0)
|
||||
/* 027C40 80027040 808E0001 */ lb $t6, 1($a0)
|
||||
/* 027C44 80027044 A0820001 */ sb $v0, 1($a0)
|
||||
/* 027C48 80027048 A08E0000 */ sb $t6, ($a0)
|
||||
/* 027C4C 8002704C 80620000 */ lb $v0, ($v1)
|
||||
/* 027C50 80027050 806F0001 */ lb $t7, 1($v1)
|
||||
/* 027C54 80027054 00003025 */ move $a2, $zero
|
||||
/* 027C58 80027058 A0620001 */ sb $v0, 1($v1)
|
||||
/* 027C5C 8002705C A06F0000 */ sb $t7, ($v1)
|
||||
.L80027060:
|
||||
/* 027C60 80027060 26100001 */ addiu $s0, $s0, 1
|
||||
/* 027C64 80027064 0010C400 */ sll $t8, $s0, 0x10
|
||||
/* 027C68 80027068 00188403 */ sra $s0, $t8, 0x10
|
||||
/* 027C6C 8002706C 0211082A */ slt $at, $s0, $s1
|
||||
/* 027C70 80027070 1420FFE5 */ bnez $at, .L80027008
|
||||
/* 027C74 80027074 02501821 */ addu $v1, $s2, $s0
|
||||
/* 027C78 80027078 00008025 */ move $s0, $zero
|
||||
.L8002707C:
|
||||
/* 027C7C 8002707C 10C0FFDF */ beqz $a2, .L80026FFC
|
||||
/* 027C80 80027080 00000000 */ nop
|
||||
/* 027C84 80027084 1A200031 */ blez $s1, .L8002714C
|
||||
/* 027C88 80027088 3C168012 */ lui $s6, %hi(D_8011D47C) # $s6, 0x8012
|
||||
/* 027C8C 8002708C 3C158012 */ lui $s5, %hi(D_8011D478) # $s5, 0x8012
|
||||
/* 027C90 80027090 26B5D478 */ addiu $s5, %lo(D_8011D478) # addiu $s5, $s5, -0x2b88
|
||||
/* 027C94 80027094 26D6D47C */ addiu $s6, %lo(D_8011D47C) # addiu $s6, $s6, -0x2b84
|
||||
/* 027C98 80027098 02132021 */ addu $a0, $s0, $s3
|
||||
.L8002709C:
|
||||
/* 027C9C 8002709C 808A0000 */ lb $t2, ($a0)
|
||||
/* 027CA0 800270A0 8EC80000 */ lw $t0, ($s6)
|
||||
/* 027CA4 800270A4 000A5840 */ sll $t3, $t2, 1
|
||||
/* 027CA8 800270A8 01686021 */ addu $t4, $t3, $t0
|
||||
/* 027CAC 800270AC 818D0000 */ lb $t5, ($t4)
|
||||
/* 027CB0 800270B0 8EA70000 */ lw $a3, ($s5)
|
||||
/* 027CB4 800270B4 808B0001 */ lb $t3, 1($a0)
|
||||
/* 027CB8 800270B8 000D70C0 */ sll $t6, $t5, 3
|
||||
/* 027CBC 800270BC 00EE7821 */ addu $t7, $a3, $t6
|
||||
/* 027CC0 800270C0 000B6040 */ sll $t4, $t3, 1
|
||||
/* 027CC4 800270C4 81E20006 */ lb $v0, 6($t7)
|
||||
/* 027CC8 800270C8 01886821 */ addu $t5, $t4, $t0
|
||||
/* 027CCC 800270CC 81AE0000 */ lb $t6, ($t5)
|
||||
/* 027CD0 800270D0 30580001 */ andi $t8, $v0, 1
|
||||
/* 027CD4 800270D4 0018CE00 */ sll $t9, $t8, 0x18
|
||||
/* 027CD8 800270D8 000E78C0 */ sll $t7, $t6, 3
|
||||
/* 027CDC 800270DC 00EFC021 */ addu $t8, $a3, $t7
|
||||
/* 027CE0 800270E0 83030006 */ lb $v1, 6($t8)
|
||||
/* 027CE4 800270E4 00191603 */ sra $v0, $t9, 0x18
|
||||
/* 027CE8 800270E8 30790001 */ andi $t9, $v1, 1
|
||||
/* 027CEC 800270EC 00195600 */ sll $t2, $t9, 0x18
|
||||
/* 027CF0 800270F0 10400010 */ beqz $v0, .L80027134
|
||||
/* 027CF4 800270F4 000A5E03 */ sra $t3, $t2, 0x18
|
||||
/* 027CF8 800270F8 1560000E */ bnez $t3, .L80027134
|
||||
/* 027CFC 800270FC 02501821 */ addu $v1, $s2, $s0
|
||||
/* 027D00 80027100 806C0000 */ lb $t4, ($v1)
|
||||
/* 027D04 80027104 806F0001 */ lb $t7, 1($v1)
|
||||
/* 027D08 80027108 000C6C40 */ sll $t5, $t4, 0x11
|
||||
/* 027D0C 8002710C 000FC440 */ sll $t8, $t7, 0x11
|
||||
/* 027D10 80027110 000D7403 */ sra $t6, $t5, 0x10
|
||||
/* 027D14 80027114 0018CC03 */ sra $t9, $t8, 0x10
|
||||
/* 027D18 80027118 00195880 */ sll $t3, $t9, 2
|
||||
/* 027D1C 8002711C 000E5080 */ sll $t2, $t6, 2
|
||||
/* 027D20 80027120 4406A000 */ mfc1 $a2, $f20
|
||||
/* 027D24 80027124 4407B000 */ mfc1 $a3, $f22
|
||||
/* 027D28 80027128 028A2021 */ addu $a0, $s4, $t2
|
||||
/* 027D2C 8002712C 0C009C61 */ jal func_80027184
|
||||
/* 027D30 80027130 028B2821 */ addu $a1, $s4, $t3
|
||||
.L80027134:
|
||||
/* 027D34 80027134 26100001 */ addiu $s0, $s0, 1
|
||||
/* 027D38 80027138 00106400 */ sll $t4, $s0, 0x10
|
||||
/* 027D3C 8002713C 000C8403 */ sra $s0, $t4, 0x10
|
||||
/* 027D40 80027140 0211082A */ slt $at, $s0, $s1
|
||||
/* 027D44 80027144 1420FFD5 */ bnez $at, .L8002709C
|
||||
/* 027D48 80027148 02132021 */ addu $a0, $s0, $s3
|
||||
.L8002714C:
|
||||
/* 027D4C 8002714C 8FBF0044 */ lw $ra, 0x44($sp)
|
||||
/* 027D50 80027150 C7B50018 */ lwc1 $f21, 0x18($sp)
|
||||
/* 027D54 80027154 C7B4001C */ lwc1 $f20, 0x1c($sp)
|
||||
/* 027D58 80027158 C7B70020 */ lwc1 $f23, 0x20($sp)
|
||||
/* 027D5C 8002715C C7B60024 */ lwc1 $f22, 0x24($sp)
|
||||
/* 027D60 80027160 8FB00028 */ lw $s0, 0x28($sp)
|
||||
/* 027D64 80027164 8FB1002C */ lw $s1, 0x2c($sp)
|
||||
/* 027D68 80027168 8FB20030 */ lw $s2, 0x30($sp)
|
||||
/* 027D6C 8002716C 8FB30034 */ lw $s3, 0x34($sp)
|
||||
/* 027D70 80027170 8FB40038 */ lw $s4, 0x38($sp)
|
||||
/* 027D74 80027174 8FB5003C */ lw $s5, 0x3c($sp)
|
||||
/* 027D78 80027178 8FB60040 */ lw $s6, 0x40($sp)
|
||||
/* 027D7C 8002717C 03E00008 */ jr $ra
|
||||
/* 027D80 80027180 27BD0108 */ addiu $sp, $sp, 0x108
|
||||
|
||||
+30
-28
@@ -5452,35 +5452,37 @@ void set_position_goal_from_path(UNUSED Object *obj, Object_Racer *racer, f32 *x
|
||||
|
||||
splineEnd = get_checkpoint_count();
|
||||
|
||||
if (splineEnd) {
|
||||
magnitude = 1.0 - racer->checkpoint_distance;
|
||||
if (magnitude < 0.0f) {
|
||||
magnitude = 0.0f;
|
||||
}
|
||||
if (racer->checkpoint) {} // Fakematch
|
||||
splinePos = racer->checkpoint - 2;
|
||||
if (splinePos < 0) {
|
||||
splinePos += splineEnd;
|
||||
}
|
||||
for (i = 0; i < 5; i++) {
|
||||
checkpoint = find_next_checkpoint_node(splinePos, racer->unk1C8);
|
||||
splineX[i] = checkpoint->x;
|
||||
splineY[i] = checkpoint->y;
|
||||
splineZ[i] = checkpoint->z;
|
||||
splinePos++;
|
||||
if (splinePos == splineEnd) {
|
||||
splinePos = 0;
|
||||
}
|
||||
}
|
||||
destReached = FALSE;
|
||||
if (magnitude >= 1.0) {
|
||||
destReached = TRUE;
|
||||
magnitude -= 1.0;
|
||||
}
|
||||
*x = catmull_rom_interpolation(splineX, destReached, magnitude);
|
||||
*y = catmull_rom_interpolation(splineY, destReached, magnitude);
|
||||
*z = catmull_rom_interpolation(splineZ, destReached, magnitude);
|
||||
if (splineEnd == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
magnitude = 1.0 - racer->checkpoint_distance;
|
||||
if (magnitude < 0.0f) {
|
||||
magnitude = 0.0f;
|
||||
}
|
||||
if (racer->checkpoint) {} // Fakematch
|
||||
splinePos = racer->checkpoint - 2;
|
||||
if (splinePos < 0) {
|
||||
splinePos += splineEnd;
|
||||
}
|
||||
for (i = 0; i < 5; i++) {
|
||||
checkpoint = find_next_checkpoint_node(splinePos, racer->unk1C8);
|
||||
splineX[i] = checkpoint->x;
|
||||
splineY[i] = checkpoint->y;
|
||||
splineZ[i] = checkpoint->z;
|
||||
splinePos++;
|
||||
if (splinePos == splineEnd) {
|
||||
splinePos = 0;
|
||||
}
|
||||
}
|
||||
destReached = FALSE;
|
||||
if (magnitude >= 1.0) {
|
||||
destReached = TRUE;
|
||||
magnitude -= 1.0;
|
||||
}
|
||||
*x = catmull_rom_interpolation(splineX, destReached, magnitude);
|
||||
*y = catmull_rom_interpolation(splineY, destReached, magnitude);
|
||||
*z = catmull_rom_interpolation(splineZ, destReached, magnitude);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
|
||||
+150
-3
@@ -467,7 +467,6 @@ void func_800257D0(void) {
|
||||
#ifdef NON_EQUIVALENT
|
||||
void func_80026070(LevelModelSegmentBoundingBox *, f32, f32, f32);
|
||||
void func_80026430(LevelModelSegment *, f32, f32, f32);
|
||||
void func_80026E54(s16 arg0, s8 *arg1, f32 arg2, f32 arg3);
|
||||
// Alternative Attempt: https://decomp.me/scratch/2C6dJ
|
||||
void func_8002581C(u8 *segmentIds, s32 numberOfSegments, s32 viewportIndex) {
|
||||
Vertex *spAC;
|
||||
@@ -634,7 +633,84 @@ void func_8002581C(u8 *segmentIds, s32 numberOfSegments, s32 viewportIndex) {
|
||||
GLOBAL_ASM("asm/non_matchings/tracks/func_8002581C.s")
|
||||
#endif
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/tracks/func_80026070.s")
|
||||
void func_80026070(LevelModelSegmentBoundingBox *arg0, f32 arg1, f32 arg2, f32 arg3) {
|
||||
f32 sp80[4];
|
||||
f32 sp70[4];
|
||||
s16 temp2;
|
||||
s32 pad;
|
||||
f32 sp60[2];
|
||||
s16 index;
|
||||
s16 nextIndex;
|
||||
f32 sp54[2];
|
||||
f32 sp4C[2];
|
||||
f32 temp;
|
||||
s16 sp40[4];
|
||||
s16 var_t0;
|
||||
|
||||
sp80[0] = arg0->x1;
|
||||
sp70[0] = arg0->z1;
|
||||
sp80[1] = arg0->x2;
|
||||
sp70[1] = arg0->z1;
|
||||
sp80[2] = arg0->x2;
|
||||
sp70[2] = arg0->z2;
|
||||
sp80[3] = arg0->x1;
|
||||
sp70[3] = arg0->z2;
|
||||
|
||||
temp2 = 0;
|
||||
for (index = 0; index < 4; index++) {
|
||||
sp60[index] = (arg1 * sp80[index]) + (sp70[index] * arg2) + arg3;
|
||||
sp40[index] = sp60[index] <= 0.0;
|
||||
temp2 += sp40[index];
|
||||
}
|
||||
if (temp2 != 0) {
|
||||
var_t0 = 0;
|
||||
if (temp2 == 4) {
|
||||
return;
|
||||
}
|
||||
for (index = 0; index < 4; index++) {
|
||||
nextIndex = index + 1;
|
||||
if (nextIndex >= 4) {
|
||||
nextIndex = 0;
|
||||
}
|
||||
if ((sp40[nextIndex] != sp40[index]) != 0U) {
|
||||
temp = sp60[index] / (sp60[index] - sp60[nextIndex]);
|
||||
sp54[var_t0] = sp80[index] + ((sp80[nextIndex] - sp80[index]) * temp);
|
||||
sp4C[var_t0] = sp70[index] + ((sp70[nextIndex] - sp70[index]) * temp);
|
||||
var_t0++;
|
||||
}
|
||||
}
|
||||
if (var_t0 != 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
sp60[0] = (D_8011D4A0 * sp54[0]) + (D_8011D4A4 * sp4C[0]) + D_8011D4A8;
|
||||
sp60[1] = (D_8011D4A0 * sp54[1]) + (D_8011D4A4 * sp4C[1]) + D_8011D4A8;
|
||||
|
||||
if (sp60[1] < sp60[0]) {
|
||||
temp = sp60[0];
|
||||
sp60[0] = sp60[1];
|
||||
sp60[1] = temp;
|
||||
}
|
||||
|
||||
// Returns must be on the same line.
|
||||
// clang-format off
|
||||
if (-300.0 > sp60[1]) { return;
|
||||
}
|
||||
if (sp60[0] > 300.0) { return;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
if (sp60[0] < -300.0) {
|
||||
sp60[0] = -300.0f;
|
||||
}
|
||||
if (sp60[1] > 300.0) {
|
||||
sp60[1] = 300.0f;
|
||||
}
|
||||
func_80026C14(sp60[1], gCurrentLevelModel->lowerYBounds - 195, 0);
|
||||
func_80026C14(sp60[0], gCurrentLevelModel->lowerYBounds - 195, 0);
|
||||
}
|
||||
}
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/tracks/func_80026430.s")
|
||||
|
||||
void func_80026C14(s16 arg0, s16 arg1, s32 arg2) {
|
||||
@@ -670,7 +746,78 @@ void func_80026C14(s16 arg0, s16 arg1, s32 arg2) {
|
||||
}
|
||||
}
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/tracks/func_80026E54.s")
|
||||
void func_80026E54(s16 arg0, s8 *arg1, f32 arg2, f32 arg3) {
|
||||
s32 pad[7];
|
||||
unk8011D478 *next;
|
||||
unk8011D478 *curr;
|
||||
s16 temp3;
|
||||
s16 temp4;
|
||||
f32 diff_unk0;
|
||||
f32 curr_unk0;
|
||||
f32 curr_unk2;
|
||||
f32 next_unk0;
|
||||
f32 next_unk2;
|
||||
s32 noSwap;
|
||||
s16 i;
|
||||
s16 j;
|
||||
s8 temp;
|
||||
s8 temp0;
|
||||
s8 temp1;
|
||||
f32 temp2;
|
||||
f32 sp94[10];
|
||||
f32 sp6C[10];
|
||||
s8 sp60[10];
|
||||
s8 swapByte;
|
||||
|
||||
if (arg0 >= 10 || arg0 == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (j = 0, i = 0; i < arg0; ) {
|
||||
temp = arg1[i];
|
||||
curr = &D_8011D478[D_8011D47C[(s16) (temp * 2)]];
|
||||
next = &D_8011D478[D_8011D47C[((s16) (temp * 2)) + 1]];
|
||||
curr_unk0 = (f32) curr->unk0;
|
||||
curr_unk2 = (f32) curr->unk2;
|
||||
next_unk0 = (f32) next->unk0;
|
||||
next_unk2 = (f32) next->unk2;
|
||||
if (curr_unk0 == next_unk0) {
|
||||
return;
|
||||
}
|
||||
diff_unk0 = (curr_unk0 - next_unk0);
|
||||
sp94[j++] = ((next_unk2 - curr_unk2) * ((curr_unk0 - arg3) / diff_unk0)) + curr_unk2;
|
||||
sp6C[i] = sp94[j - 1];
|
||||
sp60[i] = i;
|
||||
sp94[j++] = ((curr_unk2 - next_unk2) * ((arg2 - next_unk0) / diff_unk0)) + next_unk2;
|
||||
sp6C[i] += sp94[j - 1];
|
||||
i++;
|
||||
}
|
||||
|
||||
do {
|
||||
noSwap = TRUE;
|
||||
for (i = 0; i < arg0 - 1; i++) {
|
||||
if (sp6C[sp60[i + 1]] < sp6C[sp60[i]]) {
|
||||
swapByte = arg1[i];
|
||||
arg1[i] = arg1[i + 1];
|
||||
arg1[i + 1] = swapByte;
|
||||
swapByte = sp60[i];
|
||||
sp60[i] = sp60[i + 1];
|
||||
sp60[i + 1] = swapByte;
|
||||
noSwap = FALSE;
|
||||
}
|
||||
}
|
||||
} while (noSwap == FALSE);
|
||||
|
||||
for (i = 0; i < arg0 - 1; i++) {
|
||||
temp0 = D_8011D478[D_8011D47C[arg1[i] * 2]].unk6 & 1;
|
||||
temp1 = D_8011D478[D_8011D47C[arg1[i + 1] * 2]].unk6 & 1;
|
||||
if (temp0 && !temp1) {
|
||||
temp3 = (sp60[i] * 2);
|
||||
temp4 = (sp60[i + 1] * 2);
|
||||
func_80027184(&sp94[temp3], &sp94[temp4], arg3, arg2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_EQUIVALENT
|
||||
s32 func_80027184(f32 *arg0, f32 *arg1, f32 arg2, f32 arg3) {
|
||||
|
||||
@@ -185,6 +185,7 @@ void set_fog(s32 fogIdx, s16 near, s16 far, u8 red, u8 green, u8 blue);
|
||||
void slowly_change_fog(s32 fogIdx, s32 red, s32 green, s32 blue, s32 near, s32 far, s32 switchTimer);
|
||||
s32 func_8002FD74(f32 x0, f32 z0, f32 x1, f32 x2, s32 count, Vec4f *arg5);
|
||||
void func_80026C14(s16 arg0, s16 arg1, s32 arg2);
|
||||
void func_80026E54(s16 arg0, s8 *arg1, f32 arg2, f32 arg3);
|
||||
|
||||
void free_track(void);
|
||||
void func_8002581C(u8 *segmentIds, s32 numberOfSegments, s32 viewportIndex);
|
||||
|
||||
Reference in New Issue
Block a user