1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-01-24 17:47:33 +00:00

Decompiled ovl_Door_Gerudo (#274)

* Decompiled ovl_Door_Gerudo

* Update include/z64actor.h

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Update src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Update src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Update include/z64actor.h

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Ethan Roseman 2020-07-19 16:36:18 -04:00 committed by GitHub
parent 3d36fe510f
commit 71e65af9b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 146 additions and 460 deletions

View file

@ -1,14 +0,0 @@
glabel DoorGerudo_Destroy
/* 000AC 8099468C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 000B0 80994690 AFA40018 */ sw $a0, 0x0018($sp)
/* 000B4 80994694 8FAE0018 */ lw $t6, 0x0018($sp)
/* 000B8 80994698 AFBF0014 */ sw $ra, 0x0014($sp)
/* 000BC 8099469C 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 000C0 809946A0 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810
/* 000C4 809946A4 0C00FB56 */ jal DynaPolyInfo_Free
## DynaPolyInfo_delReserve
/* 000C8 809946A8 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C
/* 000CC 809946AC 8FBF0014 */ lw $ra, 0x0014($sp)
/* 000D0 809946B0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 000D4 809946B4 03E00008 */ jr $ra
/* 000D8 809946B8 00000000 */ nop

View file

@ -1,86 +0,0 @@
.rdata
glabel D_80994B80
.asciz "../z_door_gerudo.c"
.balign 4
glabel D_80994B94
.asciz "../z_door_gerudo.c"
.balign 4
glabel D_80994BA8
.asciz "../z_door_gerudo.c"
.balign 4
.late_rodata
glabel D_80994BC0
.float 0.01
.text
glabel DoorGerudo_Draw
/* 00468 80994A48 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8
/* 0046C 80994A4C AFB10018 */ sw $s1, 0x0018($sp)
/* 00470 80994A50 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000
/* 00474 80994A54 AFBF001C */ sw $ra, 0x001C($sp)
/* 00478 80994A58 AFB00014 */ sw $s0, 0x0014($sp)
/* 0047C 80994A5C AFA40048 */ sw $a0, 0x0048($sp)
/* 00480 80994A60 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000
/* 00484 80994A64 3C068099 */ lui $a2, %hi(D_80994B80) ## $a2 = 80990000
/* 00488 80994A68 24C64B80 */ addiu $a2, $a2, %lo(D_80994B80) ## $a2 = 80994B80
/* 0048C 80994A6C 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE8
/* 00490 80994A70 24070169 */ addiu $a3, $zero, 0x0169 ## $a3 = 00000169
/* 00494 80994A74 0C031AB1 */ jal Graph_OpenDisps
/* 00498 80994A78 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000
/* 0049C 80994A7C 0C024F46 */ jal func_80093D18
/* 004A0 80994A80 8E240000 */ lw $a0, 0x0000($s1) ## 00000000
/* 004A4 80994A84 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0
/* 004A8 80994A88 3C0FDA38 */ lui $t7, 0xDA38 ## $t7 = DA380000
/* 004AC 80994A8C 35EF0003 */ ori $t7, $t7, 0x0003 ## $t7 = DA380003
/* 004B0 80994A90 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008
/* 004B4 80994A94 AE0E02C0 */ sw $t6, 0x02C0($s0) ## 000002C0
/* 004B8 80994A98 AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000
/* 004BC 80994A9C 8E240000 */ lw $a0, 0x0000($s1) ## 00000000
/* 004C0 80994AA0 3C058099 */ lui $a1, %hi(D_80994B94) ## $a1 = 80990000
/* 004C4 80994AA4 24A54B94 */ addiu $a1, $a1, %lo(D_80994B94) ## $a1 = 80994B94
/* 004C8 80994AA8 2406016D */ addiu $a2, $zero, 0x016D ## $a2 = 0000016D
/* 004CC 80994AAC 0C0346A2 */ jal Matrix_NewMtx
/* 004D0 80994AB0 AFA2002C */ sw $v0, 0x002C($sp)
/* 004D4 80994AB4 8FA3002C */ lw $v1, 0x002C($sp)
/* 004D8 80994AB8 3C080600 */ lui $t0, 0x0600 ## $t0 = 06000000
/* 004DC 80994ABC 25080040 */ addiu $t0, $t0, 0x0040 ## $t0 = 06000040
/* 004E0 80994AC0 AC620004 */ sw $v0, 0x0004($v1) ## 00000004
/* 004E4 80994AC4 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0
/* 004E8 80994AC8 3C19DE00 */ lui $t9, 0xDE00 ## $t9 = DE000000
/* 004EC 80994ACC 3C063CCC */ lui $a2, 0x3CCC ## $a2 = 3CCC0000
/* 004F0 80994AD0 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008
/* 004F4 80994AD4 AE1802C0 */ sw $t8, 0x02C0($s0) ## 000002C0
/* 004F8 80994AD8 AC480004 */ sw $t0, 0x0004($v0) ## 00000004
/* 004FC 80994ADC AC590000 */ sw $t9, 0x0000($v0) ## 00000000
/* 00500 80994AE0 8FA90048 */ lw $t1, 0x0048($sp)
/* 00504 80994AE4 3C018099 */ lui $at, %hi(D_80994BC0) ## $at = 80990000
/* 00508 80994AE8 34C6CCCD */ ori $a2, $a2, 0xCCCD ## $a2 = 3CCCCCCD
/* 0050C 80994AEC 912A0166 */ lbu $t2, 0x0166($t1) ## 00000166
/* 00510 80994AF0 1140000A */ beq $t2, $zero, .L80994B1C
/* 00514 80994AF4 00000000 */ nop
/* 00518 80994AF8 C42C4BC0 */ lwc1 $f12, %lo(D_80994BC0)($at)
/* 0051C 80994AFC 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001
/* 00520 80994B00 0C0342A3 */ jal Matrix_Scale
/* 00524 80994B04 46006386 */ mov.s $f14, $f12
/* 00528 80994B08 8FAB0048 */ lw $t3, 0x0048($sp)
/* 0052C 80994B0C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000
/* 00530 80994B10 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000
/* 00534 80994B14 0C00CFD5 */ jal func_80033F54
/* 00538 80994B18 91650166 */ lbu $a1, 0x0166($t3) ## 00000166
.L80994B1C:
/* 0053C 80994B1C 3C068099 */ lui $a2, %hi(D_80994BA8) ## $a2 = 80990000
/* 00540 80994B20 24C64BA8 */ addiu $a2, $a2, %lo(D_80994BA8) ## $a2 = 80994BA8
/* 00544 80994B24 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE8
/* 00548 80994B28 8E250000 */ lw $a1, 0x0000($s1) ## 00000000
/* 0054C 80994B2C 0C031AD5 */ jal Graph_CloseDisps
/* 00550 80994B30 24070179 */ addiu $a3, $zero, 0x0179 ## $a3 = 00000179
/* 00554 80994B34 8FBF001C */ lw $ra, 0x001C($sp)
/* 00558 80994B38 8FB00014 */ lw $s0, 0x0014($sp)
/* 0055C 80994B3C 8FB10018 */ lw $s1, 0x0018($sp)
/* 00560 80994B40 03E00008 */ jr $ra
/* 00564 80994B44 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000
/* 00568 80994B48 00000000 */ nop
/* 0056C 80994B4C 00000000 */ nop

View file

@ -1,50 +0,0 @@
glabel DoorGerudo_Init
/* 00000 809945E0 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0
/* 00004 809945E4 AFA50034 */ sw $a1, 0x0034($sp)
/* 00008 809945E8 AFBF001C */ sw $ra, 0x001C($sp)
/* 0000C 809945EC AFB00018 */ sw $s0, 0x0018($sp)
/* 00010 809945F0 3C058099 */ lui $a1, %hi(D_80994B70) ## $a1 = 80990000
/* 00014 809945F4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00018 809945F8 AFA00024 */ sw $zero, 0x0024($sp)
/* 0001C 809945FC 0C01E037 */ jal Actor_ProcessInitChain
/* 00020 80994600 24A54B70 */ addiu $a1, $a1, %lo(D_80994B70) ## $a1 = 80994B70
/* 00024 80994604 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000
/* 00028 80994608 24840170 */ addiu $a0, $a0, 0x0170 ## $a0 = 06000170
/* 0002C 8099460C 0C010620 */ jal DynaPolyInfo_Alloc
/* 00030 80994610 27A50024 */ addiu $a1, $sp, 0x0024 ## $a1 = FFFFFFF4
/* 00034 80994614 8FA40034 */ lw $a0, 0x0034($sp)
/* 00038 80994618 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000
/* 0003C 8099461C 8FA70024 */ lw $a3, 0x0024($sp)
/* 00040 80994620 0C00FA9D */ jal DynaPolyInfo_RegisterActor
## DynaPolyInfo_setActor
/* 00044 80994624 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810
/* 00048 80994628 8605001C */ lh $a1, 0x001C($s0) ## 0000001C
/* 0004C 8099462C AE02014C */ sw $v0, 0x014C($s0) ## 0000014C
/* 00050 80994630 8FA40034 */ lw $a0, 0x0034($sp)
/* 00054 80994634 0C00B2D0 */ jal Flags_GetSwitch
/* 00058 80994638 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000
/* 0005C 8099463C 1040000A */ beq $v0, $zero, .L80994668
/* 00060 80994640 3C0F8099 */ lui $t7, %hi(func_8099485C) ## $t7 = 80990000
/* 00064 80994644 3C014348 */ lui $at, 0x4348 ## $at = 43480000
/* 00068 80994648 44813000 */ mtc1 $at, $f6 ## $f6 = 200.00
/* 0006C 8099464C C604000C */ lwc1 $f4, 0x000C($s0) ## 0000000C
/* 00070 80994650 3C0E8099 */ lui $t6, %hi(func_8099485C) ## $t6 = 80990000
/* 00074 80994654 25CE485C */ addiu $t6, $t6, %lo(func_8099485C) ## $t6 = 8099485C
/* 00078 80994658 46062200 */ add.s $f8, $f4, $f6
/* 0007C 8099465C AE0E0168 */ sw $t6, 0x0168($s0) ## 00000168
/* 00080 80994660 10000005 */ beq $zero, $zero, .L80994678
/* 00084 80994664 E6080028 */ swc1 $f8, 0x0028($s0) ## 00000028
.L80994668:
/* 00088 80994668 25EF485C */ addiu $t7, $t7, %lo(func_8099485C) ## $t7 = 8099485C
/* 0008C 8099466C 2418000A */ addiu $t8, $zero, 0x000A ## $t8 = 0000000A
/* 00090 80994670 AE0F0168 */ sw $t7, 0x0168($s0) ## 00000168
/* 00094 80994674 A2180166 */ sb $t8, 0x0166($s0) ## 00000166
.L80994678:
/* 00098 80994678 8FBF001C */ lw $ra, 0x001C($sp)
/* 0009C 8099467C 8FB00018 */ lw $s0, 0x0018($sp)
/* 000A0 80994680 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000
/* 000A4 80994684 03E00008 */ jr $ra
/* 000A8 80994688 00000000 */ nop

View file

@ -1,10 +0,0 @@
glabel DoorGerudo_Update
/* 00444 80994A24 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00448 80994A28 AFBF0014 */ sw $ra, 0x0014($sp)
/* 0044C 80994A2C 8C990168 */ lw $t9, 0x0168($a0) ## 00000168
/* 00450 80994A30 0320F809 */ jalr $ra, $t9
/* 00454 80994A34 00000000 */ nop
/* 00458 80994A38 8FBF0014 */ lw $ra, 0x0014($sp)
/* 0045C 80994A3C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00460 80994A40 03E00008 */ jr $ra
/* 00464 80994A44 00000000 */ nop

View file

@ -1,45 +0,0 @@
.late_rodata
glabel D_80994BBC
.word 0x7F7FFFFF # might be a float?
.text
glabel func_809946BC
/* 000DC 809946BC 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8
/* 000E0 809946C0 AFBF0014 */ sw $ra, 0x0014($sp)
/* 000E4 809946C4 AFA40038 */ sw $a0, 0x0038($sp)
/* 000E8 809946C8 AFA5003C */ sw $a1, 0x003C($sp)
/* 000EC 809946CC AFA70044 */ sw $a3, 0x0044($sp)
/* 000F0 809946D0 8C821C44 */ lw $v0, 0x1C44($a0) ## 00001C44
/* 000F4 809946D4 44866000 */ mtc1 $a2, $f12 ## $f12 = 0.00
/* 000F8 809946D8 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 000FC 809946DC C4440024 */ lwc1 $f4, 0x0024($v0) ## 00000024
/* 00100 809946E0 27A5001C */ addiu $a1, $sp, 0x001C ## $a1 = FFFFFFE4
/* 00104 809946E4 27A60028 */ addiu $a2, $sp, 0x0028 ## $a2 = FFFFFFF0
/* 00108 809946E8 E7A40028 */ swc1 $f4, 0x0028($sp)
/* 0010C 809946EC C4460028 */ lwc1 $f6, 0x0028($v0) ## 00000028
/* 00110 809946F0 460C3200 */ add.s $f8, $f6, $f12
/* 00114 809946F4 E7A8002C */ swc1 $f8, 0x002C($sp)
/* 00118 809946F8 C44A002C */ lwc1 $f10, 0x002C($v0) ## 0000002C
/* 0011C 809946FC 0C00B6F4 */ jal func_8002DBD0
/* 00120 80994700 E7AA0030 */ swc1 $f10, 0x0030($sp)
/* 00124 80994704 C7A0001C */ lwc1 $f0, 0x001C($sp)
/* 00128 80994708 C7B00044 */ lwc1 $f16, 0x0044($sp)
/* 0012C 8099470C C7B20048 */ lwc1 $f18, 0x0048($sp)
/* 00130 80994710 46000005 */ abs.s $f0, $f0
/* 00134 80994714 3C018099 */ lui $at, %hi(D_80994BBC) ## $at = 80990000
/* 00138 80994718 4600803C */ c.lt.s $f16, $f0
/* 0013C 8099471C C7A00020 */ lwc1 $f0, 0x0020($sp)
/* 00140 80994720 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00144 80994724 45010006 */ bc1t .L80994740
/* 00148 80994728 00000000 */ nop
/* 0014C 8099472C 46000005 */ abs.s $f0, $f0
/* 00150 80994730 4600903C */ c.lt.s $f18, $f0
/* 00154 80994734 C7A00024 */ lwc1 $f0, 0x0024($sp)
/* 00158 80994738 45000003 */ bc1f .L80994748
/* 0015C 8099473C 00000000 */ nop
.L80994740:
/* 00160 80994740 10000001 */ beq $zero, $zero, .L80994748
/* 00164 80994744 C4204BBC */ lwc1 $f0, %lo(D_80994BBC)($at)
.L80994748:
/* 00168 80994748 03E00008 */ jr $ra
/* 0016C 8099474C 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000

View file

@ -1,74 +0,0 @@
glabel func_80994750
/* 00170 80994750 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8
/* 00174 80994754 AFBF001C */ sw $ra, 0x001C($sp)
/* 00178 80994758 AFA40028 */ sw $a0, 0x0028($sp)
/* 0017C 8099475C 8CAE1C44 */ lw $t6, 0x1C44($a1) ## 00001C44
/* 00180 80994760 AFA5002C */ sw $a1, 0x002C($sp)
/* 00184 80994764 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 00188 80994768 0C023A62 */ jal func_8008E988
/* 0018C 8099476C AFAE0024 */ sw $t6, 0x0024($sp)
/* 00190 80994770 14400035 */ bne $v0, $zero, .L80994848
/* 00194 80994774 8FA4002C */ lw $a0, 0x002C($sp)
/* 00198 80994778 3C014170 */ lui $at, 0x4170 ## $at = 41700000
/* 0019C 8099477C 44812000 */ mtc1 $at, $f4 ## $f4 = 15.00
/* 001A0 80994780 8FA50028 */ lw $a1, 0x0028($sp)
/* 001A4 80994784 24060000 */ addiu $a2, $zero, 0x0000 ## $a2 = 00000000
/* 001A8 80994788 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000
/* 001AC 8099478C 0C2651AF */ jal func_809946BC
/* 001B0 80994790 E7A40010 */ swc1 $f4, 0x0010($sp)
/* 001B4 80994794 3C014220 */ lui $at, 0x4220 ## $at = 42200000
/* 001B8 80994798 44813000 */ mtc1 $at, $f6 ## $f6 = 40.00
/* 001BC 8099479C 46000086 */ mov.s $f2, $f0
/* 001C0 809947A0 46000005 */ abs.s $f0, $f0
/* 001C4 809947A4 44806000 */ mtc1 $zero, $f12 ## $f12 = 0.00
/* 001C8 809947A8 4606003C */ c.lt.s $f0, $f6
/* 001CC 809947AC 8FAF0024 */ lw $t7, 0x0024($sp)
/* 001D0 809947B0 8FB90028 */ lw $t9, 0x0028($sp)
/* 001D4 809947B4 45020025 */ bc1fl .L8099484C
/* 001D8 809947B8 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000
/* 001DC 809947BC 85F800B6 */ lh $t8, 0x00B6($t7) ## 000000B6
/* 001E0 809947C0 872800B6 */ lh $t0, 0x00B6($t9) ## 000000B6
/* 001E4 809947C4 4602603C */ c.lt.s $f12, $f2
/* 001E8 809947C8 34098000 */ ori $t1, $zero, 0x8000 ## $t1 = 00008000
/* 001EC 809947CC 03081023 */ subu $v0, $t8, $t0
/* 001F0 809947D0 00021400 */ sll $v0, $v0, 16
/* 001F4 809947D4 45000004 */ bc1f .L809947E8
/* 001F8 809947D8 00021403 */ sra $v0, $v0, 16
/* 001FC 809947DC 01221023 */ subu $v0, $t1, $v0
/* 00200 809947E0 00021400 */ sll $v0, $v0, 16
/* 00204 809947E4 00021403 */ sra $v0, $v0, 16
.L809947E8:
/* 00208 809947E8 04400003 */ bltz $v0, .L809947F8
/* 0020C 809947EC 00021823 */ subu $v1, $zero, $v0
/* 00210 809947F0 10000001 */ beq $zero, $zero, .L809947F8
/* 00214 809947F4 00401825 */ or $v1, $v0, $zero ## $v1 = 00000000
.L809947F8:
/* 00218 809947F8 28612000 */ slti $at, $v1, 0x2000
/* 0021C 809947FC 50200013 */ beql $at, $zero, .L8099484C
/* 00220 80994800 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000
/* 00224 80994804 4602603E */ c.le.s $f12, $f2
/* 00228 80994808 3C01BF80 */ lui $at, 0xBF80 ## $at = BF800000
/* 0022C 8099480C 45020009 */ bc1fl .L80994834
/* 00230 80994810 44810000 */ mtc1 $at, $f0 ## $f0 = -1.00
/* 00234 80994814 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000
/* 00238 80994818 44810000 */ mtc1 $at, $f0 ## $f0 = 1.00
/* 0023C 8099481C 00000000 */ nop
/* 00240 80994820 4600020D */ trunc.w.s $f8, $f0
/* 00244 80994824 44024000 */ mfc1 $v0, $f8
/* 00248 80994828 10000009 */ beq $zero, $zero, .L80994850
/* 0024C 8099482C 8FBF001C */ lw $ra, 0x001C($sp)
/* 00250 80994830 44810000 */ mtc1 $at, $f0 ## $f0 = 1.00
.L80994834:
/* 00254 80994834 00000000 */ nop
/* 00258 80994838 4600020D */ trunc.w.s $f8, $f0
/* 0025C 8099483C 44024000 */ mfc1 $v0, $f8
/* 00260 80994840 10000003 */ beq $zero, $zero, .L80994850
/* 00264 80994844 8FBF001C */ lw $ra, 0x001C($sp)
.L80994848:
/* 00268 80994848 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000
.L8099484C:
/* 0026C 8099484C 8FBF001C */ lw $ra, 0x001C($sp)
.L80994850:
/* 00270 80994850 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000
/* 00274 80994854 03E00008 */ jr $ra
/* 00278 80994858 00000000 */ nop

View file

@ -1,77 +0,0 @@
glabel func_8099485C
/* 0027C 8099485C 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8
/* 00280 80994860 AFBF001C */ sw $ra, 0x001C($sp)
/* 00284 80994864 AFB00018 */ sw $s0, 0x0018($sp)
/* 00288 80994868 848E0164 */ lh $t6, 0x0164($a0) ## 00000164
/* 0028C 8099486C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00290 80994870 00A03025 */ or $a2, $a1, $zero ## $a2 = 00000000
/* 00294 80994874 11C00013 */ beq $t6, $zero, .L809948C4
/* 00298 80994878 3C088016 */ lui $t0, %hi(gSaveContext)
/* 0029C 8099487C 3C0F8099 */ lui $t7, %hi(func_8099496C) ## $t7 = 80990000
/* 002A0 80994880 25EF496C */ addiu $t7, $t7, %lo(func_8099496C) ## $t7 = 8099496C
/* 002A4 80994884 2508E660 */ addiu $t0, %lo(gSaveContext)
/* 002A8 80994888 AC8F0168 */ sw $t7, 0x0168($a0) ## 00000168
/* 002AC 8099488C 95181402 */ lhu $t8, 0x1402($t0) ## 8015FA62
/* 002B0 80994890 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 002B4 80994894 01181021 */ addu $v0, $t0, $t8
/* 002B8 80994898 805900BC */ lb $t9, 0x00BC($v0) ## 000000BC
/* 002BC 8099489C 2729FFFF */ addiu $t1, $t9, 0xFFFF ## $t1 = FFFFFFFF
/* 002C0 809948A0 A04900BC */ sb $t1, 0x00BC($v0) ## 000000BC
/* 002C4 809948A4 8605001C */ lh $a1, 0x001C($s0) ## 0000001C
/* 002C8 809948A8 0C00B2DD */ jal Flags_SetSwitch
/* 002CC 809948AC 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000
/* 002D0 809948B0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 002D4 809948B4 0C00BE0A */ jal Audio_PlayActorSound2
/* 002D8 809948B8 2405287C */ addiu $a1, $zero, 0x287C ## $a1 = 0000287C
/* 002DC 809948BC 10000027 */ beq $zero, $zero, .L8099495C
/* 002E0 809948C0 8FBF001C */ lw $ra, 0x001C($sp)
.L809948C4:
/* 002E4 809948C4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 002E8 809948C8 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000000
/* 002EC 809948CC 0C2651D4 */ jal func_80994750
/* 002F0 809948D0 AFA6002C */ sw $a2, 0x002C($sp)
/* 002F4 809948D4 8FA6002C */ lw $a2, 0x002C($sp)
/* 002F8 809948D8 1040001F */ beq $v0, $zero, .L80994958
/* 002FC 809948DC 00403825 */ or $a3, $v0, $zero ## $a3 = 00000000
/* 00300 809948E0 3C088016 */ lui $t0, %hi(gSaveContext)
/* 00304 809948E4 2508E660 */ addiu $t0, %lo(gSaveContext)
/* 00308 809948E8 950A1402 */ lhu $t2, 0x1402($t0) ## 8015FA62
/* 0030C 809948EC 8CC31C44 */ lw $v1, 0x1C44($a2) ## 00001C44
/* 00310 809948F0 240DFDFD */ addiu $t5, $zero, 0xFDFD ## $t5 = FFFFFDFD
/* 00314 809948F4 010A5821 */ addu $t3, $t0, $t2
/* 00318 809948F8 816C00BC */ lb $t4, 0x00BC($t3) ## 000000BC
/* 0031C 809948FC 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000
/* 00320 80994900 5D800004 */ bgtzl $t4, .L80994914
/* 00324 80994904 8605001C */ lh $a1, 0x001C($s0) ## 0000001C
/* 00328 80994908 10000013 */ beq $zero, $zero, .L80994958
/* 0032C 8099490C A46D0690 */ sh $t5, 0x0690($v1) ## 00000690
/* 00330 80994910 8605001C */ lh $a1, 0x001C($s0) ## 0000001C
.L80994914:
/* 00334 80994914 AFA70024 */ sw $a3, 0x0024($sp)
/* 00338 80994918 AFA30020 */ sw $v1, 0x0020($sp)
/* 0033C 8099491C 00052A03 */ sra $a1, $a1, 8
/* 00340 80994920 0C00B35B */ jal Flags_GetCollectible
/* 00344 80994924 30A5001F */ andi $a1, $a1, 0x001F ## $a1 = 00000000
/* 00348 80994928 8FA30020 */ lw $v1, 0x0020($sp)
/* 0034C 8099492C 14400004 */ bne $v0, $zero, .L80994940
/* 00350 80994930 8FA70024 */ lw $a3, 0x0024($sp)
/* 00354 80994934 240EFDDB */ addiu $t6, $zero, 0xFDDB ## $t6 = FFFFFDDB
/* 00358 80994938 10000007 */ beq $zero, $zero, .L80994958
/* 0035C 8099493C A46E0690 */ sh $t6, 0x0690($v1) ## 00000690
.L80994940:
/* 00360 80994940 240F0002 */ addiu $t7, $zero, 0x0002 ## $t7 = 00000002
/* 00364 80994944 2418000A */ addiu $t8, $zero, 0x000A ## $t8 = 0000000A
/* 00368 80994948 A06F042C */ sb $t7, 0x042C($v1) ## 0000042C
/* 0036C 8099494C A067042D */ sb $a3, 0x042D($v1) ## 0000042D
/* 00370 80994950 AC700430 */ sw $s0, 0x0430($v1) ## 00000430
/* 00374 80994954 A478042E */ sh $t8, 0x042E($v1) ## 0000042E
.L80994958:
/* 00378 80994958 8FBF001C */ lw $ra, 0x001C($sp)
.L8099495C:
/* 0037C 8099495C 8FB00018 */ lw $s0, 0x0018($sp)
/* 00380 80994960 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000
/* 00384 80994964 03E00008 */ jr $ra
/* 00388 80994968 00000000 */ nop

View file

@ -1,28 +0,0 @@
glabel func_8099496C
/* 0038C 8099496C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00390 80994970 AFBF0014 */ sw $ra, 0x0014($sp)
/* 00394 80994974 AFA5001C */ sw $a1, 0x001C($sp)
/* 00398 80994978 90820166 */ lbu $v0, 0x0166($a0) ## 00000166
/* 0039C 8099497C 24052814 */ addiu $a1, $zero, 0x2814 ## $a1 = 00002814
/* 003A0 80994980 14400003 */ bne $v0, $zero, .L80994990
/* 003A4 80994984 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF
/* 003A8 80994988 10000003 */ beq $zero, $zero, .L80994998
/* 003AC 8099498C 00001825 */ or $v1, $zero, $zero ## $v1 = 00000000
.L80994990:
/* 003B0 80994990 A08E0166 */ sb $t6, 0x0166($a0) ## 00000166
/* 003B4 80994994 31C300FF */ andi $v1, $t6, 0x00FF ## $v1 = 000000FF
.L80994998:
/* 003B8 80994998 54600008 */ bnel $v1, $zero, .L809949BC
/* 003BC 8099499C 8FBF0014 */ lw $ra, 0x0014($sp)
/* 003C0 809949A0 0C00BE0A */ jal Audio_PlayActorSound2
/* 003C4 809949A4 AFA40018 */ sw $a0, 0x0018($sp)
/* 003C8 809949A8 8FA40018 */ lw $a0, 0x0018($sp)
/* 003CC 809949AC 3C0F8099 */ lui $t7, %hi(func_809949C8) ## $t7 = 80990000
/* 003D0 809949B0 25EF49C8 */ addiu $t7, $t7, %lo(func_809949C8) ## $t7 = 809949C8
/* 003D4 809949B4 AC8F0168 */ sw $t7, 0x0168($a0) ## 00000168
/* 003D8 809949B8 8FBF0014 */ lw $ra, 0x0014($sp)
.L809949BC:
/* 003DC 809949BC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 003E0 809949C0 03E00008 */ jr $ra
/* 003E4 809949C4 00000000 */ nop

View file

@ -1,26 +0,0 @@
glabel func_809949C8
/* 003E8 809949C8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 003EC 809949CC AFBF0014 */ sw $ra, 0x0014($sp)
/* 003F0 809949D0 AFA5001C */ sw $a1, 0x001C($sp)
/* 003F4 809949D4 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000
/* 003F8 809949D8 AFA70018 */ sw $a3, 0x0018($sp)
/* 003FC 809949DC 24840060 */ addiu $a0, $a0, 0x0060 ## $a0 = 00000060
/* 00400 809949E0 3C054170 */ lui $a1, 0x4170 ## $a1 = 41700000
/* 00404 809949E4 0C01DE80 */ jal Math_ApproxF
/* 00408 809949E8 3C064040 */ lui $a2, 0x4040 ## $a2 = 40400000
/* 0040C 809949EC 8FA70018 */ lw $a3, 0x0018($sp)
/* 00410 809949F0 3C014348 */ lui $at, 0x4348 ## $at = 43480000
/* 00414 809949F4 44813000 */ mtc1 $at, $f6 ## $f6 = 200.00
/* 00418 809949F8 C4E4000C */ lwc1 $f4, 0x000C($a3) ## 0000000C
/* 0041C 809949FC 24E40028 */ addiu $a0, $a3, 0x0028 ## $a0 = 00000028
/* 00420 80994A00 8CE60060 */ lw $a2, 0x0060($a3) ## 00000060
/* 00424 80994A04 46062200 */ add.s $f8, $f4, $f6
/* 00428 80994A08 44054000 */ mfc1 $a1, $f8
/* 0042C 80994A0C 0C01DE80 */ jal Math_ApproxF
/* 00430 80994A10 00000000 */ nop
/* 00434 80994A14 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00438 80994A18 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 0043C 80994A1C 03E00008 */ jr $ra
/* 00440 80994A20 00000000 */ nop

View file

@ -1,20 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .data
.balign 16
glabel Door_Gerudo_InitVars
.word 0x01720700, 0x00000000, 0x014B0000, 0x0000016C
.word DoorGerudo_Init
.word DoorGerudo_Destroy
.word DoorGerudo_Update
.word DoorGerudo_Draw
glabel D_80994B70
.word 0x40500001, 0x00000000, 0x00000000, 0x00000000

View file

@ -1,13 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .rodata
.balign 16
glabel D_80994BD0
.incbin "baserom/ovl_Door_Gerudo", 0x5F0, 0x00000080

View file

@ -244,7 +244,11 @@ typedef struct Player {
/* 0x03B0 */ Vec3f unk_3B0; // related to links hands
/* 0x03BC */ char unk_3BC[0x00C];
/* 0x03C8 */ Vec3f unk_3C8;
/* 0x03D4 */ char unk_3D4[0x060];
/* 0x03D4 */ char unk_3D4[0x058];
/* 0x042C */ s8 unk_42C;
/* 0x042D */ s8 unk_42D;
/* 0x042E */ s16 unk_42E;
/* 0x0430 */ Actor* unk_430;
/* 0x0434 */ u8 getItemId;
/* 0x0435 */ char unk_435[0x001];
/* 0x0436 */ u16 getItemDirection;
@ -279,7 +283,7 @@ typedef struct Player {
/* 0x0684 */ Actor* unk_684;
/* 0x0688 */ char unk_688[0x004];
/* 0x068C */ Actor* navi;
/* 0x0690 */ u16 naviMessageId;
/* 0x0690 */ s16 naviMessageId;
/* 0x0692 */ u8 unk_692;
/* 0x0693 */ s8 exchangeItemId;
/* 0x0694 */ Actor* naviTargetActor;

3
spec
View file

@ -1683,8 +1683,7 @@ endseg
beginseg
name "ovl_Door_Gerudo"
include "build/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.o"
include "build/data/overlays/actors/z_door_gerudo.data.o"
include "build/data/overlays/actors/z_door_gerudo.reloc.o"
include "build/src/overlays/actors/ovl_Door_Gerudo/ovl_Door_Gerudo_reloc.o"
endseg
beginseg

View file

@ -15,7 +15,11 @@ void DoorGerudo_Destroy(Actor* thisx, GlobalContext* globalCtx);
void DoorGerudo_Update(Actor* thisx, GlobalContext* globalCtx);
void DoorGerudo_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
void func_8099485C(DoorGerudo* this, GlobalContext* globalCtx);
s32 func_80994750(DoorGerudo* this, GlobalContext* globalCtx);
void func_8099496C(DoorGerudo* this, GlobalContext* globalCtx);
void func_809949C8(DoorGerudo* this, GlobalContext* globalCtx);
const ActorInit Door_Gerudo_InitVars = {
ACTOR_DOOR_GERUDO,
ACTORTYPE_ITEMACTION,
@ -27,21 +31,139 @@ const ActorInit Door_Gerudo_InitVars = {
(ActorFunc)DoorGerudo_Update,
(ActorFunc)DoorGerudo_Draw,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Gerudo/DoorGerudo_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Gerudo/DoorGerudo_Destroy.s")
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F(scale, 1, ICHAIN_STOP),
};
extern Gfx D_06000040[];
extern UNK_TYPE D_06000170;
extern UNK_TYPE D_80994B70;
void DoorGerudo_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
DoorGerudo* this = THIS;
s32 localC = 0;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyInfo_Alloc(&D_06000170, &localC);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, localC);
if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) {
this->actionFunc = func_8099485C;
thisx->posRot.pos.y = thisx->initPosRot.pos.y + 200.0f;
} else {
this->actionFunc = func_8099485C;
this->unk_166 = 10;
}
}
void DoorGerudo_Destroy(Actor* thisx, GlobalContext* globalCtx) {
DoorGerudo* this = THIS;
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
}
f32 func_809946BC(GlobalContext* globalCtx, DoorGerudo* this, f32 arg2, f32 arg3, f32 arg4) {
Player* player = PLAYER;
Vec3f playerPos;
Vec3f sp1C;
playerPos.x = player->actor.posRot.pos.x;
playerPos.y = player->actor.posRot.pos.y + arg2;
playerPos.z = player->actor.posRot.pos.z;
func_8002DBD0(&this->dyna.actor, &sp1C, &playerPos);
if ((arg3 < fabsf(sp1C.x)) || (arg4 < fabsf(sp1C.y))) {
return FLT_MAX;
} else {
return sp1C.z;
}
}
s32 func_80994750(DoorGerudo* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
f32 temp_f0;
s16 rotYDiff;
if (!func_8008E988(globalCtx)) {
temp_f0 = func_809946BC(globalCtx, this, 0.0f, 20.0f, 15.0f);
if (fabsf(temp_f0) < 40.0f) {
rotYDiff = player->actor.shape.rot.y - this->dyna.actor.shape.rot.y;
if (temp_f0 > 0.0f) {
rotYDiff = 0x8000 - rotYDiff;
}
if (ABS(rotYDiff) < 0x2000) {
return (temp_f0 >= 0.0f) ? 1.0f : -1.0f;
}
}
}
return 0;
}
void func_8099485C(DoorGerudo* this, GlobalContext* globalCtx) {
s32 temp_v0;
Player* player;
if (this->unk_164 != 0) {
this->actionFunc = func_8099496C;
gSaveContext.dungeonKeys[gSaveContext.mapIndex] -= 1;
Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
} else {
temp_v0 = func_80994750(this, globalCtx);
if (temp_v0 != 0) {
player = PLAYER;
if (gSaveContext.dungeonKeys[gSaveContext.mapIndex] <= 0) {
player->naviMessageId = -0x203;
} else if (!Flags_GetCollectible(globalCtx, (this->dyna.actor.params >> 8) & 0x1F)) {
player->naviMessageId = -0x225;
} else {
player->unk_42C = 2;
player->unk_42D = temp_v0;
player->unk_430 = &this->dyna.actor;
player->unk_42E = 10;
}
}
}
}
void func_8099496C(DoorGerudo* this, GlobalContext* globalCtx) {
if (DECR(this->unk_166) == 0) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
this->actionFunc = func_809949C8;
}
}
void func_809949C8(DoorGerudo* this, GlobalContext* globalCtx) {
Math_ApproxF(&this->dyna.actor.velocity.y, 15.0f, 3.0f);
Math_ApproxF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 200.0f,
this->dyna.actor.velocity.y);
}
void DoorGerudo_Update(Actor* thisx, GlobalContext* globalCtx) {
DoorGerudo* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Gerudo/func_809946BC.s")
this->actionFunc(this, globalCtx);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Gerudo/func_80994750.s")
void DoorGerudo_Draw(Actor* thisx, GlobalContext* globalCtx) {
DoorGerudo* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Gerudo/func_8099485C.s")
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* dispRefs[4];
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Gerudo/func_8099496C.s")
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_door_gerudo.c", 361);
func_80093D18(globalCtx->state.gfxCtx);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Gerudo/func_809949C8.s")
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_door_gerudo.c", 365),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, D_06000040);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Gerudo/DoorGerudo_Update.s")
if (this->unk_166 != 0) {
Matrix_Scale(0.01f, 0.01f, 0.025f, MTXMODE_APPLY);
func_80033F54(globalCtx, this->unk_166, 0);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Gerudo/DoorGerudo_Draw.s")
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_door_gerudo.c", 377);
}

View file

@ -6,9 +6,13 @@
struct DoorGerudo;
typedef void (*DoorGerudoActionFunc)(struct DoorGerudo*, GlobalContext*);
typedef struct DoorGerudo {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x20];
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ s16 unk_164;
/* 0x0166 */ u8 unk_166;
/* 0x0168 */ DoorGerudoActionFunc actionFunc;
} DoorGerudo; // size = 0x016C
extern const ActorInit Door_Gerudo_InitVars;