1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-01-14 12:17:08 +00:00

additional matching functions in z_room, z_camera, and En_Zl3 (#541)

* Darkmeiro decompilation

Bg_Gnd_Darkmeiro decompiled, matched, and documented.

* give this a shot

* fix conflict

* one more try

* could be useful

* whoops

* ZAP2 stuff

* ZAP why

* ZAP again

* small improvement

* also minor

* merge

* matches

* the room?

* woo matches

* spelling fix
This commit is contained in:
petrie911 2020-12-18 21:09:38 -06:00 committed by GitHub
parent 83e53bbaf2
commit 2373c779d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 145 additions and 1645 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,196 +0,0 @@
glabel func_8009638C
/* B0D52C 8009638C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* B0D530 80096390 00057900 */ sll $t7, $a1, 4
/* B0D534 80096394 000FC702 */ srl $t8, $t7, 0x1c
/* B0D538 80096398 0018C880 */ sll $t9, $t8, 2
/* B0D53C 8009639C 3C098016 */ lui $t1, %hi(gSegments)
/* B0D540 800963A0 01394821 */ addu $t1, $t1, $t9
/* B0D544 800963A4 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* B0D548 800963A8 8D296FA8 */ lw $t1, %lo(gSegments)($t1)
/* B0D54C 800963AC AFBF0014 */ sw $ra, 0x14($sp)
/* B0D550 800963B0 AFA40020 */ sw $a0, 0x20($sp)
/* B0D554 800963B4 AFA60028 */ sw $a2, 0x28($sp)
/* B0D558 800963B8 AFA7002C */ sw $a3, 0x2c($sp)
/* B0D55C 800963BC 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* B0D560 800963C0 8C820000 */ lw $v0, ($a0)
/* B0D564 800963C4 00A15024 */ and $t2, $a1, $at
/* B0D568 800963C8 3C018000 */ lui $at, 0x8000
/* B0D56C 800963CC 012A2021 */ addu $a0, $t1, $t2
/* B0D570 800963D0 00812021 */ addu $a0, $a0, $at
/* B0D574 800963D4 AFA50024 */ sw $a1, 0x24($sp)
/* B0D578 800963D8 0C02588E */ jal func_80096238
/* B0D57C 800963DC AFA2001C */ sw $v0, 0x1c($sp)
/* B0D580 800963E0 8FA2001C */ lw $v0, 0x1c($sp)
/* B0D584 800963E4 3C0BDE01 */ lui $t3, 0xde01
/* B0D588 800963E8 3C014080 */ li $at, 0x40800000 # 0.000000
/* B0D58C 800963EC 24430008 */ addiu $v1, $v0, 8
/* B0D590 800963F0 246C0028 */ addiu $t4, $v1, 0x28
/* B0D594 800963F4 AC4C0004 */ sw $t4, 4($v0)
/* B0D598 800963F8 AC4B0000 */ sw $t3, ($v0)
/* B0D59C 800963FC 93A80037 */ lbu $t0, 0x37($sp)
/* B0D5A0 80096400 A4600000 */ sh $zero, ($v1)
/* B0D5A4 80096404 97A6002E */ lhu $a2, 0x2e($sp)
/* B0D5A8 80096408 44810000 */ mtc1 $at, $f0
/* B0D5AC 8009640C 3409FFF4 */ li $t1, 65524
/* B0D5B0 80096410 00063080 */ sll $a2, $a2, 2
/* B0D5B4 80096414 A4660002 */ sh $a2, 2($v1)
/* B0D5B8 80096418 C7A40044 */ lwc1 $f4, 0x44($sp)
/* B0D5BC 8009641C A4600008 */ sh $zero, 8($v1)
/* B0D5C0 80096420 00602825 */ move $a1, $v1
/* B0D5C4 80096424 46002182 */ mul.s $f6, $f4, $f0
/* B0D5C8 80096428 24010002 */ li $at, 2
/* B0D5CC 8009642C 24630028 */ addiu $v1, $v1, 0x28
/* B0D5D0 80096430 24620008 */ addiu $v0, $v1, 8
/* B0D5D4 80096434 3C0BFD10 */ lui $t3, 0xfd10
/* B0D5D8 80096438 3C0DE800 */ lui $t5, 0xe800
/* B0D5DC 8009643C 3C040700 */ lui $a0, 0x700
/* B0D5E0 80096440 4600320D */ trunc.w.s $f8, $f6
/* B0D5E4 80096444 3C0FE600 */ lui $t7, 0xe600
/* B0D5E8 80096448 440E4000 */ mfc1 $t6, $f8
/* B0D5EC 8009644C 00000000 */ nop
/* B0D5F0 80096450 A46EFFDC */ sh $t6, -0x24($v1)
/* B0D5F4 80096454 97A70032 */ lhu $a3, 0x32($sp)
/* B0D5F8 80096458 3C0EE700 */ lui $t6, 0xe700
/* B0D5FC 8009645C 00073880 */ sll $a3, $a3, 2
/* B0D600 80096460 A467FFE2 */ sh $a3, -0x1e($v1)
/* B0D604 80096464 C7AA0048 */ lwc1 $f10, 0x48($sp)
/* B0D608 80096468 46005402 */ mul.s $f16, $f10, $f0
/* B0D60C 8009646C 4600848D */ trunc.w.s $f18, $f16
/* B0D610 80096470 44189000 */ mfc1 $t8, $f18
/* B0D614 80096474 00000000 */ nop
/* B0D618 80096478 A478FFE4 */ sh $t8, -0x1c($v1)
/* B0D61C 8009647C 8FB90024 */ lw $t9, 0x24($sp)
/* B0D620 80096480 A469FFEC */ sh $t1, -0x14($v1)
/* B0D624 80096484 A068FFEE */ sb $t0, -0x12($v1)
/* B0D628 80096488 AC79FFE8 */ sw $t9, -0x18($v1)
/* B0D62C 8009648C 93AA003B */ lbu $t2, 0x3b($sp)
/* B0D630 80096490 A460FFF0 */ sh $zero, -0x10($v1)
/* B0D634 80096494 A460FFF2 */ sh $zero, -0xe($v1)
/* B0D638 80096498 15010022 */ bne $t0, $at, .L80096524
/* B0D63C 8009649C A06AFFEF */ sb $t2, -0x11($v1)
/* B0D640 800964A0 AC6B0000 */ sw $t3, ($v1)
/* B0D644 800964A4 8FAC0028 */ lw $t4, 0x28($sp)
/* B0D648 800964A8 3C0EF500 */ lui $t6, (0xF5000100 >> 16) # lui $t6, 0xf500
/* B0D64C 800964AC 35CE0100 */ ori $t6, (0xF5000100 & 0xFFFF) # ori $t6, $t6, 0x100
/* B0D650 800964B0 AC6C0004 */ sw $t4, 4($v1)
/* B0D654 800964B4 00401825 */ move $v1, $v0
/* B0D658 800964B8 AC6D0000 */ sw $t5, ($v1)
/* B0D65C 800964BC AC600004 */ sw $zero, 4($v1)
/* B0D660 800964C0 24420008 */ addiu $v0, $v0, 8
/* B0D664 800964C4 00401825 */ move $v1, $v0
/* B0D668 800964C8 AC6E0000 */ sw $t6, ($v1)
/* B0D66C 800964CC AC640004 */ sw $a0, 4($v1)
/* B0D670 800964D0 24420008 */ addiu $v0, $v0, 8
/* B0D674 800964D4 00401825 */ move $v1, $v0
/* B0D678 800964D8 AC6F0000 */ sw $t7, ($v1)
/* B0D67C 800964DC AC600004 */ sw $zero, 4($v1)
/* B0D680 800964E0 24420008 */ addiu $v0, $v0, 8
/* B0D684 800964E4 00401825 */ move $v1, $v0
/* B0D688 800964E8 3C18F000 */ lui $t8, 0xf000
/* B0D68C 800964EC AC780000 */ sw $t8, ($v1)
/* B0D690 800964F0 97B90042 */ lhu $t9, 0x42($sp)
/* B0D694 800964F4 24420008 */ addiu $v0, $v0, 8
/* B0D698 800964F8 3C0DE700 */ lui $t5, 0xe700
/* B0D69C 800964FC 2729FFFF */ addiu $t1, $t9, -1
/* B0D6A0 80096500 312A03FF */ andi $t2, $t1, 0x3ff
/* B0D6A4 80096504 000A5B80 */ sll $t3, $t2, 0xe
/* B0D6A8 80096508 01646025 */ or $t4, $t3, $a0
/* B0D6AC 8009650C AC6C0004 */ sw $t4, 4($v1)
/* B0D6B0 80096510 00401825 */ move $v1, $v0
/* B0D6B4 80096514 AC6D0000 */ sw $t5, ($v1)
/* B0D6B8 80096518 AC600004 */ sw $zero, 4($v1)
/* B0D6BC 8009651C 10000005 */ b .L80096534
/* B0D6C0 80096520 24420008 */ addiu $v0, $v0, 8
.L80096524:
/* B0D6C4 80096524 24A30028 */ addiu $v1, $a1, 0x28
/* B0D6C8 80096528 24620008 */ addiu $v0, $v1, 8
/* B0D6CC 8009652C AC6E0000 */ sw $t6, ($v1)
/* B0D6D0 80096530 AC600004 */ sw $zero, 4($v1)
.L80096534:
/* B0D6D4 80096534 15000020 */ bnez $t0, .L800965B8
/* B0D6D8 80096538 3C0F8016 */ lui $t7, %hi(gGameInfo) # $t7, 0x8016
/* B0D6DC 8009653C 8DEFFA90 */ lw $t7, %lo(gGameInfo)($t7)
/* B0D6E0 80096540 00A02025 */ move $a0, $a1
/* B0D6E4 80096544 85F80108 */ lh $t8, 0x108($t7)
/* B0D6E8 80096548 5700001C */ bnezl $t8, .L800965BC
/* B0D6EC 8009654C 94AE0008 */ lhu $t6, 8($a1)
/* B0D6F0 80096550 A4A60006 */ sh $a2, 6($a1)
/* B0D6F4 80096554 A4A7000E */ sh $a3, 0xe($a1)
/* B0D6F8 80096558 AFA50018 */ sw $a1, 0x18($sp)
/* B0D6FC 8009655C 0C0412C0 */ jal guS2DInitBg
/* B0D700 80096560 AFA2001C */ sw $v0, 0x1c($sp)
/* B0D704 80096564 97B9003E */ lhu $t9, 0x3e($sp)
/* B0D708 80096568 3C010020 */ lui $at, 0x20
/* B0D70C 8009656C 8FA2001C */ lw $v0, 0x1c($sp)
/* B0D710 80096570 03214825 */ or $t1, $t9, $at
/* B0D714 80096574 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* B0D718 80096578 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* B0D71C 8009657C 01215024 */ and $t2, $t1, $at
/* B0D720 80096580 00401825 */ move $v1, $v0
/* B0D724 80096584 8FA50018 */ lw $a1, 0x18($sp)
/* B0D728 80096588 3C01EF00 */ lui $at, 0xef00
/* B0D72C 8009658C 01415825 */ or $t3, $t2, $at
/* B0D730 80096590 240C0001 */ li $t4, 1
/* B0D734 80096594 AC6C0004 */ sw $t4, 4($v1)
/* B0D738 80096598 AC6B0000 */ sw $t3, ($v1)
/* B0D73C 8009659C 24420008 */ addiu $v0, $v0, 8
/* B0D740 800965A0 00401825 */ move $v1, $v0
/* B0D744 800965A4 3C0D0A00 */ lui $t5, 0xa00
/* B0D748 800965A8 AC6D0000 */ sw $t5, ($v1)
/* B0D74C 800965AC 24420008 */ addiu $v0, $v0, 8
/* B0D750 800965B0 10000028 */ b .L80096654
/* B0D754 800965B4 AC650004 */ sw $a1, 4($v1)
.L800965B8:
/* B0D758 800965B8 94AE0008 */ lhu $t6, 8($a1)
.L800965BC:
/* B0D75C 800965BC 24030400 */ li $v1, 1024
/* B0D760 800965C0 A4A60006 */ sh $a2, 6($a1)
/* B0D764 800965C4 A4A7000E */ sh $a3, 0xe($a1)
/* B0D768 800965C8 A4A3001C */ sh $v1, 0x1c($a1)
/* B0D76C 800965CC A4A3001E */ sh $v1, 0x1e($a1)
/* B0D770 800965D0 ACAE0020 */ sw $t6, 0x20($a1)
/* B0D774 800965D4 97B9003E */ lhu $t9, 0x3e($sp)
/* B0D778 800965D8 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff
/* B0D77C 800965DC 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
/* B0D780 800965E0 37290CF0 */ ori $t1, $t9, 0xcf0
/* B0D784 800965E4 01215024 */ and $t2, $t1, $at
/* B0D788 800965E8 00401825 */ move $v1, $v0
/* B0D78C 800965EC 3C01EF00 */ lui $at, 0xef00
/* B0D790 800965F0 3C0C00A0 */ lui $t4, (0x00A03009 >> 16) # lui $t4, 0xa0
/* B0D794 800965F4 358C3009 */ ori $t4, (0x00A03009 & 0xFFFF) # ori $t4, $t4, 0x3009
/* B0D798 800965F8 01415825 */ or $t3, $t2, $at
/* B0D79C 800965FC AC6B0000 */ sw $t3, ($v1)
/* B0D7A0 80096600 AC6C0004 */ sw $t4, 4($v1)
/* B0D7A4 80096604 24420008 */ addiu $v0, $v0, 8
/* B0D7A8 80096608 00401825 */ move $v1, $v0
/* B0D7AC 8009660C 3C0EFFFC */ lui $t6, (0xFFFCFC7E >> 16) # lui $t6, 0xfffc
/* B0D7B0 80096610 3C0DFCFF */ lui $t5, (0xFCFFFFFF >> 16) # lui $t5, 0xfcff
/* B0D7B4 80096614 35ADFFFF */ ori $t5, (0xFCFFFFFF & 0xFFFF) # ori $t5, $t5, 0xffff
/* B0D7B8 80096618 35CEFC7E */ ori $t6, (0xFFFCFC7E & 0xFFFF) # ori $t6, $t6, 0xfc7e
/* B0D7BC 8009661C AC6E0004 */ sw $t6, 4($v1)
/* B0D7C0 80096620 AC6D0000 */ sw $t5, ($v1)
/* B0D7C4 80096624 24420008 */ addiu $v0, $v0, 8
/* B0D7C8 80096628 00401825 */ move $v1, $v0
/* B0D7CC 8009662C 3C0F0B00 */ lui $t7, 0xb00
/* B0D7D0 80096630 2418000C */ li $t8, 12
/* B0D7D4 80096634 AC780004 */ sw $t8, 4($v1)
/* B0D7D8 80096638 AC6F0000 */ sw $t7, ($v1)
/* B0D7DC 8009663C 24420008 */ addiu $v0, $v0, 8
/* B0D7E0 80096640 00401825 */ move $v1, $v0
/* B0D7E4 80096644 3C190900 */ lui $t9, 0x900
/* B0D7E8 80096648 AC790000 */ sw $t9, ($v1)
/* B0D7EC 8009664C AC650004 */ sw $a1, 4($v1)
/* B0D7F0 80096650 24420008 */ addiu $v0, $v0, 8
.L80096654:
/* B0D7F4 80096654 00401825 */ move $v1, $v0
/* B0D7F8 80096658 3C09E700 */ lui $t1, 0xe700
/* B0D7FC 8009665C AC690000 */ sw $t1, ($v1)
/* B0D800 80096660 AC600004 */ sw $zero, 4($v1)
/* B0D804 80096664 8FAA0020 */ lw $t2, 0x20($sp)
/* B0D808 80096668 24420008 */ addiu $v0, $v0, 8
/* B0D80C 8009666C AD420000 */ sw $v0, ($t2)
/* B0D810 80096670 8FBF0014 */ lw $ra, 0x14($sp)
/* B0D814 80096674 27BD0020 */ addiu $sp, $sp, 0x20
/* B0D818 80096678 03E00008 */ jr $ra
/* B0D81C 8009667C 00000000 */ nop

View file

@ -1,141 +0,0 @@
.late_rodata
glabel D_80B5AACC
.word 0xC62BE000
.text
glabel func_80B53980
/* 005D0 80B53980 AFA50004 */ sw $a1, 0x0004($sp)
/* 005D4 80B53984 8C8E02FC */ lw $t6, 0x02FC($a0) ## 000002FC
/* 005D8 80B53988 00052C00 */ sll $a1, $a1, 16
/* 005DC 80B5398C 00052C03 */ sra $a1, $a1, 16
/* 005E0 80B53990 11C00070 */ beq $t6, $zero, .L80B53B54
/* 005E4 80B53994 8C82024C */ lw $v0, 0x024C($a0) ## 0000024C
/* 005E8 80B53998 00067840 */ sll $t7, $a2, 1
/* 005EC 80B5399C 008F4821 */ addu $t1, $a0, $t7
/* 005F0 80B539A0 853902BC */ lh $t9, 0x02BC($t1) ## 000002BC
/* 005F4 80B539A4 8538028C */ lh $t8, 0x028C($t1) ## 0000028C
/* 005F8 80B539A8 852A025C */ lh $t2, 0x025C($t1) ## 0000025C
/* 005FC 80B539AC 00B94023 */ subu $t0, $a1, $t9
/* 00600 80B539B0 44882000 */ mtc1 $t0, $f4 ## $f4 = 0.00
/* 00604 80B539B4 34018001 */ ori $at, $zero, 0x8001 ## $at = 00008001
/* 00608 80B539B8 03053821 */ addu $a3, $t8, $a1
/* 0060C 80B539BC 46802020 */ cvt.s.w $f0, $f4
/* 00610 80B539C0 00073C00 */ sll $a3, $a3, 16
/* 00614 80B539C4 00073C03 */ sra $a3, $a3, 16
/* 00618 80B539C8 01401825 */ or $v1, $t2, $zero ## $v1 = 00000000
/* 0061C 80B539CC 46000005 */ abs.s $f0, $f0
/* 00620 80B539D0 4600018D */ trunc.w.s $f6, $f0
/* 00624 80B539D4 440C3000 */ mfc1 $t4, $f6
/* 00628 80B539D8 00000000 */ nop
/* 0062C 80B539DC 0181082A */ slt $at, $t4, $at
/* 00630 80B539E0 14200007 */ bne $at, $zero, .L80B53A00
/* 00634 80B539E4 00000000 */ nop
/* 00638 80B539E8 18A00004 */ blez $a1, .L80B539FC
/* 0063C 80B539EC 3C010001 */ lui $at, 0x0001 ## $at = 00010000
/* 00640 80B539F0 3C01FFFF */ lui $at, 0xFFFF ## $at = FFFF0000
/* 00644 80B539F4 10000002 */ beq $zero, $zero, .L80B53A00
/* 00648 80B539F8 01014021 */ addu $t0, $t0, $at
.L80B539FC:
/* 0064C 80B539FC 01014021 */ addu $t0, $t0, $at
.L80B53A00:
/* 00650 80B53A00 14C00003 */ bne $a2, $zero, .L80B53A10
/* 00654 80B53A04 24010004 */ addiu $at, $zero, 0x0004 ## $at = 00000004
/* 00658 80B53A08 10410008 */ beq $v0, $at, .L80B53A2C
/* 0065C 80B53A0C 00000000 */ nop
.L80B53A10:
/* 00660 80B53A10 11000006 */ beq $t0, $zero, .L80B53A2C
/* 00664 80B53A14 01036823 */ subu $t5, $t0, $v1
/* 00668 80B53A18 05A10003 */ bgez $t5, .L80B53A28
/* 0066C 80B53A1C 000D7103 */ sra $t6, $t5, 4
/* 00670 80B53A20 25A1000F */ addiu $at, $t5, 0x000F ## $at = 0000000F
/* 00674 80B53A24 00017103 */ sra $t6, $at, 4
.L80B53A28:
/* 00678 80B53A28 006E1821 */ addu $v1, $v1, $t6
.L80B53A2C:
/* 0067C 80B53A2C 10600006 */ beq $v1, $zero, .L80B53A48
/* 00680 80B53A30 00E54023 */ subu $t0, $a3, $a1
/* 00684 80B53A34 2401000A */ addiu $at, $zero, 0x000A ## $at = 0000000A
/* 00688 80B53A38 0061001A */ div $zero, $v1, $at
/* 0068C 80B53A3C 00007812 */ mflo $t7
/* 00690 80B53A40 006F1823 */ subu $v1, $v1, $t7
/* 00694 80B53A44 00000000 */ nop
.L80B53A48:
/* 00698 80B53A48 00084400 */ sll $t0, $t0, 16
/* 0069C 80B53A4C 00084403 */ sra $t0, $t0, 16
/* 006A0 80B53A50 11000005 */ beq $t0, $zero, .L80B53A68
/* 006A4 80B53A54 24010032 */ addiu $at, $zero, 0x0032 ## $at = 00000032
/* 006A8 80B53A58 0101001A */ div $zero, $t0, $at
/* 006AC 80B53A5C 0000C012 */ mflo $t8
/* 006B0 80B53A60 00781823 */ subu $v1, $v1, $t8
/* 006B4 80B53A64 00000000 */ nop
.L80B53A68:
/* 006B8 80B53A68 01430019 */ multu $t2, $v1
/* 006BC 80B53A6C 00E33821 */ addu $a3, $a3, $v1
/* 006C0 80B53A70 00E54023 */ subu $t0, $a3, $a1
/* 006C4 80B53A74 00084400 */ sll $t0, $t0, 16
/* 006C8 80B53A78 00084403 */ sra $t0, $t0, 16
/* 006CC 80B53A7C 2901FF9D */ slti $at, $t0, 0xFF9D
/* 006D0 80B53A80 0000C812 */ mflo $t9
/* 006D4 80B53A84 1F200007 */ bgtz $t9, .L80B53AA4
/* 006D8 80B53A88 00000000 */ nop
/* 006DC 80B53A8C 14200005 */ bne $at, $zero, .L80B53AA4
/* 006E0 80B53A90 29010064 */ slti $at, $t0, 0x0064
/* 006E4 80B53A94 10200003 */ beq $at, $zero, .L80B53AA4
/* 006E8 80B53A98 00000000 */ nop
/* 006EC 80B53A9C 00A03825 */ or $a3, $a1, $zero ## $a3 = 00000000
/* 006F0 80B53AA0 00001825 */ or $v1, $zero, $zero ## $v1 = 00000000
.L80B53AA4:
/* 006F4 80B53AA4 14C00028 */ bne $a2, $zero, .L80B53B48
/* 006F8 80B53AA8 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003
/* 006FC 80B53AAC 14410026 */ bne $v0, $at, .L80B53B48
/* 00700 80B53AB0 2488014C */ addiu $t0, $a0, 0x014C ## $t0 = 0000014C
/* 00704 80B53AB4 910B0001 */ lbu $t3, 0x0001($t0) ## 0000014D
/* 00708 80B53AB8 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002
/* 0070C 80B53ABC 24A2D508 */ addiu $v0, $a1, 0xD508 ## $v0 = FFFFD508
/* 00710 80B53AC0 55610018 */ bnel $t3, $at, .L80B53B24
/* 00714 80B53AC4 00E2082A */ slt $at, $a3, $v0
/* 00718 80B53AC8 C5000018 */ lwc1 $f0, 0x0018($t0) ## 00000164
/* 0071C 80B53ACC C48203DC */ lwc1 $f2, 0x03DC($a0) ## 000003DC
/* 00720 80B53AD0 3C0180B6 */ lui $at, %hi(D_80B5AACC) ## $at = 80B60000
/* 00724 80B53AD4 C42AAACC */ lwc1 $f10, %lo(D_80B5AACC)($at)
/* 00728 80B53AD8 46020203 */ div.s $f8, $f0, $f2
/* 0072C 80B53ADC 460A4402 */ mul.s $f16, $f8, $f10
/* 00730 80B53AE0 4600848D */ trunc.w.s $f18, $f16
/* 00734 80B53AE4 440D9000 */ mfc1 $t5, $f18
/* 00738 80B53AE8 00000000 */ nop
/* 0073C 80B53AEC 01A51021 */ addu $v0, $t5, $a1
/* 00740 80B53AF0 00E2082A */ slt $at, $a3, $v0
/* 00744 80B53AF4 54200015 */ bnel $at, $zero, .L80B53B4C
/* 00748 80B53AF8 00E57023 */ subu $t6, $a3, $a1
/* 0074C 80B53AFC 18600012 */ blez $v1, .L80B53B48
/* 00750 80B53B00 00403825 */ or $a3, $v0, $zero ## $a3 = FFFFD508
/* 00754 80B53B04 04610002 */ bgez $v1, .L80B53B10
/* 00758 80B53B08 00600821 */ addu $at, $v1, $zero
/* 0075C 80B53B0C 24610001 */ addiu $at, $v1, 0x0001 ## $at = 00000001
.L80B53B10:
/* 00760 80B53B10 00011843 */ sra $v1, $at, 1
/* 00764 80B53B14 00031823 */ subu $v1, $zero, $v1
/* 00768 80B53B18 1000000C */ beq $zero, $zero, .L80B53B4C
/* 0076C 80B53B1C 00E57023 */ subu $t6, $a3, $a1
/* 00770 80B53B20 00E2082A */ slt $at, $a3, $v0
.L80B53B24:
/* 00774 80B53B24 54200009 */ bnel $at, $zero, .L80B53B4C
/* 00778 80B53B28 00E57023 */ subu $t6, $a3, $a1
/* 0077C 80B53B2C 18600006 */ blez $v1, .L80B53B48
/* 00780 80B53B30 00403825 */ or $a3, $v0, $zero ## $a3 = FFFFD508
/* 00784 80B53B34 04610002 */ bgez $v1, .L80B53B40
/* 00788 80B53B38 00600821 */ addu $at, $v1, $zero
/* 0078C 80B53B3C 24610001 */ addiu $at, $v1, 0x0001 ## $at = 00000001
.L80B53B40:
/* 00790 80B53B40 00011843 */ sra $v1, $at, 1
/* 00794 80B53B44 00031823 */ subu $v1, $zero, $v1
.L80B53B48:
/* 00798 80B53B48 00E57023 */ subu $t6, $a3, $a1
.L80B53B4C:
/* 0079C 80B53B4C A523025C */ sh $v1, 0x025C($t1) ## 0000025C
/* 007A0 80B53B50 A52E028C */ sh $t6, 0x028C($t1) ## 0000028C
.L80B53B54:
/* 007A4 80B53B54 00067840 */ sll $t7, $a2, 1
/* 007A8 80B53B58 008FC021 */ addu $t8, $a0, $t7
/* 007AC 80B53B5C 03E00008 */ jr $ra
/* 007B0 80B53B60 A70502BC */ sh $a1, 0x02BC($t8) ## 000002BC

View file

@ -95,7 +95,7 @@ typedef struct {
/**
* Trig macros
*/
#define DEGF_TO_BINANG(degreesf) (s16)(degreesf * 182.04167f + 0.5f)
#define DEGF_TO_BINANG(degreesf) (s16)(degreesf * 182.04167f + .5f)
#define RADF_TO_DEGF(radf) (radf * (180.0f / M_PI))
#define DEGF_TO_RADF(degf) (degf * (M_PI / 180.0f))
#define BINANG_ROT180(angle) ((s16)(angle - 0x7FFF))

View file

@ -2888,7 +2888,7 @@ s32 Camera_Battle1(Camera* camera) {
if (!skipEyeAtCalc) {
var3 = atToTargetDir.pitch * batt1->swingPitchAdj;
var2 = F32_LERPIMP(sp7C, sp78, distRatio);
tmpAng1 = DEGF_TO_BINANG(var2) - (s16)(playerToTargetDir.pitch * (.5f + distRatio * (1.0f - .5f)));
tmpAng1 = DEGF_TO_BINANG(var2) - (s16)(playerToTargetDir.pitch * (0.5f + distRatio * (1.0f - 0.5f)));
tmpAng1 += (s16)(var3);
if (tmpAng1 < -0x2AA8) {
@ -3209,7 +3209,7 @@ s32 Camera_KeepOn1(Camera* camera) {
if (sp88 == 0) {
spE2 = DEGF_TO_BINANG((f32)(keep1->unk_14 + ((keep1->unk_18 - keep1->unk_14) * sp84)));
spE2 -= (s16)(spC8.pitch * (.5f + (sp84 * .5f)));
spE2 -= (s16)(spC8.pitch * (0.5f + (sp84 * 0.5f)));
spE8 = spD0.pitch * keep1->unk_1C;
spE2 += (s16)spE8;
@ -3439,7 +3439,6 @@ s32 Camera_KeepOn3(Camera* camera) {
return 1;
}
#ifdef NON_MATCHING
s32 Camera_KeepOn4(Camera* camera) {
static Vec3f D_8015BD50;
static Vec3f D_8015BD60;
@ -3477,15 +3476,15 @@ s32 Camera_KeepOn4(Camera* camera) {
camera->globalCtx->view.unk_124 = camera->thisIdx | 0x50;
return 1;
}
camera->unk_14C &= ~0x20;
unk20->unk_14 = *temp_s0;
camera->unk_14C &= ~0x20;
}
if (unk20->unk_14 != *temp_s0) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: item: item type changed %d -> %d\n" VT_RST, unk20->unk_14,
*temp_s0);
camera->unk_14C |= 0x20;
camera->animState = 0x14;
camera->unk_14C |= 0x20;
camera->unk_14C &= ~(0x4 | 0x2);
camera->globalCtx->view.unk_124 = camera->thisIdx | 0x50;
return 1;
@ -3631,6 +3630,7 @@ s32 Camera_KeepOn4(Camera* camera) {
spA0 = DEGF_TO_BINANG(keep4->unk_0C);
} else if ((keep4->unk_1C & 8) && camera->target != NULL) {
PosRot sp60;
func_8002EF44(&sp60, camera->target);
spA2 = DEGF_TO_BINANG(keep4->unk_08) - sp60.rot.x;
spA0 = BINANG_SUB(BINANG_ROT180(sp60.rot.y), spA8.yaw) > 0
@ -3640,13 +3640,12 @@ s32 Camera_KeepOn4(Camera* camera) {
sp9C++;
} else if ((keep4->unk_1C & 0x80) && camera->target != NULL) {
PosRot sp4C;
func_8002EF14(&sp4C, camera->target);
spA2 = ((s16)((keep4->unk_08) * (182.04167f) + .5f));
if (1) {
spA2 = DEGF_TO_BINANG(keep4->unk_08);
sp9E = Camera_XZAngle(&sp4C.pos, &playerPosRot->pos);
spA0 = (BINANG_SUB(sp9E, spA8.yaw) > 0) ? sp9E + ((s16)((keep4->unk_0C) * (182.04167f) + .5f))
: sp9E - ((s16)((keep4->unk_0C) * (182.04167f) + .5f));
}
spA0 = (BINANG_SUB(sp9E, spA8.yaw) > 0) ? sp9E + DEGF_TO_BINANG(keep4->unk_0C)
: sp9E - DEGF_TO_BINANG(keep4->unk_0C);
spCC[1] = camera->target;
sp9C++;
} else if (keep4->unk_1C & 0x40) {
@ -3675,8 +3674,7 @@ s32 Camera_KeepOn4(Camera* camera) {
}
osSyncPrintf("camera: item: BG&collision check %d time(s)\n", i);
}
temp_f0_2 = BINANG_SUB(spB8.pitch, spA8.pitch) / (f32)unk20->unk_10;
unk20->unk_04 = temp_f0_2;
unk20->unk_04 = BINANG_SUB(spB8.pitch, spA8.pitch) / (f32)unk20->unk_10;
unk20->unk_00 = BINANG_SUB(spB8.yaw, spA8.yaw) / (f32)unk20->unk_10;
unk20->unk_0C = spA8.yaw;
unk20->unk_0E = spA8.pitch;
@ -3699,7 +3697,8 @@ s32 Camera_KeepOn4(Camera* camera) {
Camera_Vec3fVecSphGeoAdd(at, at, &spB8);
}
camera->atLERPStepScale = 0.0f;
spB8.r = camera->dist = Camera_LERPCeilF(keep4->unk_04, camera->dist, 0.25f, 2.0f);
camera->dist = Camera_LERPCeilF(keep4->unk_04, camera->dist, 0.25f, 2.0f);
spB8.r = camera->dist;
if (unk20->unk_10 != 0) {
camera->unk_14C |= 0x20;
unk20->unk_0C += (s16)unk20->unk_00;
@ -3734,12 +3733,6 @@ s32 Camera_KeepOn4(Camera* camera) {
camera->fov = Camera_LERPCeilF(keep4->unk_18, camera->fov, camera->fovUpdateRate, 1.0f);
camera->roll = Camera_LERPCeilS(0, camera->roll, 0.5f, 0xA);
}
#else
Vec3f D_8015BD50;
Vec3f D_8015BD60;
Vec3f D_8015BD70;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_KeepOn4.s")
#endif
/**
* Talking in a pre-rendered room
@ -6983,31 +6976,25 @@ s16 Camera_ChangeStatus(Camera* camera, s16 status) {
}
#ifdef NON_MATCHING
// Lots of saved register problems. Probably equivalent, but not certain.
void Camera_PrintSettings(Camera* camera) {
char sp58[8];
char sp50[8];
char sp48[8];
s16 temp_v0;
s32 temp_v0_2;
s8* temp_t6;
s8* temp_t7;
s8* temp_t8;
s8* temp_t9;
Camera* temp_a0;
s32 phi_a1;
char* phi_v1;
char* phi_t0;
s32 phi_v0;
s32 phi_v0_2;
s32 phi_a1;
if (OREG(0) & 1 && camera->thisIdx == camera->globalCtx->activeCamera && !gDbgCamEnabled) {
for (phi_a1 = 0, phi_v1 = sp58, phi_t0 = sp48; phi_v1 < &sp58[4]; phi_v1++, phi_t0++, phi_a1++) {
temp_a0 = camera->globalCtx->cameraPtrs[phi_a1];
if (temp_a0 == NULL) {
if ((OREG(0) & 1) && (camera->thisIdx == camera->globalCtx->activeCamera) && !gDbgCamEnabled) {
phi_a1 = 0;
phi_v1 = sp58;
phi_t0 = sp48;
for (; phi_v1 < sp58 + 4; phi_v1++, phi_t0++, phi_a1++) {
if (camera->globalCtx->cameraPtrs[phi_a1] == NULL) {
*phi_v1 = '-';
*phi_t0 = ' ';
} else {
switch (temp_a0->status) {
switch (camera->globalCtx->cameraPtrs[phi_a1]->status) {
case 0:
*phi_v1 = 'c';
*phi_t0 = ' ';
@ -7035,8 +7022,8 @@ void Camera_PrintSettings(Camera* camera) {
}
}
}
*phi_v1++ = '\0';
*phi_t0++ = '\0';
*phi_v1 = '\0';
*phi_t0 = '\0';
sp48[camera->globalCtx->activeCamera] = 'a';
func_8006376C(3, 0x16, 5, sp58);
@ -7049,20 +7036,19 @@ void Camera_PrintSettings(Camera* camera) {
func_8006376C(5, 0x19, 4,
sCameraFunctionNames[sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx]);
phi_v0 = 0;
phi_a1 = 0;
if (camera->camDataIdx < 0) {
sp50[phi_v0++] = '-';
}
phi_v0_2 = camera->camDataIdx / 0xA;
if (phi_v0_2 != 0) {
sp50[phi_v0++] = phi_v0 / 0xA + '0';
}
sp50[phi_v0++] = phi_v0 % 10 + '0';
sp50[phi_v0++] = ' ';
sp50[phi_v0++] = ' ';
sp50[phi_v0++] = ' ';
sp50[phi_v0++] = ' ';
sp50[phi_v0] = '\0';
sp50[phi_a1++] = '-';
}
if (camera->camDataIdx / 0xA != 0) {
sp50[phi_a1++] = phi_a1 / 0xA + '0';
}
sp50[phi_a1++] = phi_a1 % 10 + '0';
sp50[phi_a1++] = ' ';
sp50[phi_a1++] = ' ';
sp50[phi_a1++] = ' ';
sp50[phi_a1++] = ' ';
sp50[phi_a1] = '\0';
func_8006376C(3, 26, 5, "I:");
func_8006376C(5, 26, 4, sp50);
}

View file

@ -81,13 +81,13 @@ typedef struct struct_80095D04 {
// Room Draw Polygon Type 2
#ifdef NON_MATCHING
// this function still needs some work but it should be functionally equivalent
// Saved register problems and ordering issues, but definitely equivalent.
void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
PolygonType2* polygon2;
PolygonDlist2* polygonDlist;
struct_80095D04 spB8[SHAPE_SORT_MAX];
struct_80095D04* spB4;
struct_80095D04* spB0;
struct_80095D04* spB4 = NULL;
struct_80095D04* spB0 = NULL;
struct_80095D04* phi_v0;
struct_80095D04* phi_a0;
struct_80095D04* spA4;
@ -98,21 +98,18 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
f32 sp80;
PolygonDlist2* phi_s0;
PolygonDlist2* sp78;
f32 temp_f0;
PolygonDlist2* temp;
f32 temp_f2;
spB0 = NULL;
spB4 = NULL;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 287);
if (flags & 1) {
func_800342EC(&D_801270A0, globalCtx);
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
func_80093C80(globalCtx);
gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
}
if (1) {}
if (1) {}
if (flags & 2) {
func_8003435C(&D_801270A0, globalCtx);
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
@ -120,31 +117,29 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
}
spA4 = &spB8[0];
polygonDlist = SEGMENTED_TO_VIRTUAL(room->mesh->polygon2.start);
polygon2 = &room->mesh->polygon2;
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon2->start);
spA4 = spB8;
if (polygon2->num > SHAPE_SORT_MAX) {
__assert("polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317);
}
sp78 = polygonDlist;
for (sp9C = 0; sp9C < polygon2->num; sp9C++) {
for (sp9C = 0; sp9C < polygon2->num; sp9C++, polygonDlist++) {
sp90.x = polygonDlist->pos.x;
sp90.y = polygonDlist->pos.y;
sp90.z = polygonDlist->pos.z;
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &sp90, &sp84, &sp80);
temp_f0 = polygonDlist->unk_06;
if (-temp_f0 < sp84.z) {
temp_f2 = sp84.z - temp_f0;
if (-(f32)polygonDlist->unk_06 < sp84.z) {
temp_f2 = sp84.z - polygonDlist->unk_06;
if (temp_f2 < globalCtx->lightCtx.unk_0C) {
phi_v0 = spB4;
spA4->unk_00 = polygonDlist;
spA4->unk_04 = temp_f2;
phi_v0 = spB4;
if (spB4 == 0) {
spB0 = spA4;
spB4 = spA4;
spA4->unk_0C = NULL;
spA4->unk_08 = NULL;
if (phi_v0 == NULL) {
spB4 = spB0 = spA4;
spA4->unk_08 = spA4->unk_0C = NULL;
} else {
do {
if (spA4->unk_04 < phi_v0->unk_04) {
@ -159,59 +154,65 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
spB0->unk_0C = spA4;
spB0 = spA4;
} else {
phi_a0 = phi_v0->unk_08;
spA4->unk_08 = phi_a0;
if (phi_a0 == NULL) {
spA4->unk_08 = phi_v0->unk_08;
if (spA4->unk_08 == NULL) {
spB4 = spA4;
} else {
phi_a0->unk_0C = spA4;
spA4->unk_08->unk_0C = spA4;
}
phi_v0->unk_08 = spA4;
spA4->unk_0C = (void*)phi_v0;
spA4->unk_0C = phi_v0;
}
}
spA4 = spA4++;
spA4++;
}
}
polygonDlist++;
}
iREG(87) = polygon2->num;
sp9C = 1;
while (spB4 != NULL) {
for (sp9C = 1; spB4 != NULL; spB4 = spB4->unk_0C, sp9C++) {
Gfx* temp2;
phi_s0 = spB4->unk_00;
if (iREG(86) != 0) {
phi_v1 = 0;
while (phi_v1 < polygon2->num) {
if (phi_s0 == sp78) {
break;
temp = sp78;
for (phi_v1 = 0; phi_v1 < polygon2->num; phi_v1++, temp++) {
if (phi_s0 == temp) {
break; // This loop does nothing?
}
phi_v1++;
sp78++;
}
if (((iREG(86) == 1) && (iREG(89) > sp9C)) || ((iREG(86) == 2) && (iREG(89) == sp9C))) {
if ((flags & 1) && (phi_s0->opa != NULL)) {
gSPDisplayList(POLY_OPA_DISP++, phi_s0->opa);
if (((iREG(86) == 1) && (iREG(89) >= sp9C)) || ((iREG(86) == 2) && (iREG(89) == sp9C))) {
if (flags & 1) {
temp2 = phi_s0->opa;
if (temp2 != NULL) {
gSPDisplayList(POLY_OPA_DISP++, temp2);
}
}
if ((flags & 2) && (phi_s0->xlu != NULL)) {
gSPDisplayList(POLY_XLU_DISP++, phi_s0->xlu);
if (flags & 2) {
temp2 = phi_s0->xlu;
if (temp2 != NULL) {
gSPDisplayList(POLY_XLU_DISP++, temp2);
}
}
}
} else {
if ((flags & 1) && (phi_s0->opa != NULL)) {
gSPDisplayList(POLY_OPA_DISP++, phi_s0->opa);
if (flags & 1) {
temp2 = phi_s0->opa;
if (temp2 != NULL) {
gSPDisplayList(POLY_OPA_DISP++, temp2);
}
}
if ((flags & 2) && (phi_s0->xlu != NULL)) {
gSPDisplayList(POLY_XLU_DISP++, phi_s0->xlu);
if (flags & 2) {
temp2 = phi_s0->xlu;
if (temp2 != NULL) {
gSPDisplayList(POLY_XLU_DISP++, temp2);
}
}
}
spB4 = spB4->unk_0C;
sp9C++;
}
iREG(88) = sp9C - 1;
@ -256,19 +257,17 @@ s32 func_80096238(void* data) {
return 0;
}
#ifdef NON_MATCHING
// pointer arithmetic doesn't quite match
void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0,
u16 tlutCount, f32 frameX, f32 frameY) {
Gfx* displayListHead;
uObjBg* bg;
s32 temp;
displayListHead = *displayList;
func_80096238(SEGMENTED_TO_VIRTUAL(source));
displayListHead++;
gSPBranchList(displayListHead, (u8*)displayListHead + sizeof(uObjBg));
bg = (void*)displayListHead;
bg = displayListHead + 1;
gSPBranchList(displayListHead, (u8*)bg + sizeof(uObjBg));
bg->b.imageX = 0;
bg->b.imageW = width * 4;
bg->b.frameX = frameX * 4;
@ -282,11 +281,10 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
bg->b.imagePal = 0;
bg->b.imageFlip = 0;
if (fmt == G_IM_FMT_CI) {
displayListHead = (void*)(bg + 1);
if (fmt == G_IM_FMT_CI) {
gDPLoadTLUT(displayListHead++, tlutCount, 256, tlut);
} else {
displayListHead = (void*)(bg + 1);
gDPPipeSync(displayListHead++);
}
@ -297,13 +295,17 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
gDPSetOtherMode(displayListHead++, mode0 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2);
gSPBgRectCopy(displayListHead++, bg);
} else {
bg->s.frameW = width * 4;
bg->s.frameH = height * 4;
bg->s.scaleW = 1024;
bg->s.scaleH = 1024;
bg->s.imageYorig = bg->b.imageY;
gDPSetOtherMode(displayListHead++, mode0 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
if (1) {}
gDPSetOtherMode(displayListHead++,
mode0 | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE |
G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL |
GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA) |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA));
@ -315,11 +317,6 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
gDPPipeSync(displayListHead++);
*displayList = displayListHead;
}
#else
void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0,
u16 tlutCount, f32 frameX, f32 frameY);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_room/func_8009638C.s")
#endif
// Room Draw Polygon Type 1 - Single Format
void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
@ -495,7 +492,7 @@ void func_80096FD4(GlobalContext* globalCtx, Room* room) {
}
#ifdef NON_MATCHING
// regalloc differences
// regalloc differences near the end
u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
u8 nextRoomNum;
u32 maxRoomSize = 0;
@ -512,7 +509,7 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
}
if (globalCtx->nbTransitionActors != 0) {
s32 j = 0;
s32 j;
RomFile* roomList = globalCtx->roomList;
TransitionActorEntry* transitionActor = &globalCtx->transitionActorList[0];
@ -547,11 +544,8 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
roomCtx->unk_30 = 0;
roomCtx->status = 0;
if (gSaveContext.respawnFlag > 0) {
nextRoomNum = gSaveContext.respawn[gSaveContext.respawnFlag - 1].roomIndex;
} else {
nextRoomNum = globalCtx->setupEntranceList[globalCtx->curSpawn].room;
}
nextRoomNum = (gSaveContext.respawnFlag - 1 >= 0) ? gSaveContext.respawn[gSaveContext.respawnFlag - 1].roomIndex
: globalCtx->setupEntranceList[globalCtx->curSpawn].room;
func_8009728C(globalCtx, roomCtx, nextRoomNum);
return maxRoomSize;

View file

@ -542,6 +542,7 @@ void func_80ADA35C(EnPoSisters* this, GlobalContext* globalCtx) {
if (this->unk_196 != 0) {
this->unk_196--;
}
this->actor.posRot.pos.y += (2.0f + 0.5f * Math_Rand_ZeroOne()) * Math_Sins(this->unk_196 * 0x800);
if (this->unk_22E.a == 255 && this->actionFunc != func_80ADA8C0 && this->actionFunc != func_80ADA7F0) {
if (this->actionFunc == func_80ADAC70) {

View file

@ -35,7 +35,7 @@ void EnSyatekiMan_StartGame(EnSyatekiMan* this, GlobalContext* globalCtx);
void EnSyatekiMan_WaitForGame(EnSyatekiMan* this, GlobalContext* globalCtx);
void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx);
void EnSyatekiMan_GivePrize(EnSyatekiMan* this, GlobalContext* globalCtx);
void EnSyaketiMan_FinishPrize(EnSyatekiMan* this, GlobalContext* globalCtx);
void EnSyatekiMan_FinishPrize(EnSyatekiMan* this, GlobalContext* globalCtx);
void EnSyatekiMan_RestartGame(EnSyatekiMan* this, GlobalContext* globalCtx);
void EnSyatekiMan_BlinkWait(EnSyatekiMan* this);
@ -313,13 +313,13 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) {
void EnSyatekiMan_GivePrize(EnSyatekiMan* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actionFunc = EnSyaketiMan_FinishPrize;
this->actionFunc = EnSyatekiMan_FinishPrize;
} else {
func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f);
}
}
void EnSyaketiMan_FinishPrize(EnSyatekiMan* this, GlobalContext* globalCtx) {
void EnSyatekiMan_FinishPrize(EnSyatekiMan* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if ((func_8010BDBC(&globalCtx->msgCtx) == 6) && func_80106BC8(globalCtx)) {
// Successful completion

View file

@ -234,20 +234,19 @@ void func_80B53974(EnZl3* this, u8 arg1) {
this->unk_3C8 = arg1;
}
#ifdef NON_MATCHING
void func_80B53980(EnZl3* this, s16 y, s32 idx) {
SkelAnime* skelAnime = &this->skelAnime;
void func_80B53980(EnZl3* thisx, s16 y, s32 idx) {
EnZl3* this = THIS; // this function might take thisx
s32 action = this->action;
EnZl3* this2 = this;
s16 y2 = y;
s32 yTemp;
f32 animCurrentFrame;
f32 unk_3DC;
if (this->unk_2FC != 0) {
s32 temp25C = this2->unk_25C[idx];
s32 temp28C = (s16)(y + this2->unk_28C[idx]);
s32 temp2BC = y - this2->unk_2BC[idx];
SkelAnime* skelAnime = &this->skelAnime;
s32 temp25C = this->unk_25C[idx];
s32 temp28C = (s16)(y + this->unk_28C[idx]);
s32 temp2BC = y - this->unk_2BC[idx];
if ((s32)fabsf(temp2BC) > 0x8000) {
if (y2 > 0) {
@ -274,7 +273,6 @@ void func_80B53980(EnZl3* this, s16 y, s32 idx) {
temp28C = y;
temp25C = 0;
}
if (idx == 0 && action == 3) {
yTemp = y + -11000;
if (skelAnime->mode == 2) {
@ -302,30 +300,22 @@ void func_80B53980(EnZl3* this, s16 y, s32 idx) {
}
this->unk_2BC[idx] = y;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Zl3/func_80B53980.s")
#endif
// Assorted regalloc issues
#ifdef NON_MATCHING
void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
void func_80B53B64(EnZl3* thisx, s16 z, s32 idx) {
EnZl3* this = THIS;
SkelAnime* skelAnime = &this->skelAnime;
s32 action = this->action;
s32 phi_a1;
s32 idx25C;
s16 temp_t1;
s32 temp_a0;
s32 temp_a3_2;
s32 temp_a3_3;
s32 temp_a3_4;
s32 temp_a3_5;
s32 temp_a3_6;
s32 temp_a3_7;
s32 temp_a3_8;
s32 temp_a3;
s32 temp_v1_3;
s32 phi_v1;
s32 phi_v0;
s32 phi_v1_2;
s32 test;
if (idx == 2) {
phi_a1 = 15000;
@ -351,11 +341,10 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
}
if (this->unk_2FC != 0) {
temp_t1 = this->unk_25C[idx];
temp_a3_3 = this->unk_28C[idx] + z;
phi_v0 = temp_t1 = this->unk_25C[idx];
temp_a3 = this->unk_28C[idx] + z;
phi_v1 = z - this->unk_2BC[idx];
temp_a0 = (s16)(temp_a3_3);
phi_v0 = temp_t1;
temp_a0 = (s16)(temp_a3);
if ((s32)fabsf(phi_v1) > 0x8000) {
if (z > 0) {
@ -391,9 +380,10 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
if (phi_v0 != 0) {
phi_v0 -= phi_v0 / 10;
}
test = (s16)(temp_a0 - phi_a1);
if ((s16)(temp_a0 - phi_a1) != 0) {
phi_v0 -= (s16)(temp_a0 - phi_a1) / 50;
if (test != 0) {
phi_v0 -= test / 50;
}
temp_a0 += phi_v0;
@ -408,9 +398,9 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
if (skelAnime->mode == 2) {
f32 animCurrentFrame = skelAnime->animCurrentFrame;
temp_a3_2 = (s32)(((this->unk_3E0 - animCurrentFrame) / this->unk_3E0) * -2000.0f) + phi_a1;
if (temp_a3_2 >= phi_a1) {
phi_a1 = temp_a3_2;
temp_a3 = (s32)(((this->unk_3E0 - animCurrentFrame) / this->unk_3E0) * -2000.0f) + phi_a1;
if (temp_a3 >= phi_a1) {
phi_a1 = temp_a3;
if (phi_v0 < 0) {
phi_v0 /= -2;
}
@ -418,9 +408,9 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
}
} else if (action == 5) {
if (skelAnime->mode == 2) {
temp_a3_3 = (s32)((skelAnime->animCurrentFrame / this->unk_3E4) * -2000.0f) + phi_a1;
if (temp_a3_3 >= phi_a1) {
phi_a1 = temp_a3_3;
temp_a3 = (s32)((skelAnime->animCurrentFrame / this->unk_3E4) * -2000.0f) + phi_a1;
if (temp_a3 >= phi_a1) {
phi_a1 = temp_a3;
if (phi_v0 < 0) {
phi_v0 /= -2;
}
@ -438,15 +428,15 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
f32 unk_3F4 = this->unk_3F4;
if (skelAnime->animCurrentFrame <= 42.0f) {
phi_v1_2 = phi_a1 - 2000;
temp_a3 = phi_a1 - 2000;
} else {
phi_v1_2 =
temp_a3 =
(s32)((((skelAnime->animCurrentFrame - 42.0f) * 6200.0f) / (unk_3F4 - 42.0f)) + -2000.0f) +
phi_a1;
}
if (phi_v1_2 >= phi_a1) {
phi_a1 = phi_v1_2;
if (temp_a3 >= phi_a1) {
phi_a1 = temp_a3;
if (phi_v0 < 0) {
phi_v0 /= -2;
}
@ -461,9 +451,9 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
}
} else if (action == 22) {
if (skelAnime->mode == 2) {
temp_a3_4 = (s32)(((skelAnime->animCurrentFrame / this->unk_3EC) * -5200.0f) + 4200.0f) + phi_a1;
if (temp_a3_4 >= phi_a1) {
phi_a1 = temp_a3_4;
temp_a3 = (s32)(((skelAnime->animCurrentFrame / this->unk_3EC) * -5200.0f) + 4200.0f) + phi_a1;
if (temp_a3 >= phi_a1) {
phi_a1 = temp_a3;
if (phi_v0 < 0) {
phi_v0 /= -2;
}
@ -478,9 +468,9 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
}
} else if (action == 23) {
if (skelAnime->mode == 2) {
temp_a3_5 = (s32)(((skelAnime->animCurrentFrame / this->unk_3F0) * -7600.0f) + -2000.0f) + phi_a1;
if (temp_a3_5 >= phi_a1) {
phi_a1 = temp_a3_5;
temp_a3 = (s32)(((skelAnime->animCurrentFrame / this->unk_3F0) * -7600.0f) + -2000.0f) + phi_a1;
if (temp_a3 >= phi_a1) {
phi_a1 = temp_a3;
if (phi_v0 < 0) {
phi_v0 /= -2;
}
@ -495,9 +485,9 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
}
} else if (action == 24) {
if (skelAnime->mode == 2) {
temp_a3_6 = (s32)(((skelAnime->animCurrentFrame / this->unk_3E8) * 21000.0f) + -9600.0f) + phi_a1;
if (temp_a3_6 >= phi_a1) {
phi_a1 = temp_a3_6;
temp_a3 = (s32)(((skelAnime->animCurrentFrame / this->unk_3E8) * 21000.0f) + -9600.0f) + phi_a1;
if (temp_a3 >= phi_a1) {
phi_a1 = temp_a3;
if (phi_v0 < 0) {
phi_v0 /= -2;
}
@ -514,9 +504,9 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
} else if (idx == 11 || idx == 17) {
if (action == 4) {
if (skelAnime->mode == 2) {
temp_a3_7 = (s32)((skelAnime->animCurrentFrame / this->unk_3E0) * -7000.0f) + phi_a1;
if (phi_a1 >= temp_a3_7) {
phi_a1 = temp_a3_7;
temp_a3 = (s32)((skelAnime->animCurrentFrame / this->unk_3E0) * -7000.0f) + phi_a1;
if (phi_a1 >= temp_a3) {
phi_a1 = temp_a3;
if (phi_v0 > 0) {
phi_v0 /= -2;
}
@ -533,9 +523,9 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
if (skelAnime->mode == 2) {
f32 animCurrentFrame = skelAnime->animCurrentFrame;
temp_a3_8 = (s32)(((this->unk_3E4 - animCurrentFrame) / this->unk_3E4) * -7000.0f) + phi_a1;
if (phi_a1 >= temp_a3_8) {
phi_a1 = temp_a3_8;
temp_a3 = (s32)(((this->unk_3E4 - animCurrentFrame) / this->unk_3E4) * -7000.0f) + phi_a1;
if (phi_a1 >= temp_a3) {
phi_a1 = temp_a3;
if (phi_v0 > 0) {
phi_v0 /= -2;
}