Decomp BgYdanHasi (#263)

* Decomp BgYdanHasi

* PR fixes.

* More PR fixes

* FIx issue with missing Extern
This commit is contained in:
louist103 2020-07-18 23:06:26 -04:00 committed by GitHub
parent 83d08078c3
commit 66e9475b25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 193 additions and 580 deletions

View File

@ -1,14 +0,0 @@
glabel BgYdanHasi_Destroy
/* 00160 808BE660 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00164 808BE664 AFA40018 */ sw $a0, 0x0018($sp)
/* 00168 808BE668 8FAE0018 */ lw $t6, 0x0018($sp)
/* 0016C 808BE66C AFBF0014 */ sw $ra, 0x0014($sp)
/* 00170 808BE670 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 00174 808BE674 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810
/* 00178 808BE678 0C00FB56 */ jal DynaPolyInfo_Free
## DynaPolyInfo_delReserve
/* 0017C 808BE67C 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C
/* 00180 808BE680 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00184 808BE684 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00188 808BE688 03E00008 */ jr $ra
/* 0018C 808BE68C 00000000 */ nop

View File

@ -1,111 +0,0 @@
.rdata
glabel D_808BEC30
.asciz "../z_bg_ydan_hasi.c"
.balign 4
glabel D_808BEC44
.asciz "../z_bg_ydan_hasi.c"
.balign 4
glabel D_808BEC58
.asciz "../z_bg_ydan_hasi.c"
.balign 4
.text
glabel BgYdanHasi_Draw
/* 00590 808BEA90 27BDFF98 */ addiu $sp, $sp, 0xFF98 ## $sp = FFFFFF98
/* 00594 808BEA94 AFBF003C */ sw $ra, 0x003C($sp)
/* 00598 808BEA98 AFB10038 */ sw $s1, 0x0038($sp)
/* 0059C 808BEA9C AFB00034 */ sw $s0, 0x0034($sp)
/* 005A0 808BEAA0 8482001C */ lh $v0, 0x001C($a0) ## 0000001C
/* 005A4 808BEAA4 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000
/* 005A8 808BEAA8 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002
/* 005AC 808BEAAC 10400003 */ beq $v0, $zero, .L808BEABC
/* 005B0 808BEAB0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000
/* 005B4 808BEAB4 14410008 */ bne $v0, $at, .L808BEAD8
/* 005B8 808BEAB8 3C06808C */ lui $a2, %hi(D_808BEC30) ## $a2 = 808C0000
.L808BEABC:
/* 005BC 808BEABC 00027080 */ sll $t6, $v0, 2
/* 005C0 808BEAC0 3C05808C */ lui $a1, %hi(D_808BEC24) ## $a1 = 808C0000
/* 005C4 808BEAC4 00AE2821 */ addu $a1, $a1, $t6
/* 005C8 808BEAC8 0C00D498 */ jal Gfx_DrawDListOpa
/* 005CC 808BEACC 8CA5EC24 */ lw $a1, %lo(D_808BEC24)($a1)
/* 005D0 808BEAD0 10000044 */ beq $zero, $zero, .L808BEBE4
/* 005D4 808BEAD4 8FBF003C */ lw $ra, 0x003C($sp)
.L808BEAD8:
/* 005D8 808BEAD8 8E250000 */ lw $a1, 0x0000($s1) ## 00000000
/* 005DC 808BEADC 27A40050 */ addiu $a0, $sp, 0x0050 ## $a0 = FFFFFFE8
/* 005E0 808BEAE0 24C6EC30 */ addiu $a2, $a2, %lo(D_808BEC30) ## $a2 = FFFFEC30
/* 005E4 808BEAE4 24070241 */ addiu $a3, $zero, 0x0241 ## $a3 = 00000241
/* 005E8 808BEAE8 0C031AB1 */ jal Graph_OpenDisps
/* 005EC 808BEAEC 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000
/* 005F0 808BEAF0 0C024F61 */ jal func_80093D84
/* 005F4 808BEAF4 8E240000 */ lw $a0, 0x0000($s1) ## 00000000
/* 005F8 808BEAF8 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0
/* 005FC 808BEAFC 3C18DB06 */ lui $t8, 0xDB06 ## $t8 = DB060000
/* 00600 808BEB00 37180020 */ ori $t8, $t8, 0x0020 ## $t8 = DB060020
/* 00604 808BEB04 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 00000008
/* 00608 808BEB08 AE0F02D0 */ sw $t7, 0x02D0($s0) ## 000002D0
/* 0060C 808BEB0C 3C030001 */ lui $v1, 0x0001 ## $v1 = 00010000
/* 00610 808BEB10 00711821 */ addu $v1, $v1, $s1
/* 00614 808BEB14 AC580000 */ sw $t8, 0x0000($v0) ## 00000000
/* 00618 808BEB18 8C631DE4 */ lw $v1, 0x1DE4($v1) ## 00011DE4
/* 0061C 808BEB1C 8E240000 */ lw $a0, 0x0000($s1) ## 00000000
/* 00620 808BEB20 24190020 */ addiu $t9, $zero, 0x0020 ## $t9 = 00000020
/* 00624 808BEB24 24090020 */ addiu $t1, $zero, 0x0020 ## $t1 = 00000020
/* 00628 808BEB28 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001
/* 0062C 808BEB2C 240B0020 */ addiu $t3, $zero, 0x0020 ## $t3 = 00000020
/* 00630 808BEB30 240C0020 */ addiu $t4, $zero, 0x0020 ## $t4 = 00000020
/* 00634 808BEB34 00033023 */ subu $a2, $zero, $v1
/* 00638 808BEB38 3067007F */ andi $a3, $v1, 0x007F ## $a3 = 00000000
/* 0063C 808BEB3C AFA7001C */ sw $a3, 0x001C($sp)
/* 00640 808BEB40 AFA70020 */ sw $a3, 0x0020($sp)
/* 00644 808BEB44 30C6007F */ andi $a2, $a2, 0x007F ## $a2 = 00000000
/* 00648 808BEB48 AFAC0028 */ sw $t4, 0x0028($sp)
/* 0064C 808BEB4C AFAB0024 */ sw $t3, 0x0024($sp)
/* 00650 808BEB50 AFAA0018 */ sw $t2, 0x0018($sp)
/* 00654 808BEB54 AFA90014 */ sw $t1, 0x0014($sp)
/* 00658 808BEB58 AFB90010 */ sw $t9, 0x0010($sp)
/* 0065C 808BEB5C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000
/* 00660 808BEB60 0C0253D0 */ jal Gfx_TwoTexScroll
/* 00664 808BEB64 AFA2004C */ sw $v0, 0x004C($sp)
/* 00668 808BEB68 8FA8004C */ lw $t0, 0x004C($sp)
/* 0066C 808BEB6C 3C0EDA38 */ lui $t6, 0xDA38 ## $t6 = DA380000
/* 00670 808BEB70 35CE0003 */ ori $t6, $t6, 0x0003 ## $t6 = DA380003
/* 00674 808BEB74 AD020004 */ sw $v0, 0x0004($t0) ## 00000004
/* 00678 808BEB78 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0
/* 0067C 808BEB7C 3C05808C */ lui $a1, %hi(D_808BEC44) ## $a1 = 808C0000
/* 00680 808BEB80 24A5EC44 */ addiu $a1, $a1, %lo(D_808BEC44) ## $a1 = 808BEC44
/* 00684 808BEB84 244D0008 */ addiu $t5, $v0, 0x0008 ## $t5 = 00000008
/* 00688 808BEB88 AE0D02D0 */ sw $t5, 0x02D0($s0) ## 000002D0
/* 0068C 808BEB8C AC4E0000 */ sw $t6, 0x0000($v0) ## 00000000
/* 00690 808BEB90 8E240000 */ lw $a0, 0x0000($s1) ## 00000000
/* 00694 808BEB94 24060250 */ addiu $a2, $zero, 0x0250 ## $a2 = 00000250
/* 00698 808BEB98 0C0346A2 */ jal Matrix_NewMtx
/* 0069C 808BEB9C AFA20048 */ sw $v0, 0x0048($sp)
/* 006A0 808BEBA0 8FA30048 */ lw $v1, 0x0048($sp)
/* 006A4 808BEBA4 3C190600 */ lui $t9, 0x0600 ## $t9 = 06000000
/* 006A8 808BEBA8 27395DE0 */ addiu $t9, $t9, 0x5DE0 ## $t9 = 06005DE0
/* 006AC 808BEBAC AC620004 */ sw $v0, 0x0004($v1) ## 00000004
/* 006B0 808BEBB0 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0
/* 006B4 808BEBB4 3C18DE00 */ lui $t8, 0xDE00 ## $t8 = DE000000
/* 006B8 808BEBB8 3C06808C */ lui $a2, %hi(D_808BEC58) ## $a2 = 808C0000
/* 006BC 808BEBBC 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 00000008
/* 006C0 808BEBC0 AE0F02D0 */ sw $t7, 0x02D0($s0) ## 000002D0
/* 006C4 808BEBC4 AC590004 */ sw $t9, 0x0004($v0) ## 00000004
/* 006C8 808BEBC8 AC580000 */ sw $t8, 0x0000($v0) ## 00000000
/* 006CC 808BEBCC 8E250000 */ lw $a1, 0x0000($s1) ## 00000000
/* 006D0 808BEBD0 24C6EC58 */ addiu $a2, $a2, %lo(D_808BEC58) ## $a2 = 808BEC58
/* 006D4 808BEBD4 27A40050 */ addiu $a0, $sp, 0x0050 ## $a0 = FFFFFFE8
/* 006D8 808BEBD8 0C031AD5 */ jal Graph_CloseDisps
/* 006DC 808BEBDC 24070255 */ addiu $a3, $zero, 0x0255 ## $a3 = 00000255
/* 006E0 808BEBE0 8FBF003C */ lw $ra, 0x003C($sp)
.L808BEBE4:
/* 006E4 808BEBE4 8FB00034 */ lw $s0, 0x0034($sp)
/* 006E8 808BEBE8 8FB10038 */ lw $s1, 0x0038($sp)
/* 006EC 808BEBEC 03E00008 */ jr $ra
/* 006F0 808BEBF0 27BD0068 */ addiu $sp, $sp, 0x0068 ## $sp = 00000000
/* 006F4 808BEBF4 00000000 */ nop
/* 006F8 808BEBF8 00000000 */ nop
/* 006FC 808BEBFC 00000000 */ nop

View File

@ -1,104 +0,0 @@
.late_rodata
glabel D_808BEC6C
.float 0.15
.text
glabel BgYdanHasi_Init
/* 00000 808BE500 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8
/* 00004 808BE504 AFA5003C */ sw $a1, 0x003C($sp)
/* 00008 808BE508 AFBF001C */ sw $ra, 0x001C($sp)
/* 0000C 808BE50C AFB00018 */ sw $s0, 0x0018($sp)
/* 00010 808BE510 3C05808C */ lui $a1, %hi(D_808BEC20) ## $a1 = 808C0000
/* 00014 808BE514 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00018 808BE518 AFA0002C */ sw $zero, 0x002C($sp)
/* 0001C 808BE51C 0C01E037 */ jal Actor_ProcessInitChain
/* 00020 808BE520 24A5EC20 */ addiu $a1, $a1, %lo(D_808BEC20) ## $a1 = 808BEC20
/* 00024 808BE524 860E001C */ lh $t6, 0x001C($s0) ## 0000001C
/* 00028 808BE528 8619001C */ lh $t9, 0x001C($s0) ## 0000001C
/* 0002C 808BE52C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00030 808BE530 000E7A03 */ sra $t7, $t6, 8
/* 00034 808BE534 31F8003F */ andi $t8, $t7, 0x003F ## $t8 = 00000000
/* 00038 808BE538 332800FF */ andi $t0, $t9, 0x00FF ## $t0 = 00000000
/* 0003C 808BE53C A2180168 */ sb $t8, 0x0168($s0) ## 00000168
/* 00040 808BE540 A608001C */ sh $t0, 0x001C($s0) ## 0000001C
/* 00044 808BE544 8FA9003C */ lw $t1, 0x003C($sp)
/* 00048 808BE548 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001
/* 0004C 808BE54C 8D2A07C0 */ lw $t2, 0x07C0($t1) ## 000007C0
/* 00050 808BE550 8D4B0028 */ lw $t3, 0x0028($t2) ## 00000028
/* 00054 808BE554 256C0010 */ addiu $t4, $t3, 0x0010 ## $t4 = 00000010
/* 00058 808BE558 0C010D20 */ jal DynaPolyInfo_SetActorMove
/* 0005C 808BE55C AFAC0028 */ sw $t4, 0x0028($sp)
/* 00060 808BE560 8602001C */ lh $v0, 0x001C($s0) ## 0000001C
/* 00064 808BE564 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001
/* 00068 808BE568 14410010 */ bne $v0, $at, .L808BE5AC
/* 0006C 808BE56C 3C01C0A0 */ lui $at, 0xC0A0 ## $at = C0A00000
/* 00070 808BE570 44813000 */ mtc1 $at, $f6 ## $f6 = -5.00
/* 00074 808BE574 C604000C */ lwc1 $f4, 0x000C($s0) ## 0000000C
/* 00078 808BE578 3C18808C */ lui $t8, %hi(func_808BE7C8) ## $t8 = 808C0000
/* 0007C 808BE57C 2718E7C8 */ addiu $t8, $t8, %lo(func_808BE7C8) ## $t8 = 808BE7C8
/* 00080 808BE580 46062200 */ add.s $f8, $f4, $f6
/* 00084 808BE584 E608000C */ swc1 $f8, 0x000C($s0) ## 0000000C
/* 00088 808BE588 C600000C */ lwc1 $f0, 0x000C($s0) ## 0000000C
/* 0008C 808BE58C 4600028D */ trunc.w.s $f10, $f0
/* 00090 808BE590 E6000028 */ swc1 $f0, 0x0028($s0) ## 00000028
/* 00094 808BE594 8FAF0028 */ lw $t7, 0x0028($sp)
/* 00098 808BE598 440E5000 */ mfc1 $t6, $f10
/* 0009C 808BE59C 00000000 */ nop
/* 000A0 808BE5A0 A5EE0002 */ sh $t6, 0x0002($t7) ## 00000002
/* 000A4 808BE5A4 10000028 */ beq $zero, $zero, .L808BE648
/* 000A8 808BE5A8 AE180164 */ sw $t8, 0x0164($s0) ## 00000164
.L808BE5AC:
/* 000AC 808BE5AC 14400016 */ bne $v0, $zero, .L808BE608
/* 000B0 808BE5B0 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000
/* 000B4 808BE5B4 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000
/* 000B8 808BE5B8 24847798 */ addiu $a0, $a0, 0x7798 ## $a0 = 06007798
/* 000BC 808BE5BC 0C010620 */ jal DynaPolyInfo_Alloc
/* 000C0 808BE5C0 27A5002C */ addiu $a1, $sp, 0x002C ## $a1 = FFFFFFF4
/* 000C4 808BE5C4 3C01808C */ lui $at, %hi(D_808BEC6C) ## $at = 808C0000
/* 000C8 808BE5C8 C420EC6C */ lwc1 $f0, %lo(D_808BEC6C)($at)
/* 000CC 808BE5CC 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000
/* 000D0 808BE5D0 44812000 */ mtc1 $at, $f4 ## $f4 = 20.00
/* 000D4 808BE5D4 E6000058 */ swc1 $f0, 0x0058($s0) ## 00000058
/* 000D8 808BE5D8 E6000050 */ swc1 $f0, 0x0050($s0) ## 00000050
/* 000DC 808BE5DC 8FB90028 */ lw $t9, 0x0028($sp)
/* 000E0 808BE5E0 3C09808C */ lui $t1, %hi(func_808BE690) ## $t1 = 808C0000
/* 000E4 808BE5E4 2529E690 */ addiu $t1, $t1, %lo(func_808BE690) ## $t1 = 808BE690
/* 000E8 808BE5E8 87280002 */ lh $t0, 0x0002($t9) ## 00000002
/* 000EC 808BE5EC AE090164 */ sw $t1, 0x0164($s0) ## 00000164
/* 000F0 808BE5F0 44888000 */ mtc1 $t0, $f16 ## $f16 = 0.00
/* 000F4 808BE5F4 00000000 */ nop
/* 000F8 808BE5F8 468084A0 */ cvt.s.w $f18, $f16
/* 000FC 808BE5FC 46049180 */ add.s $f6, $f18, $f4
/* 00100 808BE600 1000000B */ beq $zero, $zero, .L808BE630
/* 00104 808BE604 E6060028 */ swc1 $f6, 0x0028($s0) ## 00000028
.L808BE608:
/* 00108 808BE608 24845780 */ addiu $a0, $a0, 0x5780 ## $a0 = 00005780
/* 0010C 808BE60C 0C010620 */ jal DynaPolyInfo_Alloc
/* 00110 808BE610 27A5002C */ addiu $a1, $sp, 0x002C ## $a1 = FFFFFFF4
/* 00114 808BE614 3C0A808C */ lui $t2, %hi(func_808BE930) ## $t2 = 808C0000
/* 00118 808BE618 254AE930 */ addiu $t2, $t2, %lo(func_808BE930) ## $t2 = 808BE930
/* 0011C 808BE61C AE000134 */ sw $zero, 0x0134($s0) ## 00000134
/* 00120 808BE620 AE0A0164 */ sw $t2, 0x0164($s0) ## 00000164
/* 00124 808BE624 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00128 808BE628 0C00B56E */ jal Actor_SetHeight
/* 0012C 808BE62C 3C054220 */ lui $a1, 0x4220 ## $a1 = 42200000
.L808BE630:
/* 00130 808BE630 8FA4003C */ lw $a0, 0x003C($sp)
/* 00134 808BE634 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000
/* 00138 808BE638 8FA7002C */ lw $a3, 0x002C($sp)
/* 0013C 808BE63C 0C00FA9D */ jal DynaPolyInfo_RegisterActor
## DynaPolyInfo_setActor
/* 00140 808BE640 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810
/* 00144 808BE644 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C
.L808BE648:
/* 00148 808BE648 A600016A */ sh $zero, 0x016A($s0) ## 0000016A
/* 0014C 808BE64C 8FBF001C */ lw $ra, 0x001C($sp)
/* 00150 808BE650 8FB00018 */ lw $s0, 0x0018($sp)
/* 00154 808BE654 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000
/* 00158 808BE658 03E00008 */ jr $ra
/* 0015C 808BE65C 00000000 */ nop

View File

@ -1,10 +0,0 @@
glabel BgYdanHasi_Update
/* 0056C 808BEA6C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00570 808BEA70 AFBF0014 */ sw $ra, 0x0014($sp)
/* 00574 808BEA74 8C990164 */ lw $t9, 0x0164($a0) ## 00000164
/* 00578 808BEA78 0320F809 */ jalr $ra, $t9
/* 0057C 808BEA7C 00000000 */ nop
/* 00580 808BEA80 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00584 808BEA84 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00588 808BEA88 03E00008 */ jr $ra
/* 0058C 808BEA8C 00000000 */ nop

View File

@ -1,93 +0,0 @@
.late_rodata
glabel D_808BEC70
.word 0x3CC90FDB
glabel D_808BEC74
.word 0x3E00ADFD, 0x00000000, 0x00000000
.text
glabel func_808BE690
/* 00190 808BE690 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8
/* 00194 808BE694 3C0F0001 */ lui $t7, 0x0001 ## $t7 = 00010000
/* 00198 808BE698 AFBF001C */ sw $ra, 0x001C($sp)
/* 0019C 808BE69C AFB00018 */ sw $s0, 0x0018($sp)
/* 001A0 808BE6A0 AFA5002C */ sw $a1, 0x002C($sp)
/* 001A4 808BE6A4 01E57821 */ addu $t7, $t7, $a1
/* 001A8 808BE6A8 8DEF1DE4 */ lw $t7, 0x1DE4($t7) ## 00011DE4
/* 001AC 808BE6AC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 001B0 808BE6B0 3C014F80 */ lui $at, 0x4F80 ## $at = 4F800000
/* 001B4 808BE6B4 31F800FF */ andi $t8, $t7, 0x00FF ## $t8 = 00000000
/* 001B8 808BE6B8 44982000 */ mtc1 $t8, $f4 ## $f4 = 0.00
/* 001BC 808BE6BC 07010004 */ bgez $t8, .L808BE6D0
/* 001C0 808BE6C0 468021A0 */ cvt.s.w $f6, $f4
/* 001C4 808BE6C4 44814000 */ mtc1 $at, $f8 ## $f8 = 4294967296.00
/* 001C8 808BE6C8 00000000 */ nop
/* 001CC 808BE6CC 46083180 */ add.s $f6, $f6, $f8
.L808BE6D0:
/* 001D0 808BE6D0 3C01808C */ lui $at, %hi(D_808BEC70) ## $at = 808C0000
/* 001D4 808BE6D4 C42AEC70 */ lwc1 $f10, %lo(D_808BEC70)($at)
/* 001D8 808BE6D8 460A3302 */ mul.s $f12, $f6, $f10
/* 001DC 808BE6DC 0C0400A4 */ jal sinf
/* 001E0 808BE6E0 00000000 */ nop
/* 001E4 808BE6E4 3C014325 */ lui $at, 0x4325 ## $at = 43250000
/* 001E8 808BE6E8 44818000 */ mtc1 $at, $f16 ## $f16 = 165.00
/* 001EC 808BE6EC 00000000 */ nop
/* 001F0 808BE6F0 46100482 */ mul.s $f18, $f0, $f16
/* 001F4 808BE6F4 E7B20020 */ swc1 $f18, 0x0020($sp)
/* 001F8 808BE6F8 0C01DE1C */ jal Math_Sins
## sins?
/* 001FC 808BE6FC 86040032 */ lh $a0, 0x0032($s0) ## 00000032
/* 00200 808BE700 C7A40020 */ lwc1 $f4, 0x0020($sp)
/* 00204 808BE704 C6060008 */ lwc1 $f6, 0x0008($s0) ## 00000008
/* 00208 808BE708 86040032 */ lh $a0, 0x0032($s0) ## 00000032
/* 0020C 808BE70C 46040202 */ mul.s $f8, $f0, $f4
/* 00210 808BE710 46064280 */ add.s $f10, $f8, $f6
/* 00214 808BE714 0C01DE0D */ jal Math_Coss
## coss?
/* 00218 808BE718 E60A0024 */ swc1 $f10, 0x0024($s0) ## 00000024
/* 0021C 808BE71C C7B00020 */ lwc1 $f16, 0x0020($sp)
/* 00220 808BE720 C6040010 */ lwc1 $f4, 0x0010($s0) ## 00000010
/* 00224 808BE724 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000
/* 00228 808BE728 46100482 */ mul.s $f18, $f0, $f16
/* 0022C 808BE72C 44818000 */ mtc1 $at, $f16 ## $f16 = 20.00
/* 00230 808BE730 8602016A */ lh $v0, 0x016A($s0) ## 0000016A
/* 00234 808BE734 240B0032 */ addiu $t3, $zero, 0x0032 ## $t3 = 00000032
/* 00238 808BE738 244AFFFF */ addiu $t2, $v0, 0xFFFF ## $t2 = FFFFFFFF
/* 0023C 808BE73C 46049200 */ add.s $f8, $f18, $f4
/* 00240 808BE740 E608002C */ swc1 $f8, 0x002C($s0) ## 0000002C
/* 00244 808BE744 8FB9002C */ lw $t9, 0x002C($sp)
/* 00248 808BE748 8F2807C0 */ lw $t0, 0x07C0($t9) ## 000007C0
/* 0024C 808BE74C 8D030028 */ lw $v1, 0x0028($t0) ## 00000028
/* 00250 808BE750 84690012 */ lh $t1, 0x0012($v1) ## 00000012
/* 00254 808BE754 24630010 */ addiu $v1, $v1, 0x0010 ## $v1 = 00000010
/* 00258 808BE758 44893000 */ mtc1 $t1, $f6 ## $f6 = 0.00
/* 0025C 808BE75C 00000000 */ nop
/* 00260 808BE760 468032A0 */ cvt.s.w $f10, $f6
/* 00264 808BE764 46105480 */ add.s $f18, $f10, $f16
/* 00268 808BE768 10400003 */ beq $v0, $zero, .L808BE778
/* 0026C 808BE76C E6120028 */ swc1 $f18, 0x0028($s0) ## 00000028
/* 00270 808BE770 A60A016A */ sh $t2, 0x016A($s0) ## 0000016A
/* 00274 808BE774 8602016A */ lh $v0, 0x016A($s0) ## 0000016A
.L808BE778:
/* 00278 808BE778 54400004 */ bnel $v0, $zero, .L808BE78C
/* 0027C 808BE77C 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00
/* 00280 808BE780 A60B016A */ sh $t3, 0x016A($s0) ## 0000016A
/* 00284 808BE784 8602016A */ lh $v0, 0x016A($s0) ## 0000016A
/* 00288 808BE788 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00
.L808BE78C:
/* 0028C 808BE78C 3C01808C */ lui $at, %hi(D_808BEC74) ## $at = 808C0000
/* 00290 808BE790 C426EC74 */ lwc1 $f6, %lo(D_808BEC74)($at)
/* 00294 808BE794 46802220 */ cvt.s.w $f8, $f4
/* 00298 808BE798 46064302 */ mul.s $f12, $f8, $f6
/* 0029C 808BE79C 0C0400A4 */ jal sinf
/* 002A0 808BE7A0 00000000 */ nop
/* 002A4 808BE7A4 46000400 */ add.s $f16, $f0, $f0
/* 002A8 808BE7A8 C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028
/* 002AC 808BE7AC 46105480 */ add.s $f18, $f10, $f16
/* 002B0 808BE7B0 E6120028 */ swc1 $f18, 0x0028($s0) ## 00000028
/* 002B4 808BE7B4 8FBF001C */ lw $ra, 0x001C($sp)
/* 002B8 808BE7B8 8FB00018 */ lw $s0, 0x0018($sp)
/* 002BC 808BE7BC 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000
/* 002C0 808BE7C0 03E00008 */ jr $ra
/* 002C4 808BE7C4 00000000 */ nop

View File

@ -1,21 +0,0 @@
glabel func_808BE7C8
/* 002C8 808BE7C8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 002CC 808BE7CC 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000
/* 002D0 808BE7D0 AFBF0014 */ sw $ra, 0x0014($sp)
/* 002D4 808BE7D4 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 002D8 808BE7D8 90C50168 */ lbu $a1, 0x0168($a2) ## 00000168
/* 002DC 808BE7DC 0C00B2D0 */ jal Flags_GetSwitch
/* 002E0 808BE7E0 AFA60018 */ sw $a2, 0x0018($sp)
/* 002E4 808BE7E4 10400006 */ beq $v0, $zero, .L808BE800
/* 002E8 808BE7E8 8FA60018 */ lw $a2, 0x0018($sp)
/* 002EC 808BE7EC 3C0F808C */ lui $t7, %hi(func_808BE810) ## $t7 = 808C0000
/* 002F0 808BE7F0 240E0258 */ addiu $t6, $zero, 0x0258 ## $t6 = 00000258
/* 002F4 808BE7F4 25EFE810 */ addiu $t7, $t7, %lo(func_808BE810) ## $t7 = 808BE810
/* 002F8 808BE7F8 A4CE016A */ sh $t6, 0x016A($a2) ## 0000016A
/* 002FC 808BE7FC ACCF0164 */ sw $t7, 0x0164($a2) ## 00000164
.L808BE800:
/* 00300 808BE800 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00304 808BE804 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00308 808BE808 03E00008 */ jr $ra
/* 0030C 808BE80C 00000000 */ nop

View File

@ -1,59 +0,0 @@
glabel func_808BE810
/* 00310 808BE810 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 00314 808BE814 AFBF001C */ sw $ra, 0x001C($sp)
/* 00318 808BE818 AFB00018 */ sw $s0, 0x0018($sp)
/* 0031C 808BE81C AFA50024 */ sw $a1, 0x0024($sp)
/* 00320 808BE820 848E016A */ lh $t6, 0x016A($a0) ## 0000016A
/* 00324 808BE824 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00328 808BE828 24840028 */ addiu $a0, $a0, 0x0028 ## $a0 = 00000028
/* 0032C 808BE82C 15C00010 */ bne $t6, $zero, .L808BE870
/* 00330 808BE830 3C01423C */ lui $at, 0x423C ## $at = 423C0000
/* 00334 808BE834 8E05000C */ lw $a1, 0x000C($s0) ## 0000000C
/* 00338 808BE838 0C01DE80 */ jal Math_ApproxF
/* 0033C 808BE83C 3C063F80 */ lui $a2, 0x3F80 ## $a2 = 3F800000
/* 00340 808BE840 10400006 */ beq $v0, $zero, .L808BE85C
/* 00344 808BE844 8FA40024 */ lw $a0, 0x0024($sp)
/* 00348 808BE848 0C00B2ED */ jal Flags_UnsetSwitch
/* 0034C 808BE84C 92050168 */ lbu $a1, 0x0168($s0) ## 00000168
/* 00350 808BE850 3C0F808C */ lui $t7, %hi(func_808BE7C8) ## $t7 = 808C0000
/* 00354 808BE854 25EFE7C8 */ addiu $t7, $t7, %lo(func_808BE7C8) ## $t7 = 808BE7C8
/* 00358 808BE858 AE0F0164 */ sw $t7, 0x0164($s0) ## 00000164
.L808BE85C:
/* 0035C 808BE85C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00360 808BE860 0C00BE52 */ jal func_8002F948
/* 00364 808BE864 2405205E */ addiu $a1, $zero, 0x205E ## $a1 = 0000205E
/* 00368 808BE868 10000011 */ beq $zero, $zero, .L808BE8B0
/* 0036C 808BE86C C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028
.L808BE870:
/* 00370 808BE870 C604000C */ lwc1 $f4, 0x000C($s0) ## 0000000C
/* 00374 808BE874 44813000 */ mtc1 $at, $f6 ## $f6 = 0.00
/* 00378 808BE878 26040028 */ addiu $a0, $s0, 0x0028 ## $a0 = 00000028
/* 0037C 808BE87C 3C063F00 */ lui $a2, 0x3F00 ## $a2 = 3F000000
/* 00380 808BE880 46062201 */ sub.s $f8, $f4, $f6
/* 00384 808BE884 44054000 */ mfc1 $a1, $f8
/* 00388 808BE888 0C01DE80 */ jal Math_ApproxF
/* 0038C 808BE88C 00000000 */ nop
/* 00390 808BE890 10400004 */ beq $v0, $zero, .L808BE8A4
/* 00394 808BE894 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00398 808BE898 3C18808C */ lui $t8, %hi(func_808BE8DC) ## $t8 = 808C0000
/* 0039C 808BE89C 2718E8DC */ addiu $t8, $t8, %lo(func_808BE8DC) ## $t8 = 808BE8DC
/* 003A0 808BE8A0 AE180164 */ sw $t8, 0x0164($s0) ## 00000164
.L808BE8A4:
/* 003A4 808BE8A4 0C00BE52 */ jal func_8002F948
/* 003A8 808BE8A8 2405205E */ addiu $a1, $zero, 0x205E ## $a1 = 0000205E
/* 003AC 808BE8AC C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028
.L808BE8B0:
/* 003B0 808BE8B0 8FB90024 */ lw $t9, 0x0024($sp)
/* 003B4 808BE8B4 4600540D */ trunc.w.s $f16, $f10
/* 003B8 808BE8B8 8F2807C0 */ lw $t0, 0x07C0($t9) ## 000007C0
/* 003BC 808BE8BC 440A8000 */ mfc1 $t2, $f16
/* 003C0 808BE8C0 8D020028 */ lw $v0, 0x0028($t0) ## 00000028
/* 003C4 808BE8C4 A44A0012 */ sh $t2, 0x0012($v0) ## 00000012
/* 003C8 808BE8C8 8FBF001C */ lw $ra, 0x001C($sp)
/* 003CC 808BE8CC 8FB00018 */ lw $s0, 0x0018($sp)
/* 003D0 808BE8D0 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 003D4 808BE8D4 03E00008 */ jr $ra
/* 003D8 808BE8D8 24420010 */ addiu $v0, $v0, 0x0010 ## $v0 = 00000010

View File

@ -1,24 +0,0 @@
glabel func_808BE8DC
/* 003DC 808BE8DC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 003E0 808BE8E0 AFBF0014 */ sw $ra, 0x0014($sp)
/* 003E4 808BE8E4 AFA5001C */ sw $a1, 0x001C($sp)
/* 003E8 808BE8E8 8485016A */ lh $a1, 0x016A($a0) ## 0000016A
/* 003EC 808BE8EC 10A00003 */ beq $a1, $zero, .L808BE8FC
/* 003F0 808BE8F0 24AEFFFF */ addiu $t6, $a1, 0xFFFF ## $t6 = FFFFFFFF
/* 003F4 808BE8F4 A48E016A */ sh $t6, 0x016A($a0) ## 0000016A
/* 003F8 808BE8F8 8485016A */ lh $a1, 0x016A($a0) ## 0000016A
.L808BE8FC:
/* 003FC 808BE8FC 0C00BE65 */ jal func_8002F994
/* 00400 808BE900 AFA40018 */ sw $a0, 0x0018($sp)
/* 00404 808BE904 8FA40018 */ lw $a0, 0x0018($sp)
/* 00408 808BE908 3C18808C */ lui $t8, %hi(func_808BE810) ## $t8 = 808C0000
/* 0040C 808BE90C 2718E810 */ addiu $t8, $t8, %lo(func_808BE810) ## $t8 = 808BE810
/* 00410 808BE910 848F016A */ lh $t7, 0x016A($a0) ## 0000016A
/* 00414 808BE914 55E00003 */ bnel $t7, $zero, .L808BE924
/* 00418 808BE918 8FBF0014 */ lw $ra, 0x0014($sp)
/* 0041C 808BE91C AC980164 */ sw $t8, 0x0164($a0) ## 00000164
/* 00420 808BE920 8FBF0014 */ lw $ra, 0x0014($sp)
.L808BE924:
/* 00424 808BE924 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00428 808BE928 03E00008 */ jr $ra
/* 0042C 808BE92C 00000000 */ nop

View File

@ -1,30 +0,0 @@
glabel func_808BE930
/* 00430 808BE930 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 00434 808BE934 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000
/* 00438 808BE938 AFBF001C */ sw $ra, 0x001C($sp)
/* 0043C 808BE93C AFA50024 */ sw $a1, 0x0024($sp)
/* 00440 808BE940 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 00444 808BE944 90E50168 */ lbu $a1, 0x0168($a3) ## 00000168
/* 00448 808BE948 0C00B2D0 */ jal Flags_GetSwitch
/* 0044C 808BE94C AFA70020 */ sw $a3, 0x0020($sp)
/* 00450 808BE950 1040000E */ beq $v0, $zero, .L808BE98C
/* 00454 808BE954 8FA70020 */ lw $a3, 0x0020($sp)
/* 00458 808BE958 3C0F808C */ lui $t7, %hi(BgYdanHasi_Draw) ## $t7 = 808C0000
/* 0045C 808BE95C 3C18808C */ lui $t8, %hi(func_808BE99C) ## $t8 = 808C0000
/* 00460 808BE960 240E0104 */ addiu $t6, $zero, 0x0104 ## $t6 = 00000104
/* 00464 808BE964 25EFEA90 */ addiu $t7, $t7, %lo(BgYdanHasi_Draw) ## $t7 = 808BEA90
/* 00468 808BE968 2718E99C */ addiu $t8, $t8, %lo(func_808BE99C) ## $t8 = 808BE99C
/* 0046C 808BE96C A4EE016A */ sh $t6, 0x016A($a3) ## 0000016A
/* 00470 808BE970 ACEF0134 */ sw $t7, 0x0134($a3) ## 00000134
/* 00474 808BE974 ACF80164 */ sw $t8, 0x0164($a3) ## 00000164
/* 00478 808BE978 AFA00010 */ sw $zero, 0x0010($sp)
/* 0047C 808BE97C 8FA40024 */ lw $a0, 0x0024($sp)
/* 00480 808BE980 24050BE0 */ addiu $a1, $zero, 0x0BE0 ## $a1 = 00000BE0
/* 00484 808BE984 0C02003E */ jal func_800800F8
/* 00488 808BE988 2406001E */ addiu $a2, $zero, 0x001E ## $a2 = 0000001E
.L808BE98C:
/* 0048C 808BE98C 8FBF001C */ lw $ra, 0x001C($sp)
/* 00490 808BE990 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 00494 808BE994 03E00008 */ jr $ra
/* 00498 808BE998 00000000 */ nop

View File

@ -1,62 +0,0 @@
glabel func_808BE99C
/* 0049C 808BE99C 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 004A0 808BE9A0 AFBF001C */ sw $ra, 0x001C($sp)
/* 004A4 808BE9A4 AFB00018 */ sw $s0, 0x0018($sp)
/* 004A8 808BE9A8 AFA50024 */ sw $a1, 0x0024($sp)
/* 004AC 808BE9AC 8482016A */ lh $v0, 0x016A($a0) ## 0000016A
/* 004B0 808BE9B0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 004B4 808BE9B4 3C0142F0 */ lui $at, 0x42F0 ## $at = 42F00000
/* 004B8 808BE9B8 10400003 */ beq $v0, $zero, .L808BE9C8
/* 004BC 808BE9BC 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF
/* 004C0 808BE9C0 A48E016A */ sh $t6, 0x016A($a0) ## 0000016A
/* 004C4 808BE9C4 8482016A */ lh $v0, 0x016A($a0) ## 0000016A
.L808BE9C8:
/* 004C8 808BE9C8 14400012 */ bne $v0, $zero, .L808BEA14
/* 004CC 808BE9CC 26040028 */ addiu $a0, $s0, 0x0028 ## $a0 = 00000028
/* 004D0 808BE9D0 8E05000C */ lw $a1, 0x000C($s0) ## 0000000C
/* 004D4 808BE9D4 0C01DE80 */ jal Math_ApproxF
/* 004D8 808BE9D8 3C064040 */ lui $a2, 0x4040 ## $a2 = 40400000
/* 004DC 808BE9DC 10400009 */ beq $v0, $zero, .L808BEA04
/* 004E0 808BE9E0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 004E4 808BE9E4 8FA40024 */ lw $a0, 0x0024($sp)
/* 004E8 808BE9E8 0C00B2ED */ jal Flags_UnsetSwitch
/* 004EC 808BE9EC 92050168 */ lbu $a1, 0x0168($s0) ## 00000168
/* 004F0 808BE9F0 3C0F808C */ lui $t7, %hi(func_808BE930) ## $t7 = 808C0000
/* 004F4 808BE9F4 25EFE930 */ addiu $t7, $t7, %lo(func_808BE930) ## $t7 = 808BE930
/* 004F8 808BE9F8 AE000134 */ sw $zero, 0x0134($s0) ## 00000134
/* 004FC 808BE9FC 10000016 */ beq $zero, $zero, .L808BEA58
/* 00500 808BEA00 AE0F0164 */ sw $t7, 0x0164($s0) ## 00000164
.L808BEA04:
/* 00504 808BEA04 0C00BE52 */ jal func_8002F948
/* 00508 808BEA08 24052024 */ addiu $a1, $zero, 0x2024 ## $a1 = 00002024
/* 0050C 808BEA0C 10000013 */ beq $zero, $zero, .L808BEA5C
/* 00510 808BEA10 8FBF001C */ lw $ra, 0x001C($sp)
.L808BEA14:
/* 00514 808BEA14 C604000C */ lwc1 $f4, 0x000C($s0) ## 0000000C
/* 00518 808BEA18 44813000 */ mtc1 $at, $f6 ## $f6 = 0.00
/* 0051C 808BEA1C 26040028 */ addiu $a0, $s0, 0x0028 ## $a0 = 00000028
/* 00520 808BEA20 3C064040 */ lui $a2, 0x4040 ## $a2 = 40400000
/* 00524 808BEA24 46062200 */ add.s $f8, $f4, $f6
/* 00528 808BEA28 44054000 */ mfc1 $a1, $f8
/* 0052C 808BEA2C 0C01DE80 */ jal Math_ApproxF
/* 00530 808BEA30 00000000 */ nop
/* 00534 808BEA34 14400006 */ bne $v0, $zero, .L808BEA50
/* 00538 808BEA38 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 0053C 808BEA3C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00540 808BEA40 0C00BE52 */ jal func_8002F948
/* 00544 808BEA44 24052024 */ addiu $a1, $zero, 0x2024 ## $a1 = 00002024
/* 00548 808BEA48 10000004 */ beq $zero, $zero, .L808BEA5C
/* 0054C 808BEA4C 8FBF001C */ lw $ra, 0x001C($sp)
.L808BEA50:
/* 00550 808BEA50 0C00BE65 */ jal func_8002F994
/* 00554 808BEA54 8605016A */ lh $a1, 0x016A($s0) ## 0000016A
.L808BEA58:
/* 00558 808BEA58 8FBF001C */ lw $ra, 0x001C($sp)
.L808BEA5C:
/* 0055C 808BEA5C 8FB00018 */ lw $s0, 0x0018($sp)
/* 00560 808BEA60 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 00564 808BEA64 03E00008 */ jr $ra
/* 00568 808BEA68 00000000 */ nop

View File

@ -1,22 +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 Bg_Ydan_Hasi_InitVars
.word 0x00500100, 0x00000030, 0x00360000, 0x0000016C
.word BgYdanHasi_Init
.word BgYdanHasi_Destroy
.word BgYdanHasi_Update
.word BgYdanHasi_Draw
glabel D_808BEC20
.word 0x48500064
glabel D_808BEC24
.word 0x06007508, 0x06005DE0, 0x06005018

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_808BEC80
.incbin "baserom/ovl_Bg_Ydan_Hasi", 0x780, 0x000000C0

View File

@ -25,4 +25,4 @@ echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \;
echo "Done formatting all files."
echo "Done formatting all files."

3
spec
View File

@ -1452,8 +1452,7 @@ endseg
beginseg
name "ovl_Bg_Ydan_Hasi"
include "build/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.o"
include "build/data/overlays/actors/z_bg_ydan_hasi.data.o"
include "build/data/overlays/actors/z_bg_ydan_hasi.reloc.o"
include "build/src/overlays/actors/ovl_Bg_Ydan_Hasi/ovl_Bg_Ydan_Hasi_reloc.o"
endseg
beginseg

View File

@ -1,3 +1,8 @@
/*
* File: z_bg_ydan_hasi.c
* Overlay: ovl_Bg_Ydan_Hasi
* Description: Deku Tree Puzzle elements. Water plane and floating block in B1, and 3 blocks on 2F
*/
#include "z_bg_ydan_hasi.h"
#define FLAGS 0x00000030
@ -9,7 +14,13 @@ void BgYdanHasi_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgYdanHasi_Update(Actor* thisx, GlobalContext* globalCtx);
void BgYdanHasi_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
void BgYdanHasi_InitWater(BgYdanHasi* this, GlobalContext* globalCtx);
void BgYdanHasi_UpdateFloatingBlock(BgYdanHasi* this, GlobalContext* globalCtx);
void BgYdanHasi_SetupThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx);
WaterBox* BgYdanHasi_MoveWater(BgYdanHasi* this, GlobalContext* globalCtx);
void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, GlobalContext* globalCtx);
void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx);
const ActorInit Bg_Ydan_Hasi_InitVars = {
ACTOR_BG_YDAN_HASI,
ACTORTYPE_BG,
@ -21,23 +32,179 @@ const ActorInit Bg_Ydan_Hasi_InitVars = {
(ActorFunc)BgYdanHasi_Update,
(ActorFunc)BgYdanHasi_Draw,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/BgYdanHasi_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/BgYdanHasi_Destroy.s")
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/func_808BE690.s")
Gfx* D_808BEC24[] = { 0x06007508, 0x06005DE0, 0x06005018 };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/func_808BE7C8.s")
extern UNK_TYPE D_06005780;
extern UNK_TYPE D_06007798;
extern Gfx* D_06005DE0[];
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/func_808BE810.s")
void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad1;
BgYdanHasi* this = THIS;
s32 localConst;
WaterBox* waterBox;
s32 pad2;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/func_808BE8DC.s")
localConst = 0;
Actor_ProcessInitChain(thisx, sInitChain);
this->unk_168 = ((thisx->params >> 8) & 0x3F);
thisx->params = thisx->params & 0xFF;
waterBox = globalCtx->colCtx.stat.colHeader->waterBoxes + 0x1;
DynaPolyInfo_SetActorMove(&this->dyna, 1);
if (thisx->params == 1) {
// Water the moving platform floats on in B1. Never runs in Master Quest
thisx->initPosRot.pos.y = (thisx->initPosRot.pos.y + -5.0f);
thisx->posRot.pos.y = thisx->initPosRot.pos.y;
waterBox->unk_02 = thisx->initPosRot.pos.y;
this->actionFunc = BgYdanHasi_InitWater;
} else {
if (thisx->params == 0) {
// Moving platform on the water in B1
DynaPolyInfo_Alloc(&D_06007798, &localConst);
thisx->scale.z = 0.15f;
thisx->scale.x = 0.15f;
thisx->posRot.pos.y = (waterBox->unk_02 + 20.0f);
this->actionFunc = BgYdanHasi_UpdateFloatingBlock;
} else {
// 3 platforms on 2F
DynaPolyInfo_Alloc(&D_06005780, &localConst);
thisx->draw = NULL;
this->actionFunc = BgYdanHasi_SetupThreeBlocks;
Actor_SetHeight(thisx, 40.0f);
}
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, localConst);
}
this->timer = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/func_808BE930.s")
void BgYdanHasi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgYdanHasi* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/func_808BE99C.s")
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/BgYdanHasi_Update.s")
void BgYdanHasi_UpdateFloatingBlock(BgYdanHasi* this, GlobalContext* globalCtx) {
s32 pad;
f32 framesAfterMath;
f32 posOffset;
WaterBox* waterBox;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Hasi/BgYdanHasi_Draw.s")
framesAfterMath = sinf((globalCtx->gameplayFrames & 0xFF) * 0.024543693f) * 165.0f;
this->dyna.actor.posRot.pos.x =
((Math_Sins(this->dyna.actor.posRot.rot.y) * framesAfterMath) + this->dyna.actor.initPosRot.pos.x);
this->dyna.actor.posRot.pos.z =
((Math_Coss(this->dyna.actor.posRot.rot.y) * framesAfterMath) + this->dyna.actor.initPosRot.pos.z);
waterBox = &globalCtx->colCtx.stat.colHeader->waterBoxes[1];
this->dyna.actor.posRot.pos.y = waterBox->unk_02 + 20.0f;
if (this->timer != 0) {
this->timer--;
}
if (this->timer == 0) {
this->timer = 50;
}
posOffset = sinf(this->timer * 0.12566371f);
this->dyna.actor.posRot.pos.y = (this->dyna.actor.posRot.pos.y + (posOffset + posOffset));
}
void BgYdanHasi_InitWater(BgYdanHasi* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->unk_168)) {
this->timer = 600;
this->actionFunc = BgYdanHasi_MoveWater;
}
}
WaterBox* BgYdanHasi_MoveWater(BgYdanHasi* this, GlobalContext* globalCtx) {
WaterBox* waterBox;
if (this->timer == 0) {
if (Math_ApproxF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 1.0f) != 0) {
Flags_UnsetSwitch(globalCtx, this->unk_168);
this->actionFunc = BgYdanHasi_InitWater;
}
func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
} else {
if (Math_ApproxF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 47.0f, 0.5f)) {
this->actionFunc = BgYdanHasi_DecWaterTimer;
}
func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
}
waterBox = globalCtx->colCtx.stat.colHeader->waterBoxes;
globalCtx->colCtx.stat.colHeader->waterBoxes[1].unk_02 = this->dyna.actor.posRot.pos.y;
if (1) {}
return waterBox + 0x1;
}
void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, GlobalContext* globalCtx) {
if (this->timer != 0) {
this->timer--;
}
func_8002F994(&this->dyna.actor, this->timer);
if (this->timer == 0) {
this->actionFunc = BgYdanHasi_MoveWater;
}
}
void BgYdanHasi_SetupThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->unk_168) != 0) {
this->timer = 260;
this->dyna.actor.draw = BgYdanHasi_Draw;
this->actionFunc = BgYdanHasi_UpdateThreeBlocks;
func_800800F8(globalCtx, 0xBE0, 0x1E, &this->dyna.actor, 0);
}
}
void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx) {
s32 pad;
if (this->timer != 0) {
this->timer--;
}
if (this->timer == 0) {
if (Math_ApproxF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 3.0f) != 0) {
Flags_UnsetSwitch(globalCtx, this->unk_168);
this->dyna.actor.draw = NULL;
this->actionFunc = BgYdanHasi_SetupThreeBlocks;
return;
}
func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG);
return;
}
if (Math_ApproxF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 120.0f, 3.0f) == 0) {
func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG);
return;
}
func_8002F994(&this->dyna.actor, this->timer);
}
void BgYdanHasi_Update(Actor* thisx, GlobalContext* globalCtx) {
BgYdanHasi* this = THIS;
this->actionFunc(this, globalCtx);
}
void BgYdanHasi_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgYdanHasi* this = THIS;
GraphicsContext* gfxCtx;
Gfx* dispRefs[4];
if (this->dyna.actor.params == 0 || this->dyna.actor.params == 2) {
Gfx_DrawDListOpa(globalCtx, D_808BEC24[this->dyna.actor.params]);
return;
}
gfxCtx = globalCtx->state.gfxCtx;
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_ydan_hasi.c", 577);
func_80093D84(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (0 - globalCtx->gameplayFrames & 0x7F),
globalCtx->gameplayFrames & 0x7F, 0x20, 0x20, 1, globalCtx->gameplayFrames & 0x7F,
globalCtx->gameplayFrames & 0x7F, 0x20, 0x20));
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ydan_hasi.c", 592),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_06005DE0);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_ydan_hasi.c", 597);
}

View File

@ -6,9 +6,14 @@
struct BgYdanHasi;
typedef void (*BgYdanHasiActionFunc)(struct BgYdanHasi*, struct GlobalCtx*);
typedef struct BgYdanHasi {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x20];
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgYdanHasiActionFunc actionFunc;
/* 0x0168 */ u8 unk_168;
/* 0x0169 */ s8 unk_169; //Unused
/* 0x016A */ s16 timer; //Also used as an offset for the water blocks Y position for a "bobbing" effect
} BgYdanHasi; // size = 0x016C
extern const ActorInit Bg_Ydan_Hasi_InitVars;

View File

@ -229,6 +229,11 @@ D_060074EC = 0x060074EC;
D_060038FC = 0x060038FC;
D_06002590 = 0x06002590;
// z_bg_ydan_hasi
D_06005780 = 0x06005780;
D_06007798 = 0x06007798;
D_06005DE0 = 0x06005DE0;
// z_en_ma1
D_06000820 = 0x06000820;
D_06008460 = 0x06008460;