From 13891f1366da8b09f151c33a7d597541ccfbf46b Mon Sep 17 00:00:00 2001 From: fullgrowngaming <42490167+fullgrowngaming@users.noreply.github.com> Date: Tue, 18 Aug 2020 10:52:44 -0700 Subject: [PATCH] z_en_yukabyun decompiled (#318) * Decomped Yukabyun (flying floor tiles) * z_en_yukabyun * Ran the formatting script, plus fixed negative number stuff in the Update function * Changed unk_152 to unsigned to get rid of cast * Made all the suggested changes. * Update undefined_syms.txt Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> --- .../ovl_En_Yukabyun/EnYukabyun_Destroy.s | 12 -- .../actors/ovl_En_Yukabyun/EnYukabyun_Draw.s | 91 ------------- .../actors/ovl_En_Yukabyun/EnYukabyun_Init.s | 48 ------- .../ovl_En_Yukabyun/EnYukabyun_Update.s | 117 ----------------- .../actors/ovl_En_Yukabyun/func_80B43A94.s | 19 --- .../actors/ovl_En_Yukabyun/func_80B43AD4.s | 41 ------ .../actors/ovl_En_Yukabyun/func_80B43B6C.s | 33 ----- .../actors/ovl_En_Yukabyun/func_80B43BCC.s | 31 ----- data/overlays/actors/z_en_yukabyun.data.s | 24 ---- data/overlays/actors/z_en_yukabyun.reloc.s | 13 -- spec | 3 +- .../actors/ovl_En_Yukabyun/z_en_yukabyun.c | 122 ++++++++++++++++-- .../actors/ovl_En_Yukabyun/z_en_yukabyun.h | 7 +- undefined_syms.txt | 6 +- 14 files changed, 124 insertions(+), 443 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43A94.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43AD4.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43B6C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43BCC.s delete mode 100644 data/overlays/actors/z_en_yukabyun.data.s delete mode 100644 data/overlays/actors/z_en_yukabyun.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Destroy.s b/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Destroy.s deleted file mode 100644 index eff92cec21..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Destroy.s +++ /dev/null @@ -1,12 +0,0 @@ -glabel EnYukabyun_Destroy -/* 000AC 80B43A6C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 000B0 80B43A70 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 000B4 80B43A74 AFBF0014 */ sw $ra, 0x0014($sp) -/* 000B8 80B43A78 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 000BC 80B43A7C 0C0170EB */ jal Collider_DestroyCylinder - -/* 000C0 80B43A80 24C50154 */ addiu $a1, $a2, 0x0154 ## $a1 = 00000154 -/* 000C4 80B43A84 8FBF0014 */ lw $ra, 0x0014($sp) -/* 000C8 80B43A88 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 000CC 80B43A8C 03E00008 */ jr $ra -/* 000D0 80B43A90 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Draw.s deleted file mode 100644 index b1cf4d0251..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Draw.s +++ /dev/null @@ -1,91 +0,0 @@ -.rdata -glabel D_80B43F70 - .asciz "../z_en_yukabyun.c" - .balign 4 - -glabel D_80B43F84 - .asciz "../z_en_yukabyun.c" - .balign 4 - -glabel D_80B43F98 - .asciz "../z_en_yukabyun.c" - .balign 4 - -.text -glabel EnYukabyun_Draw -/* 00420 80B43DE0 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8 -/* 00424 80B43DE4 AFBF001C */ sw $ra, 0x001C($sp) -/* 00428 80B43DE8 AFB00018 */ sw $s0, 0x0018($sp) -/* 0042C 80B43DEC AFA40048 */ sw $a0, 0x0048($sp) -/* 00430 80B43DF0 AFA5004C */ sw $a1, 0x004C($sp) -/* 00434 80B43DF4 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 00438 80B43DF8 3C0680B4 */ lui $a2, %hi(D_80B43F70) ## $a2 = 80B40000 -/* 0043C 80B43DFC 24C63F70 */ addiu $a2, $a2, %lo(D_80B43F70) ## $a2 = 80B43F70 -/* 00440 80B43E00 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE8 -/* 00444 80B43E04 2407016E */ addiu $a3, $zero, 0x016E ## $a3 = 0000016E -/* 00448 80B43E08 0C031AB1 */ jal Graph_OpenDisps -/* 0044C 80B43E0C 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 00450 80B43E10 8FAF004C */ lw $t7, 0x004C($sp) -/* 00454 80B43E14 0C024F46 */ jal func_80093D18 -/* 00458 80B43E18 8DE40000 */ lw $a0, 0x0000($t7) ## 00000000 -/* 0045C 80B43E1C 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00460 80B43E20 3C19DB06 */ lui $t9, 0xDB06 ## $t9 = DB060000 -/* 00464 80B43E24 37390020 */ ori $t9, $t9, 0x0020 ## $t9 = DB060020 -/* 00468 80B43E28 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008 -/* 0046C 80B43E2C AE1802C0 */ sw $t8, 0x02C0($s0) ## 000002C0 -/* 00470 80B43E30 AC590000 */ sw $t9, 0x0000($v0) ## 00000000 -/* 00474 80B43E34 8FA80048 */ lw $t0, 0x0048($sp) -/* 00478 80B43E38 3C0480B4 */ lui $a0, %hi(D_80B43F64) ## $a0 = 80B40000 -/* 0047C 80B43E3C 3C0F8016 */ lui $t7, %hi(gSegments) -/* 00480 80B43E40 91090152 */ lbu $t1, 0x0152($t0) ## 00000152 -/* 00484 80B43E44 3C0100FF */ lui $at, 0x00FF ## $at = 00FF0000 -/* 00488 80B43E48 3421FFFF */ ori $at, $at, 0xFFFF ## $at = 00FFFFFF -/* 0048C 80B43E4C 00095080 */ sll $t2, $t1, 2 -/* 00490 80B43E50 008A2021 */ addu $a0, $a0, $t2 -/* 00494 80B43E54 8C843F64 */ lw $a0, %lo(D_80B43F64)($a0) -/* 00498 80B43E58 3C09DA38 */ lui $t1, 0xDA38 ## $t1 = DA380000 -/* 0049C 80B43E5C 35290003 */ ori $t1, $t1, 0x0003 ## $t1 = DA380003 -/* 004A0 80B43E60 00046100 */ sll $t4, $a0, 4 -/* 004A4 80B43E64 000C6F02 */ srl $t5, $t4, 28 -/* 004A8 80B43E68 000D7080 */ sll $t6, $t5, 2 -/* 004AC 80B43E6C 01EE7821 */ addu $t7, $t7, $t6 -/* 004B0 80B43E70 8DEF6FA8 */ lw $t7, %lo(gSegments)($t7) -/* 004B4 80B43E74 00815824 */ and $t3, $a0, $at -/* 004B8 80B43E78 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 004BC 80B43E7C 016FC021 */ addu $t8, $t3, $t7 -/* 004C0 80B43E80 0301C821 */ addu $t9, $t8, $at -/* 004C4 80B43E84 AC590004 */ sw $t9, 0x0004($v0) ## 00000004 -/* 004C8 80B43E88 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 004CC 80B43E8C 3C0580B4 */ lui $a1, %hi(D_80B43F84) ## $a1 = 80B40000 -/* 004D0 80B43E90 24A53F84 */ addiu $a1, $a1, %lo(D_80B43F84) ## $a1 = 80B43F84 -/* 004D4 80B43E94 24480008 */ addiu $t0, $v0, 0x0008 ## $t0 = 00000008 -/* 004D8 80B43E98 AE0802C0 */ sw $t0, 0x02C0($s0) ## 000002C0 -/* 004DC 80B43E9C AC490000 */ sw $t1, 0x0000($v0) ## 00000000 -/* 004E0 80B43EA0 8FAA004C */ lw $t2, 0x004C($sp) -/* 004E4 80B43EA4 24060175 */ addiu $a2, $zero, 0x0175 ## $a2 = 00000175 -/* 004E8 80B43EA8 8D440000 */ lw $a0, 0x0000($t2) ## 00000000 -/* 004EC 80B43EAC 0C0346A2 */ jal Matrix_NewMtx -/* 004F0 80B43EB0 AFA20028 */ sw $v0, 0x0028($sp) -/* 004F4 80B43EB4 8FA30028 */ lw $v1, 0x0028($sp) -/* 004F8 80B43EB8 3C0E0600 */ lui $t6, 0x0600 ## $t6 = 06000000 -/* 004FC 80B43EBC 25CE0970 */ addiu $t6, $t6, 0x0970 ## $t6 = 06000970 -/* 00500 80B43EC0 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00504 80B43EC4 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00508 80B43EC8 3C0DDE00 */ lui $t5, 0xDE00 ## $t5 = DE000000 -/* 0050C 80B43ECC 3C0680B4 */ lui $a2, %hi(D_80B43F98) ## $a2 = 80B40000 -/* 00510 80B43ED0 244C0008 */ addiu $t4, $v0, 0x0008 ## $t4 = 00000008 -/* 00514 80B43ED4 AE0C02C0 */ sw $t4, 0x02C0($s0) ## 000002C0 -/* 00518 80B43ED8 AC4E0004 */ sw $t6, 0x0004($v0) ## 00000004 -/* 0051C 80B43EDC AC4D0000 */ sw $t5, 0x0000($v0) ## 00000000 -/* 00520 80B43EE0 8FAB004C */ lw $t3, 0x004C($sp) -/* 00524 80B43EE4 24C63F98 */ addiu $a2, $a2, %lo(D_80B43F98) ## $a2 = 80B43F98 -/* 00528 80B43EE8 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE8 -/* 0052C 80B43EEC 2407017A */ addiu $a3, $zero, 0x017A ## $a3 = 0000017A -/* 00530 80B43EF0 0C031AD5 */ jal Graph_CloseDisps -/* 00534 80B43EF4 8D650000 */ lw $a1, 0x0000($t3) ## 00000000 -/* 00538 80B43EF8 8FBF001C */ lw $ra, 0x001C($sp) -/* 0053C 80B43EFC 8FB00018 */ lw $s0, 0x0018($sp) -/* 00540 80B43F00 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000 -/* 00544 80B43F04 03E00008 */ jr $ra -/* 00548 80B43F08 00000000 */ nop -/* 0054C 80B43F0C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Init.s deleted file mode 100644 index 4d8be09664..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Init.s +++ /dev/null @@ -1,48 +0,0 @@ -glabel EnYukabyun_Init -/* 00000 80B439C0 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00004 80B439C4 AFA5002C */ sw $a1, 0x002C($sp) -/* 00008 80B439C8 AFBF001C */ sw $ra, 0x001C($sp) -/* 0000C 80B439CC AFB00018 */ sw $s0, 0x0018($sp) -/* 00010 80B439D0 3C0580B4 */ lui $a1, %hi(D_80B43F5C) ## $a1 = 80B40000 -/* 00014 80B439D4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00018 80B439D8 0C01E037 */ jal Actor_ProcessInitChain - -/* 0001C 80B439DC 24A53F5C */ addiu $a1, $a1, %lo(D_80B43F5C) ## $a1 = 80B43F5C -/* 00020 80B439E0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00024 80B439E4 3C073ECC */ lui $a3, 0x3ECC ## $a3 = 3ECC0000 -/* 00028 80B439E8 34E7CCCD */ ori $a3, $a3, 0xCCCD ## $a3 = 3ECCCCCD -/* 0002C 80B439EC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) -/* 00030 80B439F0 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 -/* 00034 80B439F4 0C00AC78 */ jal ActorShape_Init - -/* 00038 80B439F8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 -/* 0003C 80B439FC 26050154 */ addiu $a1, $s0, 0x0154 ## $a1 = 00000154 -/* 00040 80B43A00 AFA50020 */ sw $a1, 0x0020($sp) -/* 00044 80B43A04 0C0170D9 */ jal Collider_InitCylinder - -/* 00048 80B43A08 8FA4002C */ lw $a0, 0x002C($sp) -/* 0004C 80B43A0C 3C0780B4 */ lui $a3, %hi(D_80B43F30) ## $a3 = 80B40000 -/* 00050 80B43A10 8FA50020 */ lw $a1, 0x0020($sp) -/* 00054 80B43A14 24E73F30 */ addiu $a3, $a3, %lo(D_80B43F30) ## $a3 = 80B43F30 -/* 00058 80B43A18 8FA4002C */ lw $a0, 0x002C($sp) -/* 0005C 80B43A1C 0C01712B */ jal Collider_SetCylinder - -/* 00060 80B43A20 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00064 80B43A24 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 00068 80B43A28 3C0980B4 */ lui $t1, %hi(func_80B43A94) ## $t1 = 80B40000 -/* 0006C 80B43A2C 25293A94 */ addiu $t1, $t1, %lo(func_80B43A94) ## $t1 = 80B43A94 -/* 00070 80B43A30 25CF0001 */ addiu $t7, $t6, 0x0001 ## $t7 = 00000001 -/* 00074 80B43A34 A60F001C */ sh $t7, 0x001C($s0) ## 0000001C -/* 00078 80B43A38 9218001D */ lbu $t8, 0x001D($s0) ## 0000001D -/* 0007C 80B43A3C A2000152 */ sb $zero, 0x0152($s0) ## 00000152 -/* 00080 80B43A40 AE09014C */ sw $t1, 0x014C($s0) ## 0000014C -/* 00084 80B43A44 0018C880 */ sll $t9, $t8, 2 -/* 00088 80B43A48 0338C821 */ addu $t9, $t9, $t8 -/* 0008C 80B43A4C 0019C840 */ sll $t9, $t9, 1 -/* 00090 80B43A50 27280014 */ addiu $t0, $t9, 0x0014 ## $t0 = 00000014 -/* 00094 80B43A54 A6080150 */ sh $t0, 0x0150($s0) ## 00000150 -/* 00098 80B43A58 8FBF001C */ lw $ra, 0x001C($sp) -/* 0009C 80B43A5C 8FB00018 */ lw $s0, 0x0018($sp) -/* 000A0 80B43A60 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 000A4 80B43A64 03E00008 */ jr $ra -/* 000A8 80B43A68 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Update.s deleted file mode 100644 index 8dd70b04e9..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Update.s +++ /dev/null @@ -1,117 +0,0 @@ -glabel EnYukabyun_Update -/* 00280 80B43C40 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 00284 80B43C44 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00288 80B43C48 AFB10020 */ sw $s1, 0x0020($sp) -/* 0028C 80B43C4C AFB0001C */ sw $s0, 0x001C($sp) -/* 00290 80B43C50 90830164 */ lbu $v1, 0x0164($a0) ## 00000164 -/* 00294 80B43C54 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00298 80B43C58 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 0029C 80B43C5C 306E0002 */ andi $t6, $v1, 0x0002 ## $t6 = 00000000 -/* 002A0 80B43C60 15C00017 */ bne $t6, $zero, .L80B43CC0 -/* 002A4 80B43C64 26050024 */ addiu $a1, $s0, 0x0024 ## $a1 = 00000024 -/* 002A8 80B43C68 908F0165 */ lbu $t7, 0x0165($a0) ## 00000165 -/* 002AC 80B43C6C 31F80002 */ andi $t8, $t7, 0x0002 ## $t8 = 00000000 -/* 002B0 80B43C70 57000014 */ bnel $t8, $zero, .L80B43CC4 -/* 002B4 80B43C74 920F0165 */ lbu $t7, 0x0165($s0) ## 00000165 -/* 002B8 80B43C78 90990166 */ lbu $t9, 0x0166($a0) ## 00000166 -/* 002BC 80B43C7C 33280002 */ andi $t0, $t9, 0x0002 ## $t0 = 00000000 -/* 002C0 80B43C80 51000007 */ beql $t0, $zero, .L80B43CA0 -/* 002C4 80B43C84 8E02014C */ lw $v0, 0x014C($s0) ## 0000014C -/* 002C8 80B43C88 8C890160 */ lw $t1, 0x0160($a0) ## 00000160 -/* 002CC 80B43C8C 2401006B */ addiu $at, $zero, 0x006B ## $at = 0000006B -/* 002D0 80B43C90 852A0000 */ lh $t2, 0x0000($t1) ## 00000000 -/* 002D4 80B43C94 5541000B */ bnel $t2, $at, .L80B43CC4 -/* 002D8 80B43C98 920F0165 */ lbu $t7, 0x0165($s0) ## 00000165 -/* 002DC 80B43C9C 8E02014C */ lw $v0, 0x014C($s0) ## 0000014C -.L80B43CA0: -/* 002E0 80B43CA0 3C0B80B4 */ lui $t3, %hi(func_80B43B6C) ## $t3 = 80B40000 -/* 002E4 80B43CA4 256B3B6C */ addiu $t3, $t3, %lo(func_80B43B6C) ## $t3 = 80B43B6C -/* 002E8 80B43CA8 55620019 */ bnel $t3, $v0, .L80B43D10 -/* 002EC 80B43CAC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002F0 80B43CB0 960C0088 */ lhu $t4, 0x0088($s0) ## 00000088 -/* 002F4 80B43CB4 318D0008 */ andi $t5, $t4, 0x0008 ## $t5 = 00000000 -/* 002F8 80B43CB8 51A00015 */ beql $t5, $zero, .L80B43D10 -/* 002FC 80B43CBC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80B43CC0: -/* 00300 80B43CC0 920F0165 */ lbu $t7, 0x0165($s0) ## 00000165 -.L80B43CC4: -/* 00304 80B43CC4 92190166 */ lbu $t9, 0x0166($s0) ## 00000166 -/* 00308 80B43CC8 8E090004 */ lw $t1, 0x0004($s0) ## 00000004 -/* 0030C 80B43CCC 2401FFFA */ addiu $at, $zero, 0xFFFA ## $at = FFFFFFFA -/* 00310 80B43CD0 306EFFFD */ andi $t6, $v1, 0xFFFD ## $t6 = 00000000 -/* 00314 80B43CD4 31F8FFFD */ andi $t8, $t7, 0xFFFD ## $t8 = 00000000 -/* 00318 80B43CD8 3328FFFD */ andi $t0, $t9, 0xFFFD ## $t0 = 00000000 -/* 0031C 80B43CDC 01215024 */ and $t2, $t1, $at -/* 00320 80B43CE0 A20E0164 */ sb $t6, 0x0164($s0) ## 00000164 -/* 00324 80B43CE4 A2180165 */ sb $t8, 0x0165($s0) ## 00000165 -/* 00328 80B43CE8 A2080166 */ sb $t0, 0x0166($s0) ## 00000166 -/* 0032C 80B43CEC AE0A0004 */ sw $t2, 0x0004($s0) ## 00000004 -/* 00330 80B43CF0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00334 80B43CF4 2406001E */ addiu $a2, $zero, 0x001E ## $a2 = 0000001E -/* 00338 80B43CF8 0C01AEB6 */ jal Audio_PlaySoundAtPosition - -/* 0033C 80B43CFC 240738C0 */ addiu $a3, $zero, 0x38C0 ## $a3 = 000038C0 -/* 00340 80B43D00 3C0B80B4 */ lui $t3, %hi(func_80B43BCC) ## $t3 = 80B40000 -/* 00344 80B43D04 25623BCC */ addiu $v0, $t3, %lo(func_80B43BCC) ## $v0 = 80B43BCC -/* 00348 80B43D08 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 0034C 80B43D0C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80B43D10: -/* 00350 80B43D10 0040F809 */ jalr $ra, $v0 -/* 00354 80B43D14 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 00358 80B43D18 0C00B638 */ jal Actor_MoveForward - -/* 0035C 80B43D1C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00360 80B43D20 8E02014C */ lw $v0, 0x014C($s0) ## 0000014C -/* 00364 80B43D24 3C0C80B4 */ lui $t4, %hi(func_80B43A94) ## $t4 = 80B40000 -/* 00368 80B43D28 258C3A94 */ addiu $t4, $t4, %lo(func_80B43A94) ## $t4 = 80B43A94 -/* 0036C 80B43D2C 11820024 */ beq $t4, $v0, .L80B43DC0 -/* 00370 80B43D30 3C0D80B4 */ lui $t5, %hi(func_80B43BCC) ## $t5 = 80B40000 -/* 00374 80B43D34 25AD3BCC */ addiu $t5, $t5, %lo(func_80B43BCC) ## $t5 = 80B43BCC -/* 00378 80B43D38 11A20021 */ beq $t5, $v0, .L80B43DC0 -/* 0037C 80B43D3C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00380 80B43D40 3C014100 */ lui $at, 0x4100 ## $at = 41000000 -/* 00384 80B43D44 44812000 */ mtc1 $at, $f4 ## $f4 = 8.00 -/* 00388 80B43D48 240E0005 */ addiu $t6, $zero, 0x0005 ## $t6 = 00000005 -/* 0038C 80B43D4C AFAE0014 */ sw $t6, 0x0014($sp) -/* 00390 80B43D50 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00394 80B43D54 3C0640A0 */ lui $a2, 0x40A0 ## $a2 = 40A00000 -/* 00398 80B43D58 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000 -/* 0039C 80B43D5C 0C00B92D */ jal func_8002E4B4 -/* 003A0 80B43D60 E7A40010 */ swc1 $f4, 0x0010($sp) -/* 003A4 80B43D64 26050154 */ addiu $a1, $s0, 0x0154 ## $a1 = 00000154 -/* 003A8 80B43D68 AFA50028 */ sw $a1, 0x0028($sp) -/* 003AC 80B43D6C 0C0189B7 */ jal Collider_CylinderUpdate - -/* 003B0 80B43D70 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 003B4 80B43D74 8E0F0004 */ lw $t7, 0x0004($s0) ## 00000004 -/* 003B8 80B43D78 3C010100 */ lui $at, 0x0100 ## $at = 01000000 -/* 003BC 80B43D7C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 003C0 80B43D80 01E1C025 */ or $t8, $t7, $at ## $t8 = 01000000 -/* 003C4 80B43D84 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 003C8 80B43D88 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 003CC 80B43D8C AE180004 */ sw $t8, 0x0004($s0) ## 00000004 -/* 003D0 80B43D90 02212821 */ addu $a1, $s1, $at -/* 003D4 80B43D94 AFA5002C */ sw $a1, 0x002C($sp) -/* 003D8 80B43D98 0C0175E7 */ jal CollisionCheck_SetAT - ## CollisionCheck_setAT -/* 003DC 80B43D9C 8FA60028 */ lw $a2, 0x0028($sp) -/* 003E0 80B43DA0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 003E4 80B43DA4 8FA5002C */ lw $a1, 0x002C($sp) -/* 003E8 80B43DA8 0C01767D */ jal CollisionCheck_SetAC - ## CollisionCheck_setAC -/* 003EC 80B43DAC 8FA60028 */ lw $a2, 0x0028($sp) -/* 003F0 80B43DB0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 003F4 80B43DB4 8FA5002C */ lw $a1, 0x002C($sp) -/* 003F8 80B43DB8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT -/* 003FC 80B43DBC 8FA60028 */ lw $a2, 0x0028($sp) -.L80B43DC0: -/* 00400 80B43DC0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00404 80B43DC4 0C00B56E */ jal Actor_SetHeight - -/* 00408 80B43DC8 3C054080 */ lui $a1, 0x4080 ## $a1 = 40800000 -/* 0040C 80B43DCC 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00410 80B43DD0 8FB0001C */ lw $s0, 0x001C($sp) -/* 00414 80B43DD4 8FB10020 */ lw $s1, 0x0020($sp) -/* 00418 80B43DD8 03E00008 */ jr $ra -/* 0041C 80B43DDC 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43A94.s b/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43A94.s deleted file mode 100644 index 98c04a0cfe..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43A94.s +++ /dev/null @@ -1,19 +0,0 @@ -glabel func_80B43A94 -/* 000D4 80B43A94 AFA50004 */ sw $a1, 0x0004($sp) -/* 000D8 80B43A98 84820150 */ lh $v0, 0x0150($a0) ## 00000150 -/* 000DC 80B43A9C 3C1980B4 */ lui $t9, %hi(func_80B43AD4) ## $t9 = 80B40000 -/* 000E0 80B43AA0 10400003 */ beq $v0, $zero, .L80B43AB0 -/* 000E4 80B43AA4 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 000E8 80B43AA8 A48E0150 */ sh $t6, 0x0150($a0) ## 00000150 -/* 000EC 80B43AAC 84820150 */ lh $v0, 0x0150($a0) ## 00000150 -.L80B43AB0: -/* 000F0 80B43AB0 14400006 */ bne $v0, $zero, .L80B43ACC -/* 000F4 80B43AB4 00000000 */ nop -/* 000F8 80B43AB8 8C8F0004 */ lw $t7, 0x0004($a0) ## 00000004 -/* 000FC 80B43ABC 27393AD4 */ addiu $t9, $t9, %lo(func_80B43AD4) ## $t9 = 80B43AD4 -/* 00100 80B43AC0 AC99014C */ sw $t9, 0x014C($a0) ## 0000014C -/* 00104 80B43AC4 35F81005 */ ori $t8, $t7, 0x1005 ## $t8 = 00001005 -/* 00108 80B43AC8 AC980004 */ sw $t8, 0x0004($a0) ## 00000004 -.L80B43ACC: -/* 0010C 80B43ACC 03E00008 */ jr $ra -/* 00110 80B43AD0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43AD4.s b/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43AD4.s deleted file mode 100644 index e0e782b4e6..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43AD4.s +++ /dev/null @@ -1,41 +0,0 @@ -glabel func_80B43AD4 -/* 00114 80B43AD4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00118 80B43AD8 AFBF0014 */ sw $ra, 0x0014($sp) -/* 0011C 80B43ADC AFA5001C */ sw $a1, 0x001C($sp) -/* 00120 80B43AE0 848E0150 */ lh $t6, 0x0150($a0) ## 00000150 -/* 00124 80B43AE4 849800B6 */ lh $t8, 0x00B6($a0) ## 000000B6 -/* 00128 80B43AE8 3C0980B4 */ lui $t1, %hi(func_80B43B6C) ## $t1 = 80B40000 -/* 0012C 80B43AEC 25CF00A0 */ addiu $t7, $t6, 0x00A0 ## $t7 = 000000A0 -/* 00130 80B43AF0 A48F0150 */ sh $t7, 0x0150($a0) ## 00000150 -/* 00134 80B43AF4 84820150 */ lh $v0, 0x0150($a0) ## 00000150 -/* 00138 80B43AF8 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 0013C 80B43AFC 25293B6C */ addiu $t1, $t1, %lo(func_80B43B6C) ## $t1 = 80B43B6C -/* 00140 80B43B00 0302C821 */ addu $t9, $t8, $v0 -/* 00144 80B43B04 28412000 */ slti $at, $v0, 0x2000 -/* 00148 80B43B08 14200007 */ bne $at, $zero, .L80B43B28 -/* 0014C 80B43B0C A49900B6 */ sh $t9, 0x00B6($a0) ## 000000B6 -/* 00150 80B43B10 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00154 80B43B14 8488008A */ lh $t0, 0x008A($a0) ## 0000008A -/* 00158 80B43B18 44812000 */ mtc1 $at, $f4 ## $f4 = 10.00 -/* 0015C 80B43B1C AC89014C */ sw $t1, 0x014C($a0) ## 0000014C -/* 00160 80B43B20 A4880032 */ sh $t0, 0x0032($a0) ## 00000032 -/* 00164 80B43B24 E4840068 */ swc1 $f4, 0x0068($a0) ## 00000068 -.L80B43B28: -/* 00168 80B43B28 3C0141F0 */ lui $at, 0x41F0 ## $at = 41F00000 -/* 0016C 80B43B2C 44814000 */ mtc1 $at, $f8 ## $f8 = 30.00 -/* 00170 80B43B30 C4E6000C */ lwc1 $f6, 0x000C($a3) ## 0000000C -/* 00174 80B43B34 AFA70018 */ sw $a3, 0x0018($sp) -/* 00178 80B43B38 24E40028 */ addiu $a0, $a3, 0x0028 ## $a0 = 00000028 -/* 0017C 80B43B3C 46083280 */ add.s $f10, $f6, $f8 -/* 00180 80B43B40 3C063F80 */ lui $a2, 0x3F80 ## $a2 = 3F800000 -/* 00184 80B43B44 44055000 */ mfc1 $a1, $f10 -/* 00188 80B43B48 0C01DE80 */ jal Math_ApproxF - -/* 0018C 80B43B4C 00000000 */ nop -/* 00190 80B43B50 8FA40018 */ lw $a0, 0x0018($sp) -/* 00194 80B43B54 0C00BE5D */ jal func_8002F974 -/* 00198 80B43B58 24053179 */ addiu $a1, $zero, 0x3179 ## $a1 = 00003179 -/* 0019C 80B43B5C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 001A0 80B43B60 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 001A4 80B43B64 03E00008 */ jr $ra -/* 001A8 80B43B68 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43B6C.s b/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43B6C.s deleted file mode 100644 index e7bb43114d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43B6C.s +++ /dev/null @@ -1,33 +0,0 @@ -.late_rodata -glabel D_80B43FAC - .float 5000.0 - -.text -glabel func_80B43B6C -/* 001AC 80B43B6C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 001B0 80B43B70 AFBF0014 */ sw $ra, 0x0014($sp) -/* 001B4 80B43B74 AFA5001C */ sw $a1, 0x001C($sp) -/* 001B8 80B43B78 848E00B6 */ lh $t6, 0x00B6($a0) ## 000000B6 -/* 001BC 80B43B7C 848F0150 */ lh $t7, 0x0150($a0) ## 00000150 -/* 001C0 80B43B80 3C0180B4 */ lui $at, %hi(D_80B43FAC) ## $at = 80B40000 -/* 001C4 80B43B84 C4860090 */ lwc1 $f6, 0x0090($a0) ## 00000090 -/* 001C8 80B43B88 01CFC021 */ addu $t8, $t6, $t7 -/* 001CC 80B43B8C A49800B6 */ sh $t8, 0x00B6($a0) ## 000000B6 -/* 001D0 80B43B90 C4243FAC */ lwc1 $f4, %lo(D_80B43FAC)($at) -/* 001D4 80B43B94 4606203C */ c.lt.s $f4, $f6 -/* 001D8 80B43B98 00000000 */ nop -/* 001DC 80B43B9C 45000005 */ bc1f .L80B43BB4 -/* 001E0 80B43BA0 00000000 */ nop -/* 001E4 80B43BA4 0C00B55C */ jal Actor_Kill - -/* 001E8 80B43BA8 00000000 */ nop -/* 001EC 80B43BAC 10000004 */ beq $zero, $zero, .L80B43BC0 -/* 001F0 80B43BB0 8FBF0014 */ lw $ra, 0x0014($sp) -.L80B43BB4: -/* 001F4 80B43BB4 0C00BE5D */ jal func_8002F974 -/* 001F8 80B43BB8 24053179 */ addiu $a1, $zero, 0x3179 ## $a1 = 00003179 -/* 001FC 80B43BBC 8FBF0014 */ lw $ra, 0x0014($sp) -.L80B43BC0: -/* 00200 80B43BC0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00204 80B43BC4 03E00008 */ jr $ra -/* 00208 80B43BC8 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43BCC.s b/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43BCC.s deleted file mode 100644 index 2b0f7d4ed9..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43BCC.s +++ /dev/null @@ -1,31 +0,0 @@ -glabel func_80B43BCC -/* 0020C 80B43BCC 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 00210 80B43BD0 AFA40030 */ sw $a0, 0x0030($sp) -/* 00214 80B43BD4 AFA50034 */ sw $a1, 0x0034($sp) -/* 00218 80B43BD8 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 0021C 80B43BDC 8FA50030 */ lw $a1, 0x0030($sp) -/* 00220 80B43BE0 3C090600 */ lui $t1, 0x0600 ## $t1 = 06000000 -/* 00224 80B43BE4 AFBF002C */ sw $ra, 0x002C($sp) -/* 00228 80B43BE8 25290A60 */ addiu $t1, $t1, 0x0A60 ## $t1 = 06000A60 -/* 0022C 80B43BEC 240E0514 */ addiu $t6, $zero, 0x0514 ## $t6 = 00000514 -/* 00230 80B43BF0 240F012C */ addiu $t7, $zero, 0x012C ## $t7 = 0000012C -/* 00234 80B43BF4 2418000F */ addiu $t8, $zero, 0x000F ## $t8 = 0000000F -/* 00238 80B43BF8 2419005F */ addiu $t9, $zero, 0x005F ## $t9 = 0000005F -/* 0023C 80B43BFC 2408000A */ addiu $t0, $zero, 0x000A ## $t0 = 0000000A -/* 00240 80B43C00 AFA80020 */ sw $t0, 0x0020($sp) -/* 00244 80B43C04 AFB9001C */ sw $t9, 0x001C($sp) -/* 00248 80B43C08 AFB80018 */ sw $t8, 0x0018($sp) -/* 0024C 80B43C0C AFAF0014 */ sw $t7, 0x0014($sp) -/* 00250 80B43C10 AFAE0010 */ sw $t6, 0x0010($sp) -/* 00254 80B43C14 AFA90024 */ sw $t1, 0x0024($sp) -/* 00258 80B43C18 3C064100 */ lui $a2, 0x4100 ## $a2 = 41000000 -/* 0025C 80B43C1C 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00260 80B43C20 0C00A5E9 */ jal func_800297A4 -/* 00264 80B43C24 24A50024 */ addiu $a1, $a1, 0x0024 ## $a1 = 00000024 -/* 00268 80B43C28 0C00B55C */ jal Actor_Kill - -/* 0026C 80B43C2C 8FA40030 */ lw $a0, 0x0030($sp) -/* 00270 80B43C30 8FBF002C */ lw $ra, 0x002C($sp) -/* 00274 80B43C34 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 00278 80B43C38 03E00008 */ jr $ra -/* 0027C 80B43C3C 00000000 */ nop diff --git a/data/overlays/actors/z_en_yukabyun.data.s b/data/overlays/actors/z_en_yukabyun.data.s deleted file mode 100644 index faa33990d9..0000000000 --- a/data/overlays/actors/z_en_yukabyun.data.s +++ /dev/null @@ -1,24 +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 En_Yukabyun_InitVars - .word 0x006B0500, 0x00000010, 0x005F0000, 0x000001A0 -.word EnYukabyun_Init -.word EnYukabyun_Destroy -.word EnYukabyun_Update -.word EnYukabyun_Draw -glabel D_80B43F30 - .word 0x0A11093D, 0x10010000, 0x00000000, 0xFFCFFFFF, 0x00040000, 0xFFCFFFFF, 0x00000000, 0x09010100, 0x001C0008, 0x00000000, 0x00000000 -glabel D_80B43F5C - .word 0xC0500001, 0x304C0010 -glabel D_80B43F64 - .word 0x06000AF0, 0x06000000, 0x00000000 - diff --git a/data/overlays/actors/z_en_yukabyun.reloc.s b/data/overlays/actors/z_en_yukabyun.reloc.s deleted file mode 100644 index 625f9e6d48..0000000000 --- a/data/overlays/actors/z_en_yukabyun.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_80B43FB0 - .incbin "baserom/ovl_En_Yukabyun", 0x5F0, 0x000000A0 diff --git a/spec b/spec index 99fb1ac23a..9e9c208ffc 100644 --- a/spec +++ b/spec @@ -3392,8 +3392,7 @@ endseg beginseg name "ovl_En_Yukabyun" include "build/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.o" - include "build/data/overlays/actors/z_en_yukabyun.data.o" - include "build/data/overlays/actors/z_en_yukabyun.reloc.o" + include "build/src/overlays/actors/ovl_En_Yukabyun/ovl_En_Yukabyun_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index f95fc88045..3e708b9c59 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -15,7 +15,10 @@ void EnYukabyun_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx); void EnYukabyun_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void func_80B43A94(EnYukabyun* this, GlobalContext* globalCtx); +void func_80B43AD4(EnYukabyun* this, GlobalContext* globalCtx); +void func_80B43B6C(EnYukabyun* this, GlobalContext* globalCtx); + const ActorInit En_Yukabyun_InitVars = { ACTOR_EN_YUKABYUN, ACTORTYPE_ENEMY, @@ -27,19 +30,118 @@ const ActorInit En_Yukabyun_InitVars = { (ActorFunc)EnYukabyun_Update, (ActorFunc)EnYukabyun_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Destroy.s") +static ColliderCylinderInit sCylinderInit = { + { COLTYPE_UNK10, 0x11, 0x09, 0x3D, 0x10, COLSHAPE_CYLINDER }, + { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x01, 0x01 }, + { 28, 8, 0, { 0, 0, 0 } }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43A94.s") +static InitChainEntry sInitChain[] = { + ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE), + ICHAIN_F32(unk_4C, 16, ICHAIN_STOP), +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43AD4.s") +UNK_PTR D_80B43F64[] = { 0x06000AF0, 0x06000000}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43B6C.s") +extern UNK_TYPE D_06000A60; +extern Gfx D_06000970[]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yukabyun/func_80B43BCC.s") +void EnYukabyun_Init(Actor* thisx, GlobalContext* globalCtx) { + EnYukabyun* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Update.s") + Actor_ProcessInitChain(&this->actor, sInitChain); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 0.4f); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + this->actor.params++; + this->unk_152 = 0; + this->unk_150 = (u8)(this->actor.params) * 0xA + 0x14; + this->actionfunc = func_80B43A94; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yukabyun/EnYukabyun_Draw.s") +void EnYukabyun_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnYukabyun* this = THIS; + Collider_DestroyCylinder(globalCtx, &this->collider); +} + +void func_80B43A94(EnYukabyun* this, GlobalContext* globalCtx) { + if (this->unk_150 != 0) { + this->unk_150--; + } + if (this->unk_150 == 0) { + this->actor.flags |= 0x1005; + this->actionfunc = func_80B43AD4; + } +} + +void func_80B43AD4(EnYukabyun* this, GlobalContext* globalCtx) { + this->unk_150 += 0xA0; + this->actor.shape.rot.y += this->unk_150; + if (this->unk_150 >= 0x2000) { + this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.speedXZ = 10.0f; + this->actionfunc = func_80B43B6C; + } + Math_ApproxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 30.0f, 1.0f); + func_8002F974(&this->actor, NA_SE_EN_YUKABYUN_FLY - SFX_FLAG); +} + +void func_80B43B6C(EnYukabyun* this, GlobalContext* globalCtx) { + this->actor.shape.rot.y += this->unk_150; + if (this->actor.xzDistFromLink > 5000.0f) { + Actor_Kill(&this->actor); + return; + } + func_8002F974(&this->actor, NA_SE_EN_YUKABYUN_FLY - SFX_FLAG); +} + +void func_80B43BCC(EnYukabyun* this, GlobalContext* globalCtx) { + func_800297A4(globalCtx, &this->actor.posRot.pos, 8.0f, 0, 0x514, 0x12C, 0xF, 0x5F, 0xA, &D_06000A60); + Actor_Kill(&this->actor); +} + +void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { + EnYukabyun* this = THIS; + s32 pad; + + if (((this->collider.base.atFlags & 2) || (this->collider.base.acFlags & 2) || + ((this->collider.base.maskA & 2) && !(this->collider.base.oc->id == ACTOR_EN_YUKABYUN))) || + ((this->actionfunc == func_80B43B6C) && (this->actor.bgCheckFlags & 8))) { + this->collider.base.atFlags &= ~0x2; + this->collider.base.acFlags &= ~0x2; + this->collider.base.maskA &= ~0x2; + this->actor.flags &= ~0x5; + Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 30, NA_SE_EN_OCTAROCK_ROCK); + this->actionfunc = func_80B43BCC; + } + + this->actionfunc(this, globalCtx); + Actor_MoveForward(&this->actor); + + if (!(this->actionfunc == func_80B43A94 || this->actionfunc == func_80B43BCC)) { + func_8002E4B4(globalCtx, &this->actor, 5.0f, 20.0f, 8.0f, 5); + Collider_CylinderUpdate(&this->actor, &this->collider); + + this->actor.flags |= 0x1000000; + + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } + Actor_SetHeight(&this->actor, 4.0f); +} + +void EnYukabyun_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnYukabyun* this = THIS; + GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; + Gfx* dispRefs[4]; + + Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_yukabyun.c", 366); + func_80093D18(globalCtx->state.gfxCtx); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80B43F64[this->unk_152])); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_yukabyun.c", 373), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(gfxCtx->polyOpa.p++, D_06000970); + Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_yukabyun.c", 378); +} diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h index 0109174232..f335e4d1b4 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h @@ -6,9 +6,14 @@ struct EnYukabyun; +typedef void (*EnYukabyunActionFunc)(struct EnYukabyun*, GlobalContext*); + typedef struct EnYukabyun { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x54]; + /* 0x014C */ EnYukabyunActionFunc actionfunc; + /* 0x0150 */ s16 unk_150; + /* 0x0152 */ u8 unk_152; + /* 0x0154 */ ColliderCylinder collider; } EnYukabyun; // size = 0x01A0 extern const ActorInit En_Yukabyun_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 231840aed9..08140c3bcc 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -827,4 +827,8 @@ D_040184B0 = 0x040184B0; // z_bg_ingate D_060011B8 = 0x060011B8; -D_06001040 = 0x06001040; \ No newline at end of file +D_06001040 = 0x06001040; + +// z_en_yukabyun +D_06000A60 = 0x06000A60; +D_06000970 = 0x06000970;