From eadf85f17c1b926cff145327bd36ee9ce5555a57 Mon Sep 17 00:00:00 2001 From: Zelllll <56516451+Zelllll@users.noreply.github.com> Date: Sat, 19 Dec 2020 03:59:35 -0600 Subject: [PATCH] Bg_Haka_Sgami OK (#532) * spinning scythe trap, 4/6 matching * fixed typo * Almost matched sgami init * Matched sgami Init * starting to clean up func_8087E858 * func_8087E858 half-way done * Scythe matched * update scythe * Removed asm files * Delete z_bg_haka_sgami.reloc.s * Update src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Update src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Update src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Update z_bg_haka_sgami.c Co-authored-by: Zelllll Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> --- .../ovl_Bg_Haka_Sgami/BgHakaSgami_Destroy.s | 26 -- .../ovl_Bg_Haka_Sgami/BgHakaSgami_Init.s | 182 --------- .../ovl_Bg_Haka_Sgami/BgHakaSgami_Update.s | 24 -- .../actors/ovl_Bg_Haka_Sgami/func_8087E7E4.s | 32 -- .../actors/ovl_Bg_Haka_Sgami/func_8087E858.s | 351 ------------------ .../actors/ovl_Bg_Haka_Sgami/func_8087EDC0.s | 39 -- data/overlays/actors/z_bg_haka_sgami.data.s | 66 ---- data/overlays/actors/z_bg_haka_sgami.reloc.s | 13 - spec | 3 +- .../ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c | 240 +++++++++++- .../ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h | 8 +- undefined_syms.txt | 1 + 12 files changed, 236 insertions(+), 749 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E7E4.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E858.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087EDC0.s delete mode 100644 data/overlays/actors/z_bg_haka_sgami.data.s delete mode 100644 data/overlays/actors/z_bg_haka_sgami.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Destroy.s deleted file mode 100644 index 28593ddff7..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Destroy.s +++ /dev/null @@ -1,26 +0,0 @@ -glabel BgHakaSgami_Destroy -/* 002A4 8087E784 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 002A8 8087E788 AFA40018 */ sw $a0, 0x0018($sp) -/* 002AC 8087E78C 8FAE0018 */ lw $t6, 0x0018($sp) -/* 002B0 8087E790 AFBF0014 */ sw $ra, 0x0014($sp) -/* 002B4 8087E794 AFA5001C */ sw $a1, 0x001C($sp) -/* 002B8 8087E798 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 002BC 8087E79C 0C009C27 */ jal Effect_Delete -/* 002C0 8087E7A0 8DC50154 */ lw $a1, 0x0154($t6) ## 00000154 -/* 002C4 8087E7A4 8FAF0018 */ lw $t7, 0x0018($sp) -/* 002C8 8087E7A8 8FA4001C */ lw $a0, 0x001C($sp) -/* 002CC 8087E7AC 0C009C27 */ jal Effect_Delete -/* 002D0 8087E7B0 8DE50158 */ lw $a1, 0x0158($t7) ## 00000158 -/* 002D4 8087E7B4 8FA50018 */ lw $a1, 0x0018($sp) -/* 002D8 8087E7B8 8FA4001C */ lw $a0, 0x001C($sp) -/* 002DC 8087E7BC 0C017232 */ jal Collider_DestroyTris -/* 002E0 8087E7C0 24A501A8 */ addiu $a1, $a1, 0x01A8 ## $a1 = 000001A8 -/* 002E4 8087E7C4 8FA50018 */ lw $a1, 0x0018($sp) -/* 002E8 8087E7C8 8FA4001C */ lw $a0, 0x001C($sp) -/* 002EC 8087E7CC 0C0170EB */ jal Collider_DestroyCylinder - -/* 002F0 8087E7D0 24A5015C */ addiu $a1, $a1, 0x015C ## $a1 = 0000015C -/* 002F4 8087E7D4 8FBF0014 */ lw $ra, 0x0014($sp) -/* 002F8 8087E7D8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 002FC 8087E7DC 03E00008 */ jr $ra -/* 00300 8087E7E0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Init.s deleted file mode 100644 index 3c2c88e3bb..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Init.s +++ /dev/null @@ -1,182 +0,0 @@ -glabel BgHakaSgami_Init -/* 00000 8087E4E0 27BDFE28 */ addiu $sp, $sp, 0xFE28 ## $sp = FFFFFE28 -/* 00004 8087E4E4 AFB10020 */ sw $s1, 0x0020($sp) -/* 00008 8087E4E8 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 0000C 8087E4EC AFBF0024 */ sw $ra, 0x0024($sp) -/* 00010 8087E4F0 AFB0001C */ sw $s0, 0x001C($sp) -/* 00014 8087E4F4 3C058088 */ lui $a1, %hi(D_8087EF94) ## $a1 = 80880000 -/* 00018 8087E4F8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0001C 8087E4FC 0C01E037 */ jal Actor_ProcessInitChain - -/* 00020 8087E500 24A5EF94 */ addiu $a1, $a1, %lo(D_8087EF94) ## $a1 = 8087EF94 -/* 00024 8087E504 860F001C */ lh $t7, 0x001C($s0) ## 0000001C -/* 00028 8087E508 8618001C */ lh $t8, 0x001C($s0) ## 0000001C -/* 0002C 8087E50C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00030 8087E510 A20F0151 */ sb $t7, 0x0151($s0) ## 00000151 -/* 00034 8087E514 82090151 */ lb $t1, 0x0151($s0) ## 00000151 -/* 00038 8087E518 0018CA03 */ sra $t9, $t8, 8 -/* 0003C 8087E51C 332800FF */ andi $t0, $t9, 0x00FF ## $t0 = 00000000 -/* 00040 8087E520 11200004 */ beq $t1, $zero, .L8087E534 -/* 00044 8087E524 A608001C */ sh $t0, 0x001C($s0) ## 0000001C -/* 00048 8087E528 8E0A0004 */ lw $t2, 0x0004($s0) ## 00000004 -/* 0004C 8087E52C 354B0080 */ ori $t3, $t2, 0x0080 ## $t3 = 00000080 -/* 00050 8087E530 AE0B0004 */ sw $t3, 0x0004($s0) ## 00000004 -.L8087E534: -/* 00054 8087E534 260501A8 */ addiu $a1, $s0, 0x01A8 ## $a1 = 000001A8 -/* 00058 8087E538 0C0171F8 */ jal Collider_InitTris -/* 0005C 8087E53C AFA50028 */ sw $a1, 0x0028($sp) -/* 00060 8087E540 3C078088 */ lui $a3, %hi(D_8087EF50) ## $a3 = 80880000 -/* 00064 8087E544 260C01C8 */ addiu $t4, $s0, 0x01C8 ## $t4 = 000001C8 -/* 00068 8087E548 8FA50028 */ lw $a1, 0x0028($sp) -/* 0006C 8087E54C AFAC0010 */ sw $t4, 0x0010($sp) -/* 00070 8087E550 24E7EF50 */ addiu $a3, $a3, %lo(D_8087EF50) ## $a3 = 8087EF50 -/* 00074 8087E554 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00078 8087E558 0C0172EB */ jal Collider_SetTris -/* 0007C 8087E55C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00080 8087E560 2605015C */ addiu $a1, $s0, 0x015C ## $a1 = 0000015C -/* 00084 8087E564 AFA50028 */ sw $a1, 0x0028($sp) -/* 00088 8087E568 0C0170D9 */ jal Collider_InitCylinder - -/* 0008C 8087E56C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00090 8087E570 3C078088 */ lui $a3, %hi(D_8087EF60) ## $a3 = 80880000 -/* 00094 8087E574 8FA50028 */ lw $a1, 0x0028($sp) -/* 00098 8087E578 24E7EF60 */ addiu $a3, $a3, %lo(D_8087EF60) ## $a3 = 8087EF60 -/* 0009C 8087E57C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 000A0 8087E580 0C01712B */ jal Collider_SetCylinder - -/* 000A4 8087E584 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 000A8 8087E588 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 000AC 8087E58C C6080028 */ lwc1 $f8, 0x0028($s0) ## 00000028 -/* 000B0 8087E590 C610002C */ lwc1 $f16, 0x002C($s0) ## 0000002C -/* 000B4 8087E594 4600218D */ trunc.w.s $f6, $f4 -/* 000B8 8087E598 3C068088 */ lui $a2, %hi(D_8087EF8C) ## $a2 = 80880000 -/* 000BC 8087E59C 24C6EF8C */ addiu $a2, $a2, %lo(D_8087EF8C) ## $a2 = 8087EF8C -/* 000C0 8087E5A0 4600428D */ trunc.w.s $f10, $f8 -/* 000C4 8087E5A4 440E3000 */ mfc1 $t6, $f6 -/* 000C8 8087E5A8 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 000CC 8087E5AC 4600848D */ trunc.w.s $f18, $f16 -/* 000D0 8087E5B0 44185000 */ mfc1 $t8, $f10 -/* 000D4 8087E5B4 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 000D8 8087E5B8 A60E01A2 */ sh $t6, 0x01A2($s0) ## 000001A2 -/* 000DC 8087E5BC 44089000 */ mfc1 $t0, $f18 -/* 000E0 8087E5C0 A61801A4 */ sh $t8, 0x01A4($s0) ## 000001A4 -/* 000E4 8087E5C4 0C0187B5 */ jal func_80061ED4 -/* 000E8 8087E5C8 A60801A6 */ sh $t0, 0x01A6($s0) ## 000001A6 -/* 000EC 8087E5CC 3C0D8088 */ lui $t5, %hi(D_8087EFA1) ## $t5 = 80880000 -/* 000F0 8087E5D0 3C0E8088 */ lui $t6, %hi(D_8087EFA5) ## $t6 = 80880000 -/* 000F4 8087E5D4 3C098088 */ lui $t1, %hi(D_8087EFA0) ## $t1 = 80880000 -/* 000F8 8087E5D8 3C0A8088 */ lui $t2, %hi(D_8087EFA4) ## $t2 = 80880000 -/* 000FC 8087E5DC 3C0B8088 */ lui $t3, %hi(D_8087EFA8) ## $t3 = 80880000 -/* 00100 8087E5E0 3C0C8088 */ lui $t4, %hi(D_8087EFAC) ## $t4 = 80880000 -/* 00104 8087E5E4 91CEEFA5 */ lbu $t6, %lo(D_8087EFA5)($t6) -/* 00108 8087E5E8 91ADEFA1 */ lbu $t5, %lo(D_8087EFA1)($t5) -/* 0010C 8087E5EC 9129EFA0 */ lbu $t1, %lo(D_8087EFA0)($t1) -/* 00110 8087E5F0 914AEFA4 */ lbu $t2, %lo(D_8087EFA4)($t2) -/* 00114 8087E5F4 916BEFA8 */ lbu $t3, %lo(D_8087EFA8)($t3) -/* 00118 8087E5F8 918CEFAC */ lbu $t4, %lo(D_8087EFAC)($t4) -/* 0011C 8087E5FC 3C0F8088 */ lui $t7, %hi(D_8087EFA9) ## $t7 = 80880000 -/* 00120 8087E600 3C188088 */ lui $t8, %hi(D_8087EFAD) ## $t8 = 80880000 -/* 00124 8087E604 3C198088 */ lui $t9, %hi(D_8087EFA2) ## $t9 = 80880000 -/* 00128 8087E608 9339EFA2 */ lbu $t9, %lo(D_8087EFA2)($t9) -/* 0012C 8087E60C 9318EFAD */ lbu $t8, %lo(D_8087EFAD)($t8) -/* 00130 8087E610 91EFEFA9 */ lbu $t7, %lo(D_8087EFA9)($t7) -/* 00134 8087E614 A3AE01BD */ sb $t6, 0x01BD($sp) -/* 00138 8087E618 A3AD01B9 */ sb $t5, 0x01B9($sp) -/* 0013C 8087E61C A3A901B8 */ sb $t1, 0x01B8($sp) -/* 00140 8087E620 A3AA01BC */ sb $t2, 0x01BC($sp) -/* 00144 8087E624 A3AB01C0 */ sb $t3, 0x01C0($sp) -/* 00148 8087E628 A3AC01C4 */ sb $t4, 0x01C4($sp) -/* 0014C 8087E62C 3C0C8088 */ lui $t4, %hi(D_8087EFA7) ## $t4 = 80880000 -/* 00150 8087E630 3C0B8088 */ lui $t3, %hi(D_8087EFA3) ## $t3 = 80880000 -/* 00154 8087E634 3C0A8088 */ lui $t2, %hi(D_8087EFAE) ## $t2 = 80880000 -/* 00158 8087E638 3C098088 */ lui $t1, %hi(D_8087EFAA) ## $t1 = 80880000 -/* 0015C 8087E63C 3C0D8088 */ lui $t5, %hi(D_8087EFAB) ## $t5 = 80880000 -/* 00160 8087E640 3C0E8088 */ lui $t6, %hi(D_8087EFAF) ## $t6 = 80880000 -/* 00164 8087E644 3C088088 */ lui $t0, %hi(D_8087EFA6) ## $t0 = 80880000 -/* 00168 8087E648 9108EFA6 */ lbu $t0, %lo(D_8087EFA6)($t0) -/* 0016C 8087E64C 91CEEFAF */ lbu $t6, %lo(D_8087EFAF)($t6) -/* 00170 8087E650 91ADEFAB */ lbu $t5, %lo(D_8087EFAB)($t5) -/* 00174 8087E654 9129EFAA */ lbu $t1, %lo(D_8087EFAA)($t1) -/* 00178 8087E658 914AEFAE */ lbu $t2, %lo(D_8087EFAE)($t2) -/* 0017C 8087E65C 916BEFA3 */ lbu $t3, %lo(D_8087EFA3)($t3) -/* 00180 8087E660 918CEFA7 */ lbu $t4, %lo(D_8087EFA7)($t4) -/* 00184 8087E664 A3B901BA */ sb $t9, 0x01BA($sp) -/* 00188 8087E668 A3B801C5 */ sb $t8, 0x01C5($sp) -/* 0018C 8087E66C A3AF01C1 */ sb $t7, 0x01C1($sp) -/* 00190 8087E670 240F000A */ addiu $t7, $zero, 0x000A ## $t7 = 0000000A -/* 00194 8087E674 24180002 */ addiu $t8, $zero, 0x0002 ## $t8 = 00000002 -/* 00198 8087E678 27B90034 */ addiu $t9, $sp, 0x0034 ## $t9 = FFFFFE5C -/* 0019C 8087E67C AFAF01C8 */ sw $t7, 0x01C8($sp) -/* 001A0 8087E680 AFA001CC */ sw $zero, 0x01CC($sp) -/* 001A4 8087E684 AFB801D0 */ sw $t8, 0x01D0($sp) -/* 001A8 8087E688 AFB90014 */ sw $t9, 0x0014($sp) -/* 001AC 8087E68C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 001B0 8087E690 26050154 */ addiu $a1, $s0, 0x0154 ## $a1 = 00000154 -/* 001B4 8087E694 24060001 */ addiu $a2, $zero, 0x0001 ## $a2 = 00000001 -/* 001B8 8087E698 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 001BC 8087E69C AFA00010 */ sw $zero, 0x0010($sp) -/* 001C0 8087E6A0 A3A801BE */ sb $t0, 0x01BE($sp) -/* 001C4 8087E6A4 A3AE01C7 */ sb $t6, 0x01C7($sp) -/* 001C8 8087E6A8 A3AD01C3 */ sb $t5, 0x01C3($sp) -/* 001CC 8087E6AC A3A901C2 */ sb $t1, 0x01C2($sp) -/* 001D0 8087E6B0 A3AA01C6 */ sb $t2, 0x01C6($sp) -/* 001D4 8087E6B4 A3AB01BB */ sb $t3, 0x01BB($sp) -/* 001D8 8087E6B8 0C009B35 */ jal Effect_Add ## Effect_Add -/* 001DC 8087E6BC A3AC01BF */ sb $t4, 0x01BF($sp) -/* 001E0 8087E6C0 27A80034 */ addiu $t0, $sp, 0x0034 ## $t0 = FFFFFE5C -/* 001E4 8087E6C4 AFA80014 */ sw $t0, 0x0014($sp) -/* 001E8 8087E6C8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 001EC 8087E6CC 26050158 */ addiu $a1, $s0, 0x0158 ## $a1 = 00000158 -/* 001F0 8087E6D0 24060001 */ addiu $a2, $zero, 0x0001 ## $a2 = 00000001 -/* 001F4 8087E6D4 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 001F8 8087E6D8 0C009B35 */ jal Effect_Add ## Effect_Add -/* 001FC 8087E6DC AFA00010 */ sw $zero, 0x0010($sp) -/* 00200 8087E6E0 8609001C */ lh $t1, 0x001C($s0) ## 0000001C -/* 00204 8087E6E4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00208 8087E6E8 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 0020C 8087E6EC 1520000C */ bne $t1, $zero, .L8087E720 -/* 00210 8087E6F0 02212021 */ addu $a0, $s1, $at -/* 00214 8087E6F4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00218 8087E6F8 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 0021C 8087E6FC 02212021 */ addu $a0, $s1, $at -/* 00220 8087E700 0C02604B */ jal Object_GetIndex - ## ObjectIndex -/* 00224 8087E704 24050069 */ addiu $a1, $zero, 0x0069 ## $a1 = 00000069 -/* 00228 8087E708 8E0A0004 */ lw $t2, 0x0004($s0) ## 00000004 -/* 0022C 8087E70C 2401FFFE */ addiu $at, $zero, 0xFFFE ## $at = FFFFFFFE -/* 00230 8087E710 A2020150 */ sb $v0, 0x0150($s0) ## 00000150 -/* 00234 8087E714 01415824 */ and $t3, $t2, $at -/* 00238 8087E718 1000000B */ beq $zero, $zero, .L8087E748 -/* 0023C 8087E71C AE0B0004 */ sw $t3, 0x0004($s0) ## 00000004 -.L8087E720: -/* 00240 8087E720 0C02604B */ jal Object_GetIndex - ## ObjectIndex -/* 00244 8087E724 2405006B */ addiu $a1, $zero, 0x006B ## $a1 = 0000006B -/* 00248 8087E728 240C001E */ addiu $t4, $zero, 0x001E ## $t4 = 0000001E -/* 0024C 8087E72C 240D0046 */ addiu $t5, $zero, 0x0046 ## $t5 = 00000046 -/* 00250 8087E730 A2020150 */ sb $v0, 0x0150($s0) ## 00000150 -/* 00254 8087E734 A60C019C */ sh $t4, 0x019C($s0) ## 0000019C -/* 00258 8087E738 A60D019E */ sh $t5, 0x019E($s0) ## 0000019E -/* 0025C 8087E73C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00260 8087E740 0C00B56E */ jal Actor_SetHeight - -/* 00264 8087E744 3C054220 */ lui $a1, 0x4220 ## $a1 = 42200000 -.L8087E748: -/* 00268 8087E748 820E0150 */ lb $t6, 0x0150($s0) ## 00000150 -/* 0026C 8087E74C 3C0F8088 */ lui $t7, %hi(func_8087E7E4) ## $t7 = 80880000 -/* 00270 8087E750 25EFE7E4 */ addiu $t7, $t7, %lo(func_8087E7E4) ## $t7 = 8087E7E4 -/* 00274 8087E754 05C30006 */ bgezl $t6, .L8087E770 -/* 00278 8087E758 AE0F014C */ sw $t7, 0x014C($s0) ## 0000014C -/* 0027C 8087E75C 0C00B55C */ jal Actor_Kill - -/* 00280 8087E760 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00284 8087E764 10000003 */ beq $zero, $zero, .L8087E774 -/* 00288 8087E768 8FBF0024 */ lw $ra, 0x0024($sp) -/* 0028C 8087E76C AE0F014C */ sw $t7, 0x014C($s0) ## 0000014C -.L8087E770: -/* 00290 8087E770 8FBF0024 */ lw $ra, 0x0024($sp) -.L8087E774: -/* 00294 8087E774 8FB0001C */ lw $s0, 0x001C($sp) -/* 00298 8087E778 8FB10020 */ lw $s1, 0x0020($sp) -/* 0029C 8087E77C 03E00008 */ jr $ra -/* 002A0 8087E780 27BD01D8 */ addiu $sp, $sp, 0x01D8 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Update.s deleted file mode 100644 index 4af28ab766..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Update.s +++ /dev/null @@ -1,24 +0,0 @@ -glabel BgHakaSgami_Update -/* 0088C 8087ED6C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00890 8087ED70 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00894 8087ED74 8CA21C44 */ lw $v0, 0x1C44($a1) ## 00001C44 -/* 00898 8087ED78 3C013000 */ lui $at, 0x3000 ## $at = 30000000 -/* 0089C 8087ED7C 342100C0 */ ori $at, $at, 0x00C0 ## $at = 300000C0 -/* 008A0 8087ED80 8C4E067C */ lw $t6, 0x067C($v0) ## 0000067C -/* 008A4 8087ED84 01C17824 */ and $t7, $t6, $at -/* 008A8 8087ED88 51E00007 */ beql $t7, $zero, .L8087EDA8 -/* 008AC 8087ED8C 8C99014C */ lw $t9, 0x014C($a0) ## 0000014C -/* 008B0 8087ED90 8C99014C */ lw $t9, 0x014C($a0) ## 0000014C -/* 008B4 8087ED94 3C188088 */ lui $t8, %hi(func_8087E7E4) ## $t8 = 80880000 -/* 008B8 8087ED98 2718E7E4 */ addiu $t8, $t8, %lo(func_8087E7E4) ## $t8 = 8087E7E4 -/* 008BC 8087ED9C 57190005 */ bnel $t8, $t9, .L8087EDB4 -/* 008C0 8087EDA0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 008C4 8087EDA4 8C99014C */ lw $t9, 0x014C($a0) ## 0000014C -.L8087EDA8: -/* 008C8 8087EDA8 0320F809 */ jalr $ra, $t9 -/* 008CC 8087EDAC 00000000 */ nop -/* 008D0 8087EDB0 8FBF0014 */ lw $ra, 0x0014($sp) -.L8087EDB4: -/* 008D4 8087EDB4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 008D8 8087EDB8 03E00008 */ jr $ra -/* 008DC 8087EDBC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E7E4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E7E4.s deleted file mode 100644 index 9a2e6c48ea..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E7E4.s +++ /dev/null @@ -1,32 +0,0 @@ -glabel func_8087E7E4 -/* 00304 8087E7E4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00308 8087E7E8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0030C 8087E7EC 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 00310 8087E7F0 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 00314 8087E7F4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00318 8087E7F8 00A12021 */ addu $a0, $a1, $at -/* 0031C 8087E7FC 80C50150 */ lb $a1, 0x0150($a2) ## 00000150 -/* 00320 8087E800 0C026062 */ jal Object_IsLoaded - -/* 00324 8087E804 AFA60018 */ sw $a2, 0x0018($sp) -/* 00328 8087E808 1040000F */ beq $v0, $zero, .L8087E848 -/* 0032C 8087E80C 8FA60018 */ lw $a2, 0x0018($sp) -/* 00330 8087E810 8CD90004 */ lw $t9, 0x0004($a2) ## 00000004 -/* 00334 8087E814 80CE0150 */ lb $t6, 0x0150($a2) ## 00000150 -/* 00338 8087E818 3C0F8088 */ lui $t7, %hi(func_8087EDC0) ## $t7 = 80880000 -/* 0033C 8087E81C 2401FFEF */ addiu $at, $zero, 0xFFEF ## $at = FFFFFFEF -/* 00340 8087E820 3C098088 */ lui $t1, %hi(func_8087E858) ## $t1 = 80880000 -/* 00344 8087E824 25EFEDC0 */ addiu $t7, $t7, %lo(func_8087EDC0) ## $t7 = 8087EDC0 -/* 00348 8087E828 24180020 */ addiu $t8, $zero, 0x0020 ## $t8 = 00000020 -/* 0034C 8087E82C 2529E858 */ addiu $t1, $t1, %lo(func_8087E858) ## $t1 = 8087E858 -/* 00350 8087E830 03214024 */ and $t0, $t9, $at -/* 00354 8087E834 ACCF0134 */ sw $t7, 0x0134($a2) ## 00000134 -/* 00358 8087E838 A4D80152 */ sh $t8, 0x0152($a2) ## 00000152 -/* 0035C 8087E83C ACC80004 */ sw $t0, 0x0004($a2) ## 00000004 -/* 00360 8087E840 ACC9014C */ sw $t1, 0x014C($a2) ## 0000014C -/* 00364 8087E844 A0CE001E */ sb $t6, 0x001E($a2) ## 0000001E -.L8087E848: -/* 00368 8087E848 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0036C 8087E84C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00370 8087E850 03E00008 */ jr $ra -/* 00374 8087E854 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E858.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E858.s deleted file mode 100644 index 761d02b27d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E858.s +++ /dev/null @@ -1,351 +0,0 @@ -.late_rodata -glabel D_8087EFE0 - .float 0.19634955 - -.text -glabel func_8087E858 -/* 00378 8087E858 27BDFF48 */ addiu $sp, $sp, 0xFF48 ## $sp = FFFFFF48 -/* 0037C 8087E85C AFBF005C */ sw $ra, 0x005C($sp) -/* 00380 8087E860 AFBE0058 */ sw $s8, 0x0058($sp) -/* 00384 8087E864 AFB70054 */ sw $s7, 0x0054($sp) -/* 00388 8087E868 AFB60050 */ sw $s6, 0x0050($sp) -/* 0038C 8087E86C AFB5004C */ sw $s5, 0x004C($sp) -/* 00390 8087E870 AFB40048 */ sw $s4, 0x0048($sp) -/* 00394 8087E874 AFB30044 */ sw $s3, 0x0044($sp) -/* 00398 8087E878 AFB20040 */ sw $s2, 0x0040($sp) -/* 0039C 8087E87C AFB1003C */ sw $s1, 0x003C($sp) -/* 003A0 8087E880 AFB00038 */ sw $s0, 0x0038($sp) -/* 003A4 8087E884 F7B80030 */ sdc1 $f24, 0x0030($sp) -/* 003A8 8087E888 F7B60028 */ sdc1 $f22, 0x0028($sp) -/* 003AC 8087E88C F7B40020 */ sdc1 $f20, 0x0020($sp) -/* 003B0 8087E890 AFA500BC */ sw $a1, 0x00BC($sp) -/* 003B4 8087E894 84820152 */ lh $v0, 0x0152($a0) ## 00000152 -/* 003B8 8087E898 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 003BC 8087E89C 10400003 */ beq $v0, $zero, .L8087E8AC -/* 003C0 8087E8A0 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 003C4 8087E8A4 A48E0152 */ sh $t6, 0x0152($a0) ## 00000152 -/* 003C8 8087E8A8 84820152 */ lh $v0, 0x0152($a0) ## 00000152 -.L8087E8AC: -/* 003CC 8087E8AC 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00 -/* 003D0 8087E8B0 3C018088 */ lui $at, %hi(D_8087EFE0) ## $at = 80880000 -/* 003D4 8087E8B4 C428EFE0 */ lwc1 $f8, %lo(D_8087EFE0)($at) -/* 003D8 8087E8B8 468021A0 */ cvt.s.w $f6, $f4 -/* 003DC 8087E8BC 46083302 */ mul.s $f12, $f6, $f8 -/* 003E0 8087E8C0 0C0400A4 */ jal sinf - -/* 003E4 8087E8C4 00000000 */ nop -/* 003E8 8087E8C8 3C014400 */ lui $at, 0x4400 ## $at = 44000000 -/* 003EC 8087E8CC 44815000 */ mtc1 $at, $f10 ## $f10 = 512.00 -/* 003F0 8087E8D0 860F00B6 */ lh $t7, 0x00B6($s0) ## 000000B6 -/* 003F4 8087E8D4 860D0152 */ lh $t5, 0x0152($s0) ## 00000152 -/* 003F8 8087E8D8 46005402 */ mul.s $f16, $f10, $f0 -/* 003FC 8087E8DC 240E0020 */ addiu $t6, $zero, 0x0020 ## $t6 = 00000020 -/* 00400 8087E8E0 4600848D */ trunc.w.s $f18, $f16 -/* 00404 8087E8E4 44199000 */ mfc1 $t9, $f18 -/* 00408 8087E8E8 00000000 */ nop -/* 0040C 8087E8EC 00194400 */ sll $t0, $t9, 16 -/* 00410 8087E8F0 00084C03 */ sra $t1, $t0, 16 -/* 00414 8087E8F4 252A0400 */ addiu $t2, $t1, 0x0400 ## $t2 = 00000400 -/* 00418 8087E8F8 000A5843 */ sra $t3, $t2, 1 -/* 0041C 8087E8FC 01EB6021 */ addu $t4, $t7, $t3 -/* 00420 8087E900 15A00002 */ bne $t5, $zero, .L8087E90C -/* 00424 8087E904 A60C00B6 */ sh $t4, 0x00B6($s0) ## 000000B6 -/* 00428 8087E908 A60E0152 */ sh $t6, 0x0152($s0) ## 00000152 -.L8087E90C: -/* 0042C 8087E90C 0C01DE1C */ jal Math_Sins - ## sins? -/* 00430 8087E910 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 00434 8087E914 46000586 */ mov.s $f22, $f0 -/* 00438 8087E918 0C01DE0D */ jal Math_Coss - ## coss? -/* 0043C 8087E91C 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 00440 8087E920 8618001C */ lh $t8, 0x001C($s0) ## 0000001C -/* 00444 8087E924 46000606 */ mov.s $f24, $f0 -/* 00448 8087E928 24080002 */ addiu $t0, $zero, 0x0002 ## $t0 = 00000002 -/* 0044C 8087E92C 13000003 */ beq $t8, $zero, .L8087E93C -/* 00450 8087E930 24190004 */ addiu $t9, $zero, 0x0004 ## $t9 = 00000004 -/* 00454 8087E934 10000002 */ beq $zero, $zero, .L8087E940 -/* 00458 8087E938 AFB90080 */ sw $t9, 0x0080($sp) -.L8087E93C: -/* 0045C 8087E93C AFA80080 */ sw $t0, 0x0080($sp) -.L8087E940: -/* 00460 8087E940 8FA90080 */ lw $t1, 0x0080($sp) -/* 00464 8087E944 261601A8 */ addiu $s6, $s0, 0x01A8 ## $s6 = 000001A8 -/* 00468 8087E948 27BE0098 */ addiu $s8, $sp, 0x0098 ## $s8 = FFFFFFE0 -/* 0046C 8087E94C 2522FFFE */ addiu $v0, $t1, 0xFFFE ## $v0 = FFFFFFFE -/* 00470 8087E950 0049082A */ slt $at, $v0, $t1 -/* 00474 8087E954 10200070 */ beq $at, $zero, .L8087EB18 -/* 00478 8087E958 00409825 */ or $s3, $v0, $zero ## $s3 = FFFFFFFE -/* 0047C 8087E95C 0002A100 */ sll $s4, $v0, 4 -/* 00480 8087E960 3C014000 */ lui $at, 0x4000 ## $at = 40000000 -/* 00484 8087E964 0282A023 */ subu $s4, $s4, $v0 -/* 00488 8087E968 27B100B0 */ addiu $s1, $sp, 0x00B0 ## $s1 = FFFFFFF8 -/* 0048C 8087E96C 4481A000 */ mtc1 $at, $f20 ## $f20 = 2.00 -/* 00490 8087E970 02209025 */ or $s2, $s1, $zero ## $s2 = FFFFFFF8 -/* 00494 8087E974 0014A080 */ sll $s4, $s4, 2 -/* 00498 8087E978 27B7008C */ addiu $s7, $sp, 0x008C ## $s7 = FFFFFFD4 -/* 0049C 8087E97C 27B500A4 */ addiu $s5, $sp, 0x00A4 ## $s5 = FFFFFFEC -.L8087E980: -/* 004A0 8087E980 3C0F8088 */ lui $t7, %hi(D_8087EF5C) ## $t7 = 80880000 -/* 004A4 8087E984 8DEFEF5C */ lw $t7, %lo(D_8087EF5C)($t7) -/* 004A8 8087E988 27A2008C */ addiu $v0, $sp, 0x008C ## $v0 = FFFFFFD4 -/* 004AC 8087E98C 028F1821 */ addu $v1, $s4, $t7 -/* 004B0 8087E990 C46A0020 */ lwc1 $f10, 0x0020($v1) ## 00000020 -/* 004B4 8087E994 2442000C */ addiu $v0, $v0, 0x000C ## $v0 = FFFFFFE0 -/* 004B8 8087E998 0051082B */ sltu $at, $v0, $s1 -/* 004BC 8087E99C 46165402 */ mul.s $f16, $f10, $f22 -/* 004C0 8087E9A0 C6120024 */ lwc1 $f18, 0x0024($s0) ## 00000024 -/* 004C4 8087E9A4 1020001A */ beq $at, $zero, .L8087EA10 -/* 004C8 8087E9A8 C46E0018 */ lwc1 $f14, 0x0018($v1) ## 00000018 -.L8087E9AC: -/* 004CC 8087E9AC 46187302 */ mul.s $f12, $f14, $f24 -/* 004D0 8087E9B0 46109280 */ add.s $f10, $f18, $f16 -/* 004D4 8087E9B4 2442000C */ addiu $v0, $v0, 0x000C ## $v0 = FFFFFFEC -/* 004D8 8087E9B8 0051082B */ sltu $at, $v0, $s1 -/* 004DC 8087E9BC 2463000C */ addiu $v1, $v1, 0x000C ## $v1 = 0000000C -/* 004E0 8087E9C0 460A6280 */ add.s $f10, $f12, $f10 -/* 004E4 8087E9C4 E44AFFE8 */ swc1 $f10, -0x0018($v0) ## FFFFFFD4 -/* 004E8 8087E9C8 C46A0010 */ lwc1 $f10, 0x0010($v1) ## 0000001C -/* 004EC 8087E9CC C60C0028 */ lwc1 $f12, 0x0028($s0) ## 00000028 -/* 004F0 8087E9D0 460C5300 */ add.s $f12, $f10, $f12 -/* 004F4 8087E9D4 E44CFFEC */ swc1 $f12, -0x0014($v0) ## FFFFFFD8 -/* 004F8 8087E9D8 C46C0014 */ lwc1 $f12, 0x0014($v1) ## 00000020 -/* 004FC 8087E9DC C46A000C */ lwc1 $f10, 0x000C($v1) ## 00000018 -/* 00500 8087E9E0 C608002C */ lwc1 $f8, 0x002C($s0) ## 0000002C -/* 00504 8087E9E4 46186302 */ mul.s $f12, $f12, $f24 -/* 00508 8087E9E8 460C4300 */ add.s $f12, $f8, $f12 -/* 0050C 8087E9EC 46165282 */ mul.s $f10, $f10, $f22 -/* 00510 8087E9F0 460A6281 */ sub.s $f10, $f12, $f10 -/* 00514 8087E9F4 E44AFFF0 */ swc1 $f10, -0x0010($v0) ## FFFFFFDC -/* 00518 8087E9F8 C46A0020 */ lwc1 $f10, 0x0020($v1) ## 0000002C -/* 0051C 8087E9FC C6120024 */ lwc1 $f18, 0x0024($s0) ## 00000024 -/* 00520 8087EA00 C46E0018 */ lwc1 $f14, 0x0018($v1) ## 00000024 -/* 00524 8087EA04 46165402 */ mul.s $f16, $f10, $f22 -/* 00528 8087EA08 1420FFE8 */ bne $at, $zero, .L8087E9AC -/* 0052C 8087EA0C 00000000 */ nop -.L8087EA10: -/* 00530 8087EA10 46187302 */ mul.s $f12, $f14, $f24 -/* 00534 8087EA14 46109280 */ add.s $f10, $f18, $f16 -/* 00538 8087EA18 2463000C */ addiu $v1, $v1, 0x000C ## $v1 = 00000018 -/* 0053C 8087EA1C 460A6280 */ add.s $f10, $f12, $f10 -/* 00540 8087EA20 E44AFFF4 */ swc1 $f10, -0x000C($v0) ## FFFFFFE0 -/* 00544 8087EA24 C60C0028 */ lwc1 $f12, 0x0028($s0) ## 00000028 -/* 00548 8087EA28 C46A0010 */ lwc1 $f10, 0x0010($v1) ## 00000028 -/* 0054C 8087EA2C 460C5300 */ add.s $f12, $f10, $f12 -/* 00550 8087EA30 E44CFFF8 */ swc1 $f12, -0x0008($v0) ## FFFFFFE4 -/* 00554 8087EA34 C46C0014 */ lwc1 $f12, 0x0014($v1) ## 0000002C -/* 00558 8087EA38 C46A000C */ lwc1 $f10, 0x000C($v1) ## 00000024 -/* 0055C 8087EA3C C608002C */ lwc1 $f8, 0x002C($s0) ## 0000002C -/* 00560 8087EA40 46186302 */ mul.s $f12, $f12, $f24 -/* 00564 8087EA44 460C4300 */ add.s $f12, $f8, $f12 -/* 00568 8087EA48 46165282 */ mul.s $f10, $f10, $f22 -/* 0056C 8087EA4C 460A6281 */ sub.s $f10, $f12, $f10 -/* 00570 8087EA50 E44AFFFC */ swc1 $f10, -0x0004($v0) ## FFFFFFE8 -/* 00574 8087EA54 02C02025 */ or $a0, $s6, $zero ## $a0 = 000001A8 -/* 00578 8087EA58 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFFE -/* 0057C 8087EA5C 02E03025 */ or $a2, $s7, $zero ## $a2 = FFFFFFD4 -/* 00580 8087EA60 03C03825 */ or $a3, $s8, $zero ## $a3 = FFFFFFE0 -/* 00584 8087EA64 0C0189E8 */ jal func_800627A0 -/* 00588 8087EA68 AFB50010 */ sw $s5, 0x0010($sp) -/* 0058C 8087EA6C 27A2008C */ addiu $v0, $sp, 0x008C ## $v0 = FFFFFFD4 -/* 00590 8087EA70 C60C0024 */ lwc1 $f12, 0x0024($s0) ## 00000024 -/* 00594 8087EA74 2442000C */ addiu $v0, $v0, 0x000C ## $v0 = FFFFFFE0 -/* 00598 8087EA78 C450FFF4 */ lwc1 $f16, -0x000C($v0) ## FFFFFFD4 -/* 0059C 8087EA7C 460CA482 */ mul.s $f18, $f20, $f12 -/* 005A0 8087EA80 5052000F */ beql $v0, $s2, .L8087EAC0 -/* 005A4 8087EA84 46109381 */ sub.s $f14, $f18, $f16 -/* 005A8 8087EA88 46109381 */ sub.s $f14, $f18, $f16 -.L8087EA8C: -/* 005AC 8087EA8C C44CFFFC */ lwc1 $f12, -0x0004($v0) ## FFFFFFDC -/* 005B0 8087EA90 C4500000 */ lwc1 $f16, 0x0000($v0) ## FFFFFFE0 -/* 005B4 8087EA94 2442000C */ addiu $v0, $v0, 0x000C ## $v0 = FFFFFFEC -/* 005B8 8087EA98 E44EFFE8 */ swc1 $f14, -0x0018($v0) ## FFFFFFD4 -/* 005BC 8087EA9C C60E002C */ lwc1 $f14, 0x002C($s0) ## 0000002C -/* 005C0 8087EAA0 460EA382 */ mul.s $f14, $f20, $f14 -/* 005C4 8087EAA4 460C7301 */ sub.s $f12, $f14, $f12 -/* 005C8 8087EAA8 E44CFFF0 */ swc1 $f12, -0x0010($v0) ## FFFFFFDC -/* 005CC 8087EAAC C60C0024 */ lwc1 $f12, 0x0024($s0) ## 00000024 -/* 005D0 8087EAB0 460CA482 */ mul.s $f18, $f20, $f12 -/* 005D4 8087EAB4 5452FFF5 */ bnel $v0, $s2, .L8087EA8C -/* 005D8 8087EAB8 46109381 */ sub.s $f14, $f18, $f16 -/* 005DC 8087EABC 46109381 */ sub.s $f14, $f18, $f16 -.L8087EAC0: -/* 005E0 8087EAC0 C44CFFFC */ lwc1 $f12, -0x0004($v0) ## FFFFFFE8 -/* 005E4 8087EAC4 E44EFFF4 */ swc1 $f14, -0x000C($v0) ## FFFFFFE0 -/* 005E8 8087EAC8 C60E002C */ lwc1 $f14, 0x002C($s0) ## 0000002C -/* 005EC 8087EACC 460EA382 */ mul.s $f14, $f20, $f14 -/* 005F0 8087EAD0 460C7301 */ sub.s $f12, $f14, $f12 -/* 005F4 8087EAD4 E44CFFFC */ swc1 $f12, -0x0004($v0) ## FFFFFFE8 -/* 005F8 8087EAD8 26650002 */ addiu $a1, $s3, 0x0002 ## $a1 = 00000000 -/* 005FC 8087EADC 02C02025 */ or $a0, $s6, $zero ## $a0 = 000001A8 -/* 00600 8087EAE0 04A10004 */ bgez $a1, .L8087EAF4 -/* 00604 8087EAE4 30A50003 */ andi $a1, $a1, 0x0003 ## $a1 = 00000000 -/* 00608 8087EAE8 10A00002 */ beq $a1, $zero, .L8087EAF4 -/* 0060C 8087EAEC 00000000 */ nop -/* 00610 8087EAF0 24A5FFFC */ addiu $a1, $a1, 0xFFFC ## $a1 = FFFFFFFC -.L8087EAF4: -/* 00614 8087EAF4 02E03025 */ or $a2, $s7, $zero ## $a2 = FFFFFFD4 -/* 00618 8087EAF8 03C03825 */ or $a3, $s8, $zero ## $a3 = FFFFFFE0 -/* 0061C 8087EAFC 0C0189E8 */ jal func_800627A0 -/* 00620 8087EB00 AFB50010 */ sw $s5, 0x0010($sp) -/* 00624 8087EB04 8FAB0080 */ lw $t3, 0x0080($sp) -/* 00628 8087EB08 26730001 */ addiu $s3, $s3, 0x0001 ## $s3 = FFFFFFFF -/* 0062C 8087EB0C 2694003C */ addiu $s4, $s4, 0x003C ## $s4 = 0000003C -/* 00630 8087EB10 166BFF9B */ bne $s3, $t3, .L8087E980 -/* 00634 8087EB14 00000000 */ nop -.L8087EB18: -/* 00638 8087EB18 820C0151 */ lb $t4, 0x0151($s0) ## 00000151 -/* 0063C 8087EB1C 3C014000 */ lui $at, 0x4000 ## $at = 40000000 -/* 00640 8087EB20 4481A000 */ mtc1 $at, $f20 ## $f20 = 2.00 -/* 00644 8087EB24 27B7008C */ addiu $s7, $sp, 0x008C ## $s7 = FFFFFFD4 -/* 00648 8087EB28 27BE0098 */ addiu $s8, $sp, 0x0098 ## $s8 = FFFFFFE0 -/* 0064C 8087EB2C 11800005 */ beq $t4, $zero, .L8087EB44 -/* 00650 8087EB30 261601A8 */ addiu $s6, $s0, 0x01A8 ## $s6 = 000001A8 -/* 00654 8087EB34 8FAD00BC */ lw $t5, 0x00BC($sp) -/* 00658 8087EB38 91AE1C27 */ lbu $t6, 0x1C27($t5) ## 00001C27 -/* 0065C 8087EB3C 51C0006F */ beql $t6, $zero, .L8087ECFC -/* 00660 8087EB40 8FA400BC */ lw $a0, 0x00BC($sp) -.L8087EB44: -/* 00664 8087EB44 8618001C */ lh $t8, 0x001C($s0) ## 0000001C -/* 00668 8087EB48 2404000C */ addiu $a0, $zero, 0x000C ## $a0 = 0000000C -/* 0066C 8087EB4C 3C058088 */ lui $a1, %hi(D_8087EFC8) ## $a1 = 80880000 -/* 00670 8087EB50 03040019 */ multu $t8, $a0 -/* 00674 8087EB54 24A5EFC8 */ addiu $a1, $a1, %lo(D_8087EFC8) ## $a1 = 8087EFC8 -/* 00678 8087EB58 C6080024 */ lwc1 $f8, 0x0024($s0) ## 00000024 -/* 0067C 8087EB5C 3C068088 */ lui $a2, %hi(D_8087EFB0) ## $a2 = 80880000 -/* 00680 8087EB60 24C6EFB0 */ addiu $a2, $a2, %lo(D_8087EFB0) ## $a2 = 8087EFB0 -/* 00684 8087EB64 0000C812 */ mflo $t9 -/* 00688 8087EB68 00B91021 */ addu $v0, $a1, $t9 -/* 0068C 8087EB6C C4440008 */ lwc1 $f4, 0x0008($v0) ## 00000008 -/* 00690 8087EB70 C4520000 */ lwc1 $f18, 0x0000($v0) ## 00000000 -/* 00694 8087EB74 46162402 */ mul.s $f16, $f4, $f22 -/* 00698 8087EB78 46104280 */ add.s $f10, $f8, $f16 -/* 0069C 8087EB7C 46189182 */ mul.s $f6, $f18, $f24 -/* 006A0 8087EB80 460A3100 */ add.s $f4, $f6, $f10 -/* 006A4 8087EB84 E7A4008C */ swc1 $f4, 0x008C($sp) -/* 006A8 8087EB88 8608001C */ lh $t0, 0x001C($s0) ## 0000001C -/* 006AC 8087EB8C C6100028 */ lwc1 $f16, 0x0028($s0) ## 00000028 -/* 006B0 8087EB90 01040019 */ multu $t0, $a0 -/* 006B4 8087EB94 00004812 */ mflo $t1 -/* 006B8 8087EB98 00A95021 */ addu $t2, $a1, $t1 -/* 006BC 8087EB9C C5480004 */ lwc1 $f8, 0x0004($t2) ## 00000004 -/* 006C0 8087EBA0 46104480 */ add.s $f18, $f8, $f16 -/* 006C4 8087EBA4 E7B20090 */ swc1 $f18, 0x0090($sp) -/* 006C8 8087EBA8 860F001C */ lh $t7, 0x001C($s0) ## 0000001C -/* 006CC 8087EBAC C606002C */ lwc1 $f6, 0x002C($s0) ## 0000002C -/* 006D0 8087EBB0 01E40019 */ multu $t7, $a0 -/* 006D4 8087EBB4 00005812 */ mflo $t3 -/* 006D8 8087EBB8 00AB1021 */ addu $v0, $a1, $t3 -/* 006DC 8087EBBC C44A0008 */ lwc1 $f10, 0x0008($v0) ## 00000008 -/* 006E0 8087EBC0 C4500000 */ lwc1 $f16, 0x0000($v0) ## 00000000 -/* 006E4 8087EBC4 46185102 */ mul.s $f4, $f10, $f24 -/* 006E8 8087EBC8 46043200 */ add.s $f8, $f6, $f4 -/* 006EC 8087EBCC 46168482 */ mul.s $f18, $f16, $f22 -/* 006F0 8087EBD0 46124281 */ sub.s $f10, $f8, $f18 -/* 006F4 8087EBD4 E7AA0094 */ swc1 $f10, 0x0094($sp) -/* 006F8 8087EBD8 860C001C */ lh $t4, 0x001C($s0) ## 0000001C -/* 006FC 8087EBDC C6060024 */ lwc1 $f6, 0x0024($s0) ## 00000024 -/* 00700 8087EBE0 01840019 */ multu $t4, $a0 -/* 00704 8087EBE4 00006812 */ mflo $t5 -/* 00708 8087EBE8 00CD1821 */ addu $v1, $a2, $t5 -/* 0070C 8087EBEC C4640008 */ lwc1 $f4, 0x0008($v1) ## 00000008 -/* 00710 8087EBF0 C4720000 */ lwc1 $f18, 0x0000($v1) ## 00000000 -/* 00714 8087EBF4 46162402 */ mul.s $f16, $f4, $f22 -/* 00718 8087EBF8 46103200 */ add.s $f8, $f6, $f16 -/* 0071C 8087EBFC 46189282 */ mul.s $f10, $f18, $f24 -/* 00720 8087EC00 46085100 */ add.s $f4, $f10, $f8 -/* 00724 8087EC04 E7A40098 */ swc1 $f4, 0x0098($sp) -/* 00728 8087EC08 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 0072C 8087EC0C C6100028 */ lwc1 $f16, 0x0028($s0) ## 00000028 -/* 00730 8087EC10 01C40019 */ multu $t6, $a0 -/* 00734 8087EC14 0000C012 */ mflo $t8 -/* 00738 8087EC18 00D8C821 */ addu $t9, $a2, $t8 -/* 0073C 8087EC1C C7260004 */ lwc1 $f6, 0x0004($t9) ## 00000004 -/* 00740 8087EC20 46103480 */ add.s $f18, $f6, $f16 -/* 00744 8087EC24 E7B2009C */ swc1 $f18, 0x009C($sp) -/* 00748 8087EC28 8608001C */ lh $t0, 0x001C($s0) ## 0000001C -/* 0074C 8087EC2C C60A002C */ lwc1 $f10, 0x002C($s0) ## 0000002C -/* 00750 8087EC30 01040019 */ multu $t0, $a0 -/* 00754 8087EC34 00004812 */ mflo $t1 -/* 00758 8087EC38 00C91821 */ addu $v1, $a2, $t1 -/* 0075C 8087EC3C C4680008 */ lwc1 $f8, 0x0008($v1) ## 00000008 -/* 00760 8087EC40 C4700000 */ lwc1 $f16, 0x0000($v1) ## 00000000 -/* 00764 8087EC44 46184102 */ mul.s $f4, $f8, $f24 -/* 00768 8087EC48 46045180 */ add.s $f6, $f10, $f4 -/* 0076C 8087EC4C 46168482 */ mul.s $f18, $f16, $f22 -/* 00770 8087EC50 46123201 */ sub.s $f8, $f6, $f18 -/* 00774 8087EC54 E7A800A0 */ swc1 $f8, 0x00A0($sp) -/* 00778 8087EC58 0C009AC3 */ jal Effect_GetByIndex -/* 0077C 8087EC5C 8E040154 */ lw $a0, 0x0154($s0) ## 00000154 -/* 00780 8087EC60 00402025 */ or $a0, $v0, $zero ## $a0 = 00000000 -/* 00784 8087EC64 02E02825 */ or $a1, $s7, $zero ## $a1 = FFFFFFD4 -/* 00788 8087EC68 0C007F7C */ jal EffectBlure_AddVertex -/* 0078C 8087EC6C 03C03025 */ or $a2, $s8, $zero ## $a2 = FFFFFFE0 -/* 00790 8087EC70 27A2008C */ addiu $v0, $sp, 0x008C ## $v0 = FFFFFFD4 -/* 00794 8087EC74 27A300A4 */ addiu $v1, $sp, 0x00A4 ## $v1 = FFFFFFEC -/* 00798 8087EC78 C6100024 */ lwc1 $f16, 0x0024($s0) ## 00000024 -/* 0079C 8087EC7C 2442000C */ addiu $v0, $v0, 0x000C ## $v0 = FFFFFFE0 -/* 007A0 8087EC80 C456FFF4 */ lwc1 $f22, -0x000C($v0) ## FFFFFFD4 -/* 007A4 8087EC84 4610A602 */ mul.s $f24, $f20, $f16 -/* 007A8 8087EC88 5043000F */ beql $v0, $v1, .L8087ECC8 -/* 007AC 8087EC8C 4616C481 */ sub.s $f18, $f24, $f22 -/* 007B0 8087EC90 4616C481 */ sub.s $f18, $f24, $f22 -.L8087EC94: -/* 007B4 8087EC94 C450FFFC */ lwc1 $f16, -0x0004($v0) ## FFFFFFDC -/* 007B8 8087EC98 C4560000 */ lwc1 $f22, 0x0000($v0) ## FFFFFFE0 -/* 007BC 8087EC9C 2442000C */ addiu $v0, $v0, 0x000C ## $v0 = FFFFFFEC -/* 007C0 8087ECA0 E452FFE8 */ swc1 $f18, -0x0018($v0) ## FFFFFFD4 -/* 007C4 8087ECA4 C612002C */ lwc1 $f18, 0x002C($s0) ## 0000002C -/* 007C8 8087ECA8 4612A482 */ mul.s $f18, $f20, $f18 -/* 007CC 8087ECAC 46109401 */ sub.s $f16, $f18, $f16 -/* 007D0 8087ECB0 E450FFF0 */ swc1 $f16, -0x0010($v0) ## FFFFFFDC -/* 007D4 8087ECB4 C6100024 */ lwc1 $f16, 0x0024($s0) ## 00000024 -/* 007D8 8087ECB8 4610A602 */ mul.s $f24, $f20, $f16 -/* 007DC 8087ECBC 5443FFF5 */ bnel $v0, $v1, .L8087EC94 -/* 007E0 8087ECC0 4616C481 */ sub.s $f18, $f24, $f22 -/* 007E4 8087ECC4 4616C481 */ sub.s $f18, $f24, $f22 -.L8087ECC8: -/* 007E8 8087ECC8 C450FFFC */ lwc1 $f16, -0x0004($v0) ## FFFFFFE8 -/* 007EC 8087ECCC E452FFF4 */ swc1 $f18, -0x000C($v0) ## FFFFFFE0 -/* 007F0 8087ECD0 C612002C */ lwc1 $f18, 0x002C($s0) ## 0000002C -/* 007F4 8087ECD4 4612A482 */ mul.s $f18, $f20, $f18 -/* 007F8 8087ECD8 46109401 */ sub.s $f16, $f18, $f16 -/* 007FC 8087ECDC E450FFFC */ swc1 $f16, -0x0004($v0) ## FFFFFFE8 -/* 00800 8087ECE0 0C009AC3 */ jal Effect_GetByIndex -/* 00804 8087ECE4 8E040158 */ lw $a0, 0x0158($s0) ## 00000158 -/* 00808 8087ECE8 00402025 */ or $a0, $v0, $zero ## $a0 = 00000000 -/* 0080C 8087ECEC 02E02825 */ or $a1, $s7, $zero ## $a1 = FFFFFFD4 -/* 00810 8087ECF0 0C007F7C */ jal EffectBlure_AddVertex -/* 00814 8087ECF4 03C03025 */ or $a2, $s8, $zero ## $a2 = FFFFFFE0 -/* 00818 8087ECF8 8FA400BC */ lw $a0, 0x00BC($sp) -.L8087ECFC: -/* 0081C 8087ECFC 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00820 8087ED00 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 00824 8087ED04 00818821 */ addu $s1, $a0, $at -/* 00828 8087ED08 02202825 */ or $a1, $s1, $zero ## $a1 = FFFFFFF8 -/* 0082C 8087ED0C 0C0175E7 */ jal CollisionCheck_SetAT - ## CollisionCheck_setAT -/* 00830 8087ED10 02C03025 */ or $a2, $s6, $zero ## $a2 = 000001A8 -/* 00834 8087ED14 8FA400BC */ lw $a0, 0x00BC($sp) -/* 00838 8087ED18 02202825 */ or $a1, $s1, $zero ## $a1 = FFFFFFF8 -/* 0083C 8087ED1C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT -/* 00840 8087ED20 2606015C */ addiu $a2, $s0, 0x015C ## $a2 = 0000015C -/* 00844 8087ED24 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00848 8087ED28 0C00BE5D */ jal func_8002F974 -/* 0084C 8087ED2C 2405204C */ addiu $a1, $zero, 0x204C ## $a1 = 0000204C -/* 00850 8087ED30 8FBF005C */ lw $ra, 0x005C($sp) -/* 00854 8087ED34 D7B40020 */ ldc1 $f20, 0x0020($sp) -/* 00858 8087ED38 D7B60028 */ ldc1 $f22, 0x0028($sp) -/* 0085C 8087ED3C D7B80030 */ ldc1 $f24, 0x0030($sp) -/* 00860 8087ED40 8FB00038 */ lw $s0, 0x0038($sp) -/* 00864 8087ED44 8FB1003C */ lw $s1, 0x003C($sp) -/* 00868 8087ED48 8FB20040 */ lw $s2, 0x0040($sp) -/* 0086C 8087ED4C 8FB30044 */ lw $s3, 0x0044($sp) -/* 00870 8087ED50 8FB40048 */ lw $s4, 0x0048($sp) -/* 00874 8087ED54 8FB5004C */ lw $s5, 0x004C($sp) -/* 00878 8087ED58 8FB60050 */ lw $s6, 0x0050($sp) -/* 0087C 8087ED5C 8FB70054 */ lw $s7, 0x0054($sp) -/* 00880 8087ED60 8FBE0058 */ lw $s8, 0x0058($sp) -/* 00884 8087ED64 03E00008 */ jr $ra -/* 00888 8087ED68 27BD00B8 */ addiu $sp, $sp, 0x00B8 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087EDC0.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087EDC0.s deleted file mode 100644 index 77016a89f6..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087EDC0.s +++ /dev/null @@ -1,39 +0,0 @@ -glabel func_8087EDC0 -/* 008E0 8087EDC0 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 008E4 8087EDC4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 008E8 8087EDC8 808E0151 */ lb $t6, 0x0151($a0) ## 00000151 -/* 008EC 8087EDCC 00A03025 */ or $a2, $a1, $zero ## $a2 = 00000000 -/* 008F0 8087EDD0 51C00008 */ beql $t6, $zero, .L8087EDF4 -/* 008F4 8087EDD4 848F001C */ lh $t7, 0x001C($a0) ## 0000001C -/* 008F8 8087EDD8 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 008FC 8087EDDC 3C050601 */ lui $a1, %hi(D_0600BF20) ## $a1 = 06010000 -/* 00900 8087EDE0 0C00D4C9 */ jal Gfx_DrawDListXlu - -/* 00904 8087EDE4 24A5BF20 */ addiu $a1, $a1, %lo(D_0600BF20) ## $a1 = 0600BF20 -/* 00908 8087EDE8 1000000F */ beq $zero, $zero, .L8087EE28 -/* 0090C 8087EDEC 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00910 8087EDF0 848F001C */ lh $t7, 0x001C($a0) ## 0000001C -.L8087EDF4: -/* 00914 8087EDF4 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000 -/* 00918 8087EDF8 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 0091C 8087EDFC 15E00007 */ bne $t7, $zero, .L8087EE1C -/* 00920 8087EE00 00000000 */ nop -/* 00924 8087EE04 3C050601 */ lui $a1, %hi(D_0600BF20) ## $a1 = 06010000 -/* 00928 8087EE08 24A5BF20 */ addiu $a1, $a1, %lo(D_0600BF20) ## $a1 = 0600BF20 -/* 0092C 8087EE0C 0C00D498 */ jal Gfx_DrawDListOpa - -/* 00930 8087EE10 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000 -/* 00934 8087EE14 10000004 */ beq $zero, $zero, .L8087EE28 -/* 00938 8087EE18 8FBF0014 */ lw $ra, 0x0014($sp) -.L8087EE1C: -/* 0093C 8087EE1C 0C00D498 */ jal Gfx_DrawDListOpa - -/* 00940 8087EE20 24A521F0 */ addiu $a1, $a1, 0x21F0 ## $a1 = 000021F0 -/* 00944 8087EE24 8FBF0014 */ lw $ra, 0x0014($sp) -.L8087EE28: -/* 00948 8087EE28 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0094C 8087EE2C 03E00008 */ jr $ra -/* 00950 8087EE30 00000000 */ nop -/* 00954 8087EE34 00000000 */ nop -/* 00958 8087EE38 00000000 */ nop -/* 0095C 8087EE3C 00000000 */ nop diff --git a/data/overlays/actors/z_bg_haka_sgami.data.s b/data/overlays/actors/z_bg_haka_sgami.data.s deleted file mode 100644 index 65dbaf3fcd..0000000000 --- a/data/overlays/actors/z_bg_haka_sgami.data.s +++ /dev/null @@ -1,66 +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_Haka_Sgami_InitVars - .word 0x00B10600, 0x00000011, 0x00010000, 0x00000338 -.word BgHakaSgami_Init -.word BgHakaSgami_Destroy -.word BgHakaSgami_Update -.word 0x00000000 -glabel D_8087EE60 - .word 0x02000000, 0x20000000, 0x00040000, 0x00000000, 0x00000000, 0x01000000, 0x43B68000, 0x42340000, 0x41D80000, 0x43020000, 0x42340000, 0x43160000, 0x43910000, 0x42340000, 0x43110000, 0x02000000, 0x20000000, 0x00040000, 0x00000000, 0x00000000, 0x01000000, 0x437A0000, 0x42340000, 0x42B40000, 0x42480000, 0x42340000, 0x42A00000, 0x43200000, 0x42340000, 0x43200000, 0x02000000, 0x20000000, 0x00040000, 0x00000000, 0x00000000, 0x01000000, 0xC3988000, 0x42040000, 0xC0E00000, 0xC35C0000, 0x42040000, 0x42200000, 0xC3020000, 0x42040000, 0xC0A00000, 0x02000000, 0x20000000, 0x00040000, 0x00000000, 0x00000000, 0x01000000, 0xC33E0000, 0x42040000, 0x42200000, 0xC1F00000, 0x42040000, 0x41700000, 0xC28C0000, 0x42040000, 0xC1F00000 -glabel D_8087EF50 - .word 0x0A110000, 0x20020000, 0x00000004 -glabel D_8087EF5C - .word D_8087EE60 -glabel D_8087EF60 - .word 0x0A000039, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00500082, 0x00000000, 0x00000000 -glabel D_8087EF8C - .word 0x00000050, 0x0082FF00 -glabel D_8087EF94 - .word 0xB0F803E8, 0x801F0004, 0x48500064 -glabel D_8087EFA0 - .byte 0xFA -glabel D_8087EFA1 - .byte 0xFA -glabel D_8087EFA2 - .byte 0xFA -glabel D_8087EFA3 - .byte 0xC8 -glabel D_8087EFA4 - .byte 0xC8 -glabel D_8087EFA5 - .byte 0xC8 -glabel D_8087EFA6 - .byte 0xC8 -glabel D_8087EFA7 - .byte 0x82 -glabel D_8087EFA8 - .byte 0xC8 -glabel D_8087EFA9 - .byte 0xC8 -glabel D_8087EFAA - .byte 0xC8 -glabel D_8087EFAB - .byte 0x3C -glabel D_8087EFAC - .byte 0x96 -glabel D_8087EFAD - .byte 0x96 -glabel D_8087EFAE - .byte 0x96 -glabel D_8087EFAF - .byte 0x14 -glabel D_8087EFB0 - .word 0xC1A00000, 0x42480000, 0x43020000, 0xC2480000, 0x42040000, 0x41A00000 -glabel D_8087EFC8 - .word 0x43BE0000, 0x42480000, 0x42480000, 0x439B0000, 0x42040000, 0x00000000 - diff --git a/data/overlays/actors/z_bg_haka_sgami.reloc.s b/data/overlays/actors/z_bg_haka_sgami.reloc.s deleted file mode 100644 index dda249c7c8..0000000000 --- a/data/overlays/actors/z_bg_haka_sgami.reloc.s +++ /dev/null @@ -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_8087EFF0 - .incbin "baserom/ovl_Bg_Haka_Sgami", 0xB10, 0x00000110 diff --git a/spec b/spec index 1378cc1ce6..06935e7f8e 100644 --- a/spec +++ b/spec @@ -770,8 +770,7 @@ endseg beginseg name "ovl_Bg_Haka_Sgami" include "build/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.o" - include "build/data/overlays/actors/z_bg_haka_sgami.data.o" - include "build/data/overlays/actors/z_bg_haka_sgami.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Haka_Sgami/ovl_Bg_Haka_Sgami_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index 467da55add..26c5ae2d9a 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -1,7 +1,7 @@ /* * File: z_bg_haka_sgami.c * Overlay: ovl_Bg_Haka_Sgami - * Description: Shadow Temple Spinning Scythe Trap + * Description: Spinning Scythe Trap */ #include "z_bg_haka_sgami.h" @@ -10,17 +10,25 @@ #define THIS ((BgHakaSgami*)thisx) +typedef enum { + /* 0 */ SCYTHE_TRAP_SHADOW_TEMPLE, + /* 1 */ SCYTHE_TRAP_SHADOW_TEMPLE_INVISIBLE, + /* 2 */ SCYTHE_TRAP_ICE_CAVERN +} SpinningScytheTrapMode; + +#define SCYTHE_SPIN_TIME 32 + void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx); void BgHakaSgami_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgHakaSgami_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaSgami_Draw(Actor* thisx, GlobalContext* globalCtx); -void func_8087E7E4(BgHakaSgami* this, GlobalContext* globalCtx); -void func_8087E858(BgHakaSgami* this, GlobalContext* globalCtx); -void func_8087EDC0(BgHakaSgami* this, GlobalContext* globalCtx); +void BgHakaSgami_SetupSpin(BgHakaSgami* this, GlobalContext* globalCtx); +void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx); -extern UNK_TYPE D_0600BF20; +extern Gfx D_0600BF20[]; +extern Gfx D_060021F0[]; -/* const ActorInit Bg_Haka_Sgami_InitVars = { ACTOR_BG_HAKA_SGAMI, ACTORTYPE_PROP, @@ -32,15 +40,221 @@ const ActorInit Bg_Haka_Sgami_InitVars = { (ActorFunc)BgHakaSgami_Update, NULL, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Destroy.s") +static ColliderTrisItemInit sTriItemsInit[] = { + { + { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { { { 365.0f, 45.0f, 27.0f }, { 130.0f, 45.0f, 150.0f }, { 290.0f, 45.0f, 145.0f } } }, + }, + { + { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { { { 250.0f, 45.0f, 90.0f }, { 50.0f, 45.0f, 80.0f }, { 160.0f, 45.0f, 160.0f } } }, + }, + { + { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { { { -305.0f, 33.0f, -7.0f }, { -220.0f, 33.0f, 40.0f }, { -130.0f, 33.0f, -5.0f } } }, + }, + { + { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { { { -190.0f, 33.0f, 40.0f }, { -30.0f, 33.0f, 15.0f }, { -70.0f, 33.0f, -30.0f } } }, + }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E7E4.s") +static ColliderTrisInit sTrisInit = { + { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_TRIS }, + 4, + sTriItemsInit, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087E858.s") +static ColliderCylinderInit sCylinderInit = { + { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, + { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { 80, 130, 0, { 0, 0, 0 } }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/BgHakaSgami_Update.s") +static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 130, 0xFF }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Sgami/func_8087EDC0.s") +static InitChainEntry sInitChain[] = { + ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), + ICHAIN_U8(unk_1F, 4, ICHAIN_CONTINUE), + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), +}; + +void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx) { + static u8 sP1StartColor[] = { 250, 250, 250, 200 }; + static u8 sP2StartColor[] = { 200, 200, 200, 130 }; + static u8 sP1EndColor[] = { 200, 200, 200, 60 }; + static u8 sP2EndColor[] = { 150, 150, 150, 20 }; + BgHakaSgami* this = THIS; + EffectBlureInit1 blureInit; + s32 i; + ColliderTris* colliderScythe = &this->colliderScythe; + + Actor_ProcessInitChain(thisx, sInitChain); + + this->unk_151 = thisx->params & 0xFF; + thisx->params = (thisx->params >> 8) & 0xFF; + + if (this->unk_151 != 0) { + thisx->flags |= 0x80; + } + + Collider_InitTris(globalCtx, colliderScythe); + Collider_SetTris(globalCtx, colliderScythe, thisx, &sTrisInit, this->colliderScytheItems); + Collider_InitCylinder(globalCtx, &this->colliderScytheCenter); + Collider_SetCylinder(globalCtx, &this->colliderScytheCenter, thisx, &sCylinderInit); + + this->colliderScytheCenter.dim.pos.x = thisx->posRot.pos.x; + this->colliderScytheCenter.dim.pos.y = thisx->posRot.pos.y; + this->colliderScytheCenter.dim.pos.z = thisx->posRot.pos.z; + + func_80061ED4(&thisx->colChkInfo, NULL, &sColChkInfoInit); + + for (i = 0; i < 4; i++) { + blureInit.p1StartColor[i] = sP1StartColor[i]; + blureInit.p2StartColor[i] = sP2StartColor[i]; + blureInit.p1EndColor[i] = sP1EndColor[i]; + blureInit.p2EndColor[i] = sP2EndColor[i]; + } + blureInit.elemDuration = 10; + blureInit.unkFlag = false; + blureInit.calcMode = 2; + Effect_Add(globalCtx, &this->blureEffectIndex[0], EFFECT_BLURE1, 0, 0, &blureInit); + Effect_Add(globalCtx, &this->blureEffectIndex[1], EFFECT_BLURE1, 0, 0, &blureInit); + + if (thisx->params == SCYTHE_TRAP_SHADOW_TEMPLE) { + this->requiredObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_HAKA_OBJECTS); + thisx->flags &= ~1; + } else { + this->requiredObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_ICE_OBJECTS); + this->colliderScytheCenter.dim.radius = 30; + this->colliderScytheCenter.dim.height = 70; + Actor_SetHeight(thisx, 40.0f); + } + + if (this->requiredObjBankIndex < 0) { + Actor_Kill(thisx); + return; + } + + this->actionFunc = BgHakaSgami_SetupSpin; +} + +void BgHakaSgami_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgHakaSgami* this = THIS; + + Effect_Delete(globalCtx, this->blureEffectIndex[0]); + Effect_Delete(globalCtx, this->blureEffectIndex[1]); + Collider_DestroyTris(globalCtx, &this->colliderScythe); + Collider_DestroyCylinder(globalCtx, &this->colliderScytheCenter); +} + +void BgHakaSgami_SetupSpin(BgHakaSgami* this, GlobalContext* globalCtx) { + if (Object_IsLoaded(&globalCtx->objectCtx, this->requiredObjBankIndex)) { + this->actor.objBankIndex = this->requiredObjBankIndex; + this->actor.draw = BgHakaSgami_Draw; + this->timer = SCYTHE_SPIN_TIME; + this->actor.flags &= ~0x10; + this->actionFunc = BgHakaSgami_Spin; + } +} + +void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) { + static Vec3f blureEffectVertices2[] = { + { -20.0f, 50.0f, 130.0f }, + { -50.0f, 33.0f, 20.0f }, + }; + static Vec3f blureEffectVertices1[] = { + { 380.0f, 50.0f, 50.0f }, + { 310.0f, 33.0f, 0.0f }, + }; + s32 i; + s32 j; + Vec3f scytheVertices[3]; + f32 actorRotYSin; + f32 actorRotYCos; + s32 iterateCount; + ColliderTrisItemInit* colliderList; + + if (this->timer != 0) { + this->timer--; + } + + this->actor.shape.rot.y += ((s16)(512.0f * sinf(this->timer * (M_PI / 16.0f))) + 0x400) >> 1; + + if (this->timer == 0) { + this->timer = SCYTHE_SPIN_TIME; + } + + actorRotYSin = Math_Sins(this->actor.shape.rot.y); + actorRotYCos = Math_Coss(this->actor.shape.rot.y); + + iterateCount = (this->actor.params != 0) ? 4 : 2; + + for (i = iterateCount - 2; i < iterateCount; i++) { + colliderList = &sTrisInit.list[i]; + + for (j = 0; j < 3; j++) { + scytheVertices[j].x = this->actor.posRot.pos.x + colliderList->dim.vtx[j].z * actorRotYSin + + colliderList->dim.vtx[j].x * actorRotYCos; + scytheVertices[j].y = this->actor.posRot.pos.y + colliderList->dim.vtx[j].y; + scytheVertices[j].z = this->actor.posRot.pos.z + colliderList->dim.vtx[j].z * actorRotYCos - + colliderList->dim.vtx[j].x * actorRotYSin; + } + + func_800627A0(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); + + for (j = 0; j < 3; j++) { + scytheVertices[j].x = (2 * this->actor.posRot.pos.x) - scytheVertices[j].x; + scytheVertices[j].z = (2 * this->actor.posRot.pos.z) - scytheVertices[j].z; + } + + func_800627A0(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); + } + + if ((this->unk_151 == 0) || (globalCtx->actorCtx.unk_03 != 0)) { + scytheVertices[0].x = this->actor.posRot.pos.x + blureEffectVertices1[this->actor.params].z * actorRotYSin + + blureEffectVertices1[this->actor.params].x * actorRotYCos; + scytheVertices[0].y = this->actor.posRot.pos.y + blureEffectVertices1[this->actor.params].y; + scytheVertices[0].z = this->actor.posRot.pos.z + blureEffectVertices1[this->actor.params].z * actorRotYCos - + blureEffectVertices1[this->actor.params].x * actorRotYSin; + scytheVertices[1].x = this->actor.posRot.pos.x + blureEffectVertices2[this->actor.params].z * actorRotYSin + + blureEffectVertices2[this->actor.params].x * actorRotYCos; + scytheVertices[1].y = this->actor.posRot.pos.y + blureEffectVertices2[this->actor.params].y; + scytheVertices[1].z = this->actor.posRot.pos.z + blureEffectVertices2[this->actor.params].z * actorRotYCos - + blureEffectVertices2[this->actor.params].x * actorRotYSin; + EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[0]), &scytheVertices[0], &scytheVertices[1]); + + for (j = 0; j < 2; j++) { + scytheVertices[j].x = (2 * this->actor.posRot.pos.x) - scytheVertices[j].x; + scytheVertices[j].z = (2 * this->actor.posRot.pos.z) - scytheVertices[j].z; + } + + EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[1]), &scytheVertices[0], &scytheVertices[1]); + } + + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderScythe.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderScytheCenter.base); + func_8002F974(&this->actor, NA_SE_EV_ROLLCUTTER_MOTOR - SFX_FLAG); +} + +void BgHakaSgami_Update(Actor* thisx, GlobalContext* globalCtx) { + BgHakaSgami* this = THIS; + Player* player = PLAYER; + + if (!(player->stateFlags1 & 0x300000C0) || (this->actionFunc == BgHakaSgami_SetupSpin)) { + this->actionFunc(this, globalCtx); + } +} + +void BgHakaSgami_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgHakaSgami* this = THIS; + + if (this->unk_151 != 0) { + Gfx_DrawDListXlu(globalCtx, D_0600BF20); + } else if (this->actor.params == SCYTHE_TRAP_SHADOW_TEMPLE) { + Gfx_DrawDListOpa(globalCtx, D_0600BF20); + } else { + Gfx_DrawDListOpa(globalCtx, D_060021F0); + } +} diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h index c12ce4e33a..240cb7f07d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h @@ -11,7 +11,13 @@ typedef void (*BgHakaSgamiActionFunc)(struct BgHakaSgami*, GlobalContext*); typedef struct BgHakaSgami { /* 0x0000 */ Actor actor; /* 0x014C */ BgHakaSgamiActionFunc actionFunc; - /* 0x0150 */ char unk_150[0x1E8]; + /* 0x0150 */ s8 requiredObjBankIndex; + /* 0x0151 */ s8 unk_151; + /* 0x0152 */ s16 timer; + /* 0x0154 */ s32 blureEffectIndex[2]; + /* 0x015C */ ColliderCylinder colliderScytheCenter; + /* 0x01A8 */ ColliderTris colliderScythe; + /* 0x01C8 */ ColliderTrisItem colliderScytheItems[4]; } BgHakaSgami; // size = 0x0338 extern const ActorInit Bg_Haka_Sgami_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 1c86509372..fd9c0fa223 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -1855,6 +1855,7 @@ D_06000870 = 0x06000870; // z_bg_haka_sgami D_0600BF20 = 0x0600BF20; +D_060021F0 = 0x060021F0; // z_bg_haka_ship D_06005A70 = 0x06005A70;