From c68d752813309b60dc35569bc9668b4d3a81e86a Mon Sep 17 00:00:00 2001 From: gamestabled <55638330+gamestabled@users.noreply.github.com> Date: Tue, 26 May 2020 20:05:09 -0400 Subject: [PATCH] EnHata OK (#155) * EnHata OK * made/attempted suggested changes. still havent been able to fix the THIS in Update --- .../actors/ovl_En_Hata/EnHata_Destroy.s | 17 -- .../overlays/actors/ovl_En_Hata/EnHata_Draw.s | 37 ----- .../overlays/actors/ovl_En_Hata/EnHata_Init.s | 97 ------------ .../actors/ovl_En_Hata/EnHata_Update.s | 147 ------------------ .../actors/ovl_En_Hata/func_80A510E4.s | 35 ----- .../actors/ovl_En_Hata/func_80A51164.s | 6 - data/overlays/actors/z_en_hata.data.s | 21 --- data/overlays/actors/z_en_hata.reloc.s | 13 -- spec | 3 +- src/overlays/actors/ovl_En_Hata/z_en_hata.c | 104 ++++++++++++- src/overlays/actors/ovl_En_Hata/z_en_hata.h | 14 +- undefined_syms.txt | 5 + 12 files changed, 111 insertions(+), 388 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A510E4.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A51164.s delete mode 100644 data/overlays/actors/z_en_hata.data.s delete mode 100644 data/overlays/actors/z_en_hata.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Destroy.s b/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Destroy.s deleted file mode 100644 index 827da6d433..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Destroy.s +++ /dev/null @@ -1,17 +0,0 @@ -glabel EnHata_Destroy -/* 0013C 80A50E8C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00140 80A50E90 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00144 80A50E94 AFA40018 */ sw $a0, 0x0018($sp) -/* 00148 80A50E98 24840164 */ addiu $a0, $a0, 0x0164 ## $a0 = 00000164 -/* 0014C 80A50E9C 0C0295BC */ jal SkelAnime_Free -/* 00150 80A50EA0 AFA5001C */ sw $a1, 0x001C($sp) -/* 00154 80A50EA4 8FA4001C */ lw $a0, 0x001C($sp) -/* 00158 80A50EA8 8FAE0018 */ lw $t6, 0x0018($sp) -/* 0015C 80A50EAC 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 00160 80A50EB0 0C00FB56 */ jal DynaPolyInfo_Free - ## DynaPolyInfo_delReserve -/* 00164 80A50EB4 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C -/* 00168 80A50EB8 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0016C 80A50EBC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00170 80A50EC0 03E00008 */ jr $ra -/* 00174 80A50EC4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Draw.s deleted file mode 100644 index 683a08e787..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Draw.s +++ /dev/null @@ -1,37 +0,0 @@ -.late_rodata -glabel D_80A5126C - .float 1.1 - -.text -glabel EnHata_Draw -/* 00428 80A51178 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 0042C 80A5117C AFBF001C */ sw $ra, 0x001C($sp) -/* 00430 80A51180 AFA40020 */ sw $a0, 0x0020($sp) -/* 00434 80A51184 AFA50024 */ sw $a1, 0x0024($sp) -/* 00438 80A51188 0C0250F2 */ jal func_800943C8 -/* 0043C 80A5118C 8CA40000 */ lw $a0, 0x0000($a1) ## 00000000 -/* 00440 80A51190 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 00444 80A51194 44816000 */ mtc1 $at, $f12 ## $f12 = 1.00 -/* 00448 80A51198 3C0180A5 */ lui $at, %hi(D_80A5126C) ## $at = 80A50000 -/* 0044C 80A5119C C42E126C */ lwc1 $f14, %lo(D_80A5126C)($at) -/* 00450 80A511A0 44066000 */ mfc1 $a2, $f12 -/* 00454 80A511A4 0C0342A3 */ jal Matrix_Scale -/* 00458 80A511A8 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 0045C 80A511AC 8FA20020 */ lw $v0, 0x0020($sp) -/* 00460 80A511B0 3C0F80A5 */ lui $t7, %hi(func_80A51164) ## $t7 = 80A50000 -/* 00464 80A511B4 25EF1164 */ addiu $t7, $t7, %lo(func_80A51164) ## $t7 = 80A51164 -/* 00468 80A511B8 3C0780A5 */ lui $a3, %hi(func_80A510E4) ## $a3 = 80A50000 -/* 0046C 80A511BC 8C450168 */ lw $a1, 0x0168($v0) ## 00000168 -/* 00470 80A511C0 8C460184 */ lw $a2, 0x0184($v0) ## 00000184 -/* 00474 80A511C4 AFAF0010 */ sw $t7, 0x0010($sp) -/* 00478 80A511C8 24E710E4 */ addiu $a3, $a3, %lo(func_80A510E4) ## $a3 = 80A510E4 -/* 0047C 80A511CC 8FA40024 */ lw $a0, 0x0024($sp) -/* 00480 80A511D0 0C028572 */ jal SkelAnime_Draw - -/* 00484 80A511D4 AFA20014 */ sw $v0, 0x0014($sp) -/* 00488 80A511D8 8FBF001C */ lw $ra, 0x001C($sp) -/* 0048C 80A511DC 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00490 80A511E0 03E00008 */ jr $ra -/* 00494 80A511E4 00000000 */ nop -/* 00498 80A511E8 00000000 */ nop -/* 0049C 80A511EC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Init.s deleted file mode 100644 index cfa5c1be6c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Init.s +++ /dev/null @@ -1,97 +0,0 @@ -.late_rodata -glabel D_80A51260 - .float 550.0 -glabel D_80A51264 - .float 2200.0 -glabel D_80A51268 - .float 65535.0 - -.text -glabel EnHata_Init -/* 00000 80A50D50 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8 -/* 00004 80A50D54 AFB00028 */ sw $s0, 0x0028($sp) -/* 00008 80A50D58 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0000C 80A50D5C AFBF002C */ sw $ra, 0x002C($sp) -/* 00010 80A50D60 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 00014 80A50D64 AFA5004C */ sw $a1, 0x004C($sp) -/* 00018 80A50D68 AFA0003C */ sw $zero, 0x003C($sp) -/* 0001C 80A50D6C 0C028800 */ jal SkelAnime_GetFrameCount - -/* 00020 80A50D70 24840444 */ addiu $a0, $a0, 0x0444 ## $a0 = 06000444 -/* 00024 80A50D74 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00 -/* 00028 80A50D78 3C053C5A */ lui $a1, 0x3C5A ## $a1 = 3C5A0000 -/* 0002C 80A50D7C 34A5740E */ ori $a1, $a1, 0x740E ## $a1 = 3C5A740E -/* 00030 80A50D80 468021A0 */ cvt.s.w $f6, $f4 -/* 00034 80A50D84 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00038 80A50D88 0C00B58B */ jal Actor_SetScale - -/* 0003C 80A50D8C E7A60038 */ swc1 $f6, 0x0038($sp) -/* 00040 80A50D90 26050164 */ addiu $a1, $s0, 0x0164 ## $a1 = 00000164 -/* 00044 80A50D94 3C060600 */ lui $a2, 0x0600 ## $a2 = 06000000 -/* 00048 80A50D98 3C070600 */ lui $a3, 0x0600 ## $a3 = 06000000 -/* 0004C 80A50D9C 24E70444 */ addiu $a3, $a3, 0x0444 ## $a3 = 06000444 -/* 00050 80A50DA0 24C62FD0 */ addiu $a2, $a2, 0x2FD0 ## $a2 = 06002FD0 -/* 00054 80A50DA4 AFA50034 */ sw $a1, 0x0034($sp) -/* 00058 80A50DA8 8FA4004C */ lw $a0, 0x004C($sp) -/* 0005C 80A50DAC AFA00010 */ sw $zero, 0x0010($sp) -/* 00060 80A50DB0 AFA00014 */ sw $zero, 0x0014($sp) -/* 00064 80A50DB4 0C02915F */ jal SkelAnime_Init - -/* 00068 80A50DB8 AFA00018 */ sw $zero, 0x0018($sp) -/* 0006C 80A50DBC 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 00070 80A50DC0 C7A80038 */ lwc1 $f8, 0x0038($sp) -/* 00074 80A50DC4 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 00078 80A50DC8 44070000 */ mfc1 $a3, $f0 -/* 0007C 80A50DCC 24A50444 */ addiu $a1, $a1, 0x0444 ## $a1 = 06000444 -/* 00080 80A50DD0 8FA40034 */ lw $a0, 0x0034($sp) -/* 00084 80A50DD4 3C063F80 */ lui $a2, 0x3F80 ## $a2 = 3F800000 -/* 00088 80A50DD8 AFA00014 */ sw $zero, 0x0014($sp) -/* 0008C 80A50DDC E7A80010 */ swc1 $f8, 0x0010($sp) -/* 00090 80A50DE0 0C029468 */ jal SkelAnime_ChangeAnim - -/* 00094 80A50DE4 E7A00018 */ swc1 $f0, 0x0018($sp) -/* 00098 80A50DE8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0009C 80A50DEC 0C010D20 */ jal DynaPolyInfo_SetActorMove - -/* 000A0 80A50DF0 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 000A4 80A50DF4 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 000A8 80A50DF8 248400C0 */ addiu $a0, $a0, 0x00C0 ## $a0 = 060000C0 -/* 000AC 80A50DFC 0C010620 */ jal DynaPolyInfo_Alloc - -/* 000B0 80A50E00 27A5003C */ addiu $a1, $sp, 0x003C ## $a1 = FFFFFFF4 -/* 000B4 80A50E04 8FA4004C */ lw $a0, 0x004C($sp) -/* 000B8 80A50E08 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 000BC 80A50E0C 8FA7003C */ lw $a3, 0x003C($sp) -/* 000C0 80A50E10 0C00FA9D */ jal DynaPolyInfo_RegisterActor - ## DynaPolyInfo_setActor -/* 000C4 80A50E14 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 000C8 80A50E18 3C0143FA */ lui $at, 0x43FA ## $at = 43FA0000 -/* 000CC 80A50E1C 44815000 */ mtc1 $at, $f10 ## $f10 = 500.00 -/* 000D0 80A50E20 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 000D4 80A50E24 3C0180A5 */ lui $at, %hi(D_80A51260) ## $at = 80A50000 -/* 000D8 80A50E28 E60A00F8 */ swc1 $f10, 0x00F8($s0) ## 000000F8 -/* 000DC 80A50E2C C4301260 */ lwc1 $f16, %lo(D_80A51260)($at) -/* 000E0 80A50E30 3C0180A5 */ lui $at, %hi(D_80A51264) ## $at = 80A50000 -/* 000E4 80A50E34 240F0006 */ addiu $t7, $zero, 0x0006 ## $t7 = 00000006 -/* 000E8 80A50E38 E61000FC */ swc1 $f16, 0x00FC($s0) ## 000000FC -/* 000EC 80A50E3C C4321264 */ lwc1 $f18, %lo(D_80A51264)($at) -/* 000F0 80A50E40 241803E8 */ addiu $t8, $zero, 0x03E8 ## $t8 = 000003E8 -/* 000F4 80A50E44 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 000F8 80A50E48 A60F0272 */ sh $t7, 0x0272($s0) ## 00000272 -/* 000FC 80A50E4C A6180274 */ sh $t8, 0x0274($s0) ## 00000274 -/* 00100 80A50E50 A6190276 */ sh $t9, 0x0276($s0) ## 00000276 -/* 00104 80A50E54 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00108 80A50E58 E61200F4 */ swc1 $f18, 0x00F4($s0) ## 000000F4 -/* 0010C 80A50E5C 3C0180A5 */ lui $at, %hi(D_80A51268) ## $at = 80A50000 -/* 00110 80A50E60 C4241268 */ lwc1 $f4, %lo(D_80A51268)($at) -/* 00114 80A50E64 46040182 */ mul.s $f6, $f0, $f4 -/* 00118 80A50E68 4600320D */ trunc.w.s $f8, $f6 -/* 0011C 80A50E6C 44094000 */ mfc1 $t1, $f8 -/* 00120 80A50E70 00000000 */ nop -/* 00124 80A50E74 A6090278 */ sh $t1, 0x0278($s0) ## 00000278 -/* 00128 80A50E78 8FBF002C */ lw $ra, 0x002C($sp) -/* 0012C 80A50E7C 8FB00028 */ lw $s0, 0x0028($sp) -/* 00130 80A50E80 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000 -/* 00134 80A50E84 03E00008 */ jr $ra -/* 00138 80A50E88 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Update.s deleted file mode 100644 index 97a9e6af74..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Update.s +++ /dev/null @@ -1,147 +0,0 @@ -glabel EnHata_Update -/* 00178 80A50EC8 27BDFFA0 */ addiu $sp, $sp, 0xFFA0 ## $sp = FFFFFFA0 -/* 0017C 80A50ECC 3C0F80A5 */ lui $t7, %hi(D_80A51248) ## $t7 = 80A50000 -/* 00180 80A50ED0 AFBF002C */ sw $ra, 0x002C($sp) -/* 00184 80A50ED4 AFB20028 */ sw $s2, 0x0028($sp) -/* 00188 80A50ED8 AFB10024 */ sw $s1, 0x0024($sp) -/* 0018C 80A50EDC AFB00020 */ sw $s0, 0x0020($sp) -/* 00190 80A50EE0 25EF1248 */ addiu $t7, $t7, %lo(D_80A51248) ## $t7 = 80A51248 -/* 00194 80A50EE4 8DF90000 */ lw $t9, 0x0000($t7) ## 80A51248 -/* 00198 80A50EE8 27AE0048 */ addiu $t6, $sp, 0x0048 ## $t6 = FFFFFFE8 -/* 0019C 80A50EEC 8DF80004 */ lw $t8, 0x0004($t7) ## 80A5124C -/* 001A0 80A50EF0 ADD90000 */ sw $t9, 0x0000($t6) ## FFFFFFE8 -/* 001A4 80A50EF4 8DF90008 */ lw $t9, 0x0008($t7) ## 80A51250 -/* 001A8 80A50EF8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 001AC 80A50EFC 00A09025 */ or $s2, $a1, $zero ## $s2 = 00000000 -/* 001B0 80A50F00 24840164 */ addiu $a0, $a0, 0x0164 ## $a0 = 00000164 -/* 001B4 80A50F04 ADD80004 */ sw $t8, 0x0004($t6) ## FFFFFFEC -/* 001B8 80A50F08 0C02927F */ jal SkelAnime_FrameUpdateMatrix - -/* 001BC 80A50F0C ADD90008 */ sw $t9, 0x0008($t6) ## FFFFFFF0 -/* 001C0 80A50F10 2409C000 */ addiu $t1, $zero, 0xC000 ## $t1 = FFFFC000 -/* 001C4 80A50F14 A609023E */ sh $t1, 0x023E($s0) ## 0000023E -/* 001C8 80A50F18 860A023E */ lh $t2, 0x023E($s0) ## 0000023E -/* 001CC 80A50F1C 3C01437F */ lui $at, 0x437F ## $at = 437F0000 -/* 001D0 80A50F20 44811000 */ mtc1 $at, $f2 ## $f2 = 255.00 -/* 001D4 80A50F24 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 001D8 80A50F28 02418821 */ addu $s1, $s2, $at -/* 001DC 80A50F2C A60A0208 */ sh $t2, 0x0208($s0) ## 00000208 -/* 001E0 80A50F30 862B0ACC */ lh $t3, 0x0ACC($s1) ## 00000ACC -/* 001E4 80A50F34 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 001E8 80A50F38 44806000 */ mtc1 $zero, $f12 ## $f12 = 0.00 -/* 001EC 80A50F3C 448B2000 */ mtc1 $t3, $f4 ## $f4 = 0.00 -/* 001F0 80A50F40 00320821 */ addu $at, $at, $s2 -/* 001F4 80A50F44 468021A0 */ cvt.s.w $f6, $f4 -/* 001F8 80A50F48 E7A6003C */ swc1 $f6, 0x003C($sp) -/* 001FC 80A50F4C 862C0ACE */ lh $t4, 0x0ACE($s1) ## 00000ACE -/* 00200 80A50F50 448C4000 */ mtc1 $t4, $f8 ## $f8 = 0.00 -/* 00204 80A50F54 00000000 */ nop -/* 00208 80A50F58 468042A0 */ cvt.s.w $f10, $f8 -/* 0020C 80A50F5C E7AA0040 */ swc1 $f10, 0x0040($sp) -/* 00210 80A50F60 862D0AD0 */ lh $t5, 0x0AD0($s1) ## 00000AD0 -/* 00214 80A50F64 448D8000 */ mtc1 $t5, $f16 ## $f16 = 0.00 -/* 00218 80A50F68 00000000 */ nop -/* 0021C 80A50F6C 468084A0 */ cvt.s.w $f18, $f16 -/* 00220 80A50F70 E7B20044 */ swc1 $f18, 0x0044($sp) -/* 00224 80A50F74 C6200AD4 */ lwc1 $f0, 0x0AD4($s1) ## 00000AD4 -/* 00228 80A50F78 4600103C */ c.lt.s $f2, $f0 -/* 0022C 80A50F7C 00000000 */ nop -/* 00230 80A50F80 45020004 */ bc1fl .L80A50F94 -/* 00234 80A50F84 460C003C */ c.lt.s $f0, $f12 -/* 00238 80A50F88 E4220AD4 */ swc1 $f2, 0x0AD4($at) ## 00010AD4 -/* 0023C 80A50F8C C6200AD4 */ lwc1 $f0, 0x0AD4($s1) ## 00000AD4 -/* 00240 80A50F90 460C003C */ c.lt.s $f0, $f12 -.L80A50F94: -/* 00244 80A50F94 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00248 80A50F98 00320821 */ addu $at, $at, $s2 -/* 0024C 80A50F9C 45000002 */ bc1f .L80A50FA8 -/* 00250 80A50FA0 00000000 */ nop -/* 00254 80A50FA4 E42C0AD4 */ swc1 $f12, 0x0AD4($at) ## 00010AD4 -.L80A50FA8: -/* 00258 80A50FA8 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 0025C 80A50FAC 00000000 */ nop -/* 00260 80A50FB0 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 00264 80A50FB4 44812000 */ mtc1 $at, $f4 ## $f4 = 0.50 -/* 00268 80A50FB8 00000000 */ nop -/* 0026C 80A50FBC 4600203C */ c.lt.s $f4, $f0 -/* 00270 80A50FC0 00000000 */ nop -/* 00274 80A50FC4 45020006 */ bc1fl .L80A50FE0 -/* 00278 80A50FC8 86180278 */ lh $t8, 0x0278($s0) ## 00000278 -/* 0027C 80A50FCC 860E0278 */ lh $t6, 0x0278($s0) ## 00000278 -/* 00280 80A50FD0 25CF1770 */ addiu $t7, $t6, 0x1770 ## $t7 = 00001770 -/* 00284 80A50FD4 10000004 */ beq $zero, $zero, .L80A50FE8 -/* 00288 80A50FD8 A60F0278 */ sh $t7, 0x0278($s0) ## 00000278 -/* 0028C 80A50FDC 86180278 */ lh $t8, 0x0278($s0) ## 00000278 -.L80A50FE0: -/* 00290 80A50FE0 27190BB8 */ addiu $t9, $t8, 0x0BB8 ## $t9 = 00000BB8 -/* 00294 80A50FE4 A6190278 */ sh $t9, 0x0278($s0) ## 00000278 -.L80A50FE8: -/* 00298 80A50FE8 0C01DE1C */ jal Math_Sins - ## sins? -/* 0029C 80A50FEC 86040278 */ lh $a0, 0x0278($s0) ## 00000278 -/* 002A0 80A50FF0 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 -/* 002A4 80A50FF4 44813000 */ mtc1 $at, $f6 ## $f6 = 80.00 -/* 002A8 80A50FF8 27A40048 */ addiu $a0, $sp, 0x0048 ## $a0 = FFFFFFE8 -/* 002AC 80A50FFC 27A5003C */ addiu $a1, $sp, 0x003C ## $a1 = FFFFFFDC -/* 002B0 80A51000 46060202 */ mul.s $f8, $f0, $f6 -/* 002B4 80A51004 0C01E027 */ jal Math_Vec3f_Pitch - -/* 002B8 80A51008 E7A80038 */ swc1 $f8, 0x0038($sp) -/* 002BC 80A5100C 3C01437F */ lui $at, 0x437F ## $at = 437F0000 -/* 002C0 80A51010 44815000 */ mtc1 $at, $f10 ## $f10 = 255.00 -/* 002C4 80A51014 C7B00038 */ lwc1 $f16, 0x0038($sp) -/* 002C8 80A51018 C6240AD4 */ lwc1 $f4, 0x0AD4($s1) ## 00000AD4 -/* 002CC 80A5101C 00021823 */ subu $v1, $zero, $v0 -/* 002D0 80A51020 46105481 */ sub.s $f18, $f10, $f16 -/* 002D4 80A51024 24093A98 */ addiu $t1, $zero, 0x3A98 ## $t1 = 00003A98 -/* 002D8 80A51028 01235023 */ subu $t2, $t1, $v1 -/* 002DC 80A5102C 448A8000 */ mtc1 $t2, $f16 ## $f16 = 0.00 -/* 002E0 80A51030 46122183 */ div.s $f6, $f4, $f18 -/* 002E4 80A51034 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 002E8 80A51038 44814000 */ mtc1 $at, $f8 ## $f8 = 1.00 -/* 002EC 80A5103C 860D0276 */ lh $t5, 0x0276($s0) ## 00000276 -/* 002F0 80A51040 46808120 */ cvt.s.w $f4, $f16 -/* 002F4 80A51044 86060272 */ lh $a2, 0x0272($s0) ## 00000272 -/* 002F8 80A51048 86070274 */ lh $a3, 0x0274($s0) ## 00000274 -/* 002FC 80A5104C 2604020E */ addiu $a0, $s0, 0x020E ## $a0 = 0000020E -/* 00300 80A51050 AFAD0010 */ sw $t5, 0x0010($sp) -/* 00304 80A51054 46064281 */ sub.s $f10, $f8, $f6 -/* 00308 80A51058 460A2482 */ mul.s $f18, $f4, $f10 -/* 0030C 80A5105C 4600920D */ trunc.w.s $f8, $f18 -/* 00310 80A51060 440C4000 */ mfc1 $t4, $f8 -/* 00314 80A51064 00000000 */ nop -/* 00318 80A51068 01834021 */ addu $t0, $t4, $v1 -/* 0031C 80A5106C 00082C00 */ sll $a1, $t0, 16 -/* 00320 80A51070 0C01E1A7 */ jal Math_SmoothScaleMaxMinS - -/* 00324 80A51074 00052C03 */ sra $a1, $a1, 16 -/* 00328 80A51078 860E020E */ lh $t6, 0x020E($s0) ## 0000020E -/* 0032C 80A5107C 27A40048 */ addiu $a0, $sp, 0x0048 ## $a0 = FFFFFFE8 -/* 00330 80A51080 27A5003C */ addiu $a1, $sp, 0x003C ## $a1 = FFFFFFDC -/* 00334 80A51084 0C01E01A */ jal Math_Vec3f_Yaw - -/* 00338 80A51088 A60E0244 */ sh $t6, 0x0244($s0) ## 00000244 -/* 0033C 80A5108C 00027823 */ subu $t7, $zero, $v0 -/* 00340 80A51090 A60F0210 */ sh $t7, 0x0210($s0) ## 00000210 -/* 00344 80A51094 86180210 */ lh $t8, 0x0210($s0) ## 00000210 -/* 00348 80A51098 3C013FA0 */ lui $at, 0x3FA0 ## $at = 3FA00000 -/* 0034C 80A5109C 44816000 */ mtc1 $at, $f12 ## $f12 = 1.25 -/* 00350 80A510A0 0C00CFBE */ jal Math_Rand_ZeroFloat - -/* 00354 80A510A4 A6180246 */ sh $t8, 0x0246($s0) ## 00000246 -/* 00358 80A510A8 3C01437F */ lui $at, 0x437F ## $at = 437F0000 -/* 0035C 80A510AC 44818000 */ mtc1 $at, $f16 ## $f16 = 255.00 -/* 00360 80A510B0 C6260AD4 */ lwc1 $f6, 0x0AD4($s1) ## 00000AD4 -/* 00364 80A510B4 3C014030 */ lui $at, 0x4030 ## $at = 40300000 -/* 00368 80A510B8 44815000 */ mtc1 $at, $f10 ## $f10 = 2.75 -/* 0036C 80A510BC 46103103 */ div.s $f4, $f6, $f16 -/* 00370 80A510C0 460A0480 */ add.s $f18, $f0, $f10 -/* 00374 80A510C4 46049202 */ mul.s $f8, $f18, $f4 -/* 00378 80A510C8 E6080180 */ swc1 $f8, 0x0180($s0) ## 00000180 -/* 0037C 80A510CC 8FBF002C */ lw $ra, 0x002C($sp) -/* 00380 80A510D0 8FB20028 */ lw $s2, 0x0028($sp) -/* 00384 80A510D4 8FB10024 */ lw $s1, 0x0024($sp) -/* 00388 80A510D8 8FB00020 */ lw $s0, 0x0020($sp) -/* 0038C 80A510DC 03E00008 */ jr $ra -/* 00390 80A510E0 27BD0060 */ addiu $sp, $sp, 0x0060 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A510E4.s b/asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A510E4.s deleted file mode 100644 index 235eea5e04..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A510E4.s +++ /dev/null @@ -1,35 +0,0 @@ -glabel func_80A510E4 -/* 00394 80A510E4 2401000C */ addiu $at, $zero, 0x000C ## $at = 0000000C -/* 00398 80A510E8 AFA40000 */ sw $a0, 0x0000($sp) -/* 0039C 80A510EC AFA60008 */ sw $a2, 0x0008($sp) -/* 003A0 80A510F0 10A10008 */ beq $a1, $at, .L80A51114 -/* 003A4 80A510F4 AFA7000C */ sw $a3, 0x000C($sp) -/* 003A8 80A510F8 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 003AC 80A510FC 10A10005 */ beq $a1, $at, .L80A51114 -/* 003B0 80A51100 2401000D */ addiu $at, $zero, 0x000D ## $at = 0000000D -/* 003B4 80A51104 10A10003 */ beq $a1, $at, .L80A51114 -/* 003B8 80A51108 24010004 */ addiu $at, $zero, 0x0004 ## $at = 00000004 -/* 003BC 80A5110C 14A10013 */ bne $a1, $at, .L80A5115C -/* 003C0 80A51110 00000000 */ nop -.L80A51114: -/* 003C4 80A51114 8FAE0014 */ lw $t6, 0x0014($sp) -/* 003C8 80A51118 00057880 */ sll $t7, $a1, 2 -/* 003CC 80A5111C 8FA20010 */ lw $v0, 0x0010($sp) -/* 003D0 80A51120 01E57823 */ subu $t7, $t7, $a1 -/* 003D4 80A51124 000F7840 */ sll $t7, $t7, 1 -/* 003D8 80A51128 01CF1821 */ addu $v1, $t6, $t7 -/* 003DC 80A5112C 847901F4 */ lh $t9, 0x01F4($v1) ## 000001F4 -/* 003E0 80A51130 84580000 */ lh $t8, 0x0000($v0) ## 00000000 -/* 003E4 80A51134 84490002 */ lh $t1, 0x0002($v0) ## 00000002 -/* 003E8 80A51138 844C0004 */ lh $t4, 0x0004($v0) ## 00000004 -/* 003EC 80A5113C 03194021 */ addu $t0, $t8, $t9 -/* 003F0 80A51140 A4480000 */ sh $t0, 0x0000($v0) ## 00000000 -/* 003F4 80A51144 846A01F6 */ lh $t2, 0x01F6($v1) ## 000001F6 -/* 003F8 80A51148 012A5821 */ addu $t3, $t1, $t2 -/* 003FC 80A5114C A44B0002 */ sh $t3, 0x0002($v0) ## 00000002 -/* 00400 80A51150 846D01F8 */ lh $t5, 0x01F8($v1) ## 000001F8 -/* 00404 80A51154 018D7021 */ addu $t6, $t4, $t5 -/* 00408 80A51158 A44E0004 */ sh $t6, 0x0004($v0) ## 00000004 -.L80A5115C: -/* 0040C 80A5115C 03E00008 */ jr $ra -/* 00410 80A51160 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A51164.s b/asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A51164.s deleted file mode 100644 index 21a7a0cb48..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A51164.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel func_80A51164 -/* 00414 80A51164 AFA40000 */ sw $a0, 0x0000($sp) -/* 00418 80A51168 AFA50004 */ sw $a1, 0x0004($sp) -/* 0041C 80A5116C AFA60008 */ sw $a2, 0x0008($sp) -/* 00420 80A51170 03E00008 */ jr $ra -/* 00424 80A51174 AFA7000C */ sw $a3, 0x000C($sp) diff --git a/data/overlays/actors/z_en_hata.data.s b/data/overlays/actors/z_en_hata.data.s deleted file mode 100644 index c41e363ad8..0000000000 --- a/data/overlays/actors/z_en_hata.data.s +++ /dev/null @@ -1,21 +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_Hata_InitVars - .word 0x00260600, 0x00000000, 0x00760000, 0x0000027C -.word EnHata_Init -.word EnHata_Destroy -.word EnHata_Update -.word EnHata_Draw -.word 0x0A000939, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000080, 0x00000000, 0x00050100, 0x001000F6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000 -glabel D_80A51248 - .word 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_en_hata.reloc.s b/data/overlays/actors/z_en_hata.reloc.s deleted file mode 100644 index 748cd0e680..0000000000 --- a/data/overlays/actors/z_en_hata.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_80A51270 - .incbin "baserom/ovl_En_Hata", 0x520, 0x00000060 diff --git a/spec b/spec index 1281fa170e..6d9590559b 100644 --- a/spec +++ b/spec @@ -2623,8 +2623,7 @@ endseg beginseg name "ovl_En_Hata" include "build/src/overlays/actors/ovl_En_Hata/z_en_hata.o" - include "build/data/overlays/actors/z_en_hata.data.o" - include "build/data/overlays/actors/z_en_hata.reloc.o" + include "build/src/overlays/actors/ovl_En_Hata/z_en_hata_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/src/overlays/actors/ovl_En_Hata/z_en_hata.c index 85722a3026..202cfe4f50 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -15,7 +15,6 @@ void EnHata_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnHata_Update(Actor* thisx, GlobalContext* globalCtx); void EnHata_Draw(Actor* thisx, GlobalContext* globalCtx); -/* const ActorInit En_Hata_InitVars = { ACTOR_EN_HATA, ACTORTYPE_PROP, @@ -27,15 +26,104 @@ const ActorInit En_Hata_InitVars = { (ActorFunc)EnHata_Update, (ActorFunc)EnHata_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Destroy.s") +static UNK_TYPE4 sUnusedData[] = { + 0x0A000939, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000080, 0x00000000, + 0x00050100, 0x001000F6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Update.s") +static Vec3f sVec = { 0, 0, 0 }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A510E4.s") +extern AnimationHeader D_06000444; +extern SkeletonHeader D_06002FD0; +extern UNK_TYPE D_060000C0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hata/func_80A51164.s") +void EnHata_Init(Actor* thisx, GlobalContext* globalCtx) { + EnHata* this = THIS; + u32 pad; + u32 temp; + f32 frameCount; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hata/EnHata_Draw.s") + temp = 0; + frameCount = (f32)SkelAnime_GetFrameCount(&D_06000444.genericHeader); + Actor_SetScale(&this->dyna.actor, 1.0f / 75.0f); + SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002FD0, &D_06000444, NULL, NULL, 0); + SkelAnime_ChangeAnim(&this->skelAnime, &D_06000444, 1.0f, 0.0f, frameCount, 0, 0.0f); + DynaPolyInfo_SetActorMove(&this->dyna, DPM_UNK); + DynaPolyInfo_Alloc(&D_060000C0, &temp); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, temp); + this->dyna.actor.unk_F8 = 500.0f; + this->dyna.actor.unk_FC = 550.0f; + this->dyna.actor.unk_F4 = 2200.0f; + this->invScale = 6; + this->maxStep = 1000; + this->minStep = 1; + this->unk_278 = (s16)(Math_Rand_ZeroOne() * 65535.0f); +} + +void EnHata_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnHata* this = THIS; + SkelAnime_Free(&this->skelAnime, globalCtx); + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); +} + +void EnHata_Update(Actor* thisx, GlobalContext* globalCtx) { + GlobalContext* gblCtx; + s32 target; + s32 pitch; + Vec3f sp48; + Vec3f sp3C; + f32 sin; + + sp48 = sVec; + SkelAnime_FrameUpdateMatrix(&THIS->skelAnime); + gblCtx = globalCtx; + THIS->limbs[3].y = THIS->limbs[12].y = -0x4000; + sp3C.x = gblCtx->envCtx.unk_A8; + sp3C.y = gblCtx->envCtx.unk_AA; + sp3C.z = gblCtx->envCtx.unk_AC; + if (gblCtx->envCtx.unk_B0 > 255.0f) { + gblCtx->envCtx.unk_B0 = 255.0f; + } + if (gblCtx->envCtx.unk_B0 < 0.0f) { + gblCtx->envCtx.unk_B0 = 0.0f; + } + if (Math_Rand_ZeroOne() > 0.5f) { + THIS->unk_278 += 6000; + } else { + THIS->unk_278 += 3000; + } + sin = Math_Sins(THIS->unk_278) * 80.0f; + pitch = -Math_Vec3f_Pitch(&sp48, &sp3C); + target = ((s32)((0x3A98 - pitch) * (1.0f - (gblCtx->envCtx.unk_B0 / (255.0f - sin))))) + pitch; + Math_SmoothScaleMaxMinS(&THIS->limbs[4].y, target, THIS->invScale, THIS->maxStep, THIS->minStep); + THIS->limbs[13].y = THIS->limbs[4].y; + THIS->limbs[4].z = -Math_Vec3f_Yaw(&sp48, &sp3C); + THIS->limbs[13].z = THIS->limbs[4].z; + THIS->skelAnime.animPlaybackSpeed = (Math_Rand_ZeroFloat(1.25f) + 2.75f) * (gblCtx->envCtx.unk_B0 / 255.0f); +} + +s32 EnHata_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx) { + EnHata* this = THIS; + Vec3s* limbs; + + if (limbIndex == 12 || limbIndex == 3 || limbIndex == 13 || limbIndex == 4) { + limbs = this->limbs; + rot->x += limbs[limbIndex].x; + rot->y += limbs[limbIndex].y; + rot->z += limbs[limbIndex].z; + } + return 0; +} + +void EnHata_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { +} + +void EnHata_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnHata* this = THIS; + func_800943C8(globalCtx->state.gfxCtx); + Matrix_Scale(1.0f, 1.1f, 1.0f, MTXMODE_APPLY); + SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, EnHata_OverrideLimbDraw, + EnHata_PostLimbDraw, &this->dyna.actor); +} diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.h b/src/overlays/actors/ovl_En_Hata/z_en_hata.h index cc29ddd11d..027e255470 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.h +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.h @@ -4,11 +4,15 @@ #include #include -struct EnHata; - -typedef struct EnHata { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x130]; +typedef struct { + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ SkelAnime skelAnime; + /* 0x01A8 */ char unk_1A8[0x4C]; + /* 0x01F4 */ Vec3s limbs[0x15]; + /* 0x0272 */ s16 invScale; + /* 0x0274 */ s16 maxStep; + /* 0x0276 */ s16 minStep; + /* 0x0278 */ s16 unk_278; } EnHata; // size = 0x027C extern const ActorInit En_Hata_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 7e52d9c920..2c77db08eb 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -584,6 +584,11 @@ D_0F000000 = 0x0F000000; D_06000BD8 = 0x06000BD8; D_060015B0 = 0x060015B0; +// z_en_hata +D_060000C0 = 0x060000C0; +D_06000444 = 0x06000444; +D_06002FD0 = 0x06002FD0; + // z_en_sb D_0600004C = 0x0600004C; D_060000B4 = 0x060000B4;