Someone needs to slow down!😉 (#410)

* WIP func_800A36CC

* Match setup_lights and func_800337E4

* Match func_800AD030

* Match func_800AC0C8

* Match func_800AC8A8

* Match func_800C1130

* README update

* Apply suggestions from code review

Co-authored-by: Fazana <52551480+FazanaJ@users.noreply.github.com>

* Add fakematch comment

---------

Co-authored-by: Fazana <52551480+FazanaJ@users.noreply.github.com>
This commit is contained in:
Ryan Myers
2023-09-25 15:34:17 -04:00
committed by GitHub
co-authored by Fazana
parent fd40898eee
commit 14b1e4d554
17 changed files with 359 additions and 757 deletions
+12 -12
View File
@@ -5,11 +5,11 @@ This repo contains a work-in-progress decompilation of Diddy Kong Racing for the
Currently, only the US 1.0 version 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 September 22, 2023, this is our current score:
As of September 25, 2023, this is our current score:
&emsp;&emsp;&emsp;&emsp;Decomp progress: 54.12%
&emsp;&emsp;&emsp;&emsp;Decomp progress: 54.44%
&emsp;&emsp;&emsp;&emsp;Documentation progress: 28.35%
&emsp;&emsp;&emsp;&emsp;Documentation progress: 28.42%
<!-- README_SCORE_SUMMARY_END -->
---
@@ -128,15 +128,15 @@ s32 is_drumstick_unlocked(void) {
```
<!-- README_SCORE_BEGIN -->
As of September 22nd, 2023, this is our current score:
As of September 25th, 2023, this is our current score:
```
========================================================
ADVENTURE ONE (ASM -> C Decompilation)
------------------- 54.12% Complete --------------------
# Decompiled functions: 1556
# GLOBAL_ASM remaining: 282
# NON_MATCHING functions: 15
# NON_EQUIVALENT WIP functions: 68
------------------- 54.44% Complete --------------------
# Decompiled functions: 1563
# GLOBAL_ASM remaining: 275
# NON_MATCHING functions: 14
# NON_EQUIVALENT WIP functions: 69
--------------------- Game Status ----------------------
Balloons: 26/47, Keys: 3/4, Trophies: 2/5
T.T. Amulets: 2/4, Wizpig Amulets: 2/4
@@ -144,9 +144,9 @@ As of September 22nd, 2023, this is our current score:
We are battling in Darkwater Beach. (1 opponent remains)
========================================================
ADVENTURE TWO (Cleanup & Documentation)
------------------- 28.35% Complete --------------------
# Documented functions: 621
# Undocumented remaining: 949
------------------- 28.42% Complete --------------------
# Documented functions: 623
# Undocumented remaining: 947
--------------------- Game Status ----------------------
Balloons: 14/47, Keys: 1/4, Trophies: 1/5
T.T. Amulets: 1/4, Wizpig Amulets: 1/4
@@ -1,187 +0,0 @@
glabel func_800C1130
/* 0C1D30 800C1130 3C07800E */ lui $a3, %hi(sTransitionFadeTimer) # $a3, 0x800e
/* 0C1D34 800C1134 24E731B0 */ addiu $a3, %lo(sTransitionFadeTimer) # addiu $a3, $a3, 0x31b0
/* 0C1D38 800C1138 44842000 */ mtc1 $a0, $f4
/* 0C1D3C 800C113C 94E20000 */ lhu $v0, ($a3)
/* 0C1D40 800C1140 3C03800E */ lui $v1, 0x800e
/* 0C1D44 800C1144 1840009B */ blez $v0, .L800C13B4
/* 0C1D48 800C1148 46802020 */ cvt.s.w $f0, $f4
/* 0C1D4C 800C114C 0082082A */ slt $at, $a0, $v0
/* 0C1D50 800C1150 10200034 */ beqz $at, .L800C1224
/* 0C1D54 800C1154 3C088013 */ lui $t0, %hi(D_8012A77C) # $t0, 0x8013
/* 0C1D58 800C1158 2508A77C */ addiu $t0, %lo(D_8012A77C) # addiu $t0, $t0, -0x5884
/* 0C1D5C 800C115C 8D050000 */ lw $a1, ($t0)
/* 0C1D60 800C1160 00001825 */ move $v1, $zero
/* 0C1D64 800C1164 18A0002A */ blez $a1, .L800C1210
/* 0C1D68 800C1168 3C0A8013 */ lui $t2, %hi(D_8012A774) # $t2, 0x8013
/* 0C1D6C 800C116C 3C098013 */ lui $t1, %hi(D_8012A770) # $t1, 0x8013
/* 0C1D70 800C1170 2529A770 */ addiu $t1, %lo(D_8012A770) # addiu $t1, $t1, -0x5890
/* 0C1D74 800C1174 00001025 */ move $v0, $zero
/* 0C1D78 800C1178 254AA774 */ addiu $t2, %lo(D_8012A774) # addiu $t2, $t2, -0x588c
.L800C117C:
/* 0C1D7C 800C117C 8D4F0000 */ lw $t7, ($t2)
/* 0C1D80 800C1180 8D2E0000 */ lw $t6, ($t1)
/* 0C1D84 800C1184 01E2C021 */ addu $t8, $t7, $v0
/* 0C1D88 800C1188 C7080000 */ lwc1 $f8, ($t8)
/* 0C1D8C 800C118C 01C23021 */ addu $a2, $t6, $v0
/* 0C1D90 800C1190 46080282 */ mul.s $f10, $f0, $f8
/* 0C1D94 800C1194 C4C60000 */ lwc1 $f6, ($a2)
/* 0C1D98 800C1198 24630001 */ addiu $v1, $v1, 1
/* 0C1D9C 800C119C 460A3400 */ add.s $f16, $f6, $f10
/* 0C1DA0 800C11A0 E4D00000 */ swc1 $f16, ($a2)
/* 0C1DA4 800C11A4 8D4B0000 */ lw $t3, ($t2)
/* 0C1DA8 800C11A8 8D390000 */ lw $t9, ($t1)
/* 0C1DAC 800C11AC 01626021 */ addu $t4, $t3, $v0
/* 0C1DB0 800C11B0 C5840004 */ lwc1 $f4, 4($t4)
/* 0C1DB4 800C11B4 03223021 */ addu $a2, $t9, $v0
/* 0C1DB8 800C11B8 46040202 */ mul.s $f8, $f0, $f4
/* 0C1DBC 800C11BC C4D20004 */ lwc1 $f18, 4($a2)
/* 0C1DC0 800C11C0 00000000 */ nop
/* 0C1DC4 800C11C4 46089180 */ add.s $f6, $f18, $f8
/* 0C1DC8 800C11C8 E4C60004 */ swc1 $f6, 4($a2)
/* 0C1DCC 800C11CC 8D4E0000 */ lw $t6, ($t2)
/* 0C1DD0 800C11D0 8D2D0000 */ lw $t5, ($t1)
/* 0C1DD4 800C11D4 01C27821 */ addu $t7, $t6, $v0
/* 0C1DD8 800C11D8 C5F00008 */ lwc1 $f16, 8($t7)
/* 0C1DDC 800C11DC 01A23021 */ addu $a2, $t5, $v0
/* 0C1DE0 800C11E0 46100102 */ mul.s $f4, $f0, $f16
/* 0C1DE4 800C11E4 C4CA0008 */ lwc1 $f10, 8($a2)
/* 0C1DE8 800C11E8 2442000C */ addiu $v0, $v0, 0xc
/* 0C1DEC 800C11EC 46045480 */ add.s $f18, $f10, $f4
/* 0C1DF0 800C11F0 E4D20008 */ swc1 $f18, 8($a2)
/* 0C1DF4 800C11F4 8D050000 */ lw $a1, ($t0)
/* 0C1DF8 800C11F8 00000000 */ nop
/* 0C1DFC 800C11FC 0065082A */ slt $at, $v1, $a1
/* 0C1E00 800C1200 1420FFDE */ bnez $at, .L800C117C
/* 0C1E04 800C1204 00000000 */ nop
/* 0C1E08 800C1208 94E20000 */ lhu $v0, ($a3)
/* 0C1E0C 800C120C 00001825 */ move $v1, $zero
.L800C1210:
/* 0C1E10 800C1210 3C098013 */ lui $t1, %hi(D_8012A770) # $t1, 0x8013
/* 0C1E14 800C1214 0044C023 */ subu $t8, $v0, $a0
/* 0C1E18 800C1218 2529A770 */ addiu $t1, %lo(D_8012A770) # addiu $t1, $t1, -0x5890
/* 0C1E1C 800C121C 10000026 */ b .L800C12B8
/* 0C1E20 800C1220 A4F80000 */ sh $t8, ($a3)
.L800C1224:
/* 0C1E24 800C1224 3C088013 */ lui $t0, %hi(D_8012A77C) # $t0, 0x8013
/* 0C1E28 800C1228 2508A77C */ addiu $t0, %lo(D_8012A77C) # addiu $t0, $t0, -0x5884
/* 0C1E2C 800C122C 8D050000 */ lw $a1, ($t0)
/* 0C1E30 800C1230 00001825 */ move $v1, $zero
/* 0C1E34 800C1234 18A0001D */ blez $a1, .L800C12AC
/* 0C1E38 800C1238 3C098013 */ lui $t1, %hi(D_8012A770) # $t1, 0x8013
/* 0C1E3C 800C123C 3C048013 */ lui $a0, %hi(D_8012A778) # $a0, 0x8013
/* 0C1E40 800C1240 2484A778 */ addiu $a0, %lo(D_8012A778) # addiu $a0, $a0, -0x5888
/* 0C1E44 800C1244 2529A770 */ addiu $t1, %lo(D_8012A770) # addiu $t1, $t1, -0x5890
/* 0C1E48 800C1248 00001025 */ move $v0, $zero
.L800C124C:
/* 0C1E4C 800C124C 8C990000 */ lw $t9, ($a0)
/* 0C1E50 800C1250 8D2C0000 */ lw $t4, ($t1)
/* 0C1E54 800C1254 03225821 */ addu $t3, $t9, $v0
/* 0C1E58 800C1258 C5680000 */ lwc1 $f8, ($t3)
/* 0C1E5C 800C125C 01826821 */ addu $t5, $t4, $v0
/* 0C1E60 800C1260 E5A80000 */ swc1 $f8, ($t5)
/* 0C1E64 800C1264 8C8E0000 */ lw $t6, ($a0)
/* 0C1E68 800C1268 8D380000 */ lw $t8, ($t1)
/* 0C1E6C 800C126C 01C27821 */ addu $t7, $t6, $v0
/* 0C1E70 800C1270 C5E60004 */ lwc1 $f6, 4($t7)
/* 0C1E74 800C1274 0302C821 */ addu $t9, $t8, $v0
/* 0C1E78 800C1278 E7260004 */ swc1 $f6, 4($t9)
/* 0C1E7C 800C127C 8C8B0000 */ lw $t3, ($a0)
/* 0C1E80 800C1280 8D2D0000 */ lw $t5, ($t1)
/* 0C1E84 800C1284 01626021 */ addu $t4, $t3, $v0
/* 0C1E88 800C1288 C5900008 */ lwc1 $f16, 8($t4)
/* 0C1E8C 800C128C 01A27021 */ addu $t6, $t5, $v0
/* 0C1E90 800C1290 E5D00008 */ swc1 $f16, 8($t6)
/* 0C1E94 800C1294 8D050000 */ lw $a1, ($t0)
/* 0C1E98 800C1298 24630001 */ addiu $v1, $v1, 1
/* 0C1E9C 800C129C 0065082A */ slt $at, $v1, $a1
/* 0C1EA0 800C12A0 1420FFEA */ bnez $at, .L800C124C
/* 0C1EA4 800C12A4 2442000C */ addiu $v0, $v0, 0xc
/* 0C1EA8 800C12A8 00001825 */ move $v1, $zero
.L800C12AC:
/* 0C1EAC 800C12AC 3C098013 */ lui $t1, %hi(D_8012A770) # $t1, 0x8013
/* 0C1EB0 800C12B0 2529A770 */ addiu $t1, %lo(D_8012A770) # addiu $t1, $t1, -0x5890
/* 0C1EB4 800C12B4 A4E00000 */ sh $zero, ($a3)
.L800C12B8:
/* 0C1EB8 800C12B8 18A00048 */ blez $a1, .L800C13DC
/* 0C1EBC 800C12BC 00001025 */ move $v0, $zero
/* 0C1EC0 800C12C0 3C06800E */ lui $a2, %hi(sTransitionTaskNum) # $a2, 0x800e
/* 0C1EC4 800C12C4 3C05800E */ lui $a1, %hi(sTransitionVtx) # $a1, 0x800e
/* 0C1EC8 800C12C8 24A531C0 */ addiu $a1, %lo(sTransitionVtx) # addiu $a1, $a1, 0x31c0
/* 0C1ECC 800C12CC 24C631D0 */ addiu $a2, %lo(sTransitionTaskNum) # addiu $a2, $a2, 0x31d0
/* 0C1ED0 800C12D0 00002025 */ move $a0, $zero
.L800C12D4:
/* 0C1ED4 800C12D4 4459F800 */ cfc1 $t9, $31
/* 0C1ED8 800C12D8 8D2F0000 */ lw $t7, ($t1)
/* 0C1EDC 800C12DC 37210003 */ ori $at, $t9, 3
/* 0C1EE0 800C12E0 38210002 */ xori $at, $at, 2
/* 0C1EE4 800C12E4 01E2C021 */ addu $t8, $t7, $v0
/* 0C1EE8 800C12E8 C70A0000 */ lwc1 $f10, ($t8)
/* 0C1EEC 800C12EC 44C1F800 */ ctc1 $at, $31
/* 0C1EF0 800C12F0 8CCC0000 */ lw $t4, ($a2)
/* 0C1EF4 800C12F4 46005124 */ cvt.w.s $f4, $f10
/* 0C1EF8 800C12F8 000C6880 */ sll $t5, $t4, 2
/* 0C1EFC 800C12FC 00AD7021 */ addu $t6, $a1, $t5
/* 0C1F00 800C1300 44D9F800 */ ctc1 $t9, $31
/* 0C1F04 800C1304 8DCF0000 */ lw $t7, ($t6)
/* 0C1F08 800C1308 440B2000 */ mfc1 $t3, $f4
/* 0C1F0C 800C130C 01E4C021 */ addu $t8, $t7, $a0
/* 0C1F10 800C1310 444DF800 */ cfc1 $t5, $31
/* 0C1F14 800C1314 A70B0000 */ sh $t3, ($t8)
/* 0C1F18 800C1318 8D390000 */ lw $t9, ($t1)
/* 0C1F1C 800C131C 35A10003 */ ori $at, $t5, 3
/* 0C1F20 800C1320 38210002 */ xori $at, $at, 2
/* 0C1F24 800C1324 03226021 */ addu $t4, $t9, $v0
/* 0C1F28 800C1328 C5920004 */ lwc1 $f18, 4($t4)
/* 0C1F2C 800C132C 44C1F800 */ ctc1 $at, $31
/* 0C1F30 800C1330 8CCF0000 */ lw $t7, ($a2)
/* 0C1F34 800C1334 46009224 */ cvt.w.s $f8, $f18
/* 0C1F38 800C1338 000F5880 */ sll $t3, $t7, 2
/* 0C1F3C 800C133C 00ABC021 */ addu $t8, $a1, $t3
/* 0C1F40 800C1340 44CDF800 */ ctc1 $t5, $31
/* 0C1F44 800C1344 8F190000 */ lw $t9, ($t8)
/* 0C1F48 800C1348 440E4000 */ mfc1 $t6, $f8
/* 0C1F4C 800C134C 03246021 */ addu $t4, $t9, $a0
/* 0C1F50 800C1350 444BF800 */ cfc1 $t3, $31
/* 0C1F54 800C1354 A58E0002 */ sh $t6, 2($t4)
/* 0C1F58 800C1358 8D2D0000 */ lw $t5, ($t1)
/* 0C1F5C 800C135C 35610003 */ ori $at, $t3, 3
/* 0C1F60 800C1360 8CD90000 */ lw $t9, ($a2)
/* 0C1F64 800C1364 38210002 */ xori $at, $at, 2
/* 0C1F68 800C1368 01A27821 */ addu $t7, $t5, $v0
/* 0C1F6C 800C136C C5E60008 */ lwc1 $f6, 8($t7)
/* 0C1F70 800C1370 44C1F800 */ ctc1 $at, $31
/* 0C1F74 800C1374 00197080 */ sll $t6, $t9, 2
/* 0C1F78 800C1378 46003424 */ cvt.w.s $f16, $f6
/* 0C1F7C 800C137C 00AE6021 */ addu $t4, $a1, $t6
/* 0C1F80 800C1380 8D8D0000 */ lw $t5, ($t4)
/* 0C1F84 800C1384 44188000 */ mfc1 $t8, $f16
/* 0C1F88 800C1388 01A47821 */ addu $t7, $t5, $a0
/* 0C1F8C 800C138C 44CBF800 */ ctc1 $t3, $31
/* 0C1F90 800C1390 A1F80009 */ sb $t8, 9($t7)
/* 0C1F94 800C1394 8D0B0000 */ lw $t3, ($t0)
/* 0C1F98 800C1398 24630001 */ addiu $v1, $v1, 1
/* 0C1F9C 800C139C 006B082A */ slt $at, $v1, $t3
/* 0C1FA0 800C13A0 2484000A */ addiu $a0, $a0, 0xa
/* 0C1FA4 800C13A4 1420FFCB */ bnez $at, .L800C12D4
/* 0C1FA8 800C13A8 2442000C */ addiu $v0, $v0, 0xc
/* 0C1FAC 800C13AC 03E00008 */ jr $ra
/* 0C1FB0 800C13B0 00000000 */ nop
.L800C13B4:
/* 0C1FB4 800C13B4 246331B4 */ addiu $v1, $v1, %lo(sTransitionFlags)# 0x31b4
/* 0C1FB8 800C13B8 94620000 */ lhu $v0, ($v1)
/* 0C1FBC 800C13BC 3401FFFF */ li $at, 65535
/* 0C1FC0 800C13C0 10410006 */ beq $v0, $at, .L800C13DC
/* 0C1FC4 800C13C4 0082082A */ slt $at, $a0, $v0
/* 0C1FC8 800C13C8 10200003 */ beqz $at, .L800C13D8
/* 0C1FCC 800C13CC 0044C823 */ subu $t9, $v0, $a0
/* 0C1FD0 800C13D0 03E00008 */ jr $ra
/* 0C1FD4 800C13D4 A4790000 */ sh $t9, ($v1)
.L800C13D8:
/* 0C1FD8 800C13D8 A4600000 */ sh $zero, ($v1)
.L800C13DC:
/* 0C1FDC 800C13DC 03E00008 */ jr $ra
/* 0C1FE0 800C13E0 00000000 */ nop
-153
View File
@@ -1,153 +0,0 @@
glabel func_800337E4
/* 0343E4 800337E4 3C0A800E */ lui $t2, %hi(D_800DC968) # $t2, 0x800e
/* 0343E8 800337E8 254AC968 */ addiu $t2, %lo(D_800DC968) # addiu $t2, $t2, -0x3698
/* 0343EC 800337EC 8D4E0000 */ lw $t6, ($t2)
/* 0343F0 800337F0 24020001 */ li $v0, 1
/* 0343F4 800337F4 29C10002 */ slti $at, $t6, 2
/* 0343F8 800337F8 14200084 */ bnez $at, .L80033A0C
/* 0343FC 800337FC 24040014 */ li $a0, 20
/* 034400 80033800 3C0B800E */ lui $t3, %hi(D_800DC960) # $t3, 0x800e
/* 034404 80033804 256BC960 */ addiu $t3, %lo(D_800DC960) # addiu $t3, $t3, -0x36a0
/* 034408 80033808 240C00FF */ li $t4, 255
.L8003380C:
/* 03440C 8003380C 8D630000 */ lw $v1, ($t3)
/* 034410 80033810 00000000 */ nop
/* 034414 80033814 00642821 */ addu $a1, $v1, $a0
/* 034418 80033818 8CA60010 */ lw $a2, 0x10($a1)
/* 03441C 8003381C 00000000 */ nop
/* 034420 80033820 28C10002 */ slti $at, $a2, 2
/* 034424 80033824 14200074 */ bnez $at, .L800339F8
/* 034428 80033828 00000000 */ nop
/* 03442C 8003382C 8C670010 */ lw $a3, 0x10($v1)
/* 034430 80033830 8C690004 */ lw $t1, 4($v1)
/* 034434 80033834 00E6082A */ slt $at, $a3, $a2
/* 034438 80033838 1420002A */ bnez $at, .L800338E4
/* 03443C 8003383C 00077C00 */ sll $t7, $a3, 0x10
/* 034440 80033840 00067C00 */ sll $t7, $a2, 0x10
/* 034444 80033844 01E7001A */ div $zero, $t7, $a3
/* 034448 80033848 8CB80004 */ lw $t8, 4($a1)
/* 03444C 8003384C 14E00002 */ bnez $a3, .L80033858
/* 034450 80033850 00000000 */ nop
/* 034454 80033854 0007000D */ break 7
.L80033858:
/* 034458 80033858 2401FFFF */ li $at, -1
/* 03445C 8003385C 14E10004 */ bne $a3, $at, .L80033870
/* 034460 80033860 3C018000 */ lui $at, 0x8000
/* 034464 80033864 15E10002 */ bne $t7, $at, .L80033870
/* 034468 80033868 00000000 */ nop
/* 03446C 8003386C 0006000D */ break 6
.L80033870:
/* 034470 80033870 00004012 */ mflo $t0
/* 034474 80033874 00000000 */ nop
/* 034478 80033878 00000000 */ nop
/* 03447C 8003387C 03080019 */ multu $t8, $t0
/* 034480 80033880 0000C812 */ mflo $t9
/* 034484 80033884 00196C03 */ sra $t5, $t9, 0x10
/* 034488 80033888 012D7021 */ addu $t6, $t1, $t5
/* 03448C 8003388C AC6E0004 */ sw $t6, 4($v1)
/* 034490 80033890 8D630000 */ lw $v1, ($t3)
/* 034494 80033894 00000000 */ nop
/* 034498 80033898 0064C021 */ addu $t8, $v1, $a0
/* 03449C 8003389C 8F190008 */ lw $t9, 8($t8)
/* 0344A0 800338A0 8C6F0008 */ lw $t7, 8($v1)
/* 0344A4 800338A4 03280019 */ multu $t9, $t0
/* 0344A8 800338A8 00006812 */ mflo $t5
/* 0344AC 800338AC 000D7403 */ sra $t6, $t5, 0x10
/* 0344B0 800338B0 01EEC021 */ addu $t8, $t7, $t6
/* 0344B4 800338B4 AC780008 */ sw $t8, 8($v1)
/* 0344B8 800338B8 8D630000 */ lw $v1, ($t3)
/* 0344BC 800338BC 00000000 */ nop
/* 0344C0 800338C0 00646821 */ addu $t5, $v1, $a0
/* 0344C4 800338C4 8DAF000C */ lw $t7, 0xc($t5)
/* 0344C8 800338C8 8C79000C */ lw $t9, 0xc($v1)
/* 0344CC 800338CC 01E80019 */ multu $t7, $t0
/* 0344D0 800338D0 00007012 */ mflo $t6
/* 0344D4 800338D4 000EC403 */ sra $t8, $t6, 0x10
/* 0344D8 800338D8 03386821 */ addu $t5, $t9, $t8
/* 0344DC 800338DC 1000002E */ b .L80033998
/* 0344E0 800338E0 AC6D000C */ sw $t5, 0xc($v1)
.L800338E4:
/* 0344E4 800338E4 01E6001A */ div $zero, $t7, $a2
/* 0344E8 800338E8 8CAE0004 */ lw $t6, 4($a1)
/* 0344EC 800338EC 14C00002 */ bnez $a2, .L800338F8
/* 0344F0 800338F0 00000000 */ nop
/* 0344F4 800338F4 0007000D */ break 7
.L800338F8:
/* 0344F8 800338F8 2401FFFF */ li $at, -1
/* 0344FC 800338FC 14C10004 */ bne $a2, $at, .L80033910
/* 034500 80033900 3C018000 */ lui $at, 0x8000
/* 034504 80033904 15E10002 */ bne $t7, $at, .L80033910
/* 034508 80033908 00000000 */ nop
/* 03450C 8003390C 0006000D */ break 6
.L80033910:
/* 034510 80033910 00004012 */ mflo $t0
/* 034514 80033914 00000000 */ nop
/* 034518 80033918 00000000 */ nop
/* 03451C 8003391C 01280019 */ multu $t1, $t0
/* 034520 80033920 0000C812 */ mflo $t9
/* 034524 80033924 0019C403 */ sra $t8, $t9, 0x10
/* 034528 80033928 01D86821 */ addu $t5, $t6, $t8
/* 03452C 8003392C AC6D0004 */ sw $t5, 4($v1)
/* 034530 80033930 8D630000 */ lw $v1, ($t3)
/* 034534 80033934 00000000 */ nop
/* 034538 80033938 8C6E0008 */ lw $t6, 8($v1)
/* 03453C 8003393C 00647821 */ addu $t7, $v1, $a0
/* 034540 80033940 01C80019 */ multu $t6, $t0
/* 034544 80033944 8DF90008 */ lw $t9, 8($t7)
/* 034548 80033948 0000C012 */ mflo $t8
/* 03454C 8003394C 00186C03 */ sra $t5, $t8, 0x10
/* 034550 80033950 032D7821 */ addu $t7, $t9, $t5
/* 034554 80033954 AC6F0008 */ sw $t7, 8($v1)
/* 034558 80033958 8D630000 */ lw $v1, ($t3)
/* 03455C 8003395C 00000000 */ nop
/* 034560 80033960 8C79000C */ lw $t9, 0xc($v1)
/* 034564 80033964 00647021 */ addu $t6, $v1, $a0
/* 034568 80033968 03280019 */ multu $t9, $t0
/* 03456C 8003396C 8DD8000C */ lw $t8, 0xc($t6)
/* 034570 80033970 00006812 */ mflo $t5
/* 034574 80033974 000D7C03 */ sra $t7, $t5, 0x10
/* 034578 80033978 030F7021 */ addu $t6, $t8, $t7
/* 03457C 8003397C AC6E000C */ sw $t6, 0xc($v1)
/* 034580 80033980 8D630000 */ lw $v1, ($t3)
/* 034584 80033984 00000000 */ nop
/* 034588 80033988 0064C821 */ addu $t9, $v1, $a0
/* 03458C 8003398C 8F2D0010 */ lw $t5, 0x10($t9)
/* 034590 80033990 00000000 */ nop
/* 034594 80033994 AC6D0010 */ sw $t5, 0x10($v1)
.L80033998:
/* 034598 80033998 8D630000 */ lw $v1, ($t3)
/* 03459C 8003399C 00000000 */ nop
/* 0345A0 800339A0 8C780004 */ lw $t8, 4($v1)
/* 0345A4 800339A4 00000000 */ nop
/* 0345A8 800339A8 2B010100 */ slti $at, $t8, 0x100
/* 0345AC 800339AC 14200004 */ bnez $at, .L800339C0
/* 0345B0 800339B0 00000000 */ nop
/* 0345B4 800339B4 AC6C0004 */ sw $t4, 4($v1)
/* 0345B8 800339B8 8D630000 */ lw $v1, ($t3)
/* 0345BC 800339BC 00000000 */ nop
.L800339C0:
/* 0345C0 800339C0 8C6F0008 */ lw $t7, 8($v1)
/* 0345C4 800339C4 00000000 */ nop
/* 0345C8 800339C8 29E10100 */ slti $at, $t7, 0x100
/* 0345CC 800339CC 14200004 */ bnez $at, .L800339E0
/* 0345D0 800339D0 00000000 */ nop
/* 0345D4 800339D4 AC6C0008 */ sw $t4, 8($v1)
/* 0345D8 800339D8 8D630000 */ lw $v1, ($t3)
/* 0345DC 800339DC 00000000 */ nop
.L800339E0:
/* 0345E0 800339E0 8C6E000C */ lw $t6, 0xc($v1)
/* 0345E4 800339E4 00000000 */ nop
/* 0345E8 800339E8 29C10100 */ slti $at, $t6, 0x100
/* 0345EC 800339EC 14200002 */ bnez $at, .L800339F8
/* 0345F0 800339F0 00000000 */ nop
/* 0345F4 800339F4 AC6C000C */ sw $t4, 0xc($v1)
.L800339F8:
/* 0345F8 800339F8 8D590000 */ lw $t9, ($t2)
/* 0345FC 800339FC 24420001 */ addiu $v0, $v0, 1
/* 034600 80033A00 0059082A */ slt $at, $v0, $t9
/* 034604 80033A04 1420FF81 */ bnez $at, .L8003380C
/* 034608 80033A08 24840014 */ addiu $a0, $a0, 0x14
.L80033A0C:
/* 03460C 80033A0C 03E00008 */ jr $ra
/* 034610 80033A10 00000000 */ nop
-65
View File
@@ -1,65 +0,0 @@
glabel setup_lights
/* 0327B8 80031BB8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0327BC 80031BBC AFBF0014 */ sw $ra, 0x14($sp)
/* 0327C0 80031BC0 0C00C6D8 */ jal free_lights
/* 0327C4 80031BC4 AFA40018 */ sw $a0, 0x18($sp)
/* 0327C8 80031BC8 8FAE0018 */ lw $t6, 0x18($sp)
/* 0327CC 80031BCC 3C06800E */ lui $a2, %hi(gMaxLights) # $a2, 0x800e
/* 0327D0 80031BD0 000E7880 */ sll $t7, $t6, 2
/* 0327D4 80031BD4 01EE7823 */ subu $t7, $t7, $t6
/* 0327D8 80031BD8 000F7880 */ sll $t7, $t7, 2
/* 0327DC 80031BDC 01EE7823 */ subu $t7, $t7, $t6
/* 0327E0 80031BE0 000F7880 */ sll $t7, $t7, 2
/* 0327E4 80031BE4 24C6C958 */ addiu $a2, %lo(gMaxLights) # addiu $a2, $a2, -0x36a8
/* 0327E8 80031BE8 3C05FF00 */ lui $a1, (0xFF00FFFF >> 16) # lui $a1, 0xff00
/* 0327EC 80031BEC 01EE7823 */ subu $t7, $t7, $t6
/* 0327F0 80031BF0 000F2080 */ sll $a0, $t7, 2
/* 0327F4 80031BF4 34A5FFFF */ ori $a1, (0xFF00FFFF & 0xFFFF) # ori $a1, $a1, 0xffff
/* 0327F8 80031BF8 0C01C327 */ jal allocate_from_main_pool_safe
/* 0327FC 80031BFC ACCE0000 */ sw $t6, ($a2)
/* 032800 80031C00 3C06800E */ lui $a2, %hi(gMaxLights) # $a2, 0x800e
/* 032804 80031C04 24C6C958 */ addiu $a2, %lo(gMaxLights) # addiu $a2, $a2, -0x36a8
/* 032808 80031C08 8CC80000 */ lw $t0, ($a2)
/* 03280C 80031C0C 3C05800E */ lui $a1, %hi(D_800DC954) # $a1, 0x800e
/* 032810 80031C10 00085900 */ sll $t3, $t0, 4
/* 032814 80031C14 0008C080 */ sll $t8, $t0, 2
/* 032818 80031C18 01685821 */ addu $t3, $t3, $t0
/* 03281C 80031C1C 0058C821 */ addu $t9, $v0, $t8
/* 032820 80031C20 000B58C0 */ sll $t3, $t3, 3
/* 032824 80031C24 00087080 */ sll $t6, $t0, 2
/* 032828 80031C28 3C07800E */ lui $a3, %hi(gActiveLights) # $a3, 0x800e
/* 03282C 80031C2C 3C09800E */ lui $t1, %hi(D_800DC960) # $t1, 0x800e
/* 032830 80031C30 032B6021 */ addu $t4, $t9, $t3
/* 032834 80031C34 01C87021 */ addu $t6, $t6, $t0
/* 032838 80031C38 2529C960 */ addiu $t1, %lo(D_800DC960) # addiu $t1, $t1, -0x36a0
/* 03283C 80031C3C 24E7C950 */ addiu $a3, %lo(gActiveLights) # addiu $a3, $a3, -0x36b0
/* 032840 80031C40 24A5C954 */ addiu $a1, %lo(D_800DC954) # addiu $a1, $a1, -0x36ac
/* 032844 80031C44 000E7080 */ sll $t6, $t6, 2
/* 032848 80031C48 ACE20000 */ sw $v0, ($a3)
/* 03284C 80031C4C ACB90000 */ sw $t9, ($a1)
/* 032850 80031C50 AD2C0000 */ sw $t4, ($t1)
/* 032854 80031C54 018E7821 */ addu $t7, $t4, $t6
/* 032858 80031C58 3C01800E */ lui $at, %hi(D_800DC964) # $at, 0x800e
/* 03285C 80031C5C AC2FC964 */ sw $t7, %lo(D_800DC964)($at)
/* 032860 80031C60 1900000E */ blez $t0, .L80031C9C
/* 032864 80031C64 00001825 */ move $v1, $zero
/* 032868 80031C68 00001025 */ move $v0, $zero
/* 03286C 80031C6C 00002025 */ move $a0, $zero
.L80031C70:
/* 032870 80031C70 8CB80000 */ lw $t8, ($a1)
/* 032874 80031C74 8CEA0000 */ lw $t2, ($a3)
/* 032878 80031C78 0098C821 */ addu $t9, $a0, $t8
/* 03287C 80031C7C 01425821 */ addu $t3, $t2, $v0
/* 032880 80031C80 AD790000 */ sw $t9, ($t3)
/* 032884 80031C84 8CCC0000 */ lw $t4, ($a2)
/* 032888 80031C88 24630001 */ addiu $v1, $v1, 1
/* 03288C 80031C8C 006C082A */ slt $at, $v1, $t4
/* 032890 80031C90 24420004 */ addiu $v0, $v0, 4
/* 032894 80031C94 1420FFF6 */ bnez $at, .L80031C70
/* 032898 80031C98 24840088 */ addiu $a0, $a0, 0x88
.L80031C9C:
/* 03289C 80031C9C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0328A0 80031CA0 27BD0018 */ addiu $sp, $sp, 0x18
/* 0328A4 80031CA4 03E00008 */ jr $ra
/* 0328A8 80031CA8 00000000 */ nop
-90
View File
@@ -1,90 +0,0 @@
glabel func_800AC0C8
/* 0ACCC8 800AC0C8 3C098012 */ lui $t1, %hi(D_80127BB0) # $t1, 0x8012
/* 0ACCCC 800AC0CC 25297BB0 */ addiu $t1, %lo(D_80127BB0) # addiu $t1, $t1, 0x7bb0
/* 0ACCD0 800AC0D0 8D2E0000 */ lw $t6, ($t1)
/* 0ACCD4 800AC0D4 00803025 */ move $a2, $a0
/* 0ACCD8 800AC0D8 19C0004E */ blez $t6, .L800AC214
/* 0ACCDC 800AC0DC 00001025 */ move $v0, $zero
/* 0ACCE0 800AC0E0 3C0D8012 */ lui $t5, %hi(D_80127BB8) # $t5, 0x8012
/* 0ACCE4 800AC0E4 3C0C800E */ lui $t4, %hi(D_800E28D8) # $t4, 0x800e
/* 0ACCE8 800AC0E8 3C0A800E */ lui $t2, %hi(D_800E28D4) # $t2, 0x800e
/* 0ACCEC 800AC0EC 254A28D4 */ addiu $t2, %lo(D_800E28D4) # addiu $t2, $t2, 0x28d4
/* 0ACCF0 800AC0F0 258C28D8 */ addiu $t4, %lo(D_800E28D8) # addiu $t4, $t4, 0x28d8
/* 0ACCF4 800AC0F4 25AD7BB8 */ addiu $t5, %lo(D_80127BB8) # addiu $t5, $t5, 0x7bb8
/* 0ACCF8 800AC0F8 00002025 */ move $a0, $zero
/* 0ACCFC 800AC0FC 240B000C */ li $t3, 12
.L800AC100:
/* 0ACD00 800AC100 8D4F0000 */ lw $t7, ($t2)
/* 0ACD04 800AC104 8D8E0000 */ lw $t6, ($t4)
/* 0ACD08 800AC108 01E42821 */ addu $a1, $t7, $a0
/* 0ACD0C 800AC10C 90B8000F */ lbu $t8, 0xf($a1)
/* 0ACD10 800AC110 00000000 */ nop
/* 0ACD14 800AC114 030B0019 */ multu $t8, $t3
/* 0ACD18 800AC118 8DB8000C */ lw $t8, 0xc($t5)
/* 0ACD1C 800AC11C 0000C812 */ mflo $t9
/* 0ACD20 800AC120 032E1821 */ addu $v1, $t9, $t6
/* 0ACD24 800AC124 8C6F0000 */ lw $t7, ($v1)
/* 0ACD28 800AC128 0018C840 */ sll $t9, $t8, 1
/* 0ACD2C 800AC12C 01F97021 */ addu $t6, $t7, $t9
/* 0ACD30 800AC130 01C60019 */ multu $t6, $a2
/* 0ACD34 800AC134 8CB90000 */ lw $t9, ($a1)
/* 0ACD38 800AC138 0000C012 */ mflo $t8
/* 0ACD3C 800AC13C 00187843 */ sra $t7, $t8, 1
/* 0ACD40 800AC140 8D980018 */ lw $t8, 0x18($t4)
/* 0ACD44 800AC144 032F7021 */ addu $t6, $t9, $t7
/* 0ACD48 800AC148 01D8C824 */ and $t9, $t6, $t8
/* 0ACD4C 800AC14C ACB90000 */ sw $t9, ($a1)
/* 0ACD50 800AC150 8D4F0000 */ lw $t7, ($t2)
/* 0ACD54 800AC154 8DB80018 */ lw $t8, 0x18($t5)
/* 0ACD58 800AC158 8C6E0004 */ lw $t6, 4($v1)
/* 0ACD5C 800AC15C 01E42821 */ addu $a1, $t7, $a0
/* 0ACD60 800AC160 0018C840 */ sll $t9, $t8, 1
/* 0ACD64 800AC164 01D97821 */ addu $t7, $t6, $t9
/* 0ACD68 800AC168 01E60019 */ multu $t7, $a2
/* 0ACD6C 800AC16C 8CB90004 */ lw $t9, 4($a1)
/* 0ACD70 800AC170 0000C012 */ mflo $t8
/* 0ACD74 800AC174 00187043 */ sra $t6, $t8, 1
/* 0ACD78 800AC178 8D98001C */ lw $t8, 0x1c($t4)
/* 0ACD7C 800AC17C 032E7821 */ addu $t7, $t9, $t6
/* 0ACD80 800AC180 01F8C824 */ and $t9, $t7, $t8
/* 0ACD84 800AC184 ACB90004 */ sw $t9, 4($a1)
/* 0ACD88 800AC188 8D4E0000 */ lw $t6, ($t2)
/* 0ACD8C 800AC18C 8DB80024 */ lw $t8, 0x24($t5)
/* 0ACD90 800AC190 8C6F0008 */ lw $t7, 8($v1)
/* 0ACD94 800AC194 01C42821 */ addu $a1, $t6, $a0
/* 0ACD98 800AC198 0018C840 */ sll $t9, $t8, 1
/* 0ACD9C 800AC19C 01F97021 */ addu $t6, $t7, $t9
/* 0ACDA0 800AC1A0 01C60019 */ multu $t6, $a2
/* 0ACDA4 800AC1A4 8CB90008 */ lw $t9, 8($a1)
/* 0ACDA8 800AC1A8 0000C012 */ mflo $t8
/* 0ACDAC 800AC1AC 00187843 */ sra $t7, $t8, 1
/* 0ACDB0 800AC1B0 8D980020 */ lw $t8, 0x20($t4)
/* 0ACDB4 800AC1B4 032F7021 */ addu $t6, $t9, $t7
/* 0ACDB8 800AC1B8 01D8C824 */ and $t9, $t6, $t8
/* 0ACDBC 800AC1BC ACB90008 */ sw $t9, 8($a1)
/* 0ACDC0 800AC1C0 8D4F0000 */ lw $t7, ($t2)
/* 0ACDC4 800AC1C4 00000000 */ nop
/* 0ACDC8 800AC1C8 01E42821 */ addu $a1, $t7, $a0
/* 0ACDCC 800AC1CC 90AE000F */ lbu $t6, 0xf($a1)
/* 0ACDD0 800AC1D0 00000000 */ nop
/* 0ACDD4 800AC1D4 25D80001 */ addiu $t8, $t6, 1
/* 0ACDD8 800AC1D8 A0B8000F */ sb $t8, 0xf($a1)
/* 0ACDDC 800AC1DC 8D590000 */ lw $t9, ($t2)
/* 0ACDE0 800AC1E0 8D880004 */ lw $t0, 4($t4)
/* 0ACDE4 800AC1E4 03242821 */ addu $a1, $t9, $a0
/* 0ACDE8 800AC1E8 90A7000F */ lbu $a3, 0xf($a1)
/* 0ACDEC 800AC1EC 00000000 */ nop
/* 0ACDF0 800AC1F0 00E8082A */ slt $at, $a3, $t0
/* 0ACDF4 800AC1F4 14200002 */ bnez $at, .L800AC200
/* 0ACDF8 800AC1F8 00E87823 */ subu $t7, $a3, $t0
/* 0ACDFC 800AC1FC A0AF000F */ sb $t7, 0xf($a1)
.L800AC200:
/* 0ACE00 800AC200 8D2E0000 */ lw $t6, ($t1)
/* 0ACE04 800AC204 24420001 */ addiu $v0, $v0, 1
/* 0ACE08 800AC208 004E082A */ slt $at, $v0, $t6
/* 0ACE0C 800AC20C 1420FFBC */ bnez $at, .L800AC100
/* 0ACE10 800AC210 24840010 */ addiu $a0, $a0, 0x10
.L800AC214:
/* 0ACE14 800AC214 03E00008 */ jr $ra
/* 0ACE18 800AC218 00000000 */ nop
-106
View File
@@ -1,106 +0,0 @@
glabel func_800AC8A8
/* 0AD4A8 800AC8A8 3C05800E */ lui $a1, %hi(D_800E2A80) # $a1, 0x800e
/* 0AD4AC 800AC8AC 24A52A80 */ addiu $a1, %lo(D_800E2A80) # addiu $a1, $a1, 0x2a80
/* 0AD4B0 800AC8B0 ACA40000 */ sw $a0, ($a1)
/* 0AD4B4 800AC8B4 3C01800E */ lui $at, %hi(D_800E2A84) # $at, 0x800e
/* 0AD4B8 800AC8B8 AC202A84 */ sw $zero, %lo(D_800E2A84)($at)
/* 0AD4BC 800AC8BC 8CAE0000 */ lw $t6, ($a1)
/* 0AD4C0 800AC8C0 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 0AD4C4 800AC8C4 AFBF0014 */ sw $ra, 0x14($sp)
/* 0AD4C8 800AC8C8 8DC3003C */ lw $v1, 0x3c($t6)
/* 0AD4CC 800AC8CC 24060001 */ li $a2, 1
/* 0AD4D0 800AC8D0 9062000C */ lbu $v0, 0xc($v1)
/* 0AD4D4 800AC8D4 3C058012 */ lui $a1, %hi(D_80127C30) # $a1, 0x8012
/* 0AD4D8 800AC8D8 1046000A */ beq $v0, $a2, .L800AC904
/* 0AD4DC 800AC8DC 24A57C30 */ addiu $a1, %lo(D_80127C30) # addiu $a1, $a1, 0x7c30
/* 0AD4E0 800AC8E0 24010002 */ li $at, 2
/* 0AD4E4 800AC8E4 1041000C */ beq $v0, $at, .L800AC918
/* 0AD4E8 800AC8E8 3C18800E */ lui $t8, %hi(D_800E29E0) # $t8, 0x800e
/* 0AD4EC 800AC8EC 24010003 */ li $at, 3
/* 0AD4F0 800AC8F0 1041000D */ beq $v0, $at, .L800AC928
/* 0AD4F4 800AC8F4 3C19800E */ lui $t9, %hi(D_800E2A30) # $t9, 0x800e
/* 0AD4F8 800AC8F8 3C018012 */ lui $at, %hi(D_80127C24) # $at, 0x8012
/* 0AD4FC 800AC8FC 1000000D */ b .L800AC934
/* 0AD500 800AC900 AC207C24 */ sw $zero, %lo(D_80127C24)($at)
.L800AC904:
/* 0AD504 800AC904 3C0F800E */ lui $t7, %hi(D_800E29A0) # $t7, 0x800e
/* 0AD508 800AC908 25EF29A0 */ addiu $t7, %lo(D_800E29A0) # addiu $t7, $t7, 0x29a0
/* 0AD50C 800AC90C 3C018012 */ lui $at, %hi(D_80127C24) # $at, 0x8012
/* 0AD510 800AC910 10000008 */ b .L800AC934
/* 0AD514 800AC914 AC2F7C24 */ sw $t7, %lo(D_80127C24)($at)
.L800AC918:
/* 0AD518 800AC918 271829E0 */ addiu $t8, %lo(D_800E29E0) # addiu $t8, $t8, 0x29e0
/* 0AD51C 800AC91C 3C018012 */ lui $at, %hi(D_80127C24) # $at, 0x8012
/* 0AD520 800AC920 10000004 */ b .L800AC934
/* 0AD524 800AC924 AC387C24 */ sw $t8, %lo(D_80127C24)($at)
.L800AC928:
/* 0AD528 800AC928 27392A30 */ addiu $t9, %lo(D_800E2A30) # addiu $t9, $t9, 0x2a30
/* 0AD52C 800AC92C 3C018012 */ lui $at, %hi(D_80127C24) # $at, 0x8012
/* 0AD530 800AC930 AC397C24 */ sw $t9, %lo(D_80127C24)($at)
.L800AC934:
/* 0AD534 800AC934 9062000D */ lbu $v0, 0xd($v1)
/* 0AD538 800AC938 44800000 */ mtc1 $zero, $f0
/* 0AD53C 800AC93C 1046000A */ beq $v0, $a2, .L800AC968
/* 0AD540 800AC940 27A4001C */ addiu $a0, $sp, 0x1c
/* 0AD544 800AC944 24010002 */ li $at, 2
/* 0AD548 800AC948 1041000C */ beq $v0, $at, .L800AC97C
/* 0AD54C 800AC94C 3C09800E */ lui $t1, %hi(D_800E29E0) # $t1, 0x800e
/* 0AD550 800AC950 24010003 */ li $at, 3
/* 0AD554 800AC954 1041000D */ beq $v0, $at, .L800AC98C
/* 0AD558 800AC958 3C0A800E */ lui $t2, %hi(D_800E2A30) # $t2, 0x800e
/* 0AD55C 800AC95C 3C018012 */ lui $at, %hi(D_80127C28) # $at, 0x8012
/* 0AD560 800AC960 1000000D */ b .L800AC998
/* 0AD564 800AC964 AC207C28 */ sw $zero, %lo(D_80127C28)($at)
.L800AC968:
/* 0AD568 800AC968 3C08800E */ lui $t0, %hi(D_800E29A0) # $t0, 0x800e
/* 0AD56C 800AC96C 250829A0 */ addiu $t0, %lo(D_800E29A0) # addiu $t0, $t0, 0x29a0
/* 0AD570 800AC970 3C018012 */ lui $at, %hi(D_80127C28) # $at, 0x8012
/* 0AD574 800AC974 10000008 */ b .L800AC998
/* 0AD578 800AC978 AC287C28 */ sw $t0, %lo(D_80127C28)($at)
.L800AC97C:
/* 0AD57C 800AC97C 252929E0 */ addiu $t1, %lo(D_800E29E0) # addiu $t1, $t1, 0x29e0
/* 0AD580 800AC980 3C018012 */ lui $at, %hi(D_80127C28) # $at, 0x8012
/* 0AD584 800AC984 10000004 */ b .L800AC998
/* 0AD588 800AC988 AC297C28 */ sw $t1, %lo(D_80127C28)($at)
.L800AC98C:
/* 0AD58C 800AC98C 254A2A30 */ addiu $t2, %lo(D_800E2A30) # addiu $t2, $t2, 0x2a30
/* 0AD590 800AC990 3C018012 */ lui $at, %hi(D_80127C28) # $at, 0x8012
/* 0AD594 800AC994 AC2A7C28 */ sw $t2, %lo(D_80127C28)($at)
.L800AC998:
/* 0AD598 800AC998 906B000E */ lbu $t3, 0xe($v1)
/* 0AD59C 800AC99C 3C0C800E */ lui $t4, %hi(D_800E2980) # $t4, 0x800e
/* 0AD5A0 800AC9A0 14CB0005 */ bne $a2, $t3, .L800AC9B8
/* 0AD5A4 800AC9A4 3C018012 */ lui $at, %hi(D_80127C2C) # $at, 0x8012
/* 0AD5A8 800AC9A8 258C2980 */ addiu $t4, %lo(D_800E2980) # addiu $t4, $t4, 0x2980
/* 0AD5AC 800AC9AC 3C018012 */ lui $at, %hi(D_80127C2C) # $at, 0x8012
/* 0AD5B0 800AC9B0 10000002 */ b .L800AC9BC
/* 0AD5B4 800AC9B4 AC2C7C2C */ sw $t4, %lo(D_80127C2C)($at)
.L800AC9B8:
/* 0AD5B8 800AC9B8 AC207C2C */ sw $zero, %lo(D_80127C2C)($at)
.L800AC9BC:
/* 0AD5BC 800AC9BC 846D000A */ lh $t5, 0xa($v1)
/* 0AD5C0 800AC9C0 3C01BF80 */ li $at, 0xBF800000 # -1.000000
/* 0AD5C4 800AC9C4 A7AD001C */ sh $t5, 0x1c($sp)
/* 0AD5C8 800AC9C8 846E0008 */ lh $t6, 8($v1)
/* 0AD5CC 800AC9CC 44812000 */ mtc1 $at, $f4
/* 0AD5D0 800AC9D0 A7A00020 */ sh $zero, 0x20($sp)
/* 0AD5D4 800AC9D4 E4A00000 */ swc1 $f0, ($a1)
/* 0AD5D8 800AC9D8 E4A00004 */ swc1 $f0, 4($a1)
/* 0AD5DC 800AC9DC A7AE001E */ sh $t6, 0x1e($sp)
/* 0AD5E0 800AC9E0 0C01C124 */ jal f32_vec3_apply_object_rotation3
/* 0AD5E4 800AC9E4 E4A40008 */ swc1 $f4, 8($a1)
/* 0AD5E8 800AC9E8 3C058012 */ lui $a1, %hi(D_80127C30) # $a1, 0x8012
/* 0AD5EC 800AC9EC 24A57C30 */ addiu $a1, %lo(D_80127C30) # addiu $a1, $a1, 0x7c30
/* 0AD5F0 800AC9F0 C4A60000 */ lwc1 $f6, ($a1)
/* 0AD5F4 800AC9F4 C4AA0004 */ lwc1 $f10, 4($a1)
/* 0AD5F8 800AC9F8 C4B20008 */ lwc1 $f18, 8($a1)
/* 0AD5FC 800AC9FC 8FBF0014 */ lw $ra, 0x14($sp)
/* 0AD600 800ACA00 46003207 */ neg.s $f8, $f6
/* 0AD604 800ACA04 46005407 */ neg.s $f16, $f10
/* 0AD608 800ACA08 46009107 */ neg.s $f4, $f18
/* 0AD60C 800ACA0C E4A80000 */ swc1 $f8, ($a1)
/* 0AD610 800ACA10 E4B00004 */ swc1 $f16, 4($a1)
/* 0AD614 800ACA14 E4A40008 */ swc1 $f4, 8($a1)
/* 0AD618 800ACA18 03E00008 */ jr $ra
/* 0AD61C 800ACA1C 27BD0028 */ addiu $sp, $sp, 0x28
-75
View File
@@ -1,75 +0,0 @@
glabel func_800AD030
/* 0ADC30 800AD030 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 0ADC34 800AD034 AFB60030 */ sw $s6, 0x30($sp)
/* 0ADC38 800AD038 3C16800E */ lui $s6, %hi(D_800E2A88) # $s6, 0x800e
/* 0ADC3C 800AD03C 26D62A88 */ addiu $s6, %lo(D_800E2A88) # addiu $s6, $s6, 0x2a88
/* 0ADC40 800AD040 AFB5002C */ sw $s5, 0x2c($sp)
/* 0ADC44 800AD044 8EC20000 */ lw $v0, ($s6)
/* 0ADC48 800AD048 3C15800E */ lui $s5, %hi(D_800E2A84) # $s5, 0x800e
/* 0ADC4C 800AD04C 26B52A84 */ addiu $s5, %lo(D_800E2A84) # addiu $s5, $s5, 0x2a84
/* 0ADC50 800AD050 AFB30024 */ sw $s3, 0x24($sp)
/* 0ADC54 800AD054 00809825 */ move $s3, $a0
/* 0ADC58 800AD058 AFBF0034 */ sw $ra, 0x34($sp)
/* 0ADC5C 800AD05C AFB40028 */ sw $s4, 0x28($sp)
/* 0ADC60 800AD060 AFB20020 */ sw $s2, 0x20($sp)
/* 0ADC64 800AD064 AFB1001C */ sw $s1, 0x1c($sp)
/* 0ADC68 800AD068 AFB00018 */ sw $s0, 0x18($sp)
/* 0ADC6C 800AD06C 1840002B */ blez $v0, .L800AD11C
/* 0ADC70 800AD070 AEA00000 */ sw $zero, ($s5)
/* 0ADC74 800AD074 3C0E800E */ lui $t6, %hi(D_800E2A80) # $t6, 0x800e
/* 0ADC78 800AD078 8DCE2A80 */ lw $t6, %lo(D_800E2A80)($t6)
/* 0ADC7C 800AD07C 00000000 */ nop
/* 0ADC80 800AD080 11C00027 */ beqz $t6, .L800AD120
/* 0ADC84 800AD084 8FBF0034 */ lw $ra, 0x34($sp)
/* 0ADC88 800AD088 18400024 */ blez $v0, .L800AD11C
/* 0ADC8C 800AD08C 00008825 */ move $s1, $zero
/* 0ADC90 800AD090 3C108012 */ lui $s0, %hi(D_80127C40) # $s0, 0x8012
/* 0ADC94 800AD094 26107C40 */ addiu $s0, %lo(D_80127C40) # addiu $s0, $s0, 0x7c40
/* 0ADC98 800AD098 24140001 */ li $s4, 1
.L800AD09C:
/* 0ADC9C 800AD09C 8E020000 */ lw $v0, ($s0)
/* 0ADCA0 800AD0A0 C664000C */ lwc1 $f4, 0xc($s3)
/* 0ADCA4 800AD0A4 C446000C */ lwc1 $f6, 0xc($v0)
/* 0ADCA8 800AD0A8 C6680010 */ lwc1 $f8, 0x10($s3)
/* 0ADCAC 800AD0AC 46062001 */ sub.s $f0, $f4, $f6
/* 0ADCB0 800AD0B0 C44A0010 */ lwc1 $f10, 0x10($v0)
/* 0ADCB4 800AD0B4 46000102 */ mul.s $f4, $f0, $f0
/* 0ADCB8 800AD0B8 460A4081 */ sub.s $f2, $f8, $f10
/* 0ADCBC 800AD0BC C6700014 */ lwc1 $f16, 0x14($s3)
/* 0ADCC0 800AD0C0 C4520014 */ lwc1 $f18, 0x14($v0)
/* 0ADCC4 800AD0C4 46021182 */ mul.s $f6, $f2, $f2
/* 0ADCC8 800AD0C8 46128381 */ sub.s $f14, $f16, $f18
/* 0ADCCC 800AD0CC 8C52003C */ lw $s2, 0x3c($v0)
/* 0ADCD0 800AD0D0 460E7282 */ mul.s $f10, $f14, $f14
/* 0ADCD4 800AD0D4 46062200 */ add.s $f8, $f4, $f6
/* 0ADCD8 800AD0D8 0C0326B4 */ jal sqrtf
/* 0ADCDC 800AD0DC 460A4300 */ add.s $f12, $f8, $f10
/* 0ADCE0 800AD0E0 864F0008 */ lh $t7, 8($s2)
/* 0ADCE4 800AD0E4 00000000 */ nop
/* 0ADCE8 800AD0E8 448F8000 */ mtc1 $t7, $f16
/* 0ADCEC 800AD0EC 00000000 */ nop
/* 0ADCF0 800AD0F0 468084A0 */ cvt.s.w $f18, $f16
/* 0ADCF4 800AD0F4 4612003C */ c.lt.s $f0, $f18
/* 0ADCF8 800AD0F8 00000000 */ nop
/* 0ADCFC 800AD0FC 45000002 */ bc1f .L800AD108
/* 0ADD00 800AD100 00000000 */ nop
/* 0ADD04 800AD104 AEB40000 */ sw $s4, ($s5)
.L800AD108:
/* 0ADD08 800AD108 8ED80000 */ lw $t8, ($s6)
/* 0ADD0C 800AD10C 26310001 */ addiu $s1, $s1, 1
/* 0ADD10 800AD110 0238082A */ slt $at, $s1, $t8
/* 0ADD14 800AD114 1420FFE1 */ bnez $at, .L800AD09C
/* 0ADD18 800AD118 26100004 */ addiu $s0, $s0, 4
.L800AD11C:
/* 0ADD1C 800AD11C 8FBF0034 */ lw $ra, 0x34($sp)
.L800AD120:
/* 0ADD20 800AD120 8FB00018 */ lw $s0, 0x18($sp)
/* 0ADD24 800AD124 8FB1001C */ lw $s1, 0x1c($sp)
/* 0ADD28 800AD128 8FB20020 */ lw $s2, 0x20($sp)
/* 0ADD2C 800AD12C 8FB30024 */ lw $s3, 0x24($sp)
/* 0ADD30 800AD130 8FB40028 */ lw $s4, 0x28($sp)
/* 0ADD34 800AD134 8FB5002C */ lw $s5, 0x2c($sp)
/* 0ADD38 800AD138 8FB60030 */ lw $s6, 0x30($sp)
/* 0ADD3C 800AD13C 03E00008 */ jr $ra
/* 0ADD40 800AD140 27BD0038 */ addiu $sp, $sp, 0x38
+20
View File
@@ -248,6 +248,20 @@ typedef struct LevelObjectEntry_Banana {
typedef struct LevelObjectEntry_RgbaLight {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ u8 unk8;
/* 0x09 */ u8 unk9;
/* 0x0A */ u8 unkA;
/* 0x0B */ u8 unkB;
/* 0x0C */ u8 unkC;
/* 0x0D */ u8 unkD;
/* 0x0E */ s16 unkE;
/* 0x10 */ s16 unk10;
/* 0x12 */ s16 unk12;
/* 0x14 */ s16 unk14;
/* 0x16 */ s16 unk16;
/* 0x18 */ s16 unk18;
/* 0x1A */ s16 unk1A;
/* 0x1C */ u8 unk1C;
} LevelObjectEntry_RgbaLight;
typedef struct LevelObjectEntry_Buoy_PirateShip {
@@ -295,6 +309,12 @@ typedef struct LevelObjectEntry_Bonus {
typedef struct LevelObjectEntry_LensFlare {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ s16 unk8;
/* 0x0A */ s16 unkA;
/* 0x0C */ u8 unkC;
/* 0x0D */ u8 unkD;
/* 0x0E */ u8 unkE;
/* 0x0F */ u8 unkF;
} LevelObjectEntry_LensFlare;
typedef struct LevelObjectEntry_LensFlareSwitch {
+13 -1
View File
@@ -1590,6 +1590,13 @@ typedef struct Object_64 {
};
} Object_64;
// Size: 0xC
typedef struct Object_68_38 {
/* 0x00 */ u8 *unk0;
/* 0x00 */ u8 pad4[4];
/* 0x08 */ s32 unk8;
} Object_68_38;
typedef struct Object_68 {
/* 0x00 */ union {
ObjectModel *objModel;
@@ -1608,9 +1615,14 @@ typedef struct Object_68 {
/* 0x21 */ s8 unk21;
/* 0x22 */ s16 unk22;
/* 0x24 */ s32 unk24;
/* 0x28 */ s32 unk28;
/* 0x28 */ s16 unk28;
/* 0x2A */ s16 unk2A;
/* 0x2C */ s32 unk2C;
/* 0x30 */ s32 unk30;
/* 0x34 */ u8 pad34[0x4];
/* 0x38 */ Object_68_38 *unk38[2]; //Array Size unknown
/* 0x40 */ u8 pad40[0x10];
/* 0x50 */ s16 unk50;
} Object_68;
/* Size: 0x20 bytes */
+40 -5
View File
@@ -22,7 +22,7 @@ u16 sTransitionFadeTimer = 0;
u16 sTransitionFlags = 0;
u16 D_800E31B8 = 0;
s8 D_800E31BC = 0;
VertexList *sTransitionVtx[2] = { NULL, NULL };
Vertex *sTransitionVtx[2] = { NULL, NULL };
TriangleList *sTransitionTris[2] = { NULL, NULL };
s32 sTransitionTaskNum = 0;
@@ -204,9 +204,9 @@ s32 D_8012A760;
s32 D_8012A764;
s32 D_8012A768;
s32 D_8012A76C;
s32 D_8012A770;
s32 D_8012A774;
s32 D_8012A778;
f32 *D_8012A770;
f32 *D_8012A774;
f32 *D_8012A778;
s32 D_8012A77C;
/*****************************/
@@ -461,7 +461,42 @@ void render_fade_fullscreen(Gfx **dList, UNUSED MatrixS **mats, UNUSED Vertex **
}
GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C0B00.s")
GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C1130.s")
void func_800C1130(s32 updateRate) {
s32 i;
f32 updateRateF;
updateRateF = (f32) updateRate;
if (sTransitionFadeTimer > 0) {
if (updateRate < sTransitionFadeTimer) {
for (i = 0; i < D_8012A77C; i++) {
D_8012A770[i*3] += updateRateF * D_8012A774[i*3];
D_8012A770[i*3 + 1] += updateRateF * D_8012A774[i*3 + 1];
D_8012A770[i*3 + 2] += updateRateF * D_8012A774[i*3 + 2];
}
sTransitionFadeTimer -= updateRate;
} else {
for (i = 0; i < D_8012A77C; i++) {
D_8012A770[i*3] = D_8012A778[i*3];
D_8012A770[i*3 + 1] = D_8012A778[i*3 + 1];
D_8012A770[i*3 + 2] = D_8012A778[i*3 + 2];
}
sTransitionFadeTimer = 0;
}
for (i = 0; i < D_8012A77C; i++) {
sTransitionVtx[sTransitionTaskNum][i].x = (s32)D_8012A770[i*3];
sTransitionVtx[sTransitionTaskNum][i].y = (s32)D_8012A770[i*3+1];
sTransitionVtx[sTransitionTaskNum][i].a = (s32)D_8012A770[i*3+2];
}
} else if (sTransitionFlags != 0xFFFF) {
if (updateRate < sTransitionFlags) {
sTransitionFlags -= updateRate;
}
else {
sTransitionFlags = 0;
}
}
}
/**
* Renders a transition effect on screen that will close in from both sides horizonally.
+1 -1
View File
@@ -59,9 +59,9 @@ void func_800C0834(s32 updateRate);
void func_800C27A0(s32 updateRate);
s32 transition_begin(FadeTransition *transition);
void render_fade_circle(Gfx **dList, MatrixS **mats, Vertex **verts);
void func_800C1130(s32 updateRate);
void render_fade_waves(Gfx **dlist, UNUSED MatrixS **mats, UNUSED Vertex **verts); //Non Matching
void func_800C1130(s32); //Non Matching
void func_800C1EE8(s32); //Non Matching
void func_800C0B00(FadeTransition *transition, s32, s32, s16*, s8*, s8*, s8*, s8*, s8*); //Non Matching
void func_800C15D4(FadeTransition *transition); //Non Matching
+43
View File
@@ -1127,7 +1127,50 @@ void func_800A277C(s32 arg0, Object* playerRacerObj, s32 updateRate) {
GLOBAL_ASM("asm/non_matchings/game_ui/func_800A277C.s")
#endif
#ifdef NON_EQUIVALENT
void func_800A36CC(u8 arg0, u8 arg1, u8 arg2, u8 arg3, u8 arg4) {
s32 var_a3;
s32 i;
u8 *temp_v0_2;
Object_68 **unk68;
Object *hud20;
if (is_in_time_trial()) {
hud20 = gAssetHudElements->entry[20];
if (hud20 != NULL) {
unk68 = hud20->unk68;
var_a3 = unk68[0]->unk28;
for (i = 0; i < var_a3; i++) {
temp_v0_2 = unk68[0]->unk38[i];
if (D_80126D66 == *temp_v0_2) {
*temp_v0_2 = arg0;
if (arg0 == 4) {
unk68[0]->unk38[i]->unk8 |= (0x800000 | 0x10000);
unk68[0]->unk50 = 1;
} else {
unk68[0]->unk38[i]->unk8 &= ~(0x800000 | 0x10000);
unk68[0]->unk50 = 0;
}
var_a3 = unk68[0]->unk28;
}
if (D_80126D65 == *temp_v0_2) {
*temp_v0_2 = arg1;
var_a3 = unk68[0]->unk28;
}
}
D_80126D66 = arg0;
D_80126D65 = arg1;
gStopwatchFaceID = arg2;
D_80126D69 = arg3;
D_80126D68 = arg4;
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/game_ui/func_800A36CC.s")
#endif
void func_800A3870(void) {
gCurrentHud->unk4C4 = 0x6490;
+107 -33
View File
@@ -7,6 +7,7 @@
#include "types.h"
#include "macros.h"
#include "objects.h"
#include "game.h"
/************ .data ************/
@@ -45,8 +46,6 @@ void free_lights(void) {
gMaxLights = 0;
}
// Regalloc issues
#ifdef NON_MATCHING
/**
* Official Name: setupLights
*/
@@ -60,18 +59,91 @@ void setup_lights(s32 count) {
temp_v0 = (ObjectLight **) allocate_from_main_pool_safe(gMaxLights * (sizeof(s32 *) + sizeof(ObjectLight) + sizeof(unk800DC960) + sizeof(Vec3f)), COLOUR_TAG_MAGENTA);
newCount = gMaxLights;
gActiveLights = temp_v0;
D_800DC954 = (ObjectLight *) &temp_v0[newCount];
D_800DC960 = (unk800DC960 *) &D_800DC954[newCount];
D_800DC964 = (Vec3f *) &D_800DC960[newCount];
D_800DC954 = newCount + (0, temp_v0); //fakematch
D_800DC960 = newCount + (0, D_800DC954); //fakematch
D_800DC964 = newCount + (0, D_800DC960); //fakematch
for (i = 0; i < gMaxLights; i++) {
gActiveLights[i] = &D_800DC954[i];
}
}
#else
GLOBAL_ASM("asm/non_matchings/lights/setup_lights.s")
#endif
#ifdef NON_EQUIVALENT
ObjectLight *func_80031CAC(Object *light, LevelObjectEntry_RgbaLight *lightEntry) {
s32 i;
ObjectLight *newLight;
LevelHeader_70 *test;
s32 temp_a0;
newLight = NULL;
if (gNumActiveLights < gMaxLights) {
newLight = gActiveLights[gNumActiveLights++];
newLight->unk0 = ((s32) (lightEntry->unk8 & 0xF0) >> 4);
newLight->type = lightEntry->unk8 & 0xF;
newLight->unk1 = ((s32) (lightEntry->unk9 & 0xE0) >> 5);
newLight->unk2 = lightEntry->unk9 & 0x1F;
newLight->enabled = TRUE;
newLight->owner = NULL;
newLight->homeX = 0;
newLight->homeY = 0;
newLight->homeZ = 0;
if (light != NULL) {
newLight->x = light->segment.trans.x_position;
newLight->y = light->segment.trans.y_position;
newLight->z = light->segment.trans.z_position;
} else {
newLight->x = (f32) lightEntry->common.x;
newLight->y = (f32) lightEntry->common.y;
newLight->z = (f32) lightEntry->common.z;
}
newLight->unk1C = lightEntry->unkA << 16;
newLight->unk2C = 0;
newLight->unk3C = 0;
newLight->unk20 = lightEntry->unkB << 16;
newLight->unk30 = 0;
newLight->unk3E = 0;
newLight->unk24 = lightEntry->unkC << 16;
newLight->unk34 = 0;
newLight->unk40 = 0;
newLight->unk28 = lightEntry->unkD << 16;
newLight->unk38 = 0;
newLight->unk42 = 0;
newLight->unk44 = NULL;
if (lightEntry->unk1C < 7) {
test = (LevelHeader_70 *) get_current_level_header()->unk74[lightEntry->unk1C];
if (((s32) test) != -1) {
newLight->unk44 = &test->unk4;
newLight->unk44 = &test->unk0;
newLight->unk4A = 0;
if (lightEntry && lightEntry && lightEntry) {}
newLight->unk4C = 0;
newLight->unk4E = 0;
newLight->unk48 = (u16) &test->red2;
temp_a0 = (u16) &test->red2;
for (i = 0; i < temp_a0; ) {
newLight->unk4E += test->unk18[i++].unk0;
}
}
}
newLight->radius = lightEntry->unkE;
newLight->unk60 = lightEntry->unk10;
newLight->unk64 = lightEntry->unk12;
newLight->radiusSquare = newLight->radius * newLight->radius;
newLight->radiusMag = 1 / newLight->radius;
newLight->unk70 = lightEntry->unk14;
newLight->unk74 = lightEntry->unk18;
newLight->unk78 = (lightEntry->unk18) ? 0xFFFF : 0;
newLight->unk72 = lightEntry->unk16;
newLight->unk76 = lightEntry->unk1A;
newLight->unk7A = (lightEntry->unk1A) ? 0xFFFF : 0;
newLight->unk7A = 0;
newLight->unk5 = 1;
func_80032424(newLight, 0);
}
return newLight;
}
#else
GLOBAL_ASM("asm/non_matchings/lights/func_80031CAC.s")
#endif
/**
* Official Name: addObjectLight
@@ -387,43 +459,45 @@ void func_80032C7C(Object *object) {
GLOBAL_ASM("asm/non_matchings/lights/func_80032C7C.s")
#endif
#ifdef NON_EQUIVALENT
// Has regalloc issues
void func_800337E4(void) {
s32 temp_a2;
s32 index;
s32 temp_a3;
s32 temp_lo;
s32 i;
s32 temp;
unk800DC960 *temp_a1;
for (i = 1; i < D_800DC968; i++) {
if (D_800DC960[i].unk10 >= 2) {
if (D_800DC960[0].unk10 >= D_800DC960[i].unk10) {
temp = (D_800DC960[i].unk10 << 0x10);
temp /= D_800DC960[0].unk10;
D_800DC960[0].unk4 = D_800DC960[0].unk4 + ((D_800DC960[i].unk4 * temp) >> 0x10);
D_800DC960[0].unk8 = D_800DC960[0].unk8 + ((D_800DC960[i].unk8 * temp) >> 0x10);
D_800DC960[0].unkC = D_800DC960[0].unkC + ((D_800DC960[i].unkC * temp) >> 0x10);
index = i; // Needed?
if ((&D_800DC960[index])->unk10){} // Fakematch
temp_a1 = (0, D_800DC960) + index;
temp_a2 = temp_a1->unk10;
if (temp_a2 >= 2) {
temp_a3 = D_800DC960->unk10;
if (temp_a3 >= temp_a2) {
temp_lo = ((s32) (temp_a2 << 16)) / temp_a3;
D_800DC960->unk4 = D_800DC960->unk4 + (((s32) (temp_a1->unk4 * temp_lo)) >> 16);
D_800DC960->unk8 += ((s32) ((&D_800DC960[index])->unk8 * temp_lo)) >> 16;
D_800DC960->unkC += ((s32) ((&D_800DC960[index])->unkC * temp_lo)) >> 16;
} else {
temp = (D_800DC960[0].unk10 << 0x10);
temp /= D_800DC960[i].unk10;
D_800DC960[0].unk4 = D_800DC960[i].unk4 + ((D_800DC960[0].unk4 * temp) >> 0x10);
D_800DC960[0].unk8 = D_800DC960[i].unk8 + ((D_800DC960[0].unk8 * temp) >> 0x10);
D_800DC960[0].unkC = D_800DC960[i].unkC + ((D_800DC960[0].unkC * temp) >> 0x10);
D_800DC960[0].unk10 = D_800DC960[i].unk10;
temp_lo = ((s32) (temp_a3 << 16)) / temp_a2;
D_800DC960->unk4 = temp_a1->unk4 + (((s32) (D_800DC960->unk4 * temp_lo)) >> 16);
D_800DC960->unk8 = (&D_800DC960[index])->unk8 + (((s32) ((D_800DC960->unk8 * temp_lo) ^ 0)) >> 16);
D_800DC960->unkC = (&D_800DC960[index])->unkC + (((s32) (D_800DC960->unkC * temp_lo)) >> 16);
D_800DC960->unk10 = (&D_800DC960[index])->unk10;
}
if (D_800DC960[0].unk4 >= 0x100) {
D_800DC960[0].unk4 = 0xFF;
if (D_800DC960->unk4 >= 256) {
D_800DC960->unk4 = 255;
}
if (D_800DC960[0].unk8 >= 0x100) {
D_800DC960[0].unk8 = 0xFF;
if (D_800DC960->unk8 >= 256) {
D_800DC960->unk8 = 255;
}
if (D_800DC960[0].unkC >= 0x100) {
D_800DC960[0].unkC = 0xFF;
if (D_800DC960->unkC >= 256) {
D_800DC960->unkC = 255;
}
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/lights/func_800337E4.s")
#endif
/**
* Official Name: lightDistanceCalc
+1 -1
View File
@@ -94,7 +94,7 @@ void func_80032BAC(ObjectLight *light);
s32 get_light_count(void);
f32 light_distance_calc(ObjectLight *light);
f32 light_direction_calc(ObjectLight *light);
Object_64 *func_80031CAC(Object *, LevelObjectEntry_RgbaLight *entry);
ObjectLight *func_80031CAC(Object *light, LevelObjectEntry_RgbaLight *lightEntry);
ObjectLight *add_object_light(Object *obj, ObjectHeader24 *arg1);
//Non Matching
-1
View File
@@ -186,7 +186,6 @@ void func_80028050(void);
void initialise_player_viewport_vars(s32);
void func_8002A31C(void);
void update_colour_cycle(LevelHeader_70 *arg0, s32 arg1);
void func_800AD030(ObjectSegment*);
void func_800B9C18(s32);
void func_800BA8E4(Gfx**, MatrixS**, s32);
void func_8002DE30(Object*);
+111 -25
View File
@@ -27,8 +27,7 @@ unk800E2850 D_800E2850[3] = {
{ 0, 0x08, (TextureHeader *)2, 0xFE000000, 0xFE000000, 0xFE000000, 0x03FFFFFF, 0x03FFFFFF, 0x03FFFFFF, 4, 4, 8, 8 },
};
s32 *D_800E28D4 = 0;
unk800E28D4 *D_800E28D4 = NULL;
unk800E2850 D_800E28D8 = { NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
// Not sure about typing for the following.
@@ -82,8 +81,8 @@ unk800E2980 D_800E2A30[5] = {
{ 0, 0, 0, 0.0f, 0.0f },
};
s32 D_800E2A80 = 0;
s32 D_800E2A84 = 1;
Object *D_800E2A80 = NULL;
s32 D_800E2A84 = TRUE;
s32 D_800E2A88 = 0;
f32 D_800E2A8C = -200.0f;
f32 D_800E2A90 = 200.0f;
@@ -168,7 +167,7 @@ Matrix *D_80127C20;
s32 D_80127C24;
s32 D_80127C28;
Matrix *D_80127C2C;
s32 D_80127C30[4];
Vec3f D_80127C30;
Object *D_80127C40[16];
/******************************/
@@ -179,7 +178,7 @@ Object *D_80127C40[16];
void init_weather(void) {
D_800E28D8.unk0 = 0;
D_800E28D8.unk4 = 0;
D_800E28D4 = 0;
D_800E28D4 = NULL;
D_80127BB0 = 0;
D_80127C00 = 6;
D_80127C00 <<= 2;
@@ -189,8 +188,8 @@ void init_weather(void) {
D_800E290C = 0;
D_80127BF8.unk0 = -1;
D_80127BF8.unk2 = -0x200;
D_800E2A80 = 0;
D_800E2A84 = 1;
D_800E2A80 = NULL;
D_800E2A84 = TRUE;
D_800E2A88 = 0;
if (D_800E291C == NULL) {
D_800E291C = (s32 *)load_asset_section_from_rom(ASSET_WEATHER_PARTICLES);
@@ -247,8 +246,8 @@ void free_weather_memory(void) {
FREE_MEM(D_800E2910);
D_800E2A88 = 0;
D_800E2A80 = 0;
D_800E2A84 = 1;
D_800E2A80 = NULL;
D_800E2A84 = TRUE;
if (gWeatherType != WEATHER_SNOW) {
free_rain_memory();
}
@@ -334,7 +333,7 @@ void process_weather(Gfx **currDisplayList, MatrixS **currHudMat, Vertex **currH
D_80127BB4 = (D_80127BB0 * D_80127BB8[0]) >> (unused = 16);
D_80127BF8.unk4 = (D_80127BF8.unk0 + ((D_80127BF8.unk2 - D_80127BF8.unk0) * D_80127BB8[12])) >> (unused = 16);
func_800AC0C8(updateRate); // This is the snow physics that makes it move
func_800AC0C8(updateRate);
if ((D_80127BB4 > 0) && (D_80127BF8.unk4 < D_80127BF8.unk0)) {
D_800E2904 = D_800E2914[D_80127C08];
func_800AC21C(); // Both of these funcs are needed to render.
@@ -348,7 +347,23 @@ void process_weather(Gfx **currDisplayList, MatrixS **currHudMat, Vertex **currH
*currHudTris = gCurrWeatherTriList;
}
GLOBAL_ASM("asm/non_matchings/weather/func_800AC0C8.s")
// This is the snow physics that makes it move
void func_800AC0C8(s32 updateRate) {
unk800E2850_unk0* temp_v1;
s32 i;
for (i = 0; i < D_80127BB0; i++) {
temp_v1 = &D_800E28D8.unk0[D_800E28D4[i].unkF];
D_800E28D4[i].unk0 = ((((temp_v1->unk0 + (D_80127BB8[3] * 2)) * updateRate) >> 1) + D_800E28D4[i].unk0) & D_800E28D8.unk18;
D_800E28D4[i].unk4 = ((((temp_v1->unk4 + (D_80127BB8[6] * 2)) * updateRate) >> 1) + D_800E28D4[i].unk4) & D_800E28D8.unk1C;
D_800E28D4[i].unk8 = ((((temp_v1->unk8 + (D_80127BB8[9] * 2)) * updateRate) >> 1) + D_800E28D4[i].unk8) & D_800E28D8.unk20;
D_800E28D4[i].unkF++;
if (D_800E28D4[i].unkF >= D_800E28D8.unk4) {
D_800E28D4[i].unkF -= D_800E28D8.unk4;
}
}
}
GLOBAL_ASM("asm/non_matchings/weather/func_800AC21C.s")
/**
@@ -380,26 +395,78 @@ void render_falling_snow(void) {
}
}
// Unused
void func_800AC850(void) {
D_800E2A84 = 1;
UNUSED void func_800AC850(void) {
D_800E2A84 = TRUE;
}
// Unused
void func_800AC860(void) {
if (D_800E2A80 != 0) {
D_800E2A84 = 0;
UNUSED void func_800AC860(void) {
if (D_800E2A80 != NULL) {
D_800E2A84 = FALSE;
}
}
void func_800AC880(s32 arg0) {
if (arg0 == D_800E2A80) {
D_800E2A80 = 0;
D_800E2A84 = 1;
void func_800AC880(Object *obj) {
if (obj == D_800E2A80) {
D_800E2A80 = NULL;
D_800E2A84 = TRUE;
}
}
GLOBAL_ASM("asm/non_matchings/weather/func_800AC8A8.s")
void func_800AC8A8(Object *lensflareObj) {
LevelObjectEntry_LensFlare *entry;
Vec3s sp1C;
D_800E2A80 = lensflareObj;
D_800E2A84 = 0;
entry = &D_800E2A80->segment.level_entry->lensFlare;
switch (entry->unkC) {
default:
D_80127C24 = 0;
break;
case 1:
D_80127C24 = (s32) D_800E29A0;
break;
case 2:
D_80127C24 = (s32) D_800E29E0;
break;
case 3:
D_80127C24 = (s32) D_800E2A30;
break;
}
switch (entry->unkD) {
default:
D_80127C28 = 0;
break;
case 1:
D_80127C28 = (s32) D_800E29A0;
break;
case 2:
D_80127C28 = (s32) D_800E29E0;
break;
case 3:
D_80127C28 = (s32) D_800E2A30;
break;
}
if (entry->unkE == 1) {
D_80127C2C = (Matrix *) D_800E2980;
} else {
D_80127C2C = NULL;
}
sp1C.y_rotation = entry->unkA;
sp1C.x_rotation = entry->unk8;
sp1C.z_rotation = 0;
D_80127C30.x = 0;
D_80127C30.y = 0;
D_80127C30.z = -1.0f;
f32_vec3_apply_object_rotation3((ObjectTransform *) &sp1C, D_80127C30.f);
D_80127C30.x = -D_80127C30.x;
D_80127C30.y = -D_80127C30.y;
D_80127C30.z = -D_80127C30.z;
}
//https://decomp.me/scratch/mYuMJ
GLOBAL_ASM("asm/non_matchings/weather/func_800ACA20.s")
@@ -431,7 +498,26 @@ void func_800ACF98(Object* arg0) {
}
GLOBAL_ASM("asm/non_matchings/weather/func_800AD030.s")
void func_800AD030(ObjectSegment *cameraSegment) {
LevelObjectEntry_Weather *weather;
f32 xDiff;
f32 zDiff;
f32 yDiff;
s32 i;
D_800E2A84 = FALSE;
if (D_800E2A88 > 0 && D_800E2A80 != 0) {
if(D_80127C40[0]){} // Fakematch
for (i = 0; i < D_800E2A88; i++) {
xDiff = cameraSegment->trans.x_position - D_80127C40[i]->segment.trans.x_position;
yDiff = cameraSegment->trans.y_position - D_80127C40[i]->segment.trans.y_position;
zDiff = cameraSegment->trans.z_position - D_80127C40[i]->segment.trans.z_position;
weather = &D_80127C40[i]->segment.level_entry->weather;
if (sqrtf((xDiff * xDiff) + (yDiff * yDiff) + (zDiff * zDiff)) < weather->radius) {
D_800E2A84 = TRUE;
}
}
}
}
void func_800AD144(s32 arg0, s32 arg1) {
gLightningFrequency = arg0;
+11 -2
View File
@@ -81,10 +81,18 @@ typedef struct {
s32 unk4;
} unk80127BF8;
typedef struct unk800E28D4 {
s32 unk0;
s32 unk4;
s32 unk8;
u8 padC[3];
u8 unkF;
} unk800E28D4;
extern u32 osTvType;
void set_weather_limits(s16 arg0, s16 arg1);
void func_800AC880(s32 arg0);
void func_800AC880(Object *obj);
void cameraAddOverrideObject(Object *arg0);
void free_rain_memory(void);
void func_800AD2C4(s32 arg0, s32 arg1, f32 arg2);
@@ -98,11 +106,12 @@ void process_weather(Gfx **currDisplayList, MatrixS **currHudMat, Vertex **currH
void render_falling_snow(void);
void free_weather_memory(void);
void changeWeather(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5);
void func_800AD030(ObjectSegment *cameraSegment);
void func_800AC0C8(s32 updateRate);
s32 coss(s16);
s32 sins(s16);
void init_weather(void);
s32 func_800AC0C8(s32);
void f32_matrix_dot(Matrix *arg0, Matrix *arg1, Matrix *arg2);
void func_800AC21C(void);
void func_800AC8A8(Object *);