From 740a54ac9998d276cd79e1059a24837d6ea9c50a Mon Sep 17 00:00:00 2001 From: i82orbom Date: Thu, 27 Aug 2020 21:25:22 +0200 Subject: [PATCH] Decompiles z_bg_spot08_bakudankabe.c (#348) * func_808B02D0 * BgSpot08Bakudankabe_Init * BgSpot08Bakudankabe_Destroy * BgSpot08Bakudankabe_Update * Finishes z_bg_spot08_bakudankabe * Update src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Update src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> Co-authored-by: i82orbom Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> --- .../BgSpot08Bakudankabe_Destroy.s | 20 -- .../BgSpot08Bakudankabe_Draw.s | 27 --- .../BgSpot08Bakudankabe_Init.s | 48 ---- .../BgSpot08Bakudankabe_Update.s | 50 ---- .../ovl_Bg_Spot08_Bakudankabe/func_808B02D0.s | 22 -- .../ovl_Bg_Spot08_Bakudankabe/func_808B0324.s | 214 ------------------ .../actors/z_bg_spot08_bakudankabe.data.s | 27 --- .../actors/z_bg_spot08_bakudankabe.reloc.s | 13 -- spec | 3 +- .../z_bg_spot08_bakudankabe.c | 153 ++++++++++++- .../z_bg_spot08_bakudankabe.h | 5 +- undefined_syms.txt | 5 + 12 files changed, 154 insertions(+), 433 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B02D0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B0324.s delete mode 100644 data/overlays/actors/z_bg_spot08_bakudankabe.data.s delete mode 100644 data/overlays/actors/z_bg_spot08_bakudankabe.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Destroy.s deleted file mode 100644 index 664c815600..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Destroy.s +++ /dev/null @@ -1,20 +0,0 @@ -glabel BgSpot08Bakudankabe_Destroy -/* 003E8 808B06B8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 003EC 808B06BC AFA40018 */ sw $a0, 0x0018($sp) -/* 003F0 808B06C0 8FAE0018 */ lw $t6, 0x0018($sp) -/* 003F4 808B06C4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 003F8 808B06C8 00A03825 */ or $a3, $a1, $zero ## $a3 = 00000000 -/* 003FC 808B06CC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00400 808B06D0 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C -/* 00404 808B06D4 AFA7001C */ sw $a3, 0x001C($sp) -/* 00408 808B06D8 0C00FB56 */ jal DynaPolyInfo_Free - ## DynaPolyInfo_delReserve -/* 0040C 808B06DC 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810 -/* 00410 808B06E0 8FA50018 */ lw $a1, 0x0018($sp) -/* 00414 808B06E4 8FA4001C */ lw $a0, 0x001C($sp) -/* 00418 808B06E8 0C016F32 */ jal Collider_DestroyJntSph -/* 0041C 808B06EC 24A50164 */ addiu $a1, $a1, 0x0164 ## $a1 = 00000164 -/* 00420 808B06F0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00424 808B06F4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00428 808B06F8 03E00008 */ jr $ra -/* 0042C 808B06FC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Draw.s deleted file mode 100644 index cc4cef2ac0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Draw.s +++ /dev/null @@ -1,27 +0,0 @@ -glabel BgSpot08Bakudankabe_Draw -/* 004DC 808B07AC 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 004E0 808B07B0 AFA40020 */ sw $a0, 0x0020($sp) -/* 004E4 808B07B4 AFA50024 */ sw $a1, 0x0024($sp) -/* 004E8 808B07B8 8FA50020 */ lw $a1, 0x0020($sp) -/* 004EC 808B07BC AFBF0014 */ sw $ra, 0x0014($sp) -/* 004F0 808B07C0 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 004F4 808B07C4 24A50164 */ addiu $a1, $a1, 0x0164 ## $a1 = 00000164 -/* 004F8 808B07C8 0C018A29 */ jal func_800628A4 -/* 004FC 808B07CC AFA50018 */ sw $a1, 0x0018($sp) -/* 00500 808B07D0 24040001 */ addiu $a0, $zero, 0x0001 ## $a0 = 00000001 -/* 00504 808B07D4 0C018A29 */ jal func_800628A4 -/* 00508 808B07D8 8FA50018 */ lw $a1, 0x0018($sp) -/* 0050C 808B07DC 24040002 */ addiu $a0, $zero, 0x0002 ## $a0 = 00000002 -/* 00510 808B07E0 0C018A29 */ jal func_800628A4 -/* 00514 808B07E4 8FA50018 */ lw $a1, 0x0018($sp) -/* 00518 808B07E8 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 0051C 808B07EC 24A53898 */ addiu $a1, $a1, 0x3898 ## $a1 = 06003898 -/* 00520 808B07F0 0C00D498 */ jal Gfx_DrawDListOpa - -/* 00524 808B07F4 8FA40024 */ lw $a0, 0x0024($sp) -/* 00528 808B07F8 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0052C 808B07FC 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00530 808B0800 03E00008 */ jr $ra -/* 00534 808B0804 00000000 */ nop -/* 00538 808B0808 00000000 */ nop -/* 0053C 808B080C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Init.s deleted file mode 100644 index dd13cf3acf..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Init.s +++ /dev/null @@ -1,48 +0,0 @@ -glabel BgSpot08Bakudankabe_Init -/* 0034C 808B061C 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 00350 808B0620 AFBF001C */ sw $ra, 0x001C($sp) -/* 00354 808B0624 AFB00018 */ sw $s0, 0x0018($sp) -/* 00358 808B0628 AFA50034 */ sw $a1, 0x0034($sp) -/* 0035C 808B062C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00360 808B0630 AFA00024 */ sw $zero, 0x0024($sp) -/* 00364 808B0634 0C010D20 */ jal DynaPolyInfo_SetActorMove - -/* 00368 808B0638 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 0036C 808B063C 8605001C */ lh $a1, 0x001C($s0) ## 0000001C -/* 00370 808B0640 8FA40034 */ lw $a0, 0x0034($sp) -/* 00374 808B0644 0C00B2D0 */ jal Flags_GetSwitch - -/* 00378 808B0648 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 0037C 808B064C 10400005 */ beq $v0, $zero, .L808B0664 -/* 00380 808B0650 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00384 808B0654 0C00B55C */ jal Actor_Kill - -/* 00388 808B0658 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0038C 808B065C 10000012 */ beq $zero, $zero, .L808B06A8 -/* 00390 808B0660 8FBF001C */ lw $ra, 0x001C($sp) -.L808B0664: -/* 00394 808B0664 0C22C0B4 */ jal func_808B02D0 -/* 00398 808B0668 8FA50034 */ lw $a1, 0x0034($sp) -/* 0039C 808B066C 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 003A0 808B0670 248439D4 */ addiu $a0, $a0, 0x39D4 ## $a0 = 060039D4 -/* 003A4 808B0674 0C010620 */ jal DynaPolyInfo_Alloc - -/* 003A8 808B0678 27A50024 */ addiu $a1, $sp, 0x0024 ## $a1 = FFFFFFF4 -/* 003AC 808B067C 8FA40034 */ lw $a0, 0x0034($sp) -/* 003B0 808B0680 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 003B4 808B0684 8FA70024 */ lw $a3, 0x0024($sp) -/* 003B8 808B0688 0C00FA9D */ jal DynaPolyInfo_RegisterActor - ## DynaPolyInfo_setActor -/* 003BC 808B068C 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 003C0 808B0690 3C05808B */ lui $a1, %hi(D_808B08D0) ## $a1 = 808B0000 -/* 003C4 808B0694 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 003C8 808B0698 24A508D0 */ addiu $a1, $a1, %lo(D_808B08D0) ## $a1 = 808B08D0 -/* 003CC 808B069C 0C01E037 */ jal Actor_ProcessInitChain - -/* 003D0 808B06A0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 003D4 808B06A4 8FBF001C */ lw $ra, 0x001C($sp) -.L808B06A8: -/* 003D8 808B06A8 8FB00018 */ lw $s0, 0x0018($sp) -/* 003DC 808B06AC 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 003E0 808B06B0 03E00008 */ jr $ra -/* 003E4 808B06B4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Update.s deleted file mode 100644 index 36f3412577..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Update.s +++ /dev/null @@ -1,50 +0,0 @@ -glabel BgSpot08Bakudankabe_Update -/* 00430 808B0700 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00434 808B0704 AFBF001C */ sw $ra, 0x001C($sp) -/* 00438 808B0708 AFB10018 */ sw $s1, 0x0018($sp) -/* 0043C 808B070C AFB00014 */ sw $s0, 0x0014($sp) -/* 00440 808B0710 908E0175 */ lbu $t6, 0x0175($a0) ## 00000175 -/* 00444 808B0714 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00448 808B0718 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 0044C 808B071C 31CF0002 */ andi $t7, $t6, 0x0002 ## $t7 = 00000000 -/* 00450 808B0720 11E00012 */ beq $t7, $zero, .L808B076C -/* 00454 808B0724 3C014448 */ lui $at, 0x4448 ## $at = 44480000 -/* 00458 808B0728 0C22C0C9 */ jal func_808B0324 -/* 0045C 808B072C 00000000 */ nop -/* 00460 808B0730 8605001C */ lh $a1, 0x001C($s0) ## 0000001C -/* 00464 808B0734 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00468 808B0738 0C00B2DD */ jal Flags_SetSwitch - -/* 0046C 808B073C 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 00470 808B0740 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00474 808B0744 26050024 */ addiu $a1, $s0, 0x0024 ## $a1 = 00000024 -/* 00478 808B0748 24060028 */ addiu $a2, $zero, 0x0028 ## $a2 = 00000028 -/* 0047C 808B074C 0C01AEB6 */ jal Audio_PlaySoundAtPosition - -/* 00480 808B0750 24072810 */ addiu $a3, $zero, 0x2810 ## $a3 = 00002810 -/* 00484 808B0754 0C01E221 */ jal func_80078884 -/* 00488 808B0758 24044802 */ addiu $a0, $zero, 0x4802 ## $a0 = 00004802 -/* 0048C 808B075C 0C00B55C */ jal Actor_Kill - -/* 00490 808B0760 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00494 808B0764 1000000D */ beq $zero, $zero, .L808B079C -/* 00498 808B0768 8FBF001C */ lw $ra, 0x001C($sp) -.L808B076C: -/* 0049C 808B076C C6040090 */ lwc1 $f4, 0x0090($s0) ## 00000090 -/* 004A0 808B0770 44813000 */ mtc1 $at, $f6 ## $f6 = 0.00 -/* 004A4 808B0774 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 004A8 808B0778 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 004AC 808B077C 4606203C */ c.lt.s $f4, $f6 -/* 004B0 808B0780 02212821 */ addu $a1, $s1, $at -/* 004B4 808B0784 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 004B8 808B0788 45020004 */ bc1fl .L808B079C -/* 004BC 808B078C 8FBF001C */ lw $ra, 0x001C($sp) -/* 004C0 808B0790 0C01767D */ jal CollisionCheck_SetAC - ## CollisionCheck_setAC -/* 004C4 808B0794 26060164 */ addiu $a2, $s0, 0x0164 ## $a2 = 00000164 -/* 004C8 808B0798 8FBF001C */ lw $ra, 0x001C($sp) -.L808B079C: -/* 004CC 808B079C 8FB00014 */ lw $s0, 0x0014($sp) -/* 004D0 808B07A0 8FB10018 */ lw $s1, 0x0018($sp) -/* 004D4 808B07A4 03E00008 */ jr $ra -/* 004D8 808B07A8 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B02D0.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B02D0.s deleted file mode 100644 index 1c38a88508..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B02D0.s +++ /dev/null @@ -1,22 +0,0 @@ -glabel func_808B02D0 -/* 00000 808B02D0 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00004 808B02D4 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 00008 808B02D8 AFA5002C */ sw $a1, 0x002C($sp) -/* 0000C 808B02DC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00010 808B02E0 AFBF001C */ sw $ra, 0x001C($sp) -/* 00014 808B02E4 24C50164 */ addiu $a1, $a2, 0x0164 ## $a1 = 00000164 -/* 00018 808B02E8 AFA50020 */ sw $a1, 0x0020($sp) -/* 0001C 808B02EC 0C016EFE */ jal Collider_InitJntSph -/* 00020 808B02F0 AFA60028 */ sw $a2, 0x0028($sp) -/* 00024 808B02F4 8FA60028 */ lw $a2, 0x0028($sp) -/* 00028 808B02F8 3C07808B */ lui $a3, %hi(D_808B089C) ## $a3 = 808B0000 -/* 0002C 808B02FC 8FA50020 */ lw $a1, 0x0020($sp) -/* 00030 808B0300 24CE0184 */ addiu $t6, $a2, 0x0184 ## $t6 = 00000184 -/* 00034 808B0304 AFAE0010 */ sw $t6, 0x0010($sp) -/* 00038 808B0308 24E7089C */ addiu $a3, $a3, %lo(D_808B089C) ## $a3 = 808B089C -/* 0003C 808B030C 0C017014 */ jal Collider_SetJntSph -/* 00040 808B0310 8FA4002C */ lw $a0, 0x002C($sp) -/* 00044 808B0314 8FBF001C */ lw $ra, 0x001C($sp) -/* 00048 808B0318 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 0004C 808B031C 03E00008 */ jr $ra -/* 00050 808B0320 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B0324.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B0324.s deleted file mode 100644 index 411518e4dd..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B0324.s +++ /dev/null @@ -1,214 +0,0 @@ -.late_rodata -glabel D_808B08E0 - .float 5.4166665 -glabel D_808B08E4 - .float 0.2 -glabel D_808B08E8 - .float 0.4 - -.text -glabel func_808B0324 -/* 00054 808B0324 27BDFF28 */ addiu $sp, $sp, 0xFF28 ## $sp = FFFFFF28 -/* 00058 808B0328 AFB10078 */ sw $s1, 0x0078($sp) -/* 0005C 808B032C 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000 -/* 00060 808B0330 AFBF0094 */ sw $ra, 0x0094($sp) -/* 00064 808B0334 AFB70090 */ sw $s7, 0x0090($sp) -/* 00068 808B0338 AFB6008C */ sw $s6, 0x008C($sp) -/* 0006C 808B033C AFB50088 */ sw $s5, 0x0088($sp) -/* 00070 808B0340 AFB40084 */ sw $s4, 0x0084($sp) -/* 00074 808B0344 AFB30080 */ sw $s3, 0x0080($sp) -/* 00078 808B0348 AFB2007C */ sw $s2, 0x007C($sp) -/* 0007C 808B034C AFB00074 */ sw $s0, 0x0074($sp) -/* 00080 808B0350 F7BE0068 */ sdc1 $f30, 0x0068($sp) -/* 00084 808B0354 F7BC0060 */ sdc1 $f28, 0x0060($sp) -/* 00088 808B0358 F7BA0058 */ sdc1 $f26, 0x0058($sp) -/* 0008C 808B035C F7B80050 */ sdc1 $f24, 0x0050($sp) -/* 00090 808B0360 F7B60048 */ sdc1 $f22, 0x0048($sp) -/* 00094 808B0364 F7B40040 */ sdc1 $f20, 0x0040($sp) -/* 00098 808B0368 00A0A825 */ or $s5, $a1, $zero ## $s5 = 00000000 -/* 0009C 808B036C 0C01DE1C */ jal Math_Sins - ## sins? -/* 000A0 808B0370 848400B6 */ lh $a0, 0x00B6($a0) ## 000000B6 -/* 000A4 808B0374 46000586 */ mov.s $f22, $f0 -/* 000A8 808B0378 0C01DE0D */ jal Math_Coss - ## coss? -/* 000AC 808B037C 862400B6 */ lh $a0, 0x00B6($s1) ## 000000B6 -/* 000B0 808B0380 3C0143DC */ lui $at, 0x43DC ## $at = 43DC0000 -/* 000B4 808B0384 4481F000 */ mtc1 $at, $f30 ## $f30 = 440.00 -/* 000B8 808B0388 44801000 */ mtc1 $zero, $f2 ## $f2 = 0.00 -/* 000BC 808B038C 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 000C0 808B0390 4481E000 */ mtc1 $at, $f28 ## $f28 = 20.00 -/* 000C4 808B0394 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 000C8 808B0398 3C170501 */ lui $s7, 0x0501 ## $s7 = 05010000 -/* 000CC 808B039C 4481D000 */ mtc1 $at, $f26 ## $f26 = 0.50 -/* 000D0 808B03A0 46000606 */ mov.s $f24, $f0 -/* 000D4 808B03A4 26F7A880 */ addiu $s7, $s7, 0xA880 ## $s7 = 0500A880 -/* 000D8 808B03A8 00009025 */ or $s2, $zero, $zero ## $s2 = 00000000 -/* 000DC 808B03AC 27B600B4 */ addiu $s6, $sp, 0x00B4 ## $s6 = FFFFFFDC -/* 000E0 808B03B0 27B400C0 */ addiu $s4, $sp, 0x00C0 ## $s4 = FFFFFFE8 -/* 000E4 808B03B4 E7A200BC */ swc1 $f2, 0x00BC($sp) -/* 000E8 808B03B8 E7A200B4 */ swc1 $f2, 0x00B4($sp) -.L808B03BC: -/* 000EC 808B03BC 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 000F0 808B03C0 00000000 */ nop -/* 000F4 808B03C4 461A0101 */ sub.s $f4, $f0, $f26 -/* 000F8 808B03C8 461E2502 */ mul.s $f20, $f4, $f30 -/* 000FC 808B03CC 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00100 808B03D0 00000000 */ nop -/* 00104 808B03D4 461A0181 */ sub.s $f6, $f0, $f26 -/* 00108 808B03D8 C6280024 */ lwc1 $f8, 0x0024($s1) ## 00000024 -/* 0010C 808B03DC 3C01808B */ lui $at, %hi(D_808B08E0) ## $at = 808B0000 -/* 00110 808B03E0 461C3082 */ mul.s $f2, $f6, $f28 -/* 00114 808B03E4 44923000 */ mtc1 $s2, $f6 ## $f6 = 0.00 -/* 00118 808B03E8 46161282 */ mul.s $f10, $f2, $f22 -/* 0011C 808B03EC 460A4400 */ add.s $f16, $f8, $f10 -/* 00120 808B03F0 4618A482 */ mul.s $f18, $f20, $f24 -/* 00124 808B03F4 C42A08E0 */ lwc1 $f10, %lo(D_808B08E0)($at) -/* 00128 808B03F8 46803220 */ cvt.s.w $f8, $f6 -/* 0012C 808B03FC 46128100 */ add.s $f4, $f16, $f18 -/* 00130 808B0400 460A4402 */ mul.s $f16, $f8, $f10 -/* 00134 808B0404 E7A400C0 */ swc1 $f4, 0x00C0($sp) -/* 00138 808B0408 C6320028 */ lwc1 $f18, 0x0028($s1) ## 00000028 -/* 0013C 808B040C 46181282 */ mul.s $f10, $f2, $f24 -/* 00140 808B0410 461C9100 */ add.s $f4, $f18, $f28 -/* 00144 808B0414 46102180 */ add.s $f6, $f4, $f16 -/* 00148 808B0418 4616A102 */ mul.s $f4, $f20, $f22 -/* 0014C 808B041C E7A600C4 */ swc1 $f6, 0x00C4($sp) -/* 00150 808B0420 C628002C */ lwc1 $f8, 0x002C($s1) ## 0000002C -/* 00154 808B0424 460A4480 */ add.s $f18, $f8, $f10 -/* 00158 808B0428 46049401 */ sub.s $f16, $f18, $f4 -/* 0015C 808B042C 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00160 808B0430 E7B000C8 */ swc1 $f16, 0x00C8($sp) -/* 00164 808B0434 3C01808B */ lui $at, %hi(D_808B08E4) ## $at = 808B0000 -/* 00168 808B0438 C42608E4 */ lwc1 $f6, %lo(D_808B08E4)($at) -/* 0016C 808B043C 3C014140 */ lui $at, 0x4140 ## $at = 41400000 -/* 00170 808B0440 44815000 */ mtc1 $at, $f10 ## $f10 = 12.00 -/* 00174 808B0444 46060201 */ sub.s $f8, $f0, $f6 -/* 00178 808B0448 460A4482 */ mul.s $f18, $f8, $f10 -/* 0017C 808B044C 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 00180 808B0450 E7B200B8 */ swc1 $f18, 0x00B8($sp) -/* 00184 808B0454 3C014296 */ lui $at, 0x4296 ## $at = 42960000 -/* 00188 808B0458 44812000 */ mtc1 $at, $f4 ## $f4 = 75.00 -/* 0018C 808B045C 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00190 808B0460 44813000 */ mtc1 $at, $f6 ## $f6 = 10.00 -/* 00194 808B0464 46040402 */ mul.s $f16, $f0, $f4 -/* 00198 808B0468 46068200 */ add.s $f8, $f16, $f6 -/* 0019C 808B046C 4600428D */ trunc.w.s $f10, $f8 -/* 001A0 808B0470 44025000 */ mfc1 $v0, $f10 -/* 001A4 808B0474 00000000 */ nop -/* 001A8 808B0478 00021C00 */ sll $v1, $v0, 16 -/* 001AC 808B047C 00031C03 */ sra $v1, $v1, 16 -/* 001B0 808B0480 28610019 */ slti $at, $v1, 0x0019 -/* 001B4 808B0484 00029C00 */ sll $s3, $v0, 16 -/* 001B8 808B0488 10200003 */ beq $at, $zero, .L808B0498 -/* 001BC 808B048C 00139C03 */ sra $s3, $s3, 16 -/* 001C0 808B0490 10000006 */ beq $zero, $zero, .L808B04AC -/* 001C4 808B0494 2410FED4 */ addiu $s0, $zero, 0xFED4 ## $s0 = FFFFFED4 -.L808B0498: -/* 001C8 808B0498 28610032 */ slti $at, $v1, 0x0032 -/* 001CC 808B049C 10200003 */ beq $at, $zero, .L808B04AC -/* 001D0 808B04A0 2410FE5C */ addiu $s0, $zero, 0xFE5C ## $s0 = FFFFFE5C -/* 001D4 808B04A4 10000001 */ beq $zero, $zero, .L808B04AC -/* 001D8 808B04A8 2410FE98 */ addiu $s0, $zero, 0xFE98 ## $s0 = FFFFFE98 -.L808B04AC: -/* 001DC 808B04AC 0C03F66B */ jal Math_Rand_ZeroOne - ## Rand.Next() float -/* 001E0 808B04B0 00000000 */ nop -/* 001E4 808B04B4 3C01808B */ lui $at, %hi(D_808B08E8) ## $at = 808B0000 -/* 001E8 808B04B8 C43208E8 */ lwc1 $f18, %lo(D_808B08E8)($at) -/* 001EC 808B04BC 02A02025 */ or $a0, $s5, $zero ## $a0 = 00000000 -/* 001F0 808B04C0 02802825 */ or $a1, $s4, $zero ## $a1 = FFFFFFE8 -/* 001F4 808B04C4 4612003C */ c.lt.s $f0, $f18 -/* 001F8 808B04C8 02C03025 */ or $a2, $s6, $zero ## $a2 = FFFFFFDC -/* 001FC 808B04CC 02803825 */ or $a3, $s4, $zero ## $a3 = FFFFFFE8 -/* 00200 808B04D0 240F001E */ addiu $t7, $zero, 0x001E ## $t7 = 0000001E -/* 00204 808B04D4 45000003 */ bc1f .L808B04E4 -/* 00208 808B04D8 24180004 */ addiu $t8, $zero, 0x0004 ## $t8 = 00000004 -/* 0020C 808B04DC 10000002 */ beq $zero, $zero, .L808B04E8 -/* 00210 808B04E0 24020041 */ addiu $v0, $zero, 0x0041 ## $v0 = 00000041 -.L808B04E4: -/* 00214 808B04E4 24020021 */ addiu $v0, $zero, 0x0021 ## $v0 = 00000021 -.L808B04E8: -/* 00218 808B04E8 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 0021C 808B04EC 24080003 */ addiu $t0, $zero, 0x0003 ## $t0 = 00000003 -/* 00220 808B04F0 24090050 */ addiu $t1, $zero, 0x0050 ## $t1 = 00000050 -/* 00224 808B04F4 240AFFFF */ addiu $t2, $zero, 0xFFFF ## $t2 = FFFFFFFF -/* 00228 808B04F8 240B0002 */ addiu $t3, $zero, 0x0002 ## $t3 = 00000002 -/* 0022C 808B04FC AFAB0038 */ sw $t3, 0x0038($sp) -/* 00230 808B0500 AFAA0034 */ sw $t2, 0x0034($sp) -/* 00234 808B0504 AFA90030 */ sw $t1, 0x0030($sp) -/* 00238 808B0508 AFA8002C */ sw $t0, 0x002C($sp) -/* 0023C 808B050C AFB90028 */ sw $t9, 0x0028($sp) -/* 00240 808B0510 AFB00010 */ sw $s0, 0x0010($sp) -/* 00244 808B0514 AFA20014 */ sw $v0, 0x0014($sp) -/* 00248 808B0518 AFAF0018 */ sw $t7, 0x0018($sp) -/* 0024C 808B051C AFB8001C */ sw $t8, 0x001C($sp) -/* 00250 808B0520 AFA00020 */ sw $zero, 0x0020($sp) -/* 00254 808B0524 AFB30024 */ sw $s3, 0x0024($sp) -/* 00258 808B0528 0C00A7A3 */ jal func_80029E8C - -/* 0025C 808B052C AFB7003C */ sw $s7, 0x003C($sp) -/* 00260 808B0530 26520001 */ addiu $s2, $s2, 0x0001 ## $s2 = 00000001 -/* 00264 808B0534 2A410018 */ slti $at, $s2, 0x0018 -/* 00268 808B0538 1420FFA0 */ bne $at, $zero, .L808B03BC -/* 0026C 808B053C 00000000 */ nop -/* 00270 808B0540 3C0142F0 */ lui $at, 0x42F0 ## $at = 42F00000 -/* 00274 808B0544 3C10808B */ lui $s0, %hi(D_808B08AC) ## $s0 = 808B0000 -/* 00278 808B0548 3C12808B */ lui $s2, %hi(D_808B08D0) ## $s2 = 808B0000 -/* 0027C 808B054C 4481A000 */ mtc1 $at, $f20 ## $f20 = 120.00 -/* 00280 808B0550 265208D0 */ addiu $s2, $s2, %lo(D_808B08D0) ## $s2 = 808B08D0 -/* 00284 808B0554 261008AC */ addiu $s0, $s0, %lo(D_808B08AC) ## $s0 = 808B08AC -/* 00288 808B0558 C6020008 */ lwc1 $f2, 0x0008($s0) ## 808B08B4 -.L808B055C: -/* 0028C 808B055C C6000000 */ lwc1 $f0, 0x0000($s0) ## 808B08AC -/* 00290 808B0560 C6240024 */ lwc1 $f4, 0x0024($s1) ## 00000024 -/* 00294 808B0564 46161402 */ mul.s $f16, $f2, $f22 -/* 00298 808B0568 C6120004 */ lwc1 $f18, 0x0004($s0) ## 808B08B0 -/* 0029C 808B056C 4406A000 */ mfc1 $a2, $f20 -/* 002A0 808B0570 46180202 */ mul.s $f8, $f0, $f24 -/* 002A4 808B0574 240C0078 */ addiu $t4, $zero, 0x0078 ## $t4 = 00000078 -/* 002A8 808B0578 240D00A0 */ addiu $t5, $zero, 0x00A0 ## $t5 = 000000A0 -/* 002AC 808B057C 240E0001 */ addiu $t6, $zero, 0x0001 ## $t6 = 00000001 -/* 002B0 808B0580 02A02025 */ or $a0, $s5, $zero ## $a0 = 00000000 -/* 002B4 808B0584 46102180 */ add.s $f6, $f4, $f16 -/* 002B8 808B0588 02802825 */ or $a1, $s4, $zero ## $a1 = FFFFFFE8 -/* 002BC 808B058C 24070004 */ addiu $a3, $zero, 0x0004 ## $a3 = 00000004 -/* 002C0 808B0590 46064280 */ add.s $f10, $f8, $f6 -/* 002C4 808B0594 46181182 */ mul.s $f6, $f2, $f24 -/* 002C8 808B0598 E7AA00C0 */ swc1 $f10, 0x00C0($sp) -/* 002CC 808B059C C6240028 */ lwc1 $f4, 0x0028($s1) ## 00000028 -/* 002D0 808B05A0 46049400 */ add.s $f16, $f18, $f4 -/* 002D4 808B05A4 46160482 */ mul.s $f18, $f0, $f22 -/* 002D8 808B05A8 E7B000C4 */ swc1 $f16, 0x00C4($sp) -/* 002DC 808B05AC C628002C */ lwc1 $f8, 0x002C($s1) ## 0000002C -/* 002E0 808B05B0 AFAE0018 */ sw $t6, 0x0018($sp) -/* 002E4 808B05B4 AFAD0014 */ sw $t5, 0x0014($sp) -/* 002E8 808B05B8 46064280 */ add.s $f10, $f8, $f6 -/* 002EC 808B05BC AFAC0010 */ sw $t4, 0x0010($sp) -/* 002F0 808B05C0 46125101 */ sub.s $f4, $f10, $f18 -/* 002F4 808B05C4 0C00CD20 */ jal func_80033480 -/* 002F8 808B05C8 E7A400C8 */ swc1 $f4, 0x00C8($sp) -/* 002FC 808B05CC 2610000C */ addiu $s0, $s0, 0x000C ## $s0 = 808B08B8 -/* 00300 808B05D0 5612FFE2 */ bnel $s0, $s2, .L808B055C -/* 00304 808B05D4 C6020008 */ lwc1 $f2, 0x0008($s0) ## 808B08C0 -/* 00308 808B05D8 8FBF0094 */ lw $ra, 0x0094($sp) -/* 0030C 808B05DC D7B40040 */ ldc1 $f20, 0x0040($sp) -/* 00310 808B05E0 D7B60048 */ ldc1 $f22, 0x0048($sp) -/* 00314 808B05E4 D7B80050 */ ldc1 $f24, 0x0050($sp) -/* 00318 808B05E8 D7BA0058 */ ldc1 $f26, 0x0058($sp) -/* 0031C 808B05EC D7BC0060 */ ldc1 $f28, 0x0060($sp) -/* 00320 808B05F0 D7BE0068 */ ldc1 $f30, 0x0068($sp) -/* 00324 808B05F4 8FB00074 */ lw $s0, 0x0074($sp) -/* 00328 808B05F8 8FB10078 */ lw $s1, 0x0078($sp) -/* 0032C 808B05FC 8FB2007C */ lw $s2, 0x007C($sp) -/* 00330 808B0600 8FB30080 */ lw $s3, 0x0080($sp) -/* 00334 808B0604 8FB40084 */ lw $s4, 0x0084($sp) -/* 00338 808B0608 8FB50088 */ lw $s5, 0x0088($sp) -/* 0033C 808B060C 8FB6008C */ lw $s6, 0x008C($sp) -/* 00340 808B0610 8FB70090 */ lw $s7, 0x0090($sp) -/* 00344 808B0614 03E00008 */ jr $ra -/* 00348 808B0618 27BD00D8 */ addiu $sp, $sp, 0x00D8 ## $sp = 00000000 diff --git a/data/overlays/actors/z_bg_spot08_bakudankabe.data.s b/data/overlays/actors/z_bg_spot08_bakudankabe.data.s deleted file mode 100644 index 7d3cd9a4a7..0000000000 --- a/data/overlays/actors/z_bg_spot08_bakudankabe.data.s +++ /dev/null @@ -1,27 +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 Bg_Spot08_Bakudankabe_InitVars - .word 0x01A80100, 0x00400000, 0x00740000, 0x00000244 -.word BgSpot08Bakudankabe_Init -.word BgSpot08Bakudankabe_Destroy -.word BgSpot08Bakudankabe_Update -.word BgSpot08Bakudankabe_Draw -glabel D_808B0830 - .word 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000000, 0x00010000, 0x00000000, 0x00320032, 0x00460064, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000000, 0x00010000, 0x0000FF9C, 0x00320032, 0x00460064, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000000, 0x00010000, 0x00000064, 0x00320032, 0x00460064 -glabel D_808B089C - .word 0x0A000900, 0x20000000, 0x00000003 -.word D_808B0830 -glabel D_808B08AC - .word 0x00000000, 0x42E94CCD, 0x42480000, 0x42E60000, 0x42BE0000, 0x41200000, 0xC2E60000, 0x42BE0000, 0x41200000 -glabel D_808B08D0 - .word 0xC0500001, 0xB0F40C80, 0xB0F80320, 0x30FC03E8 - diff --git a/data/overlays/actors/z_bg_spot08_bakudankabe.reloc.s b/data/overlays/actors/z_bg_spot08_bakudankabe.reloc.s deleted file mode 100644 index 78699f2d91..0000000000 --- a/data/overlays/actors/z_bg_spot08_bakudankabe.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_808B08F0 - .incbin "baserom/ovl_Bg_Spot08_Bakudankabe", 0x620, 0x00000070 diff --git a/spec b/spec index cbd847efd2..572d24f748 100644 --- a/spec +++ b/spec @@ -1271,8 +1271,7 @@ endseg beginseg name "ovl_Bg_Spot08_Bakudankabe" include "build/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.o" - include "build/data/overlays/actors/z_bg_spot08_bakudankabe.data.o" - include "build/data/overlays/actors/z_bg_spot08_bakudankabe.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/ovl_Bg_Spot08_Bakudankabe_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index befa82623c..3cb0e2d962 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -15,7 +15,9 @@ void BgSpot08Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgSpot08Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx); void BgSpot08Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void func_808B02D0(BgSpot08Bakudankabe* this, GlobalContext* globalCtx); +void func_808B0324(BgSpot08Bakudankabe* this, GlobalContext* globalCtx); + const ActorInit Bg_Spot08_Bakudankabe_InitVars = { ACTOR_BG_SPOT08_BAKUDANKABE, ACTORTYPE_BG, @@ -27,15 +29,150 @@ const ActorInit Bg_Spot08_Bakudankabe_InitVars = { (ActorFunc)BgSpot08Bakudankabe_Update, (ActorFunc)BgSpot08Bakudankabe_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B02D0.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/func_808B0324.s") +extern Gfx D_0500A880[]; +extern UNK_TYPE D_060039D4; +extern Gfx D_06003898[]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Init.s") +static ColliderJntSphItemInit sJntSphItemsInit[] = { + { + { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { 0, { { 0, 50, 50 }, 70 }, 100 }, + }, + { + { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { 0, { { -100, 50, 50 }, 70 }, 100 }, + }, + { + { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { 0, { { 100, 50, 50 }, 70 }, 100 }, + }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Destroy.s") +static ColliderJntSphInit sJntSphInit = { + { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_JNTSPH }, + 3, + sJntSphItemsInit, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Update.s") +Vec3f D_808B08AC[] = { + { 0.0f, 116.65f, 50.0f }, + { 115.0f, 95.0f, 10.0f }, + { -115.0f, 95.0f, 10.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot08_Bakudankabe/BgSpot08Bakudankabe_Draw.s") +static InitChainEntry sInitChain[] = { + ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneForward, 3200, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneScale, 800, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP), +}; + +void func_808B02D0(BgSpot08Bakudankabe* this, GlobalContext* globalCtx) { + s32 pad; + + Collider_InitJntSph(globalCtx, &this->collider); + Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); +} + +void func_808B0324(BgSpot08Bakudankabe* this, GlobalContext* globalCtx) { + s32 pad[2]; + s32 i; + Vec3f burstDepthY; + Vec3f burstDepthX; + f32 sinY; + f32 cosY; + + sinY = Math_Sins(this->dyna.actor.shape.rot.y); + cosY = Math_Coss(this->dyna.actor.shape.rot.y); + + burstDepthX.z = 0.0f; + burstDepthX.x = 0.0f; + + for (i = 0; i < 24; i++) { + s16 gravityInfluence; + s16 scale; + f32 temp1; + f32 temp2; + s32 rotationSpeed; + + temp1 = (Math_Rand_ZeroOne() - 0.5f) * 440.0f; + temp2 = (Math_Rand_ZeroOne() - 0.5f) * 20.0f; + burstDepthY.x = this->dyna.actor.posRot.pos.x + temp2 * sinY + (temp1 * cosY); + burstDepthY.y = (this->dyna.actor.posRot.pos.y + 20.0f) + (i * 5.4166665f); + burstDepthY.z = this->dyna.actor.posRot.pos.z + temp2 * cosY - (temp1 * sinY); + + burstDepthX.y = (Math_Rand_ZeroOne() - 0.2f) * 12.0f; + scale = Math_Rand_ZeroOne() * 75.0f + 10.0f; + + if (scale < 25) { + gravityInfluence = -300; + } else if (scale < 50) { + gravityInfluence = -360; + } else { + gravityInfluence = -420; + } + + if (Math_Rand_ZeroOne() < 0.4f) { + rotationSpeed = 65; + } else { + rotationSpeed = 33; + } + + func_80029E8C(globalCtx, &burstDepthY, &burstDepthX, &burstDepthY, gravityInfluence, rotationSpeed, 0x1E, 4, 0, + scale, 1, 3, 80, -1, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A880); + } + + for (i = 0; i < ARRAY_COUNT(D_808B08AC); i++) { + burstDepthY.x = this->dyna.actor.posRot.pos.x + D_808B08AC[i].z * sinY + D_808B08AC[i].x * cosY; + burstDepthY.y = this->dyna.actor.posRot.pos.y + D_808B08AC[i].y; + burstDepthY.z = this->dyna.actor.posRot.pos.z + D_808B08AC[i].z * cosY - (D_808B08AC[i].x * sinY); + func_80033480(globalCtx, &burstDepthY, 120.0f, 4, 0x78, 0xA0, 1); + } +} + +void BgSpot08Bakudankabe_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot08Bakudankabe* this = THIS; + s32 pad; + s32 sp24 = 0; + + DynaPolyInfo_SetActorMove(&this->dyna, 0); + if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x3F))) { + Actor_Kill(&this->dyna.actor); + return; + } + func_808B02D0(this, globalCtx); + DynaPolyInfo_Alloc(&D_060039D4, &sp24); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp24); + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); +} + +void BgSpot08Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgSpot08Bakudankabe* this = THIS; + + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); + Collider_DestroyJntSph(globalCtx, &this->collider); +} + +void BgSpot08Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot08Bakudankabe* this = THIS; + + if (this->collider.base.acFlags & 2) { + func_808B0324(this, globalCtx); + Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + func_80078884(NA_SE_SY_CORRECT_CHIME); + Actor_Kill(&this->dyna.actor); + } else if (this->dyna.actor.xzDistFromLink < 800.0f) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } +} + +void BgSpot08Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgSpot08Bakudankabe* this = THIS; + + func_800628A4(0, &this->collider); + func_800628A4(1, &this->collider); + func_800628A4(2, &this->collider); + Gfx_DrawDListOpa(globalCtx, D_06003898); +} diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h index 173b858fae..86094995c4 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h @@ -7,8 +7,9 @@ struct BgSpot08Bakudankabe; typedef struct BgSpot08Bakudankabe { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0xF8]; + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ ColliderJntSph collider; + /* 0x0184 */ ColliderJntSphItem colliderItems[3]; } BgSpot08Bakudankabe; // size = 0x0244 extern const ActorInit Bg_Spot08_Bakudankabe_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 3d00dff2be..32b6982281 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -250,6 +250,11 @@ D_06002AD0 = 0x06002AD0; D_060038FC = 0x060038FC; D_06002590 = 0x06002590; +// z_bg_spot08_bakudankabe +D_060039D4 = 0x060039D4; +D_06003898 = 0x06003898; +D_0500A880 = 0x0500A880; + // z_bg_ydan_hasi D_06005780 = 0x06005780; D_06007798 = 0x06007798;