From adbcbb643421edb2c2f05f18347013f937d9176e Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Fri, 20 Mar 2020 00:50:20 +0000 Subject: [PATCH 1/3] Decompile Obj_Bombiwa --- .../ovl_Obj_Bombiwa/ObjBombiwa_Destroy.s | 14 -- .../actors/ovl_Obj_Bombiwa/ObjBombiwa_Draw.s | 17 --- .../actors/ovl_Obj_Bombiwa/ObjBombiwa_Init.s | 60 -------- .../ovl_Obj_Bombiwa/ObjBombiwa_Update.s | 81 ---------- .../actors/ovl_Obj_Bombiwa/func_80B915F0.s | 28 ---- .../actors/ovl_Obj_Bombiwa/func_80B91738.s | 141 ----------------- data/overlays/actors/z_obj_bombiwa.data.s | 26 ---- data/overlays/actors/z_obj_bombiwa.reloc.s | 11 -- spec | 3 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 142 ++++++++++++++++-- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h | 2 +- undefined_syms.txt | 5 +- 12 files changed, 136 insertions(+), 394 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B915F0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B91738.s delete mode 100644 data/overlays/actors/z_obj_bombiwa.data.s delete mode 100644 data/overlays/actors/z_obj_bombiwa.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Destroy.s deleted file mode 100644 index 09fb4e368f4..00000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Destroy.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel ObjBombiwa_Destroy -/* 00120 80B91710 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00124 80B91714 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 00128 80B91718 AFBF0014 */ sw $ra, 0x0014($sp) -/* 0012C 80B9171C 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00130 80B91720 0C0170EB */ jal ActorCollider_FreeCylinder - -/* 00134 80B91724 24E5014C */ addiu $a1, $a3, 0x014C ## $a1 = 0000014C -/* 00138 80B91728 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0013C 80B9172C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00140 80B91730 03E00008 */ jr $ra -/* 00144 80B91734 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Draw.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Draw.s deleted file mode 100644 index 55780313d97..00000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Draw.s +++ /dev/null @@ -1,17 +0,0 @@ -glabel ObjBombiwa_Draw -/* 00458 80B91A48 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0045C 80B91A4C AFA40018 */ sw $a0, 0x0018($sp) -/* 00460 80B91A50 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00464 80B91A54 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00468 80B91A58 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 0046C 80B91A5C 0C00D498 */ jal Draw_DListOpa - -/* 00470 80B91A60 24A509E0 */ addiu $a1, $a1, 0x09E0 ## $a1 = 060009E0 -/* 00474 80B91A64 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00478 80B91A68 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0047C 80B91A6C 03E00008 */ jr $ra -/* 00480 80B91A70 00000000 */ nop -/* 00484 80B91A74 00000000 */ nop -/* 00488 80B91A78 00000000 */ nop -/* 0048C 80B91A7C 00000000 */ nop - diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Init.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Init.s deleted file mode 100644 index 8cffc64b818..00000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Init.s +++ /dev/null @@ -1,60 +0,0 @@ -glabel ObjBombiwa_Init -/* 00058 80B91648 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 0005C 80B9164C AFA50024 */ sw $a1, 0x0024($sp) -/* 00060 80B91650 AFBF001C */ sw $ra, 0x001C($sp) -/* 00064 80B91654 AFB00018 */ sw $s0, 0x0018($sp) -/* 00068 80B91658 3C0580B9 */ lui $a1, %hi(D_80B91AD4) ## $a1 = 80B90000 -/* 0006C 80B9165C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00070 80B91660 0C01E037 */ jal Actor_ProcessInitChain - -/* 00074 80B91664 24A51AD4 */ addiu $a1, $a1, %lo(D_80B91AD4) ## $a1 = 80B91AD4 -/* 00078 80B91668 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0007C 80B9166C 0C2E457C */ jal func_80B915F0 -/* 00080 80B91670 8FA50024 */ lw $a1, 0x0024($sp) -/* 00084 80B91674 8605001C */ lh $a1, 0x001C($s0) ## 0000001C -/* 00088 80B91678 8FA40024 */ lw $a0, 0x0024($sp) -/* 0008C 80B9167C 0C00B2D0 */ jal Flags_GetSwitch - -/* 00090 80B91680 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 00094 80B91684 10400005 */ beq $v0, $zero, .L80B9169C -/* 00098 80B91688 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 0009C 80B9168C 0C00B55C */ jal Actor_Kill - -/* 000A0 80B91690 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000A4 80B91694 1000001A */ beq $zero, $zero, .L80B91700 -/* 000A8 80B91698 8FBF001C */ lw $ra, 0x001C($sp) -.L80B9169C: -/* 000AC 80B9169C 3C0680B9 */ lui $a2, %hi(D_80B91ACC) ## $a2 = 80B90000 -/* 000B0 80B916A0 24C61ACC */ addiu $a2, $a2, %lo(D_80B91ACC) ## $a2 = 80B91ACC -/* 000B4 80B916A4 0C0187B5 */ jal func_80061ED4 -/* 000B8 80B916A8 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 000BC 80B916AC 860E00B6 */ lh $t6, 0x00B6($s0) ## 000000B6 -/* 000C0 80B916B0 3C014780 */ lui $at, 0x4780 ## $at = 47800000 -/* 000C4 80B916B4 55C0000A */ bnel $t6, $zero, .L80B916E0 -/* 000C8 80B916B8 3C01C348 */ lui $at, 0xC348 ## $at = C3480000 -/* 000CC 80B916BC 44816000 */ mtc1 $at, $f12 ## $f12 = -200.00 -/* 000D0 80B916C0 0C00CFBE */ jal Math_Rand_ZeroFloat - -/* 000D4 80B916C4 00000000 */ nop -/* 000D8 80B916C8 4600010D */ trunc.w.s $f4, $f0 -/* 000DC 80B916CC 44022000 */ mfc1 $v0, $f4 -/* 000E0 80B916D0 00000000 */ nop -/* 000E4 80B916D4 A6020032 */ sh $v0, 0x0032($s0) ## 00000032 -/* 000E8 80B916D8 A60200B6 */ sh $v0, 0x00B6($s0) ## 000000B6 -/* 000EC 80B916DC 3C01C348 */ lui $at, 0xC348 ## $at = C3480000 -.L80B916E0: -/* 000F0 80B916E0 44813000 */ mtc1 $at, $f6 ## $f6 = -200.00 -/* 000F4 80B916E4 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 000F8 80B916E8 44815000 */ mtc1 $at, $f10 ## $f10 = 20.00 -/* 000FC 80B916EC C608000C */ lwc1 $f8, 0x000C($s0) ## 0000000C -/* 00100 80B916F0 E60600BC */ swc1 $f6, 0x00BC($s0) ## 000000BC -/* 00104 80B916F4 460A4400 */ add.s $f16, $f8, $f10 -/* 00108 80B916F8 E6100028 */ swc1 $f16, 0x0028($s0) ## 00000028 -/* 0010C 80B916FC 8FBF001C */ lw $ra, 0x001C($sp) -.L80B91700: -/* 00110 80B91700 8FB00018 */ lw $s0, 0x0018($sp) -/* 00114 80B91704 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00118 80B91708 03E00008 */ jr $ra -/* 0011C 80B9170C 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Update.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Update.s deleted file mode 100644 index a357967a45e..00000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Update.s +++ /dev/null @@ -1,81 +0,0 @@ -glabel ObjBombiwa_Update -/* 00348 80B91938 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 0034C 80B9193C AFB00014 */ sw $s0, 0x0014($sp) -/* 00350 80B91940 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00354 80B91944 AFB10018 */ sw $s1, 0x0018($sp) -/* 00358 80B91948 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 0035C 80B9194C AFBF001C */ sw $ra, 0x001C($sp) -/* 00360 80B91950 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00364 80B91954 0C00CDA1 */ jal func_80033684 -/* 00368 80B91958 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 0036C 80B9195C 1440000C */ bne $v0, $zero, .L80B91990 -/* 00370 80B91960 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00374 80B91964 9202015D */ lbu $v0, 0x015D($s0) ## 0000015D -/* 00378 80B91968 304E0002 */ andi $t6, $v0, 0x0002 ## $t6 = 00000000 -/* 0037C 80B9196C 51C0001F */ beql $t6, $zero, .L80B919EC -/* 00380 80B91970 3C014448 */ lui $at, 0x4448 ## $at = 44480000 -/* 00384 80B91974 8E0F0188 */ lw $t7, 0x0188($s0) ## 00000188 -/* 00388 80B91978 3C014000 */ lui $at, 0x4000 ## $at = 40000000 -/* 0038C 80B9197C 34210040 */ ori $at, $at, 0x0040 ## $at = 40000040 -/* 00390 80B91980 8DF80000 */ lw $t8, 0x0000($t7) ## 00000000 -/* 00394 80B91984 0301C824 */ and $t9, $t8, $at -/* 00398 80B91988 53200018 */ beql $t9, $zero, .L80B919EC -/* 0039C 80B9198C 3C014448 */ lui $at, 0x4448 ## $at = 44480000 -.L80B91990: -/* 003A0 80B91990 0C2E45CE */ jal func_80B91738 -/* 003A4 80B91994 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 003A8 80B91998 8605001C */ lh $a1, 0x001C($s0) ## 0000001C -/* 003AC 80B9199C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 003B0 80B919A0 0C00B2DD */ jal Flags_SetSwitch - -/* 003B4 80B919A4 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 003B8 80B919A8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 003BC 80B919AC 26050024 */ addiu $a1, $s0, 0x0024 ## $a1 = 00000024 -/* 003C0 80B919B0 24060050 */ addiu $a2, $zero, 0x0050 ## $a2 = 00000050 -/* 003C4 80B919B4 0C01AEB6 */ jal Audio_PlaySoundAtPosition - -/* 003C8 80B919B8 24072810 */ addiu $a3, $zero, 0x2810 ## $a3 = 00002810 -/* 003CC 80B919BC 8608001C */ lh $t0, 0x001C($s0) ## 0000001C -/* 003D0 80B919C0 00084BC3 */ sra $t1, $t0, 15 -/* 003D4 80B919C4 312A0001 */ andi $t2, $t1, 0x0001 ## $t2 = 00000000 -/* 003D8 80B919C8 11400003 */ beq $t2, $zero, .L80B919D8 -/* 003DC 80B919CC 00000000 */ nop -/* 003E0 80B919D0 0C01E221 */ jal func_80078884 -/* 003E4 80B919D4 24044802 */ addiu $a0, $zero, 0x4802 ## $a0 = 00004802 -.L80B919D8: -/* 003E8 80B919D8 0C00B55C */ jal Actor_Kill - -/* 003EC 80B919DC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 003F0 80B919E0 10000015 */ beq $zero, $zero, .L80B91A38 -/* 003F4 80B919E4 8FBF001C */ lw $ra, 0x001C($sp) -/* 003F8 80B919E8 3C014448 */ lui $at, 0x4448 ## $at = 44480000 -.L80B919EC: -/* 003FC 80B919EC 44813000 */ mtc1 $at, $f6 ## $f6 = 800.00 -/* 00400 80B919F0 C6040090 */ lwc1 $f4, 0x0090($s0) ## 00000090 -/* 00404 80B919F4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00408 80B919F8 304BFFFD */ andi $t3, $v0, 0xFFFD ## $t3 = 00000000 -/* 0040C 80B919FC 4606203C */ c.lt.s $f4, $f6 -/* 00410 80B91A00 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 00414 80B91A04 A20B015D */ sb $t3, 0x015D($s0) ## 0000015D -/* 00418 80B91A08 02212821 */ addu $a1, $s1, $at -/* 0041C 80B91A0C 45000009 */ bc1f .L80B91A34 -/* 00420 80B91A10 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00424 80B91A14 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C -/* 00428 80B91A18 AFA60020 */ sw $a2, 0x0020($sp) -/* 0042C 80B91A1C 0C01767D */ jal Actor_CollisionCheck_SetAC - ## CollisionCheck_setAC -/* 00430 80B91A20 AFA50024 */ sw $a1, 0x0024($sp) -/* 00434 80B91A24 8FA50024 */ lw $a1, 0x0024($sp) -/* 00438 80B91A28 8FA60020 */ lw $a2, 0x0020($sp) -/* 0043C 80B91A2C 0C017713 */ jal Actor_CollisionCheck_SetOT - ## CollisionCheck_setOT -/* 00440 80B91A30 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -.L80B91A34: -/* 00444 80B91A34 8FBF001C */ lw $ra, 0x001C($sp) -.L80B91A38: -/* 00448 80B91A38 8FB00014 */ lw $s0, 0x0014($sp) -/* 0044C 80B91A3C 8FB10018 */ lw $s1, 0x0018($sp) -/* 00450 80B91A40 03E00008 */ jr $ra -/* 00454 80B91A44 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 - - diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B915F0.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B915F0.s deleted file mode 100644 index 4d34357b32b..00000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B915F0.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_80B915F0 -/* 00000 80B915F0 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00004 80B915F4 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 00008 80B915F8 AFA50024 */ sw $a1, 0x0024($sp) -/* 0000C 80B915FC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00010 80B91600 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00014 80B91604 24C5014C */ addiu $a1, $a2, 0x014C ## $a1 = 0000014C -/* 00018 80B91608 AFA50018 */ sw $a1, 0x0018($sp) -/* 0001C 80B9160C 0C0170D9 */ jal ActorCollider_AllocCylinder - -/* 00020 80B91610 AFA60020 */ sw $a2, 0x0020($sp) -/* 00024 80B91614 3C0780B9 */ lui $a3, %hi(D_80B91AA0) ## $a3 = 80B90000 -/* 00028 80B91618 8FA60020 */ lw $a2, 0x0020($sp) -/* 0002C 80B9161C 24E71AA0 */ addiu $a3, $a3, %lo(D_80B91AA0) ## $a3 = 80B91AA0 -/* 00030 80B91620 8FA40024 */ lw $a0, 0x0024($sp) -/* 00034 80B91624 0C01712B */ jal ActorCollider_InitCylinder - -/* 00038 80B91628 8FA50018 */ lw $a1, 0x0018($sp) -/* 0003C 80B9162C 8FA40020 */ lw $a0, 0x0020($sp) -/* 00040 80B91630 0C0189B7 */ jal ActorCollider_Cylinder_Update - -/* 00044 80B91634 8FA50018 */ lw $a1, 0x0018($sp) -/* 00048 80B91638 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0004C 80B9163C 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00050 80B91640 03E00008 */ jr $ra -/* 00054 80B91644 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B91738.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B91738.s deleted file mode 100644 index f28386d4376..00000000000 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B91738.s +++ /dev/null @@ -1,141 +0,0 @@ -glabel func_80B91738 -/* 00148 80B91738 27BDFF40 */ addiu $sp, $sp, 0xFF40 ## $sp = FFFFFF40 -/* 0014C 80B9173C F7BE0070 */ sdc1 $f30, 0x0070($sp) -/* 00150 80B91740 3C014180 */ lui $at, 0x4180 ## $at = 41800000 -/* 00154 80B91744 4481F000 */ mtc1 $at, $f30 ## $f30 = 16.00 -/* 00158 80B91748 F7BC0068 */ sdc1 $f28, 0x0068($sp) -/* 0015C 80B9174C 3C014100 */ lui $at, 0x4100 ## $at = 41000000 -/* 00160 80B91750 4481E000 */ mtc1 $at, $f28 ## $f28 = 8.00 -/* 00164 80B91754 F7BA0060 */ sdc1 $f26, 0x0060($sp) -/* 00168 80B91758 3C014170 */ lui $at, 0x4170 ## $at = 41700000 -/* 0016C 80B9175C 4481D000 */ mtc1 $at, $f26 ## $f26 = 15.00 -/* 00170 80B91760 F7B80058 */ sdc1 $f24, 0x0058($sp) -/* 00174 80B91764 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000 -/* 00178 80B91768 4481C000 */ mtc1 $at, $f24 ## $f24 = 5.00 -/* 0017C 80B9176C F7B60050 */ sdc1 $f22, 0x0050($sp) -/* 00180 80B91770 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00184 80B91774 4481B000 */ mtc1 $at, $f22 ## $f22 = 10.00 -/* 00188 80B91778 AFB5008C */ sw $s5, 0x008C($sp) -/* 0018C 80B9177C AFB40088 */ sw $s4, 0x0088($sp) -/* 00190 80B91780 AFB00078 */ sw $s0, 0x0078($sp) -/* 00194 80B91784 F7B40048 */ sdc1 $f20, 0x0048($sp) -/* 00198 80B91788 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 0019C 80B9178C AFB60090 */ sw $s6, 0x0090($sp) -/* 001A0 80B91790 AFB30084 */ sw $s3, 0x0084($sp) -/* 001A4 80B91794 AFB20080 */ sw $s2, 0x0080($sp) -/* 001A8 80B91798 AFB1007C */ sw $s1, 0x007C($sp) -/* 001AC 80B9179C 3C1080B9 */ lui $s0, %hi(D_80B91AE4) ## $s0 = 80B90000 -/* 001B0 80B917A0 3C140600 */ lui $s4, 0x0600 ## $s4 = 06000000 -/* 001B4 80B917A4 3C1580B9 */ lui $s5, %hi(D_80B91AF4) ## $s5 = 80B90000 -/* 001B8 80B917A8 4481A000 */ mtc1 $at, $f20 ## $f20 = 0.50 -/* 001BC 80B917AC 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000 -/* 001C0 80B917B0 00A0B025 */ or $s6, $a1, $zero ## $s6 = 00000000 -/* 001C4 80B917B4 AFBF0094 */ sw $ra, 0x0094($sp) -/* 001C8 80B917B8 26B51AF4 */ addiu $s5, $s5, %lo(D_80B91AF4) ## $s5 = 80B91AF4 -/* 001CC 80B917BC 269409E0 */ addiu $s4, $s4, 0x09E0 ## $s4 = 060009E0 -/* 001D0 80B917C0 26101AE4 */ addiu $s0, $s0, %lo(D_80B91AE4) ## $s0 = 80B91AE4 -/* 001D4 80B917C4 27B200B4 */ addiu $s2, $sp, 0x00B4 ## $s2 = FFFFFFF4 -/* 001D8 80B917C8 27B300A8 */ addiu $s3, $sp, 0x00A8 ## $s3 = FFFFFFE8 -.L80B917CC: -/* 001DC 80B917CC 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 001E0 80B917D0 00000000 */ nop -/* 001E4 80B917D4 46140101 */ sub.s $f4, $f0, $f20 -/* 001E8 80B917D8 C6280008 */ lwc1 $f8, 0x0008($s1) ## 00000008 -/* 001EC 80B917DC 46162182 */ mul.s $f6, $f4, $f22 -/* 001F0 80B917E0 46083280 */ add.s $f10, $f6, $f8 -/* 001F4 80B917E4 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 001F8 80B917E8 E7AA00B4 */ swc1 $f10, 0x00B4($sp) -/* 001FC 80B917EC 46180402 */ mul.s $f16, $f0, $f24 -/* 00200 80B917F0 C632000C */ lwc1 $f18, 0x000C($s1) ## 0000000C -/* 00204 80B917F4 46128100 */ add.s $f4, $f16, $f18 -/* 00208 80B917F8 461C2180 */ add.s $f6, $f4, $f28 -/* 0020C 80B917FC 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00210 80B91800 E7A600B8 */ swc1 $f6, 0x00B8($sp) -/* 00214 80B91804 46140201 */ sub.s $f8, $f0, $f20 -/* 00218 80B91808 C6300010 */ lwc1 $f16, 0x0010($s1) ## 00000010 -/* 0021C 80B9180C 46164282 */ mul.s $f10, $f8, $f22 -/* 00220 80B91810 46105480 */ add.s $f18, $f10, $f16 -/* 00224 80B91814 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00228 80B91818 E7B200BC */ swc1 $f18, 0x00BC($sp) -/* 0022C 80B9181C 46140101 */ sub.s $f4, $f0, $f20 -/* 00230 80B91820 461A2182 */ mul.s $f6, $f4, $f26 -/* 00234 80B91824 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00238 80B91828 E7A600A8 */ swc1 $f6, 0x00A8($sp) -/* 0023C 80B9182C 461E0202 */ mul.s $f8, $f0, $f30 -/* 00240 80B91830 46184280 */ add.s $f10, $f8, $f24 -/* 00244 80B91834 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00248 80B91838 E7AA00AC */ swc1 $f10, 0x00AC($sp) -/* 0024C 80B9183C 46140401 */ sub.s $f16, $f0, $f20 -/* 00250 80B91840 86020000 */ lh $v0, 0x0000($s0) ## 80B91AE4 -/* 00254 80B91844 02C02025 */ or $a0, $s6, $zero ## $a0 = 00000000 -/* 00258 80B91848 02402825 */ or $a1, $s2, $zero ## $a1 = FFFFFFF4 -/* 0025C 80B9184C 461A8482 */ mul.s $f18, $f16, $f26 -/* 00260 80B91850 2841000B */ slti $at, $v0, 0x000B -/* 00264 80B91854 02603025 */ or $a2, $s3, $zero ## $a2 = FFFFFFE8 -/* 00268 80B91858 02403825 */ or $a3, $s2, $zero ## $a3 = FFFFFFF4 -/* 0026C 80B9185C 240EFE70 */ addiu $t6, $zero, 0xFE70 ## $t6 = FFFFFE70 -/* 00270 80B91860 240F000A */ addiu $t7, $zero, 0x000A ## $t7 = 0000000A -/* 00274 80B91864 14200003 */ bne $at, $zero, .L80B91874 -/* 00278 80B91868 E7B200B0 */ swc1 $f18, 0x00B0($sp) -/* 0027C 80B9186C 10000002 */ beq $zero, $zero, .L80B91878 -/* 00280 80B91870 24030025 */ addiu $v1, $zero, 0x0025 ## $v1 = 00000025 -.L80B91874: -/* 00284 80B91874 24030021 */ addiu $v1, $zero, 0x0021 ## $v1 = 00000021 -.L80B91878: -/* 00288 80B91878 24180002 */ addiu $t8, $zero, 0x0002 ## $t8 = 00000002 -/* 0028C 80B9187C 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 00290 80B91880 24080050 */ addiu $t0, $zero, 0x0050 ## $t0 = 00000050 -/* 00294 80B91884 2409FFFF */ addiu $t1, $zero, 0xFFFF ## $t1 = FFFFFFFF -/* 00298 80B91888 240A0163 */ addiu $t2, $zero, 0x0163 ## $t2 = 00000163 -/* 0029C 80B9188C AFAA0038 */ sw $t2, 0x0038($sp) -/* 002A0 80B91890 AFA90034 */ sw $t1, 0x0034($sp) -/* 002A4 80B91894 AFA80030 */ sw $t0, 0x0030($sp) -/* 002A8 80B91898 AFB90028 */ sw $t9, 0x0028($sp) -/* 002AC 80B9189C AFB8001C */ sw $t8, 0x001C($sp) -/* 002B0 80B918A0 AFAE0010 */ sw $t6, 0x0010($sp) -/* 002B4 80B918A4 AFA30014 */ sw $v1, 0x0014($sp) -/* 002B8 80B918A8 AFAF0018 */ sw $t7, 0x0018($sp) -/* 002BC 80B918AC AFA00020 */ sw $zero, 0x0020($sp) -/* 002C0 80B918B0 AFA20024 */ sw $v0, 0x0024($sp) -/* 002C4 80B918B4 AFA0002C */ sw $zero, 0x002C($sp) -/* 002C8 80B918B8 0C00A7A3 */ jal Effect_SpawnFragment - -/* 002CC 80B918BC AFB4003C */ sw $s4, 0x003C($sp) -/* 002D0 80B918C0 26100002 */ addiu $s0, $s0, 0x0002 ## $s0 = 80B91AE6 -/* 002D4 80B918C4 1615FFC1 */ bne $s0, $s5, .L80B917CC -/* 002D8 80B918C8 00000000 */ nop -/* 002DC 80B918CC 240B0064 */ addiu $t3, $zero, 0x0064 ## $t3 = 00000064 -/* 002E0 80B918D0 240C00A0 */ addiu $t4, $zero, 0x00A0 ## $t4 = 000000A0 -/* 002E4 80B918D4 240D0001 */ addiu $t5, $zero, 0x0001 ## $t5 = 00000001 -/* 002E8 80B918D8 AFAD0018 */ sw $t5, 0x0018($sp) -/* 002EC 80B918DC AFAC0014 */ sw $t4, 0x0014($sp) -/* 002F0 80B918E0 AFAB0010 */ sw $t3, 0x0010($sp) -/* 002F4 80B918E4 02C02025 */ or $a0, $s6, $zero ## $a0 = 00000000 -/* 002F8 80B918E8 26250024 */ addiu $a1, $s1, 0x0024 ## $a1 = 00000024 -/* 002FC 80B918EC 3C064270 */ lui $a2, 0x4270 ## $a2 = 42700000 -/* 00300 80B918F0 0C00CD20 */ jal func_80033480 -/* 00304 80B918F4 24070008 */ addiu $a3, $zero, 0x0008 ## $a3 = 00000008 -/* 00308 80B918F8 8FBF0094 */ lw $ra, 0x0094($sp) -/* 0030C 80B918FC D7B40048 */ ldc1 $f20, 0x0048($sp) -/* 00310 80B91900 D7B60050 */ ldc1 $f22, 0x0050($sp) -/* 00314 80B91904 D7B80058 */ ldc1 $f24, 0x0058($sp) -/* 00318 80B91908 D7BA0060 */ ldc1 $f26, 0x0060($sp) -/* 0031C 80B9190C D7BC0068 */ ldc1 $f28, 0x0068($sp) -/* 00320 80B91910 D7BE0070 */ ldc1 $f30, 0x0070($sp) -/* 00324 80B91914 8FB00078 */ lw $s0, 0x0078($sp) -/* 00328 80B91918 8FB1007C */ lw $s1, 0x007C($sp) -/* 0032C 80B9191C 8FB20080 */ lw $s2, 0x0080($sp) -/* 00330 80B91920 8FB30084 */ lw $s3, 0x0084($sp) -/* 00334 80B91924 8FB40088 */ lw $s4, 0x0088($sp) -/* 00338 80B91928 8FB5008C */ lw $s5, 0x008C($sp) -/* 0033C 80B9192C 8FB60090 */ lw $s6, 0x0090($sp) -/* 00340 80B91930 03E00008 */ jr $ra -/* 00344 80B91934 27BD00C0 */ addiu $sp, $sp, 0x00C0 ## $sp = 00000000 - - diff --git a/data/overlays/actors/z_obj_bombiwa.data.s b/data/overlays/actors/z_obj_bombiwa.data.s deleted file mode 100644 index 8e75de6e792..00000000000 --- a/data/overlays/actors/z_obj_bombiwa.data.s +++ /dev/null @@ -1,26 +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 Obj_Bombiwa_InitVars - .word 0x01270600, 0x00000000, 0x01630000, 0x00000198 -.word ObjBombiwa_Init -.word ObjBombiwa_Destroy -.word ObjBombiwa_Update -.word ObjBombiwa_Draw -glabel D_80B91AA0 - .word 0x0C000D39, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x4FC1FFFE, 0x00000000, 0x00010100, 0x00370046, 0x00000000, 0x00000000 -glabel D_80B91ACC - .word 0x0000000C, 0x003CFF00 -glabel D_80B91AD4 - .word 0xC8500064, 0xB0F407D0, 0xB0F8015E, 0x30FC03E8 -glabel D_80B91AE4 - .word 0x0011000E, 0x000A0008, 0x00070005, 0x00030002 -glabel D_80B91AF4 - .word 0x00000000, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_obj_bombiwa.reloc.s b/data/overlays/actors/z_obj_bombiwa.reloc.s deleted file mode 100644 index 924bca2fae6..00000000000 --- a/data/overlays/actors/z_obj_bombiwa.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_80B91B00 - -.incbin "baserom/ovl_Obj_Bombiwa", 0x510, 0x00000060 diff --git a/spec b/spec index 1a3b075a91d..d29e1d46e79 100644 --- a/spec +++ b/spec @@ -4048,8 +4048,7 @@ endseg beginseg name "ovl_Obj_Bombiwa" include "build/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.o" - include "build/data/overlays/actors/z_obj_bombiwa.data.o" - include "build/data/overlays/actors/z_obj_bombiwa.reloc.o" + include "build/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 00b720f4203..fa1d9696760 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -1,14 +1,22 @@ +/* + * File: z_obj_bombiwa.c + * Overlay: ovl_Obj_Bombiwa + * Description: Round, brown, breakable boulder +*/ + #include "z_obj_bombiwa.h" #define ROOM 0x00 #define FLAGS 0x00000000 -void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx); -void ObjBombiwa_Destroy(ObjBombiwa* this, GlobalContext* globalCtx); -void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx); -void ObjBombiwa_Draw(ObjBombiwa* this, GlobalContext* globalCtx); +static void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx); +static void ObjBombiwa_Destroy(ObjBombiwa* this, GlobalContext* globalCtx); +static void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx); +static void ObjBombiwa_Draw(ObjBombiwa* this, GlobalContext* globalCtx); + +static void ObjBombiwa_InitCollision(ObjBombiwa* this, GlobalContext* globalCtx); +static void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx); -/* const ActorInit Obj_Bombiwa_InitVars = { ACTOR_OBJ_BOMBIWA, @@ -22,18 +30,128 @@ const ActorInit Obj_Bombiwa_InitVars = (ActorFunc)ObjBombiwa_Update, (ActorFunc)ObjBombiwa_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B915F0.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Init.s") +static ColliderCylinderInit colliderInit = +{ + 0x0C, 0x00, 0x0D, 0x39, + 0x20, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00000000, 0x00, 0x00, + 0x00, 0x00, 0x4FC1FFFE, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x00, + 0x0037, 0x0046, 0x0000, + 0x0000, 0x0000, 0x0000 +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Destroy.s") +static u32 damageChart[] = +{ + 0x0000000C, 0x003CFF00 +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/func_80B91738.s") +static InitChainEntry initChain[] = +{ + ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_CONTINUE), + ICHAIN_F32(unk_F4, 0x7D0, ICHAIN_CONTINUE), + ICHAIN_F32(unk_F8, 0x15E, ICHAIN_CONTINUE), + ICHAIN_F32(unk_FC, 0x3E8, ICHAIN_STOP) +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Update.s") +static s16 effectScales[] = +{ + 17, 14, 10, 8, 7, 5, 3, 2 +}; + +extern Gfx* D_060009E0; //dlist + +static void ObjBombiwa_InitCollision(ObjBombiwa* this, GlobalContext* globalCtx) +{ + ObjBombiwa* thisLocal = this; + ActorCollider_AllocCylinder(globalCtx, &thisLocal->collider); + ActorCollider_InitCylinder(globalCtx, &thisLocal->collider, &thisLocal->actor, &colliderInit); + ActorCollider_Cylinder_Update(&thisLocal->actor, &thisLocal->collider); +} + +static void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx) +{ + Actor_ProcessInitChain(&this->actor, initChain); + ObjBombiwa_InitCollision(this, globalCtx); + if ((Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) != 0)) + { + Actor_Kill(&this->actor); + return; + } + func_80061ED4(&this->actor.sub_98.damageChart, NULL, damageChart); + if (this->actor.shape.rot.y == 0) + { + s16 rand = (s16) Math_Rand_ZeroFloat(65536.0f); + this->actor.posRot.rot.y = rand; + this->actor.shape.rot.y = rand; + } + this->actor.shape.unk_08 = -200.0f; + this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 20.0f; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Bombiwa/ObjBombiwa_Draw.s") +static void ObjBombiwa_Destroy(ObjBombiwa* this, GlobalContext* globalCtx) +{ + ActorCollider_FreeCylinder(globalCtx, &this->collider); +} + +static void ObjBombiwa_Break(ObjBombiwa *this, GlobalContext *globalCtx) +{ + Vec3f temp_s2; + Vec3f temp_s3; + Gfx** dlist; + s16 u0; + s16 scale; + s32 i; + dlist = &D_060009E0; + for (i = 0; i < ARRAY_COUNT(effectScales); i++) + { + temp_s2.x = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.x; + temp_s2.y = ((Math_Rand_ZeroOne() * 5.0f) + this->actor.initPosRot.pos.y) + 8.0f; + temp_s2.z = ((Math_Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.z; + temp_s3.x = (Math_Rand_ZeroOne() - 0.5f) * 15.0f; + temp_s3.y = (Math_Rand_ZeroOne() * 16.0f) + 5.0f; + temp_s3.z = (Math_Rand_ZeroOne() - 0.5f) * 15.0f; + scale = effectScales[i]; + u0 = (scale >= 11) ? 37 : 33; + Effect_SpawnFragment(globalCtx, &temp_s2, &temp_s3, &temp_s2, -400, u0, 10, 2, 0, scale, 1, 0, 80, -1, OBJECT_BOMBIWA, dlist); + } + func_80033480(globalCtx, &this->actor.posRot.pos, 60.0f, 8, 100, 160, 1); +} +static void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx) +{ + SubGlobalContext11E60* sub_11E60; + ColliderCylinderMain* collider; + + if (func_80033684(globalCtx, &this->actor) != NULL || + ((this->collider.base.collideFlags & 2) != 0 && + (this->collider.body.colliding->toucher.flags & 0x40000040) != 0)) + { + ObjBombiwa_Break(this, globalCtx); + Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 80, NA_SE_EV_WALL_BROKEN); + if (((this->actor.params >> 0xF) & 1) != 0) + { + func_80078884(NA_SE_SY_CORRECT_CHIME); + } + Actor_Kill(&this->actor); + return; + } + this->collider.base.collideFlags &= ~0x2; + if (this->actor.xzDistanceFromLink < 800.0f) + { + sub_11E60 = &globalCtx->sub_11E60; + collider = &this->collider; + Actor_CollisionCheck_SetAC(globalCtx, sub_11E60, collider); + Actor_CollisionCheck_SetOT(globalCtx, sub_11E60, collider); + } +} +static void ObjBombiwa_Draw(ObjBombiwa* this, GlobalContext* globalCtx) +{ + Draw_DListOpa(globalCtx, &D_060009E0); +} diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h index ccffafb5992..beafae8fbe8 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h @@ -7,7 +7,7 @@ typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x4C]; + /* 0x014C */ ColliderCylinderMain collider; } ObjBombiwa; // size = 0x0198 extern const ActorInit Obj_Bombiwa_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 102b1856002..a092767d431 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -390,4 +390,7 @@ D_06009244 = 0x06009244; D_060041F4 = 0x060041F4; D_0600A054 = 0x0600A054; D_06008688 = 0x06008688; -D_04049210 = 0x04049210; \ No newline at end of file +D_04049210 = 0x04049210; + +// z_obj_bombiwa +D_060009E0 = 0x060009E0; \ No newline at end of file From ad417f8824c598cbb08697f609ed14a67887b5ad Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Fri, 20 Mar 2020 01:04:19 +0000 Subject: [PATCH 2/3] Remove duplicate en_lightbox syms added by merge --- undefined_syms.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/undefined_syms.txt b/undefined_syms.txt index 38e5bd45b53..92837d0b737 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -393,9 +393,5 @@ D_0600A054 = 0x0600A054; D_06008688 = 0x06008688; D_04049210 = 0x04049210; -// z_en_lightbox -D_06000B70 = 0x06000B70; -D_06001F10 = 0x06001F10; - // z_obj_bombiwa D_060009E0 = 0x060009E0; \ No newline at end of file From a3ddf65661628784e0b24b1e460b04e4dba4adc1 Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Fri, 20 Mar 2020 01:29:12 +0000 Subject: [PATCH 3/3] Cleanups, add trailing commas to several multi-line arrays/structs --- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 4 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 43 +++++++++++-------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 53641c4f19e..406a70a6894 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -45,7 +45,7 @@ static ColliderCylinderInit colliderInit = 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0032, 0x000A, 0x0000, - 0x0000, 0x0000, 0x0000 + 0x0000, 0x0000, 0x0000, }; // array of entrance table entries to grotto destinations @@ -53,7 +53,7 @@ static s16 entrances[] = { 0x036D, 0x003F, 0x0598, 0x059C, 0x05A0, 0x05A4, 0x05A8, 0x05AC, 0x05B0, 0x05B4, 0x05B8, 0x05BC, - 0x05C0, 0x05C4, 0x05FC + 0x05C0, 0x05C4, 0x05FC, }; // display list diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index fa1d9696760..d5cc6f8feb5 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -41,12 +41,12 @@ static ColliderCylinderInit colliderInit = 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x0037, 0x0046, 0x0000, - 0x0000, 0x0000, 0x0000 + 0x0000, 0x0000, 0x0000, }; static u32 damageChart[] = { - 0x0000000C, 0x003CFF00 + 0x0000000C, 0x003CFF00, }; static InitChainEntry initChain[] = @@ -54,12 +54,12 @@ static InitChainEntry initChain[] = ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_CONTINUE), ICHAIN_F32(unk_F4, 0x7D0, ICHAIN_CONTINUE), ICHAIN_F32(unk_F8, 0x15E, ICHAIN_CONTINUE), - ICHAIN_F32(unk_FC, 0x3E8, ICHAIN_STOP) + ICHAIN_F32(unk_FC, 0x3E8, ICHAIN_STOP), }; static s16 effectScales[] = { - 17, 14, 10, 8, 7, 5, 3, 2 + 17, 14, 10, 8, 7, 5, 3, 2, }; extern Gfx* D_060009E0; //dlist @@ -79,17 +79,20 @@ static void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx) if ((Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) != 0)) { Actor_Kill(&this->actor); - return; } - func_80061ED4(&this->actor.sub_98.damageChart, NULL, damageChart); - if (this->actor.shape.rot.y == 0) + else { - s16 rand = (s16) Math_Rand_ZeroFloat(65536.0f); - this->actor.posRot.rot.y = rand; - this->actor.shape.rot.y = rand; + func_80061ED4(&this->actor.sub_98.damageChart, NULL, damageChart); + if (this->actor.shape.rot.y == 0) + { + s16 rand = (s16) Math_Rand_ZeroFloat(65536.0f); + this->actor.posRot.rot.y = rand; + this->actor.shape.rot.y = rand; + } + this->actor.shape.unk_08 = -200.0f; + this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 20.0f; } - this->actor.shape.unk_08 = -200.0f; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 20.0f; + } static void ObjBombiwa_Destroy(ObjBombiwa* this, GlobalContext* globalCtx) @@ -139,15 +142,17 @@ static void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx) func_80078884(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->actor); - return; } - this->collider.base.collideFlags &= ~0x2; - if (this->actor.xzDistanceFromLink < 800.0f) + else { - sub_11E60 = &globalCtx->sub_11E60; - collider = &this->collider; - Actor_CollisionCheck_SetAC(globalCtx, sub_11E60, collider); - Actor_CollisionCheck_SetOT(globalCtx, sub_11E60, collider); + this->collider.base.collideFlags &= ~0x2; + if (this->actor.xzDistanceFromLink < 800.0f) + { + sub_11E60 = &globalCtx->sub_11E60; + collider = &this->collider; + Actor_CollisionCheck_SetAC(globalCtx, sub_11E60, collider); + Actor_CollisionCheck_SetOT(globalCtx, sub_11E60, collider); + } } }