From 845135d8e64307cefba5683334c98880e7c8cc66 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Thu, 27 Aug 2020 17:12:02 -0400 Subject: [PATCH] Decompiled ovl_Obj_Hsblock (#345) * Decompiled ovl_Obj_Hsblock * reloc * Renaming * PR suggestion * PR comments * Grouping action funcs --- .../ovl_Obj_Hsblock/ObjHsblock_Destroy.s | 14 -- .../actors/ovl_Obj_Hsblock/ObjHsblock_Draw.s | 101 ------------ .../actors/ovl_Obj_Hsblock/ObjHsblock_Init.s | 66 -------- .../ovl_Obj_Hsblock/ObjHsblock_Update.s | 22 --- .../actors/ovl_Obj_Hsblock/func_80B93B60.s | 3 - .../actors/ovl_Obj_Hsblock/func_80B93B68.s | 50 ------ .../actors/ovl_Obj_Hsblock/func_80B93BF0.s | 36 ----- .../actors/ovl_Obj_Hsblock/func_80B93D90.s | 9 -- .../actors/ovl_Obj_Hsblock/func_80B93DB0.s | 18 --- .../actors/ovl_Obj_Hsblock/func_80B93DF4.s | 20 --- .../actors/ovl_Obj_Hsblock/func_80B93E38.s | 10 -- .../actors/ovl_Obj_Hsblock/func_80B93E5C.s | 54 ------- data/overlays/actors/z_obj_hsblock.data.s | 28 ---- data/overlays/actors/z_obj_hsblock.reloc.s | 13 -- spec | 3 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 149 ++++++++++++++++-- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.h | 4 +- 17 files changed, 139 insertions(+), 461 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B60.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B68.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93BF0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93D90.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DB0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DF4.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E38.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E5C.s delete mode 100644 data/overlays/actors/z_obj_hsblock.data.s delete mode 100644 data/overlays/actors/z_obj_hsblock.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Destroy.s deleted file mode 100644 index 834b6e216f..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Destroy.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel ObjHsblock_Destroy -/* 00200 80B93D60 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00204 80B93D64 AFA40018 */ sw $a0, 0x0018($sp) -/* 00208 80B93D68 8FAE0018 */ lw $t6, 0x0018($sp) -/* 0020C 80B93D6C AFBF0014 */ sw $ra, 0x0014($sp) -/* 00210 80B93D70 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00214 80B93D74 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810 -/* 00218 80B93D78 0C00FB56 */ jal DynaPolyInfo_Free - ## DynaPolyInfo_delReserve -/* 0021C 80B93D7C 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C -/* 00220 80B93D80 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00224 80B93D84 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00228 80B93D88 03E00008 */ jr $ra -/* 0022C 80B93D8C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Draw.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Draw.s deleted file mode 100644 index 4638751461..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Draw.s +++ /dev/null @@ -1,101 +0,0 @@ -.rdata -glabel D_80B94154 - .asciz "../z_obj_hsblock.c" - .balign 4 - -glabel D_80B94168 - .asciz "../z_obj_hsblock.c" - .balign 4 - -glabel D_80B9417C - .asciz "../z_obj_hsblock.c" - .balign 4 - -.text -glabel ObjHsblock_Draw -/* 003F0 80B93F50 27BDFFB0 */ addiu $sp, $sp, 0xFFB0 ## $sp = FFFFFFB0 -/* 003F4 80B93F54 AFB10018 */ sw $s1, 0x0018($sp) -/* 003F8 80B93F58 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 003FC 80B93F5C AFBF001C */ sw $ra, 0x001C($sp) -/* 00400 80B93F60 AFB00014 */ sw $s0, 0x0014($sp) -/* 00404 80B93F64 AFA40050 */ sw $a0, 0x0050($sp) -/* 00408 80B93F68 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 0040C 80B93F6C 3C0680B9 */ lui $a2, %hi(D_80B94154) ## $a2 = 80B90000 -/* 00410 80B93F70 24C64154 */ addiu $a2, $a2, %lo(D_80B94154) ## $a2 = 80B94154 -/* 00414 80B93F74 27A40034 */ addiu $a0, $sp, 0x0034 ## $a0 = FFFFFFE4 -/* 00418 80B93F78 2407016D */ addiu $a3, $zero, 0x016D ## $a3 = 0000016D -/* 0041C 80B93F7C 0C031AB1 */ jal Graph_OpenDisps -/* 00420 80B93F80 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 00424 80B93F84 0C024F46 */ jal func_80093D18 -/* 00428 80B93F88 8E240000 */ lw $a0, 0x0000($s1) ## 00000000 -/* 0042C 80B93F8C 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00430 80B93F90 3C0FDA38 */ lui $t7, 0xDA38 ## $t7 = DA380000 -/* 00434 80B93F94 35EF0003 */ ori $t7, $t7, 0x0003 ## $t7 = DA380003 -/* 00438 80B93F98 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008 -/* 0043C 80B93F9C AE0E02C0 */ sw $t6, 0x02C0($s0) ## 000002C0 -/* 00440 80B93FA0 AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 -/* 00444 80B93FA4 8E240000 */ lw $a0, 0x0000($s1) ## 00000000 -/* 00448 80B93FA8 3C0580B9 */ lui $a1, %hi(D_80B94168) ## $a1 = 80B90000 -/* 0044C 80B93FAC 24A54168 */ addiu $a1, $a1, %lo(D_80B94168) ## $a1 = 80B94168 -/* 00450 80B93FB0 24060171 */ addiu $a2, $zero, 0x0171 ## $a2 = 00000171 -/* 00454 80B93FB4 0C0346A2 */ jal Matrix_NewMtx -/* 00458 80B93FB8 AFA20030 */ sw $v0, 0x0030($sp) -/* 0045C 80B93FBC 8FA30030 */ lw $v1, 0x0030($sp) -/* 00460 80B93FC0 24010004 */ addiu $at, $zero, 0x0004 ## $at = 00000004 -/* 00464 80B93FC4 3C0480B9 */ lui $a0, %hi(D_80B940E8) ## $a0 = 80B90000 -/* 00468 80B93FC8 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 0046C 80B93FCC 863800A4 */ lh $t8, 0x00A4($s1) ## 000000A4 -/* 00470 80B93FD0 3C028016 */ lui $v0, %hi(gGameInfo) -/* 00474 80B93FD4 17010003 */ bne $t8, $at, .L80B93FE4 -/* 00478 80B93FD8 00000000 */ nop -/* 0047C 80B93FDC 10000009 */ beq $zero, $zero, .L80B94004 -/* 00480 80B93FE0 248440E8 */ addiu $a0, $a0, %lo(D_80B940E8) ## $a0 = 80B940E8 -.L80B93FE4: -/* 00484 80B93FE4 8C42FA90 */ lw $v0, %lo(gGameInfo)($v0) -/* 00488 80B93FE8 27A40048 */ addiu $a0, $sp, 0x0048 ## $a0 = FFFFFFF8 -/* 0048C 80B93FEC 8459116E */ lh $t9, 0x116E($v0) ## 8016116E -/* 00490 80B93FF0 A3B90048 */ sb $t9, 0x0048($sp) -/* 00494 80B93FF4 84481170 */ lh $t0, 0x1170($v0) ## 80161170 -/* 00498 80B93FF8 A3A80049 */ sb $t0, 0x0049($sp) -/* 0049C 80B93FFC 84491172 */ lh $t1, 0x1172($v0) ## 80161172 -/* 004A0 80B94000 A3A9004A */ sb $t1, 0x004A($sp) -.L80B94004: -/* 004A4 80B94004 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 004A8 80B94008 3C0BFB00 */ lui $t3, 0xFB00 ## $t3 = FB000000 -/* 004AC 80B9400C 3C0680B9 */ lui $a2, %hi(D_80B9417C) ## $a2 = 80B90000 -/* 004B0 80B94010 244A0008 */ addiu $t2, $v0, 0x0008 ## $t2 = 80160008 -/* 004B4 80B94014 AE0A02C0 */ sw $t2, 0x02C0($s0) ## 000002C0 -/* 004B8 80B94018 AC4B0000 */ sw $t3, 0x0000($v0) ## 80160000 -/* 004BC 80B9401C 90980001 */ lbu $t8, 0x0001($a0) ## FFFFFFF9 -/* 004C0 80B94020 908D0000 */ lbu $t5, 0x0000($a0) ## FFFFFFF8 -/* 004C4 80B94024 908A0002 */ lbu $t2, 0x0002($a0) ## FFFFFFFA -/* 004C8 80B94028 0018CC00 */ sll $t9, $t8, 16 -/* 004CC 80B9402C 000D7600 */ sll $t6, $t5, 24 -/* 004D0 80B94030 01D94025 */ or $t0, $t6, $t9 ## $t0 = 00000000 -/* 004D4 80B94034 000A5A00 */ sll $t3, $t2, 8 -/* 004D8 80B94038 010B6025 */ or $t4, $t0, $t3 ## $t4 = FB000000 -/* 004DC 80B9403C 358D00FF */ ori $t5, $t4, 0x00FF ## $t5 = FB0000FF -/* 004E0 80B94040 AC4D0004 */ sw $t5, 0x0004($v0) ## 80160004 -/* 004E4 80B94044 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 004E8 80B94048 3C18DE00 */ lui $t8, 0xDE00 ## $t8 = DE000000 -/* 004EC 80B9404C 3C0880B9 */ lui $t0, %hi(D_80B940EC) ## $t0 = 80B90000 -/* 004F0 80B94050 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 80160008 -/* 004F4 80B94054 AE0F02C0 */ sw $t7, 0x02C0($s0) ## 000002C0 -/* 004F8 80B94058 AC580000 */ sw $t8, 0x0000($v0) ## 80160000 -/* 004FC 80B9405C 8FAE0050 */ lw $t6, 0x0050($sp) -/* 00500 80B94060 27A40034 */ addiu $a0, $sp, 0x0034 ## $a0 = FFFFFFE4 -/* 00504 80B94064 24C6417C */ addiu $a2, $a2, %lo(D_80B9417C) ## $a2 = 80B9417C -/* 00508 80B94068 85D9001C */ lh $t9, 0x001C($t6) ## 0000001C -/* 0050C 80B9406C 2407018F */ addiu $a3, $zero, 0x018F ## $a3 = 0000018F -/* 00510 80B94070 33290003 */ andi $t1, $t9, 0x0003 ## $t1 = 00000000 -/* 00514 80B94074 00095080 */ sll $t2, $t1, 2 -/* 00518 80B94078 010A4021 */ addu $t0, $t0, $t2 -/* 0051C 80B9407C 8D0840EC */ lw $t0, %lo(D_80B940EC)($t0) -/* 00520 80B94080 AC480004 */ sw $t0, 0x0004($v0) ## 80160004 -/* 00524 80B94084 0C031AD5 */ jal Graph_CloseDisps -/* 00528 80B94088 8E250000 */ lw $a1, 0x0000($s1) ## 00000000 -/* 0052C 80B9408C 8FBF001C */ lw $ra, 0x001C($sp) -/* 00530 80B94090 8FB00014 */ lw $s0, 0x0014($sp) -/* 00534 80B94094 8FB10018 */ lw $s1, 0x0018($sp) -/* 00538 80B94098 03E00008 */ jr $ra -/* 0053C 80B9409C 27BD0050 */ addiu $sp, $sp, 0x0050 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Init.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Init.s deleted file mode 100644 index 60b388ee56..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Init.s +++ /dev/null @@ -1,66 +0,0 @@ -glabel ObjHsblock_Init -/* 00114 80B93C74 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00118 80B93C78 AFB00018 */ sw $s0, 0x0018($sp) -/* 0011C 80B93C7C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00120 80B93C80 AFBF001C */ sw $ra, 0x001C($sp) -/* 00124 80B93C84 AFA50024 */ sw $a1, 0x0024($sp) -/* 00128 80B93C88 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 0012C 80B93C8C 3C0680B9 */ lui $a2, %hi(D_80B940DC) ## $a2 = 80B90000 -/* 00130 80B93C90 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00134 80B93C94 31CF0003 */ andi $t7, $t6, 0x0003 ## $t7 = 00000000 -/* 00138 80B93C98 000FC080 */ sll $t8, $t7, 2 -/* 0013C 80B93C9C 00D83021 */ addu $a2, $a2, $t8 -/* 00140 80B93CA0 0C2E4EDA */ jal func_80B93B68 -/* 00144 80B93CA4 8CC640DC */ lw $a2, %lo(D_80B940DC)($a2) -/* 00148 80B93CA8 3C0580B9 */ lui $a1, %hi(D_80B940CC) ## $a1 = 80B90000 -/* 0014C 80B93CAC 24A540CC */ addiu $a1, $a1, %lo(D_80B940CC) ## $a1 = 80B940CC -/* 00150 80B93CB0 0C01E037 */ jal Actor_ProcessInitChain - -/* 00154 80B93CB4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00158 80B93CB8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0015C 80B93CBC 0C2E4EFC */ jal func_80B93BF0 -/* 00160 80B93CC0 8FA50024 */ lw $a1, 0x0024($sp) -/* 00164 80B93CC4 8603001C */ lh $v1, 0x001C($s0) ## 0000001C -/* 00168 80B93CC8 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 0016C 80B93CCC 30620003 */ andi $v0, $v1, 0x0003 ## $v0 = 00000000 -/* 00170 80B93CD0 10400006 */ beq $v0, $zero, .L80B93CEC -/* 00174 80B93CD4 00000000 */ nop -/* 00178 80B93CD8 10410008 */ beq $v0, $at, .L80B93CFC -/* 0017C 80B93CDC 8FA40024 */ lw $a0, 0x0024($sp) -/* 00180 80B93CE0 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 00184 80B93CE4 14410010 */ bne $v0, $at, .L80B93D28 -/* 00188 80B93CE8 00000000 */ nop -.L80B93CEC: -/* 0018C 80B93CEC 0C2E4F64 */ jal func_80B93D90 -/* 00190 80B93CF0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00194 80B93CF4 1000000C */ beq $zero, $zero, .L80B93D28 -/* 00198 80B93CF8 00000000 */ nop -.L80B93CFC: -/* 0019C 80B93CFC 00032A03 */ sra $a1, $v1, 8 -/* 001A0 80B93D00 0C00B2D0 */ jal Flags_GetSwitch - -/* 001A4 80B93D04 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 001A8 80B93D08 10400005 */ beq $v0, $zero, .L80B93D20 -/* 001AC 80B93D0C 00000000 */ nop -/* 001B0 80B93D10 0C2E4F64 */ jal func_80B93D90 -/* 001B4 80B93D14 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001B8 80B93D18 10000003 */ beq $zero, $zero, .L80B93D28 -/* 001BC 80B93D1C 00000000 */ nop -.L80B93D20: -/* 001C0 80B93D20 0C2E4F6C */ jal func_80B93DB0 -/* 001C4 80B93D24 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80B93D28: -/* 001C8 80B93D28 3C028016 */ lui $v0, %hi(gGameInfo) -/* 001CC 80B93D2C 2442FA90 */ addiu $v0, %lo(gGameInfo) -/* 001D0 80B93D30 8C590000 */ lw $t9, 0x0000($v0) ## 8015FA90 -/* 001D4 80B93D34 240300FF */ addiu $v1, $zero, 0x00FF ## $v1 = 000000FF -/* 001D8 80B93D38 A723116E */ sh $v1, 0x116E($t9) ## 0000116E -/* 001DC 80B93D3C 8C480000 */ lw $t0, 0x0000($v0) ## 8015FA90 -/* 001E0 80B93D40 A5031170 */ sh $v1, 0x1170($t0) ## 00001170 -/* 001E4 80B93D44 8C490000 */ lw $t1, 0x0000($v0) ## 8015FA90 -/* 001E8 80B93D48 A5231172 */ sh $v1, 0x1172($t1) ## 00001172 -/* 001EC 80B93D4C 8FBF001C */ lw $ra, 0x001C($sp) -/* 001F0 80B93D50 8FB00018 */ lw $s0, 0x0018($sp) -/* 001F4 80B93D54 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 001F8 80B93D58 03E00008 */ jr $ra -/* 001FC 80B93D5C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Update.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Update.s deleted file mode 100644 index faff3c5f1f..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Update.s +++ /dev/null @@ -1,22 +0,0 @@ -glabel ObjHsblock_Update -/* 003A4 80B93F04 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 003A8 80B93F08 AFBF0014 */ sw $ra, 0x0014($sp) -/* 003AC 80B93F0C 8C820164 */ lw $v0, 0x0164($a0) ## 00000164 -/* 003B0 80B93F10 50400005 */ beql $v0, $zero, .L80B93F28 -/* 003B4 80B93F14 848E001C */ lh $t6, 0x001C($a0) ## 0000001C -/* 003B8 80B93F18 0040F809 */ jalr $ra, $v0 -/* 003BC 80B93F1C AFA40018 */ sw $a0, 0x0018($sp) -/* 003C0 80B93F20 8FA40018 */ lw $a0, 0x0018($sp) -/* 003C4 80B93F24 848E001C */ lh $t6, 0x001C($a0) ## 0000001C -.L80B93F28: -/* 003C8 80B93F28 3C0580B9 */ lui $a1, %hi(D_80B940C0) ## $a1 = 80B90000 -/* 003CC 80B93F2C 31CF0003 */ andi $t7, $t6, 0x0003 ## $t7 = 00000000 -/* 003D0 80B93F30 000FC080 */ sll $t8, $t7, 2 -/* 003D4 80B93F34 00B82821 */ addu $a1, $a1, $t8 -/* 003D8 80B93F38 0C00B56E */ jal Actor_SetHeight - -/* 003DC 80B93F3C 8CA540C0 */ lw $a1, %lo(D_80B940C0)($a1) -/* 003E0 80B93F40 8FBF0014 */ lw $ra, 0x0014($sp) -/* 003E4 80B93F44 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 003E8 80B93F48 03E00008 */ jr $ra -/* 003EC 80B93F4C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B60.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B60.s deleted file mode 100644 index 0f0ed0a915..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B60.s +++ /dev/null @@ -1,3 +0,0 @@ -glabel func_80B93B60 -/* 00000 80B93B60 03E00008 */ jr $ra -/* 00004 80B93B64 AC850164 */ sw $a1, 0x0164($a0) ## 00000164 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B68.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B68.s deleted file mode 100644 index 4321d6bfda..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B68.s +++ /dev/null @@ -1,50 +0,0 @@ -.rdata -glabel D_80B94100 - .asciz "Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n" - .balign 4 - -glabel D_80B94140 - .asciz "../z_obj_hsblock.c" - .balign 4 - -.text -glabel func_80B93B68 -/* 00008 80B93B68 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 0000C 80B93B6C AFBF0024 */ sw $ra, 0x0024($sp) -/* 00010 80B93B70 AFB00020 */ sw $s0, 0x0020($sp) -/* 00014 80B93B74 AFA5003C */ sw $a1, 0x003C($sp) -/* 00018 80B93B78 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0001C 80B93B7C AFA60040 */ sw $a2, 0x0040($sp) -/* 00020 80B93B80 AFA00030 */ sw $zero, 0x0030($sp) -/* 00024 80B93B84 0C010D20 */ jal DynaPolyInfo_SetActorMove - -/* 00028 80B93B88 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 -/* 0002C 80B93B8C 8FA40040 */ lw $a0, 0x0040($sp) -/* 00030 80B93B90 0C010620 */ jal DynaPolyInfo_Alloc - -/* 00034 80B93B94 27A50030 */ addiu $a1, $sp, 0x0030 ## $a1 = FFFFFFF8 -/* 00038 80B93B98 8FA4003C */ lw $a0, 0x003C($sp) -/* 0003C 80B93B9C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00040 80B93BA0 8FA70030 */ lw $a3, 0x0030($sp) -/* 00044 80B93BA4 0C00FA9D */ jal DynaPolyInfo_RegisterActor - ## DynaPolyInfo_setActor -/* 00048 80B93BA8 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 0004C 80B93BAC 24010032 */ addiu $at, $zero, 0x0032 ## $at = 00000032 -/* 00050 80B93BB0 1441000A */ bne $v0, $at, .L80B93BDC -/* 00054 80B93BB4 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 00058 80B93BB8 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 0005C 80B93BBC 3C0480B9 */ lui $a0, %hi(D_80B94100) ## $a0 = 80B90000 -/* 00060 80B93BC0 3C0580B9 */ lui $a1, %hi(D_80B94140) ## $a1 = 80B90000 -/* 00064 80B93BC4 86070000 */ lh $a3, 0x0000($s0) ## 00000000 -/* 00068 80B93BC8 24A54140 */ addiu $a1, $a1, %lo(D_80B94140) ## $a1 = 80B94140 -/* 0006C 80B93BCC 24844100 */ addiu $a0, $a0, %lo(D_80B94100) ## $a0 = 80B94100 -/* 00070 80B93BD0 240600A3 */ addiu $a2, $zero, 0x00A3 ## $a2 = 000000A3 -/* 00074 80B93BD4 0C00084C */ jal osSyncPrintf - -/* 00078 80B93BD8 AFAE0010 */ sw $t6, 0x0010($sp) -.L80B93BDC: -/* 0007C 80B93BDC 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00080 80B93BE0 8FB00020 */ lw $s0, 0x0020($sp) -/* 00084 80B93BE4 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 00088 80B93BE8 03E00008 */ jr $ra -/* 0008C 80B93BEC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93BF0.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93BF0.s deleted file mode 100644 index bd7e264e69..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93BF0.s +++ /dev/null @@ -1,36 +0,0 @@ -glabel func_80B93BF0 -/* 00090 80B93BF0 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 00094 80B93BF4 AFBF003C */ sw $ra, 0x003C($sp) -/* 00098 80B93BF8 AFB00038 */ sw $s0, 0x0038($sp) -/* 0009C 80B93BFC 848E001C */ lh $t6, 0x001C($a0) ## 0000001C -/* 000A0 80B93C00 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 000A4 80B93C04 00A03025 */ or $a2, $a1, $zero ## $a2 = 00000000 -/* 000A8 80B93C08 000E7943 */ sra $t7, $t6, 5 -/* 000AC 80B93C0C 31F80001 */ andi $t8, $t7, 0x0001 ## $t8 = 00000000 -/* 000B0 80B93C10 53000014 */ beql $t8, $zero, .L80B93C64 -/* 000B4 80B93C14 8FBF003C */ lw $ra, 0x003C($sp) -/* 000B8 80B93C18 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 000BC 80B93C1C 24A41C24 */ addiu $a0, $a1, 0x1C24 ## $a0 = 00001C24 -/* 000C0 80B93C20 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 000C4 80B93C24 E7A40010 */ swc1 $f4, 0x0010($sp) -/* 000C8 80B93C28 C6060028 */ lwc1 $f6, 0x0028($s0) ## 00000028 -/* 000CC 80B93C2C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 000D0 80B93C30 2407011E */ addiu $a3, $zero, 0x011E ## $a3 = 0000011E -/* 000D4 80B93C34 E7A60014 */ swc1 $f6, 0x0014($sp) -/* 000D8 80B93C38 C608002C */ lwc1 $f8, 0x002C($s0) ## 0000002C -/* 000DC 80B93C3C E7A80018 */ swc1 $f8, 0x0018($sp) -/* 000E0 80B93C40 86190030 */ lh $t9, 0x0030($s0) ## 00000030 -/* 000E4 80B93C44 AFB9001C */ sw $t9, 0x001C($sp) -/* 000E8 80B93C48 86080032 */ lh $t0, 0x0032($s0) ## 00000032 -/* 000EC 80B93C4C AFA80020 */ sw $t0, 0x0020($sp) -/* 000F0 80B93C50 86090034 */ lh $t1, 0x0034($s0) ## 00000034 -/* 000F4 80B93C54 AFAA0028 */ sw $t2, 0x0028($sp) -/* 000F8 80B93C58 0C00C916 */ jal Actor_SpawnAttached - -/* 000FC 80B93C5C AFA90024 */ sw $t1, 0x0024($sp) -/* 00100 80B93C60 8FBF003C */ lw $ra, 0x003C($sp) -.L80B93C64: -/* 00104 80B93C64 8FB00038 */ lw $s0, 0x0038($sp) -/* 00108 80B93C68 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 0010C 80B93C6C 03E00008 */ jr $ra -/* 00110 80B93C70 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93D90.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93D90.s deleted file mode 100644 index 9857fda184..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93D90.s +++ /dev/null @@ -1,9 +0,0 @@ -glabel func_80B93D90 -/* 00230 80B93D90 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00234 80B93D94 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00238 80B93D98 0C2E4ED8 */ jal func_80B93B60 -/* 0023C 80B93D9C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00240 80B93DA0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00244 80B93DA4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00248 80B93DA8 03E00008 */ jr $ra -/* 0024C 80B93DAC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DB0.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DB0.s deleted file mode 100644 index c567d6834f..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DB0.s +++ /dev/null @@ -1,18 +0,0 @@ -glabel func_80B93DB0 -/* 00250 80B93DB0 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00254 80B93DB4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00258 80B93DB8 3C0142D2 */ lui $at, 0x42D2 ## $at = 42D20000 -/* 0025C 80B93DBC 44813000 */ mtc1 $at, $f6 ## $f6 = 105.00 -/* 00260 80B93DC0 C484000C */ lwc1 $f4, 0x000C($a0) ## 0000000C -/* 00264 80B93DC4 8C8E0004 */ lw $t6, 0x0004($a0) ## 00000004 -/* 00268 80B93DC8 3C0580B9 */ lui $a1, %hi(func_80B93DF4) ## $a1 = 80B90000 -/* 0026C 80B93DCC 46062201 */ sub.s $f8, $f4, $f6 -/* 00270 80B93DD0 35CF0010 */ ori $t7, $t6, 0x0010 ## $t7 = 00000010 -/* 00274 80B93DD4 AC8F0004 */ sw $t7, 0x0004($a0) ## 00000004 -/* 00278 80B93DD8 24A53DF4 */ addiu $a1, $a1, %lo(func_80B93DF4) ## $a1 = 80B93DF4 -/* 0027C 80B93DDC 0C2E4ED8 */ jal func_80B93B60 -/* 00280 80B93DE0 E4880028 */ swc1 $f8, 0x0028($a0) ## 00000028 -/* 00284 80B93DE4 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00288 80B93DE8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0028C 80B93DEC 03E00008 */ jr $ra -/* 00290 80B93DF0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DF4.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DF4.s deleted file mode 100644 index 683f85778a..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DF4.s +++ /dev/null @@ -1,20 +0,0 @@ -glabel func_80B93DF4 -/* 00294 80B93DF4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00298 80B93DF8 AFA40018 */ sw $a0, 0x0018($sp) -/* 0029C 80B93DFC 8FAE0018 */ lw $t6, 0x0018($sp) -/* 002A0 80B93E00 AFBF0014 */ sw $ra, 0x0014($sp) -/* 002A4 80B93E04 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 002A8 80B93E08 85C5001C */ lh $a1, 0x001C($t6) ## 0000001C -/* 002AC 80B93E0C 00052A03 */ sra $a1, $a1, 8 -/* 002B0 80B93E10 0C00B2D0 */ jal Flags_GetSwitch - -/* 002B4 80B93E14 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 002B8 80B93E18 50400004 */ beql $v0, $zero, .L80B93E2C -/* 002BC 80B93E1C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 002C0 80B93E20 0C2E4F8E */ jal func_80B93E38 -/* 002C4 80B93E24 8FA40018 */ lw $a0, 0x0018($sp) -/* 002C8 80B93E28 8FBF0014 */ lw $ra, 0x0014($sp) -.L80B93E2C: -/* 002CC 80B93E2C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 002D0 80B93E30 03E00008 */ jr $ra -/* 002D4 80B93E34 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E38.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E38.s deleted file mode 100644 index 1365927931..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E38.s +++ /dev/null @@ -1,10 +0,0 @@ -glabel func_80B93E38 -/* 002D8 80B93E38 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 002DC 80B93E3C AFBF0014 */ sw $ra, 0x0014($sp) -/* 002E0 80B93E40 3C0580B9 */ lui $a1, %hi(func_80B93E5C) ## $a1 = 80B90000 -/* 002E4 80B93E44 0C2E4ED8 */ jal func_80B93B60 -/* 002E8 80B93E48 24A53E5C */ addiu $a1, $a1, %lo(func_80B93E5C) ## $a1 = 80B93E5C -/* 002EC 80B93E4C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 002F0 80B93E50 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 002F4 80B93E54 03E00008 */ jr $ra -/* 002F8 80B93E58 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E5C.s b/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E5C.s deleted file mode 100644 index e15c555316..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E5C.s +++ /dev/null @@ -1,54 +0,0 @@ -.late_rodata -glabel D_80B94190 - .float 0.3 - -glabel D_80B94194 - .float 0.001 - -.text -glabel func_80B93E5C -/* 002FC 80B93E5C 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00300 80B93E60 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 00304 80B93E64 AFB00020 */ sw $s0, 0x0020($sp) -/* 00308 80B93E68 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0030C 80B93E6C AFBF0024 */ sw $ra, 0x0024($sp) -/* 00310 80B93E70 AFA5002C */ sw $a1, 0x002C($sp) -/* 00314 80B93E74 3C063DCC */ lui $a2, 0x3DCC ## $a2 = 3DCC0000 -/* 00318 80B93E78 3C073F4C */ lui $a3, 0x3F4C ## $a3 = 3F4C0000 -/* 0031C 80B93E7C 34E7CCCD */ ori $a3, $a3, 0xCCCD ## $a3 = 3F4CCCCD -/* 00320 80B93E80 34C6CCCD */ ori $a2, $a2, 0xCCCD ## $a2 = 3DCCCCCD -/* 00324 80B93E84 3C054180 */ lui $a1, 0x4180 ## $a1 = 41800000 -/* 00328 80B93E88 24840060 */ addiu $a0, $a0, 0x0060 ## $a0 = 00000060 -/* 0032C 80B93E8C 0C01E0C4 */ jal Math_SmoothScaleMaxMinF - -/* 00330 80B93E90 E7A40010 */ swc1 $f4, 0x0010($sp) -/* 00334 80B93E94 3C0180B9 */ lui $at, %hi(D_80B94190) ## $at = 80B90000 -/* 00338 80B93E98 C4224190 */ lwc1 $f2, %lo(D_80B94190)($at) -/* 0033C 80B93E9C 8E05000C */ lw $a1, 0x000C($s0) ## 0000000C -/* 00340 80B93EA0 8E070060 */ lw $a3, 0x0060($s0) ## 00000060 -/* 00344 80B93EA4 44061000 */ mfc1 $a2, $f2 -/* 00348 80B93EA8 26040028 */ addiu $a0, $s0, 0x0028 ## $a0 = 00000028 -/* 0034C 80B93EAC 0C01E0C4 */ jal Math_SmoothScaleMaxMinF - -/* 00350 80B93EB0 E7A20010 */ swc1 $f2, 0x0010($sp) -/* 00354 80B93EB4 3C0180B9 */ lui $at, %hi(D_80B94194) ## $at = 80B90000 -/* 00358 80B93EB8 C4264194 */ lwc1 $f6, %lo(D_80B94194)($at) -/* 0035C 80B93EBC 46000005 */ abs.s $f0, $f0 -/* 00360 80B93EC0 4606003C */ c.lt.s $f0, $f6 -/* 00364 80B93EC4 00000000 */ nop -/* 00368 80B93EC8 4502000A */ bc1fl .L80B93EF4 -/* 0036C 80B93ECC 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00370 80B93ED0 C608000C */ lwc1 $f8, 0x000C($s0) ## 0000000C -/* 00374 80B93ED4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00378 80B93ED8 0C2E4F64 */ jal func_80B93D90 -/* 0037C 80B93EDC E6080028 */ swc1 $f8, 0x0028($s0) ## 00000028 -/* 00380 80B93EE0 8E0E0004 */ lw $t6, 0x0004($s0) ## 00000004 -/* 00384 80B93EE4 2401FFEF */ addiu $at, $zero, 0xFFEF ## $at = FFFFFFEF -/* 00388 80B93EE8 01C17824 */ and $t7, $t6, $at -/* 0038C 80B93EEC AE0F0004 */ sw $t7, 0x0004($s0) ## 00000004 -/* 00390 80B93EF0 8FBF0024 */ lw $ra, 0x0024($sp) -.L80B93EF4: -/* 00394 80B93EF4 8FB00020 */ lw $s0, 0x0020($sp) -/* 00398 80B93EF8 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 0039C 80B93EFC 03E00008 */ jr $ra -/* 003A0 80B93F00 00000000 */ nop diff --git a/data/overlays/actors/z_obj_hsblock.data.s b/data/overlays/actors/z_obj_hsblock.data.s deleted file mode 100644 index 6ace7c5a83..0000000000 --- a/data/overlays/actors/z_obj_hsblock.data.s +++ /dev/null @@ -1,28 +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 Obj_Hsblock_InitVars - .word 0x012D0100, 0x00000000, 0x011C0000, 0x00000168 -.word ObjHsblock_Init -.word ObjHsblock_Destroy -.word ObjHsblock_Update -.word ObjHsblock_Draw -glabel D_80B940C0 - .word 0x42AA0000, 0x42AA0000, 0x00000000 -glabel D_80B940CC - .word 0xC8500064, 0xB0F407D0, 0xB0F80190, 0x30FC07D0 -glabel D_80B940DC - .word 0x06000730, 0x06000730, 0x06000578 -glabel D_80B940E8 - .word 0xA57D3700 -glabel D_80B940EC - .word 0x06000210, 0x06000210, 0x06000470, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_obj_hsblock.reloc.s b/data/overlays/actors/z_obj_hsblock.reloc.s deleted file mode 100644 index 88f61f96f3..0000000000 --- a/data/overlays/actors/z_obj_hsblock.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_80B941A0 - .incbin "baserom/ovl_Obj_Hsblock", 0x640, 0x000000C0 diff --git a/spec b/spec index 465c97a3e3..487c043f09 100644 --- a/spec +++ b/spec @@ -3561,8 +3561,7 @@ endseg beginseg name "ovl_Obj_Hsblock" include "build/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.o" - include "build/data/overlays/actors/z_obj_hsblock.data.o" - include "build/data/overlays/actors/z_obj_hsblock.reloc.o" + include "build/src/overlays/actors/ovl_Obj_Hsblock/ovl_Obj_Hsblock_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index bb20cf0de2..d3aa946a8b 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -15,7 +15,13 @@ void ObjHsblock_Destroy(Actor* thisx, GlobalContext* globalCtx); void ObjHsblock_Update(Actor* thisx, GlobalContext* globalCtx); void ObjHsblock_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void func_80B93DF4(ObjHsblock* this, GlobalContext* globalCtx); +void func_80B93E5C(ObjHsblock* this, GlobalContext* globalCtx); + +void func_80B93D90(ObjHsblock* this); +void func_80B93DB0(ObjHsblock* this); +void func_80B93E38(ObjHsblock* this); + const ActorInit Obj_Hsblock_InitVars = { ACTOR_OBJ_HSBLOCK, ACTORTYPE_BG, @@ -27,27 +33,142 @@ const ActorInit Obj_Hsblock_InitVars = { (ActorFunc)ObjHsblock_Update, (ActorFunc)ObjHsblock_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B60.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93B68.s") +f32 D_80B940C0[] = { 85.0f, 85.0f, 0.0f }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93BF0.s") +static InitChainEntry sInitChain[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 2000, ICHAIN_STOP), +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Init.s") +UNK_TYPE D_80B940DC[] = { 0x06000730, 0x06000730, 0x06000578 }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Destroy.s") +static Color_RGB8 sFireTempleColor = { 165, 125, 55 }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93D90.s") +static Gfx* sDLists[] = { 0x06000210, 0x06000210, 0x06000470 }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DB0.s") +void ObjHsblock_SetupAction(ObjHsblock* this, ObjHsblockActionFunc actionFunc) { + this->actionFunc = actionFunc; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93DF4.s") +void func_80B93B68(ObjHsblock* this, GlobalContext* globalCtx, UNK_TYPE arg2, DynaPolyMoveFlag moveFlags) { + s32 pad; + s32 localC = 0; + s32 pad2[2]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E38.s") + DynaPolyInfo_SetActorMove(&this->dyna, moveFlags); + DynaPolyInfo_Alloc(arg2, &localC); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, localC); + if (this->dyna.dynaPolyId == 0x32) { + osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_hsblock.c", 163, + this->dyna.actor.id, this->dyna.actor.params); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/func_80B93E5C.s") +void func_80B93BF0(ObjHsblock* this, GlobalContext* globalCtx) { + if ((this->dyna.actor.params >> 5) & 1) { + Actor_SpawnAttached(&globalCtx->actorCtx, this, globalCtx, ACTOR_OBJ_ICE_POLY, this->dyna.actor.posRot.pos.x, + this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, this->dyna.actor.posRot.rot.x, + this->dyna.actor.posRot.rot.y, this->dyna.actor.posRot.rot.z, 1); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Update.s") +void ObjHsblock_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjHsblock* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Hsblock/ObjHsblock_Draw.s") + func_80B93B68(this, globalCtx, D_80B940DC[thisx->params & 3], 0); + Actor_ProcessInitChain(thisx, sInitChain); + func_80B93BF0(this, globalCtx); + + switch (thisx->params & 3) { + case 0: + case 2: + func_80B93D90(this); + break; + case 1: + if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0x3F)) { + func_80B93D90(this); + } else { + func_80B93DB0(this); + } + } + + mREG(13) = 255; + mREG(14) = 255; + mREG(15) = 255; +} + +void ObjHsblock_Destroy(Actor* thisx, GlobalContext* globalCtx) { + ObjHsblock* this = THIS; + + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); +} + +void func_80B93D90(ObjHsblock* this) { + ObjHsblock_SetupAction(this, NULL); +} + +void func_80B93DB0(ObjHsblock* this) { + this->dyna.actor.flags |= 0x10; + this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 105.0f; + ObjHsblock_SetupAction(this, func_80B93DF4); +} + +void func_80B93DF4(ObjHsblock* this, GlobalContext* globalCtx) { + if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) { + func_80B93E38(this); + } +} + +void func_80B93E38(ObjHsblock* this) { + ObjHsblock_SetupAction(this, func_80B93E5C); +} + +void func_80B93E5C(ObjHsblock* this, GlobalContext* globalCtx) { + Math_SmoothScaleMaxMinF(&this->dyna.actor.velocity.y, 16.0f, 0.1f, 0.8f, 0.0f); + if (fabsf(Math_SmoothScaleMaxMinF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 0.3f, + this->dyna.actor.velocity.y, 0.3f)) < 0.001f) { + this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + func_80B93D90(this); + this->dyna.actor.flags &= ~0x10; + } +} + +void ObjHsblock_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjHsblock* this = THIS; + + if (this->actionFunc != NULL) { + this->actionFunc(this, globalCtx); + } + Actor_SetHeight(thisx, D_80B940C0[thisx->params & 3]); +} + +void ObjHsblock_Draw(Actor* thisx, GlobalContext* globalCtx) { + Color_RGB8* color; + Color_RGB8 defaultColor; + + GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; + Gfx* dispRefs[4]; + + Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_obj_hsblock.c", 365); + func_80093D18(globalCtx->state.gfxCtx); + + gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_hsblock.c", 369), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + if (globalCtx->sceneNum == SCENE_HIDAN) { + color = &sFireTempleColor; + } else { + defaultColor.r = mREG(13); + defaultColor.g = mREG(14); + defaultColor.b = mREG(15); + color = &defaultColor; + } + + gDPSetEnvColor(gfxCtx->polyOpa.p++, color->r, color->g, color->b, 255); + gSPDisplayList(gfxCtx->polyOpa.p++, sDLists[thisx->params & 3]); + + Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_obj_hsblock.c", 399); +} diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h index d66da24f2e..36d614e849 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h @@ -6,9 +6,11 @@ struct ObjHsblock; +typedef void (*ObjHsblockActionFunc)(struct ObjHsblock*, GlobalContext*); + typedef struct ObjHsblock { /* 0x0000 */ DynaPolyActor dyna; - /* 0x0164 */ char unk_164[0x4]; + /* 0x0164 */ ObjHsblockActionFunc actionFunc; } ObjHsblock; // size = 0x0168 extern const ActorInit Obj_Hsblock_InitVars;