diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Destroy.s b/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Destroy.s deleted file mode 100644 index 82a5a63d15..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Destroy.s +++ /dev/null @@ -1,12 +0,0 @@ -glabel EnSkjneedle_Destroy -/* 00094 80B01F44 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00098 80B01F48 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 0009C 80B01F4C AFBF0014 */ sw $ra, 0x0014($sp) -/* 000A0 80B01F50 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 000A4 80B01F54 0C0170EB */ jal Collider_DestroyCylinder - -/* 000A8 80B01F58 24C50194 */ addiu $a1, $a2, 0x0194 ## $a1 = 00000194 -/* 000AC 80B01F5C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 000B0 80B01F60 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 000B4 80B01F64 03E00008 */ jr $ra -/* 000B8 80B01F68 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Draw.s deleted file mode 100644 index caaa44e99a..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Draw.s +++ /dev/null @@ -1,68 +0,0 @@ -.rdata -glabel D_80B021C0 - .asciz "../z_en_skj_needle.c" - .balign 4 - -glabel D_80B021D8 - .asciz "../z_en_skj_needle.c" - .balign 4 - -glabel D_80B021F0 - .asciz "../z_en_skj_needle.c" - .balign 4 - -.text -glabel EnSkjneedle_Draw -/* 001DC 80B0208C 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8 -/* 001E0 80B02090 AFBF001C */ sw $ra, 0x001C($sp) -/* 001E4 80B02094 AFB00018 */ sw $s0, 0x0018($sp) -/* 001E8 80B02098 AFA40048 */ sw $a0, 0x0048($sp) -/* 001EC 80B0209C AFA5004C */ sw $a1, 0x004C($sp) -/* 001F0 80B020A0 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 001F4 80B020A4 3C0680B0 */ lui $a2, %hi(D_80B021C0) ## $a2 = 80B00000 -/* 001F8 80B020A8 24C621C0 */ addiu $a2, $a2, %lo(D_80B021C0) ## $a2 = 80B021C0 -/* 001FC 80B020AC 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE8 -/* 00200 80B020B0 240700C8 */ addiu $a3, $zero, 0x00C8 ## $a3 = 000000C8 -/* 00204 80B020B4 0C031AB1 */ jal Graph_OpenDisps -/* 00208 80B020B8 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 0020C 80B020BC 8FAF004C */ lw $t7, 0x004C($sp) -/* 00210 80B020C0 0C024F46 */ jal func_80093D18 -/* 00214 80B020C4 8DE40000 */ lw $a0, 0x0000($t7) ## 00000000 -/* 00218 80B020C8 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 0021C 80B020CC 3C19DA38 */ lui $t9, 0xDA38 ## $t9 = DA380000 -/* 00220 80B020D0 37390003 */ ori $t9, $t9, 0x0003 ## $t9 = DA380003 -/* 00224 80B020D4 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008 -/* 00228 80B020D8 AE1802C0 */ sw $t8, 0x02C0($s0) ## 000002C0 -/* 0022C 80B020DC AC590000 */ sw $t9, 0x0000($v0) ## 00000000 -/* 00230 80B020E0 8FA8004C */ lw $t0, 0x004C($sp) -/* 00234 80B020E4 3C0580B0 */ lui $a1, %hi(D_80B021D8) ## $a1 = 80B00000 -/* 00238 80B020E8 24A521D8 */ addiu $a1, $a1, %lo(D_80B021D8) ## $a1 = 80B021D8 -/* 0023C 80B020EC 8D040000 */ lw $a0, 0x0000($t0) ## 00000000 -/* 00240 80B020F0 240600CD */ addiu $a2, $zero, 0x00CD ## $a2 = 000000CD -/* 00244 80B020F4 0C0346A2 */ jal Matrix_NewMtx -/* 00248 80B020F8 AFA2002C */ sw $v0, 0x002C($sp) -/* 0024C 80B020FC 8FA3002C */ lw $v1, 0x002C($sp) -/* 00250 80B02100 3C0B0600 */ lui $t3, 0x0600 ## $t3 = 06000000 -/* 00254 80B02104 256B0EB0 */ addiu $t3, $t3, 0x0EB0 ## $t3 = 06000EB0 -/* 00258 80B02108 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 0025C 80B0210C 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00260 80B02110 3C0ADE00 */ lui $t2, 0xDE00 ## $t2 = DE000000 -/* 00264 80B02114 3C0680B0 */ lui $a2, %hi(D_80B021F0) ## $a2 = 80B00000 -/* 00268 80B02118 24490008 */ addiu $t1, $v0, 0x0008 ## $t1 = 00000008 -/* 0026C 80B0211C AE0902C0 */ sw $t1, 0x02C0($s0) ## 000002C0 -/* 00270 80B02120 AC4B0004 */ sw $t3, 0x0004($v0) ## 00000004 -/* 00274 80B02124 AC4A0000 */ sw $t2, 0x0000($v0) ## 00000000 -/* 00278 80B02128 8FAC004C */ lw $t4, 0x004C($sp) -/* 0027C 80B0212C 24C621F0 */ addiu $a2, $a2, %lo(D_80B021F0) ## $a2 = 80B021F0 -/* 00280 80B02130 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE8 -/* 00284 80B02134 240700D2 */ addiu $a3, $zero, 0x00D2 ## $a3 = 000000D2 -/* 00288 80B02138 0C031AD5 */ jal Graph_CloseDisps -/* 0028C 80B0213C 8D850000 */ lw $a1, 0x0000($t4) ## 00000000 -/* 00290 80B02140 8FBF001C */ lw $ra, 0x001C($sp) -/* 00294 80B02144 8FB00018 */ lw $s0, 0x0018($sp) -/* 00298 80B02148 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000 -/* 0029C 80B0214C 03E00008 */ jr $ra -/* 002A0 80B02150 00000000 */ nop -/* 002A4 80B02154 00000000 */ nop -/* 002A8 80B02158 00000000 */ nop -/* 002AC 80B0215C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Init.s deleted file mode 100644 index 85dc7c8827..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Init.s +++ /dev/null @@ -1,42 +0,0 @@ -glabel EnSkjneedle_Init -/* 00000 80B01EB0 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00004 80B01EB4 AFA5002C */ sw $a1, 0x002C($sp) -/* 00008 80B01EB8 AFBF001C */ sw $ra, 0x001C($sp) -/* 0000C 80B01EBC AFB00018 */ sw $s0, 0x0018($sp) -/* 00010 80B01EC0 3C0580B0 */ lui $a1, %hi(D_80B021AC) ## $a1 = 80B00000 -/* 00014 80B01EC4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00018 80B01EC8 0C01E037 */ jal Actor_ProcessInitChain - -/* 0001C 80B01ECC 24A521AC */ addiu $a1, $a1, %lo(D_80B021AC) ## $a1 = 80B021AC -/* 00020 80B01ED0 26050194 */ addiu $a1, $s0, 0x0194 ## $a1 = 00000194 -/* 00024 80B01ED4 AFA50020 */ sw $a1, 0x0020($sp) -/* 00028 80B01ED8 0C0170D9 */ jal Collider_InitCylinder - -/* 0002C 80B01EDC 8FA4002C */ lw $a0, 0x002C($sp) -/* 00030 80B01EE0 3C0780B0 */ lui $a3, %hi(D_80B02180) ## $a3 = 80B00000 -/* 00034 80B01EE4 8FA50020 */ lw $a1, 0x0020($sp) -/* 00038 80B01EE8 24E72180 */ addiu $a3, $a3, %lo(D_80B02180) ## $a3 = 80B02180 -/* 0003C 80B01EEC 8FA4002C */ lw $a0, 0x002C($sp) -/* 00040 80B01EF0 0C017114 */ jal Collider_SetCylinder_Set3 -/* 00044 80B01EF4 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00048 80B01EF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0004C 80B01EFC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) -/* 00050 80B01F00 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 -/* 00054 80B01F04 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 -/* 00058 80B01F08 0C00AC78 */ jal ActorShape_Init - -/* 0005C 80B01F0C 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000 -/* 00060 80B01F10 8E0E0004 */ lw $t6, 0x0004($s0) ## 00000004 -/* 00064 80B01F14 2401FFFE */ addiu $at, $zero, 0xFFFE ## $at = FFFFFFFE -/* 00068 80B01F18 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 -/* 0006C 80B01F1C 01C17824 */ and $t7, $t6, $at -/* 00070 80B01F20 AE0F0004 */ sw $t7, 0x0004($s0) ## 00000004 -/* 00074 80B01F24 34A5D70A */ ori $a1, $a1, 0xD70A ## $a1 = 3C23D70A -/* 00078 80B01F28 0C00B58B */ jal Actor_SetScale - -/* 0007C 80B01F2C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00080 80B01F30 8FBF001C */ lw $ra, 0x001C($sp) -/* 00084 80B01F34 8FB00018 */ lw $s0, 0x0018($sp) -/* 00088 80B01F38 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 0008C 80B01F3C 03E00008 */ jr $ra -/* 00090 80B01F40 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Update.s deleted file mode 100644 index 39cc2e2ef1..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Update.s +++ /dev/null @@ -1,71 +0,0 @@ -glabel EnSkjneedle_Update -/* 000EC 80B01F9C 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 000F0 80B01FA0 AFBF0024 */ sw $ra, 0x0024($sp) -/* 000F4 80B01FA4 AFB10020 */ sw $s1, 0x0020($sp) -/* 000F8 80B01FA8 AFB0001C */ sw $s0, 0x001C($sp) -/* 000FC 80B01FAC 848E01E0 */ lh $t6, 0x01E0($a0) ## 000001E0 -/* 00100 80B01FB0 848201E2 */ lh $v0, 0x01E2($a0) ## 000001E2 -/* 00104 80B01FB4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00108 80B01FB8 25CF0001 */ addiu $t7, $t6, 0x0001 ## $t7 = 00000001 -/* 0010C 80B01FBC 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 00110 80B01FC0 10400003 */ beq $v0, $zero, .L80B01FD0 -/* 00114 80B01FC4 A48F01E0 */ sh $t7, 0x01E0($a0) ## 000001E0 -/* 00118 80B01FC8 2458FFFF */ addiu $t8, $v0, 0xFFFF ## $t8 = FFFFFFFF -/* 0011C 80B01FCC A49801E2 */ sh $t8, 0x01E2($a0) ## 000001E2 -.L80B01FD0: -/* 00120 80B01FD0 0C2C07DB */ jal func_80B01F6C -/* 00124 80B01FD4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00128 80B01FD8 14400006 */ bne $v0, $zero, .L80B01FF4 -/* 0012C 80B01FDC 00000000 */ nop -/* 00130 80B01FE0 861901E2 */ lh $t9, 0x01E2($s0) ## 000001E2 -/* 00134 80B01FE4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00138 80B01FE8 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 -/* 0013C 80B01FEC 17200005 */ bne $t9, $zero, .L80B02004 -/* 00140 80B01FF0 00000000 */ nop -.L80B01FF4: -/* 00144 80B01FF4 0C00B55C */ jal Actor_Kill - -/* 00148 80B01FF8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0014C 80B01FFC 1000001F */ beq $zero, $zero, .L80B0207C -/* 00150 80B02000 8FBF0024 */ lw $ra, 0x0024($sp) -.L80B02004: -/* 00154 80B02004 0C00B58B */ jal Actor_SetScale - -/* 00158 80B02008 34A5D70A */ ori $a1, $a1, 0xD70A ## $a1 = 0000D70A -/* 0015C 80B0200C 26050194 */ addiu $a1, $s0, 0x0194 ## $a1 = 00000194 -/* 00160 80B02010 AFA50028 */ sw $a1, 0x0028($sp) -/* 00164 80B02014 0C0189B7 */ jal Collider_CylinderUpdate - -/* 00168 80B02018 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0016C 80B0201C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00170 80B02020 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 00174 80B02024 02212821 */ addu $a1, $s1, $at -/* 00178 80B02028 AFA5002C */ sw $a1, 0x002C($sp) -/* 0017C 80B0202C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00180 80B02030 0C0175E7 */ jal CollisionCheck_SetAT - ## CollisionCheck_setAT -/* 00184 80B02034 8FA60028 */ lw $a2, 0x0028($sp) -/* 00188 80B02038 8FA5002C */ lw $a1, 0x002C($sp) -/* 0018C 80B0203C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00190 80B02040 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT -/* 00194 80B02044 8FA60028 */ lw $a2, 0x0028($sp) -/* 00198 80B02048 0C00B638 */ jal Actor_MoveForward - -/* 0019C 80B0204C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001A0 80B02050 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 001A4 80B02054 44810000 */ mtc1 $at, $f0 ## $f0 = 20.00 -/* 001A8 80B02058 24080007 */ addiu $t0, $zero, 0x0007 ## $t0 = 00000007 -/* 001AC 80B0205C AFA80014 */ sw $t0, 0x0014($sp) -/* 001B0 80B02060 44060000 */ mfc1 $a2, $f0 -/* 001B4 80B02064 44070000 */ mfc1 $a3, $f0 -/* 001B8 80B02068 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 001BC 80B0206C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 001C0 80B02070 0C00B92D */ jal func_8002E4B4 -/* 001C4 80B02074 E7A00010 */ swc1 $f0, 0x0010($sp) -/* 001C8 80B02078 8FBF0024 */ lw $ra, 0x0024($sp) -.L80B0207C: -/* 001CC 80B0207C 8FB0001C */ lw $s0, 0x001C($sp) -/* 001D0 80B02080 8FB10020 */ lw $s1, 0x0020($sp) -/* 001D4 80B02084 03E00008 */ jr $ra -/* 001D8 80B02088 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/func_80B01F6C.s b/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/func_80B01F6C.s deleted file mode 100644 index 2377bdc60a..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Skjneedle/func_80B01F6C.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel func_80B01F6C -/* 000BC 80B01F6C 908E01A4 */ lbu $t6, 0x01A4($a0) ## 000001A4 -/* 000C0 80B01F70 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 000C4 80B01F74 31CF0002 */ andi $t7, $t6, 0x0002 ## $t7 = 00000000 -/* 000C8 80B01F78 11E00006 */ beq $t7, $zero, .L80B01F94 -/* 000CC 80B01F7C 00000000 */ nop -/* 000D0 80B01F80 909801A5 */ lbu $t8, 0x01A5($a0) ## 000001A5 -/* 000D4 80B01F84 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 000D8 80B01F88 3319FFFD */ andi $t9, $t8, 0xFFFD ## $t9 = 00000000 -/* 000DC 80B01F8C 03E00008 */ jr $ra -/* 000E0 80B01F90 A09901A5 */ sb $t9, 0x01A5($a0) ## 000001A5 -.L80B01F94: -/* 000E4 80B01F94 03E00008 */ jr $ra -/* 000E8 80B01F98 00000000 */ nop diff --git a/data/overlays/actors/z_en_skjneedle.data.s b/data/overlays/actors/z_en_skjneedle.data.s deleted file mode 100644 index 07b358ddbc..0000000000 --- a/data/overlays/actors/z_en_skjneedle.data.s +++ /dev/null @@ -1,20 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purposee registers - -.section .data - -glabel En_Skjneedle_InitVars - .word 0x01160500, 0x00000205, 0x010A0000, 0x000001E8 -.word EnSkjneedle_Init -.word EnSkjneedle_Destroy -.word EnSkjneedle_Update -.word EnSkjneedle_Draw -glabel D_80B02180 - .word 0x01110900, 0x01000000, 0x00000000, 0xFFCFFFFF, 0x00080000, 0xFFCFFFFF, 0x00000000, 0x01010100, 0x000A0004, 0xFFFE0000, 0x00000000 -glabel D_80B021AC - .word 0x801F0002, 0x304C001E, 0x00000000, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_en_skjneedle.reloc.s b/data/overlays/actors/z_en_skjneedle.reloc.s deleted file mode 100644 index eabe12bb50..0000000000 --- a/data/overlays/actors/z_en_skjneedle.reloc.s +++ /dev/null @@ -1,11 +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 purposee registers - -.section .rodata -glabel D_80B02210 - -.incbin "baserom/ovl_En_Skjneedle", 0x360, 0x00000060 diff --git a/spec b/spec index b197388522..d4a038c594 100644 --- a/spec +++ b/spec @@ -3214,8 +3214,7 @@ endseg beginseg name "ovl_En_Skjneedle" include "build/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.o" - include "build/data/overlays/actors/z_en_skjneedle.data.o" - include "build/data/overlays/actors/z_en_skjneedle.reloc.o" + include "build/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c index 00940ef27e..f37235e2e7 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -15,7 +15,10 @@ void EnSkjneedle_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnSkjneedle_Update(Actor* thisx, GlobalContext* globalCtx); void EnSkjneedle_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +s32 func_80B01F6C(EnSkjneedle* this); + +extern Gfx D_06000EB0[]; + const ActorInit En_Skjneedle_InitVars = { ACTOR_EN_SKJNEEDLE, ACTORTYPE_ENEMY, @@ -27,13 +30,72 @@ const ActorInit En_Skjneedle_InitVars = { (ActorFunc)EnSkjneedle_Update, (ActorFunc)EnSkjneedle_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Destroy.s") +static ColliderCylinderInit_Set3 sCylinderInit = { + { COLTYPE_UNK1, 0x11, 0x09, 0x00, COLSHAPE_CYLINDER }, + { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { 10, 4, -2, { 0, 0, 0 } }, +}; + +static InitChainEntry sInitChain[] = { + ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), + ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), +}; + +void EnSkjneedle_Init(Actor* thisx, GlobalContext* globalCtx) { + EnSkjneedle* this = THIS; + + Actor_ProcessInitChain(&this->actor, sInitChain); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 20.0f); + thisx->flags &= ~0x1; + Actor_SetScale(&this->actor, 0.01f); +} + +void EnSkjneedle_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnSkjneedle* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); +} + +s32 func_80B01F6C(EnSkjneedle* this) { + if (this->collider.base.atFlags & 2) { + this->collider.base.acFlags &= ~2; + return 1; + } + return 0; +} + +void EnSkjneedle_Update(Actor* thisx, GlobalContext* globalCtx) { + EnSkjneedle* this = THIS; + GlobalContext* preserve = globalCtx; // workaround to store globalCtx in $s1 and not on the stack -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skjneedle/func_80B01F6C.s") + this->unk_1E0++; + if (this->unk_1E2 != 0) { + this->unk_1E2--; + } + if (func_80B01F6C(this) || this->unk_1E2 == 0) { + Actor_Kill(&this->actor); + } else { + globalCtx = preserve; // workaround + Actor_SetScale(&this->actor, 0.01f); + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + Actor_MoveForward(&this->actor); + func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 7); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Update.s") +void EnSkjneedle_Draw(Actor* thisx, GlobalContext* globalCtx) { + GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; + Gfx* dispRefs[5]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skjneedle/EnSkjneedle_Draw.s") + Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_skj_needle.c", 200); + func_80093D18(globalCtx->state.gfxCtx); + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_skj_needle.c", 205), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(gfxCtx->polyOpa.p++, &D_06000EB0); + Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_skj_needle.c", 210); +} diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h index 8cc04ba7b2..d68581d638 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h @@ -8,7 +8,11 @@ struct EnSkjneedle; typedef struct EnSkjneedle { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x9C]; + /* 0x014C */ char unk_14C[0x48]; + /* 0x0194 */ ColliderCylinder collider; + /* 0x01E0 */ s16 unk_1E0; + /* 0x01E2 */ s16 unk_1E2; + /* 0x01E4 */ char unk_1E4[4]; } EnSkjneedle; // size = 0x01E8 extern const ActorInit En_Skjneedle_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index ddc68b6b7e..e4d4bd4a67 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -549,6 +549,9 @@ D_06002CE4 = 0x06002CE4; D_06002650 = 0x06002650; D_06003858 = 0x06003858; +// z_en_skjneedle +D_06000EB0 = 0x06000EB0; + // z_en_heishi3 D_0600BAC8 = 0x0600BAC8; D_06005C30 = 0x06005C30;