From 546811bba832cb86cdd347ed7269aedb71e511fc Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sat, 4 Apr 2020 22:48:30 -0400 Subject: [PATCH] Decompiled ovl_Bg_Spot12_Saku --- .../ovl_Bg_Spot12_Saku/BgSpot12Saku_Destroy.s | 16 --- .../ovl_Bg_Spot12_Saku/BgSpot12Saku_Draw.s | 16 --- .../ovl_Bg_Spot12_Saku/BgSpot12Saku_Init.s | 37 ----- .../ovl_Bg_Spot12_Saku/BgSpot12Saku_Update.s | 17 --- .../actors/ovl_Bg_Spot12_Saku/func_808B3420.s | 42 ------ .../actors/ovl_Bg_Spot12_Saku/func_808B3550.s | 14 -- .../actors/ovl_Bg_Spot12_Saku/func_808B357C.s | 31 ----- .../actors/ovl_Bg_Spot12_Saku/func_808B35E4.s | 12 -- .../actors/ovl_Bg_Spot12_Saku/func_808B3604.s | 77 ----------- .../actors/ovl_Bg_Spot12_Saku/func_808B3714.s | 43 ------ .../actors/ovl_Bg_Spot12_Saku/func_808B37AC.s | 6 - data/overlays/actors/z_bg_spot12_saku.data.s | 18 --- data/overlays/actors/z_bg_spot12_saku.reloc.s | 11 -- .../overlays/actors/z_bg_spot12_saku.rodata.s | 29 ---- spec | 4 +- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 128 +++++++++++++++--- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h | 5 +- undefined_syms.txt | 4 + 18 files changed, 119 insertions(+), 391 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3420.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3550.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B357C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B35E4.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3604.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3714.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B37AC.s delete mode 100644 data/overlays/actors/z_bg_spot12_saku.data.s delete mode 100644 data/overlays/actors/z_bg_spot12_saku.reloc.s delete mode 100644 data/overlays/actors/z_bg_spot12_saku.rodata.s diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Destroy.s deleted file mode 100644 index 2f1fc7aada..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Destroy.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel BgSpot12Saku_Destroy -/* 00100 808B3520 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00104 808B3524 AFA40018 */ sw $a0, 0x0018($sp) -/* 00108 808B3528 8FAE0018 */ lw $t6, 0x0018($sp) -/* 0010C 808B352C AFBF0014 */ sw $ra, 0x0014($sp) -/* 00110 808B3530 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00114 808B3534 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810 -/* 00118 808B3538 0C00FB56 */ jal DynaPolyInfo_Free - ## DynaPolyInfo_delReserve -/* 0011C 808B353C 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C -/* 00120 808B3540 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00124 808B3544 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00128 808B3548 03E00008 */ jr $ra -/* 0012C 808B354C 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Draw.s deleted file mode 100644 index 6114059902..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Draw.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel BgSpot12Saku_Draw -/* 003CC 808B37EC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 003D0 808B37F0 AFA40018 */ sw $a0, 0x0018($sp) -/* 003D4 808B37F4 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 003D8 808B37F8 AFBF0014 */ sw $ra, 0x0014($sp) -/* 003DC 808B37FC 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 003E0 808B3800 0C00D498 */ jal Gfx_DrawDListOpa - -/* 003E4 808B3804 24A52260 */ addiu $a1, $a1, 0x2260 ## $a1 = 06002260 -/* 003E8 808B3808 8FBF0014 */ lw $ra, 0x0014($sp) -/* 003EC 808B380C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 003F0 808B3810 03E00008 */ jr $ra -/* 003F4 808B3814 00000000 */ nop -/* 003F8 808B3818 00000000 */ nop -/* 003FC 808B381C 00000000 */ nop - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Init.s deleted file mode 100644 index 4604d0e183..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Init.s +++ /dev/null @@ -1,37 +0,0 @@ -glabel BgSpot12Saku_Init -/* 00088 808B34A8 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 0008C 808B34AC AFBF001C */ sw $ra, 0x001C($sp) -/* 00090 808B34B0 AFB00018 */ sw $s0, 0x0018($sp) -/* 00094 808B34B4 3C060600 */ lui $a2, 0x0600 ## $a2 = 06000000 -/* 00098 808B34B8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0009C 808B34BC AFA50024 */ sw $a1, 0x0024($sp) -/* 000A0 808B34C0 24C6238C */ addiu $a2, $a2, 0x238C ## $a2 = 0600238C -/* 000A4 808B34C4 0C22CD08 */ jal func_808B3420 -/* 000A8 808B34C8 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 000AC 808B34CC 3C05808B */ lui $a1, %hi(D_808B3840) ## $a1 = 808B0000 -/* 000B0 808B34D0 24A53840 */ addiu $a1, $a1, %lo(D_808B3840) ## $a1 = 808B3840 -/* 000B4 808B34D4 0C01E037 */ jal Actor_ProcessInitChain - -/* 000B8 808B34D8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000BC 808B34DC 8605001C */ lh $a1, 0x001C($s0) ## 0000001C -/* 000C0 808B34E0 8FA40024 */ lw $a0, 0x0024($sp) -/* 000C4 808B34E4 0C00B2D0 */ jal Flags_GetSwitch - -/* 000C8 808B34E8 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 000CC 808B34EC 10400005 */ beq $v0, $zero, .L808B3504 -/* 000D0 808B34F0 00000000 */ nop -/* 000D4 808B34F4 0C22CDC5 */ jal func_808B3714 -/* 000D8 808B34F8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000DC 808B34FC 10000004 */ beq $zero, $zero, .L808B3510 -/* 000E0 808B3500 8FBF001C */ lw $ra, 0x001C($sp) -.L808B3504: -/* 000E4 808B3504 0C22CD54 */ jal func_808B3550 -/* 000E8 808B3508 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000EC 808B350C 8FBF001C */ lw $ra, 0x001C($sp) -.L808B3510: -/* 000F0 808B3510 8FB00018 */ lw $s0, 0x0018($sp) -/* 000F4 808B3514 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 000F8 808B3518 03E00008 */ jr $ra -/* 000FC 808B351C 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Update.s deleted file mode 100644 index 1dbbee3206..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Update.s +++ /dev/null @@ -1,17 +0,0 @@ -glabel BgSpot12Saku_Update -/* 00398 808B37B8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0039C 808B37BC AFBF0014 */ sw $ra, 0x0014($sp) -/* 003A0 808B37C0 84820168 */ lh $v0, 0x0168($a0) ## 00000168 -/* 003A4 808B37C4 18400002 */ blez $v0, .L808B37D0 -/* 003A8 808B37C8 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 003AC 808B37CC A48E0168 */ sh $t6, 0x0168($a0) ## 00000168 -.L808B37D0: -/* 003B0 808B37D0 8C990164 */ lw $t9, 0x0164($a0) ## 00000164 -/* 003B4 808B37D4 0320F809 */ jalr $ra, $t9 -/* 003B8 808B37D8 00000000 */ nop -/* 003BC 808B37DC 8FBF0014 */ lw $ra, 0x0014($sp) -/* 003C0 808B37E0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 003C4 808B37E4 03E00008 */ jr $ra -/* 003C8 808B37E8 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3420.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3420.s deleted file mode 100644 index a88e8132f6..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3420.s +++ /dev/null @@ -1,42 +0,0 @@ -glabel func_808B3420 -/* 00000 808B3420 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 00004 808B3424 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00008 808B3428 AFB00020 */ sw $s0, 0x0020($sp) -/* 0000C 808B342C AFA5003C */ sw $a1, 0x003C($sp) -/* 00010 808B3430 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00014 808B3434 AFA60040 */ sw $a2, 0x0040($sp) -/* 00018 808B3438 AFA00030 */ sw $zero, 0x0030($sp) -/* 0001C 808B343C 0C010D20 */ jal DynaPolyInfo_SetActorMove - -/* 00020 808B3440 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 -/* 00024 808B3444 8FA40040 */ lw $a0, 0x0040($sp) -/* 00028 808B3448 0C010620 */ jal DynaPolyInfo_Alloc - -/* 0002C 808B344C 27A50030 */ addiu $a1, $sp, 0x0030 ## $a1 = FFFFFFF8 -/* 00030 808B3450 8FA4003C */ lw $a0, 0x003C($sp) -/* 00034 808B3454 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00038 808B3458 8FA70030 */ lw $a3, 0x0030($sp) -/* 0003C 808B345C 0C00FA9D */ jal DynaPolyInfo_RegisterActor - ## DynaPolyInfo_setActor -/* 00040 808B3460 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 00044 808B3464 24010032 */ addiu $at, $zero, 0x0032 ## $at = 00000032 -/* 00048 808B3468 1441000A */ bne $v0, $at, .L808B3494 -/* 0004C 808B346C AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 00050 808B3470 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 00054 808B3474 3C04808B */ lui $a0, %hi(D_808B3850) ## $a0 = 808B0000 -/* 00058 808B3478 3C05808B */ lui $a1, %hi(D_808B3890) ## $a1 = 808B0000 -/* 0005C 808B347C 86070000 */ lh $a3, 0x0000($s0) ## 00000000 -/* 00060 808B3480 24A53890 */ addiu $a1, $a1, %lo(D_808B3890) ## $a1 = 808B3890 -/* 00064 808B3484 24843850 */ addiu $a0, $a0, %lo(D_808B3850) ## $a0 = 808B3850 -/* 00068 808B3488 2406008C */ addiu $a2, $zero, 0x008C ## $a2 = 0000008C -/* 0006C 808B348C 0C00084C */ jal osSyncPrintf - -/* 00070 808B3490 AFAE0010 */ sw $t6, 0x0010($sp) -.L808B3494: -/* 00074 808B3494 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00078 808B3498 8FB00020 */ lw $s0, 0x0020($sp) -/* 0007C 808B349C 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 00080 808B34A0 03E00008 */ jr $ra -/* 00084 808B34A4 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3550.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3550.s deleted file mode 100644 index fccff5da5d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3550.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel func_808B3550 -/* 00130 808B3550 3C0E808B */ lui $t6, %hi(func_808B357C) ## $t6 = 808B0000 -/* 00134 808B3554 25CE357C */ addiu $t6, $t6, %lo(func_808B357C) ## $t6 = 808B357C -/* 00138 808B3558 AC8E0164 */ sw $t6, 0x0164($a0) ## 00000164 -/* 0013C 808B355C 3C01808B */ lui $at, %hi(D_808B38A8) ## $at = 808B0000 -/* 00140 808B3560 C42438A8 */ lwc1 $f4, %lo(D_808B38A8)($at) -/* 00144 808B3564 C4860008 */ lwc1 $f6, 0x0008($a0) ## 00000008 -/* 00148 808B3568 C4880010 */ lwc1 $f8, 0x0010($a0) ## 00000010 -/* 0014C 808B356C E4840050 */ swc1 $f4, 0x0050($a0) ## 00000050 -/* 00150 808B3570 E4860024 */ swc1 $f6, 0x0024($a0) ## 00000024 -/* 00154 808B3574 03E00008 */ jr $ra -/* 00158 808B3578 E488002C */ swc1 $f8, 0x002C($a0) ## 0000002C - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B357C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B357C.s deleted file mode 100644 index 4388f48498..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B357C.s +++ /dev/null @@ -1,31 +0,0 @@ -glabel func_808B357C -/* 0015C 808B357C 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00160 808B3580 AFA40020 */ sw $a0, 0x0020($sp) -/* 00164 808B3584 8FAE0020 */ lw $t6, 0x0020($sp) -/* 00168 808B3588 AFBF001C */ sw $ra, 0x001C($sp) -/* 0016C 808B358C AFA50024 */ sw $a1, 0x0024($sp) -/* 00170 808B3590 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00174 808B3594 85C5001C */ lh $a1, 0x001C($t6) ## 0000001C -/* 00178 808B3598 0C00B2D0 */ jal Flags_GetSwitch - -/* 0017C 808B359C 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 00180 808B35A0 5040000D */ beql $v0, $zero, .L808B35D8 -/* 00184 808B35A4 8FBF001C */ lw $ra, 0x001C($sp) -/* 00188 808B35A8 0C22CD79 */ jal func_808B35E4 -/* 0018C 808B35AC 8FA40020 */ lw $a0, 0x0020($sp) -/* 00190 808B35B0 8FB80020 */ lw $t8, 0x0020($sp) -/* 00194 808B35B4 240F0014 */ addiu $t7, $zero, 0x0014 ## $t7 = 00000014 -/* 00198 808B35B8 2405104A */ addiu $a1, $zero, 0x104A ## $a1 = 0000104A -/* 0019C 808B35BC A70F0168 */ sh $t7, 0x0168($t8) ## 00000168 -/* 001A0 808B35C0 AFA00010 */ sw $zero, 0x0010($sp) -/* 001A4 808B35C4 8FA70020 */ lw $a3, 0x0020($sp) -/* 001A8 808B35C8 8FA40024 */ lw $a0, 0x0024($sp) -/* 001AC 808B35CC 0C02003E */ jal func_800800F8 -/* 001B0 808B35D0 2406FF9D */ addiu $a2, $zero, 0xFF9D ## $a2 = FFFFFF9D -/* 001B4 808B35D4 8FBF001C */ lw $ra, 0x001C($sp) -.L808B35D8: -/* 001B8 808B35D8 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 001BC 808B35DC 03E00008 */ jr $ra -/* 001C0 808B35E0 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B35E4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B35E4.s deleted file mode 100644 index bc80b4f073..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B35E4.s +++ /dev/null @@ -1,12 +0,0 @@ -glabel func_808B35E4 -/* 001C4 808B35E4 848E0168 */ lh $t6, 0x0168($a0) ## 00000168 -/* 001C8 808B35E8 3C0F808B */ lui $t7, %hi(func_808B3604) ## $t7 = 808B0000 -/* 001CC 808B35EC 25EF3604 */ addiu $t7, $t7, %lo(func_808B3604) ## $t7 = 808B3604 -/* 001D0 808B35F0 15C00002 */ bne $t6, $zero, .L808B35FC -/* 001D4 808B35F4 00000000 */ nop -/* 001D8 808B35F8 AC8F0164 */ sw $t7, 0x0164($a0) ## 00000164 -.L808B35FC: -/* 001DC 808B35FC 03E00008 */ jr $ra -/* 001E0 808B3600 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3604.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3604.s deleted file mode 100644 index 9d3a30464a..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3604.s +++ /dev/null @@ -1,77 +0,0 @@ -glabel func_808B3604 -/* 001E4 808B3604 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 001E8 808B3608 3C01808B */ lui $at, %hi(D_808B38AC) ## $at = 808B0000 -/* 001EC 808B360C C42438AC */ lwc1 $f4, %lo(D_808B38AC)($at) -/* 001F0 808B3610 AFB00020 */ sw $s0, 0x0020($sp) -/* 001F4 808B3614 AFA50034 */ sw $a1, 0x0034($sp) -/* 001F8 808B3618 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 001FC 808B361C AFBF0024 */ sw $ra, 0x0024($sp) -/* 00200 808B3620 3C053BEA */ lui $a1, 0x3BEA ## $a1 = 3BEA0000 -/* 00204 808B3624 3C063E23 */ lui $a2, 0x3E23 ## $a2 = 3E230000 -/* 00208 808B3628 3C073B10 */ lui $a3, 0x3B10 ## $a3 = 3B100000 -/* 0020C 808B362C 34E72DE0 */ ori $a3, $a3, 0x2DE0 ## $a3 = 3B102DE0 -/* 00210 808B3630 34C6D70A */ ori $a2, $a2, 0xD70A ## $a2 = 3E23D70A -/* 00214 808B3634 34A50EA2 */ ori $a1, $a1, 0x0EA2 ## $a1 = 3BEA0EA2 -/* 00218 808B3638 24840050 */ addiu $a0, $a0, 0x0050 ## $a0 = 00000050 -/* 0021C 808B363C 0C01E0C4 */ jal Math_SmoothScaleMaxMinF - -/* 00220 808B3640 E7A40010 */ swc1 $f4, 0x0010($sp) -/* 00224 808B3644 E7A0002C */ swc1 $f0, 0x002C($sp) -/* 00228 808B3648 3C01808B */ lui $at, %hi(D_808B38B0) ## $at = 808B0000 -/* 0022C 808B364C C42638B0 */ lwc1 $f6, %lo(D_808B38B0)($at) -/* 00230 808B3650 C6080050 */ lwc1 $f8, 0x0050($s0) ## 00000050 -/* 00234 808B3654 3C014452 */ lui $at, 0x4452 ## $at = 44520000 -/* 00238 808B3658 44818000 */ mtc1 $at, $f16 ## $f16 = 840.00 -/* 0023C 808B365C 46083281 */ sub.s $f10, $f6, $f8 -/* 00240 808B3660 46105482 */ mul.s $f18, $f10, $f16 -/* 00244 808B3664 E7B20028 */ swc1 $f18, 0x0028($sp) -/* 00248 808B3668 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 0024C 808B366C 24844000 */ addiu $a0, $a0, 0x4000 ## $a0 = 00004000 -/* 00250 808B3670 00042400 */ sll $a0, $a0, 16 -/* 00254 808B3674 0C01DE1C */ jal Math_Sins - ## sins? -/* 00258 808B3678 00042403 */ sra $a0, $a0, 16 -/* 0025C 808B367C C7A60028 */ lwc1 $f6, 0x0028($sp) -/* 00260 808B3680 C6040008 */ lwc1 $f4, 0x0008($s0) ## 00000008 -/* 00264 808B3684 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 00268 808B3688 46060202 */ mul.s $f8, $f0, $f6 -/* 0026C 808B368C 24844000 */ addiu $a0, $a0, 0x4000 ## $a0 = 00004000 -/* 00270 808B3690 00042400 */ sll $a0, $a0, 16 -/* 00274 808B3694 00042403 */ sra $a0, $a0, 16 -/* 00278 808B3698 46082281 */ sub.s $f10, $f4, $f8 -/* 0027C 808B369C 0C01DE0D */ jal Math_Coss - ## coss? -/* 00280 808B36A0 E60A0024 */ swc1 $f10, 0x0024($s0) ## 00000024 -/* 00284 808B36A4 C7B20028 */ lwc1 $f18, 0x0028($sp) -/* 00288 808B36A8 C6100010 */ lwc1 $f16, 0x0010($s0) ## 00000010 -/* 0028C 808B36AC 3C01808B */ lui $at, %hi(D_808B38B4) ## $at = 808B0000 -/* 00290 808B36B0 46120182 */ mul.s $f6, $f0, $f18 -/* 00294 808B36B4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00298 808B36B8 46068101 */ sub.s $f4, $f16, $f6 -/* 0029C 808B36BC E604002C */ swc1 $f4, 0x002C($s0) ## 0000002C -/* 002A0 808B36C0 C7A0002C */ lwc1 $f0, 0x002C($sp) -/* 002A4 808B36C4 C42838B4 */ lwc1 $f8, %lo(D_808B38B4)($at) -/* 002A8 808B36C8 46000005 */ abs.s $f0, $f0 -/* 002AC 808B36CC 4608003C */ c.lt.s $f0, $f8 -/* 002B0 808B36D0 00000000 */ nop -/* 002B4 808B36D4 45000008 */ bc1f .L808B36F8 -/* 002B8 808B36D8 00000000 */ nop -/* 002BC 808B36DC 0C22CDC5 */ jal func_808B3714 -/* 002C0 808B36E0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002C4 808B36E4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002C8 808B36E8 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 002CC 808B36EC 2405280E */ addiu $a1, $zero, 0x280E ## $a1 = 0000280E -/* 002D0 808B36F0 10000004 */ beq $zero, $zero, .L808B3704 -/* 002D4 808B36F4 8FBF0024 */ lw $ra, 0x0024($sp) -.L808B36F8: -/* 002D8 808B36F8 0C00BE5D */ jal func_8002F974 -/* 002DC 808B36FC 24052067 */ addiu $a1, $zero, 0x2067 ## $a1 = 00002067 -/* 002E0 808B3700 8FBF0024 */ lw $ra, 0x0024($sp) -.L808B3704: -/* 002E4 808B3704 8FB00020 */ lw $s0, 0x0020($sp) -/* 002E8 808B3708 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 002EC 808B370C 03E00008 */ jr $ra -/* 002F0 808B3710 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3714.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3714.s deleted file mode 100644 index c137e524a4..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3714.s +++ /dev/null @@ -1,43 +0,0 @@ -glabel func_808B3714 -/* 002F4 808B3714 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 002F8 808B3718 3C0E808B */ lui $t6, %hi(func_808B37AC) ## $t6 = 808B0000 -/* 002FC 808B371C AFBF0014 */ sw $ra, 0x0014($sp) -/* 00300 808B3720 25CE37AC */ addiu $t6, $t6, %lo(func_808B37AC) ## $t6 = 808B37AC -/* 00304 808B3724 AC8E0164 */ sw $t6, 0x0164($a0) ## 00000164 -/* 00308 808B3728 3C01808B */ lui $at, %hi(D_808B38B8) ## $at = 808B0000 -/* 0030C 808B372C C42438B8 */ lwc1 $f4, %lo(D_808B38B8)($at) -/* 00310 808B3730 00802825 */ or $a1, $a0, $zero ## $a1 = 00000000 -/* 00314 808B3734 E4840050 */ swc1 $f4, 0x0050($a0) ## 00000050 -/* 00318 808B3738 848400B6 */ lh $a0, 0x00B6($a0) ## 000000B6 -/* 0031C 808B373C AFA50018 */ sw $a1, 0x0018($sp) -/* 00320 808B3740 24844000 */ addiu $a0, $a0, 0x4000 ## $a0 = 00004000 -/* 00324 808B3744 00042400 */ sll $a0, $a0, 16 -/* 00328 808B3748 0C01DE1C */ jal Math_Sins - ## sins? -/* 0032C 808B374C 00042403 */ sra $a0, $a0, 16 -/* 00330 808B3750 3C01429C */ lui $at, 0x429C ## $at = 429C0000 -/* 00334 808B3754 44814000 */ mtc1 $at, $f8 ## $f8 = 78.00 -/* 00338 808B3758 8FA50018 */ lw $a1, 0x0018($sp) -/* 0033C 808B375C 46080282 */ mul.s $f10, $f0, $f8 -/* 00340 808B3760 C4A60008 */ lwc1 $f6, 0x0008($a1) ## 00000008 -/* 00344 808B3764 84A400B6 */ lh $a0, 0x00B6($a1) ## 000000B6 -/* 00348 808B3768 24844000 */ addiu $a0, $a0, 0x4000 ## $a0 = 00004000 -/* 0034C 808B376C 00042400 */ sll $a0, $a0, 16 -/* 00350 808B3770 460A3401 */ sub.s $f16, $f6, $f10 -/* 00354 808B3774 00042403 */ sra $a0, $a0, 16 -/* 00358 808B3778 0C01DE0D */ jal Math_Coss - ## coss? -/* 0035C 808B377C E4B00024 */ swc1 $f16, 0x0024($a1) ## 00000024 -/* 00360 808B3780 3C01429C */ lui $at, 0x429C ## $at = 429C0000 -/* 00364 808B3784 44812000 */ mtc1 $at, $f4 ## $f4 = 78.00 -/* 00368 808B3788 8FA50018 */ lw $a1, 0x0018($sp) -/* 0036C 808B378C 46040202 */ mul.s $f8, $f0, $f4 -/* 00370 808B3790 C4B20010 */ lwc1 $f18, 0x0010($a1) ## 00000010 -/* 00374 808B3794 46089181 */ sub.s $f6, $f18, $f8 -/* 00378 808B3798 E4A6002C */ swc1 $f6, 0x002C($a1) ## 0000002C -/* 0037C 808B379C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00380 808B37A0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00384 808B37A4 03E00008 */ jr $ra -/* 00388 808B37A8 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B37AC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B37AC.s deleted file mode 100644 index 3e8b36554c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B37AC.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel func_808B37AC -/* 0038C 808B37AC AFA40000 */ sw $a0, 0x0000($sp) -/* 00390 808B37B0 03E00008 */ jr $ra -/* 00394 808B37B4 AFA50004 */ sw $a1, 0x0004($sp) - - diff --git a/data/overlays/actors/z_bg_spot12_saku.data.s b/data/overlays/actors/z_bg_spot12_saku.data.s deleted file mode 100644 index 175fddb609..0000000000 --- a/data/overlays/actors/z_bg_spot12_saku.data.s +++ /dev/null @@ -1,18 +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 Bg_Spot12_Saku_InitVars - .word 0x01910100, 0x00000000, 0x01620000, 0x0000016C -.word BgSpot12Saku_Init -.word BgSpot12Saku_Destroy -.word BgSpot12Saku_Update -.word BgSpot12Saku_Draw -glabel D_808B3840 - .word 0xC8500064, 0xB0F404B0, 0xB0F801F4, 0x30FC03E8 - diff --git a/data/overlays/actors/z_bg_spot12_saku.reloc.s b/data/overlays/actors/z_bg_spot12_saku.reloc.s deleted file mode 100644 index 48ee0e2b87..0000000000 --- a/data/overlays/actors/z_bg_spot12_saku.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_808B38C0 - -.incbin "baserom/ovl_Bg_Spot12_Saku", 0x4A0, 0x000000A0 diff --git a/data/overlays/actors/z_bg_spot12_saku.rodata.s b/data/overlays/actors/z_bg_spot12_saku.rodata.s deleted file mode 100644 index 5d04132d4d..0000000000 --- a/data/overlays/actors/z_bg_spot12_saku.rodata.s +++ /dev/null @@ -1,29 +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_808B3850 - .asciz "Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n" - .balign 4 - -glabel D_808B3890 - .asciz "../z_bg_spot12_saku.c" - .balign 4 - -glabel D_808B38A8 - .word 0x3DCCCCCD -glabel D_808B38AC - .word 0x3A83126F -glabel D_808B38B0 - .word 0x3DCCCCCD -glabel D_808B38B4 - .word 0x38D1B717 -glabel D_808B38B8 - .word 0x3BEA0EA2, 0x00000000 - - diff --git a/spec b/spec index 16da9b7ffb..bacb1cf73c 100644 --- a/spec +++ b/spec @@ -1466,9 +1466,7 @@ endseg beginseg name "ovl_Bg_Spot12_Saku" include "build/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.o" - include "build/data/overlays/actors/z_bg_spot12_saku.data.o" - include "build/data/overlays/actors/z_bg_spot12_saku.rodata.o" - include "build/data/overlays/actors/z_bg_spot12_saku.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 4ce75c6d2f..7df87077d9 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -1,14 +1,26 @@ +/* + * File: z_bg_spot12_saku.c + * Overlay: Bg_Spot12_Saku + * Description: + */ + #include "z_bg_spot12_saku.h" #define ROOM 0x00 #define FLAGS 0x00000000 -void BgSpot12Saku_Init(BgSpot12Saku* this, GlobalContext* globalCtx); -void BgSpot12Saku_Destroy(BgSpot12Saku* this, GlobalContext* globalCtx); -void BgSpot12Saku_Update(BgSpot12Saku* this, GlobalContext* globalCtx); -void BgSpot12Saku_Draw(BgSpot12Saku* this, GlobalContext* globalCtx); +static void BgSpot12Saku_Init(BgSpot12Saku* this, GlobalContext* globalCtx); +static void BgSpot12Saku_Destroy(BgSpot12Saku* this, GlobalContext* globalCtx); +static void BgSpot12Saku_Update(BgSpot12Saku* this, GlobalContext* globalCtx); +static void BgSpot12Saku_Draw(BgSpot12Saku* this, GlobalContext* globalCtx); + +static void func_808B3550(BgSpot12Saku* this); +static void func_808B357C(BgSpot12Saku* this, GlobalContext* globalCtx); +static void func_808B35E4(BgSpot12Saku* this); +static void func_808B3604(BgSpot12Saku* this, GlobalContext* globalCtx); +static void func_808B3714(BgSpot12Saku* this); +static void func_808B37AC(BgSpot12Saku* this, GlobalContext* globalCtx); -/* const ActorInit Bg_Spot12_Saku_InitVars = { ACTOR_BG_SPOT12_SAKU, ACTORTYPE_BG, @@ -21,25 +33,107 @@ const ActorInit Bg_Spot12_Saku_InitVars = { (ActorFunc)BgSpot12Saku_Update, (ActorFunc)BgSpot12Saku_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3420.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Init.s") +static InitChainEntry D_808B3840[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), + ICHAIN_F32(unk_F4, 1200, ICHAIN_CONTINUE), + ICHAIN_F32(unk_F8, 500, ICHAIN_CONTINUE), + ICHAIN_F32(unk_FC, 1000, ICHAIN_STOP), +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Destroy.s") +extern UNK_PTR D_06002260; +extern UNK_PTR D_0600238C; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3550.s") +static void func_808B3420(BgSpot12Saku* this, GlobalContext* globalCtx, UNK_TYPE collision, DynaPolyMoveFlag flags) { + Actor* thisx = &this->dyna.actor; + s32 localC = 0; + s32 pad[2]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B357C.s") + DynaPolyInfo_SetActorMove(thisx, flags); + DynaPolyInfo_Alloc(collision, &localC); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, localC); + if (this->dyna.dynaPolyId == 0x32) { + osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot12_saku.c", 140, + thisx->id, thisx->params); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B35E4.s") +static void BgSpot12Saku_Init(BgSpot12Saku* this, GlobalContext* globalCtx) { + Actor* thisx = &this->dyna.actor; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3604.s") + func_808B3420(this, globalCtx, &D_0600238C, 0); + Actor_ProcessInitChain(thisx, D_808B3840); + if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) { + func_808B3714(this); + } else { + func_808B3550(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B3714.s") +static void BgSpot12Saku_Destroy(BgSpot12Saku* this, GlobalContext* globalCtx) { + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/func_808B37AC.s") +static void func_808B3550(BgSpot12Saku* this) { + Actor* thisx = &this->dyna.actor; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Update.s") + this->actionFunc = func_808B357C; + thisx->scale.x = 0.1f; + thisx->posRot.pos.x = thisx->initPosRot.pos.x; + thisx->posRot.pos.z = thisx->initPosRot.pos.z; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot12_Saku/BgSpot12Saku_Draw.s") +static void func_808B357C(BgSpot12Saku* this, GlobalContext* globalCtx) { + Actor* thisx = &this->dyna.actor; + + if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) { + func_808B35E4(this); + this->unk_168 = 0x14; + func_800800F8(globalCtx, 0x104A, -0x63, thisx, 0); + } +} + +static void func_808B35E4(BgSpot12Saku* this) { + if (this->unk_168 == 0) { + this->actionFunc = func_808B3604; + } +} + +static void func_808B3604(BgSpot12Saku* this, GlobalContext* globalCtx) { + f32 temp_ret = Math_SmoothScaleMaxMinF(&this->dyna.actor.scale.x, 0.001f / 0.14f, 0.16f, 0.0022f, 0.001f); + f32 temp_f18 = ((0.1f - this->dyna.actor.scale.x) * 840.0f); + + this->dyna.actor.posRot.pos.x = + this->dyna.actor.initPosRot.pos.x - (Math_Sins(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); + this->dyna.actor.posRot.pos.z = + this->dyna.actor.initPosRot.pos.z - (Math_Coss(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); + if (fabsf(temp_ret) < 0.0001f) { + func_808B3714(this); + Audio_PlayActorSound2(&this->dyna.actor, 0x280E); + } else { + func_8002F974(&this->dyna.actor, 0x2067); + } +} + +static void func_808B3714(BgSpot12Saku* this) { + Actor* thisx = &this->dyna.actor; + + this->actionFunc = func_808B37AC; + thisx->scale.x = 0.00714285764843f; + thisx->posRot.pos.x = thisx->initPosRot.pos.x - (Math_Sins(thisx->shape.rot.y + 0x4000) * 78.0f); + thisx->posRot.pos.z = thisx->initPosRot.pos.z - (Math_Coss(thisx->shape.rot.y + 0x4000) * 78.0f); +} + +static void func_808B37AC(BgSpot12Saku* this, GlobalContext* globalCtx) { +} + +static void BgSpot12Saku_Update(BgSpot12Saku* this, GlobalContext* globalCtx) { + if (this->unk_168 > 0) { + this->unk_168 -= 1; + } + this->actionFunc(this, globalCtx); +} + +static void BgSpot12Saku_Draw(BgSpot12Saku* this, GlobalContext* globalCtx) { + Gfx_DrawDListOpa(globalCtx, &D_06002260); +} diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h index 8b748fa09e..f6d018d888 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h @@ -5,8 +5,9 @@ #include typedef struct { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x20]; + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ ActorFunc actionFunc; + /* 0x0168 */ s16 unk_168; } BgSpot12Saku; // size = 0x016C extern const ActorInit Bg_Spot12_Saku_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index e45c99de83..4052d6ada8 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -156,6 +156,10 @@ D_06008010 = 0x06008010; D_06001080 = 0x06001080; D_060011EC = 0x060011EC; +// z_bg_spot12_saku +D_06002260 = 0x06002260; +D_0600238C = 0x0600238C; + // z_bg_spot18_futa DL_SPOT18_FUTA = 0x06000368; DL_SPOT18_FUTA2 = 0x06000150;