From db602828c3ca146f14191639dfef74366ec036f3 Mon Sep 17 00:00:00 2001 From: Ryan Myers Date: Sun, 2 Mar 2025 17:18:23 -0500 Subject: [PATCH] 4 More matches, and large struct changes (#469) * Match func_8005698C and fix func_8001B7A8 * Larger update to match func_80032424 and change a couple of structs * format * Fix many warnings * Matxh func_80014B50 * Format func_80014B50 * Racing Smokey! * Match func_80053750 * Update score * Fix some explicit casts --- README.md | 18 +- asm/non_matchings/lights/func_80032424.s | 516 ------------------- asm/non_matchings/objects/func_80014B50.s | 578 ---------------------- asm/non_matchings/racer/func_80053750.s | 519 ------------------- asm/non_matchings/racer/func_8005698C.s | 323 ------------ include/f3ddkr.h | 2 +- include/structs.h | 13 +- src/audio_vehicle.c | 10 +- src/camera.c | 117 +++-- src/game_ui.c | 32 +- src/lights.c | 162 +++++- src/lights.h | 27 +- src/math_util.c | 62 +-- src/math_util.h | 2 +- src/menu.c | 24 +- src/object_functions.c | 303 ++++++------ src/objects.c | 233 +++++++-- src/objects.h | 4 +- src/particles.c | 130 ++--- src/particles.h | 8 +- src/racer.c | 470 ++++++++++++------ src/racer.h | 4 +- src/tracks.c | 28 +- src/vehicle_bluey.c | 2 +- src/vehicle_bubbler.c | 2 +- src/vehicle_smokey.c | 2 +- src/vehicle_tricky.c | 2 +- src/vehicle_wizpig.c | 2 +- src/weather.c | 35 +- 29 files changed, 1081 insertions(+), 2549 deletions(-) delete mode 100644 asm/non_matchings/lights/func_80032424.s delete mode 100644 asm/non_matchings/objects/func_80014B50.s delete mode 100644 asm/non_matchings/racer/func_80053750.s delete mode 100644 asm/non_matchings/racer/func_8005698C.s diff --git a/README.md b/README.md index 6e479927..e8247417 100644 --- a/README.md +++ b/README.md @@ -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. -As of February 27, 2025, this is our current score: +As of March 2, 2025, this is our current score: -    Decomp progress: 71.03% +    Decomp progress: 71.83%     Documentation progress: 49.99% @@ -126,20 +126,20 @@ s32 is_drumstick_unlocked(void) { ``` -As of February 27th, 2025, this is our current score: +As of March 2nd, 2025, this is our current score: ``` =============================================== ADVENTURE ONE (ASM -> C Decompilation) - ---- 71.03% Complete (74.19% NON_MATCHING) ---- - # Decompiled functions: 1810 - # GLOBAL_ASM remaining: 131 + ---- 71.83% Complete (74.99% NON_MATCHING) ---- + # Decompiled functions: 1814 + # GLOBAL_ASM remaining: 127 # NON_MATCHING functions: 15 # NON_EQUIVALENT WIP functions: 44 ----------------- Game Status ----------------- - Balloons: 34/47, Keys: 4/4, Trophies: 3/5 + Balloons: 35/47, Keys: 4/4, Trophies: 3/5 T.T. Amulets: 3/4, Wizpig Amulets: 3/4 ----------------------------------------------- - We are racing in Haunted Woods. (Lap 3/3) + We are racing the dragon boss Smokey. (Lap 2/3) =============================================== ADVENTURE TWO (Cleanup & Documentation) --------------- 49.99% Complete --------------- @@ -149,7 +149,7 @@ As of February 27th, 2025, this is our current score: Balloons: 24/47, Keys: 3/4, Trophies: 2/5 T.T. Amulets: 2/4, Wizpig Amulets: 2/4 ----------------------------------------------- - We are racing in Pirate Lagoon. (Lap 3/3) + We are racing in Pirate Lagoon. (Lap 3/3) =============================================== ``` diff --git a/asm/non_matchings/lights/func_80032424.s b/asm/non_matchings/lights/func_80032424.s deleted file mode 100644 index afb2c89b..00000000 --- a/asm/non_matchings/lights/func_80032424.s +++ /dev/null @@ -1,516 +0,0 @@ -glabel func_80032424 -/* 033024 80032424 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 033028 80032428 AFBF001C */ sw $ra, 0x1c($sp) -/* 03302C 8003242C AFB00018 */ sw $s0, 0x18($sp) -/* 033030 80032430 8C87000C */ lw $a3, 0xc($a0) -/* 033034 80032434 00A08025 */ move $s0, $a1 -/* 033038 80032438 10E00022 */ beqz $a3, .L800324C4 -/* 03303C 8003243C 00803025 */ move $a2, $a0 -/* 033040 80032440 848E0006 */ lh $t6, 6($a0) -/* 033044 80032444 848F0008 */ lh $t7, 8($a0) -/* 033048 80032448 8498000A */ lh $t8, 0xa($a0) -/* 03304C 8003244C 448E2000 */ mtc1 $t6, $f4 -/* 033050 80032450 448F4000 */ mtc1 $t7, $f8 -/* 033054 80032454 44988000 */ mtc1 $t8, $f16 -/* 033058 80032458 468021A0 */ cvt.s.w $f6, $f4 -/* 03305C 8003245C 24C50010 */ addiu $a1, $a2, 0x10 -/* 033060 80032460 468042A0 */ cvt.s.w $f10, $f8 -/* 033064 80032464 E4860010 */ swc1 $f6, 0x10($a0) -/* 033068 80032468 468084A0 */ cvt.s.w $f18, $f16 -/* 03306C 8003246C E48A0014 */ swc1 $f10, 0x14($a0) -/* 033070 80032470 E4920018 */ swc1 $f18, 0x18($a0) -/* 033074 80032474 AFA60048 */ sw $a2, 0x48($sp) -/* 033078 80032478 0C01C0C8 */ jal f32_vec3_apply_object_rotation -/* 03307C 8003247C 00E02025 */ move $a0, $a3 -/* 033080 80032480 8FA60048 */ lw $a2, 0x48($sp) -/* 033084 80032484 240B0001 */ li $t3, 1 -/* 033088 80032488 8CC7000C */ lw $a3, 0xc($a2) -/* 03308C 8003248C C4C40010 */ lwc1 $f4, 0x10($a2) -/* 033090 80032490 C4E6000C */ lwc1 $f6, 0xc($a3) -/* 033094 80032494 C4CA0014 */ lwc1 $f10, 0x14($a2) -/* 033098 80032498 46062200 */ add.s $f8, $f4, $f6 -/* 03309C 8003249C C4C40018 */ lwc1 $f4, 0x18($a2) -/* 0330A0 800324A0 E4C80010 */ swc1 $f8, 0x10($a2) -/* 0330A4 800324A4 C4F00010 */ lwc1 $f16, 0x10($a3) -/* 0330A8 800324A8 00000000 */ nop -/* 0330AC 800324AC 46105480 */ add.s $f18, $f10, $f16 -/* 0330B0 800324B0 E4D20014 */ swc1 $f18, 0x14($a2) -/* 0330B4 800324B4 C4E60014 */ lwc1 $f6, 0x14($a3) -/* 0330B8 800324B8 A0CB0005 */ sb $t3, 5($a2) -/* 0330BC 800324BC 46062200 */ add.s $f8, $f4, $f6 -/* 0330C0 800324C0 E4C80018 */ swc1 $f8, 0x18($a2) -.L800324C4: -/* 0330C4 800324C4 8CC50044 */ lw $a1, 0x44($a2) -/* 0330C8 800324C8 240B0001 */ li $t3, 1 -/* 0330CC 800324CC 10A0006E */ beqz $a1, .L80032688 -/* 0330D0 800324D0 00000000 */ nop -/* 0330D4 800324D4 94D9004C */ lhu $t9, 0x4c($a2) -/* 0330D8 800324D8 94C2004A */ lhu $v0, 0x4a($a2) -/* 0330DC 800324DC 03306021 */ addu $t4, $t9, $s0 -/* 0330E0 800324E0 000268C0 */ sll $t5, $v0, 3 -/* 0330E4 800324E4 A4CC004C */ sh $t4, 0x4c($a2) -/* 0330E8 800324E8 00AD7021 */ addu $t6, $a1, $t5 -/* 0330EC 800324EC 8DC30004 */ lw $v1, 4($t6) -/* 0330F0 800324F0 3184FFFF */ andi $a0, $t4, 0xffff -/* 0330F4 800324F4 0083082A */ slt $at, $a0, $v1 -/* 0330F8 800324F8 14200014 */ bnez $at, .L8003254C -/* 0330FC 800324FC 00000000 */ nop -.L80032500: -/* 033100 80032500 94D90048 */ lhu $t9, 0x48($a2) -/* 033104 80032504 24580001 */ addiu $t8, $v0, 1 -/* 033108 80032508 3302FFFF */ andi $v0, $t8, 0xffff -/* 03310C 8003250C 00837823 */ subu $t7, $a0, $v1 -/* 033110 80032510 0322082A */ slt $at, $t9, $v0 -/* 033114 80032514 A4CF004C */ sh $t7, 0x4c($a2) -/* 033118 80032518 10200004 */ beqz $at, .L8003252C -/* 03311C 8003251C A4D8004A */ sh $t8, 0x4a($a2) -/* 033120 80032520 8CC50044 */ lw $a1, 0x44($a2) -/* 033124 80032524 A4C0004A */ sh $zero, 0x4a($a2) -/* 033128 80032528 3002FFFF */ andi $v0, $zero, 0xffff -.L8003252C: -/* 03312C 8003252C 000260C0 */ sll $t4, $v0, 3 -/* 033130 80032530 00AC6821 */ addu $t5, $a1, $t4 -/* 033134 80032534 8DA30004 */ lw $v1, 4($t5) -/* 033138 80032538 94C4004C */ lhu $a0, 0x4c($a2) -/* 03313C 8003253C 00000000 */ nop -/* 033140 80032540 0083082A */ slt $at, $a0, $v1 -/* 033144 80032544 1020FFEE */ beqz $at, .L80032500 -/* 033148 80032548 00000000 */ nop -.L8003254C: -/* 03314C 8003254C 94CF0048 */ lhu $t7, 0x48($a2) -/* 033150 80032550 000270C0 */ sll $t6, $v0, 3 -/* 033154 80032554 25F8FFFF */ addiu $t8, $t7, -1 -/* 033158 80032558 0058082A */ slt $at, $v0, $t8 -/* 03315C 8003255C 00AE1821 */ addu $v1, $a1, $t6 -/* 033160 80032560 10200005 */ beqz $at, .L80032578 -/* 033164 80032564 00404025 */ move $t0, $v0 -/* 033168 80032568 25190001 */ addiu $t9, $t0, 1 -/* 03316C 8003256C 001960C0 */ sll $t4, $t9, 3 -/* 033170 80032570 10000002 */ b .L8003257C -/* 033174 80032574 00AC3821 */ addu $a3, $a1, $t4 -.L80032578: -/* 033178 80032578 00A03825 */ move $a3, $a1 -.L8003257C: -/* 03317C 8003257C 8C6D0004 */ lw $t5, 4($v1) -/* 033180 80032580 3C0E0001 */ lui $t6, 1 -/* 033184 80032584 01CD001A */ div $zero, $t6, $t5 -/* 033188 80032588 90650000 */ lbu $a1, ($v1) -/* 03318C 8003258C 90EF0000 */ lbu $t7, ($a3) -/* 033190 80032590 15A00002 */ bnez $t5, .L8003259C -/* 033194 80032594 00000000 */ nop -/* 033198 80032598 0007000D */ break 7 -.L8003259C: -/* 03319C 8003259C 2401FFFF */ li $at, -1 -/* 0331A0 800325A0 15A10004 */ bne $t5, $at, .L800325B4 -/* 0331A4 800325A4 3C018000 */ lui $at, 0x8000 -/* 0331A8 800325A8 15C10002 */ bne $t6, $at, .L800325B4 -/* 0331AC 800325AC 00000000 */ nop -/* 0331B0 800325B0 0006000D */ break 6 -.L800325B4: -/* 0331B4 800325B4 01E5C023 */ subu $t8, $t7, $a1 -/* 0331B8 800325B8 00057400 */ sll $t6, $a1, 0x10 -/* 0331BC 800325BC 00001012 */ mflo $v0 -/* 0331C0 800325C0 00000000 */ nop -/* 0331C4 800325C4 00000000 */ nop -/* 0331C8 800325C8 03040019 */ multu $t8, $a0 -/* 0331CC 800325CC 0000C812 */ mflo $t9 -/* 0331D0 800325D0 00000000 */ nop -/* 0331D4 800325D4 00000000 */ nop -/* 0331D8 800325D8 03220019 */ multu $t9, $v0 -/* 0331DC 800325DC 00006012 */ mflo $t4 -/* 0331E0 800325E0 018E6821 */ addu $t5, $t4, $t6 -/* 0331E4 800325E4 ACCD001C */ sw $t5, 0x1c($a2) -/* 0331E8 800325E8 90EF0001 */ lbu $t7, 1($a3) -/* 0331EC 800325EC 90680001 */ lbu $t0, 1($v1) -/* 0331F0 800325F0 00000000 */ nop -/* 0331F4 800325F4 01E8C023 */ subu $t8, $t7, $t0 -/* 0331F8 800325F8 03040019 */ multu $t8, $a0 -/* 0331FC 800325FC 00087400 */ sll $t6, $t0, 0x10 -/* 033200 80032600 0000C812 */ mflo $t9 -/* 033204 80032604 00000000 */ nop -/* 033208 80032608 00000000 */ nop -/* 03320C 8003260C 03220019 */ multu $t9, $v0 -/* 033210 80032610 00006012 */ mflo $t4 -/* 033214 80032614 018E6821 */ addu $t5, $t4, $t6 -/* 033218 80032618 ACCD0020 */ sw $t5, 0x20($a2) -/* 03321C 8003261C 90EF0002 */ lbu $t7, 2($a3) -/* 033220 80032620 90690002 */ lbu $t1, 2($v1) -/* 033224 80032624 00000000 */ nop -/* 033228 80032628 01E9C023 */ subu $t8, $t7, $t1 -/* 03322C 8003262C 03040019 */ multu $t8, $a0 -/* 033230 80032630 00097400 */ sll $t6, $t1, 0x10 -/* 033234 80032634 0000C812 */ mflo $t9 -/* 033238 80032638 00000000 */ nop -/* 03323C 8003263C 00000000 */ nop -/* 033240 80032640 03220019 */ multu $t9, $v0 -/* 033244 80032644 00006012 */ mflo $t4 -/* 033248 80032648 018E6821 */ addu $t5, $t4, $t6 -/* 03324C 8003264C ACCD0024 */ sw $t5, 0x24($a2) -/* 033250 80032650 90EF0003 */ lbu $t7, 3($a3) -/* 033254 80032654 906A0003 */ lbu $t2, 3($v1) -/* 033258 80032658 00000000 */ nop -/* 03325C 8003265C 01EAC023 */ subu $t8, $t7, $t2 -/* 033260 80032660 03040019 */ multu $t8, $a0 -/* 033264 80032664 000A7400 */ sll $t6, $t2, 0x10 -/* 033268 80032668 0000C812 */ mflo $t9 -/* 03326C 8003266C 00000000 */ nop -/* 033270 80032670 00000000 */ nop -/* 033274 80032674 03220019 */ multu $t9, $v0 -/* 033278 80032678 00006012 */ mflo $t4 -/* 03327C 8003267C 018E6821 */ addu $t5, $t4, $t6 -/* 033280 80032680 10000059 */ b .L800327E8 -/* 033284 80032684 ACCD0028 */ sw $t5, 0x28($a2) -.L80032688: -/* 033288 80032688 94C3003C */ lhu $v1, 0x3c($a2) -/* 03328C 8003268C 00000000 */ nop -/* 033290 80032690 10600013 */ beqz $v1, .L800326E0 -/* 033294 80032694 0203082A */ slt $at, $s0, $v1 -/* 033298 80032698 1020000A */ beqz $at, .L800326C4 -/* 03329C 8003269C 00601025 */ move $v0, $v1 -/* 0332A0 800326A0 8CD8002C */ lw $t8, 0x2c($a2) -/* 0332A4 800326A4 8CCF001C */ lw $t7, 0x1c($a2) -/* 0332A8 800326A8 03100019 */ multu $t8, $s0 -/* 0332AC 800326AC 00707023 */ subu $t6, $v1, $s0 -/* 0332B0 800326B0 A4CE003C */ sh $t6, 0x3c($a2) -/* 0332B4 800326B4 0000C812 */ mflo $t9 -/* 0332B8 800326B8 01F96021 */ addu $t4, $t7, $t9 -/* 0332BC 800326BC 10000008 */ b .L800326E0 -/* 0332C0 800326C0 ACCC001C */ sw $t4, 0x1c($a2) -.L800326C4: -/* 0332C4 800326C4 8CD8002C */ lw $t8, 0x2c($a2) -/* 0332C8 800326C8 8CCD001C */ lw $t5, 0x1c($a2) -/* 0332CC 800326CC 03020019 */ multu $t8, $v0 -/* 0332D0 800326D0 A4C0003C */ sh $zero, 0x3c($a2) -/* 0332D4 800326D4 00007812 */ mflo $t7 -/* 0332D8 800326D8 01AFC821 */ addu $t9, $t5, $t7 -/* 0332DC 800326DC ACD9001C */ sw $t9, 0x1c($a2) -.L800326E0: -/* 0332E0 800326E0 94C3003E */ lhu $v1, 0x3e($a2) -/* 0332E4 800326E4 00000000 */ nop -/* 0332E8 800326E8 10600013 */ beqz $v1, .L80032738 -/* 0332EC 800326EC 0203082A */ slt $at, $s0, $v1 -/* 0332F0 800326F0 1020000A */ beqz $at, .L8003271C -/* 0332F4 800326F4 00601025 */ move $v0, $v1 -/* 0332F8 800326F8 8CCE0030 */ lw $t6, 0x30($a2) -/* 0332FC 800326FC 8CCC0020 */ lw $t4, 0x20($a2) -/* 033300 80032700 01D00019 */ multu $t6, $s0 -/* 033304 80032704 00707823 */ subu $t7, $v1, $s0 -/* 033308 80032708 A4CF003E */ sh $t7, 0x3e($a2) -/* 03330C 8003270C 0000C012 */ mflo $t8 -/* 033310 80032710 01986821 */ addu $t5, $t4, $t8 -/* 033314 80032714 10000008 */ b .L80032738 -/* 033318 80032718 ACCD0020 */ sw $t5, 0x20($a2) -.L8003271C: -/* 03331C 8003271C 8CCE0030 */ lw $t6, 0x30($a2) -/* 033320 80032720 8CD90020 */ lw $t9, 0x20($a2) -/* 033324 80032724 01C20019 */ multu $t6, $v0 -/* 033328 80032728 A4C0003E */ sh $zero, 0x3e($a2) -/* 03332C 8003272C 00006012 */ mflo $t4 -/* 033330 80032730 032CC021 */ addu $t8, $t9, $t4 -/* 033334 80032734 ACD80020 */ sw $t8, 0x20($a2) -.L80032738: -/* 033338 80032738 94C30040 */ lhu $v1, 0x40($a2) -/* 03333C 8003273C 00000000 */ nop -/* 033340 80032740 10600013 */ beqz $v1, .L80032790 -/* 033344 80032744 0203082A */ slt $at, $s0, $v1 -/* 033348 80032748 1020000A */ beqz $at, .L80032774 -/* 03334C 8003274C 00601025 */ move $v0, $v1 -/* 033350 80032750 8CCF0034 */ lw $t7, 0x34($a2) -/* 033354 80032754 8CCD0024 */ lw $t5, 0x24($a2) -/* 033358 80032758 01F00019 */ multu $t7, $s0 -/* 03335C 8003275C 00706023 */ subu $t4, $v1, $s0 -/* 033360 80032760 A4CC0040 */ sh $t4, 0x40($a2) -/* 033364 80032764 00007012 */ mflo $t6 -/* 033368 80032768 01AEC821 */ addu $t9, $t5, $t6 -/* 03336C 8003276C 10000008 */ b .L80032790 -/* 033370 80032770 ACD90024 */ sw $t9, 0x24($a2) -.L80032774: -/* 033374 80032774 8CCF0034 */ lw $t7, 0x34($a2) -/* 033378 80032778 8CD80024 */ lw $t8, 0x24($a2) -/* 03337C 8003277C 01E20019 */ multu $t7, $v0 -/* 033380 80032780 A4C00040 */ sh $zero, 0x40($a2) -/* 033384 80032784 00006812 */ mflo $t5 -/* 033388 80032788 030D7021 */ addu $t6, $t8, $t5 -/* 03338C 8003278C ACCE0024 */ sw $t6, 0x24($a2) -.L80032790: -/* 033390 80032790 94C30042 */ lhu $v1, 0x42($a2) -/* 033394 80032794 00000000 */ nop -/* 033398 80032798 10600013 */ beqz $v1, .L800327E8 -/* 03339C 8003279C 0203082A */ slt $at, $s0, $v1 -/* 0333A0 800327A0 1020000A */ beqz $at, .L800327CC -/* 0333A4 800327A4 00601025 */ move $v0, $v1 -/* 0333A8 800327A8 8CCC0038 */ lw $t4, 0x38($a2) -/* 0333AC 800327AC 8CD90028 */ lw $t9, 0x28($a2) -/* 0333B0 800327B0 01900019 */ multu $t4, $s0 -/* 0333B4 800327B4 00706823 */ subu $t5, $v1, $s0 -/* 0333B8 800327B8 A4CD0042 */ sh $t5, 0x42($a2) -/* 0333BC 800327BC 00007812 */ mflo $t7 -/* 0333C0 800327C0 032FC021 */ addu $t8, $t9, $t7 -/* 0333C4 800327C4 10000008 */ b .L800327E8 -/* 0333C8 800327C8 ACD80028 */ sw $t8, 0x28($a2) -.L800327CC: -/* 0333CC 800327CC 8CCC0038 */ lw $t4, 0x38($a2) -/* 0333D0 800327D0 8CCE0028 */ lw $t6, 0x28($a2) -/* 0333D4 800327D4 01820019 */ multu $t4, $v0 -/* 0333D8 800327D8 A4C00042 */ sh $zero, 0x42($a2) -/* 0333DC 800327DC 0000C812 */ mflo $t9 -/* 0333E0 800327E0 01D97821 */ addu $t7, $t6, $t9 -/* 0333E4 800327E4 ACCF0028 */ sw $t7, 0x28($a2) -.L800327E8: -/* 0333E8 800327E8 94C30078 */ lhu $v1, 0x78($a2) -/* 0333EC 800327EC 3401FFFF */ li $at, 65535 -/* 0333F0 800327F0 1060001E */ beqz $v1, .L8003286C -/* 0333F4 800327F4 00000000 */ nop -/* 0333F8 800327F8 14610008 */ bne $v1, $at, .L8003281C -/* 0333FC 800327FC 00601025 */ move $v0, $v1 -/* 033400 80032800 84CD0074 */ lh $t5, 0x74($a2) -/* 033404 80032804 84D80070 */ lh $t8, 0x70($a2) -/* 033408 80032808 01B00019 */ multu $t5, $s0 -/* 03340C 8003280C 00006012 */ mflo $t4 -/* 033410 80032810 030C7021 */ addu $t6, $t8, $t4 -/* 033414 80032814 10000014 */ b .L80032868 -/* 033418 80032818 A4CE0070 */ sh $t6, 0x70($a2) -.L8003281C: -/* 03341C 8003281C 0202082A */ slt $at, $s0, $v0 -/* 033420 80032820 1020000A */ beqz $at, .L8003284C -/* 033424 80032824 00000000 */ nop -/* 033428 80032828 84CF0074 */ lh $t7, 0x74($a2) -/* 03342C 8003282C 84D90070 */ lh $t9, 0x70($a2) -/* 033430 80032830 01F00019 */ multu $t7, $s0 -/* 033434 80032834 00506023 */ subu $t4, $v0, $s0 -/* 033438 80032838 A4CC0078 */ sh $t4, 0x78($a2) -/* 03343C 8003283C 00006812 */ mflo $t5 -/* 033440 80032840 032DC021 */ addu $t8, $t9, $t5 -/* 033444 80032844 10000008 */ b .L80032868 -/* 033448 80032848 A4D80070 */ sh $t8, 0x70($a2) -.L8003284C: -/* 03344C 8003284C 84CF0074 */ lh $t7, 0x74($a2) -/* 033450 80032850 84CE0070 */ lh $t6, 0x70($a2) -/* 033454 80032854 01E20019 */ multu $t7, $v0 -/* 033458 80032858 A4C00078 */ sh $zero, 0x78($a2) -/* 03345C 8003285C 0000C812 */ mflo $t9 -/* 033460 80032860 01D96821 */ addu $t5, $t6, $t9 -/* 033464 80032864 A4CD0070 */ sh $t5, 0x70($a2) -.L80032868: -/* 033468 80032868 A0CB0005 */ sb $t3, 5($a2) -.L8003286C: -/* 03346C 8003286C 94C3007A */ lhu $v1, 0x7a($a2) -/* 033470 80032870 3401FFFF */ li $at, 65535 -/* 033474 80032874 1060001E */ beqz $v1, .L800328F0 -/* 033478 80032878 00000000 */ nop -/* 03347C 8003287C 14610008 */ bne $v1, $at, .L800328A0 -/* 033480 80032880 00601025 */ move $v0, $v1 -/* 033484 80032884 84CC0076 */ lh $t4, 0x76($a2) -/* 033488 80032888 84D80072 */ lh $t8, 0x72($a2) -/* 03348C 8003288C 01900019 */ multu $t4, $s0 -/* 033490 80032890 00007812 */ mflo $t7 -/* 033494 80032894 030F7021 */ addu $t6, $t8, $t7 -/* 033498 80032898 10000014 */ b .L800328EC -/* 03349C 8003289C A4CE0072 */ sh $t6, 0x72($a2) -.L800328A0: -/* 0334A0 800328A0 0202082A */ slt $at, $s0, $v0 -/* 0334A4 800328A4 1020000A */ beqz $at, .L800328D0 -/* 0334A8 800328A8 00000000 */ nop -/* 0334AC 800328AC 84CD0076 */ lh $t5, 0x76($a2) -/* 0334B0 800328B0 84D90072 */ lh $t9, 0x72($a2) -/* 0334B4 800328B4 01B00019 */ multu $t5, $s0 -/* 0334B8 800328B8 00507823 */ subu $t7, $v0, $s0 -/* 0334BC 800328BC A4CF007A */ sh $t7, 0x7a($a2) -/* 0334C0 800328C0 00006012 */ mflo $t4 -/* 0334C4 800328C4 032CC021 */ addu $t8, $t9, $t4 -/* 0334C8 800328C8 10000008 */ b .L800328EC -/* 0334CC 800328CC A4D80072 */ sh $t8, 0x72($a2) -.L800328D0: -/* 0334D0 800328D0 84CD0076 */ lh $t5, 0x76($a2) -/* 0334D4 800328D4 84CE0072 */ lh $t6, 0x72($a2) -/* 0334D8 800328D8 01A20019 */ multu $t5, $v0 -/* 0334DC 800328DC A4C0007A */ sh $zero, 0x7a($a2) -/* 0334E0 800328E0 0000C812 */ mflo $t9 -/* 0334E4 800328E4 01D96021 */ addu $t4, $t6, $t9 -/* 0334E8 800328E8 A4CC0072 */ sh $t4, 0x72($a2) -.L800328EC: -/* 0334EC 800328EC A0CB0005 */ sb $t3, 5($a2) -.L800328F0: -/* 0334F0 800328F0 90D80005 */ lbu $t8, 5($a2) -/* 0334F4 800328F4 00000000 */ nop -/* 0334F8 800328F8 130000A9 */ beqz $t8, .L80032BA0 -/* 0334FC 800328FC 8FBF001C */ lw $ra, 0x1c($sp) -/* 033500 80032900 C4C20010 */ lwc1 $f2, 0x10($a2) -/* 033504 80032904 C4C0005C */ lwc1 $f0, 0x5c($a2) -/* 033508 80032908 90CC0000 */ lbu $t4, ($a2) -/* 03350C 8003290C 46001281 */ sub.s $f10, $f2, $f0 -/* 033510 80032910 24D0007C */ addiu $s0, $a2, 0x7c -/* 033514 80032914 444FF800 */ cfc1 $t7, $31 -/* 033518 80032918 02002825 */ move $a1, $s0 -/* 03351C 8003291C 35E10003 */ ori $at, $t7, 3 -/* 033520 80032920 38210002 */ xori $at, $at, 2 -/* 033524 80032924 44C1F800 */ ctc1 $at, $31 -/* 033528 80032928 27A40040 */ addiu $a0, $sp, 0x40 -/* 03352C 8003292C 46005424 */ cvt.w.s $f16, $f10 -/* 033530 80032930 44CFF800 */ ctc1 $t7, $31 -/* 033534 80032934 440D8000 */ mfc1 $t5, $f16 -/* 033538 80032938 46001480 */ add.s $f18, $f2, $f0 -/* 03353C 8003293C A4CD0050 */ sh $t5, 0x50($a2) -/* 033540 80032940 444EF800 */ cfc1 $t6, $31 -/* 033544 80032944 00000000 */ nop -/* 033548 80032948 35C10003 */ ori $at, $t6, 3 -/* 03354C 8003294C 38210002 */ xori $at, $at, 2 -/* 033550 80032950 44C1F800 */ ctc1 $at, $31 -/* 033554 80032954 24010001 */ li $at, 1 -/* 033558 80032958 46009124 */ cvt.w.s $f4, $f18 -/* 03355C 8003295C 44192000 */ mfc1 $t9, $f4 -/* 033560 80032960 44CEF800 */ ctc1 $t6, $31 -/* 033564 80032964 1581001A */ bne $t4, $at, .L800329D0 -/* 033568 80032968 A4D90056 */ sh $t9, 0x56($a2) -/* 03356C 8003296C C4C20014 */ lwc1 $f2, 0x14($a2) -/* 033570 80032970 00000000 */ nop -/* 033574 80032974 46001181 */ sub.s $f6, $f2, $f0 -/* 033578 80032978 4458F800 */ cfc1 $t8, $31 -/* 03357C 8003297C 00000000 */ nop -/* 033580 80032980 37010003 */ ori $at, $t8, 3 -/* 033584 80032984 38210002 */ xori $at, $at, 2 -/* 033588 80032988 44C1F800 */ ctc1 $at, $31 -/* 03358C 8003298C 00000000 */ nop -/* 033590 80032990 46003224 */ cvt.w.s $f8, $f6 -/* 033594 80032994 44D8F800 */ ctc1 $t8, $31 -/* 033598 80032998 440F4000 */ mfc1 $t7, $f8 -/* 03359C 8003299C 46001280 */ add.s $f10, $f2, $f0 -/* 0335A0 800329A0 A4CF0052 */ sh $t7, 0x52($a2) -/* 0335A4 800329A4 444DF800 */ cfc1 $t5, $31 -/* 0335A8 800329A8 00000000 */ nop -/* 0335AC 800329AC 35A10003 */ ori $at, $t5, 3 -/* 0335B0 800329B0 38210002 */ xori $at, $at, 2 -/* 0335B4 800329B4 44C1F800 */ ctc1 $at, $31 -/* 0335B8 800329B8 00000000 */ nop -/* 0335BC 800329BC 46005424 */ cvt.w.s $f16, $f10 -/* 0335C0 800329C0 440E8000 */ mfc1 $t6, $f16 -/* 0335C4 800329C4 44CDF800 */ ctc1 $t5, $31 -/* 0335C8 800329C8 1000001B */ b .L80032A38 -/* 0335CC 800329CC A4CE0058 */ sh $t6, 0x58($a2) -.L800329D0: -/* 0335D0 800329D0 C4C20014 */ lwc1 $f2, 0x14($a2) -/* 0335D4 800329D4 C4C00060 */ lwc1 $f0, 0x60($a2) -/* 0335D8 800329D8 00000000 */ nop -/* 0335DC 800329DC 46001481 */ sub.s $f18, $f2, $f0 -/* 0335E0 800329E0 4459F800 */ cfc1 $t9, $31 -/* 0335E4 800329E4 00000000 */ nop -/* 0335E8 800329E8 37210003 */ ori $at, $t9, 3 -/* 0335EC 800329EC 38210002 */ xori $at, $at, 2 -/* 0335F0 800329F0 44C1F800 */ ctc1 $at, $31 -/* 0335F4 800329F4 00000000 */ nop -/* 0335F8 800329F8 46009124 */ cvt.w.s $f4, $f18 -/* 0335FC 800329FC 44D9F800 */ ctc1 $t9, $31 -/* 033600 80032A00 440C2000 */ mfc1 $t4, $f4 -/* 033604 80032A04 46001180 */ add.s $f6, $f2, $f0 -/* 033608 80032A08 A4CC0052 */ sh $t4, 0x52($a2) -/* 03360C 80032A0C 4458F800 */ cfc1 $t8, $31 -/* 033610 80032A10 00000000 */ nop -/* 033614 80032A14 37010003 */ ori $at, $t8, 3 -/* 033618 80032A18 38210002 */ xori $at, $at, 2 -/* 03361C 80032A1C 44C1F800 */ ctc1 $at, $31 -/* 033620 80032A20 00000000 */ nop -/* 033624 80032A24 46003224 */ cvt.w.s $f8, $f6 -/* 033628 80032A28 440F4000 */ mfc1 $t7, $f8 -/* 03362C 80032A2C 44D8F800 */ ctc1 $t8, $31 -/* 033630 80032A30 A4CF0058 */ sh $t7, 0x58($a2) -/* 033634 80032A34 00000000 */ nop -.L80032A38: -/* 033638 80032A38 90CD0000 */ lbu $t5, ($a2) -/* 03363C 80032A3C 00000000 */ nop -/* 033640 80032A40 15A0001B */ bnez $t5, .L80032AB0 -/* 033644 80032A44 00000000 */ nop -/* 033648 80032A48 C4C20018 */ lwc1 $f2, 0x18($a2) -/* 03364C 80032A4C C4C00064 */ lwc1 $f0, 0x64($a2) -/* 033650 80032A50 00000000 */ nop -/* 033654 80032A54 46001281 */ sub.s $f10, $f2, $f0 -/* 033658 80032A58 444EF800 */ cfc1 $t6, $31 -/* 03365C 80032A5C 00000000 */ nop -/* 033660 80032A60 35C10003 */ ori $at, $t6, 3 -/* 033664 80032A64 38210002 */ xori $at, $at, 2 -/* 033668 80032A68 44C1F800 */ ctc1 $at, $31 -/* 03366C 80032A6C 00000000 */ nop -/* 033670 80032A70 46005424 */ cvt.w.s $f16, $f10 -/* 033674 80032A74 44CEF800 */ ctc1 $t6, $31 -/* 033678 80032A78 44198000 */ mfc1 $t9, $f16 -/* 03367C 80032A7C 46001480 */ add.s $f18, $f2, $f0 -/* 033680 80032A80 A4D90054 */ sh $t9, 0x54($a2) -/* 033684 80032A84 444CF800 */ cfc1 $t4, $31 -/* 033688 80032A88 00000000 */ nop -/* 03368C 80032A8C 35810003 */ ori $at, $t4, 3 -/* 033690 80032A90 38210002 */ xori $at, $at, 2 -/* 033694 80032A94 44C1F800 */ ctc1 $at, $31 -/* 033698 80032A98 00000000 */ nop -/* 03369C 80032A9C 46009124 */ cvt.w.s $f4, $f18 -/* 0336A0 80032AA0 44182000 */ mfc1 $t8, $f4 -/* 0336A4 80032AA4 44CCF800 */ ctc1 $t4, $31 -/* 0336A8 80032AA8 1000001B */ b .L80032B18 -/* 0336AC 80032AAC A4D8005A */ sh $t8, 0x5a($a2) -.L80032AB0: -/* 0336B0 80032AB0 C4C20018 */ lwc1 $f2, 0x18($a2) -/* 0336B4 80032AB4 C4C0005C */ lwc1 $f0, 0x5c($a2) -/* 0336B8 80032AB8 00000000 */ nop -/* 0336BC 80032ABC 46001181 */ sub.s $f6, $f2, $f0 -/* 0336C0 80032AC0 444FF800 */ cfc1 $t7, $31 -/* 0336C4 80032AC4 00000000 */ nop -/* 0336C8 80032AC8 35E10003 */ ori $at, $t7, 3 -/* 0336CC 80032ACC 38210002 */ xori $at, $at, 2 -/* 0336D0 80032AD0 44C1F800 */ ctc1 $at, $31 -/* 0336D4 80032AD4 00000000 */ nop -/* 0336D8 80032AD8 46003224 */ cvt.w.s $f8, $f6 -/* 0336DC 80032ADC 44CFF800 */ ctc1 $t7, $31 -/* 0336E0 80032AE0 440D4000 */ mfc1 $t5, $f8 -/* 0336E4 80032AE4 46001280 */ add.s $f10, $f2, $f0 -/* 0336E8 80032AE8 A4CD0054 */ sh $t5, 0x54($a2) -/* 0336EC 80032AEC 444EF800 */ cfc1 $t6, $31 -/* 0336F0 80032AF0 00000000 */ nop -/* 0336F4 80032AF4 35C10003 */ ori $at, $t6, 3 -/* 0336F8 80032AF8 38210002 */ xori $at, $at, 2 -/* 0336FC 80032AFC 44C1F800 */ ctc1 $at, $31 -/* 033700 80032B00 00000000 */ nop -/* 033704 80032B04 46005424 */ cvt.w.s $f16, $f10 -/* 033708 80032B08 44198000 */ mfc1 $t9, $f16 -/* 03370C 80032B0C 44CEF800 */ ctc1 $t6, $31 -/* 033710 80032B10 A4D9005A */ sh $t9, 0x5a($a2) -/* 033714 80032B14 00000000 */ nop -.L80032B18: -/* 033718 80032B18 90CC0001 */ lbu $t4, 1($a2) -/* 03371C 80032B1C 24010002 */ li $at, 2 -/* 033720 80032B20 1581001D */ bne $t4, $at, .L80032B98 -/* 033724 80032B24 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 033728 80032B28 44819000 */ mtc1 $at, $f18 -/* 03372C 80032B2C 84D80070 */ lh $t8, 0x70($a2) -/* 033730 80032B30 E4D20084 */ swc1 $f18, 0x84($a2) -/* 033734 80032B34 A7B80040 */ sh $t8, 0x40($sp) -/* 033738 80032B38 84CF0072 */ lh $t7, 0x72($a2) -/* 03373C 80032B3C A7A00044 */ sh $zero, 0x44($sp) -/* 033740 80032B40 AFA60048 */ sw $a2, 0x48($sp) -/* 033744 80032B44 0C01C124 */ jal f32_vec3_apply_object_rotation3 -/* 033748 80032B48 A7AF0042 */ sh $t7, 0x42($sp) -/* 03374C 80032B4C 8FA60048 */ lw $a2, 0x48($sp) -/* 033750 80032B50 02002825 */ move $a1, $s0 -/* 033754 80032B54 8CC7000C */ lw $a3, 0xc($a2) -/* 033758 80032B58 00000000 */ nop -/* 03375C 80032B5C 10E00005 */ beqz $a3, .L80032B74 -/* 033760 80032B60 00E02025 */ move $a0, $a3 -/* 033764 80032B64 0C01C0C8 */ jal f32_vec3_apply_object_rotation -/* 033768 80032B68 AFA60048 */ sw $a2, 0x48($sp) -/* 03376C 80032B6C 8FA60048 */ lw $a2, 0x48($sp) -/* 033770 80032B70 00000000 */ nop -.L80032B74: -/* 033774 80032B74 C4C4007C */ lwc1 $f4, 0x7c($a2) -/* 033778 80032B78 C4C80080 */ lwc1 $f8, 0x80($a2) -/* 03377C 80032B7C C4D00084 */ lwc1 $f16, 0x84($a2) -/* 033780 80032B80 46002187 */ neg.s $f6, $f4 -/* 033784 80032B84 46004287 */ neg.s $f10, $f8 -/* 033788 80032B88 46008487 */ neg.s $f18, $f16 -/* 03378C 80032B8C E4C6007C */ swc1 $f6, 0x7c($a2) -/* 033790 80032B90 E4CA0080 */ swc1 $f10, 0x80($a2) -/* 033794 80032B94 E4D20084 */ swc1 $f18, 0x84($a2) -.L80032B98: -/* 033798 80032B98 A0C00005 */ sb $zero, 5($a2) -/* 03379C 80032B9C 8FBF001C */ lw $ra, 0x1c($sp) -.L80032BA0: -/* 0337A0 80032BA0 8FB00018 */ lw $s0, 0x18($sp) -/* 0337A4 80032BA4 03E00008 */ jr $ra -/* 0337A8 80032BA8 27BD0048 */ addiu $sp, $sp, 0x48 - diff --git a/asm/non_matchings/objects/func_80014B50.s b/asm/non_matchings/objects/func_80014B50.s deleted file mode 100644 index bc3a0ca2..00000000 --- a/asm/non_matchings/objects/func_80014B50.s +++ /dev/null @@ -1,578 +0,0 @@ -.late_rodata -glabel jpt_800E5588 -.word L80014B80, L80014CCC, L80014E18, L80015340, L80015340, L80015340, L80015340, L80015340, L80014F64, L800150B0, L800151FC - -.text -glabel func_80014B50 -/* 015750 80014B50 44866000 */ mtc1 $a2, $f12 -/* 015754 80014B54 2CE1000B */ sltiu $at, $a3, 0xb -/* 015758 80014B58 00801025 */ move $v0, $a0 -/* 01575C 80014B5C 102001F8 */ beqz $at, .L80015340 -/* 015760 80014B60 00A01825 */ move $v1, $a1 -/* 015764 80014B64 00077080 */ sll $t6, $a3, 2 -/* 015768 80014B68 3C01800E */ lui $at, %hi(jpt_800E5588) # $at, 0x800e -/* 01576C 80014B6C 002E0821 */ addu $at, $at, $t6 -/* 015770 80014B70 8C2E5588 */ lw $t6, %lo(jpt_800E5588)($at) -/* 015774 80014B74 00000000 */ nop -/* 015778 80014B78 01C00008 */ jr $t6 -/* 01577C 80014B7C 00000000 */ nop -glabel L80014B80 -/* 015780 80014B80 00A4082A */ slt $at, $a1, $a0 -/* 015784 80014B84 142001EE */ bnez $at, .L80015340 -/* 015788 80014B88 3C0A8012 */ lui $t2, %hi(gObjPtrList) # $t2, 0x8012 -/* 01578C 80014B8C 254AAE58 */ addiu $t2, %lo(gObjPtrList) # addiu $t2, $t2, -0x51a8 -/* 015790 80014B90 0064082A */ slt $at, $v1, $a0 -.L80014B94: -/* 015794 80014B94 1420001D */ bnez $at, .L80014C0C -/* 015798 80014B98 00A2082A */ slt $at, $a1, $v0 -/* 01579C 80014B9C 8D4F0000 */ lw $t7, ($t2) -/* 0157A0 80014BA0 0004C080 */ sll $t8, $a0, 2 -/* 0157A4 80014BA4 01F83821 */ addu $a3, $t7, $t8 -/* 0157A8 80014BA8 8CE60000 */ lw $a2, ($a3) -/* 0157AC 80014BAC 00000000 */ nop -/* 0157B0 80014BB0 C4C4000C */ lwc1 $f4, 0xc($a2) -/* 0157B4 80014BB4 C4C60034 */ lwc1 $f6, 0x34($a2) -/* 0157B8 80014BB8 00000000 */ nop -/* 0157BC 80014BBC 46062201 */ sub.s $f8, $f4, $f6 -/* 0157C0 80014BC0 460C403C */ c.lt.s $f8, $f12 -/* 0157C4 80014BC4 00000000 */ nop -/* 0157C8 80014BC8 45000010 */ bc1f .L80014C0C -/* 0157CC 80014BCC 00A2082A */ slt $at, $a1, $v0 -.L80014BD0: -/* 0157D0 80014BD0 24840001 */ addiu $a0, $a0, 1 -/* 0157D4 80014BD4 0064082A */ slt $at, $v1, $a0 -/* 0157D8 80014BD8 1420000B */ bnez $at, .L80014C08 -/* 0157DC 80014BDC 24E70004 */ addiu $a3, $a3, 4 -/* 0157E0 80014BE0 8CE60000 */ lw $a2, ($a3) -/* 0157E4 80014BE4 00000000 */ nop -/* 0157E8 80014BE8 C4CA000C */ lwc1 $f10, 0xc($a2) -/* 0157EC 80014BEC C4D00034 */ lwc1 $f16, 0x34($a2) -/* 0157F0 80014BF0 00000000 */ nop -/* 0157F4 80014BF4 46105481 */ sub.s $f18, $f10, $f16 -/* 0157F8 80014BF8 460C903C */ c.lt.s $f18, $f12 -/* 0157FC 80014BFC 00000000 */ nop -/* 015800 80014C00 4501FFF3 */ bc1t .L80014BD0 -/* 015804 80014C04 00000000 */ nop -.L80014C08: -/* 015808 80014C08 00A2082A */ slt $at, $a1, $v0 -.L80014C0C: -/* 01580C 80014C0C 1420001C */ bnez $at, .L80014C80 -/* 015810 80014C10 00046080 */ sll $t4, $a0, 2 -/* 015814 80014C14 8D590000 */ lw $t9, ($t2) -/* 015818 80014C18 00055880 */ sll $t3, $a1, 2 -/* 01581C 80014C1C 032B3021 */ addu $a2, $t9, $t3 -/* 015820 80014C20 8CC70000 */ lw $a3, ($a2) -/* 015824 80014C24 00000000 */ nop -/* 015828 80014C28 C4E4000C */ lwc1 $f4, 0xc($a3) -/* 01582C 80014C2C C4E60034 */ lwc1 $f6, 0x34($a3) -/* 015830 80014C30 00000000 */ nop -/* 015834 80014C34 46062201 */ sub.s $f8, $f4, $f6 -/* 015838 80014C38 4608603E */ c.le.s $f12, $f8 -/* 01583C 80014C3C 00000000 */ nop -/* 015840 80014C40 45000010 */ bc1f .L80014C84 -/* 015844 80014C44 0085082A */ slt $at, $a0, $a1 -.L80014C48: -/* 015848 80014C48 24A5FFFF */ addiu $a1, $a1, -1 -/* 01584C 80014C4C 00A2082A */ slt $at, $a1, $v0 -/* 015850 80014C50 1420000B */ bnez $at, .L80014C80 -/* 015854 80014C54 24C6FFFC */ addiu $a2, $a2, -4 -/* 015858 80014C58 8CC70000 */ lw $a3, ($a2) -/* 01585C 80014C5C 00000000 */ nop -/* 015860 80014C60 C4EA000C */ lwc1 $f10, 0xc($a3) -/* 015864 80014C64 C4F00034 */ lwc1 $f16, 0x34($a3) -/* 015868 80014C68 00000000 */ nop -/* 01586C 80014C6C 46105481 */ sub.s $f18, $f10, $f16 -/* 015870 80014C70 4612603E */ c.le.s $f12, $f18 -/* 015874 80014C74 00000000 */ nop -/* 015878 80014C78 4501FFF3 */ bc1t .L80014C48 -/* 01587C 80014C7C 00000000 */ nop -.L80014C80: -/* 015880 80014C80 0085082A */ slt $at, $a0, $a1 -.L80014C84: -/* 015884 80014C84 1020000C */ beqz $at, .L80014CB8 -/* 015888 80014C88 00054080 */ sll $t0, $a1, 2 -/* 01588C 80014C8C 8D460000 */ lw $a2, ($t2) -/* 015890 80014C90 24840001 */ addiu $a0, $a0, 1 -/* 015894 80014C94 00C86821 */ addu $t5, $a2, $t0 -/* 015898 80014C98 8DAE0000 */ lw $t6, ($t5) -/* 01589C 80014C9C 00CC3821 */ addu $a3, $a2, $t4 -/* 0158A0 80014CA0 8CE90000 */ lw $t1, ($a3) -/* 0158A4 80014CA4 ACEE0000 */ sw $t6, ($a3) -/* 0158A8 80014CA8 8D4F0000 */ lw $t7, ($t2) -/* 0158AC 80014CAC 24A5FFFF */ addiu $a1, $a1, -1 -/* 0158B0 80014CB0 01E8C021 */ addu $t8, $t7, $t0 -/* 0158B4 80014CB4 AF090000 */ sw $t1, ($t8) -.L80014CB8: -/* 0158B8 80014CB8 00A4082A */ slt $at, $a1, $a0 -/* 0158BC 80014CBC 1020FFB5 */ beqz $at, .L80014B94 -/* 0158C0 80014CC0 0064082A */ slt $at, $v1, $a0 -/* 0158C4 80014CC4 03E00008 */ jr $ra -/* 0158C8 80014CC8 00801025 */ move $v0, $a0 - -glabel L80014CCC -/* 0158CC 80014CCC 00A4082A */ slt $at, $a1, $a0 -/* 0158D0 80014CD0 1420019B */ bnez $at, .L80015340 -/* 0158D4 80014CD4 3C0A8012 */ lui $t2, %hi(gObjPtrList) # $t2, 0x8012 -/* 0158D8 80014CD8 254AAE58 */ addiu $t2, %lo(gObjPtrList) # addiu $t2, $t2, -0x51a8 -/* 0158DC 80014CDC 0064082A */ slt $at, $v1, $a0 -.L80014CE0: -/* 0158E0 80014CE0 1420001D */ bnez $at, .L80014D58 -/* 0158E4 80014CE4 00A2082A */ slt $at, $a1, $v0 -/* 0158E8 80014CE8 8D590000 */ lw $t9, ($t2) -/* 0158EC 80014CEC 00045880 */ sll $t3, $a0, 2 -/* 0158F0 80014CF0 032B3821 */ addu $a3, $t9, $t3 -/* 0158F4 80014CF4 8CE60000 */ lw $a2, ($a3) -/* 0158F8 80014CF8 00000000 */ nop -/* 0158FC 80014CFC C4C40010 */ lwc1 $f4, 0x10($a2) -/* 015900 80014D00 C4C60034 */ lwc1 $f6, 0x34($a2) -/* 015904 80014D04 00000000 */ nop -/* 015908 80014D08 46062201 */ sub.s $f8, $f4, $f6 -/* 01590C 80014D0C 460C403C */ c.lt.s $f8, $f12 -/* 015910 80014D10 00000000 */ nop -/* 015914 80014D14 45000010 */ bc1f .L80014D58 -/* 015918 80014D18 00A2082A */ slt $at, $a1, $v0 -.L80014D1C: -/* 01591C 80014D1C 24840001 */ addiu $a0, $a0, 1 -/* 015920 80014D20 0064082A */ slt $at, $v1, $a0 -/* 015924 80014D24 1420000B */ bnez $at, .L80014D54 -/* 015928 80014D28 24E70004 */ addiu $a3, $a3, 4 -/* 01592C 80014D2C 8CE60000 */ lw $a2, ($a3) -/* 015930 80014D30 00000000 */ nop -/* 015934 80014D34 C4CA0010 */ lwc1 $f10, 0x10($a2) -/* 015938 80014D38 C4D00034 */ lwc1 $f16, 0x34($a2) -/* 01593C 80014D3C 00000000 */ nop -/* 015940 80014D40 46105481 */ sub.s $f18, $f10, $f16 -/* 015944 80014D44 460C903C */ c.lt.s $f18, $f12 -/* 015948 80014D48 00000000 */ nop -/* 01594C 80014D4C 4501FFF3 */ bc1t .L80014D1C -/* 015950 80014D50 00000000 */ nop -.L80014D54: -/* 015954 80014D54 00A2082A */ slt $at, $a1, $v0 -.L80014D58: -/* 015958 80014D58 1420001C */ bnez $at, .L80014DCC -/* 01595C 80014D5C 00047080 */ sll $t6, $a0, 2 -/* 015960 80014D60 8D4C0000 */ lw $t4, ($t2) -/* 015964 80014D64 00056880 */ sll $t5, $a1, 2 -/* 015968 80014D68 018D3021 */ addu $a2, $t4, $t5 -/* 01596C 80014D6C 8CC70000 */ lw $a3, ($a2) -/* 015970 80014D70 00000000 */ nop -/* 015974 80014D74 C4E40010 */ lwc1 $f4, 0x10($a3) -/* 015978 80014D78 C4E60034 */ lwc1 $f6, 0x34($a3) -/* 01597C 80014D7C 00000000 */ nop -/* 015980 80014D80 46062201 */ sub.s $f8, $f4, $f6 -/* 015984 80014D84 4608603E */ c.le.s $f12, $f8 -/* 015988 80014D88 00000000 */ nop -/* 01598C 80014D8C 45000010 */ bc1f .L80014DD0 -/* 015990 80014D90 0085082A */ slt $at, $a0, $a1 -.L80014D94: -/* 015994 80014D94 24A5FFFF */ addiu $a1, $a1, -1 -/* 015998 80014D98 00A2082A */ slt $at, $a1, $v0 -/* 01599C 80014D9C 1420000B */ bnez $at, .L80014DCC -/* 0159A0 80014DA0 24C6FFFC */ addiu $a2, $a2, -4 -/* 0159A4 80014DA4 8CC70000 */ lw $a3, ($a2) -/* 0159A8 80014DA8 00000000 */ nop -/* 0159AC 80014DAC C4EA0010 */ lwc1 $f10, 0x10($a3) -/* 0159B0 80014DB0 C4F00034 */ lwc1 $f16, 0x34($a3) -/* 0159B4 80014DB4 00000000 */ nop -/* 0159B8 80014DB8 46105481 */ sub.s $f18, $f10, $f16 -/* 0159BC 80014DBC 4612603E */ c.le.s $f12, $f18 -/* 0159C0 80014DC0 00000000 */ nop -/* 0159C4 80014DC4 4501FFF3 */ bc1t .L80014D94 -/* 0159C8 80014DC8 00000000 */ nop -.L80014DCC: -/* 0159CC 80014DCC 0085082A */ slt $at, $a0, $a1 -.L80014DD0: -/* 0159D0 80014DD0 1020000C */ beqz $at, .L80014E04 -/* 0159D4 80014DD4 00054080 */ sll $t0, $a1, 2 -/* 0159D8 80014DD8 8D460000 */ lw $a2, ($t2) -/* 0159DC 80014DDC 24840001 */ addiu $a0, $a0, 1 -/* 0159E0 80014DE0 00C87821 */ addu $t7, $a2, $t0 -/* 0159E4 80014DE4 8DF80000 */ lw $t8, ($t7) -/* 0159E8 80014DE8 00CE3821 */ addu $a3, $a2, $t6 -/* 0159EC 80014DEC 8CE90000 */ lw $t1, ($a3) -/* 0159F0 80014DF0 ACF80000 */ sw $t8, ($a3) -/* 0159F4 80014DF4 8D590000 */ lw $t9, ($t2) -/* 0159F8 80014DF8 24A5FFFF */ addiu $a1, $a1, -1 -/* 0159FC 80014DFC 03285821 */ addu $t3, $t9, $t0 -/* 015A00 80014E00 AD690000 */ sw $t1, ($t3) -.L80014E04: -/* 015A04 80014E04 00A4082A */ slt $at, $a1, $a0 -/* 015A08 80014E08 1020FFB5 */ beqz $at, .L80014CE0 -/* 015A0C 80014E0C 0064082A */ slt $at, $v1, $a0 -/* 015A10 80014E10 03E00008 */ jr $ra -/* 015A14 80014E14 00801025 */ move $v0, $a0 - -glabel L80014E18 -/* 015A18 80014E18 00A4082A */ slt $at, $a1, $a0 -/* 015A1C 80014E1C 14200148 */ bnez $at, .L80015340 -/* 015A20 80014E20 3C0A8012 */ lui $t2, %hi(gObjPtrList) # $t2, 0x8012 -/* 015A24 80014E24 254AAE58 */ addiu $t2, %lo(gObjPtrList) # addiu $t2, $t2, -0x51a8 -/* 015A28 80014E28 0064082A */ slt $at, $v1, $a0 -.L80014E2C: -/* 015A2C 80014E2C 1420001D */ bnez $at, .L80014EA4 -/* 015A30 80014E30 00A2082A */ slt $at, $a1, $v0 -/* 015A34 80014E34 8D4C0000 */ lw $t4, ($t2) -/* 015A38 80014E38 00046880 */ sll $t5, $a0, 2 -/* 015A3C 80014E3C 018D3821 */ addu $a3, $t4, $t5 -/* 015A40 80014E40 8CE60000 */ lw $a2, ($a3) -/* 015A44 80014E44 00000000 */ nop -/* 015A48 80014E48 C4C40014 */ lwc1 $f4, 0x14($a2) -/* 015A4C 80014E4C C4C60034 */ lwc1 $f6, 0x34($a2) -/* 015A50 80014E50 00000000 */ nop -/* 015A54 80014E54 46062201 */ sub.s $f8, $f4, $f6 -/* 015A58 80014E58 460C403C */ c.lt.s $f8, $f12 -/* 015A5C 80014E5C 00000000 */ nop -/* 015A60 80014E60 45000010 */ bc1f .L80014EA4 -/* 015A64 80014E64 00A2082A */ slt $at, $a1, $v0 -.L80014E68: -/* 015A68 80014E68 24840001 */ addiu $a0, $a0, 1 -/* 015A6C 80014E6C 0064082A */ slt $at, $v1, $a0 -/* 015A70 80014E70 1420000B */ bnez $at, .L80014EA0 -/* 015A74 80014E74 24E70004 */ addiu $a3, $a3, 4 -/* 015A78 80014E78 8CE60000 */ lw $a2, ($a3) -/* 015A7C 80014E7C 00000000 */ nop -/* 015A80 80014E80 C4CA0014 */ lwc1 $f10, 0x14($a2) -/* 015A84 80014E84 C4D00034 */ lwc1 $f16, 0x34($a2) -/* 015A88 80014E88 00000000 */ nop -/* 015A8C 80014E8C 46105481 */ sub.s $f18, $f10, $f16 -/* 015A90 80014E90 460C903C */ c.lt.s $f18, $f12 -/* 015A94 80014E94 00000000 */ nop -/* 015A98 80014E98 4501FFF3 */ bc1t .L80014E68 -/* 015A9C 80014E9C 00000000 */ nop -.L80014EA0: -/* 015AA0 80014EA0 00A2082A */ slt $at, $a1, $v0 -.L80014EA4: -/* 015AA4 80014EA4 1420001C */ bnez $at, .L80014F18 -/* 015AA8 80014EA8 0004C080 */ sll $t8, $a0, 2 -/* 015AAC 80014EAC 8D4E0000 */ lw $t6, ($t2) -/* 015AB0 80014EB0 00057880 */ sll $t7, $a1, 2 -/* 015AB4 80014EB4 01CF3021 */ addu $a2, $t6, $t7 -/* 015AB8 80014EB8 8CC70000 */ lw $a3, ($a2) -/* 015ABC 80014EBC 00000000 */ nop -/* 015AC0 80014EC0 C4E40014 */ lwc1 $f4, 0x14($a3) -/* 015AC4 80014EC4 C4E60034 */ lwc1 $f6, 0x34($a3) -/* 015AC8 80014EC8 00000000 */ nop -/* 015ACC 80014ECC 46062201 */ sub.s $f8, $f4, $f6 -/* 015AD0 80014ED0 4608603E */ c.le.s $f12, $f8 -/* 015AD4 80014ED4 00000000 */ nop -/* 015AD8 80014ED8 45000010 */ bc1f .L80014F1C -/* 015ADC 80014EDC 0085082A */ slt $at, $a0, $a1 -.L80014EE0: -/* 015AE0 80014EE0 24A5FFFF */ addiu $a1, $a1, -1 -/* 015AE4 80014EE4 00A2082A */ slt $at, $a1, $v0 -/* 015AE8 80014EE8 1420000B */ bnez $at, .L80014F18 -/* 015AEC 80014EEC 24C6FFFC */ addiu $a2, $a2, -4 -/* 015AF0 80014EF0 8CC70000 */ lw $a3, ($a2) -/* 015AF4 80014EF4 00000000 */ nop -/* 015AF8 80014EF8 C4EA0014 */ lwc1 $f10, 0x14($a3) -/* 015AFC 80014EFC C4F00034 */ lwc1 $f16, 0x34($a3) -/* 015B00 80014F00 00000000 */ nop -/* 015B04 80014F04 46105481 */ sub.s $f18, $f10, $f16 -/* 015B08 80014F08 4612603E */ c.le.s $f12, $f18 -/* 015B0C 80014F0C 00000000 */ nop -/* 015B10 80014F10 4501FFF3 */ bc1t .L80014EE0 -/* 015B14 80014F14 00000000 */ nop -.L80014F18: -/* 015B18 80014F18 0085082A */ slt $at, $a0, $a1 -.L80014F1C: -/* 015B1C 80014F1C 1020000C */ beqz $at, .L80014F50 -/* 015B20 80014F20 00054080 */ sll $t0, $a1, 2 -/* 015B24 80014F24 8D460000 */ lw $a2, ($t2) -/* 015B28 80014F28 24840001 */ addiu $a0, $a0, 1 -/* 015B2C 80014F2C 00C8C821 */ addu $t9, $a2, $t0 -/* 015B30 80014F30 8F2B0000 */ lw $t3, ($t9) -/* 015B34 80014F34 00D83821 */ addu $a3, $a2, $t8 -/* 015B38 80014F38 8CE90000 */ lw $t1, ($a3) -/* 015B3C 80014F3C ACEB0000 */ sw $t3, ($a3) -/* 015B40 80014F40 8D4C0000 */ lw $t4, ($t2) -/* 015B44 80014F44 24A5FFFF */ addiu $a1, $a1, -1 -/* 015B48 80014F48 01886821 */ addu $t5, $t4, $t0 -/* 015B4C 80014F4C ADA90000 */ sw $t1, ($t5) -.L80014F50: -/* 015B50 80014F50 00A4082A */ slt $at, $a1, $a0 -/* 015B54 80014F54 1020FFB5 */ beqz $at, .L80014E2C -/* 015B58 80014F58 0064082A */ slt $at, $v1, $a0 -/* 015B5C 80014F5C 03E00008 */ jr $ra -/* 015B60 80014F60 00801025 */ move $v0, $a0 - -glabel L80014F64 -/* 015B64 80014F64 00A4082A */ slt $at, $a1, $a0 -/* 015B68 80014F68 142000F5 */ bnez $at, .L80015340 -/* 015B6C 80014F6C 3C0A8012 */ lui $t2, %hi(gObjPtrList) # $t2, 0x8012 -/* 015B70 80014F70 254AAE58 */ addiu $t2, %lo(gObjPtrList) # addiu $t2, $t2, -0x51a8 -/* 015B74 80014F74 0064082A */ slt $at, $v1, $a0 -.L80014F78: -/* 015B78 80014F78 1420001D */ bnez $at, .L80014FF0 -/* 015B7C 80014F7C 00A2082A */ slt $at, $a1, $v0 -/* 015B80 80014F80 8D4E0000 */ lw $t6, ($t2) -/* 015B84 80014F84 00047880 */ sll $t7, $a0, 2 -/* 015B88 80014F88 01CF3821 */ addu $a3, $t6, $t7 -/* 015B8C 80014F8C 8CE60000 */ lw $a2, ($a3) -/* 015B90 80014F90 00000000 */ nop -/* 015B94 80014F94 C4C40034 */ lwc1 $f4, 0x34($a2) -/* 015B98 80014F98 C4C6000C */ lwc1 $f6, 0xc($a2) -/* 015B9C 80014F9C 00000000 */ nop -/* 015BA0 80014FA0 46062200 */ add.s $f8, $f4, $f6 -/* 015BA4 80014FA4 460C403C */ c.lt.s $f8, $f12 -/* 015BA8 80014FA8 00000000 */ nop -/* 015BAC 80014FAC 45000010 */ bc1f .L80014FF0 -/* 015BB0 80014FB0 00A2082A */ slt $at, $a1, $v0 -.L80014FB4: -/* 015BB4 80014FB4 24840001 */ addiu $a0, $a0, 1 -/* 015BB8 80014FB8 0064082A */ slt $at, $v1, $a0 -/* 015BBC 80014FBC 1420000B */ bnez $at, .L80014FEC -/* 015BC0 80014FC0 24E70004 */ addiu $a3, $a3, 4 -/* 015BC4 80014FC4 8CE60000 */ lw $a2, ($a3) -/* 015BC8 80014FC8 00000000 */ nop -/* 015BCC 80014FCC C4CA0034 */ lwc1 $f10, 0x34($a2) -/* 015BD0 80014FD0 C4D0000C */ lwc1 $f16, 0xc($a2) -/* 015BD4 80014FD4 00000000 */ nop -/* 015BD8 80014FD8 46105480 */ add.s $f18, $f10, $f16 -/* 015BDC 80014FDC 460C903C */ c.lt.s $f18, $f12 -/* 015BE0 80014FE0 00000000 */ nop -/* 015BE4 80014FE4 4501FFF3 */ bc1t .L80014FB4 -/* 015BE8 80014FE8 00000000 */ nop -.L80014FEC: -/* 015BEC 80014FEC 00A2082A */ slt $at, $a1, $v0 -.L80014FF0: -/* 015BF0 80014FF0 1420001C */ bnez $at, .L80015064 -/* 015BF4 80014FF4 00045880 */ sll $t3, $a0, 2 -/* 015BF8 80014FF8 8D580000 */ lw $t8, ($t2) -/* 015BFC 80014FFC 0005C880 */ sll $t9, $a1, 2 -/* 015C00 80015000 03193021 */ addu $a2, $t8, $t9 -/* 015C04 80015004 8CC70000 */ lw $a3, ($a2) -/* 015C08 80015008 00000000 */ nop -/* 015C0C 8001500C C4E40034 */ lwc1 $f4, 0x34($a3) -/* 015C10 80015010 C4E6000C */ lwc1 $f6, 0xc($a3) -/* 015C14 80015014 00000000 */ nop -/* 015C18 80015018 46062200 */ add.s $f8, $f4, $f6 -/* 015C1C 8001501C 4608603E */ c.le.s $f12, $f8 -/* 015C20 80015020 00000000 */ nop -/* 015C24 80015024 45000010 */ bc1f .L80015068 -/* 015C28 80015028 0085082A */ slt $at, $a0, $a1 -.L8001502C: -/* 015C2C 8001502C 24A5FFFF */ addiu $a1, $a1, -1 -/* 015C30 80015030 00A2082A */ slt $at, $a1, $v0 -/* 015C34 80015034 1420000B */ bnez $at, .L80015064 -/* 015C38 80015038 24C6FFFC */ addiu $a2, $a2, -4 -/* 015C3C 8001503C 8CC70000 */ lw $a3, ($a2) -/* 015C40 80015040 00000000 */ nop -/* 015C44 80015044 C4EA0034 */ lwc1 $f10, 0x34($a3) -/* 015C48 80015048 C4F0000C */ lwc1 $f16, 0xc($a3) -/* 015C4C 8001504C 00000000 */ nop -/* 015C50 80015050 46105480 */ add.s $f18, $f10, $f16 -/* 015C54 80015054 4612603E */ c.le.s $f12, $f18 -/* 015C58 80015058 00000000 */ nop -/* 015C5C 8001505C 4501FFF3 */ bc1t .L8001502C -/* 015C60 80015060 00000000 */ nop -.L80015064: -/* 015C64 80015064 0085082A */ slt $at, $a0, $a1 -.L80015068: -/* 015C68 80015068 1020000C */ beqz $at, .L8001509C -/* 015C6C 8001506C 00054080 */ sll $t0, $a1, 2 -/* 015C70 80015070 8D460000 */ lw $a2, ($t2) -/* 015C74 80015074 24840001 */ addiu $a0, $a0, 1 -/* 015C78 80015078 00C86021 */ addu $t4, $a2, $t0 -/* 015C7C 8001507C 8D8D0000 */ lw $t5, ($t4) -/* 015C80 80015080 00CB3821 */ addu $a3, $a2, $t3 -/* 015C84 80015084 8CE90000 */ lw $t1, ($a3) -/* 015C88 80015088 ACED0000 */ sw $t5, ($a3) -/* 015C8C 8001508C 8D4E0000 */ lw $t6, ($t2) -/* 015C90 80015090 24A5FFFF */ addiu $a1, $a1, -1 -/* 015C94 80015094 01C87821 */ addu $t7, $t6, $t0 -/* 015C98 80015098 ADE90000 */ sw $t1, ($t7) -.L8001509C: -/* 015C9C 8001509C 00A4082A */ slt $at, $a1, $a0 -/* 015CA0 800150A0 1020FFB5 */ beqz $at, .L80014F78 -/* 015CA4 800150A4 0064082A */ slt $at, $v1, $a0 -/* 015CA8 800150A8 03E00008 */ jr $ra -/* 015CAC 800150AC 00801025 */ move $v0, $a0 - -glabel L800150B0 -/* 015CB0 800150B0 00A4082A */ slt $at, $a1, $a0 -/* 015CB4 800150B4 142000A2 */ bnez $at, .L80015340 -/* 015CB8 800150B8 3C0A8012 */ lui $t2, %hi(gObjPtrList) # $t2, 0x8012 -/* 015CBC 800150BC 254AAE58 */ addiu $t2, %lo(gObjPtrList) # addiu $t2, $t2, -0x51a8 -/* 015CC0 800150C0 0064082A */ slt $at, $v1, $a0 -.L800150C4: -/* 015CC4 800150C4 1420001D */ bnez $at, .L8001513C -/* 015CC8 800150C8 00A2082A */ slt $at, $a1, $v0 -/* 015CCC 800150CC 8D580000 */ lw $t8, ($t2) -/* 015CD0 800150D0 0004C880 */ sll $t9, $a0, 2 -/* 015CD4 800150D4 03193821 */ addu $a3, $t8, $t9 -/* 015CD8 800150D8 8CE60000 */ lw $a2, ($a3) -/* 015CDC 800150DC 00000000 */ nop -/* 015CE0 800150E0 C4C40034 */ lwc1 $f4, 0x34($a2) -/* 015CE4 800150E4 C4C60010 */ lwc1 $f6, 0x10($a2) -/* 015CE8 800150E8 00000000 */ nop -/* 015CEC 800150EC 46062200 */ add.s $f8, $f4, $f6 -/* 015CF0 800150F0 460C403C */ c.lt.s $f8, $f12 -/* 015CF4 800150F4 00000000 */ nop -/* 015CF8 800150F8 45000010 */ bc1f .L8001513C -/* 015CFC 800150FC 00A2082A */ slt $at, $a1, $v0 -.L80015100: -/* 015D00 80015100 24840001 */ addiu $a0, $a0, 1 -/* 015D04 80015104 0064082A */ slt $at, $v1, $a0 -/* 015D08 80015108 1420000B */ bnez $at, .L80015138 -/* 015D0C 8001510C 24E70004 */ addiu $a3, $a3, 4 -/* 015D10 80015110 8CE60000 */ lw $a2, ($a3) -/* 015D14 80015114 00000000 */ nop -/* 015D18 80015118 C4CA0034 */ lwc1 $f10, 0x34($a2) -/* 015D1C 8001511C C4D00010 */ lwc1 $f16, 0x10($a2) -/* 015D20 80015120 00000000 */ nop -/* 015D24 80015124 46105480 */ add.s $f18, $f10, $f16 -/* 015D28 80015128 460C903C */ c.lt.s $f18, $f12 -/* 015D2C 8001512C 00000000 */ nop -/* 015D30 80015130 4501FFF3 */ bc1t .L80015100 -/* 015D34 80015134 00000000 */ nop -.L80015138: -/* 015D38 80015138 00A2082A */ slt $at, $a1, $v0 -.L8001513C: -/* 015D3C 8001513C 1420001C */ bnez $at, .L800151B0 -/* 015D40 80015140 00046880 */ sll $t5, $a0, 2 -/* 015D44 80015144 8D4B0000 */ lw $t3, ($t2) -/* 015D48 80015148 00056080 */ sll $t4, $a1, 2 -/* 015D4C 8001514C 016C3021 */ addu $a2, $t3, $t4 -/* 015D50 80015150 8CC70000 */ lw $a3, ($a2) -/* 015D54 80015154 00000000 */ nop -/* 015D58 80015158 C4E40034 */ lwc1 $f4, 0x34($a3) -/* 015D5C 8001515C C4E60010 */ lwc1 $f6, 0x10($a3) -/* 015D60 80015160 00000000 */ nop -/* 015D64 80015164 46062200 */ add.s $f8, $f4, $f6 -/* 015D68 80015168 4608603E */ c.le.s $f12, $f8 -/* 015D6C 8001516C 00000000 */ nop -/* 015D70 80015170 45000010 */ bc1f .L800151B4 -/* 015D74 80015174 0085082A */ slt $at, $a0, $a1 -.L80015178: -/* 015D78 80015178 24A5FFFF */ addiu $a1, $a1, -1 -/* 015D7C 8001517C 00A2082A */ slt $at, $a1, $v0 -/* 015D80 80015180 1420000B */ bnez $at, .L800151B0 -/* 015D84 80015184 24C6FFFC */ addiu $a2, $a2, -4 -/* 015D88 80015188 8CC70000 */ lw $a3, ($a2) -/* 015D8C 8001518C 00000000 */ nop -/* 015D90 80015190 C4EA0034 */ lwc1 $f10, 0x34($a3) -/* 015D94 80015194 C4F00010 */ lwc1 $f16, 0x10($a3) -/* 015D98 80015198 00000000 */ nop -/* 015D9C 8001519C 46105480 */ add.s $f18, $f10, $f16 -/* 015DA0 800151A0 4612603E */ c.le.s $f12, $f18 -/* 015DA4 800151A4 00000000 */ nop -/* 015DA8 800151A8 4501FFF3 */ bc1t .L80015178 -/* 015DAC 800151AC 00000000 */ nop -.L800151B0: -/* 015DB0 800151B0 0085082A */ slt $at, $a0, $a1 -.L800151B4: -/* 015DB4 800151B4 1020000C */ beqz $at, .L800151E8 -/* 015DB8 800151B8 00054080 */ sll $t0, $a1, 2 -/* 015DBC 800151BC 8D460000 */ lw $a2, ($t2) -/* 015DC0 800151C0 24840001 */ addiu $a0, $a0, 1 -/* 015DC4 800151C4 00C87021 */ addu $t6, $a2, $t0 -/* 015DC8 800151C8 8DCF0000 */ lw $t7, ($t6) -/* 015DCC 800151CC 00CD3821 */ addu $a3, $a2, $t5 -/* 015DD0 800151D0 8CE90000 */ lw $t1, ($a3) -/* 015DD4 800151D4 ACEF0000 */ sw $t7, ($a3) -/* 015DD8 800151D8 8D580000 */ lw $t8, ($t2) -/* 015DDC 800151DC 24A5FFFF */ addiu $a1, $a1, -1 -/* 015DE0 800151E0 0308C821 */ addu $t9, $t8, $t0 -/* 015DE4 800151E4 AF290000 */ sw $t1, ($t9) -.L800151E8: -/* 015DE8 800151E8 00A4082A */ slt $at, $a1, $a0 -/* 015DEC 800151EC 1020FFB5 */ beqz $at, .L800150C4 -/* 015DF0 800151F0 0064082A */ slt $at, $v1, $a0 -/* 015DF4 800151F4 03E00008 */ jr $ra -/* 015DF8 800151F8 00801025 */ move $v0, $a0 - -glabel L800151FC -/* 015DFC 800151FC 00A4082A */ slt $at, $a1, $a0 -/* 015E00 80015200 1420004F */ bnez $at, .L80015340 -/* 015E04 80015204 3C0A8012 */ lui $t2, %hi(gObjPtrList) # $t2, 0x8012 -/* 015E08 80015208 254AAE58 */ addiu $t2, %lo(gObjPtrList) # addiu $t2, $t2, -0x51a8 -/* 015E0C 8001520C 0064082A */ slt $at, $v1, $a0 -.L80015210: -/* 015E10 80015210 1420001D */ bnez $at, .L80015288 -/* 015E14 80015214 00A2082A */ slt $at, $a1, $v0 -/* 015E18 80015218 8D4B0000 */ lw $t3, ($t2) -/* 015E1C 8001521C 00046080 */ sll $t4, $a0, 2 -/* 015E20 80015220 016C3821 */ addu $a3, $t3, $t4 -/* 015E24 80015224 8CE60000 */ lw $a2, ($a3) -/* 015E28 80015228 00000000 */ nop -/* 015E2C 8001522C C4C40034 */ lwc1 $f4, 0x34($a2) -/* 015E30 80015230 C4C60014 */ lwc1 $f6, 0x14($a2) -/* 015E34 80015234 00000000 */ nop -/* 015E38 80015238 46062200 */ add.s $f8, $f4, $f6 -/* 015E3C 8001523C 460C403C */ c.lt.s $f8, $f12 -/* 015E40 80015240 00000000 */ nop -/* 015E44 80015244 45000010 */ bc1f .L80015288 -/* 015E48 80015248 00A2082A */ slt $at, $a1, $v0 -.L8001524C: -/* 015E4C 8001524C 24840001 */ addiu $a0, $a0, 1 -/* 015E50 80015250 0064082A */ slt $at, $v1, $a0 -/* 015E54 80015254 1420000B */ bnez $at, .L80015284 -/* 015E58 80015258 24E70004 */ addiu $a3, $a3, 4 -/* 015E5C 8001525C 8CE60000 */ lw $a2, ($a3) -/* 015E60 80015260 00000000 */ nop -/* 015E64 80015264 C4CA0034 */ lwc1 $f10, 0x34($a2) -/* 015E68 80015268 C4D00014 */ lwc1 $f16, 0x14($a2) -/* 015E6C 8001526C 00000000 */ nop -/* 015E70 80015270 46105480 */ add.s $f18, $f10, $f16 -/* 015E74 80015274 460C903C */ c.lt.s $f18, $f12 -/* 015E78 80015278 00000000 */ nop -/* 015E7C 8001527C 4501FFF3 */ bc1t .L8001524C -/* 015E80 80015280 00000000 */ nop -.L80015284: -/* 015E84 80015284 00A2082A */ slt $at, $a1, $v0 -.L80015288: -/* 015E88 80015288 1420001C */ bnez $at, .L800152FC -/* 015E8C 8001528C 00047880 */ sll $t7, $a0, 2 -/* 015E90 80015290 8D4D0000 */ lw $t5, ($t2) -/* 015E94 80015294 00057080 */ sll $t6, $a1, 2 -/* 015E98 80015298 01AE3021 */ addu $a2, $t5, $t6 -/* 015E9C 8001529C 8CC70000 */ lw $a3, ($a2) -/* 015EA0 800152A0 00000000 */ nop -/* 015EA4 800152A4 C4E40034 */ lwc1 $f4, 0x34($a3) -/* 015EA8 800152A8 C4E60014 */ lwc1 $f6, 0x14($a3) -/* 015EAC 800152AC 00000000 */ nop -/* 015EB0 800152B0 46062200 */ add.s $f8, $f4, $f6 -/* 015EB4 800152B4 4608603E */ c.le.s $f12, $f8 -/* 015EB8 800152B8 00000000 */ nop -/* 015EBC 800152BC 45000010 */ bc1f .L80015300 -/* 015EC0 800152C0 0085082A */ slt $at, $a0, $a1 -.L800152C4: -/* 015EC4 800152C4 24A5FFFF */ addiu $a1, $a1, -1 -/* 015EC8 800152C8 00A2082A */ slt $at, $a1, $v0 -/* 015ECC 800152CC 1420000B */ bnez $at, .L800152FC -/* 015ED0 800152D0 24C6FFFC */ addiu $a2, $a2, -4 -/* 015ED4 800152D4 8CC70000 */ lw $a3, ($a2) -/* 015ED8 800152D8 00000000 */ nop -/* 015EDC 800152DC C4EA0034 */ lwc1 $f10, 0x34($a3) -/* 015EE0 800152E0 C4F00014 */ lwc1 $f16, 0x14($a3) -/* 015EE4 800152E4 00000000 */ nop -/* 015EE8 800152E8 46105480 */ add.s $f18, $f10, $f16 -/* 015EEC 800152EC 4612603E */ c.le.s $f12, $f18 -/* 015EF0 800152F0 00000000 */ nop -/* 015EF4 800152F4 4501FFF3 */ bc1t .L800152C4 -/* 015EF8 800152F8 00000000 */ nop -.L800152FC: -/* 015EFC 800152FC 0085082A */ slt $at, $a0, $a1 -.L80015300: -/* 015F00 80015300 1020000C */ beqz $at, .L80015334 -/* 015F04 80015304 00054080 */ sll $t0, $a1, 2 -/* 015F08 80015308 8D460000 */ lw $a2, ($t2) -/* 015F0C 8001530C 24840001 */ addiu $a0, $a0, 1 -/* 015F10 80015310 00C8C021 */ addu $t8, $a2, $t0 -/* 015F14 80015314 8F190000 */ lw $t9, ($t8) -/* 015F18 80015318 00CF3821 */ addu $a3, $a2, $t7 -/* 015F1C 8001531C 8CE90000 */ lw $t1, ($a3) -/* 015F20 80015320 ACF90000 */ sw $t9, ($a3) -/* 015F24 80015324 8D4B0000 */ lw $t3, ($t2) -/* 015F28 80015328 24A5FFFF */ addiu $a1, $a1, -1 -/* 015F2C 8001532C 01686021 */ addu $t4, $t3, $t0 -/* 015F30 80015330 AD890000 */ sw $t1, ($t4) -.L80015334: -/* 015F34 80015334 00A4082A */ slt $at, $a1, $a0 -/* 015F38 80015338 1020FFB5 */ beqz $at, .L80015210 -/* 015F3C 8001533C 0064082A */ slt $at, $v1, $a0 -.L80015340: -glabel L80015340 -/* 015F40 80015340 03E00008 */ jr $ra -/* 015F44 80015344 00801025 */ move $v0, $a0 - diff --git a/asm/non_matchings/racer/func_80053750.s b/asm/non_matchings/racer/func_80053750.s deleted file mode 100644 index f8a2ea02..00000000 --- a/asm/non_matchings/racer/func_80053750.s +++ /dev/null @@ -1,519 +0,0 @@ -.late_rodata -glabel D_800E6788 -.double 0.4 -glabel D_800E6790 -.double 0.1 -glabel D_800E6798 -.double 1.4 - -.text -glabel func_80053750 -/* 054350 80053750 AFA50004 */ sw $a1, 4($sp) -/* 054354 80053754 8C820060 */ lw $v0, 0x60($a0) -/* 054358 80053758 44867000 */ mtc1 $a2, $f14 -/* 05435C 8005375C 104001CD */ beqz $v0, .L80053E94 -/* 054360 80053760 00A03025 */ move $a2, $a1 -/* 054364 80053764 8C430000 */ lw $v1, ($v0) -/* 054368 80053768 24010002 */ li $at, 2 -/* 05436C 8005376C 1461000A */ bne $v1, $at, .L80053798 -/* 054370 80053770 28610004 */ slti $at, $v1, 4 -/* 054374 80053774 8C450004 */ lw $a1, 4($v0) -/* 054378 80053778 24074000 */ li $a3, 16384 -/* 05437C 8005377C A4A70000 */ sh $a3, ($a1) -/* 054380 80053780 8C8E0060 */ lw $t6, 0x60($a0) -/* 054384 80053784 00000000 */ nop -/* 054388 80053788 8DC50008 */ lw $a1, 8($t6) -/* 05438C 8005378C 00000000 */ nop -/* 054390 80053790 A4A70000 */ sh $a3, ($a1) -/* 054394 80053794 28610004 */ slti $at, $v1, 4 -.L80053798: -/* 054398 80053798 142001BE */ bnez $at, .L80053E94 -/* 05439C 8005379C 00000000 */ nop -/* 0543A0 800537A0 C4C0002C */ lwc1 $f0, 0x2c($a2) -/* 0543A4 800537A4 3C014014 */ li $at, 0x40140000 # 2.312500 -/* 0543A8 800537A8 44818800 */ mtc1 $at, $f17 -/* 0543AC 800537AC 44808000 */ mtc1 $zero, $f16 -/* 0543B0 800537B0 460000A1 */ cvt.d.s $f2, $f0 -/* 0543B4 800537B4 4622803C */ c.lt.d $f16, $f2 -/* 0543B8 800537B8 44802000 */ mtc1 $zero, $f4 -/* 0543BC 800537BC 45000004 */ bc1f .L800537D0 -/* 0543C0 800537C0 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0543C4 800537C4 44810000 */ mtc1 $at, $f0 -/* 0543C8 800537C8 00000000 */ nop -/* 0543CC 800537CC 460000A1 */ cvt.d.s $f2, $f0 -.L800537D0: -/* 0543D0 800537D0 3C01C014 */ li $at, 0xC0140000 # -2.312500 -/* 0543D4 800537D4 44812800 */ mtc1 $at, $f5 -/* 0543D8 800537D8 3C01C0A0 */ li $at, 0xC0A00000 # -5.000000 -/* 0543DC 800537DC 4624103C */ c.lt.d $f2, $f4 -/* 0543E0 800537E0 24090004 */ li $t1, 4 -/* 0543E4 800537E4 45000003 */ bc1f .L800537F4 -/* 0543E8 800537E8 00000000 */ nop -/* 0543EC 800537EC 44810000 */ mtc1 $at, $f0 -/* 0543F0 800537F0 00000000 */ nop -.L800537F4: -/* 0543F4 800537F4 3C01800E */ lui $at, %hi(D_800E6788 + 4) # $at, 0x800e -/* 0543F8 800537F8 C4C600B8 */ lwc1 $f6, 0xb8($a2) -/* 0543FC 800537FC C4236788 */ lwc1 $f3, %lo(D_800E6788)($at) -/* 054400 80053800 C422678C */ lwc1 $f2, %lo(D_800E6788 + 4)($at) -/* 054404 80053804 46003221 */ cvt.d.s $f8, $f6 -/* 054408 80053808 4628103C */ c.lt.d $f2, $f8 -/* 05440C 8005380C 24020001 */ li $v0, 1 -/* 054410 80053810 4500000A */ bc1f .L8005383C -/* 054414 80053814 00000000 */ nop -/* 054418 80053818 C4CA00B4 */ lwc1 $f10, 0xb4($a2) -/* 05441C 8005381C 00001025 */ move $v0, $zero -/* 054420 80053820 46005121 */ cvt.d.s $f4, $f10 -/* 054424 80053824 4622203C */ c.lt.d $f4, $f2 -/* 054428 80053828 00000000 */ nop -/* 05442C 8005382C 45000003 */ bc1f .L8005383C -/* 054430 80053830 00000000 */ nop -/* 054434 80053834 44800000 */ mtc1 $zero, $f0 -/* 054438 80053838 00000000 */ nop -.L8005383C: -/* 05443C 8005383C 460E0182 */ mul.s $f6, $f0, $f14 -/* 054440 80053840 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 -/* 054444 80053844 44815800 */ mtc1 $at, $f11 -/* 054448 80053848 44805000 */ mtc1 $zero, $f10 -/* 05444C 8005384C 46003221 */ cvt.d.s $f8, $f6 -/* 054450 80053850 462A4102 */ mul.d $f4, $f8, $f10 -/* 054454 80053854 C4C600B0 */ lwc1 $f6, 0xb0($a2) -/* 054458 80053858 44809000 */ mtc1 $zero, $f18 -/* 05445C 8005385C 46003221 */ cvt.d.s $f8, $f6 -/* 054460 80053860 44807000 */ mtc1 $zero, $f14 -/* 054464 80053864 46244281 */ sub.d $f10, $f8, $f4 -/* 054468 80053868 462051A0 */ cvt.s.d $f6, $f10 -/* 05446C 8005386C E4C600B0 */ swc1 $f6, 0xb0($a2) -/* 054470 80053870 C4C200B0 */ lwc1 $f2, 0xb0($a2) -/* 054474 80053874 00000000 */ nop -/* 054478 80053878 46001321 */ cvt.d.s $f12, $f2 -/* 05447C 8005387C 462C803C */ c.lt.d $f16, $f12 -/* 054480 80053880 00000000 */ nop -/* 054484 80053884 45000067 */ bc1f .L80053A24 -/* 054488 80053888 00000000 */ nop -.L8005388C: -/* 05448C 8005388C 46306201 */ sub.d $f8, $f12, $f16 -/* 054490 80053890 00001825 */ move $v1, $zero -/* 054494 80053894 46204120 */ cvt.s.d $f4, $f8 -/* 054498 80053898 E4C400B0 */ swc1 $f4, 0xb0($a2) -/* 05449C 8005389C 28610002 */ slti $at, $v1, 2 -.L800538A0: -/* 0544A0 800538A0 14200003 */ bnez $at, .L800538B0 -/* 0544A4 800538A4 0003C080 */ sll $t8, $v1, 2 -/* 0544A8 800538A8 10400029 */ beqz $v0, .L80053950 -/* 0544AC 800538AC 00000000 */ nop -.L800538B0: -/* 0544B0 800538B0 8C8F0060 */ lw $t7, 0x60($a0) -/* 0544B4 800538B4 80C801FB */ lb $t0, 0x1fb($a2) -/* 0544B8 800538B8 01F8C821 */ addu $t9, $t7, $t8 -/* 0544BC 800538BC 8F270004 */ lw $a3, 4($t9) -/* 0544C0 800538C0 11000004 */ beqz $t0, .L800538D4 -/* 0544C4 800538C4 00E02825 */ move $a1, $a3 -/* 0544C8 800538C8 28610003 */ slti $at, $v1, 3 -/* 0544CC 800538CC 10200003 */ beqz $at, .L800538DC -/* 0544D0 800538D0 00000000 */ nop -.L800538D4: -/* 0544D4 800538D4 1500001E */ bnez $t0, .L80053950 -/* 0544D8 800538D8 00000000 */ nop -.L800538DC: -/* 0544DC 800538DC 8CEA0078 */ lw $t2, 0x78($a3) -/* 0544E0 800538E0 00000000 */ nop -/* 0544E4 800538E4 11400010 */ beqz $t2, .L80053928 -/* 0544E8 800538E8 00000000 */ nop -/* 0544EC 800538EC 80AB003A */ lb $t3, 0x3a($a1) -/* 0544F0 800538F0 00000000 */ nop -/* 0544F4 800538F4 256CFFFF */ addiu $t4, $t3, -1 -/* 0544F8 800538F8 A0AC003A */ sb $t4, 0x3a($a1) -/* 0544FC 800538FC 80AD003A */ lb $t5, 0x3a($a1) -/* 054500 80053900 00000000 */ nop -/* 054504 80053904 05A10012 */ bgez $t5, .L80053950 -/* 054508 80053908 00000000 */ nop -/* 05450C 8005390C 8CAE0040 */ lw $t6, 0x40($a1) -/* 054510 80053910 00000000 */ nop -/* 054514 80053914 81CF0055 */ lb $t7, 0x55($t6) -/* 054518 80053918 00000000 */ nop -/* 05451C 8005391C 25F8FFFF */ addiu $t8, $t7, -1 -/* 054520 80053920 1000000B */ b .L80053950 -/* 054524 80053924 A0B8003A */ sb $t8, 0x3a($a1) -.L80053928: -/* 054528 80053928 80B9003A */ lb $t9, 0x3a($a1) -/* 05452C 8005392C 8CAB0040 */ lw $t3, 0x40($a1) -/* 054530 80053930 272A0001 */ addiu $t2, $t9, 1 -/* 054534 80053934 A0AA003A */ sb $t2, 0x3a($a1) -/* 054538 80053938 80AD003A */ lb $t5, 0x3a($a1) -/* 05453C 8005393C 816C0055 */ lb $t4, 0x55($t3) -/* 054540 80053940 00000000 */ nop -/* 054544 80053944 158D0002 */ bne $t4, $t5, .L80053950 -/* 054548 80053948 00000000 */ nop -/* 05454C 8005394C A0A0003A */ sb $zero, 0x3a($a1) -.L80053950: -/* 054550 80053950 18600003 */ blez $v1, .L80053960 -/* 054554 80053954 00037880 */ sll $t7, $v1, 2 -/* 054558 80053958 10400028 */ beqz $v0, .L800539FC -/* 05455C 8005395C 00000000 */ nop -.L80053960: -/* 054560 80053960 8C8E0060 */ lw $t6, 0x60($a0) -/* 054564 80053964 80C801FB */ lb $t0, 0x1fb($a2) -/* 054568 80053968 01CFC021 */ addu $t8, $t6, $t7 -/* 05456C 8005396C 8F050008 */ lw $a1, 8($t8) -/* 054570 80053970 11000003 */ beqz $t0, .L80053980 -/* 054574 80053974 28610002 */ slti $at, $v1, 2 -/* 054578 80053978 10200003 */ beqz $at, .L80053988 -/* 05457C 8005397C 00000000 */ nop -.L80053980: -/* 054580 80053980 1500001E */ bnez $t0, .L800539FC -/* 054584 80053984 00000000 */ nop -.L80053988: -/* 054588 80053988 8CB90078 */ lw $t9, 0x78($a1) -/* 05458C 8005398C 00000000 */ nop -/* 054590 80053990 13200010 */ beqz $t9, .L800539D4 -/* 054594 80053994 00000000 */ nop -/* 054598 80053998 80AA003A */ lb $t2, 0x3a($a1) -/* 05459C 8005399C 00000000 */ nop -/* 0545A0 800539A0 254BFFFF */ addiu $t3, $t2, -1 -/* 0545A4 800539A4 A0AB003A */ sb $t3, 0x3a($a1) -/* 0545A8 800539A8 80AC003A */ lb $t4, 0x3a($a1) -/* 0545AC 800539AC 00000000 */ nop -/* 0545B0 800539B0 05810012 */ bgez $t4, .L800539FC -/* 0545B4 800539B4 00000000 */ nop -/* 0545B8 800539B8 8CAD0040 */ lw $t5, 0x40($a1) -/* 0545BC 800539BC 00000000 */ nop -/* 0545C0 800539C0 81AE0055 */ lb $t6, 0x55($t5) -/* 0545C4 800539C4 00000000 */ nop -/* 0545C8 800539C8 25CFFFFF */ addiu $t7, $t6, -1 -/* 0545CC 800539CC 1000000B */ b .L800539FC -/* 0545D0 800539D0 A0AF003A */ sb $t7, 0x3a($a1) -.L800539D4: -/* 0545D4 800539D4 80B8003A */ lb $t8, 0x3a($a1) -/* 0545D8 800539D8 8CAA0040 */ lw $t2, 0x40($a1) -/* 0545DC 800539DC 27190001 */ addiu $t9, $t8, 1 -/* 0545E0 800539E0 A0B9003A */ sb $t9, 0x3a($a1) -/* 0545E4 800539E4 80AC003A */ lb $t4, 0x3a($a1) -/* 0545E8 800539E8 814B0055 */ lb $t3, 0x55($t2) -/* 0545EC 800539EC 00000000 */ nop -/* 0545F0 800539F0 156C0002 */ bne $t3, $t4, .L800539FC -/* 0545F4 800539F4 00000000 */ nop -/* 0545F8 800539F8 A0A0003A */ sb $zero, 0x3a($a1) -.L800539FC: -/* 0545FC 800539FC 24630002 */ addiu $v1, $v1, 2 -/* 054600 80053A00 1469FFA7 */ bne $v1, $t1, .L800538A0 -/* 054604 80053A04 28610002 */ slti $at, $v1, 2 -/* 054608 80053A08 C4C200B0 */ lwc1 $f2, 0xb0($a2) -/* 05460C 80053A0C 00000000 */ nop -/* 054610 80053A10 46001321 */ cvt.d.s $f12, $f2 -/* 054614 80053A14 462C803C */ c.lt.d $f16, $f12 -/* 054618 80053A18 00000000 */ nop -/* 05461C 80053A1C 4501FF9B */ bc1t .L8005388C -/* 054620 80053A20 00000000 */ nop -.L80053A24: -/* 054624 80053A24 4612103C */ c.lt.s $f2, $f18 -/* 054628 80053A28 24090004 */ li $t1, 4 -/* 05462C 80053A2C 45000067 */ bc1f .L80053BCC -/* 054630 80053A30 00000000 */ nop -.L80053A34: -/* 054634 80053A34 460012A1 */ cvt.d.s $f10, $f2 -/* 054638 80053A38 46305180 */ add.d $f6, $f10, $f16 -/* 05463C 80053A3C 00001825 */ move $v1, $zero -/* 054640 80053A40 46203220 */ cvt.s.d $f8, $f6 -/* 054644 80053A44 E4C800B0 */ swc1 $f8, 0xb0($a2) -/* 054648 80053A48 28610002 */ slti $at, $v1, 2 -.L80053A4C: -/* 05464C 80053A4C 14200003 */ bnez $at, .L80053A5C -/* 054650 80053A50 00037080 */ sll $t6, $v1, 2 -/* 054654 80053A54 10400029 */ beqz $v0, .L80053AFC -/* 054658 80053A58 00000000 */ nop -.L80053A5C: -/* 05465C 80053A5C 8C8D0060 */ lw $t5, 0x60($a0) -/* 054660 80053A60 80C801FB */ lb $t0, 0x1fb($a2) -/* 054664 80053A64 01AE7821 */ addu $t7, $t5, $t6 -/* 054668 80053A68 8DE70004 */ lw $a3, 4($t7) -/* 05466C 80053A6C 11000004 */ beqz $t0, .L80053A80 -/* 054670 80053A70 00E02825 */ move $a1, $a3 -/* 054674 80053A74 28610003 */ slti $at, $v1, 3 -/* 054678 80053A78 10200003 */ beqz $at, .L80053A88 -/* 05467C 80053A7C 00000000 */ nop -.L80053A80: -/* 054680 80053A80 1500001E */ bnez $t0, .L80053AFC -/* 054684 80053A84 00000000 */ nop -.L80053A88: -/* 054688 80053A88 8CF80078 */ lw $t8, 0x78($a3) -/* 05468C 80053A8C 00000000 */ nop -/* 054690 80053A90 17000010 */ bnez $t8, .L80053AD4 -/* 054694 80053A94 00000000 */ nop -/* 054698 80053A98 80B9003A */ lb $t9, 0x3a($a1) -/* 05469C 80053A9C 00000000 */ nop -/* 0546A0 80053AA0 272AFFFF */ addiu $t2, $t9, -1 -/* 0546A4 80053AA4 A0AA003A */ sb $t2, 0x3a($a1) -/* 0546A8 80053AA8 80AB003A */ lb $t3, 0x3a($a1) -/* 0546AC 80053AAC 00000000 */ nop -/* 0546B0 80053AB0 05610012 */ bgez $t3, .L80053AFC -/* 0546B4 80053AB4 00000000 */ nop -/* 0546B8 80053AB8 8CAC0040 */ lw $t4, 0x40($a1) -/* 0546BC 80053ABC 00000000 */ nop -/* 0546C0 80053AC0 818D0055 */ lb $t5, 0x55($t4) -/* 0546C4 80053AC4 00000000 */ nop -/* 0546C8 80053AC8 25AEFFFF */ addiu $t6, $t5, -1 -/* 0546CC 80053ACC 1000000B */ b .L80053AFC -/* 0546D0 80053AD0 A0AE003A */ sb $t6, 0x3a($a1) -.L80053AD4: -/* 0546D4 80053AD4 80AF003A */ lb $t7, 0x3a($a1) -/* 0546D8 80053AD8 8CB90040 */ lw $t9, 0x40($a1) -/* 0546DC 80053ADC 25F80001 */ addiu $t8, $t7, 1 -/* 0546E0 80053AE0 A0B8003A */ sb $t8, 0x3a($a1) -/* 0546E4 80053AE4 80AB003A */ lb $t3, 0x3a($a1) -/* 0546E8 80053AE8 832A0055 */ lb $t2, 0x55($t9) -/* 0546EC 80053AEC 00000000 */ nop -/* 0546F0 80053AF0 154B0002 */ bne $t2, $t3, .L80053AFC -/* 0546F4 80053AF4 00000000 */ nop -/* 0546F8 80053AF8 A0A0003A */ sb $zero, 0x3a($a1) -.L80053AFC: -/* 0546FC 80053AFC 18600003 */ blez $v1, .L80053B0C -/* 054700 80053B00 00036880 */ sll $t5, $v1, 2 -/* 054704 80053B04 10400028 */ beqz $v0, .L80053BA8 -/* 054708 80053B08 00000000 */ nop -.L80053B0C: -/* 05470C 80053B0C 8C8C0060 */ lw $t4, 0x60($a0) -/* 054710 80053B10 80C801FB */ lb $t0, 0x1fb($a2) -/* 054714 80053B14 018D7021 */ addu $t6, $t4, $t5 -/* 054718 80053B18 8DC50008 */ lw $a1, 8($t6) -/* 05471C 80053B1C 11000003 */ beqz $t0, .L80053B2C -/* 054720 80053B20 28610002 */ slti $at, $v1, 2 -/* 054724 80053B24 10200003 */ beqz $at, .L80053B34 -/* 054728 80053B28 00000000 */ nop -.L80053B2C: -/* 05472C 80053B2C 1500001E */ bnez $t0, .L80053BA8 -/* 054730 80053B30 00000000 */ nop -.L80053B34: -/* 054734 80053B34 8CAF0078 */ lw $t7, 0x78($a1) -/* 054738 80053B38 00000000 */ nop -/* 05473C 80053B3C 15E00010 */ bnez $t7, .L80053B80 -/* 054740 80053B40 00000000 */ nop -/* 054744 80053B44 80B8003A */ lb $t8, 0x3a($a1) -/* 054748 80053B48 00000000 */ nop -/* 05474C 80053B4C 2719FFFF */ addiu $t9, $t8, -1 -/* 054750 80053B50 A0B9003A */ sb $t9, 0x3a($a1) -/* 054754 80053B54 80AA003A */ lb $t2, 0x3a($a1) -/* 054758 80053B58 00000000 */ nop -/* 05475C 80053B5C 05410012 */ bgez $t2, .L80053BA8 -/* 054760 80053B60 00000000 */ nop -/* 054764 80053B64 8CAB0040 */ lw $t3, 0x40($a1) -/* 054768 80053B68 00000000 */ nop -/* 05476C 80053B6C 816C0055 */ lb $t4, 0x55($t3) -/* 054770 80053B70 00000000 */ nop -/* 054774 80053B74 258DFFFF */ addiu $t5, $t4, -1 -/* 054778 80053B78 1000000B */ b .L80053BA8 -/* 05477C 80053B7C A0AD003A */ sb $t5, 0x3a($a1) -.L80053B80: -/* 054780 80053B80 80AE003A */ lb $t6, 0x3a($a1) -/* 054784 80053B84 8CB80040 */ lw $t8, 0x40($a1) -/* 054788 80053B88 25CF0001 */ addiu $t7, $t6, 1 -/* 05478C 80053B8C A0AF003A */ sb $t7, 0x3a($a1) -/* 054790 80053B90 80AA003A */ lb $t2, 0x3a($a1) -/* 054794 80053B94 83190055 */ lb $t9, 0x55($t8) -/* 054798 80053B98 00000000 */ nop -/* 05479C 80053B9C 172A0002 */ bne $t9, $t2, .L80053BA8 -/* 0547A0 80053BA0 00000000 */ nop -/* 0547A4 80053BA4 A0A0003A */ sb $zero, 0x3a($a1) -.L80053BA8: -/* 0547A8 80053BA8 24630002 */ addiu $v1, $v1, 2 -/* 0547AC 80053BAC 1469FFA7 */ bne $v1, $t1, .L80053A4C -/* 0547B0 80053BB0 28610002 */ slti $at, $v1, 2 -/* 0547B4 80053BB4 C4C200B0 */ lwc1 $f2, 0xb0($a2) -/* 0547B8 80053BB8 00000000 */ nop -/* 0547BC 80053BBC 4612103C */ c.lt.s $f2, $f18 -/* 0547C0 80053BC0 00000000 */ nop -/* 0547C4 80053BC4 4501FF9B */ bc1t .L80053A34 -/* 0547C8 80053BC8 00000000 */ nop -.L80053BCC: -/* 0547CC 80053BCC 80CB01FB */ lb $t3, 0x1fb($a2) -/* 0547D0 80053BD0 24070001 */ li $a3, 1 -/* 0547D4 80053BD4 1160002B */ beqz $t3, .L80053C84 -/* 0547D8 80053BD8 3C01800E */ lui $at, %hi(D_800E6790 + 4) # $at, 0x800e -/* 0547DC 80053BDC 00001025 */ move $v0, $zero -/* 0547E0 80053BE0 24030008 */ li $v1, 8 -.L80053BE4: -/* 0547E4 80053BE4 8C8C0060 */ lw $t4, 0x60($a0) -/* 0547E8 80053BE8 00000000 */ nop -/* 0547EC 80053BEC 01826821 */ addu $t5, $t4, $v0 -/* 0547F0 80053BF0 8DA50004 */ lw $a1, 4($t5) -/* 0547F4 80053BF4 24420004 */ addiu $v0, $v0, 4 -/* 0547F8 80053BF8 8CAE0078 */ lw $t6, 0x78($a1) -/* 0547FC 80053BFC 00000000 */ nop -/* 054800 80053C00 11C00010 */ beqz $t6, .L80053C44 -/* 054804 80053C04 00000000 */ nop -/* 054808 80053C08 80AF003A */ lb $t7, 0x3a($a1) -/* 05480C 80053C0C 00000000 */ nop -/* 054810 80053C10 25F8FFFF */ addiu $t8, $t7, -1 -/* 054814 80053C14 A0B8003A */ sb $t8, 0x3a($a1) -/* 054818 80053C18 80B9003A */ lb $t9, 0x3a($a1) -/* 05481C 80053C1C 00000000 */ nop -/* 054820 80053C20 07210012 */ bgez $t9, .L80053C6C -/* 054824 80053C24 00000000 */ nop -/* 054828 80053C28 8CAA0040 */ lw $t2, 0x40($a1) -/* 05482C 80053C2C 00000000 */ nop -/* 054830 80053C30 814B0055 */ lb $t3, 0x55($t2) -/* 054834 80053C34 00000000 */ nop -/* 054838 80053C38 256CFFFF */ addiu $t4, $t3, -1 -/* 05483C 80053C3C 1000000B */ b .L80053C6C -/* 054840 80053C40 A0AC003A */ sb $t4, 0x3a($a1) -.L80053C44: -/* 054844 80053C44 80AD003A */ lb $t5, 0x3a($a1) -/* 054848 80053C48 8CAF0040 */ lw $t7, 0x40($a1) -/* 05484C 80053C4C 25AE0001 */ addiu $t6, $t5, 1 -/* 054850 80053C50 A0AE003A */ sb $t6, 0x3a($a1) -/* 054854 80053C54 80B9003A */ lb $t9, 0x3a($a1) -/* 054858 80053C58 81F80055 */ lb $t8, 0x55($t7) -/* 05485C 80053C5C 00000000 */ nop -/* 054860 80053C60 17190002 */ bne $t8, $t9, .L80053C6C -/* 054864 80053C64 00000000 */ nop -/* 054868 80053C68 A0A0003A */ sb $zero, 0x3a($a1) -.L80053C6C: -/* 05486C 80053C6C 1443FFDD */ bne $v0, $v1, .L80053BE4 -/* 054870 80053C70 00000000 */ nop -/* 054874 80053C74 8C8A0074 */ lw $t2, 0x74($a0) -/* 054878 80053C78 00000000 */ nop -/* 05487C 80053C7C 354B0C00 */ ori $t3, $t2, 0xc00 -/* 054880 80053C80 AC8B0074 */ sw $t3, 0x74($a0) -.L80053C84: -/* 054884 80053C84 C4336790 */ lwc1 $f19, %lo(D_800E6790)($at) -/* 054888 80053C88 C4326794 */ lwc1 $f18, %lo(D_800E6790 + 4)($at) -/* 05488C 80053C8C 3C01800E */ lui $at, %hi(D_800E6798 + 4) # $at, 0x800e -/* 054890 80053C90 C4316798 */ lwc1 $f17, %lo(D_800E6798)($at) -/* 054894 80053C94 C430679C */ lwc1 $f16, %lo(D_800E6798 + 4)($at) -/* 054898 80053C98 3C013FC0 */ li $at, 0x3FC00000 # 1.500000 -/* 05489C 80053C9C 44817800 */ mtc1 $at, $f15 -/* 0548A0 80053CA0 3C01C120 */ li $at, 0xC1200000 # -10.000000 -/* 0548A4 80053CA4 44816000 */ mtc1 $at, $f12 -/* 0548A8 80053CA8 00001025 */ move $v0, $zero -/* 0548AC 80053CAC 24030010 */ li $v1, 16 -.L80053CB0: -/* 0548B0 80053CB0 8C8C0060 */ lw $t4, 0x60($a0) -/* 0548B4 80053CB4 80CE01E3 */ lb $t6, 0x1e3($a2) -/* 0548B8 80053CB8 01826821 */ addu $t5, $t4, $v0 -/* 0548BC 80053CBC 8DA50004 */ lw $a1, 4($t5) -/* 0548C0 80053CC0 01C77824 */ and $t7, $t6, $a3 -/* 0548C4 80053CC4 15E0001A */ bnez $t7, .L80053D30 -/* 0548C8 80053CC8 00075840 */ sll $t3, $a3, 1 -/* 0548CC 80053CCC C4A00010 */ lwc1 $f0, 0x10($a1) -/* 0548D0 80053CD0 00000000 */ nop -/* 0548D4 80053CD4 46006281 */ sub.s $f10, $f12, $f0 -/* 0548D8 80053CD8 460051A1 */ cvt.d.s $f6, $f10 -/* 0548DC 80053CDC 462E3202 */ mul.d $f8, $f6, $f14 -/* 0548E0 80053CE0 46000121 */ cvt.d.s $f4, $f0 -/* 0548E4 80053CE4 46282280 */ add.d $f10, $f4, $f8 -/* 0548E8 80053CE8 462051A0 */ cvt.s.d $f6, $f10 -/* 0548EC 80053CEC E4A60010 */ swc1 $f6, 0x10($a1) -/* 0548F0 80053CF0 80D801E5 */ lb $t8, 0x1e5($a2) -/* 0548F4 80053CF4 00000000 */ nop -/* 0548F8 80053CF8 1300001F */ beqz $t8, .L80053D78 -/* 0548FC 80053CFC 00000000 */ nop -/* 054900 80053D00 8CB90040 */ lw $t9, 0x40($a1) -/* 054904 80053D04 C4A40008 */ lwc1 $f4, 8($a1) -/* 054908 80053D08 C728000C */ lwc1 $f8, 0xc($t9) -/* 05490C 80053D0C 46002021 */ cvt.d.s $f0, $f4 -/* 054910 80053D10 460042A1 */ cvt.d.s $f10, $f8 -/* 054914 80053D14 46305182 */ mul.d $f6, $f10, $f16 -/* 054918 80053D18 46203101 */ sub.d $f4, $f6, $f0 -/* 05491C 80053D1C 46322202 */ mul.d $f8, $f4, $f18 -/* 054920 80053D20 46280280 */ add.d $f10, $f0, $f8 -/* 054924 80053D24 462051A0 */ cvt.s.d $f6, $f10 -/* 054928 80053D28 10000013 */ b .L80053D78 -/* 05492C 80053D2C E4A60008 */ swc1 $f6, 8($a1) -.L80053D30: -/* 054930 80053D30 C4A40010 */ lwc1 $f4, 0x10($a1) -/* 054934 80053D34 8CAA0040 */ lw $t2, 0x40($a1) -/* 054938 80053D38 46002021 */ cvt.d.s $f0, $f4 -/* 05493C 80053D3C 462E0202 */ mul.d $f8, $f0, $f14 -/* 054940 80053D40 C4A20008 */ lwc1 $f2, 8($a1) -/* 054944 80053D44 00000000 */ nop -/* 054948 80053D48 46001121 */ cvt.d.s $f4, $f2 -/* 05494C 80053D4C 46280281 */ sub.d $f10, $f0, $f8 -/* 054950 80053D50 462051A0 */ cvt.s.d $f6, $f10 -/* 054954 80053D54 E4A60010 */ swc1 $f6, 0x10($a1) -/* 054958 80053D58 C548000C */ lwc1 $f8, 0xc($t2) -/* 05495C 80053D5C 00000000 */ nop -/* 054960 80053D60 46024281 */ sub.s $f10, $f8, $f2 -/* 054964 80053D64 460051A1 */ cvt.d.s $f6, $f10 -/* 054968 80053D68 46323202 */ mul.d $f8, $f6, $f18 -/* 05496C 80053D6C 46282280 */ add.d $f10, $f4, $f8 -/* 054970 80053D70 462051A0 */ cvt.s.d $f6, $f10 -/* 054974 80053D74 E4A60008 */ swc1 $f6, 8($a1) -.L80053D78: -/* 054978 80053D78 8C8C0060 */ lw $t4, 0x60($a0) -/* 05497C 80053D7C 80CE01E3 */ lb $t6, 0x1e3($a2) -/* 054980 80053D80 01826821 */ addu $t5, $t4, $v0 -/* 054984 80053D84 8DA50008 */ lw $a1, 8($t5) -/* 054988 80053D88 01CB7824 */ and $t7, $t6, $t3 -/* 05498C 80053D8C 15E0001A */ bnez $t7, .L80053DF8 -/* 054990 80053D90 01603825 */ move $a3, $t3 -/* 054994 80053D94 C4A00010 */ lwc1 $f0, 0x10($a1) -/* 054998 80053D98 00000000 */ nop -/* 05499C 80053D9C 46006201 */ sub.s $f8, $f12, $f0 -/* 0549A0 80053DA0 460042A1 */ cvt.d.s $f10, $f8 -/* 0549A4 80053DA4 462E5182 */ mul.d $f6, $f10, $f14 -/* 0549A8 80053DA8 46000121 */ cvt.d.s $f4, $f0 -/* 0549AC 80053DAC 46262200 */ add.d $f8, $f4, $f6 -/* 0549B0 80053DB0 462042A0 */ cvt.s.d $f10, $f8 -/* 0549B4 80053DB4 E4AA0010 */ swc1 $f10, 0x10($a1) -/* 0549B8 80053DB8 80D801E5 */ lb $t8, 0x1e5($a2) -/* 0549BC 80053DBC 00000000 */ nop -/* 0549C0 80053DC0 13000020 */ beqz $t8, .L80053E44 -/* 0549C4 80053DC4 00075840 */ sll $t3, $a3, 1 -/* 0549C8 80053DC8 8CB90040 */ lw $t9, 0x40($a1) -/* 0549CC 80053DCC C4A40008 */ lwc1 $f4, 8($a1) -/* 0549D0 80053DD0 C726000C */ lwc1 $f6, 0xc($t9) -/* 0549D4 80053DD4 46002021 */ cvt.d.s $f0, $f4 -/* 0549D8 80053DD8 46003221 */ cvt.d.s $f8, $f6 -/* 0549DC 80053DDC 46304282 */ mul.d $f10, $f8, $f16 -/* 0549E0 80053DE0 46205101 */ sub.d $f4, $f10, $f0 -/* 0549E4 80053DE4 46322182 */ mul.d $f6, $f4, $f18 -/* 0549E8 80053DE8 46260200 */ add.d $f8, $f0, $f6 -/* 0549EC 80053DEC 462042A0 */ cvt.s.d $f10, $f8 -/* 0549F0 80053DF0 10000013 */ b .L80053E40 -/* 0549F4 80053DF4 E4AA0008 */ swc1 $f10, 8($a1) -.L80053DF8: -/* 0549F8 80053DF8 C4A40010 */ lwc1 $f4, 0x10($a1) -/* 0549FC 80053DFC 8CAA0040 */ lw $t2, 0x40($a1) -/* 054A00 80053E00 46002021 */ cvt.d.s $f0, $f4 -/* 054A04 80053E04 462E0182 */ mul.d $f6, $f0, $f14 -/* 054A08 80053E08 C4A20008 */ lwc1 $f2, 8($a1) -/* 054A0C 80053E0C 00000000 */ nop -/* 054A10 80053E10 46001121 */ cvt.d.s $f4, $f2 -/* 054A14 80053E14 46260201 */ sub.d $f8, $f0, $f6 -/* 054A18 80053E18 462042A0 */ cvt.s.d $f10, $f8 -/* 054A1C 80053E1C E4AA0010 */ swc1 $f10, 0x10($a1) -/* 054A20 80053E20 C546000C */ lwc1 $f6, 0xc($t2) -/* 054A24 80053E24 00000000 */ nop -/* 054A28 80053E28 46023201 */ sub.s $f8, $f6, $f2 -/* 054A2C 80053E2C 460042A1 */ cvt.d.s $f10, $f8 -/* 054A30 80053E30 46325182 */ mul.d $f6, $f10, $f18 -/* 054A34 80053E34 46262200 */ add.d $f8, $f4, $f6 -/* 054A38 80053E38 462042A0 */ cvt.s.d $f10, $f8 -/* 054A3C 80053E3C E4AA0008 */ swc1 $f10, 8($a1) -.L80053E40: -/* 054A40 80053E40 00075840 */ sll $t3, $a3, 1 -.L80053E44: -/* 054A44 80053E44 24420008 */ addiu $v0, $v0, 8 -/* 054A48 80053E48 1443FF99 */ bne $v0, $v1, .L80053CB0 -/* 054A4C 80053E4C 01603825 */ move $a3, $t3 -/* 054A50 80053E50 3C028012 */ lui $v0, %hi(gCurrentStickX) # $v0, 0x8012 -/* 054A54 80053E54 2442D534 */ addiu $v0, %lo(gCurrentStickX) # addiu $v0, $v0, -0x2acc -/* 054A58 80053E58 8C4D0000 */ lw $t5, ($v0) -/* 054A5C 80053E5C 24030064 */ li $v1, 100 -/* 054A60 80053E60 01A30019 */ multu $t5, $v1 -/* 054A64 80053E64 8C8C0060 */ lw $t4, 0x60($a0) -/* 054A68 80053E68 00000000 */ nop -/* 054A6C 80053E6C 8D85000C */ lw $a1, 0xc($t4) -/* 054A70 80053E70 00007012 */ mflo $t6 -/* 054A74 80053E74 A4AE0000 */ sh $t6, ($a1) -/* 054A78 80053E78 8C580000 */ lw $t8, ($v0) -/* 054A7C 80053E7C 8C8F0060 */ lw $t7, 0x60($a0) -/* 054A80 80053E80 03030019 */ multu $t8, $v1 -/* 054A84 80053E84 8DE50010 */ lw $a1, 0x10($t7) -/* 054A88 80053E88 0000C812 */ mflo $t9 -/* 054A8C 80053E8C A4B90000 */ sh $t9, ($a1) -/* 054A90 80053E90 00000000 */ nop -.L80053E94: -/* 054A94 80053E94 03E00008 */ jr $ra -/* 054A98 80053E98 00000000 */ nop - diff --git a/asm/non_matchings/racer/func_8005698C.s b/asm/non_matchings/racer/func_8005698C.s deleted file mode 100644 index 5a070760..00000000 --- a/asm/non_matchings/racer/func_8005698C.s +++ /dev/null @@ -1,323 +0,0 @@ -.late_rodata -glabel D_800E68C4 -.float 10000.0 -glabel D_800E68C8 -.float 10000.0 - -.text -glabel func_8005698C -/* 05758C 8005698C 27BDFF48 */ addiu $sp, $sp, -0xb8 -/* 057590 80056990 AFBF004C */ sw $ra, 0x4c($sp) -/* 057594 80056994 AFB10048 */ sw $s1, 0x48($sp) -/* 057598 80056998 AFB00044 */ sw $s0, 0x44($sp) -/* 05759C 8005699C 00A08025 */ move $s0, $a1 -/* 0575A0 800569A0 00808825 */ move $s1, $a0 -/* 0575A4 800569A4 E7BF0038 */ swc1 $f31, 0x38($sp) -/* 0575A8 800569A8 E7BE003C */ swc1 $f30, 0x3c($sp) -/* 0575AC 800569AC E7BD0030 */ swc1 $f29, 0x30($sp) -/* 0575B0 800569B0 E7BC0034 */ swc1 $f28, 0x34($sp) -/* 0575B4 800569B4 E7BB0028 */ swc1 $f27, 0x28($sp) -/* 0575B8 800569B8 E7BA002C */ swc1 $f26, 0x2c($sp) -/* 0575BC 800569BC E7B90020 */ swc1 $f25, 0x20($sp) -/* 0575C0 800569C0 E7B80024 */ swc1 $f24, 0x24($sp) -/* 0575C4 800569C4 E7B70018 */ swc1 $f23, 0x18($sp) -/* 0575C8 800569C8 E7B6001C */ swc1 $f22, 0x1c($sp) -/* 0575CC 800569CC E7B50010 */ swc1 $f21, 0x10($sp) -/* 0575D0 800569D0 E7B40014 */ swc1 $f20, 0x14($sp) -/* 0575D4 800569D4 0C01AF66 */ jal get_current_level_race_type -/* 0575D8 800569D8 AFA600C0 */ sw $a2, 0xc0($sp) -/* 0575DC 800569DC 860E0000 */ lh $t6, ($s0) -/* 0575E0 800569E0 30440040 */ andi $a0, $v0, 0x40 -/* 0575E4 800569E4 2401FFFF */ li $at, -1 -/* 0575E8 800569E8 00404825 */ move $t1, $v0 -/* 0575EC 800569EC 15C1000C */ bne $t6, $at, .L80056A20 -/* 0575F0 800569F0 00805025 */ move $t2, $a0 -/* 0575F4 800569F4 1480000A */ bnez $a0, .L80056A20 -/* 0575F8 800569F8 24050001 */ li $a1, 1 -/* 0575FC 800569FC 44807000 */ mtc1 $zero, $f14 -/* 057600 80056A00 02002025 */ move $a0, $s0 -/* 057604 80056A04 27A600AC */ addiu $a2, $sp, 0xac -/* 057608 80056A08 0C006DEA */ jal func_8001B7A8 -/* 05760C 80056A0C E7AE00AC */ swc1 $f14, 0xac($sp) -/* 057610 80056A10 C7A400AC */ lwc1 $f4, 0xac($sp) -/* 057614 80056A14 8FAF00C0 */ lw $t7, 0xc0($sp) -/* 057618 80056A18 100000F3 */ b .L80056DE8 -/* 05761C 80056A1C E5E40000 */ swc1 $f4, ($t7) -.L80056A20: -/* 057620 80056A20 C612003C */ lwc1 $f18, 0x3c($s0) -/* 057624 80056A24 C6260010 */ lwc1 $f6, 0x10($s1) -/* 057628 80056A28 C6100038 */ lwc1 $f16, 0x38($s0) -/* 05762C 80056A2C 46123082 */ mul.s $f2, $f6, $f18 -/* 057630 80056A30 C620000C */ lwc1 $f0, 0xc($s1) -/* 057634 80056A34 C6140040 */ lwc1 $f20, 0x40($s0) -/* 057638 80056A38 C62C0014 */ lwc1 $f12, 0x14($s1) -/* 05763C 80056A3C 46100202 */ mul.s $f8, $f0, $f16 -/* 057640 80056A40 C6160050 */ lwc1 $f22, 0x50($s0) -/* 057644 80056A44 C6180058 */ lwc1 $f24, 0x58($s0) -/* 057648 80056A48 C61C0054 */ lwc1 $f28, 0x54($s0) -/* 05764C 80056A4C 46146102 */ mul.s $f4, $f12, $f20 -/* 057650 80056A50 46024280 */ add.s $f10, $f8, $f2 -/* 057654 80056A54 AFAA0068 */ sw $t2, 0x68($sp) -/* 057658 80056A58 AFA90064 */ sw $t1, 0x64($sp) -/* 05765C 80056A5C 46160182 */ mul.s $f6, $f0, $f22 -/* 057660 80056A60 46045680 */ add.s $f26, $f10, $f4 -/* 057664 80056A64 27A40070 */ addiu $a0, $sp, 0x70 -/* 057668 80056A68 E7B200A0 */ swc1 $f18, 0xa0($sp) -/* 05766C 80056A6C 46186282 */ mul.s $f10, $f12, $f24 -/* 057670 80056A70 46023200 */ add.s $f8, $f6, $f2 -/* 057674 80056A74 E7B000A8 */ swc1 $f16, 0xa8($sp) -/* 057678 80056A78 460A4780 */ add.s $f30, $f8, $f10 -/* 05767C 80056A7C 4600D687 */ neg.s $f26, $f26 -/* 057680 80056A80 0C006E9D */ jal get_racer_objects -/* 057684 80056A84 4600F787 */ neg.s $f30, $f30 -/* 057688 80056A88 3C01800E */ lui $at, %hi(D_800E68C4) # $at, 0x800e -/* 05768C 80056A8C C42C68C4 */ lwc1 $f12, %lo(D_800E68C4)($at) -/* 057690 80056A90 8FB80070 */ lw $t8, 0x70($sp) -/* 057694 80056A94 8FA90064 */ lw $t1, 0x64($sp) -/* 057698 80056A98 8FAA0068 */ lw $t2, 0x68($sp) -/* 05769C 80056A9C C7B000A8 */ lwc1 $f16, 0xa8($sp) -/* 0576A0 80056AA0 C7B200A0 */ lwc1 $f18, 0xa0($sp) -/* 0576A4 80056AA4 00004025 */ move $t0, $zero -/* 0576A8 80056AA8 00001825 */ move $v1, $zero -/* 0576AC 80056AAC 1B0000CA */ blez $t8, .L80056DD8 -/* 0576B0 80056AB0 E7AC0084 */ swc1 $f12, 0x84($sp) -/* 0576B4 80056AB4 33040001 */ andi $a0, $t8, 1 -/* 0576B8 80056AB8 10800046 */ beqz $a0, .L80056BD4 -/* 0576BC 80056ABC 8FAB0070 */ lw $t3, 0x70($sp) -/* 0576C0 80056AC0 8C440000 */ lw $a0, ($v0) -/* 0576C4 80056AC4 00000000 */ nop -/* 0576C8 80056AC8 1224003E */ beq $s1, $a0, .L80056BC4 -/* 0576CC 80056ACC 8FB80070 */ lw $t8, 0x70($sp) -/* 0576D0 80056AD0 11400007 */ beqz $t2, .L80056AF0 -/* 0576D4 80056AD4 00801825 */ move $v1, $a0 -/* 0576D8 80056AD8 8C990064 */ lw $t9, 0x64($a0) -/* 0576DC 80056ADC 00000000 */ nop -/* 0576E0 80056AE0 832C01D8 */ lb $t4, 0x1d8($t9) -/* 0576E4 80056AE4 00000000 */ nop -/* 0576E8 80056AE8 15800036 */ bnez $t4, .L80056BC4 -/* 0576EC 80056AEC 8FB80070 */ lw $t8, 0x70($sp) -.L80056AF0: -/* 0576F0 80056AF0 8C8E0064 */ lw $t6, 0x64($a0) -/* 0576F4 80056AF4 820D0212 */ lb $t5, 0x212($s0) -/* 0576F8 80056AF8 81CF0212 */ lb $t7, 0x212($t6) -/* 0576FC 80056AFC 00000000 */ nop -/* 057700 80056B00 15AF0030 */ bne $t5, $t7, .L80056BC4 -/* 057704 80056B04 8FB80070 */ lw $t8, 0x70($sp) -/* 057708 80056B08 C464000C */ lwc1 $f4, 0xc($v1) -/* 05770C 80056B0C C4680010 */ lwc1 $f8, 0x10($v1) -/* 057710 80056B10 46102182 */ mul.s $f6, $f4, $f16 -/* 057714 80056B14 44807000 */ mtc1 $zero, $f14 -/* 057718 80056B18 46089282 */ mul.s $f10, $f18, $f8 -/* 05771C 80056B1C C4680014 */ lwc1 $f8, 0x14($v1) -/* 057720 80056B20 460A3100 */ add.s $f4, $f6, $f10 -/* 057724 80056B24 4608A182 */ mul.s $f6, $f20, $f8 -/* 057728 80056B28 46062280 */ add.s $f10, $f4, $f6 -/* 05772C 80056B2C 461A5200 */ add.s $f8, $f10, $f26 -/* 057730 80056B30 46004107 */ neg.s $f4, $f8 -/* 057734 80056B34 4604703C */ c.lt.s $f14, $f4 -/* 057738 80056B38 E7A400AC */ swc1 $f4, 0xac($sp) -/* 05773C 80056B3C 45000021 */ bc1f .L80056BC4 -/* 057740 80056B40 8FB80070 */ lw $t8, 0x70($sp) -/* 057744 80056B44 C466000C */ lwc1 $f6, 0xc($v1) -/* 057748 80056B48 C4680010 */ lwc1 $f8, 0x10($v1) -/* 05774C 80056B4C 46163282 */ mul.s $f10, $f6, $f22 -/* 057750 80056B50 24010008 */ li $at, 8 -/* 057754 80056B54 4608E102 */ mul.s $f4, $f28, $f8 -/* 057758 80056B58 C4680014 */ lwc1 $f8, 0x14($v1) -/* 05775C 80056B5C 46045180 */ add.s $f6, $f10, $f4 -/* 057760 80056B60 4608C282 */ mul.s $f10, $f24, $f8 -/* 057764 80056B64 C7A800AC */ lwc1 $f8, 0xac($sp) -/* 057768 80056B68 460A3100 */ add.s $f4, $f6, $f10 -/* 05776C 80056B6C 461E2080 */ add.s $f2, $f4, $f30 -/* 057770 80056B70 460E103C */ c.lt.s $f2, $f14 -/* 057774 80056B74 46001006 */ mov.s $f0, $f2 -/* 057778 80056B78 45000002 */ bc1f .L80056B84 -/* 05777C 80056B7C 00000000 */ nop -/* 057780 80056B80 46001007 */ neg.s $f0, $f2 -.L80056B84: -/* 057784 80056B84 4608003C */ c.lt.s $f0, $f8 -/* 057788 80056B88 00000000 */ nop -/* 05778C 80056B8C 45010002 */ bc1t .L80056B98 -/* 057790 80056B90 00000000 */ nop -/* 057794 80056B94 1521000A */ bne $t1, $at, .L80056BC0 -.L80056B98: -/* 057798 80056B98 3C01800E */ lui $at, %hi(D_800E68C8) # $at, 0x800e -/* 05779C 80056B9C C42668C8 */ lwc1 $f6, %lo(D_800E68C8)($at) -/* 0577A0 80056BA0 C7AA00AC */ lwc1 $f10, 0xac($sp) -/* 0577A4 80056BA4 4606003C */ c.lt.s $f0, $f6 -/* 0577A8 80056BA8 00000000 */ nop -/* 0577AC 80056BAC 45000005 */ bc1f .L80056BC4 -/* 0577B0 80056BB0 8FB80070 */ lw $t8, 0x70($sp) -/* 0577B4 80056BB4 E7AA0084 */ swc1 $f10, 0x84($sp) -/* 0577B8 80056BB8 46000306 */ mov.s $f12, $f0 -/* 0577BC 80056BBC 00604025 */ move $t0, $v1 -.L80056BC0: -/* 0577C0 80056BC0 8FB80070 */ lw $t8, 0x70($sp) -.L80056BC4: -/* 0577C4 80056BC4 24030001 */ li $v1, 1 -/* 0577C8 80056BC8 10780083 */ beq $v1, $t8, .L80056DD8 -/* 0577CC 80056BCC 00000000 */ nop -/* 0577D0 80056BD0 8FAB0070 */ lw $t3, 0x70($sp) -.L80056BD4: -/* 0577D4 80056BD4 00033880 */ sll $a3, $v1, 2 -/* 0577D8 80056BD8 000BC880 */ sll $t9, $t3, 2 -/* 0577DC 80056BDC 44807000 */ mtc1 $zero, $f14 -/* 0577E0 80056BE0 03205825 */ move $t3, $t9 -/* 0577E4 80056BE4 00473021 */ addu $a2, $v0, $a3 -.L80056BE8: -/* 0577E8 80056BE8 8CC40000 */ lw $a0, ($a2) -/* 0577EC 80056BEC 24E70008 */ addiu $a3, $a3, 8 -/* 0577F0 80056BF0 1224003B */ beq $s1, $a0, .L80056CE0 -/* 0577F4 80056BF4 00000000 */ nop -/* 0577F8 80056BF8 11400007 */ beqz $t2, .L80056C18 -/* 0577FC 80056BFC 00801825 */ move $v1, $a0 -/* 057800 80056C00 8C8C0064 */ lw $t4, 0x64($a0) -/* 057804 80056C04 00000000 */ nop -/* 057808 80056C08 818E01D8 */ lb $t6, 0x1d8($t4) -/* 05780C 80056C0C 00000000 */ nop -/* 057810 80056C10 15C00033 */ bnez $t6, .L80056CE0 -/* 057814 80056C14 00000000 */ nop -.L80056C18: -/* 057818 80056C18 8C8F0064 */ lw $t7, 0x64($a0) -/* 05781C 80056C1C 820D0212 */ lb $t5, 0x212($s0) -/* 057820 80056C20 81F80212 */ lb $t8, 0x212($t7) -/* 057824 80056C24 00000000 */ nop -/* 057828 80056C28 15B8002D */ bne $t5, $t8, .L80056CE0 -/* 05782C 80056C2C 00000000 */ nop -/* 057830 80056C30 C464000C */ lwc1 $f4, 0xc($v1) -/* 057834 80056C34 C4660010 */ lwc1 $f6, 0x10($v1) -/* 057838 80056C38 46102202 */ mul.s $f8, $f4, $f16 -/* 05783C 80056C3C 00000000 */ nop -/* 057840 80056C40 46069282 */ mul.s $f10, $f18, $f6 -/* 057844 80056C44 C4660014 */ lwc1 $f6, 0x14($v1) -/* 057848 80056C48 460A4100 */ add.s $f4, $f8, $f10 -/* 05784C 80056C4C 4606A202 */ mul.s $f8, $f20, $f6 -/* 057850 80056C50 46082280 */ add.s $f10, $f4, $f8 -/* 057854 80056C54 461A5180 */ add.s $f6, $f10, $f26 -/* 057858 80056C58 46003107 */ neg.s $f4, $f6 -/* 05785C 80056C5C 4604703C */ c.lt.s $f14, $f4 -/* 057860 80056C60 E7A400AC */ swc1 $f4, 0xac($sp) -/* 057864 80056C64 4500001E */ bc1f .L80056CE0 -/* 057868 80056C68 00000000 */ nop -/* 05786C 80056C6C C468000C */ lwc1 $f8, 0xc($v1) -/* 057870 80056C70 C4660010 */ lwc1 $f6, 0x10($v1) -/* 057874 80056C74 46164282 */ mul.s $f10, $f8, $f22 -/* 057878 80056C78 24010008 */ li $at, 8 -/* 05787C 80056C7C 4606E102 */ mul.s $f4, $f28, $f6 -/* 057880 80056C80 C4660014 */ lwc1 $f6, 0x14($v1) -/* 057884 80056C84 46045200 */ add.s $f8, $f10, $f4 -/* 057888 80056C88 4606C282 */ mul.s $f10, $f24, $f6 -/* 05788C 80056C8C C7A600AC */ lwc1 $f6, 0xac($sp) -/* 057890 80056C90 460A4100 */ add.s $f4, $f8, $f10 -/* 057894 80056C94 461E2080 */ add.s $f2, $f4, $f30 -/* 057898 80056C98 460E103C */ c.lt.s $f2, $f14 -/* 05789C 80056C9C 46001006 */ mov.s $f0, $f2 -/* 0578A0 80056CA0 45000002 */ bc1f .L80056CAC -/* 0578A4 80056CA4 00000000 */ nop -/* 0578A8 80056CA8 46001007 */ neg.s $f0, $f2 -.L80056CAC: -/* 0578AC 80056CAC 4606003C */ c.lt.s $f0, $f6 -/* 0578B0 80056CB0 00000000 */ nop -/* 0578B4 80056CB4 45010003 */ bc1t .L80056CC4 -/* 0578B8 80056CB8 00000000 */ nop -/* 0578BC 80056CBC 15210008 */ bne $t1, $at, .L80056CE0 -/* 0578C0 80056CC0 00000000 */ nop -.L80056CC4: -/* 0578C4 80056CC4 460C003C */ c.lt.s $f0, $f12 -/* 0578C8 80056CC8 C7A800AC */ lwc1 $f8, 0xac($sp) -/* 0578CC 80056CCC 45000004 */ bc1f .L80056CE0 -/* 0578D0 80056CD0 00000000 */ nop -/* 0578D4 80056CD4 E7A80084 */ swc1 $f8, 0x84($sp) -/* 0578D8 80056CD8 46000306 */ mov.s $f12, $f0 -/* 0578DC 80056CDC 00604025 */ move $t0, $v1 -.L80056CE0: -/* 0578E0 80056CE0 8CC40004 */ lw $a0, 4($a2) -/* 0578E4 80056CE4 00000000 */ nop -/* 0578E8 80056CE8 12240039 */ beq $s1, $a0, .L80056DD0 -/* 0578EC 80056CEC 00000000 */ nop -/* 0578F0 80056CF0 8C850064 */ lw $a1, 0x64($a0) -/* 0578F4 80056CF4 11400005 */ beqz $t2, .L80056D0C -/* 0578F8 80056CF8 00801825 */ move $v1, $a0 -/* 0578FC 80056CFC 80B901D8 */ lb $t9, 0x1d8($a1) -/* 057900 80056D00 00000000 */ nop -/* 057904 80056D04 17200032 */ bnez $t9, .L80056DD0 -/* 057908 80056D08 00000000 */ nop -.L80056D0C: -/* 05790C 80056D0C 820C0212 */ lb $t4, 0x212($s0) -/* 057910 80056D10 80AE0212 */ lb $t6, 0x212($a1) -/* 057914 80056D14 00000000 */ nop -/* 057918 80056D18 158E002D */ bne $t4, $t6, .L80056DD0 -/* 05791C 80056D1C 00000000 */ nop -/* 057920 80056D20 C46A000C */ lwc1 $f10, 0xc($v1) -/* 057924 80056D24 C4660010 */ lwc1 $f6, 0x10($v1) -/* 057928 80056D28 46105102 */ mul.s $f4, $f10, $f16 -/* 05792C 80056D2C 00000000 */ nop -/* 057930 80056D30 46069202 */ mul.s $f8, $f18, $f6 -/* 057934 80056D34 C4660014 */ lwc1 $f6, 0x14($v1) -/* 057938 80056D38 46082280 */ add.s $f10, $f4, $f8 -/* 05793C 80056D3C 4606A102 */ mul.s $f4, $f20, $f6 -/* 057940 80056D40 46045200 */ add.s $f8, $f10, $f4 -/* 057944 80056D44 461A4180 */ add.s $f6, $f8, $f26 -/* 057948 80056D48 46003287 */ neg.s $f10, $f6 -/* 05794C 80056D4C 460A703C */ c.lt.s $f14, $f10 -/* 057950 80056D50 E7AA00AC */ swc1 $f10, 0xac($sp) -/* 057954 80056D54 4500001E */ bc1f .L80056DD0 -/* 057958 80056D58 00000000 */ nop -/* 05795C 80056D5C C464000C */ lwc1 $f4, 0xc($v1) -/* 057960 80056D60 C4660010 */ lwc1 $f6, 0x10($v1) -/* 057964 80056D64 46162202 */ mul.s $f8, $f4, $f22 -/* 057968 80056D68 24010008 */ li $at, 8 -/* 05796C 80056D6C 4606E282 */ mul.s $f10, $f28, $f6 -/* 057970 80056D70 C4660014 */ lwc1 $f6, 0x14($v1) -/* 057974 80056D74 460A4100 */ add.s $f4, $f8, $f10 -/* 057978 80056D78 4606C202 */ mul.s $f8, $f24, $f6 -/* 05797C 80056D7C C7A600AC */ lwc1 $f6, 0xac($sp) -/* 057980 80056D80 46082280 */ add.s $f10, $f4, $f8 -/* 057984 80056D84 461E5080 */ add.s $f2, $f10, $f30 -/* 057988 80056D88 460E103C */ c.lt.s $f2, $f14 -/* 05798C 80056D8C 46001006 */ mov.s $f0, $f2 -/* 057990 80056D90 45000002 */ bc1f .L80056D9C -/* 057994 80056D94 00000000 */ nop -/* 057998 80056D98 46001007 */ neg.s $f0, $f2 -.L80056D9C: -/* 05799C 80056D9C 4606003C */ c.lt.s $f0, $f6 -/* 0579A0 80056DA0 00000000 */ nop -/* 0579A4 80056DA4 45010003 */ bc1t .L80056DB4 -/* 0579A8 80056DA8 00000000 */ nop -/* 0579AC 80056DAC 15210008 */ bne $t1, $at, .L80056DD0 -/* 0579B0 80056DB0 00000000 */ nop -.L80056DB4: -/* 0579B4 80056DB4 460C003C */ c.lt.s $f0, $f12 -/* 0579B8 80056DB8 C7A400AC */ lwc1 $f4, 0xac($sp) -/* 0579BC 80056DBC 45000004 */ bc1f .L80056DD0 -/* 0579C0 80056DC0 00000000 */ nop -/* 0579C4 80056DC4 E7A40084 */ swc1 $f4, 0x84($sp) -/* 0579C8 80056DC8 46000306 */ mov.s $f12, $f0 -/* 0579CC 80056DCC 00604025 */ move $t0, $v1 -.L80056DD0: -/* 0579D0 80056DD0 14EBFF85 */ bne $a3, $t3, .L80056BE8 -/* 0579D4 80056DD4 24C60008 */ addiu $a2, $a2, 8 -.L80056DD8: -/* 0579D8 80056DD8 C7A80084 */ lwc1 $f8, 0x84($sp) -/* 0579DC 80056DDC 8FAF00C0 */ lw $t7, 0xc0($sp) -/* 0579E0 80056DE0 01001025 */ move $v0, $t0 -/* 0579E4 80056DE4 E5E80000 */ swc1 $f8, ($t7) -.L80056DE8: -/* 0579E8 80056DE8 8FBF004C */ lw $ra, 0x4c($sp) -/* 0579EC 80056DEC C7B50010 */ lwc1 $f21, 0x10($sp) -/* 0579F0 80056DF0 C7B40014 */ lwc1 $f20, 0x14($sp) -/* 0579F4 80056DF4 C7B70018 */ lwc1 $f23, 0x18($sp) -/* 0579F8 80056DF8 C7B6001C */ lwc1 $f22, 0x1c($sp) -/* 0579FC 80056DFC C7B90020 */ lwc1 $f25, 0x20($sp) -/* 057A00 80056E00 C7B80024 */ lwc1 $f24, 0x24($sp) -/* 057A04 80056E04 C7BB0028 */ lwc1 $f27, 0x28($sp) -/* 057A08 80056E08 C7BA002C */ lwc1 $f26, 0x2c($sp) -/* 057A0C 80056E0C C7BD0030 */ lwc1 $f29, 0x30($sp) -/* 057A10 80056E10 C7BC0034 */ lwc1 $f28, 0x34($sp) -/* 057A14 80056E14 C7BF0038 */ lwc1 $f31, 0x38($sp) -/* 057A18 80056E18 C7BE003C */ lwc1 $f30, 0x3c($sp) -/* 057A1C 80056E1C 8FB00044 */ lw $s0, 0x44($sp) -/* 057A20 80056E20 8FB10048 */ lw $s1, 0x48($sp) -/* 057A24 80056E24 03E00008 */ jr $ra -/* 057A28 80056E28 27BD00B8 */ addiu $sp, $sp, 0xb8 - diff --git a/include/f3ddkr.h b/include/f3ddkr.h index 534b96ec..f475758c 100644 --- a/include/f3ddkr.h +++ b/include/f3ddkr.h @@ -101,7 +101,7 @@ _g->words.w1 = (unsigned int)(ptr); \ } -#define numberOfGfxCommands(gfxCmds) (sizeof(gfxCmds) / sizeof(Gwords)) +#define numberOfGfxCommands(gfxCmds) (sizeof(gfxCmds) / sizeof(Gfx)) #define gDkrDmaDisplayList(pkt, address, numberOfCommands) \ { \ diff --git a/include/structs.h b/include/structs.h index ba905255..1b0021db 100644 --- a/include/structs.h +++ b/include/structs.h @@ -1304,7 +1304,7 @@ typedef struct Object_Racer { /* 0x1A4 */ s16 x_rotation_vel; /* 0x1A6 */ s16 z_rotation_vel; /* 0x1A8 */ s16 unk1A8; - /* 0x1AA */ u16 unk1AA; + /* 0x1AA */ s16 unk1AA; /* 0x1AC */ s16 finishPosition; /* 0x1AE */ s16 racePosition; /* 0x1B0 */ s16 unk1B0; @@ -1519,11 +1519,6 @@ typedef struct Object_Bridge_WhaleRamp { /* 0x4 */ SoundMask *soundMask; } Object_Bridge_WhaleRamp; -typedef struct Object_8001B7A8 { - u8 pad0[0x112]; - /* 0x112 */ s16 unk112; -} Object_8001B7A8; - typedef struct Object_64_80021400 { /* 0x00 */ u8 pad[0x2A]; /* 0x2A */ s16 unk2A; @@ -1798,9 +1793,7 @@ typedef struct unk800B2260_C { /* Size: 0x018 bytes */ typedef struct ObjectTransform { - /* 0x0000 */ s16 y_rotation; - /* 0x0002 */ s16 x_rotation; - /* 0x0004 */ s16 z_rotation; + /* 0x0000 */ Vec3s rotation; /* 0x0006 */ s16 flags; /* 0x0008 */ f32 scale; /* 0x000C */ f32 x_position; @@ -1910,7 +1903,7 @@ typedef struct Object { /* 0x008C */ u32 unk8C; /* 0x0090 */ u32 unk90; /* 0x0094 */ u32 unk94; - /* 0x0098 */ Object_8001B7A8 obj; + /* 0x0098 */ s32 unk98; } Object; // Unused diff --git a/src/audio_vehicle.c b/src/audio_vehicle.c index c250f3df..340e02d5 100644 --- a/src/audio_vehicle.c +++ b/src/audio_vehicle.c @@ -525,8 +525,8 @@ void func_800063EC(Object *obj, UNUSED u32 buttonsPressed, u32 buttonsHeld, s32 gRacerSound->throttlePitch = 0.0f; } var_f14 += gRacerSound->throttlePitch; - sp28 = sins_f(obj->segment.trans.x_rotation); - var_f2 = sins_f(obj->segment.trans.z_rotation) * gRacerSound->unkC0; + sp28 = sins_f(obj->segment.trans.rotation.x_rotation); + var_f2 = sins_f(obj->segment.trans.rotation.z_rotation) * gRacerSound->unkC0; if (var_f2 < 0.0f) { var_f2 = -var_f2; } @@ -722,7 +722,8 @@ void func_80006FC8(Object **objs, s32 numRacers, ObjectSegment *segment, u8 arg3 var_f26 = 2250000.0f; //(1500.0f * 1500.0f) var_f26 = (var_f26 - (gRacerSound->unk84 * gRacerSound->unk84)) / var_f26; var_f26 *= var_f26; - gRacerSound->unk91[0] = func_800090C0(tempxPos, tempzPos, segment[loopCount1].trans.y_rotation); + gRacerSound->unk91[0] = + func_800090C0(tempxPos, tempzPos, segment[loopCount1].trans.rotation.y_rotation); } else { var_f26 = 0.0f; } @@ -841,7 +842,8 @@ void func_80006FC8(Object **objs, s32 numRacers, ObjectSegment *segment, u8 arg3 temp_s3 *= 0.8; if (gRacerSound->unk88 < temp_s3) { gRacerSound->unk88 = temp_s3; - gRacerSound->unk91[0] = func_800090C0(tempxPos, tempzPos, segment->trans.y_rotation); + gRacerSound->unk91[0] = + func_800090C0(tempxPos, tempzPos, segment->trans.rotation.y_rotation); if (racer->raceFinished != 0) { func_80006BFC(objs[loopCount1], segment, objs[loopCount2], updateRate); } else { diff --git a/src/camera.c b/src/camera.c index 88e519eb..ffcc2faf 100644 --- a/src/camera.c +++ b/src/camera.c @@ -60,11 +60,11 @@ Vp gViewportStack[20] = { }; ObjectTransform D_800DD288 = { - 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, -281.0f, + { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, -281.0f, }; ObjectTransform D_800DD2A0 = { - 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f, + { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f, }; Matrix gOrthoMatrixF = { @@ -248,16 +248,16 @@ void camera_init_tracks_menu(Gfx **dList, MatrixS **mtxS) { set_active_viewports_and_max(0); set_active_camera(0); cam = get_active_camera_segment(); - angleY = cam->trans.y_rotation; - angleX = cam->trans.x_rotation; - angleZ = cam->trans.z_rotation; + angleY = cam->trans.rotation.y_rotation; + angleX = cam->trans.rotation.x_rotation; + angleZ = cam->trans.rotation.z_rotation; posX = cam->trans.x_position; posY = cam->trans.y_position; posZ = cam->trans.z_position; sp24 = cam->camera.unk38; - cam->trans.z_rotation = 0; - cam->trans.x_rotation = 0; - cam->trans.y_rotation = -0x8000; + cam->trans.rotation.z_rotation = 0; + cam->trans.rotation.x_rotation = 0; + cam->trans.rotation.y_rotation = -0x8000; cam->camera.unk38 = 0; cam->trans.x_position = 0.0f; cam->trans.y_position = 0.0f; @@ -265,9 +265,9 @@ void camera_init_tracks_menu(Gfx **dList, MatrixS **mtxS) { update_envmap_position(0.0f, 0.0f, -1.0f); func_80066CDC(dList, mtxS); cam->camera.unk38 = sp24; - cam->trans.y_rotation = angleY; - cam->trans.x_rotation = angleX; - cam->trans.z_rotation = angleZ; + cam->trans.rotation.y_rotation = angleY; + cam->trans.rotation.x_rotation = angleX; + cam->trans.rotation.z_rotation = angleZ; cam->trans.x_position = posX; cam->trans.y_position = posY; cam->trans.z_position = posZ; @@ -297,18 +297,18 @@ f32 get_distance_to_active_camera(f32 xPos, f32 yPos, f32 zPos) { * Also sets the other properties of the camera to a default. */ void camera_reset(s32 xPos, s32 yPos, s32 zPos, s32 angleZ, s32 angleX, s32 angleY) { - gCameraSegment[gActiveCameraID].trans.z_rotation = (s16) (angleZ * 0xB6); + gCameraSegment[gActiveCameraID].trans.rotation.z_rotation = (s16) (angleZ * 0xB6); gCameraSegment[gActiveCameraID].trans.x_position = (f32) xPos; gCameraSegment[gActiveCameraID].trans.y_position = (f32) yPos; gCameraSegment[gActiveCameraID].trans.z_position = (f32) zPos; - gCameraSegment[gActiveCameraID].trans.x_rotation = (s16) (angleX * 0xB6); + gCameraSegment[gActiveCameraID].trans.rotation.x_rotation = (s16) (angleX * 0xB6); gCameraSegment[gActiveCameraID].camera.unk38 = 0; gCameraSegment[gActiveCameraID].z_velocity = 0.0f; gCameraSegment[gActiveCameraID].unk28 = 0.0f; gCameraSegment[gActiveCameraID].camera.unk2C = 0.0f; gCameraSegment[gActiveCameraID].camera.distanceToCamera = 0.0f; gCameraSegment[gActiveCameraID].x_velocity = 160.0f; - gCameraSegment[gActiveCameraID].trans.y_rotation = (s16) (angleY * 0xB6); + gCameraSegment[gActiveCameraID].trans.rotation.y_rotation = (s16) (angleY * 0xB6); gCameraSegment[gActiveCameraID].object.animationID = gCameraZoomLevels[gActiveCameraID]; } @@ -323,9 +323,9 @@ void write_to_object_render_stack(s32 stackPos, f32 xPos, f32 yPos, f32 zPos, s1 gCameraSegment[stackPos].trans.x_position = xPos; gCameraSegment[stackPos].trans.y_position = yPos; gCameraSegment[stackPos].trans.z_position = zPos; - gCameraSegment[stackPos].trans.y_rotation = arg4; - gCameraSegment[stackPos].trans.x_rotation = arg5; - gCameraSegment[stackPos].trans.z_rotation = arg6; + gCameraSegment[stackPos].trans.rotation.y_rotation = arg4; + gCameraSegment[stackPos].trans.rotation.x_rotation = arg5; + gCameraSegment[stackPos].trans.rotation.z_rotation = arg6; gCameraSegment[stackPos].object.cameraSegmentID = get_level_segment_index_from_position(xPos, yPos, zPos); gCutsceneCameraActive = TRUE; } @@ -868,10 +868,10 @@ void func_80067D3C(Gfx **dlist, UNUSED MatrixS **mats) { gActiveCameraID += 4; } - gCameraTransform.y_rotation = 0x8000 + gCameraSegment[gActiveCameraID].trans.y_rotation; - gCameraTransform.x_rotation = - gCameraSegment[gActiveCameraID].trans.x_rotation + gCameraSegment[gActiveCameraID].camera.unk38; - gCameraTransform.z_rotation = gCameraSegment[gActiveCameraID].trans.z_rotation; + gCameraTransform.rotation.y_rotation = 0x8000 + gCameraSegment[gActiveCameraID].trans.rotation.y_rotation; + gCameraTransform.rotation.x_rotation = + gCameraSegment[gActiveCameraID].trans.rotation.x_rotation + gCameraSegment[gActiveCameraID].camera.unk38; + gCameraTransform.rotation.z_rotation = gCameraSegment[gActiveCameraID].trans.rotation.z_rotation; gCameraTransform.x_position = -gCameraSegment[gActiveCameraID].trans.x_position; gCameraTransform.y_position = -gCameraSegment[gActiveCameraID].trans.y_position; @@ -883,10 +883,10 @@ void func_80067D3C(Gfx **dlist, UNUSED MatrixS **mats) { object_transform_to_matrix_2(gCameraMatrixF, &gCameraTransform); f32_matrix_mult(&gCameraMatrixF, &gPerspectiveMatrixF, &gViewMatrixF); - gCameraTransform.y_rotation = -0x8000 - gCameraSegment[gActiveCameraID].trans.y_rotation; - gCameraTransform.x_rotation = - -(gCameraSegment[gActiveCameraID].trans.x_rotation + gCameraSegment[gActiveCameraID].camera.unk38); - gCameraTransform.z_rotation = -gCameraSegment[gActiveCameraID].trans.z_rotation; + gCameraTransform.rotation.y_rotation = -0x8000 - gCameraSegment[gActiveCameraID].trans.rotation.y_rotation; + gCameraTransform.rotation.x_rotation = + -(gCameraSegment[gActiveCameraID].trans.rotation.x_rotation + gCameraSegment[gActiveCameraID].camera.unk38); + gCameraTransform.rotation.z_rotation = -gCameraSegment[gActiveCameraID].trans.rotation.z_rotation; gCameraTransform.scale = 1.0f; gCameraTransform.x_position = gCameraSegment[gActiveCameraID].trans.x_position; gCameraTransform.y_position = gCameraSegment[gActiveCameraID].trans.y_position; @@ -1053,8 +1053,8 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj diffX = gModelMatrixViewX[gCameraMatrixPos] - obj->segment.trans.x_position; diffY = gModelMatrixViewY[gCameraMatrixPos] - obj->segment.trans.y_position; diffZ = gModelMatrixViewZ[gCameraMatrixPos] - obj->segment.trans.z_position; - sineY = sins_f(obj->segment.trans.y_rotation); - cosY = coss_f(obj->segment.trans.y_rotation); + sineY = sins_f(obj->segment.trans.rotation.y_rotation); + cosY = coss_f(obj->segment.trans.rotation.y_rotation); sp44 = (diffX * cosY) + (diffZ * sineY); diffZ = (diffZ * cosY) - (diffX * sineY); tanY = arctan2_f(sp44, sqrtf((diffY * diffY) + (diffZ * diffZ))); @@ -1081,9 +1081,9 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj diffY = gModelMatrixViewY[gCameraMatrixPos] - obj->segment.trans.y_position; diffZ = gModelMatrixViewZ[gCameraMatrixPos] - obj->segment.trans.z_position; lateralDist = sqrtf((diffX * diffX) + (diffZ * diffZ)); - gCameraTransform.y_rotation = arctan2_f(diffX, diffZ); - gCameraTransform.x_rotation = -arctan2_f(diffY, lateralDist); - gCameraTransform.z_rotation = angleDiff; + gCameraTransform.rotation.y_rotation = arctan2_f(diffX, diffZ); + gCameraTransform.rotation.x_rotation = -arctan2_f(diffY, lateralDist); + gCameraTransform.rotation.z_rotation = angleDiff; gCameraTransform.scale = obj->segment.trans.scale; gCameraTransform.x_position = obj->segment.trans.x_position; gCameraTransform.y_position = obj->segment.trans.y_position; @@ -1109,9 +1109,11 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj gSPVertexDKR((*dlist)++, OS_PHYSICAL_TO_K0(*vertexList), 1, 0); (*vertexList)++; if (gCutsceneCameraActive == 0) { - angleDiff = gCameraSegment[gActiveCameraID].trans.z_rotation + obj->segment.trans.z_rotation; + angleDiff = + gCameraSegment[gActiveCameraID].trans.rotation.z_rotation + obj->segment.trans.rotation.z_rotation; } else { - angleDiff = gCameraSegment[gActiveCameraID + 4].trans.z_rotation + obj->segment.trans.z_rotation; + angleDiff = + gCameraSegment[gActiveCameraID + 4].trans.rotation.z_rotation + obj->segment.trans.rotation.z_rotation; } textureFrame = obj->segment.animFrame; gModelMatrixStackPos++; @@ -1172,9 +1174,10 @@ void render_ortho_triangle_image(Gfx **dList, MatrixS **mtx, Vertex **vtx, Objec (*vtx)++; // Can't be done in the macro? index = segment->animFrame; gModelMatrixStackPos++; - gCameraTransform.y_rotation = -segment->trans.y_rotation; - gCameraTransform.x_rotation = -segment->trans.x_rotation; - gCameraTransform.z_rotation = gCameraSegment[gActiveCameraID].trans.z_rotation + segment->trans.z_rotation; + gCameraTransform.rotation.y_rotation = -segment->trans.rotation.y_rotation; + gCameraTransform.rotation.x_rotation = -segment->trans.rotation.x_rotation; + gCameraTransform.rotation.z_rotation = + gCameraSegment[gActiveCameraID].trans.rotation.z_rotation + segment->trans.rotation.z_rotation; gCameraTransform.x_position = 0.0f; gCameraTransform.y_position = 0.0f; gCameraTransform.z_position = 0.0f; @@ -1236,19 +1239,19 @@ void apply_object_shear_matrix(Gfx **dList, MatrixS **mtx, Object *arg2, Object f32 arg3_zPos; Matrix matrix_mult; - cossf_x_arg2 = coss_f(arg2->segment.trans.x_rotation); - sinsf_x_arg2 = sins_f(arg2->segment.trans.x_rotation); - cossf_y_arg2 = coss_f(arg2->segment.trans.y_rotation); - sinsf_y_arg2 = sins_f(arg2->segment.trans.y_rotation); + cossf_x_arg2 = coss_f(arg2->segment.trans.rotation.x_rotation); + sinsf_x_arg2 = sins_f(arg2->segment.trans.rotation.x_rotation); + cossf_y_arg2 = coss_f(arg2->segment.trans.rotation.y_rotation); + sinsf_y_arg2 = sins_f(arg2->segment.trans.rotation.y_rotation); arg2_xPos = arg2->segment.trans.x_position; arg2_yPos = arg2->segment.trans.y_position; arg2_zPos = arg2->segment.trans.z_position; - cossf_z_arg3 = coss_f(arg3->segment.trans.z_rotation); - sinsf_z_arg3 = sins_f(arg3->segment.trans.z_rotation); - cossf_x_arg3 = coss_f(arg3->segment.trans.x_rotation); - sinsf_x_arg3 = sins_f(arg3->segment.trans.x_rotation); - cossf_y_arg3 = coss_f(arg3->segment.trans.y_rotation); - sinsf_y_arg3 = sins_f(arg3->segment.trans.y_rotation); + cossf_z_arg3 = coss_f(arg3->segment.trans.rotation.z_rotation); + sinsf_z_arg3 = sins_f(arg3->segment.trans.rotation.z_rotation); + cossf_x_arg3 = coss_f(arg3->segment.trans.rotation.x_rotation); + sinsf_x_arg3 = sins_f(arg3->segment.trans.rotation.x_rotation); + cossf_y_arg3 = coss_f(arg3->segment.trans.rotation.y_rotation); + sinsf_y_arg3 = sins_f(arg3->segment.trans.rotation.y_rotation); arg3_xPos = arg3->segment.trans.x_position; arg3_yPos = arg3->segment.trans.y_position; arg3_zPos = arg3->segment.trans.z_position; @@ -1352,9 +1355,9 @@ void camera_push_model_mtx(Gfx **dList, MatrixS **mtx, ObjectTransform *trans, f tempX = gCameraSegment[index].trans.x_position - tempX; tempY = gCameraSegment[index].trans.y_position - tempY; tempZ = gCameraSegment[index].trans.z_position - tempZ; - gCameraTransform.y_rotation = -trans->y_rotation; - gCameraTransform.x_rotation = -trans->x_rotation; - gCameraTransform.z_rotation = -trans->z_rotation; + gCameraTransform.rotation.y_rotation = -trans->rotation.y_rotation; + gCameraTransform.rotation.x_rotation = -trans->rotation.x_rotation; + gCameraTransform.rotation.z_rotation = -trans->rotation.z_rotation; gCameraTransform.x_position = 0.0f; gCameraTransform.y_position = 0.0f; gCameraTransform.z_position = 0.0f; @@ -1472,10 +1475,14 @@ UNUSED void translate_camera_segment(f32 x, f32 y, f32 z) { * Also recalculates which block it's in. */ UNUSED void transform_camera_segment(f32 x, UNUSED f32 y, f32 z) { - gCameraSegment[gActiveCameraID].trans.x_position -= x * coss_f(gCameraSegment[gActiveCameraID].trans.y_rotation); - gCameraSegment[gActiveCameraID].trans.z_position -= x * sins_f(gCameraSegment[gActiveCameraID].trans.y_rotation); - gCameraSegment[gActiveCameraID].trans.x_position -= z * sins_f(gCameraSegment[gActiveCameraID].trans.y_rotation); - gCameraSegment[gActiveCameraID].trans.z_position += z * coss_f(gCameraSegment[gActiveCameraID].trans.y_rotation); + gCameraSegment[gActiveCameraID].trans.x_position -= + x * coss_f(gCameraSegment[gActiveCameraID].trans.rotation.y_rotation); + gCameraSegment[gActiveCameraID].trans.z_position -= + x * sins_f(gCameraSegment[gActiveCameraID].trans.rotation.y_rotation); + gCameraSegment[gActiveCameraID].trans.x_position -= + z * sins_f(gCameraSegment[gActiveCameraID].trans.rotation.y_rotation); + gCameraSegment[gActiveCameraID].trans.z_position += + z * coss_f(gCameraSegment[gActiveCameraID].trans.rotation.y_rotation); gCameraSegment[gActiveCameraID].object.cameraSegmentID = get_level_segment_index_from_position( gCameraSegment[gActiveCameraID].trans.x_position, gCameraSegment[gActiveCameraID].trans.y_position, gCameraSegment[gActiveCameraID].trans.z_position); @@ -1485,9 +1492,9 @@ UNUSED void transform_camera_segment(f32 x, UNUSED f32 y, f32 z) { * Rotate the camera with the given angles. */ UNUSED void rotate_camera_segment(s32 angleX, s32 angleY, s32 angleZ) { - gCameraSegment[gActiveCameraID].trans.y_rotation += angleX; - gCameraSegment[gActiveCameraID].trans.x_rotation += angleY; - gCameraSegment[gActiveCameraID].trans.z_rotation += angleZ; + gCameraSegment[gActiveCameraID].trans.rotation.y_rotation += angleX; + gCameraSegment[gActiveCameraID].trans.rotation.x_rotation += angleY; + gCameraSegment[gActiveCameraID].trans.rotation.z_rotation += angleZ; } /** diff --git a/src/game_ui.c b/src/game_ui.c index 5f3736bd..2b21f073 100644 --- a/src/game_ui.c +++ b/src/game_ui.c @@ -2912,7 +2912,7 @@ void render_minimap_and_misc_hud(Gfx **dList, MatrixS **mtx, Vertex **vtx, s32 u Object_Racer *someRacer; s32 i; s32 objectCount; - HudElement objTrans; + HudElement hudElem; f32 sp11C; f32 sp118; f32 sp114; @@ -3218,22 +3218,22 @@ void render_minimap_and_misc_hud(Gfx **dList, MatrixS **mtx, Vertex **vtx, s32 u gMinimapScreenY *= 1.2; } sprite_opaque(FALSE); - objTrans.x = gMinimapScreenX + gHudOffsetX + gHudBounceX; - objTrans.y = gMinimapScreenY; + hudElem.x = gMinimapScreenX + gHudOffsetX + gHudBounceX; + hudElem.y = gMinimapScreenY; if (osTvType == OS_TV_TYPE_PAL) { - objTrans.x -= 4.0f; + hudElem.x -= 4.0f; } - objTrans.z_rotation = -someObjSeg->trans.z_rotation; - objTrans.x_rotation = 0; + hudElem.z_rotation = -someObjSeg->trans.rotation.z_rotation; + hudElem.x_rotation = 0; if (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) { - objTrans.y_rotation = -0x8000; - objTrans.x -= gMinimapDotOffsetX; + hudElem.y_rotation = -0x8000; + hudElem.x -= gMinimapDotOffsetX; } else { - objTrans.y_rotation = 0; + hudElem.y_rotation = 0; } - objTrans.spriteOffset = 0; - objTrans.z = 0.0f; - objTrans.scale = 1.0f; + hudElem.spriteOffset = 0; + hudElem.z = 0.0f; + hudElem.scale = 1.0f; opacity = mapOpacity; if (mapOpacity > 160) { mapOpacity = 160; @@ -3244,7 +3244,7 @@ void render_minimap_and_misc_hud(Gfx **dList, MatrixS **mtx, Vertex **vtx, s32 u gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, gMinimapRed, gMinimapGreen, gMinimapBlue, mapOpacity); } render_ortho_triangle_image(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrVertex, - (ObjectSegment *) &objTrans, minimap, 0); + (ObjectSegment *) &hudElem, minimap, 0); sp11C = (lvlMdl->upperXBounds - lvlMdl->lowerXBounds) / (f32) (lvlMdl->upperZBounds - lvlMdl->lowerZBounds); sp118 = coss_f((lvlMdl->minimapRotation * 0xFFFF) / 360); sp114 = sins_f((lvlMdl->minimapRotation * 0xFFFF) / 360); @@ -3297,9 +3297,9 @@ void render_minimap_and_misc_hud(Gfx **dList, MatrixS **mtx, Vertex **vtx, s32 u if (someRacer->playerIndex != PLAYER_COMPUTER) { gCurrentHud->minimapMarker.y -= 1.0f; gCurrentHud->minimapMarker.spriteID = HUD_SPRITE_MAP_ARROW; - gCurrentHud->minimapMarker.z_rotation = - (objectGroup[i]->segment.trans.y_rotation - ((lvlMdl->minimapRotation * 0xFFFF) / 360)) & - 0xFFFF; + gCurrentHud->minimapMarker.z_rotation = (objectGroup[i]->segment.trans.rotation.y_rotation - + ((lvlMdl->minimapRotation * 0xFFFF) / 360)) & + 0xFFFF; if (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) { gCurrentHud->minimapMarker.z_rotation = 0xFFFF - gCurrentHud->minimapMarker.z_rotation; diff --git a/src/lights.c b/src/lights.c index 2b209c1d..a66bb4e5 100644 --- a/src/lights.c +++ b/src/lights.c @@ -89,13 +89,13 @@ ObjectLight *func_80031CAC(Object *light, LevelObjectEntry_RgbaLight *lightEntry 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; + newLight->pos.x = light->segment.trans.x_position; + newLight->pos.y = light->segment.trans.y_position; + newLight->pos.z = light->segment.trans.z_position; } else { - newLight->x = lightEntry->common.x; - newLight->y = lightEntry->common.y; - newLight->z = lightEntry->common.z; + newLight->pos.x = lightEntry->common.x; + newLight->pos.y = lightEntry->common.y; + newLight->pos.z = lightEntry->common.z; } newLight->unk1C = lightEntry->unkA << 16; newLight->unk2C = 0; @@ -167,9 +167,9 @@ ObjectLight *add_object_light(Object *obj, ObjectHeader24 *arg1) { light->homeX = arg1->homeX; light->homeY = arg1->homeY; light->homeZ = arg1->homeZ; - light->x = light->homeX; - light->y = light->homeY; - light->z = light->homeZ; + light->pos.x = light->homeX; + light->pos.y = light->homeY; + light->pos.z = light->homeZ; light->unk1C = arg1->unk2 << 16; light->unk2C = 0; light->unk3C = 0; @@ -272,7 +272,143 @@ void lightUpdateLights(s32 updateRate) { } } -GLOBAL_ASM("asm/non_matchings/lights/func_80032424.s") +void func_80032424(ObjectLight *light, s32 updateRate) { + Vec3s rotation; + SubMiscAssetObjectHeader24 *var_a3; + s32 temp_v0; + SubMiscAssetObjectHeader24 *temp_v1; + + if (light->owner != NULL) { + light->pos.x = light->homeX; + light->pos.y = light->homeY; + light->pos.z = light->homeZ; + f32_vec3_apply_object_rotation(&light->owner->segment.trans, (f32 *) &light->pos); + light->pos.x += light->owner->segment.trans.x_position; + light->pos.y += light->owner->segment.trans.y_position; + light->pos.z += light->owner->segment.trans.z_position; + light->unk5 = 1; + } + if (light->unk44 != NULL) { + light->unk4C += updateRate; + while (light->unk4C >= light->unk44[light->unk4A].unk4) { + light->unk4C -= light->unk44[light->unk4A].unk4; + light->unk4A++; + if (light->unk48 < light->unk4A) { + light->unk4A = 0; + } + } + temp_v1 = &light->unk44[light->unk4A]; + if (light->unk4A < (light->unk48 - 1)) { + var_a3 = &light->unk44[light->unk4A + 1]; + } else { + var_a3 = light->unk44; + } + temp_v0 = (0x10000 / temp_v1->unk4); + light->unk1C = ((var_a3->unk0 - temp_v1->unk0) * light->unk4C * temp_v0) + (temp_v1->unk0 << 0x10); + light->unk20 = ((var_a3->unk1 - temp_v1->unk1) * light->unk4C * temp_v0) + (temp_v1->unk1 << 0x10); + light->unk24 = ((var_a3->unk2 - temp_v1->unk2) * light->unk4C * temp_v0) + (temp_v1->unk2 << 0x10); + light->unk28 = ((var_a3->unk3 - temp_v1->unk3) * light->unk4C * temp_v0) + (temp_v1->unk3 << 0x10); + } else { + if (light->unk3C != 0) { + temp_v0 = light->unk3C; + if (updateRate < light->unk3C) { + light->unk1C += light->unk2C * updateRate; + light->unk3C -= updateRate; + } else { + light->unk3C = 0; + light->unk1C += light->unk2C * temp_v0; + } + } + if (light->unk3E != 0) { + temp_v0 = light->unk3E; + if (updateRate < light->unk3E) { + light->unk20 += light->unk30 * updateRate; + light->unk3E -= updateRate; + } else { + light->unk3E = 0; + light->unk20 += light->unk30 * temp_v0; + } + } + if (light->unk40 != 0) { + temp_v0 = light->unk40; + if (updateRate < light->unk40) { + light->unk24 += light->unk34 * updateRate; + light->unk40 -= updateRate; + } else { + light->unk40 = 0; + light->unk24 += light->unk34 * temp_v0; + } + } + if (light->unk42 != 0) { + temp_v0 = light->unk42; + if (updateRate < light->unk42) { + light->unk28 += light->unk38 * updateRate; + light->unk42 -= updateRate; + } else { + light->unk42 = 0; + light->unk28 += light->unk38 * temp_v0; + } + } + } + if (light->unk78 != 0) { + temp_v0 = light->unk78; + if (light->unk78 == 0xFFFF) { + light->unk70 += light->unk74 * updateRate; + } else if (updateRate < temp_v0) { + light->unk70 += light->unk74 * updateRate; + light->unk78 = temp_v0 - updateRate; + } else { + light->unk78 = 0; + light->unk70 += light->unk74 * temp_v0; + } + light->unk5 = 1; + } + if (light->unk7A != 0) { + temp_v0 = light->unk7A; + if (light->unk7A == 0xFFFF) { + light->unk72 += light->unk76 * updateRate; + } else if (updateRate < temp_v0) { + light->unk72 += light->unk76 * updateRate; + light->unk7A = temp_v0 - updateRate; + } else { + light->unk7A = 0; + light->unk72 += light->unk76 * temp_v0; + } + light->unk5 = 1; + } + if (light->unk5 != 0) { + light->unk50 = light->pos.x - light->radius; + light->unk56 = light->pos.x + light->radius; + if (light->unk0 == 1) { + light->unk52 = light->pos.y - light->radius; + light->unk58 = light->pos.y + light->radius; + } else { + light->unk52 = light->pos.y - light->unk60; + light->unk58 = light->pos.y + light->unk60; + } + if (light->unk0 == 0) { + light->unk54 = light->pos.z - light->unk64; + light->unk5A = light->pos.z + light->unk64; + } else { + light->unk54 = light->pos.z - light->radius; + light->unk5A = light->pos.z + light->radius; + } + if (light->unk1 == 2) { + light->unk84 = -1.0f; + rotation.y_rotation = light->unk70; + rotation.x_rotation = light->unk72; + rotation.z_rotation = 0; + f32_vec3_apply_object_rotation3(&rotation, &light->unk7C); + if (light->owner != NULL) { + f32_vec3_apply_object_rotation(&light->owner->segment.trans, &light->unk7C); + } + light->unk7C = -light->unk7C; + light->unk80 = -light->unk80; + light->unk84 = -light->unk84; + } + light->unk5 = 0; + } +} /** * Official Name: killLight? @@ -348,9 +484,9 @@ void func_80032C7C(Object *object) { D_800DC968 = D_800DC968 + 1; } } else { - gLightDiffX = entry->x - object->segment.trans.x_position; - gLightDiffY = entry->y - object->segment.trans.y_position; - gLightDiffZ = entry->z - object->segment.trans.z_position; + gLightDiffX = entry->pos.x - object->segment.trans.x_position; + gLightDiffY = entry->pos.y - object->segment.trans.y_position; + gLightDiffZ = entry->pos.z - object->segment.trans.z_position; if (entry->unk0 == 2) { gLightDiffY = 0.0f; } diff --git a/src/lights.h b/src/lights.h index 4413eb37..0e2193eb 100644 --- a/src/lights.h +++ b/src/lights.h @@ -15,7 +15,10 @@ enum LightType { }; typedef struct SubMiscAssetObjectHeader24 { - s32 unk0; + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; s32 unk4; } SubMiscAssetObjectHeader24; @@ -37,9 +40,7 @@ typedef struct ObjectLight { s16 homeY; s16 homeZ; Object *owner; - f32 x; - f32 y; - f32 z; + Vec3f pos; s32 unk1C; s32 unk20; s32 unk24; @@ -48,14 +49,14 @@ typedef struct ObjectLight { s32 unk30; s32 unk34; s32 unk38; - s16 unk3C; - s16 unk3E; - s16 unk40; - s16 unk42; + u16 unk3C; + u16 unk3E; + u16 unk40; + u16 unk42; SubMiscAssetObjectHeader24 *unk44; u16 unk48; - s16 unk4A; - s16 unk4C; + u16 unk4A; + u16 unk4C; u16 unk4E; s16 unk50; s16 unk52; @@ -72,8 +73,8 @@ typedef struct ObjectLight { s16 unk72; s16 unk74; s16 unk76; - s16 unk78; - s16 unk7A; + u16 unk78; + u16 unk7A; f32 unk7C; // Think this might be scale. f32 unk80; // Ditto. f32 unk84; // The evolved form of ditto. @@ -96,11 +97,11 @@ f32 light_distance_calc(ObjectLight *light); f32 light_direction_calc(ObjectLight *light); ObjectLight *func_80031CAC(Object *light, LevelObjectEntry_RgbaLight *lightEntry); ObjectLight *add_object_light(Object *obj, ObjectHeader24 *arg1); +void func_80032424(ObjectLight *light, s32 updateRate); //Non Matching void setup_lights(s32 count); void func_80032C7C(Object *object); void func_800337E4(void); -void func_80032424(ObjectLight *light, s32 arg1); #endif diff --git a/src/math_util.c b/src/math_util.c index dd2bdb51..632ccf5a 100644 --- a/src/math_util.c +++ b/src/math_util.c @@ -280,12 +280,12 @@ void object_transform_to_matrix(Matrix mtx, ObjectTransform *trans) { f32 zRotCosine; f32 scale; - yRotSine = sins_s16(trans->y_rotation) * 0.000015f; - yRotCosine = coss_s16(trans->y_rotation) * 0.000015f; - xRotSine = sins_s16(trans->x_rotation) * 0.000015f; - xRotCosine = coss_s16(trans->x_rotation) * 0.000015f; - zRotSine = sins_s16(trans->z_rotation) * 0.000015f; - zRotCosine = coss_s16(trans->z_rotation) * 0.000015f; + yRotSine = sins_s16(trans->rotation.y_rotation) * 0.000015f; + yRotCosine = coss_s16(trans->rotation.y_rotation) * 0.000015f; + xRotSine = sins_s16(trans->rotation.x_rotation) * 0.000015f; + xRotCosine = coss_s16(trans->rotation.x_rotation) * 0.000015f; + zRotSine = sins_s16(trans->rotation.z_rotation) * 0.000015f; + zRotCosine = coss_s16(trans->rotation.z_rotation) * 0.000015f; scale = trans->scale * 0.000015f; mtx[0][0] = ((xRotSine * yRotSine * zRotSine) + (scale * yRotCosine)) * scale; @@ -341,12 +341,12 @@ void object_transform_to_matrix_2(Matrix mtx, ObjectTransform *trans) { f32 zRotCosine; f32 scale; - yRotCosine = coss_s16(trans->y_rotation) * 0.000015f; - yRotSine = sins_s16(trans->y_rotation) * 0.000015f; - xRotCosine = coss_s16(trans->x_rotation) * 0.000015f; - xRotSine = sins_s16(trans->x_rotation) * 0.000015f; - zRotCosine = coss_s16(trans->z_rotation) * 0.000015f; - zRotSine = sins_s16(trans->z_rotation) * 0.000015f; + yRotCosine = coss_s16(trans->rotation.y_rotation) * 0.000015f; + yRotSine = sins_s16(trans->rotation.y_rotation) * 0.000015f; + xRotCosine = coss_s16(trans->rotation.x_rotation) * 0.000015f; + xRotSine = sins_s16(trans->rotation.x_rotation) * 0.000015f; + zRotCosine = coss_s16(trans->rotation.z_rotation) * 0.000015f; + zRotSine = sins_s16(trans->rotation.z_rotation) * 0.000015f; scale = trans->scale * 0.000015f; @@ -412,12 +412,12 @@ void s16_vec3_apply_object_rotation(ObjectTransform *trans, s16 *vec3Arg) { s32 temp_t4; s32 temp_t5; - yRotCosine = coss_s16(trans->y_rotation); - yRotSine = sins_s16(trans->y_rotation); - xRotCosine = coss_s16(trans->x_rotation); - xRotSine = sins_s16(trans->x_rotation); - zRotCosine = coss_s16(trans->z_rotation); - zRotSine = sins_s16(trans->z_rotation); + yRotCosine = coss_s16(trans->rotation.y_rotation); + yRotSine = sins_s16(trans->rotation.y_rotation); + xRotCosine = coss_s16(trans->rotation.x_rotation); + xRotSine = sins_s16(trans->rotation.x_rotation); + zRotCosine = coss_s16(trans->rotation.z_rotation); + zRotSine = sins_s16(trans->rotation.z_rotation); temp_t3 = ((vec3Arg[0] * yRotSine) - (vec3Arg[1] * yRotCosine)) >> 16; temp_t4 = ((vec3Arg[1] * yRotSine) + (vec3Arg[0] * yRotCosine)) >> 16; @@ -449,12 +449,12 @@ void f32_vec3_apply_object_rotation(ObjectTransform *trans, f32 *vec3_f32) { f32 x, y, z; f32 temp; - zRotSine = sinf(trans->z_rotation); - zRotCosine = cosf(trans->z_rotation); - xRotSine = sinf(trans->x_rotation); - xRotCosine = cosf(trans->x_rotation); - yRotSine = sinf(trans->y_rotation); - yRotCosine = cosf(trans->y_rotation); + zRotSine = sinf(trans->rotation.z_rotation); + zRotCosine = cosf(trans->rotation.z_rotation); + xRotSine = sinf(trans->rotation.x_rotation); + xRotCosine = cosf(trans->rotation.x_rotation); + yRotSine = sinf(trans->rotation.y_rotation); + yRotCosine = cosf(trans->rotation.y_rotation); x = vec3_f32[0]; y = vec3_f32[1]; @@ -492,12 +492,12 @@ void f32_vec3_apply_object_rotation2(ObjectTransform *trans, f32 *arg1) { f32 temp_f6; f32 temp_f8; - xRotSine = sinf(trans->x_rotation); - xRotCosine = cosf(trans->x_rotation); - yRotSine = sinf(trans->y_rotation); - yRotCosine = cosf(trans->y_rotation); - zRotCosine = cosf(trans->z_rotation); - zRotSine = sinf(trans->z_rotation); + xRotSine = sinf(trans->rotation.x_rotation); + xRotCosine = cosf(trans->rotation.x_rotation); + yRotSine = sinf(trans->rotation.y_rotation); + yRotCosine = cosf(trans->rotation.y_rotation); + zRotCosine = cosf(trans->rotation.z_rotation); + zRotSine = sinf(trans->rotation.z_rotation); temp_f4 = (arg1[0] * xRotSine) + (arg1[2] * xRotCosine); temp_f8 = (arg1[2] * xRotSine) - (arg1[0] * xRotCosine); @@ -519,7 +519,7 @@ GLOBAL_ASM("asm/math_util/f32_vec3_apply_object_rotation2.s") #ifdef NON_EQUIVALENT /* Official Name: mathOneFloatPY */ -void f32_vec3_apply_object_rotation3(ObjectTransform *trans, f32 *vec3_f32) { +void f32_vec3_apply_object_rotation3(Vec3s *trans, f32 *vec3_f32) { f32 xRotSine; f32 xRotCosine; f32 yRotSine; diff --git a/src/math_util.h b/src/math_util.h index 4c02632c..2cbf3899 100644 --- a/src/math_util.h +++ b/src/math_util.h @@ -52,7 +52,7 @@ void f32_matrix_from_rotation_and_scale(Matrix mtx, s32 angle, f32 arg2, f32 arg void s16_vec3_apply_object_rotation(ObjectTransform *trans, s16 *vec3Arg); void f32_vec3_apply_object_rotation(ObjectTransform *trans, f32 *vec3_f32); void f32_vec3_apply_object_rotation2(ObjectTransform *trans, f32 *arg1); -void f32_vec3_apply_object_rotation3(ObjectTransform *trans, f32 *vec3_f32); +void f32_vec3_apply_object_rotation3(Vec3s *trans, f32 *vec3_f32); s32 point_triangle_2d_xz_intersection(s32 x, s32 z, s16 *vec3A, s16 *vec3B, s16 *vec3C); void f32_matrix_from_position(Matrix *mtx, f32 x, f32 y, f32 z); void f32_matrix_from_scale(Matrix, f32, f32, f32); diff --git a/src/menu.c b/src/menu.c index 61db7073..a056236f 100644 --- a/src/menu.c +++ b/src/menu.c @@ -11908,15 +11908,15 @@ void menu_camera_centre(void) { cam = get_active_camera_segment(); - angleY = cam->trans.y_rotation; - angleX = cam->trans.x_rotation; - angleZ = cam->trans.z_rotation; + angleY = cam->trans.rotation.y_rotation; + angleX = cam->trans.rotation.x_rotation; + angleZ = cam->trans.rotation.z_rotation; posX = cam->trans.x_position; posY = cam->trans.y_position; posZ = cam->trans.z_position; - cam->trans.z_rotation = 0; - cam->trans.x_rotation = 0; - cam->trans.y_rotation = 0x8000; + cam->trans.rotation.z_rotation = 0; + cam->trans.rotation.x_rotation = 0; + cam->trans.rotation.y_rotation = 0x8000; cam->trans.x_position = -32.0f; cam->trans.y_position = -32.0f; cam->trans.z_position = -32.0f; @@ -11924,9 +11924,9 @@ void menu_camera_centre(void) { update_envmap_position(0, 0, -1); func_80066CDC(&sMenuCurrDisplayList, &sMenuCurrHudMat); - cam->trans.y_rotation = angleY; - cam->trans.x_rotation = angleX; - cam->trans.z_rotation = angleZ; + cam->trans.rotation.y_rotation = angleY; + cam->trans.rotation.x_rotation = angleX; + cam->trans.rotation.z_rotation = angleZ; cam->trans.x_position = posX; cam->trans.y_position = posY; cam->trans.z_position = posZ; @@ -12364,9 +12364,9 @@ void menu_element_render(s32 elementID) { if (0) {} // Fakematch object = (Object *) gMenuAssets[gMenuImages[elementID].spriteID]; asset = (MenuAsset *) &gMenuImages[elementID]; - object->segment.trans.y_rotation = asset->y_rotation; - object->segment.trans.x_rotation = asset->x_rotation; - object->segment.trans.z_rotation = asset->z_rotation; + object->segment.trans.rotation.y_rotation = asset->y_rotation; + object->segment.trans.rotation.x_rotation = asset->x_rotation; + object->segment.trans.rotation.z_rotation = asset->z_rotation; object->segment.trans.x_position = asset->x; object->segment.trans.y_position = asset->y; object->segment.trans.z_position = asset->z; diff --git a/src/object_functions.c b/src/object_functions.c index 1669e7d9..b8f07c1e 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -123,7 +123,7 @@ void obj_init_scenery(Object *obj, LevelObjectEntry_Scenery *entry) { obj->segment.trans.scale = obj->segment.header->scale * radius; obj->shadow->scale = obj->segment.header->shadowScale * radius; obj->segment.object.modelIndex = entry->modelIndex; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); if (entry->solid) { obj->interactObj->flags = INTERACT_FLAGS_SOLID; obj->interactObj->unk11 = 1; @@ -172,7 +172,7 @@ void obj_loop_scenery(Object *obj, s32 updateRate) { } else if (properties->hitTimer <= 0) { properties->interactObj = NULL; } - obj->segment.trans.z_rotation = properties->angleVel; + obj->segment.trans.rotation.z_rotation = properties->angleVel; properties->angleVel = (properties->angleVel * -200) >> 8; } } @@ -242,8 +242,8 @@ void obj_loop_fireball_octoweapon(Object *obj, s32 updateRate) { obj->segment.z_velocity += (diff - obj->segment.z_velocity) * 0.125 * updateRateF; if (sqrtf((obj->segment.x_velocity * obj->segment.x_velocity) + (obj->segment.z_velocity * obj->segment.z_velocity)) > 0.5) { - obj->segment.trans.y_rotation = arctan2_f(obj->segment.x_velocity, obj->segment.z_velocity); - obj->segment.trans.x_rotation -= updateRate * 0x200; + obj->segment.trans.rotation.y_rotation = arctan2_f(obj->segment.x_velocity, obj->segment.z_velocity); + obj->segment.trans.rotation.x_rotation -= updateRate * 0x200; } move_object(obj, obj->segment.x_velocity * updateRateF, obj->segment.y_velocity * updateRateF, obj->segment.z_velocity * updateRateF); @@ -334,8 +334,8 @@ void obj_init_lasergun(Object *obj, LevelObjectEntry_Lasergun *entry) { laserGun->laserDuration = entry->laserDuration; laserGun->radius = entry->radius; laserGun->fireTimer = laserGun->fireRate; - obj->segment.trans.y_rotation = entry->angleY << 4 << 4; // Not sure about the shift amounts here, but it - obj->segment.trans.x_rotation = entry->angleX << 4 << 4; // just needs to be 2 left shifts that add up to 8. + obj->segment.trans.rotation.y_rotation = entry->angleY << 4 << 4; // Not sure about the shift amounts here, but it + obj->segment.trans.rotation.x_rotation = entry->angleX << 4 << 4; // just needs to be 2 left shifts to add up to 8. } /** @@ -373,8 +373,8 @@ void obj_loop_lasergun(Object *obj, s32 updateRate) { diffX /= distance; diffY /= distance; diffZ /= distance; - obj->segment.trans.y_rotation = (arctan2_f(diffX, diffZ) - 0x8000) & 0xFFFF; - obj->segment.trans.x_rotation = arctan2_f(diffY, 1.0f) & 0xFFFF; + obj->segment.trans.rotation.y_rotation = (arctan2_f(diffX, diffZ) - 0x8000) & 0xFFFF; + obj->segment.trans.rotation.x_rotation = arctan2_f(diffY, 1.0f) & 0xFFFF; } } } @@ -389,17 +389,17 @@ void obj_loop_lasergun(Object *obj, s32 updateRate) { laserBoltObj = spawn_object(&spawnObj, 1); if (laserBoltObj != NULL) { laserBoltObj->segment.level_entry = NULL; - laserBoltObj->segment.trans.y_rotation = obj->segment.trans.y_rotation; - laserBoltObj->segment.trans.x_rotation = obj->segment.trans.x_rotation; + laserBoltObj->segment.trans.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; + laserBoltObj->segment.trans.rotation.x_rotation = obj->segment.trans.rotation.x_rotation; laserBoltObj->properties.lasergun.timer = lasergun->laserDuration; laserBoltObj->properties.lasergun.obj = lasergun; trans.x_position = 0.0f; trans.y_position = 0.0f; trans.z_position = 0.0f; trans.scale = 1.0f; - trans.y_rotation = obj->segment.trans.y_rotation; - trans.x_rotation = obj->segment.trans.x_rotation; - trans.z_rotation = 0; + trans.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; + trans.rotation.x_rotation = obj->segment.trans.rotation.x_rotation; + trans.rotation.z_rotation = 0; object_transform_to_matrix(mtx, &trans); diffX = 30.0f; // Need to use diffX to match. if (lasergun->targeting == FALSE) { @@ -583,7 +583,7 @@ void obj_loop_effectbox(Object *obj, UNUSED s32 updateRate) { void obj_init_trophycab(Object *obj, LevelObjectEntry_TrophyCab *entry) { obj->interactObj->flags = INTERACT_FLAGS_SOLID; obj->interactObj->unk11 = 2; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); } /** @@ -620,7 +620,7 @@ void obj_loop_trophycab(Object *obj, s32 updateRate) { tempObj = spawn_object(&newObject, 1); if (tempObj != NULL) { tempObj->segment.level_entry = NULL; - tempObj->segment.trans.y_rotation = obj->segment.trans.y_rotation; + tempObj->segment.trans.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; } } } @@ -854,7 +854,7 @@ void obj_init_lighthouse_rocketsignpost(Object *obj, LevelObjectEntry_Lighthouse } radius /= 64; obj->segment.trans.scale = obj->segment.header->scale * radius; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); if (obj->segment.object.modelIndex >= obj->segment.header->numberOfModelIds) { obj->segment.object.modelIndex = 0; } @@ -903,7 +903,7 @@ void obj_init_airzippers_waterzippers(Object *obj, LevelObjectEntry_AirZippers_W objHeader = obj->segment.header; radius /= 64; obj->segment.trans.scale = objHeader->scale * radius; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); if (obj->segment.object.modelIndex >= objHeader->numberOfModelIds) { obj->segment.object.modelIndex = 0; } @@ -971,7 +971,7 @@ void obj_init_groundzipper(Object *obj, LevelObjectEntry_GroundZipper *entry) { header = obj->segment.header; obj->segment.trans.scale = header->scale * radius; obj->shadow->scale = header->shadowScale * radius; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); if (obj->segment.object.modelIndex >= obj->segment.header->numberOfModelIds) { obj->segment.object.modelIndex = 0; } @@ -1076,7 +1076,7 @@ void obj_loop_timetrialghost(Object *obj, s32 updateRate) { vehicleID = someOtherObj64->vehicleID; if (vehicleID == VEHICLE_HOVERCRAFT || vehicleID == VEHICLE_PLANE) { someObj = (Object *) obj60->unk4[0]; - someObj->segment.trans.y_rotation = 0x4000; + someObj->segment.trans.rotation.y_rotation = 0x4000; someObj->segment.object.modelIndex++; someObj->segment.object.modelIndex &= 1; } @@ -1092,7 +1092,7 @@ void obj_init_characterflag(Object *obj, LevelObjectEntry_CharacterFlag *entry) f32 radius; obj->properties.characterFlag.playerID = entry->playerIndex; obj->properties.characterFlag.characterID = -1; // Set to -1 so the loop func builds the gfx data. - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); radius = entry->radius & 0xFF; if (radius < 10.0f) { radius = 10.0f; @@ -1158,9 +1158,9 @@ void try_to_collect_egg(Object *obj, Object_CollectEgg *egg) { egg->status = EGG_COLLECTED; obj->segment.trans.flags |= OBJ_FLAGS_INVISIBLE; racer->racer.held_obj = obj; - transF.y_rotation = -interactedObj->segment.trans.y_rotation; - transF.x_rotation = -interactedObj->segment.trans.x_rotation; - transF.z_rotation = -interactedObj->segment.trans.z_rotation; + transF.rotation.y_rotation = -interactedObj->segment.trans.rotation.y_rotation; + transF.rotation.x_rotation = -interactedObj->segment.trans.rotation.x_rotation; + transF.rotation.z_rotation = -interactedObj->segment.trans.rotation.z_rotation; transF.scale = 1.0f; transF.x_position = -interactedObj->segment.trans.x_position; transF.y_position = -interactedObj->segment.trans.y_position; @@ -1239,7 +1239,7 @@ void obj_loop_stopwatchman(Object *obj, s32 updateRate) { distance = sqrtf((diffX * diffX) + (diffZ * diffZ)); angleDiff = arctan2_f(racerObj->segment.trans.x_position - obj->segment.trans.x_position, racerObj->segment.trans.z_position - obj->segment.trans.z_position) - - (racerObj->segment.trans.y_rotation & 0xFFFF); + (racerObj->segment.trans.rotation.y_rotation & 0xFFFF); if (angleDiff > 0x8000) { angleDiff = -0xFFFF; } @@ -1289,22 +1289,23 @@ void obj_loop_stopwatchman(Object *obj, s32 updateRate) { racer_set_dialogue_camera(); } if (distance > 10.0) { - angleDiff = - (arctan2_f(diffX / distance, diffZ / distance) - (obj->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + angleDiff = (arctan2_f(diffX / distance, diffZ / distance) - + (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + + 0x8000; WRAP(angleDiff, -0x8000, 0x8000); if (angleDiff > 0) { if (angleDiff < 0x10) { angleDiff = 0x10; } } - obj->segment.trans.y_rotation += angleDiff >> 4; + obj->segment.trans.rotation.y_rotation += angleDiff >> 4; distance = -2.0f; if (angleDiff > 0x800 || angleDiff < -0x800) { distance = -0.5f; } tt->forwardVel += (distance - tt->forwardVel) * 0.125; - obj->segment.x_velocity = sins_f(obj->segment.trans.y_rotation) * tt->forwardVel; - obj->segment.z_velocity = coss_f(obj->segment.trans.y_rotation) * tt->forwardVel; + obj->segment.x_velocity = sins_f(obj->segment.trans.rotation.y_rotation) * tt->forwardVel; + obj->segment.z_velocity = coss_f(obj->segment.trans.rotation.y_rotation) * tt->forwardVel; tt->animFrameF -= (tt->forwardVel * 2 * updateRateF); } else { obj->properties.npc.action = TT_MODE_TURN_TOWARDS_PLAYER; @@ -1317,14 +1318,16 @@ void obj_loop_stopwatchman(Object *obj, s32 updateRate) { racer_set_dialogue_camera(); obj->segment.object.animationID = 0; tt->animFrameF += 3.0 * updateRateF; - angleDiff = (racerObj->segment.trans.y_rotation - (obj->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + angleDiff = + (racerObj->segment.trans.rotation.y_rotation - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + + 0x8000; WRAP(angleDiff, -0x8000, 0x8000); if (angleDiff > 0) { if (angleDiff < 0x10) { angleDiff = 0x10; } } - obj->segment.trans.y_rotation += (angleDiff >> 4); + obj->segment.trans.rotation.y_rotation += (angleDiff >> 4); obj->segment.x_velocity = diffX * 0.05; obj->segment.z_velocity = diffZ * 0.05; if (angleDiff < 0x500) { @@ -1398,8 +1401,8 @@ void obj_loop_stopwatchman(Object *obj, s32 updateRate) { index--; } } - obj->segment.trans.x_rotation = 0; - obj->segment.trans.z_rotation = 0; + obj->segment.trans.rotation.x_rotation = 0; + obj->segment.trans.rotation.z_rotation = 0; if (obj->properties.npc.action != TT_MODE_ROAM) { gNPCPosY = obj->segment.trans.y_position; } @@ -1454,7 +1457,7 @@ void obj_init_fish(Object *fishObj, LevelObjectEntry_Fish *fishEntry, s32 param) fish->unkFD = 0; } else { fish->unkFE = 0x4000; - fishObj->segment.trans.y_rotation = fish->unk104; + fishObj->segment.trans.rotation.y_rotation = fish->unk104; } xPos = sins_f(fish->unkFE * 2) * fish->unk114; @@ -1593,14 +1596,14 @@ void obj_loop_fish(Object *fishObj, s32 updateRate) { dist3D = sqrtf((yDiff * yDiff) + dist2D); dist2D = sqrtf(dist2D); fish->unk106 += (s32) (dist3D * 0x600); - fishObj->segment.trans.y_rotation = arctan2_f(xDiff, zDiff); + fishObj->segment.trans.rotation.y_rotation = arctan2_f(xDiff, zDiff); temp_v0_2 = arctan2_f(-yDiff, dist2D); - temp_t9 = (temp_v0_2 - fishObj->segment.trans.x_rotation) & 0xFFFF; - temp_t1 = (fishObj->segment.trans.x_rotation - temp_v0_2) & 0xFFFF; + temp_t9 = (temp_v0_2 - fishObj->segment.trans.rotation.x_rotation) & 0xFFFF; + temp_t1 = (fishObj->segment.trans.rotation.x_rotation - temp_v0_2) & 0xFFFF; if (temp_t9 < temp_t1) { - fishObj->segment.trans.x_rotation += ((temp_t9 * updateRate) >> 3); + fishObj->segment.trans.rotation.x_rotation += ((temp_t9 * updateRate) >> 3); } else { - fishObj->segment.trans.x_rotation -= ((temp_t1 * updateRate) >> 3); + fishObj->segment.trans.rotation.x_rotation -= ((temp_t1 * updateRate) >> 3); } fish->unkFC = 1 - fish->unkFC; verts = &fish->vertices[fish->unkFC * 6]; @@ -1798,9 +1801,9 @@ void obj_init_animation(Object *obj, LevelObjectEntry_Animation *entry, s32 arg2 } scalef /= 64; obj->segment.trans.scale = obj->segment.header->scale * scalef; - obj->segment.trans.y_rotation = entry->y_rotation << 8; - obj->segment.trans.x_rotation = entry->x_rotation << 8; - obj->segment.trans.z_rotation = entry->z_rotation << 8; + obj->segment.trans.rotation.y_rotation = entry->y_rotation << 8; + obj->segment.trans.rotation.x_rotation = entry->x_rotation << 8; + obj->segment.trans.rotation.z_rotation = entry->z_rotation << 8; if (entry->actorIndex == -2) { entry->actorIndex = func_8001F3B8(); } else { @@ -1914,9 +1917,9 @@ void obj_loop_wizpigship(Object *wizShipObj, s32 updateRate) { trans.y_position = 0.0f; trans.z_position = 0.0f; trans.scale = 1.0f; - trans.y_rotation = wizShipObj->segment.trans.y_rotation; - trans.x_rotation = wizShipObj->segment.trans.x_rotation; - trans.z_rotation = 0; + trans.rotation.y_rotation = wizShipObj->segment.trans.rotation.y_rotation; + trans.rotation.x_rotation = wizShipObj->segment.trans.rotation.x_rotation; + trans.rotation.z_rotation = 0; object_transform_to_matrix(laserMtx, &trans); for (i = 0; i < wizShipObj->unk60->unk0; i++) { @@ -1935,8 +1938,10 @@ void obj_loop_wizpigship(Object *wizShipObj, s32 updateRate) { newObj = spawn_object(&newObject, 1); if (newObj != NULL) { newObj->segment.level_entry = NULL; - newObj->segment.trans.y_rotation = wizShipObj->segment.trans.y_rotation + 0x8000; - newObj->segment.trans.x_rotation = -wizShipObj->segment.trans.x_rotation; + newObj->segment.trans.rotation.y_rotation = + wizShipObj->segment.trans.rotation.y_rotation + 0x8000; + newObj->segment.trans.rotation.x_rotation = + -wizShipObj->segment.trans.rotation.x_rotation; newObj->properties.lasergun.timer = 0x3C; guMtxXFMF(laserMtx, 0.0f, 0.0f, -30.0f, &newObj->segment.x_velocity, &newObj->segment.y_velocity, &newObj->segment.z_velocity); @@ -1961,7 +1966,7 @@ void obj_loop_vehicleanim(Object *obj, s32 updateRate) { if (obj60 != NULL) { if (obj60->unk0 > 0) { someObj = obj60->unk0 == 3 ? obj60->unkC : obj60->unk4; - someObj->segment.trans.y_rotation = 0x4000; + someObj->segment.trans.rotation.y_rotation = 0x4000; someObj->segment.object.modelIndex++; if (someObj->segment.object.modelIndex == someObj->segment.header->numberOfModelIds) { someObj->segment.object.modelIndex = 0; @@ -2154,8 +2159,9 @@ void obj_loop_animcamera(Object *obj, s32 updateRate) { } if (updateCam) { write_to_object_render_stack(camera->cameraID, obj->segment.trans.x_position, obj->segment.trans.y_position, - obj->segment.trans.z_position, 0x8000 - obj->segment.trans.y_rotation, - -obj->segment.trans.x_rotation, obj->segment.trans.z_rotation); + obj->segment.trans.z_position, 0x8000 - obj->segment.trans.rotation.y_rotation, + -obj->segment.trans.rotation.x_rotation, + obj->segment.trans.rotation.z_rotation); } } } @@ -2198,7 +2204,7 @@ void obj_init_infopoint(Object *obj, LevelObjectEntry_InfoPoint *entry) { obj->interactObj->pushForce = 0; obj->properties.infoPoint.radius = (entry->hitbox[2] << 16) | entry->hitbox[0]; // Not sure about the values here. obj->properties.infoPoint.visible = entry->hitbox[1]; - obj->segment.trans.y_rotation = entry->unkB << 10; // Not sure about the values here. + obj->segment.trans.rotation.y_rotation = entry->unkB << 10; // Not sure about the values here. } void obj_loop_infopoint(Object *obj, UNUSED s32 updateRate) { @@ -2360,10 +2366,10 @@ void obj_init_exit(Object *obj, LevelObjectEntry_Exit *entry) { exit = &obj->unk64->exit; radius /= 128; obj->segment.trans.scale = radius; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); - exit->directionX = sins_f(obj->segment.trans.y_rotation); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + exit->directionX = sins_f(obj->segment.trans.rotation.y_rotation); exit->directionY = 0.0f; - exit->directionZ = coss_f(obj->segment.trans.y_rotation); + exit->directionZ = coss_f(obj->segment.trans.rotation.y_rotation); exit->rotationDiff = -((exit->directionX * obj->segment.trans.x_position) + (exit->directionZ * obj->segment.trans.z_position)); exit->radius = entry->radius; @@ -2453,7 +2459,7 @@ void obj_loop_cameracontrol(UNUSED Object *obj, UNUSED s32 updateRate) { void obj_init_setuppoint(Object *obj, LevelObjectEntry_SetupPoint *entry) { obj->properties.setupPoint.racerIndex = entry->racerIndex; obj->properties.setupPoint.entranceID = entry->entranceID; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); } /** @@ -2593,7 +2599,7 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { } arctan = arctan2_f(racerObj->segment.trans.x_position - obj->segment.trans.x_position, racerObj->segment.trans.z_position - obj->segment.trans.z_position) - - (racerObj->segment.trans.y_rotation & 0xFFFF); + (racerObj->segment.trans.rotation.y_rotation & 0xFFFF); if (arctan > 0x8000) { arctan = -0xFFFF; } @@ -2618,7 +2624,7 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { audioline_off(); arctan = arctan2_f(racerObj->segment.trans.x_position - obj->segment.trans.x_position, racerObj->segment.trans.z_position - obj->segment.trans.z_position); - arctan -= (racerObj->segment.trans.y_rotation & 0xFFFF); + arctan -= (racerObj->segment.trans.rotation.y_rotation & 0xFFFF); if ((arctan > 0x8000)) { // Probably had a debug statement here. if ((obj->properties.npc.action) && (!obj->properties.npc.action) && (!obj->properties.npc.action)) { @@ -2680,9 +2686,9 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { racer_set_dialogue_camera(); } if (distance > 10.0) { - arctan = - (arctan2_f(xPosDiff / distance, zPosDiff / distance) - (obj->segment.trans.y_rotation & 0xFFFF)) + - 0x8000; + arctan = (arctan2_f(xPosDiff / distance, zPosDiff / distance) - + (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + + 0x8000; if (arctan > 0x8000) { arctan -= 0xFFFF; } @@ -2692,14 +2698,14 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { if (arctan > 0 && arctan < 16) { arctan = 16; } - obj->segment.trans.y_rotation += (arctan >> 4); + obj->segment.trans.rotation.y_rotation += (arctan >> 4); var_f2 = -2.0f; if (arctan > 0x800 || arctan < -0x800) { var_f2 = -0.5f; } taj->forwardVel += (var_f2 - taj->forwardVel) * 0.125; - obj->segment.x_velocity = sins_f(obj->segment.trans.y_rotation) * taj->forwardVel; - obj->segment.z_velocity = coss_f(obj->segment.trans.y_rotation) * taj->forwardVel; + obj->segment.x_velocity = sins_f(obj->segment.trans.rotation.y_rotation) * taj->forwardVel; + obj->segment.z_velocity = coss_f(obj->segment.trans.rotation.y_rotation) * taj->forwardVel; taj->animFrameF -= taj->forwardVel * 2 * updateRateF; } else { obj->properties.npc.action = TAJ_MODE_TURN_TOWARDS_PLAYER; @@ -2711,7 +2717,8 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { racer_set_dialogue_camera(); obj->segment.object.animationID = 0; taj->animFrameF += updateRateF * 2.0; - arctan = (racerObj->segment.trans.y_rotation - (obj->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + arctan = (racerObj->segment.trans.rotation.y_rotation - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + + 0x8000; if (arctan > 0x8000) { arctan -= 0xFFFF; } @@ -2721,7 +2728,7 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { if (arctan > 0 && arctan < 16) { arctan = 16; } - obj->segment.trans.y_rotation += arctan >> 3; + obj->segment.trans.rotation.y_rotation += arctan >> 3; if (arctan < 0x400 && arctan > -0x400 && distance < 2.0) { obj->properties.npc.action = TAJ_MODE_GREET_PLAYER; taj->animFrameF = 0; @@ -2743,7 +2750,8 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { taj->unk18 = -1.0f; obj->properties.npc.action = TAJ_MODE_DIALOGUE; } - arctan = (racerObj->segment.trans.y_rotation - (obj->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + arctan = (racerObj->segment.trans.rotation.y_rotation - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + + 0x8000; if (arctan > 0x8000) { arctan -= 0xFFFF; } @@ -2753,7 +2761,7 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { if (arctan > 0 && arctan < 16) { arctan = 16; } - obj->segment.trans.y_rotation = obj->segment.trans.y_rotation + (arctan >> 4); + obj->segment.trans.rotation.y_rotation = obj->segment.trans.rotation.y_rotation + (arctan >> 4); racer_set_dialogue_camera(); break; case TAJ_MODE_DIALOGUE: @@ -2895,7 +2903,7 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { obj->segment.trans.z_position = racerObj->segment.trans.z_position - (racer->oz1 * 150.0f); obj->segment.object.segmentID = get_level_segment_index_from_position( obj->segment.trans.x_position, obj->segment.trans.y_position, obj->segment.trans.z_position); - obj->segment.trans.y_rotation = racerObj->segment.trans.y_rotation + 0x8000; + obj->segment.trans.rotation.y_rotation = racerObj->segment.trans.rotation.y_rotation + 0x8000; } break; case TAJ_MODE_TELEPORT_TO_PLAYER_END: @@ -2938,7 +2946,7 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { obj->segment.trans.x_position = telepoint->segment.trans.x_position; obj->segment.trans.z_position = telepoint->segment.trans.z_position; obj->segment.object.segmentID = telepoint->segment.object.segmentID; - obj->segment.trans.y_rotation = racerObj->segment.trans.y_rotation + 0x8000; + obj->segment.trans.rotation.y_rotation = racerObj->segment.trans.rotation.y_rotation + 0x8000; } obj->properties.npc.action = TAJ_MODE_RACE; } @@ -2965,7 +2973,7 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { obj->segment.trans.x_position = telepoint->segment.trans.x_position; obj->segment.trans.z_position = telepoint->segment.trans.z_position; obj->segment.object.segmentID = telepoint->segment.object.segmentID; - obj->segment.trans.y_rotation = racerObj->segment.trans.y_rotation + 0x8000; + obj->segment.trans.rotation.y_rotation = racerObj->segment.trans.rotation.y_rotation + 0x8000; } } break; @@ -3014,16 +3022,16 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { if (taj->unk1C < 120) { taj->animFrameF += func_8001C6C4((Object_64 *) taj, obj, updateRateF, 1.0f, 0); } else { - var_a2 = taj->unk1E - (obj->segment.trans.y_rotation & 0xFFFF); + var_a2 = taj->unk1E - (obj->segment.trans.rotation.y_rotation & 0xFFFF); if (var_a2 > 0x8000) { var_a2 -= 0xFFFF; } if (var_a2 < -0x8000) { var_a2 += 0xFFFF; } - obj->segment.trans.y_rotation += ((var_a2 * updateRate) >> 4); - xPosDiff = sins_f(obj->segment.trans.y_rotation + 0x8000); - zPosDiff = coss_f(obj->segment.trans.y_rotation + 0x8000); + obj->segment.trans.rotation.y_rotation += ((var_a2 * updateRate) >> 4); + xPosDiff = sins_f(obj->segment.trans.rotation.y_rotation + 0x8000); + zPosDiff = coss_f(obj->segment.trans.rotation.y_rotation + 0x8000); move_object(obj, (updateRateF2 * xPosDiff) * 1.1, 0.0f, (updateRateF2 * zPosDiff) * 1.1); taj->animFrameF += updateRate * 2.2; } @@ -3040,7 +3048,7 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { temp_v0_22 = get_cutscene_camera_segment(); xPosDiff = obj->segment.trans.x_position - temp_v0_22->trans.x_position; zPosDiff = obj->segment.trans.z_position - temp_v0_22->trans.z_position; - arctan = func_800090C0(xPosDiff, zPosDiff, temp_v0_22->trans.y_rotation); + arctan = func_800090C0(xPosDiff, zPosDiff, temp_v0_22->trans.rotation.y_rotation); temp = arctan; music_channel_fade_set(10, sp3C); music_channel_fade_set(11, sp3C); @@ -3119,8 +3127,8 @@ void obj_loop_parkwarden(Object *obj, s32 updateRate) { var_a2--; } } - obj->segment.trans.x_rotation = 0; - obj->segment.trans.z_rotation = 0; + obj->segment.trans.rotation.x_rotation = 0; + obj->segment.trans.rotation.z_rotation = 0; if (obj->properties.npc.action != TAJ_MODE_ROAM) { gNPCPosY = obj->segment.trans.y_position; } @@ -3169,7 +3177,7 @@ void obj_init_checkpoint(Object *obj, LevelObjectEntry_Checkpoint *entry, UNUSED } scale /= 64; obj->segment.trans.scale = scale; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); path_enable(); } @@ -3194,10 +3202,10 @@ void obj_init_modechange(Object *obj, LevelObjectEntry_ModeChange *entry) { obj64 = &obj->unk64->trigger; radius /= 128; obj->segment.trans.scale = radius; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); - obj64->directionX = sins_f(obj->segment.trans.y_rotation); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj64->directionX = sins_f(obj->segment.trans.rotation.y_rotation); obj64->directionY = 0.0f; - obj64->directionZ = coss_f(obj->segment.trans.y_rotation); + obj64->directionZ = coss_f(obj->segment.trans.rotation.y_rotation); obj64->rotationDiff = -((obj64->directionX * obj->segment.trans.x_position) + (obj64->directionZ * obj->segment.trans.z_position)); obj64->radius = entry->radius; @@ -3263,7 +3271,7 @@ void obj_loop_modechange(Object *obj, UNUSED s32 updateRate) { racer->challengeMarker = NULL; racer->unk19A = 0; } - racer->unk198 = obj->segment.trans.y_rotation; + racer->unk198 = obj->segment.trans.rotation.y_rotation; } } } @@ -3281,10 +3289,10 @@ void obj_init_bonus(Object *obj, LevelObjectEntry_Bonus *entry) { bonus = &obj->unk64->trigger; radius /= 128; obj->segment.trans.scale = radius; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); - bonus->directionX = sins_f(obj->segment.trans.y_rotation); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + bonus->directionX = sins_f(obj->segment.trans.rotation.y_rotation); bonus->directionY = 0.0f; - bonus->directionZ = coss_f(obj->segment.trans.y_rotation); + bonus->directionZ = coss_f(obj->segment.trans.rotation.y_rotation); bonus->rotationDiff = -((bonus->directionX * obj->segment.trans.x_position) + (bonus->directionZ * obj->segment.trans.z_position)); bonus->radius = entry->radius; @@ -3496,10 +3504,10 @@ void obj_init_door(Object *obj, LevelObjectEntry_Door *entry) { rmonPrintf("Illegal door no!!!\n"); } obj->segment.object.modelIndex = entry->modelIndex; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->closedRotation); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->closedRotation); door->homeY = obj->segment.trans.y_position; door->jingleTimer = 0; - obj->properties.door.closeAngle = obj->segment.trans.y_rotation; + obj->properties.door.closeAngle = obj->segment.trans.rotation.y_rotation; obj->properties.door.openAngle = (entry->openRotation & 0x3F) << 10; radius = entry->scale & 0xFF; if (radius < 10.0f) { @@ -3674,9 +3682,9 @@ void obj_loop_door(Object *doorObj, s32 updateRate) { } angleVel = 0; if (door->openDir == DOOR_OPENING) { - angleVel = doorObj->segment.trans.y_rotation - doorObj->properties.common.unk4; + angleVel = doorObj->segment.trans.rotation.y_rotation - doorObj->properties.common.unk4; } else if (door->openDir == DOOR_CLOSING) { - angleVel = doorObj->segment.trans.y_rotation - doorObj->properties.common.unk0; + angleVel = doorObj->segment.trans.rotation.y_rotation - doorObj->properties.common.unk0; } angleVel >>= 3; if (angleVel > 0x200) { @@ -3685,7 +3693,7 @@ void obj_loop_door(Object *doorObj, s32 updateRate) { if (angleVel < -0x200) { angleVel = -0x200; } - doorObj->segment.trans.y_rotation -= angleVel; //@!Delta + doorObj->segment.trans.rotation.y_rotation -= angleVel; //@!Delta if (angleVel != 0) { playSound = TRUE; } @@ -3739,13 +3747,13 @@ void obj_init_ttdoor(Object *obj, LevelObjectEntry_TTDoor *entry) { obj->segment.object.modelIndex = 0; obj64 = &obj->unk64->door; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); obj64->doorType = entry->doorType; obj64->textID = entry->textID; obj64->homeY = obj->segment.trans.y_position; obj64->jingleTimer = 0; obj64->radius = entry->radius; - obj->properties.door.closeAngle = obj->segment.trans.y_rotation; + obj->properties.door.closeAngle = obj->segment.trans.rotation.y_rotation; obj->properties.door.openAngle = (entry->unk9 & 0x3F) << 0xA; radius = entry->scale & 0xFF; if (radius < 10) { @@ -3817,9 +3825,9 @@ void obj_loop_ttdoor(Object *obj, s32 updateRate) { } openDoor = TRUE; if (settings->ttAmulet >= 4 && obj->interactObj->distance < ttDoor->radius && *settings->balloonsPtr >= 47) { - angle = obj->segment.trans.y_rotation - obj->properties.door.openAngle; + angle = obj->segment.trans.rotation.y_rotation - obj->properties.door.openAngle; } else { - angle = obj->segment.trans.y_rotation - obj->properties.door.closeAngle; + angle = obj->segment.trans.rotation.y_rotation - obj->properties.door.closeAngle; } angle >>= 3; if (angle > 0x200) { @@ -3828,7 +3836,7 @@ void obj_loop_ttdoor(Object *obj, s32 updateRate) { if (angle < -0x200) { angle = -0x200; } - obj->segment.trans.y_rotation -= angle; + obj->segment.trans.rotation.y_rotation -= angle; if (angle == 0) { openDoor = FALSE; } @@ -3866,10 +3874,10 @@ void obj_init_trigger(Object *obj, LevelObjectEntry_Trigger *entry) { obj64 = &obj->unk64->trigger; radius /= 128; obj->segment.trans.scale = radius; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); - obj64->directionX = sins_f(obj->segment.trans.y_rotation); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj64->directionX = sins_f(obj->segment.trans.rotation.y_rotation); obj64->directionY = 0.0f; - obj64->directionZ = coss_f(obj->segment.trans.y_rotation); + obj64->directionZ = coss_f(obj->segment.trans.rotation.y_rotation); obj64->rotationDiff = -((obj64->directionX * obj->segment.trans.x_position) + (obj64->directionZ * obj->segment.trans.z_position)); obj64->radius = entry->scale; @@ -3946,7 +3954,7 @@ void obj_loop_trigger(Object *obj, UNUSED s32 updateRate) { void obj_init_bridge_whaleramp(Object *obj, LevelObjectEntry_Bridge_WhaleRamp *entry) { Object_Bridge_WhaleRamp *bridge = &obj->unk64->bridge_whale_ramp; obj->segment.object.modelIndex = entry->modelIndex; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); bridge->homeY = obj->segment.trans.y_position; obj->interactObj->flags = INTERACT_FLAGS_SOLID | INTERACT_FLAGS_UNK_0020; obj->interactObj->unk11 = 2; @@ -4010,22 +4018,22 @@ void obj_loop_bridge_whaleramp(Object *obj, s32 updateRate) { } } } else if (obj->properties.common.unk0 != 0) { - if (obj->segment.trans.x_rotation >= -0x12FF) { - obj->segment.trans.x_rotation -= updateRate * 0x2D; + if (obj->segment.trans.rotation.x_rotation >= -0x12FF) { + obj->segment.trans.rotation.x_rotation -= updateRate * 0x2D; } if (whaleRamp->soundMask == NULL) { obj_bridge_pos(entry->unkA, &bellX1, &bellY1, &bellZ1); play_sound_at_position(SOUND_DRAWBRIDGE_BELL, bellX1, bellY1, bellZ1, 1, &whaleRamp->soundMask); } } else { - if (obj->segment.trans.x_rotation < 0) { - obj->segment.trans.x_rotation += updateRate * 0x28; + if (obj->segment.trans.rotation.x_rotation < 0) { + obj->segment.trans.rotation.x_rotation += updateRate * 0x28; if (whaleRamp->soundMask == NULL) { obj_bridge_pos(entry->unkA, &bellX2, &bellY2, &bellZ2); play_sound_at_position(SOUND_DRAWBRIDGE_BELL, bellX2, bellY2, bellZ2, 1, &whaleRamp->soundMask); } } else { - obj->segment.trans.x_rotation = 0; + obj->segment.trans.rotation.x_rotation = 0; if (whaleRamp->soundMask != NULL) { func_800096F8(whaleRamp->soundMask); } @@ -4593,7 +4601,7 @@ void obj_loop_worldkey(Object *worldKeyObj, s32 updateRate) { } // Rotate world key - worldKeyObj->segment.trans.y_rotation += updateRate * 0x100; + worldKeyObj->segment.trans.rotation.y_rotation += updateRate * 0x100; } /** @@ -4853,9 +4861,9 @@ void weapon_projectile(Object *obj, s32 updateRate) { posX = obj->segment.trans.x_position; posY = obj->segment.trans.y_position; posZ = obj->segment.trans.z_position; - trans.y_rotation = obj->segment.trans.y_rotation; - trans.x_rotation = obj->segment.trans.x_rotation; - trans.z_rotation = 0; + trans.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; + trans.rotation.x_rotation = obj->segment.trans.rotation.x_rotation; + trans.rotation.z_rotation = 0; trans.x_position = 0.0f; trans.y_position = 0.0f; trans.z_position = 0.0f; @@ -4999,14 +5007,14 @@ void rocket_prevent_overshoot(Object *obj, UNUSED s32 updateRate, Object_Weapon if (dist > 0.0f) { rocket->forwardVel = -25.0f; angle = (arctan2_f(diffX, diffZ) - 0x8000) & 0xFFFF; - angleDiff = angle - (obj->segment.trans.y_rotation & 0xFFFF); + angleDiff = angle - (obj->segment.trans.rotation.y_rotation & 0xFFFF); WRAP(angleDiff, -0x8000, 0x8000); if (angleDiff > 0x6000 || angleDiff < -0x6000) { obj->interactObj->obj = (Object *) interactedObj; obj->interactObj->distance = 1; } - obj->segment.trans.x_rotation = arctan2_f(diffY, dist); - obj->segment.trans.y_rotation = angle; + obj->segment.trans.rotation.x_rotation = arctan2_f(diffY, dist); + obj->segment.trans.rotation.y_rotation = angle; } } play_rocket_trailing_sound(obj, rocket, SOUND_INCOMING_ROCKET); @@ -5057,21 +5065,21 @@ void homing_rocket_prevent_overshoot(Object *obj, s32 updateRate, Object_Weapon sp58 = FALSE; } angle = (arctan2_f(diffX, diffZ) - 0x8000) & 0xFFFF; - angleDiff = angle - (obj->segment.trans.y_rotation & 0xFFFF); + angleDiff = angle - (obj->segment.trans.rotation.y_rotation & 0xFFFF); WRAP(angleDiff, -0x8000, 0x8000); if (sp58) { - obj->segment.trans.y_rotation += (angleDiff * updateRate) >> shift; - angleDiff = sineY - (obj->segment.trans.x_rotation & 0xFFFF); + obj->segment.trans.rotation.y_rotation += (angleDiff * updateRate) >> shift; + angleDiff = sineY - (obj->segment.trans.rotation.x_rotation & 0xFFFF); WRAP(angleDiff, -0x8000, 0x8000); - obj->segment.trans.x_rotation += (angleDiff * updateRate) >> shift; + obj->segment.trans.rotation.x_rotation += (angleDiff * updateRate) >> shift; } else { if (angleDiff > 0x6000 || angleDiff < -0x6000) { obj->interactObj->obj = targetObj; obj->interactObj->distance = 1; } - obj->segment.trans.x_rotation = arctan2_f(diffY, dist) & 0xFFFFu; + obj->segment.trans.rotation.x_rotation = arctan2_f(diffY, dist) & 0xFFFFu; - obj->segment.trans.y_rotation = angle; + obj->segment.trans.rotation.y_rotation = angle; } } play_rocket_trailing_sound(obj, rocket, SOUND_HOMING_ROCKET); @@ -5606,7 +5614,7 @@ void obj_init_log(Object *obj, LevelObjectEntry_Log *entry, UNUSED s32 arg2) { radius /= 64; obj->segment.trans.scale = obj->segment.header->scale * radius; obj->segment.object.modelIndex = entry->modelIndex; - obj->segment.trans.y_rotation = U8_ANGLE_TO_U16(entry->angleY); + obj->segment.trans.rotation.y_rotation = U8_ANGLE_TO_U16(entry->angleY); } /** @@ -5637,8 +5645,8 @@ void obj_loop_log(Object *obj, s32 updateRate) { rumble_set(racer->playerIndex, RUMBLE_TYPE_18); } } - sine = sins_f(-obj->segment.trans.y_rotation); - cosine = coss_f(-obj->segment.trans.y_rotation); + sine = sins_f(-obj->segment.trans.rotation.y_rotation); + cosine = coss_f(-obj->segment.trans.rotation.y_rotation); // This looks a bit messy, but is required to match. diffX = obj->segment.trans.x_position - racerObj->segment.trans.x_position; @@ -5672,7 +5680,7 @@ void obj_loop_log(Object *obj, s32 updateRate) { obj->properties.log.angleVel = 0; } } - obj->segment.trans.y_rotation += obj->properties.log.angleVel * updateRate; + obj->segment.trans.rotation.y_rotation += obj->properties.log.angleVel * updateRate; obj->unk5C->unk100 = NULL; } @@ -5881,18 +5889,18 @@ void obj_loop_butterfly(Object *butterflyObj, s32 updateRate) { xDiff = butterflyObj->segment.trans.x_position - butterflyEntry->common.x; zDiff = butterflyObj->segment.trans.z_position - butterflyEntry->common.z; temp = arctan2_f(xDiff, zDiff); - temp -= butterflyObj->segment.trans.y_rotation & 0xffff & 0xffff; + temp -= butterflyObj->segment.trans.rotation.y_rotation & 0xffff & 0xffff; if (temp < 0) { if (temp > -sp72) { - butterflyObj->segment.trans.y_rotation += temp; + butterflyObj->segment.trans.rotation.y_rotation += temp; } else { - butterflyObj->segment.trans.y_rotation -= sp72; + butterflyObj->segment.trans.rotation.y_rotation -= sp72; } } else if ((temp > 0)) { if (temp < sp72) { - butterflyObj->segment.trans.y_rotation += temp; + butterflyObj->segment.trans.rotation.y_rotation += temp; } else { - butterflyObj->segment.trans.y_rotation += sp72; + butterflyObj->segment.trans.rotation.y_rotation += sp72; } } sp84 = butterflyEntry->common.y - butterflyObj->segment.trans.y_position; @@ -5967,18 +5975,18 @@ void obj_loop_butterfly(Object *butterflyObj, s32 updateRate) { xDiff = butterflyObj->segment.trans.x_position - butterfly->unk100->segment.trans.x_position; zDiff = butterflyObj->segment.trans.z_position - butterfly->unk100->segment.trans.z_position; temp = arctan2_f(xDiff, zDiff); - temp -= butterflyObj->segment.trans.y_rotation & 0xffff & 0xffff; + temp -= butterflyObj->segment.trans.rotation.y_rotation & 0xffff & 0xffff; if (temp < 0) { if (-sp72 < temp) { - butterflyObj->segment.trans.y_rotation += temp; + butterflyObj->segment.trans.rotation.y_rotation += temp; } else { - butterflyObj->segment.trans.y_rotation -= sp72; + butterflyObj->segment.trans.rotation.y_rotation -= sp72; } } else if ((temp > 0)) { if (temp < sp72) { - butterflyObj->segment.trans.y_rotation += temp; + butterflyObj->segment.trans.rotation.y_rotation += temp; } else { - butterflyObj->segment.trans.y_rotation += sp72; + butterflyObj->segment.trans.rotation.y_rotation += sp72; } } sp84 = (butterfly->unk100->segment.trans.y_position + 16.0f) - butterflyObj->segment.trans.y_position; @@ -6042,7 +6050,7 @@ void obj_loop_butterfly(Object *butterflyObj, s32 updateRate) { if (get_random_number_from_range(0, 0x64) >= 0x63) { butterfly->unk106 = -butterfly->unk106; } - butterflyObj->segment.trans.y_rotation += updateRate * butterfly->unk106; + butterflyObj->segment.trans.rotation.y_rotation += updateRate * butterfly->unk106; if ((butterfly->unk100->segment.trans.y_position + 64.0f) < butterflyObj->segment.trans.y_position) { butterfly->unkFE = 0; @@ -6055,7 +6063,7 @@ void obj_loop_butterfly(Object *butterflyObj, s32 updateRate) { } else { butterflyObj->segment.y_velocity -= (sp7C * updateRate); } - butterflyObj->segment.trans.y_rotation += butterfly->unk106; + butterflyObj->segment.trans.rotation.y_rotation += butterfly->unk106; } } } @@ -6086,8 +6094,10 @@ void obj_loop_butterfly(Object *butterflyObj, s32 updateRate) { butterflyObj->segment.y_velocity = var_f0; } if (butterfly->unk108 != 0.0f) { - butterflyObj->segment.x_velocity = sins_f(butterflyObj->segment.trans.y_rotation) * -butterfly->unk108; - butterflyObj->segment.z_velocity = coss_f(butterflyObj->segment.trans.y_rotation) * -butterfly->unk108; + butterflyObj->segment.x_velocity = + sins_f(butterflyObj->segment.trans.rotation.y_rotation) * -butterfly->unk108; + butterflyObj->segment.z_velocity = + coss_f(butterflyObj->segment.trans.rotation.y_rotation) * -butterfly->unk108; move_object(butterflyObj, butterflyObj->segment.x_velocity, butterflyObj->segment.y_velocity, butterflyObj->segment.z_velocity); } @@ -6141,7 +6151,7 @@ void obj_init_midifade(Object *obj, LevelObjectEntry_MidiFade *entry) { s32 i; f32 scaleF2; - obj->segment.trans.y_rotation = entry->angleY << 8 << 2; // Two shifts needed to skip a register. + obj->segment.trans.rotation.y_rotation = entry->angleY << 8 << 2; // Two shifts needed to skip a register. obj64 = obj->unk64; scaleF = (f32) (((s32) entry->scale) & 0xFFFF); if (scaleF < 1.0f) { @@ -6149,9 +6159,9 @@ void obj_init_midifade(Object *obj, LevelObjectEntry_MidiFade *entry) { } scaleF /= 8; obj->segment.trans.scale = obj->segment.header->scale * (scaleF); - transform.y_rotation = obj->segment.trans.y_rotation; - transform.x_rotation = obj->segment.trans.x_rotation; - transform.z_rotation = obj->segment.trans.z_rotation; + transform.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; + transform.rotation.x_rotation = obj->segment.trans.rotation.x_rotation; + transform.rotation.z_rotation = obj->segment.trans.rotation.z_rotation; transform.scale = 1.0f; transform.x_position = 0.0f; transform.y_position = 0.0f; @@ -6200,8 +6210,8 @@ void obj_init_midifade(Object *obj, LevelObjectEntry_MidiFade *entry) { maxZ = vertex->z; } } - cosYRot = coss_f(obj->segment.trans.y_rotation); - sinYRot = sins_f(obj->segment.trans.y_rotation); + cosYRot = coss_f(obj->segment.trans.rotation.y_rotation); + sinYRot = sins_f(obj->segment.trans.rotation.y_rotation); tempF3 = minX; minX = (minX * cosYRot) + (minZ * sinYRot); minZ = (minZ * cosYRot) - (tempF3 * sinYRot); @@ -6245,9 +6255,9 @@ void obj_init_midifadepoint(Object *obj, LevelObjectEntry_MidiFadePoint *entry) if (obj64->unk2 < obj64->unk0) { obj64->unk2 = obj64->unk0 + 10; } - obj->segment.trans.z_rotation = 0; - obj->segment.trans.x_rotation = 0; - obj->segment.trans.y_rotation = 0; + obj->segment.trans.rotation.z_rotation = 0; + obj->segment.trans.rotation.x_rotation = 0; + obj->segment.trans.rotation.y_rotation = 0; for (i = 0; i < 15; i++) { obj64->unkC[i] = entry->unkC[i]; @@ -6432,7 +6442,8 @@ void obj_loop_frog(Object *obj, s32 updateRate) { if (frog->hopTimer < 0) { hopping = TRUE; frog->forwardVel = get_random_number_from_range(40, 72); - frog->hopDirection = get_random_number_from_range(-0x4000, 0x4000) + obj->segment.trans.y_rotation; + frog->hopDirection = + get_random_number_from_range(-0x4000, 0x4000) + obj->segment.trans.rotation.y_rotation; } } if (hopping) { @@ -6463,7 +6474,7 @@ void obj_loop_frog(Object *obj, s32 updateRate) { frog->hopStartX = obj->segment.trans.x_position; frog->hopStartZ = obj->segment.trans.z_position; frog->hopFrame = 32; - obj->segment.trans.y_rotation = -frog->hopDirection; + obj->segment.trans.rotation.y_rotation = -frog->hopDirection; } default: break; diff --git a/src/objects.c b/src/objects.c index 42ea4a5e..8543a6af 100644 --- a/src/objects.c +++ b/src/objects.c @@ -966,7 +966,7 @@ void func_8000CC7C(Vehicle vehicle, u32 arg1, s32 arg2) { spF4[curObj->properties.setupPoint.racerIndex] = curObj->segment.trans.x_position; spD4[curObj->properties.setupPoint.racerIndex] = curObj->segment.trans.y_position; spB4[curObj->properties.setupPoint.racerIndex] = curObj->segment.trans.z_position; - sp94[curObj->properties.setupPoint.racerIndex] = curObj->segment.trans.y_rotation; + sp94[curObj->properties.setupPoint.racerIndex] = curObj->segment.trans.rotation.y_rotation; } tempVehicle = curObj->segment.level_entry->setupPoint.vehicle; if (tempVehicle != -1) { @@ -1057,8 +1057,8 @@ void func_8000CC7C(Vehicle vehicle, u32 arg1, s32 arg2) { } } } - if (((!(curObj->segment.trans.y_rotation)) && (!(curObj->segment.trans.y_rotation))) && - (!(curObj->segment.trans.y_rotation))) {} + if (((!(curObj->segment.trans.rotation.y_rotation)) && (!(curObj->segment.trans.rotation.y_rotation))) && + (!(curObj->segment.trans.rotation.y_rotation))) {} entry = mempool_alloc_safe(sizeof(LevelObjectEntry_Unk8000CC7C), COLOUR_TAG_YELLOW); entry->unkC = 0; entry->unkA = 0; @@ -1140,7 +1140,7 @@ void func_8000CC7C(Vehicle vehicle, u32 arg1, s32 arg2) { func_800619F4(0); } newRacerObj = spawn_object((LevelObjectEntryCommon *) entry, spawnObjFlags); - newRacerObj->segment.trans.y_rotation = sp94[i6]; + newRacerObj->segment.trans.rotation.y_rotation = sp94[i6]; (*gRacers)[i6] = newRacerObj; gRacersByPosition[i6] = newRacerObj; gRacersByPort[var_s4] = newRacerObj; @@ -1446,7 +1446,7 @@ void despawn_player_racer(Object *obj, s32 vehicleID) { gTransformPosX = obj->segment.trans.x_position; gTransformPosY = obj->segment.trans.y_position; gTransformPosZ = obj->segment.trans.z_position; - gTransformAngleY = obj->segment.trans.y_rotation; + gTransformAngleY = obj->segment.trans.rotation.y_rotation; free_object(obj); gNumRacers = 0; } @@ -1506,7 +1506,7 @@ void transform_player_vehicle(void) { player->segment.trans.scale *= 0.714f; } player->segment.level_entry = NULL; - player->segment.trans.y_rotation = gTransformAngleY; + player->segment.trans.rotation.y_rotation = gTransformAngleY; player->segment.trans.y_position = gTransformPosY; } @@ -1873,7 +1873,8 @@ Object *spawn_object(LevelObjectEntryCommon *entry, s32 arg1) { // WRONG WRONG WRONG - Is this really just trying to set up the first several values in a weird way? for (var_s0_5 = 0; var_s0_5 < sizeOfobj; var_s0_5 += 4) { - newObj[var_s0_5].segment.trans.y_rotation = (*gSpawnObjectHeap)[var_s0_5]->segment.trans.y_rotation; + newObj[var_s0_5].segment.trans.rotation.y_rotation = + (*gSpawnObjectHeap)[var_s0_5]->segment.trans.rotation.y_rotation; } if (newObj->waterEffect != NULL) { newObj->waterEffect = @@ -2824,9 +2825,9 @@ void render_3d_billboard(Object *obj) { // 5 = OilSlick, SmokeCloud, Bomb, BubbleWeapon if (bubbleTrap != NULL || !(obj->behaviorId != BHV_WEAPON || obj->unk64->weapon.weaponID != WEAPON_BUBBLE_TRAP)) { - objTrans.trans.z_rotation = 0; - objTrans.trans.x_rotation = 0; - objTrans.trans.y_rotation = 0; + objTrans.trans.rotation.z_rotation = 0; + objTrans.trans.rotation.x_rotation = 0; + objTrans.trans.rotation.y_rotation = 0; objTrans.trans.scale = obj->segment.trans.scale; objTrans.trans.x_position = 0.0f; objTrans.trans.z_position = 0.0f; @@ -3145,9 +3146,9 @@ void object_do_player_tumble(Object *this) { if (this->behaviorId == BHV_RACER) { sp_20 = &this->unk64->racer; - this->segment.trans.y_rotation += sp_20->y_rotation_offset; - this->segment.trans.x_rotation += sp_20->x_rotation_offset; - this->segment.trans.z_rotation += sp_20->z_rotation_offset; + this->segment.trans.rotation.y_rotation += sp_20->y_rotation_offset; + this->segment.trans.rotation.x_rotation += sp_20->x_rotation_offset; + this->segment.trans.rotation.z_rotation += sp_20->z_rotation_offset; offsetY = 0.0f; if (sp_20->vehicleIDPrev < VEHICLE_TRICKY) { @@ -3172,9 +3173,9 @@ void object_do_player_tumble(Object *this) { void object_undo_player_tumble(Object *obj) { if (obj->behaviorId == BHV_RACER) { Object_Racer *racer = &obj->unk64->racer; - obj->segment.trans.y_rotation -= racer->y_rotation_offset; - obj->segment.trans.x_rotation -= racer->x_rotation_offset; - obj->segment.trans.z_rotation -= racer->z_rotation_offset; + obj->segment.trans.rotation.y_rotation -= racer->y_rotation_offset; + obj->segment.trans.rotation.x_rotation -= racer->x_rotation_offset; + obj->segment.trans.rotation.z_rotation -= racer->z_rotation_offset; obj->segment.trans.y_position -= gObjectOffsetY; } } @@ -3435,9 +3436,9 @@ void render_racer_shield(Gfx **dList, MatrixS **mtx, Vertex **vtxList, Object *o shear = (coss_f(D_8011B010[racerIndex] * 0x400) * 0.05f) + 0.95f; gShieldEffectObject->segment.trans.scale = shield->scale * shear; shear = shear * shield->turnSpeed; - gShieldEffectObject->segment.trans.y_rotation = D_8011B010[racerIndex] * 0x800; - gShieldEffectObject->segment.trans.x_rotation = 0x800; - gShieldEffectObject->segment.trans.z_rotation = 0; + gShieldEffectObject->segment.trans.rotation.y_rotation = D_8011B010[racerIndex] * 0x800; + gShieldEffectObject->segment.trans.rotation.x_rotation = 0x800; + gShieldEffectObject->segment.trans.rotation.z_rotation = 0; shieldType = racer->shieldType; if (shieldType != SHIELD_NONE) { shieldType--; @@ -3509,9 +3510,9 @@ void render_racer_magnet(Gfx **dList, MatrixS **mtx, Vertex **vtxList, Object *o gMagnetEffectObject->segment.trans.scale = magnet[0] * shear; magnet += 1; shear = magnet[0] * shear; - gMagnetEffectObject->segment.trans.y_rotation = D_8011B078[var_t0].b * 0x1000; - gMagnetEffectObject->segment.trans.x_rotation = 0; - gMagnetEffectObject->segment.trans.z_rotation = 0; + gMagnetEffectObject->segment.trans.rotation.y_rotation = D_8011B078[var_t0].b * 0x1000; + gMagnetEffectObject->segment.trans.rotation.x_rotation = 0; + gMagnetEffectObject->segment.trans.rotation.z_rotation = 0; gfxData = *gMagnetEffectObject->unk68; mdl = gfxData->objModel; gMagnetEffectObject->unk44 = (Vertex *) gfxData->unk4[gfxData->animationTaskNum]; @@ -3707,7 +3708,132 @@ UNUSED void func_800149C0(unk800149C0 *arg0, UNUSED s32 arg1, s32 arg2, s32 arg3 *arg5 = endVal - 1; } -GLOBAL_ASM("asm/non_matchings/objects/func_80014B50.s") +// Only used in the unused function func_800149C0 +s32 func_80014B50(s32 arg0, s32 arg1, f32 arg2, u32 arg3) { + Object *swapTemp; + s32 var_a0; + s32 var_a1; + + var_a0 = arg0; + var_a1 = arg1; + switch (arg3) { + case 0: + while (arg1 >= arg0) { + while ((var_a1 >= arg0) && ((gObjPtrList[arg0]->segment.trans.x_position - + gObjPtrList[arg0]->segment.particle.unk34) < arg2)) { + arg0++; + } + while ((arg1 >= var_a0) && (arg2 <= (gObjPtrList[arg1]->segment.trans.x_position - + gObjPtrList[arg1]->segment.particle.unk34))) { + arg1--; + } + if (arg0 < arg1) { + swapTemp = gObjPtrList[arg0]; + gObjPtrList[arg0] = gObjPtrList[arg1]; + gObjPtrList[arg1] = swapTemp; + arg0++; + arg1--; + } + } + break; + case 1: + while (arg1 >= arg0) { + while ((var_a1 >= arg0) && ((gObjPtrList[arg0]->segment.trans.y_position - + gObjPtrList[arg0]->segment.particle.unk34) < arg2)) { + arg0++; + } + while ((arg1 >= var_a0) && (arg2 <= (gObjPtrList[arg1]->segment.trans.y_position - + gObjPtrList[arg1]->segment.particle.unk34))) { + arg1--; + } + if (arg0 < arg1) { + swapTemp = gObjPtrList[arg0]; + gObjPtrList[arg0] = gObjPtrList[arg1]; + gObjPtrList[arg1] = swapTemp; + arg0++; + arg1--; + } + } + break; + case 2: + while (arg1 >= arg0) { + while ((var_a1 >= arg0) && ((gObjPtrList[arg0]->segment.trans.z_position - + gObjPtrList[arg0]->segment.particle.unk34) < arg2)) { + arg0++; + } + while ((arg1 >= var_a0) && (arg2 <= (gObjPtrList[arg1]->segment.trans.z_position - + gObjPtrList[arg1]->segment.particle.unk34))) { + arg1--; + } + if (arg0 < arg1) { + swapTemp = gObjPtrList[arg0]; + gObjPtrList[arg0] = gObjPtrList[arg1]; + gObjPtrList[arg1] = swapTemp; + arg0++; + arg1--; + } + } + break; + case 8: + while (arg1 >= arg0) { + while ((var_a1 >= arg0) && ((gObjPtrList[arg0]->segment.trans.x_position + + gObjPtrList[arg0]->segment.particle.unk34) < arg2)) { + arg0++; + } + while ((arg1 >= var_a0) && (arg2 <= (gObjPtrList[arg1]->segment.trans.x_position + + gObjPtrList[arg1]->segment.particle.unk34))) { + arg1--; + } + if (arg0 < arg1) { + swapTemp = gObjPtrList[arg0]; + gObjPtrList[arg0] = gObjPtrList[arg1]; + gObjPtrList[arg1] = swapTemp; + arg0++; + arg1--; + } + } + break; + case 9: + while (arg1 >= arg0) { + while ((var_a1 >= arg0) && ((gObjPtrList[arg0]->segment.trans.y_position + + gObjPtrList[arg0]->segment.particle.unk34) < arg2)) { + arg0++; + } + while ((arg1 >= var_a0) && (arg2 <= (gObjPtrList[arg1]->segment.trans.y_position + + gObjPtrList[arg1]->segment.particle.unk34))) { + arg1--; + } + if (arg0 < arg1) { + swapTemp = gObjPtrList[arg0]; + gObjPtrList[arg0] = gObjPtrList[arg1]; + gObjPtrList[arg1] = swapTemp; + arg0++; + arg1--; + } + } + break; + case 10: + while (arg1 >= arg0) { + while ((var_a1 >= arg0) && ((gObjPtrList[arg0]->segment.trans.z_position + + gObjPtrList[arg0]->segment.particle.unk34) < arg2)) { + arg0++; + } + while ((arg1 >= var_a0) && (arg2 <= (gObjPtrList[arg1]->segment.trans.z_position + + gObjPtrList[arg1]->segment.particle.unk34))) { + arg1--; + } + if (arg0 < arg1) { + swapTemp = gObjPtrList[arg0]; + gObjPtrList[arg0] = gObjPtrList[arg1]; + gObjPtrList[arg1] = swapTemp; + arg0++; + arg1--; + } + } + break; + } + return arg0; +} /** * Takes every object and sorts the main object list by distance to the camera. @@ -4098,9 +4224,9 @@ void func_8001709C(Object *obj) { obj5C = obj->unk5C; obj5C->unk104 = (obj5C->unk104 + 1) & 1; sp6C = (Matrix *) &obj5C->_matrices[obj5C->unk104 << 1]; - sp78.y_rotation = -obj->segment.trans.y_rotation; - sp78.x_rotation = -obj->segment.trans.x_rotation; - sp78.z_rotation = -obj->segment.trans.z_rotation; + sp78.rotation.y_rotation = -obj->segment.trans.rotation.y_rotation; + sp78.rotation.x_rotation = -obj->segment.trans.rotation.x_rotation; + sp78.rotation.z_rotation = -obj->segment.trans.rotation.z_rotation; sp78.scale = 1.0f; sp78.x_position = -obj->segment.trans.x_position; sp78.y_position = -obj->segment.trans.y_position; @@ -4117,9 +4243,9 @@ void func_8001709C(Object *obj) { sp2C[2][2] = inverseScale; sp2C[3][3] = 1.0f; f32_matrix_mult(sp6C, &sp2C, sp6C); - sp78.y_rotation = obj->segment.trans.y_rotation; - sp78.x_rotation = obj->segment.trans.x_rotation; - sp78.z_rotation = obj->segment.trans.z_rotation; + sp78.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; + sp78.rotation.x_rotation = obj->segment.trans.rotation.x_rotation; + sp78.rotation.z_rotation = obj->segment.trans.rotation.z_rotation; sp78.scale = 1.0 / inverseScale; sp78.x_position = obj->segment.trans.x_position; sp78.y_position = obj->segment.trans.y_position; @@ -4749,19 +4875,19 @@ void set_ghost_none(void) { gHasGhostToSave = FALSE; } -Object *func_8001B7A8(Object *racer, s32 position, f32 *distance) { - UNUSED s32 temp; - Object *tempRacer; - position = (racer->obj.unk112 - position) - 1; +Object *func_8001B7A8(Object_Racer *racer, s32 position, f32 *distance) { + UNUSED s32 pad; + Object *tempRacerObj; + position = (racer->unk1AA - position) - 1; if (position < 0 || position >= gNumRacers) { return NULL; } - tempRacer = gRacersByPosition[position]; - if (tempRacer == NULL) { + tempRacerObj = gRacersByPosition[position]; + if (tempRacerObj == NULL) { return NULL; } - *distance = func_8001B834((Object_Racer *) racer, (Object_Racer *) tempRacer->unk64); - return tempRacer; + *distance = func_8001B834(racer, &tempRacerObj->unk64->racer); + return tempRacerObj; } f32 func_8001B834(Object_Racer *racer1, Object_Racer *racer2) { @@ -5552,8 +5678,9 @@ void calc_dyn_light_and_env_map_for_object(ObjectModel *model, Object *object, s if (environmentMappingEnabled) { // Calculates environment mapping for the object - calc_env_mapping_for_object(model, object->segment.trans.z_rotation, object->segment.trans.x_rotation, - object->segment.trans.y_rotation); + calc_env_mapping_for_object(model, object->segment.trans.rotation.z_rotation, + object->segment.trans.rotation.x_rotation, + object->segment.trans.rotation.y_rotation); } } @@ -5577,9 +5704,9 @@ UNUSED void set_racer_position_and_angle(s16 player, s16 *x, s16 *y, s16 *z, s16 *x = obj->segment.trans.x_position; *y = obj->segment.trans.y_position; *z = obj->segment.trans.z_position; - *angleZ = obj->segment.trans.z_rotation; - *angleX = obj->segment.trans.x_rotation; - *angleY = obj->segment.trans.y_rotation; + *angleZ = obj->segment.trans.rotation.z_rotation; + *angleX = obj->segment.trans.rotation.x_rotation; + *angleY = obj->segment.trans.rotation.y_rotation; i = gObjectCount; // Feels like it should be a break instead. } } @@ -5828,9 +5955,9 @@ void obj_init_animcamera(Object *arg0, Object *animObj) { animObj->segment.trans.x_position = arg0->segment.trans.x_position; animObj->segment.trans.y_position = arg0->segment.trans.y_position; animObj->segment.trans.z_position = arg0->segment.trans.z_position; - animObj->segment.trans.y_rotation = arg0->segment.trans.y_rotation; - animObj->segment.trans.z_rotation = arg0->segment.trans.z_rotation; - animObj->segment.trans.x_rotation = arg0->segment.trans.x_rotation; + animObj->segment.trans.rotation.y_rotation = arg0->segment.trans.rotation.y_rotation; + animObj->segment.trans.rotation.z_rotation = arg0->segment.trans.rotation.z_rotation; + animObj->segment.trans.rotation.x_rotation = arg0->segment.trans.rotation.x_rotation; anim->unk26 = 0; anim->unk3D = animEntry->channel; anim->unk28 = animEntry->actorIndex; @@ -5975,9 +6102,9 @@ void func_80021104(Object *obj, Object_Animation *animObj, LevelObjectEntry_Anim animObjTrans->x_position = seg->trans.x_position; animObjTrans->y_position = seg->trans.y_position; animObjTrans->z_position = seg->trans.z_position; - animObjTrans->y_rotation = (0x8000 - seg->trans.y_rotation); - animObjTrans->x_rotation = -seg->trans.x_rotation; - animObjTrans->z_rotation = seg->trans.z_rotation; + animObjTrans->rotation.y_rotation = (0x8000 - seg->trans.rotation.y_rotation); + animObjTrans->rotation.x_rotation = -seg->trans.rotation.x_rotation; + animObjTrans->rotation.z_rotation = seg->trans.rotation.z_rotation; } if ((entry->unk22 >= 10) && (entry->unk22 < 18)) { seg = &(*gRacers)[entry->unk22 - 10]->segment; @@ -5985,9 +6112,9 @@ void func_80021104(Object *obj, Object_Animation *animObj, LevelObjectEntry_Anim animObjTrans->x_position = seg->trans.x_position; animObjTrans->y_position = seg->trans.y_position; animObjTrans->z_position = seg->trans.z_position; - animObjTrans->y_rotation = seg->trans.y_rotation; - animObjTrans->x_rotation = seg->trans.x_rotation; - animObjTrans->z_rotation = seg->trans.z_rotation; + animObjTrans->rotation.y_rotation = seg->trans.rotation.y_rotation; + animObjTrans->rotation.x_rotation = seg->trans.rotation.x_rotation; + animObjTrans->rotation.z_rotation = seg->trans.rotation.z_rotation; } } } @@ -6402,11 +6529,11 @@ CheckpointNode *func_800230D0(Object *obj, Object_Racer *racer) { if (lastCheckpointNode != NULL) { racer->steerVisualRotation = arctan2_f(lastCheckpointNode->rotationXFrac, lastCheckpointNode->rotationZFrac); } else { - racer->steerVisualRotation = ptrList->segment.trans.y_rotation; + racer->steerVisualRotation = ptrList->segment.trans.rotation.y_rotation; } racer->checkpoint = 0; racer->courseCheckpoint = racer->lap * gNumberOfCheckpoints; - obj->segment.trans.y_rotation = racer->steerVisualRotation; + obj->segment.trans.rotation.y_rotation = racer->steerVisualRotation; racer->unkD8.x = obj->segment.trans.x_position; racer->unkD8.y = obj->segment.trans.y_position + 15.0f; racer->unkD8.z = obj->segment.trans.z_position; diff --git a/src/objects.h b/src/objects.h index ca6b7420..5d5541be 100644 --- a/src/objects.h +++ b/src/objects.h @@ -455,7 +455,7 @@ void func_8000B290(void); void func_80016BC4(Object *obj); s32 ainode_register(Object *obj); void obj_taj_create_balloon(s32 blockID, f32 x, f32 y, f32 z); -Object *func_8001B7A8(Object *racer, s32 position, f32 *distance); +Object *func_8001B7A8(Object_Racer *racer, s32 position, f32 *distance); s32 func_8000FD34(Object *obj, Object_5C *matrices); void func_8000E4E8(s32 index); void objFreeAssets(Object *obj, s32 count, s32 objType); @@ -502,6 +502,7 @@ f32 func_8002277C(f32 *data, s32 index, f32 x); void race_transition_adventure(s32 updateRate); void func_8001E4C4(void); void func_8000B020(s32 numberOfVertices, s32 numberOfTriangles); +s32 func_80014B50(s32 arg0, s32 arg1, f32 arg2, u32 arg3); //Non Matching void calc_dynamic_lighting_for_object_1(Object *, ObjectModel *, s16, Object *, f32, f32); @@ -533,7 +534,6 @@ void func_800159C8(Object *, Object *); void func_80011264(ObjectModel *, Object *); void func_800245F0(ObjectModel *, Object *, f32); //asm func in unknown_0251F0 s32 object_animate(Object *obj); -s32 func_80014B50(s32 arg0, s32 arg1, f32 arg2, u32 arg3); s16 func_8001CD28(s32 arg0, s32 arg1, s32 arg2, s32 arg3); // NON MATCHING #endif diff --git a/src/particles.c b/src/particles.c index 51fc7b64..249b5599 100644 --- a/src/particles.c +++ b/src/particles.c @@ -478,12 +478,12 @@ void func_800AF29C(Particle *arg0, s32 behaviourID, s32 propertyID, s16 velX, s1 arg0->data.unkC_400.unk16 = behaviour->unk24; } else { arg0->data.flags = 0; - arg0->data.angle.y_rotation = behaviour->unk14; - arg0->data.angle.x_rotation = behaviour->unk16; - arg0->data.angle.z_rotation = behaviour->unk18; - arg0->data.angle.y_direction = behaviour->unk22; - arg0->data.angle.x_direction = behaviour->unk24; - arg0->data.angle.z_direction = behaviour->unk26; + arg0->data.angle.rotation.y_rotation = behaviour->unk14; + arg0->data.angle.rotation.x_rotation = behaviour->unk16; + arg0->data.angle.rotation.z_rotation = behaviour->unk18; + arg0->data.angle.direction.y_rotation = behaviour->unk22; + arg0->data.angle.direction.x_rotation = behaviour->unk24; + arg0->data.angle.direction.z_rotation = behaviour->unk26; } } @@ -539,25 +539,25 @@ void func_800AF52C(Object *obj, s32 arg1) { } } if (behaviour->flags & 1) { - temp_v0->data.angle.z_rotation = behaviour->unk14; - temp_v0->data.angle.y_direction = behaviour->unk16; + temp_v0->data.angle.rotation.z_rotation = behaviour->unk14; + temp_v0->data.angle.direction.y_rotation = behaviour->unk16; } if (behaviour->flags & 4) { - temp_v0->data.angle.x_direction = behaviour->unk22; - temp_v0->data.angle.z_direction = behaviour->unk24; + temp_v0->data.angle.direction.x_rotation = behaviour->unk22; + temp_v0->data.angle.direction.z_rotation = behaviour->unk24; } } else { if (behaviour->flags & 1) { temp_v0->data.unk6 = 0; - temp_v0->data.angle.y_rotation = behaviour->unk14; - temp_v0->data.angle.x_rotation = behaviour->unk16; - temp_v0->data.angle.z_rotation = behaviour->unk18; + temp_v0->data.angle.rotation.y_rotation = behaviour->unk14; + temp_v0->data.angle.rotation.x_rotation = behaviour->unk16; + temp_v0->data.angle.rotation.z_rotation = behaviour->unk18; } if (behaviour->flags & 4) { temp_v0->data.lifeTime = 0; - temp_v0->data.angle.y_direction = behaviour->unk22; - temp_v0->data.angle.x_direction = behaviour->unk24; - temp_v0->data.angle.z_direction = behaviour->unk26; + temp_v0->data.angle.direction.y_rotation = behaviour->unk22; + temp_v0->data.angle.direction.x_rotation = behaviour->unk24; + temp_v0->data.angle.direction.z_rotation = behaviour->unk26; } } temp_v0->data.flags &= 0xFDFF; @@ -877,19 +877,19 @@ void func_800B0010(Particle *arg0, Particle *arg1, Particle *arg2, ParticleBehav (f32) get_random_number_from_range(-arg3->gravityRange2, arg3->gravityRange2) * 0.00001525878906; } if (flags & (PARTICLE_UNK00000040 | PARTICLE_UNK00000020)) { - angle.y_rotation = arg2->data.angle.y_direction; + angle.y_rotation = arg2->data.angle.direction.y_rotation; if (flags & PARTICLE_UNK00000020) { angle.y_rotation += get_random_number_from_range(-arg3->angleRangeY2, arg3->angleRangeY2); } - angle.x_rotation = arg2->data.angle.x_direction; + angle.x_rotation = arg2->data.angle.direction.x_rotation; if (flags & PARTICLE_UNK00000040) { angle.x_rotation += get_random_number_from_range(-arg3->angleRangeX2, arg3->angleRangeX2); } - f32_vec3_apply_object_rotation3((ObjectTransform *) &angle, (f32 *) &velocityPos); + f32_vec3_apply_object_rotation3(&angle, &velocityPos.x); } else { - f32_vec3_apply_object_rotation3((ObjectTransform *) &arg2->data.angle.y_direction, (f32 *) &velocityPos); + f32_vec3_apply_object_rotation3(&arg2->data.angle.direction, &velocityPos.x); } - f32_vec3_apply_object_rotation((ObjectTransform *) arg0->segment.unk3C, (f32 *) &velocityPos); + f32_vec3_apply_object_rotation((ObjectTransform *) arg0->segment.unk3C, &velocityPos.x); arg0->segment.x_velocity += velocityPos.x; arg0->segment.y_velocity += velocityPos.y; arg0->segment.z_velocity += velocityPos.z; @@ -920,17 +920,17 @@ void func_800B03C0(Particle *particle, Particle *arg1, Particle *arg2, ParticleB 0.00001525878906; } if (flags & (PARTICLE_UNK00000004 | PARTICLE_UNK00000002)) { - angle.y_rotation = arg2->data.angle.y_rotation; + angle.y_rotation = arg2->data.angle.rotation.y_rotation; if (flags & PARTICLE_UNK00000002) { angle.y_rotation += get_random_number_from_range(-behaviour->angleRangeY1, behaviour->angleRangeY1); } - angle.x_rotation = arg2->data.angle.x_rotation; + angle.x_rotation = arg2->data.angle.rotation.x_rotation; if (flags & PARTICLE_UNK00000004) { angle.x_rotation += get_random_number_from_range(-behaviour->angleRangeX1, behaviour->angleRangeX1); } - f32_vec3_apply_object_rotation3((ObjectTransform *) &angle, (f32 *) &posVel); + f32_vec3_apply_object_rotation3(&angle, (f32 *) &posVel); } else { - f32_vec3_apply_object_rotation((ObjectTransform *) &arg2->data.angle.y_rotation, (f32 *) &posVel); + f32_vec3_apply_object_rotation((Vec3s *) &arg2->data.angle.rotation.y_rotation, (f32 *) &posVel); } particle->baseVelX += posVel.x; particle->baseVelY += posVel.y; @@ -1009,13 +1009,13 @@ Particle *func_800B0698(Particle *arg0, Particle *arg1) { } func_800B03C0(var_v0, arg0, arg1, sp20); if (sp20->flags & 0x80) { - var_v0->segment.trans.y_rotation = sp20->angleOffsetY; - var_v0->segment.trans.x_rotation = sp20->angleOffsetX; - var_v0->segment.trans.z_rotation = sp20->angleOffsetZ; + var_v0->segment.trans.rotation.y_rotation = sp20->angleOffsetY; + var_v0->segment.trans.rotation.x_rotation = sp20->angleOffsetX; + var_v0->segment.trans.rotation.z_rotation = sp20->angleOffsetZ; } else { - var_v0->segment.trans.y_rotation = arg0->segment.trans.y_rotation + sp20->angleOffsetY; - var_v0->segment.trans.x_rotation = arg0->segment.trans.x_rotation + sp20->angleOffsetX; - var_v0->segment.trans.z_rotation = arg0->segment.trans.z_rotation + sp20->angleOffsetZ; + var_v0->segment.trans.rotation.y_rotation = arg0->segment.trans.rotation.y_rotation + sp20->angleOffsetY; + var_v0->segment.trans.rotation.x_rotation = arg0->segment.trans.rotation.x_rotation + sp20->angleOffsetX; + var_v0->segment.trans.rotation.z_rotation = arg0->segment.trans.rotation.z_rotation + sp20->angleOffsetZ; } var_v0->angleVelY = sp20->angleVelY; var_v0->angleVelX = sp20->angleVelX; @@ -1029,12 +1029,12 @@ Particle *func_800B0698(Particle *arg0, Particle *arg1) { var_v0->forwardVel = sqrtf((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f14 * temp_f14)); } if (sp20->flags & 2) { - arg1->data.angle.z_rotation += sp20->unk1C; - arg1->data.angle.y_direction += sp20->unk1E; + arg1->data.angle.rotation.z_rotation += sp20->unk1C; + arg1->data.angle.direction.y_rotation += sp20->unk1E; } if (sp20->flags & 8) { - arg1->data.angle.x_direction += sp20->unk2A; - arg1->data.angle.z_direction += sp20->unk2C; + arg1->data.angle.direction.x_rotation += sp20->unk2A; + arg1->data.angle.direction.z_rotation += sp20->unk2C; } var_v0->segment.unk1A = properties->unk6; var_v0->segment.textureFrame = 0; @@ -1342,26 +1342,26 @@ Particle *func_800B1130(Particle *arg0, Particle *arg1) { } func_800B03C0(var_v0, arg0, arg1, behaviour); if (behaviour->flags & 0x80) { - var_v0->segment.trans.y_rotation = behaviour->angleOffsetY; - var_v0->segment.trans.x_rotation = behaviour->angleOffsetX; - var_v0->segment.trans.z_rotation = behaviour->angleOffsetZ; + var_v0->segment.trans.rotation.y_rotation = behaviour->angleOffsetY; + var_v0->segment.trans.rotation.x_rotation = behaviour->angleOffsetX; + var_v0->segment.trans.rotation.z_rotation = behaviour->angleOffsetZ; } else { - var_v0->segment.trans.y_rotation = arg0->segment.trans.y_rotation + behaviour->angleOffsetY; - var_v0->segment.trans.x_rotation = arg0->segment.trans.x_rotation + behaviour->angleOffsetX; - var_v0->segment.trans.z_rotation = arg0->segment.trans.z_rotation + behaviour->angleOffsetZ; + var_v0->segment.trans.rotation.y_rotation = arg0->segment.trans.rotation.y_rotation + behaviour->angleOffsetY; + var_v0->segment.trans.rotation.x_rotation = arg0->segment.trans.rotation.x_rotation + behaviour->angleOffsetX; + var_v0->segment.trans.rotation.z_rotation = arg0->segment.trans.rotation.z_rotation + behaviour->angleOffsetZ; } flags = behaviour->behaviourFlags & (PARTICLE_ANGLE_Z | PARTICLE_ANGLE_X | PARTICLE_ANGLE_Y); if (flags != 0) { if (flags & PARTICLE_ANGLE_Y) { - var_v0->segment.trans.y_rotation += + var_v0->segment.trans.rotation.y_rotation += get_random_number_from_range(-behaviour->angleRangeY3, behaviour->angleRangeY3); } if (flags & PARTICLE_ANGLE_X) { - var_v0->segment.trans.x_rotation += + var_v0->segment.trans.rotation.x_rotation += get_random_number_from_range(-behaviour->angleRangeX3, behaviour->angleRangeX3); } if (flags & PARTICLE_ANGLE_Z) { - var_v0->segment.trans.z_rotation += + var_v0->segment.trans.rotation.z_rotation += get_random_number_from_range(-behaviour->angleRangeZ3, behaviour->angleRangeZ3); } } @@ -1390,18 +1390,18 @@ Particle *func_800B1130(Particle *arg0, Particle *arg1) { if (behaviour->flags & 2) { arg1->data.unk6++; if (arg1->data.unk6 >= behaviour->unk1A) { - arg1->data.angle.y_rotation += behaviour->unk1C; - arg1->data.angle.x_rotation += behaviour->unk1E; - arg1->data.angle.z_rotation += behaviour->unk18; + arg1->data.angle.rotation.y_rotation += behaviour->unk1C; + arg1->data.angle.rotation.x_rotation += behaviour->unk1E; + arg1->data.angle.rotation.z_rotation += behaviour->unk18; arg1->data.unk6 -= behaviour->unk1A; } } if (behaviour->flags & 8) { arg1->data.lifeTime++; if (arg1->data.lifeTime >= behaviour->unk28) { - arg1->data.angle.y_direction += behaviour->unk2A; - arg1->data.angle.x_direction += behaviour->unk2C; - arg1->data.angle.z_direction += behaviour->unk2E; + arg1->data.angle.direction.y_rotation += behaviour->unk2A; + arg1->data.angle.direction.x_rotation += behaviour->unk2C; + arg1->data.angle.direction.z_rotation += behaviour->unk2E; arg1->data.lifeTime -= behaviour->unk28; } } @@ -1897,9 +1897,9 @@ void move_particle_basic_parent(Particle *particle) { particle->baseVelY += particle->segment.y_velocity; particle->segment.y_velocity -= particle->gravity; particle->baseVelZ += particle->segment.z_velocity; - particle->segment.trans.y_rotation += particle->angleVelY; - particle->segment.trans.x_rotation += particle->angleVelX; - particle->segment.trans.z_rotation += particle->angleVelZ; + particle->segment.trans.rotation.y_rotation += particle->angleVelY; + particle->segment.trans.rotation.x_rotation += particle->angleVelX; + particle->segment.trans.rotation.z_rotation += particle->angleVelZ; particle->segment.trans.scale += particle->segment.scaleVel; } particle->segment.trans.x_position = particle->baseVelX; @@ -1924,9 +1924,9 @@ void move_particle_velocity_parent(Particle *particle) { i = gParticleUpdateRate; while (i-- > 0) { - particle->segment.trans.y_rotation += particle->angleVelY; - particle->segment.trans.x_rotation += particle->angleVelX; - particle->segment.trans.z_rotation += particle->angleVelZ; + particle->segment.trans.rotation.y_rotation += particle->angleVelY; + particle->segment.trans.rotation.x_rotation += particle->angleVelX; + particle->segment.trans.rotation.z_rotation += particle->angleVelZ; particle->segment.trans.scale += particle->segment.scaleVel; } particle->segment.trans.x_position = 0.0f; @@ -1957,9 +1957,9 @@ void move_particle_with_velocities(Particle *particle) { particle->segment.trans.y_position += particle->segment.y_velocity; particle->segment.trans.z_position += particle->segment.z_velocity; particle->segment.trans.scale += particle->segment.scaleVel; - particle->segment.trans.y_rotation += particle->angleVelY; - particle->segment.trans.x_rotation += particle->angleVelX; - particle->segment.trans.z_rotation += particle->angleVelZ; + particle->segment.trans.rotation.y_rotation += particle->angleVelY; + particle->segment.trans.rotation.x_rotation += particle->angleVelX; + particle->segment.trans.rotation.z_rotation += particle->angleVelZ; vel.x = 0.0f; vel.y = -particle->forwardVel; vel.z = 0.0f; @@ -1983,9 +1983,9 @@ void move_particle_basic(Particle *particle) { particle->segment.y_velocity = particle->segment.y_velocity - particle->gravity; particle->segment.trans.z_position += particle->segment.z_velocity; particle->segment.trans.scale += particle->segment.scaleVel; - particle->segment.trans.y_rotation += particle->angleVelY; - particle->segment.trans.x_rotation += particle->angleVelX; - particle->segment.trans.z_rotation += particle->angleVelZ; + particle->segment.trans.rotation.y_rotation += particle->angleVelY; + particle->segment.trans.rotation.x_rotation += particle->angleVelX; + particle->segment.trans.rotation.z_rotation += particle->angleVelZ; } } @@ -2005,9 +2005,9 @@ void move_particle_with_velocity(Particle *particle) { particle->segment.trans.y_position += particle->segment.y_velocity - particle->gravity; particle->segment.trans.z_position += particle->segment.z_velocity; particle->segment.trans.scale += particle->segment.scaleVel; - particle->segment.trans.y_rotation += particle->angleVelY; - particle->segment.trans.x_rotation += particle->angleVelX; - particle->segment.trans.z_rotation += particle->angleVelZ; + particle->segment.trans.rotation.y_rotation += particle->angleVelY; + particle->segment.trans.rotation.x_rotation += particle->angleVelX; + particle->segment.trans.rotation.z_rotation += particle->angleVelZ; } } diff --git a/src/particles.h b/src/particles.h index f233ba5f..3df06b36 100644 --- a/src/particles.h +++ b/src/particles.h @@ -159,12 +159,8 @@ typedef struct ParticleSegment_3C { } ParticleSegment_3C; typedef struct ParticleAngle { - s16 y_rotation; - s16 x_rotation; - s16 z_rotation; - s16 y_direction; - s16 x_direction; - s16 z_direction; + Vec3s rotation; + Vec3s direction; } ParticleAngle; typedef struct ParticleData { diff --git a/src/racer.c b/src/racer.c index d51b91e0..309e469b 100644 --- a/src/racer.c +++ b/src/racer.c @@ -280,12 +280,12 @@ void func_80042D20(Object *obj, Object_Racer *racer, s32 updateRate) { sp5C = NULL; sp94 = 0.0f; sp90 = 0.0f; - temp_v0_3 = func_8001B7A8((Object *) racer, 1, &sp94); + temp_v0_3 = func_8001B7A8(racer, 1, &sp94); if (temp_v0_3 != NULL) { sp5C = temp_v0_3->unk64; } sp58 = NULL; - temp_v0_3 = func_8001B7A8((Object *) racer, -1, &sp90); + temp_v0_3 = func_8001B7A8(racer, -1, &sp90); if (temp_v0_3 != NULL) { sp58 = temp_v0_3->unk64; } @@ -806,7 +806,7 @@ void func_80046524(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r racer->steerAngle = 0; racer->spinout_timer = 0; racer->trickType = 0; - var_v1 = racer->zipperObj->segment.trans.y_rotation - (racer->steerVisualRotation & 0xFFFF); + var_v1 = racer->zipperObj->segment.trans.rotation.y_rotation - (racer->steerVisualRotation & 0xFFFF); if (var_v1 > 0x8000) { var_v1 -= 0xFFFF; } @@ -877,7 +877,7 @@ void func_80046524(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r } } if (racer->groundedWheels && racer->groundedWheels < 3) { - obj->segment.trans.x_rotation -= (obj->segment.trans.x_rotation * updateRate) >> 6; + obj->segment.trans.rotation.x_rotation -= (obj->segment.trans.rotation.x_rotation * updateRate) >> 6; racer->x_rotation_vel -= (racer->x_rotation_vel * updateRate) >> 6; } if (racer->unk1D4 != 0) { @@ -904,9 +904,9 @@ void func_80046524(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r racer->y_rotation_offset += updateRate * 0x500; racer->x_rotation_offset += updateRate * 0x600; } - gCurrentRacerTransform.y_rotation = obj->segment.trans.y_rotation; - gCurrentRacerTransform.x_rotation = obj->segment.trans.x_rotation; - gCurrentRacerTransform.z_rotation = 0; + gCurrentRacerTransform.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; + gCurrentRacerTransform.rotation.x_rotation = obj->segment.trans.rotation.x_rotation; + gCurrentRacerTransform.rotation.z_rotation = 0; gCurrentRacerTransform.x_position = 0.0f; gCurrentRacerTransform.y_position = 0.0f; gCurrentRacerTransform.z_position = 0.0f; @@ -1151,9 +1151,9 @@ void func_80046524(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r } racer->unk10C = 0; racer->y_rotation_vel += (gCurrentCarSteerVel - racer->y_rotation_vel) >> 3; - obj->segment.trans.y_rotation = racer->steerVisualRotation + racer->y_rotation_vel; + obj->segment.trans.rotation.y_rotation = racer->steerVisualRotation + racer->y_rotation_vel; racer->z_rotation_vel += (D_8011D558 - racer->z_rotation_vel) >> 3; - obj->segment.trans.z_rotation = racer->x_rotation_vel + racer->z_rotation_vel; + obj->segment.trans.rotation.z_rotation = racer->x_rotation_vel + racer->z_rotation_vel; if (racer->unk1D2 > 0) { racer->unk1D2 -= updateRate; } else { @@ -1326,9 +1326,9 @@ void func_80046524(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r func_800AF714(obj, updateRate); obj->segment.y_velocity -= updateRate * gCurrentRacerWeightStat; } - gCurrentRacerTransform.y_rotation = -obj->segment.trans.y_rotation; - gCurrentRacerTransform.x_rotation = -obj->segment.trans.x_rotation; - gCurrentRacerTransform.z_rotation = -obj->segment.trans.z_rotation; + gCurrentRacerTransform.rotation.y_rotation = -obj->segment.trans.rotation.y_rotation; + gCurrentRacerTransform.rotation.x_rotation = -obj->segment.trans.rotation.x_rotation; + gCurrentRacerTransform.rotation.z_rotation = -obj->segment.trans.rotation.z_rotation; gCurrentRacerTransform.scale = 1.0f; gCurrentRacerTransform.x_position = 0.0f; gCurrentRacerTransform.y_position = 0.0f; @@ -1338,14 +1338,14 @@ void func_80046524(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r &racer->lateral_velocity, (f32 *) &racer->unk34, &racer->velocity); if (racer->groundedWheels == 0 && racer->waterTimer == 0) { iTemp = (-gCurrentStickY * 0x40) & 0xFFFF; - var_v1 = iTemp - (obj->segment.trans.x_rotation & 0xFFFF); + var_v1 = iTemp - (obj->segment.trans.rotation.x_rotation & 0xFFFF); if (var_v1 > 0x8000) { var_v1 -= 0xFFFF; } if (var_v1 < -0x8000) { var_v1 += 0xFFFF; } - obj->segment.trans.x_rotation += var_v1 >> 2; + obj->segment.trans.rotation.x_rotation += var_v1 >> 2; var_v0 = -(racer->x_rotation_vel & 0xFFFF); if (var_v0 > 0x8000) { var_v0 -= 0xFFFF; @@ -1512,7 +1512,7 @@ void update_camera_hovercraft(f32 updateRate, Object *obj, Object_Racer *racer) break; } if (racer->unk1E4 == 0) { - angle = (obj->segment.trans.x_rotation); + angle = (obj->segment.trans.rotation.x_rotation); if (angle > 0) { angle -= 0x61C; if (angle < 0) { @@ -1526,9 +1526,9 @@ void update_camera_hovercraft(f32 updateRate, Object *obj, Object_Racer *racer) } } angle = sp24 - angle; - tempAngle = angle - (u16) gCameraObject->trans.x_rotation; + tempAngle = angle - (u16) gCameraObject->trans.rotation.x_rotation; WRAP(tempAngle, -0x8000, 0x8000); - gCameraObject->trans.x_rotation += (tempAngle * tempUpdateRate) >> 4; + gCameraObject->trans.rotation.x_rotation += (tempAngle * tempUpdateRate) >> 4; } get_viewport_count(); if (racer->velocity < 0.0) { @@ -1553,8 +1553,8 @@ void update_camera_hovercraft(f32 updateRate, Object *obj, Object_Racer *racer) } gCameraObject->unk1C += (phi_f14 - gCameraObject->unk1C) * 0.125; //!@Delta gCameraObject->unk20 += (phi_f18 - gCameraObject->unk20) * 0.125; //!@Delta - sp34 = sins_f(gCameraObject->trans.x_rotation - sp24); - phi_f18 = coss_f(gCameraObject->trans.x_rotation - sp24); + sp34 = sins_f(gCameraObject->trans.rotation.x_rotation - sp24); + phi_f18 = coss_f(gCameraObject->trans.rotation.x_rotation - sp24); phi_f18 = (gCameraObject->unk1C * sp34) + (gCameraObject->unk20 * phi_f18); xVel = sins_f(-racer->cameraYaw + 0x8000) * gCameraObject->unk1C; zVel = coss_f(-racer->cameraYaw + 0x8000) * gCameraObject->unk1C; @@ -1579,14 +1579,14 @@ void update_camera_hovercraft(f32 updateRate, Object *obj, Object_Racer *racer) } } gCameraObject->trans.y_position -= yVel; - gCameraObject->trans.z_rotation = 0; + gCameraObject->trans.rotation.z_rotation = 0; if (gRaceStartTimer) { gCameraObject->trans.y_position = obj->segment.trans.y_position + phi_f18; } coss_f(racer->cameraYaw + 0x4000); // Unused function call that wasn't fully optimised out. gCameraObject->trans.z_position = obj->segment.trans.z_position + zVel; - gCameraObject->trans.y_rotation = racer->cameraYaw; + gCameraObject->trans.rotation.y_rotation = racer->cameraYaw; segmentIndex = get_level_segment_index_from_position( gCameraObject->trans.x_position, gCameraObject->trans.y_position, gCameraObject->trans.z_position); if (segmentIndex != SEGMENT_NONE) { @@ -1619,9 +1619,9 @@ f32 rotate_racer_in_water(Object *obj, Object_Racer *racer, Vec3f *pos, s8 arg3, obj->segment.trans.z_position += pos->z * updateRateF * arg6; velocity = 1.0f; } - gCurrentRacerTransform.y_rotation = -obj->segment.trans.y_rotation; - gCurrentRacerTransform.x_rotation = 0; - gCurrentRacerTransform.z_rotation = 0; + gCurrentRacerTransform.rotation.y_rotation = -obj->segment.trans.rotation.y_rotation; + gCurrentRacerTransform.rotation.x_rotation = 0; + gCurrentRacerTransform.rotation.z_rotation = 0; gCurrentRacerTransform.x_position = 0.0f; gCurrentRacerTransform.y_position = 0.0f; gCurrentRacerTransform.z_position = 0.0f; @@ -1636,10 +1636,10 @@ f32 rotate_racer_in_water(Object *obj, Object_Racer *racer, Vec3f *pos, s8 arg3, angleVel = ((s16) (u16) arctan2_f(pos->z, pos->y) * velocity); angleVel += -gCurrentStickY * 32; angleVel += 0x3C0; - angle = (u16) angleVel - ((u16) obj->segment.trans.x_rotation); + angle = (u16) angleVel - ((u16) obj->segment.trans.rotation.x_rotation); angle = angle > 0x8000 ? angle - 0xffff : angle; angle = angle < -0x8000 ? angle + 0xffff : angle; - obj->segment.trans.x_rotation += (angle * updateRate) >> 4; + obj->segment.trans.rotation.x_rotation += (angle * updateRate) >> 4; return velocity; } @@ -1812,7 +1812,7 @@ void update_camera_plane(f32 updateRate, Object *obj, Object_Racer *racer) { if (racer->trickType == 2 || racer->trickType == -2) { angle = 0; } else { - angle = obj->segment.trans.x_rotation; + angle = obj->segment.trans.rotation.x_rotation; if (angle > 0x3000) { angle = 0x3000; } @@ -1821,14 +1821,14 @@ void update_camera_plane(f32 updateRate, Object *obj, Object_Racer *racer) { } } angle = -(angle - ((s32) (temp_f16 * 10.0f))); - angle = angle - ((u16) gCameraObject->trans.x_rotation); + angle = angle - ((u16) gCameraObject->trans.rotation.x_rotation); if (angle > 0x8000) { angle -= 0xFFFF; } if (angle < -0x8000) { angle += 0xFFFF; } - gCameraObject->trans.x_rotation += ((angle * delta) >> 4); + gCameraObject->trans.rotation.x_rotation += ((angle * delta) >> 4); brakeVar = racer->brake; baseSpeed = racer->forwardVel; switch (gCameraObject->zoom) { @@ -1877,8 +1877,8 @@ void update_camera_plane(f32 updateRate, Object *obj, Object_Racer *racer) { } gCameraObject->unk1C += (phi_f14 - gCameraObject->unk1C) * 0.125; gCameraObject->unk20 += (baseFloat1 - gCameraObject->unk20) * 0.125; - phi_f14 = sins_f(gCameraObject->trans.x_rotation - 0x400); - xOffset = coss_f(gCameraObject->trans.x_rotation - 0x400); + phi_f14 = sins_f(gCameraObject->trans.rotation.x_rotation - 0x400); + xOffset = coss_f(gCameraObject->trans.rotation.x_rotation - 0x400); baseFloat3 = phi_f14; baseFloat2 = (gCameraObject->unk1C * baseFloat3) - (gCameraObject->unk20 * xOffset); baseFloat1 = ((gCameraObject->unk1C) * (gCameraObject->unk1C)); @@ -1912,18 +1912,18 @@ void update_camera_plane(f32 updateRate, Object *obj, Object_Racer *racer) { gCameraObject->trans.y_position -= yVel; gCameraObject->trans.z_position = zOffset + obj->segment.trans.z_position + (-coss_f(racer->cameraYaw + 0x4000) * 3.0f * racer->lateral_velocity); - gCameraObject->trans.y_rotation = racer->cameraYaw; + gCameraObject->trans.rotation.y_rotation = racer->cameraYaw; if (racer->trickType || gDialogueCameraAngle) { - angle = -(u16) gCameraObject->trans.z_rotation; + angle = -(u16) gCameraObject->trans.rotation.z_rotation; if (angle > 0x8000) { angle -= 0xFFFF; } if (angle < -0x8000) { angle += 0xFFFF; } - gCameraObject->trans.z_rotation += angle >> 2; + gCameraObject->trans.rotation.z_rotation += angle >> 2; } else { - angle = (u16) gCameraObject->trans.z_rotation; + angle = (u16) gCameraObject->trans.rotation.z_rotation; angle = angle + (-(racer->x_rotation_vel >> 4)); if (angle > 0x8000) { angle -= 0xFFFF; @@ -1931,7 +1931,7 @@ void update_camera_plane(f32 updateRate, Object *obj, Object_Racer *racer) { if (angle < -0x8000) { angle += 0xFFFF; } - gCameraObject->trans.z_rotation += angle >> 3; + gCameraObject->trans.rotation.z_rotation += angle >> 3; } tempVel = gCameraObject->trans.x_position; segmentIndex = get_level_segment_index_from_position(tempVel, gCameraObject->trans.y_position, @@ -1939,7 +1939,7 @@ void update_camera_plane(f32 updateRate, Object *obj, Object_Racer *racer) { if (segmentIndex != -1) { gCameraObject->segmentIndex = segmentIndex; } - racer->cameraYaw = gCameraObject->trans.y_rotation; + racer->cameraYaw = gCameraObject->trans.rotation.y_rotation; } #else GLOBAL_ASM("asm/non_matchings/racer/update_camera_plane.s") @@ -1981,9 +1981,9 @@ void update_camera_loop(f32 updateRateF, Object *obj, Object_Racer *racer) { zoom -= 35.0f; } gCameraObject->unk1C += (zoom - gCameraObject->unk1C) * 0.125; - gCurrentRacerTransform.y_rotation = -gCameraObject->trans.y_rotation + 0x8000; - gCurrentRacerTransform.x_rotation = -gCameraObject->trans.x_rotation; - gCurrentRacerTransform.z_rotation = 0; + gCurrentRacerTransform.rotation.y_rotation = -gCameraObject->trans.rotation.y_rotation + 0x8000; + gCurrentRacerTransform.rotation.x_rotation = -gCameraObject->trans.rotation.x_rotation; + gCurrentRacerTransform.rotation.z_rotation = 0; gCurrentRacerTransform.x_position = 0.0f; gCurrentRacerTransform.y_position = 0.0f; gCurrentRacerTransform.z_position = 0.0f; @@ -1997,21 +1997,21 @@ void update_camera_loop(f32 updateRateF, Object *obj, Object_Racer *racer) { gCameraObject->trans.x_position += xVel; gCameraObject->trans.y_position += yVel; gCameraObject->trans.z_position += zVel; - angleDiff = (u16) (-obj->segment.trans.z_rotation); - angle = angleDiff - ((u16) gCameraObject->trans.z_rotation); + angleDiff = (u16) (-obj->segment.trans.rotation.z_rotation); + angle = angleDiff - ((u16) gCameraObject->trans.rotation.z_rotation); WRAP(angle, -0x8000, 0x8000); - gCameraObject->trans.z_rotation += ((angle * UpdateRate) >> 4); - angleDiff = -obj->segment.trans.x_rotation; - angle = angleDiff - (u16) gCameraObject->trans.x_rotation; + gCameraObject->trans.rotation.z_rotation += ((angle * UpdateRate) >> 4); + angleDiff = -obj->segment.trans.rotation.x_rotation; + angle = angleDiff - (u16) gCameraObject->trans.rotation.x_rotation; WRAP(angle, -0x8000, 0x8000); - gCameraObject->trans.x_rotation += ((angle * UpdateRate) >> 4); - gCameraObject->trans.y_rotation = racer->cameraYaw; + gCameraObject->trans.rotation.x_rotation += ((angle * UpdateRate) >> 4); + gCameraObject->trans.rotation.y_rotation = racer->cameraYaw; segmentIndex = get_level_segment_index_from_position( gCameraObject->trans.x_position, gCameraObject->trans.y_position, gCameraObject->trans.z_position); if (segmentIndex != SEGMENT_NONE) { gCameraObject->segmentIndex = segmentIndex; } - racer->cameraYaw = gCameraObject->trans.y_rotation; + racer->cameraYaw = gCameraObject->trans.rotation.y_rotation; gCameraObject->trans.x_position += gCameraObject->offsetX; gCameraObject->trans.y_position += gCameraObject->offsetY; gCameraObject->trans.z_position += gCameraObject->offsetZ; @@ -2040,9 +2040,9 @@ void update_carpet(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r racer->unk154->segment.trans.y_position = obj->segment.trans.y_position; racer->unk154->segment.trans.z_position = obj->segment.trans.z_position; racer->unk154->segment.object.segmentID = obj->segment.object.segmentID; - racer->unk154->segment.trans.y_rotation = obj->segment.trans.y_rotation; - racer->unk154->segment.trans.x_rotation = obj->segment.trans.x_rotation; - racer->unk154->segment.trans.z_rotation = obj->segment.trans.z_rotation; + racer->unk154->segment.trans.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; + racer->unk154->segment.trans.rotation.x_rotation = obj->segment.trans.rotation.x_rotation; + racer->unk154->segment.trans.rotation.z_rotation = obj->segment.trans.rotation.z_rotation; obj->segment.object.animationID = 0; obj->segment.animFrame = animFrame + updateRate; func_80061C0C(obj); @@ -2061,9 +2061,9 @@ void obj_init_racer(Object *obj, LevelObjectEntry_Racer *racer) { unused_8011D53C = 0; tempRacer = (struct Object_Racer *) obj->unk64; - obj->segment.trans.y_rotation = racer->angleY; - obj->segment.trans.x_rotation = racer->angleX; - obj->segment.trans.z_rotation = racer->angleZ; + obj->segment.trans.rotation.y_rotation = racer->angleY; + obj->segment.trans.rotation.x_rotation = racer->angleX; + obj->segment.trans.rotation.z_rotation = racer->angleZ; player = racer->playerIndex; tempRacer->countLap = 0; tempRacer->stretch_height = 1.0f; @@ -2078,8 +2078,8 @@ void obj_init_racer(Object *obj, LevelObjectEntry_Racer *racer) { } else { tempRacer->playerIndex = PLAYER_COMPUTER; } - tempRacer->steerVisualRotation = obj->segment.trans.y_rotation; - tempRacer->x_rotation_vel = obj->segment.trans.z_rotation; + tempRacer->steerVisualRotation = obj->segment.trans.rotation.y_rotation; + tempRacer->x_rotation_vel = obj->segment.trans.rotation.z_rotation; tempRacer->unkC4 = 0.5f; if (1) {} // Fakematch tempRacer->cameraYaw = tempRacer->steerVisualRotation; @@ -2116,9 +2116,9 @@ void obj_init_racer(Object *obj, LevelObjectEntry_Racer *racer) { if (tempRacer->playerIndex != PLAYER_COMPUTER && gTajInteractStatus == TAJ_WANDER) { set_active_camera(player); gCameraObject = (ObjectCamera *) get_active_camera_segment_no_cutscenes(); - gCameraObject->trans.z_rotation = 0; - gCameraObject->trans.x_rotation = 0x400; - gCameraObject->trans.y_rotation = tempRacer->cameraYaw; + gCameraObject->trans.rotation.z_rotation = 0; + gCameraObject->trans.rotation.x_rotation = 0x400; + gCameraObject->trans.rotation.y_rotation = tempRacer->cameraYaw; gCameraObject->mode = CAMERA_CAR; gCameraObject->unk3C = 0xFF; gCameraObject->unk3D = 0xFF; @@ -2557,10 +2557,10 @@ void update_player_racer(Object *obj, s32 updateRate) { } tempRacer->challengeMarker->segment.trans.z_position = checkpointNode->obj->segment.trans.z_position; - tempRacer->challengeMarker->segment.trans.y_rotation = - checkpointNode->obj->segment.trans.y_rotation; - tempRacer->challengeMarker->segment.trans.x_rotation = - checkpointNode->obj->segment.trans.x_rotation; + tempRacer->challengeMarker->segment.trans.rotation.y_rotation = + checkpointNode->obj->segment.trans.rotation.y_rotation; + tempRacer->challengeMarker->segment.trans.rotation.x_rotation = + checkpointNode->obj->segment.trans.rotation.x_rotation; tempRacer->challengeMarker->segment.object.segmentID = checkpointNode->obj->segment.object.segmentID; } @@ -2759,11 +2759,11 @@ void racer_approach_object(Object *obj, Object_Racer *racer, f32 divisor) { diffY = racer->approachTarget->segment.trans.y_position - obj->segment.trans.y_position; diffZ = racer->approachTarget->segment.trans.z_position - obj->segment.trans.z_position; move_object(obj, diffX, diffY, diffZ); - obj->segment.trans.y_rotation = racer->approachTarget->segment.trans.y_rotation; - obj->segment.trans.x_rotation = racer->approachTarget->segment.trans.x_rotation; - obj->segment.trans.z_rotation = racer->approachTarget->segment.trans.z_rotation; - racer->x_rotation_vel = obj->segment.trans.z_rotation; - racer->steerVisualRotation = obj->segment.trans.y_rotation; + obj->segment.trans.rotation.y_rotation = racer->approachTarget->segment.trans.rotation.y_rotation; + obj->segment.trans.rotation.x_rotation = racer->approachTarget->segment.trans.rotation.x_rotation; + obj->segment.trans.rotation.z_rotation = racer->approachTarget->segment.trans.rotation.z_rotation; + racer->x_rotation_vel = obj->segment.trans.rotation.z_rotation; + racer->steerVisualRotation = obj->segment.trans.rotation.y_rotation; obj->segment.x_velocity = diffX / divisor; obj->segment.y_velocity = diffY / divisor; obj->segment.z_velocity = diffZ / divisor; @@ -3350,13 +3350,13 @@ void handle_racer_head_turning(Object *obj, Object_Racer *racer, UNUSED s32 upda foundObj = turn_head_towards_object(obj, racer, tempObj, 400.0f * 400.0f); } if (foundObj == FALSE) { - tempObj = func_8001B7A8((Object *) racer, 1, &distance); + tempObj = func_8001B7A8(racer, 1, &distance); if (tempObj && !gRaceStartTimer) { foundObj = turn_head_towards_object(obj, racer, tempObj, 400.0f * 400.0f); } } if (foundObj == FALSE) { - tempObj = func_8001B7A8((Object *) racer, -1, &distance); + tempObj = func_8001B7A8(racer, -1, &distance); if (tempObj && !gRaceStartTimer) { foundObj = turn_head_towards_object(obj, racer, tempObj, 30000.0f); } @@ -3405,7 +3405,7 @@ s32 turn_head_towards_object(Object *obj, Object_Racer *racer, Object *targetObj diffX = targetObj->segment.trans.x_position - obj->segment.trans.x_position; diffZ = targetObj->segment.trans.z_position - obj->segment.trans.z_position; if ((diffX * diffX) + (diffZ * diffZ) < distance) { - intendedAngle = (arctan2_f(diffX, diffZ) - (obj->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + intendedAngle = (arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + 0x8000; WRAP(intendedAngle, -0x8000, 0x8000); CLAMP(intendedAngle, -0x3000, 0x3000); racer->headAngleTarget = intendedAngle; @@ -3413,7 +3413,7 @@ s32 turn_head_towards_object(Object *obj, Object_Racer *racer, Object *targetObj racer->headAngleTarget = 0; } racer = (struct Object_Racer *) targetObj->unk64; - intendedAngle = arctan2_f(diffX, diffZ) - (obj->segment.trans.y_rotation & 0xFFFF); + intendedAngle = arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF); WRAP(intendedAngle, -0x8000, 0x8000); CLAMP(intendedAngle, -0x3000, 0x3000); racer->headAngleTarget = intendedAngle; @@ -3762,10 +3762,10 @@ void update_car_velocity_offground(Object *obj, Object_Racer *racer, s32 updateR yStick = -yStick; yStick *= 64; yStick = (u16) yStick; - angle = yStick - ((u16) obj->segment.trans.x_rotation); + angle = yStick - ((u16) obj->segment.trans.rotation.x_rotation); angle = angle > 0x8000 ? angle - 0xFFFF : angle; angle = angle < -0x8000 ? angle + 0xFFFF : angle; - obj->segment.trans.x_rotation += (angle >> 3); //!@Delta + obj->segment.trans.rotation.x_rotation += (angle >> 3); //!@Delta obj->segment.y_velocity -= weight * updateRateF; if (racer->buoyancy == 0.0) { steerAngle = -obj->segment.y_velocity * 20.0; @@ -3815,9 +3815,9 @@ void handle_car_steering(Object_Racer *racer) { void func_800535C4(Object *obj, Object_Racer *racer) { Matrix mf; - gCurrentRacerTransform.y_rotation = -racer->steerVisualRotation; - gCurrentRacerTransform.x_rotation = -obj->segment.trans.x_rotation; - gCurrentRacerTransform.z_rotation = -racer->x_rotation_vel; + gCurrentRacerTransform.rotation.y_rotation = -racer->steerVisualRotation; + gCurrentRacerTransform.rotation.x_rotation = -obj->segment.trans.rotation.x_rotation; + gCurrentRacerTransform.rotation.z_rotation = -racer->x_rotation_vel; gCurrentRacerTransform.x_position = 0; gCurrentRacerTransform.y_position = 0; gCurrentRacerTransform.z_position = 0; @@ -3851,7 +3851,124 @@ void handle_car_velocity_control(Object_Racer *racer) { } } -GLOBAL_ASM("asm/non_matchings/racer/func_80053750.s") +void func_80053750(Object *objRacer, Object_Racer *racer, f32 updateRateF) { + Object *someObj; + f64 temp_f0; + f32 velocity; + s32 temp_v1; + s32 flags; + s32 isNotHardBraking; + s32 i; + + if (objRacer->unk60 == NULL) { + return; + } + temp_v1 = objRacer->unk60->unk0; + if (temp_v1 == 2) { + someObj = objRacer->unk60->unk4[0]; + someObj->segment.trans.rotation.y_rotation = 0x4000; + someObj = objRacer->unk60->unk4[1]; + someObj->segment.trans.rotation.y_rotation = 0x4000; + } + if (temp_v1 >= 4) { + velocity = racer->velocity; + if (velocity > 5.0) { + velocity = 5.0; + } + if (velocity < -5.0) { + velocity = -5.0; + } + isNotHardBraking = TRUE; + if (racer->brake > 0.4) { + if (racer->throttle < 0.4) { + velocity = 0.0f; + } + isNotHardBraking = FALSE; + } + racer->unkB0 -= (velocity * updateRateF) * 0.5; + while (racer->unkB0 > 5.0) { + racer->unkB0 -= 5.0; + for (i = 0; i < 4; i++) { + if (i < 2 || isNotHardBraking) { + someObj = objRacer->unk60->unk4[i]; + if ((racer->unk1FB != 0 && i >= 3) || racer->unk1FB == 0) { + if (someObj->properties.common.unk0 != 0) { + someObj->segment.object.modelIndex--; + if (someObj->segment.object.modelIndex < 0) { + someObj->segment.object.modelIndex = someObj->segment.header->numberOfModelIds - 1; + } + } else { + someObj->segment.object.modelIndex++; + if (someObj->segment.object.modelIndex == someObj->segment.header->numberOfModelIds) { + someObj->segment.object.modelIndex = 0; + } + } + } + } + } + } + while (racer->unkB0 < 0.0f) { + racer->unkB0 += 5.0; + for (i = 0; i < 4; i++) { + if (i < 2 || isNotHardBraking) { + someObj = objRacer->unk60->unk4[i]; + if ((racer->unk1FB != 0 && i >= 3) || racer->unk1FB == 0) { + if (someObj->properties.common.unk0 == 0) { + someObj->segment.object.modelIndex--; + if (someObj->segment.object.modelIndex < 0) { + someObj->segment.object.modelIndex = someObj->segment.header->numberOfModelIds - 1; + } + } else { + someObj->segment.object.modelIndex++; + if (someObj->segment.object.modelIndex == someObj->segment.header->numberOfModelIds) { + someObj->segment.object.modelIndex = 0; + } + } + } + } + } + } + flags = 1; + if (racer->unk1FB != 0) { + for (i = 0; i < 2; i++) { + someObj = objRacer->unk60->unk4[i]; + if (someObj->properties.racer.unk0 != 0) { + someObj->segment.object.modelIndex--; + if (someObj->segment.object.modelIndex < 0) { + someObj->segment.object.modelIndex = (s8) (someObj->segment.header->numberOfModelIds - 1); + } + } else { + someObj->segment.object.modelIndex++; + if (someObj->segment.object.modelIndex == someObj->segment.header->numberOfModelIds) { + someObj->segment.object.modelIndex = 0; + } + } + } + objRacer->particleEmitFlags |= OBJ_EMIT_UNK_400 | OBJ_EMIT_UNK_800; + } + temp_f0 = someObj->segment.trans.y_position; // Fake + for (i = 0; i < 4; i++) { + someObj = objRacer->unk60->unk4[i]; + if (!(racer->unk1E3 & flags)) { + someObj->segment.trans.y_position += ((-10.0f - someObj->segment.trans.y_position) * 0.125); + if (racer->waterTimer != 0) { + someObj->segment.trans.scale += + (((someObj->segment.header->scale * 1.4) - someObj->segment.trans.scale) * 0.1); + } + } else { + temp_f0 = someObj->segment.trans.y_position; + someObj->segment.trans.y_position = (temp_f0 - (temp_f0 * 0.125)); + someObj->segment.trans.scale += + ((someObj->segment.header->scale - someObj->segment.trans.scale) * 0.1); + } + flags <<= 1; + } + someObj = objRacer->unk60->unk4[2]; + someObj->segment.trans.rotation.y_rotation = gCurrentStickX * 100; + someObj = objRacer->unk60->unk4[3]; + someObj->segment.trans.rotation.y_rotation = gCurrentStickX * 100; + } +} /** * Initialise some states when a racer is attacked or runs into something. @@ -4008,13 +4125,13 @@ void update_onscreen_AI_racer(Object *obj, Object_Racer *racer, s32 updateRate, angle >>= 2; CLAMP(angle, -0x2EE, 0x2EE); racer->y_rotation_vel += (angle * updateRate); - obj->segment.trans.y_rotation = racer->steerVisualRotation + racer->y_rotation_vel; + obj->segment.trans.rotation.y_rotation = racer->steerVisualRotation + racer->y_rotation_vel; racer->z_rotation_vel += ((D_8011D558 - racer->z_rotation_vel) * updateRate) >> 4; - obj->segment.trans.z_rotation = racer->x_rotation_vel + racer->z_rotation_vel; + obj->segment.trans.rotation.z_rotation = racer->x_rotation_vel + racer->z_rotation_vel; if (!racer->unk1F0) { - gCurrentRacerTransform.y_rotation = racer->steerVisualRotation + racer->unk10C; - gCurrentRacerTransform.x_rotation = 0; - gCurrentRacerTransform.z_rotation = 0; + gCurrentRacerTransform.rotation.y_rotation = racer->steerVisualRotation + racer->unk10C; + gCurrentRacerTransform.rotation.x_rotation = 0; + gCurrentRacerTransform.rotation.z_rotation = 0; gCurrentRacerTransform.x_position = 0.0f; gCurrentRacerTransform.y_position = 0.0f; gCurrentRacerTransform.z_position = 0.0f; @@ -4055,9 +4172,9 @@ void update_onscreen_AI_racer(Object *obj, Object_Racer *racer, s32 updateRate, xVel = (((obj->segment.trans.x_position - xTemp) - D_8011D548) * tempVel) - racer->unk84; obj->segment.y_velocity = (obj->segment.trans.y_position - yTemp) * tempVel; zVel = (((obj->segment.trans.z_position - zTemp) - D_8011D54C) * tempVel) - racer->unk88; - gCurrentRacerTransform.y_rotation = -(racer->steerVisualRotation + racer->unk10C); - gCurrentRacerTransform.x_rotation = -obj->segment.trans.x_rotation; - gCurrentRacerTransform.z_rotation = -obj->segment.trans.z_rotation; + gCurrentRacerTransform.rotation.y_rotation = -(racer->steerVisualRotation + racer->unk10C); + gCurrentRacerTransform.rotation.x_rotation = -obj->segment.trans.rotation.x_rotation; + gCurrentRacerTransform.rotation.z_rotation = -obj->segment.trans.rotation.z_rotation; gCurrentRacerTransform.x_position = 0.0f; gCurrentRacerTransform.y_position = 0.0f; gCurrentRacerTransform.z_position = 0.0f; @@ -4321,8 +4438,8 @@ void onscreen_ai_racer_physics(Object *obj, Object_Racer *racer, UNUSED s32 upda obj->segment.trans.z_position = racer->unkD8.z; if (racer->groundedWheels) { func_8002ACD4(&xTemp, &yTemp, &zTemp); - angleX = sins_f(-obj->segment.trans.y_rotation); - angleZ = coss_f(-obj->segment.trans.y_rotation); + angleX = sins_f(-obj->segment.trans.rotation.y_rotation); + angleZ = coss_f(-obj->segment.trans.rotation.y_rotation); distance = (xTemp * angleZ) + (zTemp * angleX); zTemp = (xTemp * angleX) - (zTemp * angleZ); temp_v1_2 = -(s16) (u16) arctan2_f(distance, yTemp); @@ -4331,20 +4448,20 @@ void onscreen_ai_racer_physics(Object *obj, Object_Racer *racer, UNUSED s32 upda } xRot = -(s16) (u16) arctan2_f(zTemp, yTemp); if ((xRot < 0x2000) && (xRot > -0x2000)) { - obj->segment.trans.x_rotation = xRot; + obj->segment.trans.rotation.x_rotation = xRot; } if (racer->vehicleID == VEHICLE_LOOPDELOOP) { if (1) { // Fakematch - xRot -= (u16) obj->segment.trans.x_rotation; + xRot -= (u16) obj->segment.trans.rotation.x_rotation; } WRAP(xRot, -0x8000, 0x8000); - obj->segment.trans.x_rotation += xRot >> 2; + obj->segment.trans.rotation.x_rotation += xRot >> 2; } } if (racer->vehicleID != VEHICLE_LOOPDELOOP && racer->vehicleID != VEHICLE_PLANE && racer->vehicleID != VEHICLE_CARPET && racer->vehicleID != VEHICLE_SMOKEY) { CLAMP(racer->x_rotation_vel, -0x3400, 0x3400); - CLAMP(obj->segment.trans.x_rotation, -0x3400, 0x3400); + CLAMP(obj->segment.trans.rotation.x_rotation, -0x3400, 0x3400); } } @@ -4601,12 +4718,12 @@ void handle_racer_items(Object *obj, Object_Racer *racer, UNUSED s32 updateRate) spawnedObj->segment.x_velocity = obj->segment.x_velocity - (racer->ox1 * velocity); spawnedObj->segment.y_velocity = obj->segment.y_velocity - (racer->oy1 * velocity); spawnedObj->segment.z_velocity = obj->segment.z_velocity - (racer->oz1 * velocity); - spawnedObj->segment.trans.y_rotation = obj->segment.trans.y_rotation; - spawnedObj->segment.trans.x_rotation = obj->segment.trans.x_rotation; + spawnedObj->segment.trans.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; + spawnedObj->segment.trans.rotation.x_rotation = obj->segment.trans.rotation.x_rotation; if (racer->vehicleID == VEHICLE_HOVERCRAFT && racer->waterTimer) { - if (spawnedObj->segment.trans.x_rotation > -0x400 && - spawnedObj->segment.trans.x_rotation < 0x400) { - spawnedObj->segment.trans.x_rotation = 0; + if (spawnedObj->segment.trans.rotation.x_rotation > -0x400 && + spawnedObj->segment.trans.rotation.x_rotation < 0x400) { + spawnedObj->segment.trans.rotation.x_rotation = 0; } } objData = spawnedObj->unk64; @@ -4675,7 +4792,80 @@ void play_char_horn_sound(Object *obj, Object_Racer *racer) { } } -GLOBAL_ASM("asm/non_matchings/racer/func_8005698C.s") +// Used for magnet and homing rockets to get the distance to the nearest racer. +Object *func_8005698C(Object *racerObj, Object_Racer *racer, f32 *outDistance) { + Object_Racer *curRacer; + s32 i; + f32 curDistance; + f32 racerOx1; + UNUSED s32 pad; + f32 racerOy1; + Object *savedRacerObj; + Object *curRacerObj; + Object **racerObjects; + f32 racerOz1; + f32 racerOx3; + f32 racerOz3; + f32 savedDist; + f32 racerO1dist; + f32 racerOy3; + f32 racerO3dist; + f32 curDistance2; + s32 numRacers; + f32 savedDist2; + s32 isChallengeRace; + s32 raceType; + + raceType = get_current_level_race_type(); + isChallengeRace = raceType & RACETYPE_CHALLENGE; + if (racer->playerIndex == PLAYER_COMPUTER && !isChallengeRace) { + curDistance = 0.0f; + curRacerObj = func_8001B7A8(racer, 1, &curDistance); + *outDistance = curDistance; + return curRacerObj; + } + racerOx1 = racer->ox1; + racerOy1 = racer->oy1; + racerOz1 = racer->oz1; + racerO1dist = -((racerObj->segment.trans.x_position * racerOx1) + (racerObj->segment.trans.y_position * racerOy1) + + (racerObj->segment.trans.z_position * racerOz1)); + racerOx3 = racer->ox3; + racerOy3 = racer->oy3; + racerOz3 = racer->oz3; + racerO3dist = -((racerObj->segment.trans.x_position * racerOx3) + (racerObj->segment.trans.y_position * racerOy1) + + (racerObj->segment.trans.z_position * racerOz3)); + racerObjects = get_racer_objects(&numRacers); + // TODO: Need better names for these + savedDist2 = 10000.0f; + savedDist = 10000.0f; + savedRacerObj = NULL; + for (i = 0; i < numRacers; i++) { + if (racerObj != racerObjects[i]) { + curRacerObj = racerObjects[i]; + curRacer = &racerObjects[i]->unk64->racer; + if ((!isChallengeRace || !curRacer->raceFinished) && curRacer->elevation == racer->elevation) { + curDistance = -((racerOx1 * curRacerObj->segment.trans.x_position) + + (racerOy1 * curRacerObj->segment.trans.y_position) + + (racerOz1 * curRacerObj->segment.trans.z_position) + racerO1dist); + if (curDistance > 0.0f) { + curDistance2 = (racerOx3 * curRacerObj->segment.trans.x_position) + + (racerOy3 * curRacerObj->segment.trans.y_position) + + (racerOz3 * curRacerObj->segment.trans.z_position) + racerO3dist; + if (curDistance2 < 0.0f) { + curDistance2 = -curDistance2; + } + if ((curDistance2 < curDistance || raceType == RACETYPE_BOSS) && curDistance2 < savedDist2) { + savedDist = curDistance; + savedDist2 = curDistance2; + savedRacerObj = curRacerObj; + } + } + } + } + } + *outDistance = savedDist; + return savedRacerObj; +} /** * When active, takes the magnet target, calculates the distance then sets the player's velocity @@ -4908,9 +5098,9 @@ f32 handle_racer_top_speed(Object *obj, Object_Racer *racer) { void func_800575EC(Object *obj, Object_Racer *racer) { Matrix mtxF; - gCurrentRacerTransform.y_rotation = obj->segment.trans.y_rotation; - gCurrentRacerTransform.x_rotation = obj->segment.trans.x_rotation; - gCurrentRacerTransform.z_rotation = 0; + gCurrentRacerTransform.rotation.y_rotation = obj->segment.trans.rotation.y_rotation; + gCurrentRacerTransform.rotation.x_rotation = obj->segment.trans.rotation.x_rotation; + gCurrentRacerTransform.rotation.z_rotation = 0; gCurrentRacerTransform.x_position = 0.0f; gCurrentRacerTransform.y_position = 0.0f; gCurrentRacerTransform.z_position = 0.0f; @@ -4941,7 +5131,7 @@ void drop_bananas(Object *obj, Object_Racer *racer, s32 number) { } if (number > 0 && number < 3) { angle[0] = racer->x_rotation_vel; - angle[1] = obj->segment.trans.x_rotation; + angle[1] = obj->segment.trans.rotation.x_rotation; angle[2] = racer->steerVisualRotation; pos[0] = 0; pos[1] = 8; @@ -5084,7 +5274,7 @@ void update_player_camera(Object *obj, Object_Racer *racer, f32 updateRateF) { gCameraObject->trans.z_position) * dialogueAngle); gCameraObject->offsetY = (((get_npc_pos_y() + 48.5) - gCameraObject->trans.y_position) * dialogueAngle); - gCameraObject->pitchOffset = -gCameraObject->trans.x_rotation * dialogueAngle; + gCameraObject->pitchOffset = -gCameraObject->trans.rotation.x_rotation * dialogueAngle; gCameraObject->trans.x_position += gCameraObject->offsetX; gCameraObject->trans.y_position += gCameraObject->offsetY + gCameraObject->unk30; gCameraObject->trans.z_position += gCameraObject->offsetZ; @@ -5113,7 +5303,7 @@ void update_player_camera(Object *obj, Object_Racer *racer, f32 updateRateF) { gDialogueCameraAngle = 0; } } - gCameraObject->trans.y_rotation -= gDialogueCameraAngle; + gCameraObject->trans.rotation.y_rotation -= gDialogueCameraAngle; gCameraObject->unk3A -= tempUpdateRateF; while (gCameraObject->unk3A < 0) { gCameraObject->unk3A += 5; @@ -5222,7 +5412,7 @@ void update_camera_car(f32 updateRate, Object *obj, Object_Racer *racer) { break; } if (racer->groundedWheels > 2 || racer->waterTimer != 0) { - angle = (obj->segment.trans.x_rotation); + angle = (obj->segment.trans.rotation.x_rotation); if (angle > 0) { angle -= 0x71C; if (angle < 0) { @@ -5236,14 +5426,14 @@ void update_camera_car(f32 updateRate, Object *obj, Object_Racer *racer) { } } angle = baseAngle - angle; - tempAngle = angle - (u16) gCameraObject->trans.x_rotation; + tempAngle = angle - (u16) gCameraObject->trans.rotation.x_rotation; if (tempAngle > 0x8000) { tempAngle -= 0xFFFF; } if (tempAngle < -0x8000) { tempAngle += 0xFFFF; } - gCameraObject->trans.x_rotation += (tempAngle * delta) >> 4; + gCameraObject->trans.rotation.x_rotation += (tempAngle * delta) >> 4; } if (racer->velocity < 0.0) { tempVel = 6.0f; @@ -5274,8 +5464,8 @@ void update_camera_car(f32 updateRate, Object *obj, Object_Racer *racer) { } gCameraObject->unk1C += (baseDistance - gCameraObject->unk1C) * 0.125; gCameraObject->unk20 += (yVel - gCameraObject->unk20) * 0.125; - cosOffset = sins_f(gCameraObject->trans.x_rotation - baseAngle); - sineOffset = coss_f(gCameraObject->trans.x_rotation - baseAngle); + cosOffset = sins_f(gCameraObject->trans.rotation.x_rotation - baseAngle); + sineOffset = coss_f(gCameraObject->trans.rotation.x_rotation - baseAngle); lateralOffset = gCameraObject->unk1C; lateralOffset = (lateralOffset * sineOffset) - (gCameraObject->unk20 * cosOffset); yVel = (gCameraObject->unk1C * cosOffset) + (gCameraObject->unk20 * sineOffset); @@ -5321,28 +5511,28 @@ void update_camera_car(f32 updateRate, Object *obj, Object_Racer *racer) { gCameraObject->trans.y_position = yOffset; } gCameraObject->trans.z_position = zOffset + (-coss_f(racer->cameraYaw + 0x4000) * racer->unkC8) + cosOffset; - gCameraObject->trans.y_rotation = racer->cameraYaw; - newAngle = gCameraObject->trans.z_rotation; + gCameraObject->trans.rotation.y_rotation = racer->cameraYaw; + newAngle = gCameraObject->trans.rotation.z_rotation; if ((racer->drift_direction && racer->brake > 0.0) || gDialogueCameraAngle) { newAngle = 0; } - angle = obj->segment.trans.z_rotation; + angle = obj->segment.trans.rotation.z_rotation; angleVel = (newAngle + angle) >> 4; - gCameraObject->trans.z_rotation -= angleVel; - if (gCameraObject->trans.z_rotation > 0x2000) { - gCameraObject->trans.z_rotation = 0x2000; + gCameraObject->trans.rotation.z_rotation -= angleVel; + if (gCameraObject->trans.rotation.z_rotation > 0x2000) { + gCameraObject->trans.rotation.z_rotation = 0x2000; } - if (gCameraObject->trans.z_rotation < -0x2000) { - gCameraObject->trans.z_rotation = -0x2000; + if (gCameraObject->trans.rotation.z_rotation < -0x2000) { + gCameraObject->trans.rotation.z_rotation = -0x2000; } - gCameraObject->trans.y_position -= racer->unkC8 * sins_f(gCameraObject->trans.z_rotation); + gCameraObject->trans.y_position -= racer->unkC8 * sins_f(gCameraObject->trans.rotation.z_rotation); lateralOffset = (yOffset = gCameraObject->trans.x_position); segmentIndex = get_level_segment_index_from_position(lateralOffset, gCameraObject->trans.y_position, gCameraObject->trans.z_position); if (segmentIndex != -1) { gCameraObject->segmentIndex = segmentIndex; } - racer->cameraYaw = gCameraObject->trans.y_rotation; + racer->cameraYaw = gCameraObject->trans.rotation.y_rotation; } #else GLOBAL_ASM("asm/non_matchings/racer/update_camera_car.s") @@ -5359,13 +5549,13 @@ void update_camera_finish_challenge(UNUSED f32 updateRate, Object *obj, Object_R f32 zOffset; f32 xOffset; - gCameraObject->trans.y_rotation += 0x200; + gCameraObject->trans.rotation.y_rotation += 0x200; if (1) {} // Fakematch - gCameraObject->trans.x_rotation = 0x400; - gCameraObject->trans.z_rotation = 0; + gCameraObject->trans.rotation.x_rotation = 0x400; + gCameraObject->trans.rotation.z_rotation = 0; gCameraObject->unk1C = 150.0f; - xOffset = sins_f(0x8000 - gCameraObject->trans.y_rotation) * gCameraObject->unk1C; - zOffset = coss_f(0x8000 - gCameraObject->trans.y_rotation) * gCameraObject->unk1C; + xOffset = sins_f(0x8000 - gCameraObject->trans.rotation.y_rotation) * gCameraObject->unk1C; + zOffset = coss_f(0x8000 - gCameraObject->trans.rotation.y_rotation) * gCameraObject->unk1C; gCameraObject->trans.x_position = obj->segment.trans.x_position + xOffset; temp_f12 = (gCameraObject->trans.y_position - (obj->segment.trans.y_position + 45.0f)) * 0.25; if (temp_f12 < -2.0) { @@ -5380,7 +5570,7 @@ void update_camera_finish_challenge(UNUSED f32 updateRate, Object *obj, Object_R if (segmentIndex != SEGMENT_NONE) { gCameraObject->segmentIndex = segmentIndex; } - racer->cameraYaw = gCameraObject->trans.y_rotation; + racer->cameraYaw = gCameraObject->trans.rotation.y_rotation; } /** @@ -5409,9 +5599,9 @@ void update_camera_finish_race(UNUSED f32 updateRate, Object *obj, Object_Racer diffY = gCameraObject->trans.y_position - obj->segment.trans.y_position; diffZ = gCameraObject->trans.z_position - obj->segment.trans.z_position; distance = sqrtf((diffX * diffX) + (diffZ * diffZ)); - gCameraObject->trans.y_rotation = 0x8000 - atan2s(diffX, diffZ); - gCameraObject->trans.x_rotation = atan2s((s32) diffY, (s32) distance); - gCameraObject->trans.z_rotation = 0; + gCameraObject->trans.rotation.y_rotation = 0x8000 - atan2s(diffX, diffZ); + gCameraObject->trans.rotation.x_rotation = atan2s((s32) diffY, (s32) distance); + gCameraObject->trans.rotation.z_rotation = 0; gCameraObject->segmentIndex = get_level_segment_index_from_position(gCameraObject->trans.x_position, racer->oy1, gCameraObject->trans.z_position); } @@ -5427,9 +5617,9 @@ void update_camera_fixed(f32 updateRate, Object *obj, Object_Racer *racer) { updateRateF = (s32) updateRate; diffX = gCameraObject->trans.x_position - obj->segment.trans.x_position; diffZ = gCameraObject->trans.z_position - obj->segment.trans.z_position; - gCameraObject->trans.y_rotation += - ((((-atan2s(diffX, diffZ)) - gCameraObject->trans.y_rotation) + 0x8000) * updateRateF) >> 4; - gCameraObject->trans.z_rotation -= ((s32) (gCameraObject->trans.z_rotation * updateRateF)) >> 4; + gCameraObject->trans.rotation.y_rotation += + ((((-atan2s(diffX, diffZ)) - gCameraObject->trans.rotation.y_rotation) + 0x8000) * updateRateF) >> 4; + gCameraObject->trans.rotation.z_rotation -= ((s32) (gCameraObject->trans.rotation.z_rotation * updateRateF)) >> 4; gCameraObject->segmentIndex = get_level_segment_index_from_position(gCameraObject->trans.x_position, racer->oy1, gCameraObject->trans.z_position); } @@ -5777,9 +5967,9 @@ void timetrial_ghost_write(Object *obj, s32 updateRate) { ghostNode->x = obj->segment.trans.x_position; ghostNode->y = obj->segment.trans.y_position + yOffset; ghostNode->z = obj->segment.trans.z_position; - ghostNode->yRotation = obj->segment.trans.y_rotation + racer->y_rotation_offset; - ghostNode->xRotation = obj->segment.trans.x_rotation + racer->x_rotation_offset; - ghostNode->zRotation = obj->segment.trans.z_rotation + racer->z_rotation_offset; + ghostNode->yRotation = obj->segment.trans.rotation.y_rotation + racer->y_rotation_offset; + ghostNode->xRotation = obj->segment.trans.rotation.x_rotation + racer->x_rotation_offset; + ghostNode->zRotation = obj->segment.trans.rotation.z_rotation + racer->z_rotation_offset; gGhostNodeCount[gCurrentGhostIndex]++; } } @@ -5869,7 +6059,7 @@ s32 set_ghost_position_and_rotation(Object *obj) { if (rotDiff < -0x8000) { rotDiff += 0xFFFF; } - obj->segment.trans.y_rotation = rot + (s32) (rotDiff * catmullX); + obj->segment.trans.rotation.y_rotation = rot + (s32) (rotDiff * catmullX); // X Rotation rot = curGhostNode->xRotation; @@ -5881,7 +6071,7 @@ s32 set_ghost_position_and_rotation(Object *obj) { if (rotDiff < -0x8000) { rotDiff += 0xFFFF; } - obj->segment.trans.x_rotation = rot + (s32) (rotDiff * catmullX); + obj->segment.trans.rotation.x_rotation = rot + (s32) (rotDiff * catmullX); // Z Rotation rot = curGhostNode->zRotation; @@ -5893,7 +6083,7 @@ s32 set_ghost_position_and_rotation(Object *obj) { if (rotDiff < -0x8000) { rotDiff += 0xFFFF; } - obj->segment.trans.z_rotation = rot + (s32) (rotDiff * catmullX); + obj->segment.trans.rotation.z_rotation = rot + (s32) (rotDiff * catmullX); obj->particleEmitFlags = OBJ_EMIT_OFF; obj->segment.object.segmentID = get_level_segment_index_from_position( @@ -6514,13 +6704,13 @@ void func_8005B818(Object *obj, Object_Racer *racer, s32 updateRate, f32 updateR sp94 /= temp_f0_5; sp98 /= temp_f0_5; racer->steerVisualRotation = arctan2_f(sp9C, sp94) - 0x8000; - obj->segment.trans.y_rotation = racer->steerVisualRotation; - obj->segment.trans.x_rotation = arctan2_f(sp98, 1.0f); + obj->segment.trans.rotation.y_rotation = racer->steerVisualRotation; + obj->segment.trans.rotation.x_rotation = arctan2_f(sp98, 1.0f); } racer->unk1C2 = racer->unk1BE; racer->unk1C4 = racer->unk1C0; racer->unk1BE = racer->steerVisualRotation; - racer->unk1C0 = obj->segment.trans.x_rotation; + racer->unk1C0 = obj->segment.trans.rotation.x_rotation; if (move_object(obj, var_f26, temp_f24_3, var_f28)) { obj->segment.trans.x_position += var_f26; obj->segment.trans.y_position += temp_f24_3; diff --git a/src/racer.h b/src/racer.h index 5162cbdc..bf60d9f0 100644 --- a/src/racer.h +++ b/src/racer.h @@ -232,11 +232,11 @@ void update_player_racer(Object *obj, s32 updateRate); void func_80045128(Object **racerObjs); void timetrial_ghost_write(Object *obj, s32 updateRate); void func_80046524(s32 updateRate, f32 updateRateF, Object* obj, Object_Racer* racer); +void func_80053750(Object *objRacer, Object_Racer *racer, f32 updateRateF); //Non Matching s32 set_ghost_position_and_rotation(Object *obj); void func_80054FD0(Object *obj, Object_Racer *racer, s32); -void func_80053750(Object *obj, Object_Racer *racer, f32); void update_car_velocity_offground(Object *obj, Object_Racer *racer, s32, f32); s32 func_80017248(void*, s32, s32*, Vec3f*, f32*, f32*, s8* surface); void func_80059208(Object* obj, Object_Racer* racer, s32 updateRate); /* extern */ @@ -247,7 +247,7 @@ void func_8004447C(Object *obj, Object_Racer *racer, s32 updateRate); void func_800452A0(Object *obj, Object_Racer *racer, s32 updateRate); void func_80045C48(Object *obj, Object_Racer *racer, s32 updateRate); void racer_activate_magnet(Object *obj, Object_Racer *racer, s32 updateRate); -Object* func_8005698C(Object* racer, Object_Racer* obj, f32* dist); +Object *func_8005698C(Object *racerObj, Object_Racer *racer, f32 *outDistance); void func_8005B818(Object *obj, Object_Racer *racer, s32 updateRate, f32 updateRateF); #endif diff --git a/src/tracks.c b/src/tracks.c index 0d2df12d..79bd6d48 100644 --- a/src/tracks.c +++ b/src/tracks.c @@ -509,8 +509,8 @@ void func_8002581C(u8 *segmentIds, s32 numberOfSegments, s32 viewportIndex) { load_and_set_texture_no_offset(&gSceneCurrDisplayList, NULL, RENDER_ANTI_ALIASING | RENDER_Z_COMPARE); D_8011D49C = 0; D_8011D49E = 0; - yCameraSins = sins_f(gSceneActiveCamera->trans.y_rotation * -1); - yCameraCoss = coss_f(gSceneActiveCamera->trans.y_rotation * -1); + yCameraSins = sins_f(gSceneActiveCamera->trans.rotation.y_rotation * -1); + yCameraCoss = coss_f(gSceneActiveCamera->trans.rotation.y_rotation * -1); D_8011D4AC = (gSceneActiveCamera->trans.x_position + (yCameraSins * 250.0)); D_8011D4B0 = (gSceneActiveCamera->trans.z_position + (yCameraCoss * 250.0)); D_8011D4A0 = -yCameraCoss; @@ -772,8 +772,8 @@ void func_80026E54(s16 arg0, s8 *arg1, f32 arg2, f32 arg3) { if (arg0 >= 10 || arg0 == 0) { return; } - - for (j = 0, i = 0; i < arg0; ) { + + 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]]; @@ -1096,27 +1096,27 @@ void func_800278E8(s32 updateRate) { zDelta = segment->trans.z_position - thisObject->segment.trans.z_position; xzSqr = sqrtf((xDelta * xDelta) + (zDelta * zDelta)); if (D_8011B108 != 0) { - angleDiff = ((s32) (-atan2s(xDelta, zDelta) - segment->trans.y_rotation) + 0x8000); + angleDiff = ((s32) (-atan2s(xDelta, zDelta) - segment->trans.rotation.y_rotation) + 0x8000); //!@bug Never true, since angleDiff is signed. Should be >=. if (angleDiff > 0x8000) { angleDiff = -(0xFFFF - angleDiff); } - segment->trans.y_rotation += ((s32) (angleDiff / (16.0f * (D_8011B108 / 180.0f)))) & 0xFFFF; - angleDiff = atan2s(yDelta, xzSqr) - segment->trans.x_rotation; + segment->trans.rotation.y_rotation += ((s32) (angleDiff / (16.0f * (D_8011B108 / 180.0f)))) & 0xFFFF; + angleDiff = atan2s(yDelta, xzSqr) - segment->trans.rotation.x_rotation; //!@bug Never true, since angleDiff is signed. Should be >=. if (angleDiff > 0x8000) { angleDiff = -(0xFFFF - angleDiff); } - segment->trans.x_rotation += ((s32) (angleDiff / (16.0f * (D_8011B108 / 180.0f)))) & 0xFFFF; + segment->trans.rotation.x_rotation += ((s32) (angleDiff / (16.0f * (D_8011B108 / 180.0f)))) & 0xFFFF; D_8011B108 -= updateRate; if (D_8011B108 < 0) { D_8011B108 = 0; } } else { - segment->trans.y_rotation = 0x8000 - atan2s(xDelta, zDelta); - segment->trans.x_rotation = atan2s(yDelta, xzSqr); + segment->trans.rotation.y_rotation = 0x8000 - atan2s(xDelta, zDelta); + segment->trans.rotation.x_rotation = atan2s(yDelta, xzSqr); } - segment->trans.z_rotation = 0; + segment->trans.rotation.z_rotation = 0; segment->object.cameraSegmentID = get_level_segment_index_from_position( segment->trans.x_position, currentRacer->oy1, segment->trans.z_position); D_8011B104 = currentRacer->cameraIndex; @@ -3396,9 +3396,9 @@ void compute_scene_camera_transform_matrix(void) { f32 y = 0.0f; f32 z = -65536.0f; - trans.z_rotation = gSceneActiveCamera->trans.z_rotation; - trans.x_rotation = gSceneActiveCamera->trans.x_rotation; - trans.y_rotation = gSceneActiveCamera->trans.y_rotation; + trans.rotation.z_rotation = gSceneActiveCamera->trans.rotation.z_rotation; + trans.rotation.x_rotation = gSceneActiveCamera->trans.rotation.x_rotation; + trans.rotation.y_rotation = gSceneActiveCamera->trans.rotation.y_rotation; trans.x_position = 0.0f; trans.y_position = 0.0f; trans.z_position = 0.0f; diff --git a/src/vehicle_bluey.c b/src/vehicle_bluey.c index 6bc0618c..d7abc991 100644 --- a/src/vehicle_bluey.c +++ b/src/vehicle_bluey.c @@ -182,7 +182,7 @@ void update_bluey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *ra diffX = firstRacerObj->segment.trans.x_position - obj->segment.trans.x_position; diffZ = firstRacerObj->segment.trans.z_position - obj->segment.trans.z_position; if (sqrtf((diffX * diffX) + (diffZ * diffZ)) < 700.0) { - tempStartTimer = (arctan2_f(diffX, diffZ) - (obj->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + tempStartTimer = (arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + 0x8000; WRAP(tempStartTimer, -0x8000, 0x8000); CLAMP(tempStartTimer, -0xC00, 0xC00); racer->headAngleTarget = tempStartTimer; diff --git a/src/vehicle_bubbler.c b/src/vehicle_bubbler.c index fcf66ce5..dd6ebf5b 100644 --- a/src/vehicle_bubbler.c +++ b/src/vehicle_bubbler.c @@ -160,7 +160,7 @@ void update_bubbler(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer * diffX = firstRacerObj->segment.trans.x_position - obj->segment.trans.x_position; diffZ = firstRacerObj->segment.trans.z_position - obj->segment.trans.z_position; if (sqrtf((diffX * diffX) + (diffZ * diffZ)) < 700.0) { - timer = (arctan2_f(diffX, diffZ) - (obj->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + timer = (arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + 0x8000; WRAP(timer, -0x8000, 0x8000); CLAMP(timer, -headAngleRange, headAngleRange); racer->headAngleTarget = timer; diff --git a/src/vehicle_smokey.c b/src/vehicle_smokey.c index 66edf0f2..8311ff41 100644 --- a/src/vehicle_smokey.c +++ b/src/vehicle_smokey.c @@ -243,7 +243,7 @@ void update_smokey(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r diffX = firstRacerObj->segment.trans.x_position - obj->segment.trans.x_position; diffZ = firstRacerObj->segment.trans.z_position - obj->segment.trans.z_position; if (sqrtf((diffX * diffX) + (diffZ * diffZ)) < 700.0) { - headAngleRange = (arctan2_f(diffX, diffZ) - (obj->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + headAngleRange = (arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + 0x8000; if (headAngleRange > 0x8000) { headAngleRange -= 0xFFFF; } diff --git a/src/vehicle_tricky.c b/src/vehicle_tricky.c index 08c0066e..9f7598e4 100644 --- a/src/vehicle_tricky.c +++ b/src/vehicle_tricky.c @@ -185,7 +185,7 @@ void update_tricky(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r diffX = firstRacerObj->segment.trans.x_position - obj->segment.trans.x_position; diffZ = firstRacerObj->segment.trans.z_position - obj->segment.trans.z_position; if (sqrtf((diffX * diffX) + (diffZ * diffZ)) < 700.0) { - tempStartTimer = (arctan2_f(diffX, diffZ) - (obj->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + tempStartTimer = (arctan2_f(diffX, diffZ) - (obj->segment.trans.rotation.y_rotation & 0xFFFF)) + 0x8000; WRAP(tempStartTimer, -0x8000, 0x8000); CLAMP(tempStartTimer, -headAngleRange, headAngleRange); racer->headAngleTarget = tempStartTimer; diff --git a/src/vehicle_wizpig.c b/src/vehicle_wizpig.c index 9296347f..15ce8283 100644 --- a/src/vehicle_wizpig.c +++ b/src/vehicle_wizpig.c @@ -125,7 +125,7 @@ void update_wizpig(s32 updateRate, f32 updateRateF, Object *obj, Object_Racer *r if (find_next_checkpoint_node(racer->checkpoint, racer->unk1C8)->unk36[racer->unk1CA] == 1) { nextCheckpoint = TRUE; } - racer->x_rotation_offset = -obj->segment.trans.x_rotation; + racer->x_rotation_offset = -obj->segment.trans.rotation.x_rotation; gfxData = *obj->unk68; objModel = gfxData->objModel; diffX = (objModel->animations[obj->segment.object.animationID].unk4 * 0x10) - 0x11; diff --git a/src/weather.c b/src/weather.c index 1dee7991..eb7c30d4 100644 --- a/src/weather.c +++ b/src/weather.c @@ -92,10 +92,14 @@ Vertex gRainVertices[16] = { }; RainPosData gRainSplashSegments[8] = { - { { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, { { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, - { { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, { { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, - { { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, { { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, - { { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, { { 0, 0, 0, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, + { { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, + { { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, + { { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, + { { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, + { { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, + { { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, + { { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, + { { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 }, }; RainGfxData gRainGfx[2] = { @@ -625,7 +629,7 @@ void lensflare_init(Object *obj) { gLensFlarePos.x = 0; gLensFlarePos.y = 0; gLensFlarePos.z = -1.0f; - f32_vec3_apply_object_rotation3((ObjectTransform *) &angle, gLensFlarePos.f); + f32_vec3_apply_object_rotation3(&angle, gLensFlarePos.f); gLensFlarePos.x = -gLensFlarePos.x; gLensFlarePos.y = -gLensFlarePos.y; gLensFlarePos.z = -gLensFlarePos.z; @@ -666,9 +670,9 @@ void lensflare_render(Gfx **dList, MatrixS **mats, Vertex **verts, ObjectSegment pos[0].z = (gLensFlarePos.z * 256.0f) + segment->trans.z_position; magSquared = magnitude * magnitude; magSquareSquared = magSquared * magSquared; - trans.y_rotation = 0; - trans.x_rotation = 0; - trans.z_rotation = 0; + trans.rotation.y_rotation = 0; + trans.rotation.x_rotation = 0; + trans.rotation.z_rotation = 0; pos[1].x = (pos[1].x * (0, (2 * magnitude))) - gLensFlarePos.x; pos[1].y = (pos[1].y * (0, (2 * magnitude))) - gLensFlarePos.y; pos[1].z = (pos[1].z * (0, (2 * magnitude))) - gLensFlarePos.z; @@ -941,8 +945,8 @@ void rain_render_splashes(s32 updateRate) { } } if (firstIndexWithoutFlags >= 0) { - randYRot = - get_random_number_from_range(-0x2000, 0x2000) + racer->segment.trans.y_rotation + 0x8000; + randYRot = get_random_number_from_range(-0x2000, 0x2000) + + racer->segment.trans.rotation.y_rotation + 0x8000; randFloat = (f32) get_random_number_from_range(50, 500); xPos = (sins_f(randYRot) * randFloat) + racer->segment.trans.x_position; zPos = (coss_f(randYRot) * randFloat) + racer->segment.trans.z_position; @@ -1060,8 +1064,8 @@ void rain_sound(UNUSED s32 updateRate) { f32 sineOffset; length = 1152.0f - (f32) (gLightningFrequency >> 6); - cosOffset = sins_f(gWeatherCamera->trans.y_rotation) * length; - sineOffset = coss_f(gWeatherCamera->trans.y_rotation) * length; + cosOffset = sins_f(gWeatherCamera->trans.rotation.y_rotation) * length; + sineOffset = coss_f(gWeatherCamera->trans.rotation.y_rotation) * length; xPos = gWeatherCamera->trans.x_position + (sineOffset - cosOffset); yPos = gWeatherCamera->trans.y_position; zPos = gWeatherCamera->trans.z_position + (-sineOffset - cosOffset); @@ -1101,10 +1105,11 @@ void render_rain_overlay(RainGfxData *arg0, s32 arg1) { if (opacity > 0) { altVertical = arg0->unk2; vertical = ((arg0->unk6 * vertical) >> 8) + arg0->unk2; - altHorizontal = (arg0->unk0 + ((horizontal * 6 * gWeatherCamera->trans.y_rotation) >> 16)) & temp_v1; + altHorizontal = + (arg0->unk0 + ((horizontal * 6 * gWeatherCamera->trans.rotation.y_rotation) >> 16)) & temp_v1; horizontal += altHorizontal; - zSins = sins_f(gWeatherCamera->trans.z_rotation); - zCoss = coss_f(gWeatherCamera->trans.z_rotation); + zSins = sins_f(gWeatherCamera->trans.rotation.z_rotation); + zCoss = coss_f(gWeatherCamera->trans.rotation.z_rotation); verts = &gRainVertices[gRainVertexFlip]; verts[0].x = ((D_800E2A8C * zCoss) - (D_800E2A9C * zSins)); verts[0].y = ((D_800E2A8C * zSins) + (D_800E2A9C * zCoss));