From 21e367a7cb70b166c68891778a6e8ad3aba44daa Mon Sep 17 00:00:00 2001 From: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Date: Tue, 29 Dec 2020 08:50:56 +0000 Subject: [PATCH] Bigmirror OK and documented (#530) * OK * documented (with one odd float value) * delete asm and alter spec * uniformise spawn data to sIsSpawned, fix compile warnings in Bg_Jya_Lift and Bg_Mori_Elevator * translate last printf * re-delete modified asm * addressed review comments * remove outdated comment * addressed comments, made defines * untrack scenes dir * remove scenes dir --- .../BgJyaBigmirror_Destroy.s | 10 - .../BgJyaBigmirror_Draw.s | 37 --- .../BgJyaBigmirror_Init.s | 50 ---- .../BgJyaBigmirror_Update.s | 19 -- .../ovl_Bg_Jya_Bigmirror/func_808936E0.s | 34 --- .../ovl_Bg_Jya_Bigmirror/func_80893750.s | 162 ----------- .../ovl_Bg_Jya_Bigmirror/func_8089394C.s | 24 -- .../ovl_Bg_Jya_Bigmirror/func_8089399C.s | 140 ---------- .../ovl_Bg_Jya_Bigmirror/func_80893C68.s | 155 ----------- .../overlays/actors/z_bg_jya_bigmirror.data.s | 30 --- .../actors/z_bg_jya_bigmirror.reloc.s | 13 - include/functions.h | 5 +- spec | 3 +- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.c | 10 +- .../ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c | 253 ++++++++++++++++-- .../ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h | 13 +- .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c | 16 +- .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h | 2 +- .../ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c | 10 +- .../ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h | 2 +- .../ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c | 8 +- 21 files changed, 278 insertions(+), 718 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_808936E0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893750.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089394C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089399C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893C68.s delete mode 100644 data/overlays/actors/z_bg_jya_bigmirror.data.s delete mode 100644 data/overlays/actors/z_bg_jya_bigmirror.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Destroy.s deleted file mode 100644 index 871b13ba6f..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Destroy.s +++ /dev/null @@ -1,10 +0,0 @@ -glabel BgJyaBigmirror_Destroy -/* 00520 80893C00 AFA50004 */ sw $a1, 0x0004($sp) -/* 00524 80893C04 908E015D */ lbu $t6, 0x015D($a0) ## 0000015D -/* 00528 80893C08 3C018089 */ lui $at, %hi(D_80893ED0) ## $at = 80890000 -/* 0052C 80893C0C 11C00002 */ beq $t6, $zero, .L80893C18 -/* 00530 80893C10 00000000 */ nop -/* 00534 80893C14 A0203ED0 */ sb $zero, %lo(D_80893ED0)($at) -.L80893C18: -/* 00538 80893C18 03E00008 */ jr $ra -/* 0053C 80893C1C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Draw.s deleted file mode 100644 index e069a14654..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Draw.s +++ /dev/null @@ -1,37 +0,0 @@ -glabel BgJyaBigmirror_Draw -/* 00770 80893E50 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00774 80893E54 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00778 80893E58 AFA5001C */ sw $a1, 0x001C($sp) -/* 0077C 80893E5C 9082015C */ lbu $v0, 0x015C($a0) ## 0000015C -/* 00780 80893E60 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 00784 80893E64 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00788 80893E68 304E0010 */ andi $t6, $v0, 0x0010 ## $t6 = 00000000 -/* 0078C 80893E6C 11C0000A */ beq $t6, $zero, .L80893E98 -/* 00790 80893E70 3C050601 */ lui $a1, %hi(D_0600E1B0) ## $a1 = 06010000 -/* 00794 80893E74 24A5E1B0 */ addiu $a1, $a1, %lo(D_0600E1B0) ## $a1 = 0600E1B0 -/* 00798 80893E78 0C00D498 */ jal Gfx_DrawDListOpa - -/* 0079C 80893E7C AFA60018 */ sw $a2, 0x0018($sp) -/* 007A0 80893E80 3C050601 */ lui $a1, %hi(D_0600E2D0) ## $a1 = 06010000 -/* 007A4 80893E84 24A5E2D0 */ addiu $a1, $a1, %lo(D_0600E2D0) ## $a1 = 0600E2D0 -/* 007A8 80893E88 0C00D4C9 */ jal Gfx_DrawDListXlu - -/* 007AC 80893E8C 8FA4001C */ lw $a0, 0x001C($sp) -/* 007B0 80893E90 8FA60018 */ lw $a2, 0x0018($sp) -/* 007B4 80893E94 90C2015C */ lbu $v0, 0x015C($a2) ## 0000015C -.L80893E98: -/* 007B8 80893E98 304F0038 */ andi $t7, $v0, 0x0038 ## $t7 = 00000000 -/* 007BC 80893E9C 11E00007 */ beq $t7, $zero, .L80893EBC -/* 007C0 80893EA0 30580002 */ andi $t8, $v0, 0x0002 ## $t8 = 00000000 -/* 007C4 80893EA4 13000005 */ beq $t8, $zero, .L80893EBC -/* 007C8 80893EA8 30590001 */ andi $t9, $v0, 0x0001 ## $t9 = 00000000 -/* 007CC 80893EAC 13200003 */ beq $t9, $zero, .L80893EBC -/* 007D0 80893EB0 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000 -/* 007D4 80893EB4 0C224F1A */ jal func_80893C68 -/* 007D8 80893EB8 8FA5001C */ lw $a1, 0x001C($sp) -.L80893EBC: -/* 007DC 80893EBC 8FBF0014 */ lw $ra, 0x0014($sp) -/* 007E0 80893EC0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 007E4 80893EC4 03E00008 */ jr $ra -/* 007E8 80893EC8 00000000 */ nop -/* 007EC 80893ECC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Init.s deleted file mode 100644 index ad987eda83..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Init.s +++ /dev/null @@ -1,50 +0,0 @@ -.rdata -glabel D_80894010 - .asciz "(jya 大鏡)(arg_data 0x%04x)\n" - .balign 4 - -.text -glabel BgJyaBigmirror_Init -/* 00488 80893B68 3C0E8089 */ lui $t6, %hi(D_80893ED0) ## $t6 = 80890000 -/* 0048C 80893B6C 91CE3ED0 */ lbu $t6, %lo(D_80893ED0)($t6) -/* 00490 80893B70 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00494 80893B74 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00498 80893B78 AFA5001C */ sw $a1, 0x001C($sp) -/* 0049C 80893B7C 11C00005 */ beq $t6, $zero, .L80893B94 -/* 004A0 80893B80 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 004A4 80893B84 0C00B55C */ jal Actor_Kill - -/* 004A8 80893B88 00000000 */ nop -/* 004AC 80893B8C 10000019 */ beq $zero, $zero, .L80893BF4 -/* 004B0 80893B90 8FBF0014 */ lw $ra, 0x0014($sp) -.L80893B94: -/* 004B4 80893B94 3C053DCC */ lui $a1, 0x3DCC ## $a1 = 3DCC0000 -/* 004B8 80893B98 34A5CCCD */ ori $a1, $a1, 0xCCCD ## $a1 = 3DCCCCCD -/* 004BC 80893B9C 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000 -/* 004C0 80893BA0 0C00B58B */ jal Actor_SetScale - -/* 004C4 80893BA4 AFA60018 */ sw $a2, 0x0018($sp) -/* 004C8 80893BA8 3C028089 */ lui $v0, %hi(D_80893EF4) ## $v0 = 80890000 -/* 004CC 80893BAC 24423EF4 */ addiu $v0, $v0, %lo(D_80893EF4) ## $v0 = 80893EF4 -/* 004D0 80893BB0 8FA60018 */ lw $a2, 0x0018($sp) -/* 004D4 80893BB4 844F0010 */ lh $t7, 0x0010($v0) ## 80893F04 -/* 004D8 80893BB8 2403FFFF */ addiu $v1, $zero, 0xFFFF ## $v1 = FFFFFFFF -/* 004DC 80893BBC 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 004E0 80893BC0 A4CF0150 */ sh $t7, 0x0150($a2) ## 00000150 -/* 004E4 80893BC4 84580024 */ lh $t8, 0x0024($v0) ## 80893F18 -/* 004E8 80893BC8 3C018089 */ lui $at, %hi(D_80893ED0) ## $at = 80890000 -/* 004EC 80893BCC A0C30003 */ sb $v1, 0x0003($a2) ## 00000003 -/* 004F0 80893BD0 A4D80158 */ sh $t8, 0x0158($a2) ## 00000158 -/* 004F4 80893BD4 A0273ED0 */ sb $a3, %lo(D_80893ED0)($at) -/* 004F8 80893BD8 3C048089 */ lui $a0, %hi(D_80894010) ## $a0 = 80890000 -/* 004FC 80893BDC 24844010 */ addiu $a0, $a0, %lo(D_80894010) ## $a0 = 80894010 -/* 00500 80893BE0 A0C7015D */ sb $a3, 0x015D($a2) ## 0000015D -/* 00504 80893BE4 ACC3016C */ sw $v1, 0x016C($a2) ## 0000016C -/* 00508 80893BE8 0C00084C */ jal osSyncPrintf - -/* 0050C 80893BEC 84C5001C */ lh $a1, 0x001C($a2) ## 0000001C -/* 00510 80893BF0 8FBF0014 */ lw $ra, 0x0014($sp) -.L80893BF4: -/* 00514 80893BF4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00518 80893BF8 03E00008 */ jr $ra -/* 0051C 80893BFC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Update.s deleted file mode 100644 index 01c805e2cf..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Update.s +++ /dev/null @@ -1,19 +0,0 @@ -glabel BgJyaBigmirror_Update -/* 00540 80893C20 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00544 80893C24 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00548 80893C28 AFA40018 */ sw $a0, 0x0018($sp) -/* 0054C 80893C2C 0C224DB8 */ jal func_808936E0 -/* 00550 80893C30 AFA5001C */ sw $a1, 0x001C($sp) -/* 00554 80893C34 8FA40018 */ lw $a0, 0x0018($sp) -/* 00558 80893C38 0C224DD4 */ jal func_80893750 -/* 0055C 80893C3C 8FA5001C */ lw $a1, 0x001C($sp) -/* 00560 80893C40 8FA40018 */ lw $a0, 0x0018($sp) -/* 00564 80893C44 0C224E53 */ jal func_8089394C -/* 00568 80893C48 8FA5001C */ lw $a1, 0x001C($sp) -/* 0056C 80893C4C 8FA40018 */ lw $a0, 0x0018($sp) -/* 00570 80893C50 0C224E67 */ jal func_8089399C -/* 00574 80893C54 8FA5001C */ lw $a1, 0x001C($sp) -/* 00578 80893C58 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0057C 80893C5C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00580 80893C60 03E00008 */ jr $ra -/* 00584 80893C64 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_808936E0.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_808936E0.s deleted file mode 100644 index 1fbe5274b0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_808936E0.s +++ /dev/null @@ -1,34 +0,0 @@ -glabel func_808936E0 -/* 00000 808936E0 908E015C */ lbu $t6, 0x015C($a0) ## 0000015C -/* 00004 808936E4 2401FFC7 */ addiu $at, $zero, 0xFFC7 ## $at = FFFFFFC7 -/* 00008 808936E8 3C020001 */ lui $v0, 0x0001 ## $v0 = 00010000 -/* 0000C 808936EC 01C17824 */ and $t7, $t6, $at -/* 00010 808936F0 A08F015C */ sb $t7, 0x015C($a0) ## 0000015C -/* 00014 808936F4 00451021 */ addu $v0, $v0, $a1 -/* 00018 808936F8 80421CBC */ lb $v0, 0x1CBC($v0) ## 00011CBC -/* 0001C 808936FC 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 00020 80893700 35F90008 */ ori $t9, $t7, 0x0008 ## $t9 = 00000008 -/* 00024 80893704 54410004 */ bnel $v0, $at, .L80893718 -/* 00028 80893708 24010019 */ addiu $at, $zero, 0x0019 ## $at = 00000019 -/* 0002C 8089370C 03E00008 */ jr $ra -/* 00030 80893710 A099015C */ sb $t9, 0x015C($a0) ## 0000015C -.L80893714: -/* 00034 80893714 24010019 */ addiu $at, $zero, 0x0019 ## $at = 00000019 -.L80893718: -/* 00038 80893718 54410006 */ bnel $v0, $at, .L80893734 -/* 0003C 8089371C 2401001A */ addiu $at, $zero, 0x001A ## $at = 0000001A -/* 00040 80893720 9088015C */ lbu $t0, 0x015C($a0) ## 0000015C -/* 00044 80893724 35090010 */ ori $t1, $t0, 0x0010 ## $t1 = 00000010 -/* 00048 80893728 03E00008 */ jr $ra -/* 0004C 8089372C A089015C */ sb $t1, 0x015C($a0) ## 0000015C -.L80893730: -/* 00050 80893730 2401001A */ addiu $at, $zero, 0x001A ## $at = 0000001A -.L80893734: -/* 00054 80893734 14410004 */ bne $v0, $at, .L80893748 -/* 00058 80893738 00000000 */ nop -/* 0005C 8089373C 908A015C */ lbu $t2, 0x015C($a0) ## 0000015C -/* 00060 80893740 354B0020 */ ori $t3, $t2, 0x0020 ## $t3 = 00000020 -/* 00064 80893744 A08B015C */ sb $t3, 0x015C($a0) ## 0000015C -.L80893748: -/* 00068 80893748 03E00008 */ jr $ra -/* 0006C 8089374C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893750.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893750.s deleted file mode 100644 index d2f625a891..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893750.s +++ /dev/null @@ -1,162 +0,0 @@ -.rdata -glabel D_80893F60 - .asciz "Error : コブラ削除された (%s %d)\n" - .balign 4 - -glabel D_80893F84 - .asciz "../z_bg_jya_bigmirror.c" - .balign 4 - -glabel D_80893F9C - .asciz "Error : コブラ発生失敗 (%s %d)\n" - .balign 4 - -glabel D_80893FBC - .asciz "../z_bg_jya_bigmirror.c" - .balign 4 - -.text -glabel func_80893750 -/* 00070 80893750 27BDFFA0 */ addiu $sp, $sp, 0xFFA0 ## $sp = FFFFFFA0 -/* 00074 80893754 AFBF005C */ sw $ra, 0x005C($sp) -/* 00078 80893758 AFBE0058 */ sw $s8, 0x0058($sp) -/* 0007C 8089375C AFB70054 */ sw $s7, 0x0054($sp) -/* 00080 80893760 AFB60050 */ sw $s6, 0x0050($sp) -/* 00084 80893764 AFB5004C */ sw $s5, 0x004C($sp) -/* 00088 80893768 AFB40048 */ sw $s4, 0x0048($sp) -/* 0008C 8089376C AFB30044 */ sw $s3, 0x0044($sp) -/* 00090 80893770 AFB20040 */ sw $s2, 0x0040($sp) -/* 00094 80893774 AFB1003C */ sw $s1, 0x003C($sp) -/* 00098 80893778 AFB00038 */ sw $s0, 0x0038($sp) -/* 0009C 8089377C 908E015C */ lbu $t6, 0x015C($a0) ## 0000015C -/* 000A0 80893780 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 000A4 80893784 00A0A825 */ or $s5, $a1, $zero ## $s5 = 00000000 -/* 000A8 80893788 31CF0030 */ andi $t7, $t6, 0x0030 ## $t7 = 00000000 -/* 000AC 8089378C 11E0004E */ beq $t7, $zero, .L808938C8 -/* 000B0 80893790 00009025 */ or $s2, $zero, $zero ## $s2 = 00000000 -/* 000B4 80893794 3C128089 */ lui $s2, %hi(D_80893EF4) ## $s2 = 80890000 -/* 000B8 80893798 3C178089 */ lui $s7, %hi(D_80893F84) ## $s7 = 80890000 -/* 000BC 8089379C 3C168089 */ lui $s6, %hi(D_80893F60) ## $s6 = 80890000 -/* 000C0 808937A0 26D63F60 */ addiu $s6, $s6, %lo(D_80893F60) ## $s6 = 80893F60 -/* 000C4 808937A4 26F73F84 */ addiu $s7, $s7, %lo(D_80893F84) ## $s7 = 80893F84 -/* 000C8 808937A8 26523EF4 */ addiu $s2, $s2, %lo(D_80893EF4) ## $s2 = 80893EF4 -/* 000CC 808937AC 0000A025 */ or $s4, $zero, $zero ## $s4 = 00000000 -/* 000D0 808937B0 00809825 */ or $s3, $a0, $zero ## $s3 = 00000000 -/* 000D4 808937B4 2491014C */ addiu $s1, $a0, 0x014C ## $s1 = 0000014C -/* 000D8 808937B8 241E0002 */ addiu $s8, $zero, 0x0002 ## $s8 = 00000002 -.L808937BC: -/* 000DC 808937BC 8E78014C */ lw $t8, 0x014C($s3) ## 0000014C -/* 000E0 808937C0 53000020 */ beql $t8, $zero, .L80893844 -/* 000E4 808937C4 C6440000 */ lwc1 $f4, 0x0000($s2) ## 80893EF4 -/* 000E8 808937C8 8E390000 */ lw $t9, 0x0000($s1) ## 0000014C -/* 000EC 808937CC 3C098089 */ lui $t1, %hi(D_80893F1C) ## $t1 = 80890000 -/* 000F0 808937D0 25293F1C */ addiu $t1, $t1, %lo(D_80893F1C) ## $t1 = 80893F1C -/* 000F4 808937D4 872800B6 */ lh $t0, 0x00B6($t9) ## 000000B6 -/* 000F8 808937D8 02891021 */ addu $v0, $s4, $t1 -/* 000FC 808937DC 02C02025 */ or $a0, $s6, $zero ## $a0 = 80893F60 -/* 00100 808937E0 A6280004 */ sh $t0, 0x0004($s1) ## 00000150 -/* 00104 808937E4 862B0004 */ lh $t3, 0x0004($s1) ## 00000150 -/* 00108 808937E8 864A000E */ lh $t2, 0x000E($s2) ## 80893F02 -/* 0010C 808937EC 02E02825 */ or $a1, $s7, $zero ## $a1 = 80893F84 -/* 00110 808937F0 554B0007 */ bnel $t2, $t3, .L80893810 -/* 00114 808937F4 90580000 */ lbu $t8, 0x0000($v0) ## 00000000 -/* 00118 808937F8 920C015C */ lbu $t4, 0x015C($s0) ## 0000015C -/* 0011C 808937FC 904D0000 */ lbu $t5, 0x0000($v0) ## 00000000 -/* 00120 80893800 018D7025 */ or $t6, $t4, $t5 ## $t6 = 00000000 -/* 00124 80893804 10000006 */ beq $zero, $zero, .L80893820 -/* 00128 80893808 A20E015C */ sb $t6, 0x015C($s0) ## 0000015C -/* 0012C 8089380C 90580000 */ lbu $t8, 0x0000($v0) ## 00000000 -.L80893810: -/* 00130 80893810 920F015C */ lbu $t7, 0x015C($s0) ## 0000015C -/* 00134 80893814 0300C827 */ nor $t9, $t8, $zero -/* 00138 80893818 01F94024 */ and $t0, $t7, $t9 -/* 0013C 8089381C A208015C */ sb $t0, 0x015C($s0) ## 0000015C -.L80893820: -/* 00140 80893820 8E290000 */ lw $t1, 0x0000($s1) ## 0000014C -/* 00144 80893824 8D2A0130 */ lw $t2, 0x0130($t1) ## 8089404C -/* 00148 80893828 55400021 */ bnel $t2, $zero, .L808938B0 -/* 0014C 8089382C 26940001 */ addiu $s4, $s4, 0x0001 ## $s4 = 00000001 -/* 00150 80893830 0C00084C */ jal osSyncPrintf - -/* 00154 80893834 240600CB */ addiu $a2, $zero, 0x00CB ## $a2 = 000000CB -/* 00158 80893838 1000001D */ beq $zero, $zero, .L808938B0 -/* 0015C 8089383C 26940001 */ addiu $s4, $s4, 0x0001 ## $s4 = 00000002 -/* 00160 80893840 C6440000 */ lwc1 $f4, 0x0000($s2) ## 80893EF4 -.L80893844: -/* 00164 80893844 26A41C24 */ addiu $a0, $s5, 0x1C24 ## $a0 = 00001C24 -/* 00168 80893848 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 0016C 8089384C E7A40010 */ swc1 $f4, 0x0010($sp) -/* 00170 80893850 C6460004 */ lwc1 $f6, 0x0004($s2) ## 80893EF8 -/* 00174 80893854 02A03025 */ or $a2, $s5, $zero ## $a2 = 00000000 -/* 00178 80893858 240700FC */ addiu $a3, $zero, 0x00FC ## $a3 = 000000FC -/* 0017C 8089385C E7A60014 */ swc1 $f6, 0x0014($sp) -/* 00180 80893860 C6480008 */ lwc1 $f8, 0x0008($s2) ## 80893EFC -/* 00184 80893864 AFA0001C */ sw $zero, 0x001C($sp) -/* 00188 80893868 E7A80018 */ swc1 $f8, 0x0018($sp) -/* 0018C 8089386C 862B0004 */ lh $t3, 0x0004($s1) ## 00000150 -/* 00190 80893870 AFA00024 */ sw $zero, 0x0024($sp) -/* 00194 80893874 AFAB0020 */ sw $t3, 0x0020($sp) -/* 00198 80893878 864C000C */ lh $t4, 0x000C($s2) ## 80893F00 -/* 0019C 8089387C 0C00C916 */ jal Actor_SpawnAsChild - -/* 001A0 80893880 AFAC0028 */ sw $t4, 0x0028($sp) -/* 001A4 80893884 AE220000 */ sw $v0, 0x0000($s1) ## 0000014C -/* 001A8 80893888 AE00011C */ sw $zero, 0x011C($s0) ## 0000011C -/* 001AC 8089388C 8E2D0000 */ lw $t5, 0x0000($s1) ## 0000014C -/* 001B0 80893890 3C048089 */ lui $a0, %hi(D_80893F9C) ## $a0 = 80890000 -/* 001B4 80893894 24843F9C */ addiu $a0, $a0, %lo(D_80893F9C) ## $a0 = 80893F9C -/* 001B8 80893898 15A00004 */ bne $t5, $zero, .L808938AC -/* 001BC 8089389C 3C058089 */ lui $a1, %hi(D_80893FBC) ## $a1 = 80890000 -/* 001C0 808938A0 24A53FBC */ addiu $a1, $a1, %lo(D_80893FBC) ## $a1 = 80893FBC -/* 001C4 808938A4 0C00084C */ jal osSyncPrintf - -/* 001C8 808938A8 240600DD */ addiu $a2, $zero, 0x00DD ## $a2 = 000000DD -.L808938AC: -/* 001CC 808938AC 26940001 */ addiu $s4, $s4, 0x0001 ## $s4 = 00000003 -.L808938B0: -/* 001D0 808938B0 26520014 */ addiu $s2, $s2, 0x0014 ## $s2 = 80893F08 -/* 001D4 808938B4 26730008 */ addiu $s3, $s3, 0x0008 ## $s3 = 00000008 -/* 001D8 808938B8 169EFFC0 */ bne $s4, $s8, .L808937BC -/* 001DC 808938BC 26310008 */ addiu $s1, $s1, 0x0008 ## $s1 = 00000154 -/* 001E0 808938C0 10000017 */ beq $zero, $zero, .L80893920 -/* 001E4 808938C4 8FBF005C */ lw $ra, 0x005C($sp) -.L808938C8: -/* 001E8 808938C8 02009825 */ or $s3, $s0, $zero ## $s3 = 00000000 -/* 001EC 808938CC 24140010 */ addiu $s4, $zero, 0x0010 ## $s4 = 00000010 -.L808938D0: -/* 001F0 808938D0 8E6E014C */ lw $t6, 0x014C($s3) ## 0000014C -/* 001F4 808938D4 2671014C */ addiu $s1, $s3, 0x014C ## $s1 = 0000014C -/* 001F8 808938D8 51C0000E */ beql $t6, $zero, .L80893914 -/* 001FC 808938DC 26520008 */ addiu $s2, $s2, 0x0008 ## $s2 = 80893F10 -/* 00200 808938E0 8E240000 */ lw $a0, 0x0000($s1) ## 0000014C -/* 00204 808938E4 8C85011C */ lw $a1, 0x011C($a0) ## 0000011C -/* 00208 808938E8 10A00006 */ beq $a1, $zero, .L80893904 -/* 0020C 808938EC 00000000 */ nop -/* 00210 808938F0 0C00B55C */ jal Actor_Kill - -/* 00214 808938F4 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00218 808938F8 8E380000 */ lw $t8, 0x0000($s1) ## 0000014C -/* 0021C 808938FC AF00011C */ sw $zero, 0x011C($t8) ## 0000011C -/* 00220 80893900 8E240000 */ lw $a0, 0x0000($s1) ## 0000014C -.L80893904: -/* 00224 80893904 0C00B55C */ jal Actor_Kill - -/* 00228 80893908 00000000 */ nop -/* 0022C 8089390C AE200000 */ sw $zero, 0x0000($s1) ## 0000014C -/* 00230 80893910 26520008 */ addiu $s2, $s2, 0x0008 ## $s2 = 80893F18 -.L80893914: -/* 00234 80893914 1654FFEE */ bne $s2, $s4, .L808938D0 -/* 00238 80893918 26730008 */ addiu $s3, $s3, 0x0008 ## $s3 = 00000008 -/* 0023C 8089391C 8FBF005C */ lw $ra, 0x005C($sp) -.L80893920: -/* 00240 80893920 8FB00038 */ lw $s0, 0x0038($sp) -/* 00244 80893924 8FB1003C */ lw $s1, 0x003C($sp) -/* 00248 80893928 8FB20040 */ lw $s2, 0x0040($sp) -/* 0024C 8089392C 8FB30044 */ lw $s3, 0x0044($sp) -/* 00250 80893930 8FB40048 */ lw $s4, 0x0048($sp) -/* 00254 80893934 8FB5004C */ lw $s5, 0x004C($sp) -/* 00258 80893938 8FB60050 */ lw $s6, 0x0050($sp) -/* 0025C 8089393C 8FB70054 */ lw $s7, 0x0054($sp) -/* 00260 80893940 8FBE0058 */ lw $s8, 0x0058($sp) -/* 00264 80893944 03E00008 */ jr $ra -/* 00268 80893948 27BD0060 */ addiu $sp, $sp, 0x0060 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089394C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089394C.s deleted file mode 100644 index 48a3cf808b..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089394C.s +++ /dev/null @@ -1,24 +0,0 @@ -glabel func_8089394C -/* 0026C 8089394C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00270 80893950 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 00274 80893954 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00278 80893958 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 0027C 8089395C 24050029 */ addiu $a1, $zero, 0x0029 ## $a1 = 00000029 -/* 00280 80893960 0C00B2D0 */ jal Flags_GetSwitch - -/* 00284 80893964 AFA60018 */ sw $a2, 0x0018($sp) -/* 00288 80893968 10400005 */ beq $v0, $zero, .L80893980 -/* 0028C 8089396C 8FA60018 */ lw $a2, 0x0018($sp) -/* 00290 80893970 90CE015C */ lbu $t6, 0x015C($a2) ## 0000015C -/* 00294 80893974 35CF0004 */ ori $t7, $t6, 0x0004 ## $t7 = 00000004 -/* 00298 80893978 10000004 */ beq $zero, $zero, .L8089398C -/* 0029C 8089397C A0CF015C */ sb $t7, 0x015C($a2) ## 0000015C -.L80893980: -/* 002A0 80893980 90D8015C */ lbu $t8, 0x015C($a2) ## 0000015C -/* 002A4 80893984 3319FFFB */ andi $t9, $t8, 0xFFFB ## $t9 = 00000000 -/* 002A8 80893988 A0D9015C */ sb $t9, 0x015C($a2) ## 0000015C -.L8089398C: -/* 002AC 8089398C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 002B0 80893990 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 002B4 80893994 03E00008 */ jr $ra -/* 002B8 80893998 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089399C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089399C.s deleted file mode 100644 index 03fb43c17b..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089399C.s +++ /dev/null @@ -1,140 +0,0 @@ -.rdata -glabel D_80893FD4 - .asciz "Error : Mir Ray 発生失敗 (%s %d)\n" - .balign 4 - -glabel D_80893FF8 - .asciz "../z_bg_jya_bigmirror.c" - .balign 4 - -.text -glabel func_8089399C -/* 002BC 8089399C 27BDFF78 */ addiu $sp, $sp, 0xFF78 ## $sp = FFFFFF78 -/* 002C0 808939A0 AFB20038 */ sw $s2, 0x0038($sp) -/* 002C4 808939A4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 002C8 808939A8 00809025 */ or $s2, $a0, $zero ## $s2 = 00000000 -/* 002CC 808939AC AFB40040 */ sw $s4, 0x0040($sp) -/* 002D0 808939B0 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 002D4 808939B4 00A0A025 */ or $s4, $a1, $zero ## $s4 = 00000000 -/* 002D8 808939B8 AFBF0054 */ sw $ra, 0x0054($sp) -/* 002DC 808939BC 00A12021 */ addu $a0, $a1, $at -/* 002E0 808939C0 AFBE0050 */ sw $s8, 0x0050($sp) -/* 002E4 808939C4 AFB7004C */ sw $s7, 0x004C($sp) -/* 002E8 808939C8 AFB60048 */ sw $s6, 0x0048($sp) -/* 002EC 808939CC AFB50044 */ sw $s5, 0x0044($sp) -/* 002F0 808939D0 AFB3003C */ sw $s3, 0x003C($sp) -/* 002F4 808939D4 AFB10034 */ sw $s1, 0x0034($sp) -/* 002F8 808939D8 AFB00030 */ sw $s0, 0x0030($sp) -/* 002FC 808939DC AFA40064 */ sw $a0, 0x0064($sp) -/* 00300 808939E0 0C02604B */ jal Object_GetIndex - ## ObjectIndex -/* 00304 808939E4 240500AB */ addiu $a1, $zero, 0x00AB ## $a1 = 000000AB -/* 00308 808939E8 04400006 */ bltz $v0, .L80893A04 -/* 0030C 808939EC AFA2006C */ sw $v0, 0x006C($sp) -/* 00310 808939F0 8E4E016C */ lw $t6, 0x016C($s2) ## 0000016C -/* 00314 808939F4 00008825 */ or $s1, $zero, $zero ## $s1 = 00000000 -/* 00318 808939F8 27B30074 */ addiu $s3, $sp, 0x0074 ## $s3 = FFFFFFEC -/* 0031C 808939FC 104E0005 */ beq $v0, $t6, .L80893A14 -/* 00320 80893A00 02408025 */ or $s0, $s2, $zero ## $s0 = 00000000 -.L80893A04: -/* 00324 80893A04 AE400168 */ sw $zero, 0x0168($s2) ## 00000168 -/* 00328 80893A08 AE400164 */ sw $zero, 0x0164($s2) ## 00000164 -/* 0032C 80893A0C 10000048 */ beq $zero, $zero, .L80893B30 -/* 00330 80893A10 AE400160 */ sw $zero, 0x0160($s2) ## 00000160 -.L80893A14: -/* 00334 80893A14 9243015C */ lbu $v1, 0x015C($s2) ## 0000015C -/* 00338 80893A18 3C1E8089 */ lui $s8, %hi(D_80893FD4) ## $s8 = 80890000 -/* 0033C 80893A1C 27DE3FD4 */ addiu $s8, $s8, %lo(D_80893FD4) ## $s8 = 80893FD4 -/* 00340 80893A20 30620018 */ andi $v0, $v1, 0x0018 ## $v0 = 00000000 -/* 00344 80893A24 0002102B */ sltu $v0, $zero, $v0 -/* 00348 80893A28 10400007 */ beq $v0, $zero, .L80893A48 -/* 0034C 80893A2C 3C178089 */ lui $s7, %hi(D_80893F20) ## $s7 = 80890000 -/* 00350 80893A30 30620002 */ andi $v0, $v1, 0x0002 ## $v0 = 00000000 -/* 00354 80893A34 0002102B */ sltu $v0, $zero, $v0 -/* 00358 80893A38 50400004 */ beql $v0, $zero, .L80893A4C -/* 0035C 80893A3C AFA20074 */ sw $v0, 0x0074($sp) -/* 00360 80893A40 30620001 */ andi $v0, $v1, 0x0001 ## $v0 = 00000000 -/* 00364 80893A44 0002102B */ sltu $v0, $zero, $v0 -.L80893A48: -/* 00368 80893A48 AFA20074 */ sw $v0, 0x0074($sp) -.L80893A4C: -/* 0036C 80893A4C 9242015C */ lbu $v0, 0x015C($s2) ## 0000015C -/* 00370 80893A50 3C158089 */ lui $s5, %hi(D_80893F28) ## $s5 = 80890000 -/* 00374 80893A54 26B53F28 */ addiu $s5, $s5, %lo(D_80893F28) ## $s5 = 80893F28 -/* 00378 80893A58 30420030 */ andi $v0, $v0, 0x0030 ## $v0 = 00000000 -/* 0037C 80893A5C AFA2007C */ sw $v0, 0x007C($sp) -/* 00380 80893A60 AFA20078 */ sw $v0, 0x0078($sp) -/* 00384 80893A64 26F73F20 */ addiu $s7, $s7, %lo(D_80893F20) ## $s7 = 80893F20 -/* 00388 80893A68 2416000C */ addiu $s6, $zero, 0x000C ## $s6 = 0000000C -.L80893A6C: -/* 0038C 80893A6C 8E6F0000 */ lw $t7, 0x0000($s3) ## FFFFFFEC -/* 00390 80893A70 51E00025 */ beql $t7, $zero, .L80893B08 -/* 00394 80893A74 8E040160 */ lw $a0, 0x0160($s0) ## 00000160 -/* 00398 80893A78 8E180160 */ lw $t8, 0x0160($s0) ## 00000160 -/* 0039C 80893A7C 8FA40064 */ lw $a0, 0x0064($sp) -/* 003A0 80893A80 57000027 */ bnel $t8, $zero, .L80893B20 -/* 003A4 80893A84 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000001 -/* 003A8 80893A88 0C026062 */ jal Object_IsLoaded - -/* 003AC 80893A8C 8FA5006C */ lw $a1, 0x006C($sp) -/* 003B0 80893A90 10400022 */ beq $v0, $zero, .L80893B1C -/* 003B4 80893A94 26841C24 */ addiu $a0, $s4, 0x1C24 ## $a0 = 00001C24 -/* 003B8 80893A98 02360019 */ multu $s1, $s6 -/* 003BC 80893A9C 00114040 */ sll $t0, $s1, 1 -/* 003C0 80893AA0 02E84821 */ addu $t1, $s7, $t0 -/* 003C4 80893AA4 852A0000 */ lh $t2, 0x0000($t1) ## 00000000 -/* 003C8 80893AA8 02802825 */ or $a1, $s4, $zero ## $a1 = 00000000 -/* 003CC 80893AAC 240600B7 */ addiu $a2, $zero, 0x00B7 ## $a2 = 000000B7 -/* 003D0 80893AB0 AFA00018 */ sw $zero, 0x0018($sp) -/* 003D4 80893AB4 AFA0001C */ sw $zero, 0x001C($sp) -/* 003D8 80893AB8 AFA00020 */ sw $zero, 0x0020($sp) -/* 003DC 80893ABC AFAA0024 */ sw $t2, 0x0024($sp) -/* 003E0 80893AC0 0000C812 */ mflo $t9 -/* 003E4 80893AC4 02B91021 */ addu $v0, $s5, $t9 -/* 003E8 80893AC8 C4440004 */ lwc1 $f4, 0x0004($v0) ## 00000004 -/* 003EC 80893ACC C4460008 */ lwc1 $f6, 0x0008($v0) ## 00000008 -/* 003F0 80893AD0 8C470000 */ lw $a3, 0x0000($v0) ## 00000000 -/* 003F4 80893AD4 E7A40010 */ swc1 $f4, 0x0010($sp) -/* 003F8 80893AD8 0C00C7D4 */ jal Actor_Spawn - ## ActorSpawn -/* 003FC 80893ADC E7A60014 */ swc1 $f6, 0x0014($sp) -/* 00400 80893AE0 1440000E */ bne $v0, $zero, .L80893B1C -/* 00404 80893AE4 AE020160 */ sw $v0, 0x0160($s0) ## 00000160 -/* 00408 80893AE8 3C058089 */ lui $a1, %hi(D_80893FF8) ## $a1 = 80890000 -/* 0040C 80893AEC 24A53FF8 */ addiu $a1, $a1, %lo(D_80893FF8) ## $a1 = 80893FF8 -/* 00410 80893AF0 03C02025 */ or $a0, $s8, $zero ## $a0 = 80893FD4 -/* 00414 80893AF4 0C00084C */ jal osSyncPrintf - -/* 00418 80893AF8 24060136 */ addiu $a2, $zero, 0x0136 ## $a2 = 00000136 -/* 0041C 80893AFC 10000008 */ beq $zero, $zero, .L80893B20 -/* 00420 80893B00 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000002 -/* 00424 80893B04 8E040160 */ lw $a0, 0x0160($s0) ## 00000160 -.L80893B08: -/* 00428 80893B08 50800005 */ beql $a0, $zero, .L80893B20 -/* 0042C 80893B0C 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000003 -/* 00430 80893B10 0C00B55C */ jal Actor_Kill - -/* 00434 80893B14 00000000 */ nop -/* 00438 80893B18 AE000160 */ sw $zero, 0x0160($s0) ## 00000160 -.L80893B1C: -/* 0043C 80893B1C 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000004 -.L80893B20: -/* 00440 80893B20 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 00444 80893B24 26730004 */ addiu $s3, $s3, 0x0004 ## $s3 = FFFFFFF0 -/* 00448 80893B28 1621FFD0 */ bne $s1, $at, .L80893A6C -/* 0044C 80893B2C 26100004 */ addiu $s0, $s0, 0x0004 ## $s0 = 00000004 -.L80893B30: -/* 00450 80893B30 8FAB006C */ lw $t3, 0x006C($sp) -/* 00454 80893B34 AE4B016C */ sw $t3, 0x016C($s2) ## 0000016C -/* 00458 80893B38 8FBF0054 */ lw $ra, 0x0054($sp) -/* 0045C 80893B3C 8FBE0050 */ lw $s8, 0x0050($sp) -/* 00460 80893B40 8FB7004C */ lw $s7, 0x004C($sp) -/* 00464 80893B44 8FB60048 */ lw $s6, 0x0048($sp) -/* 00468 80893B48 8FB50044 */ lw $s5, 0x0044($sp) -/* 0046C 80893B4C 8FB40040 */ lw $s4, 0x0040($sp) -/* 00470 80893B50 8FB3003C */ lw $s3, 0x003C($sp) -/* 00474 80893B54 8FB20038 */ lw $s2, 0x0038($sp) -/* 00478 80893B58 8FB10034 */ lw $s1, 0x0034($sp) -/* 0047C 80893B5C 8FB00030 */ lw $s0, 0x0030($sp) -/* 00480 80893B60 03E00008 */ jr $ra -/* 00484 80893B64 27BD0088 */ addiu $sp, $sp, 0x0088 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893C68.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893C68.s deleted file mode 100644 index 2a908a8df7..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893C68.s +++ /dev/null @@ -1,155 +0,0 @@ -.rdata -glabel D_80894030 - .asciz "../z_bg_jya_bigmirror.c" - .balign 4 - -glabel D_80894048 - .asciz "../z_bg_jya_bigmirror.c" - .balign 4 - -glabel D_80894060 - .asciz "../z_bg_jya_bigmirror.c" - .balign 4 - -glabel D_80894078 - .asciz "../z_bg_jya_bigmirror.c" - .balign 4 - -.late_rodata -glabel D_80894090 - .float 0.1 - -glabel D_80894094 - .word 0xBA4CCCCD -glabel D_80894098 - .word 0x3FB1F0A4 -glabel D_8089409C - .float 0.1 - -.text -glabel func_80893C68 -/* 00588 80893C68 27BDFFB0 */ addiu $sp, $sp, 0xFFB0 ## $sp = FFFFFFB0 -/* 0058C 80893C6C AFBF001C */ sw $ra, 0x001C($sp) -/* 00590 80893C70 AFB00018 */ sw $s0, 0x0018($sp) -/* 00594 80893C74 AFA40050 */ sw $a0, 0x0050($sp) -/* 00598 80893C78 AFA50054 */ sw $a1, 0x0054($sp) -/* 0059C 80893C7C 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 005A0 80893C80 3C068089 */ lui $a2, %hi(D_80894030) ## $a2 = 80890000 -/* 005A4 80893C84 24C64030 */ addiu $a2, $a2, %lo(D_80894030) ## $a2 = 80894030 -/* 005A8 80893C88 27A40034 */ addiu $a0, $sp, 0x0034 ## $a0 = FFFFFFE4 -/* 005AC 80893C8C 240701B3 */ addiu $a3, $zero, 0x01B3 ## $a3 = 000001B3 -/* 005B0 80893C90 0C031AB1 */ jal Graph_OpenDisps -/* 005B4 80893C94 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 005B8 80893C98 8FAF0054 */ lw $t7, 0x0054($sp) -/* 005BC 80893C9C 0C024F61 */ jal func_80093D84 -/* 005C0 80893CA0 8DE40000 */ lw $a0, 0x0000($t7) ## 00000000 -/* 005C4 80893CA4 8FA40054 */ lw $a0, 0x0054($sp) -/* 005C8 80893CA8 24050157 */ addiu $a1, $zero, 0x0157 ## $a1 = 00000157 -/* 005CC 80893CAC 24060001 */ addiu $a2, $zero, 0x0001 ## $a2 = 00000001 -/* 005D0 80893CB0 0C00CB0F */ jal Actor_Find - -/* 005D4 80893CB4 24841C24 */ addiu $a0, $a0, 0x1C24 ## $a0 = 00001C24 -/* 005D8 80893CB8 10400004 */ beq $v0, $zero, .L80893CCC -/* 005DC 80893CBC 00404025 */ or $t0, $v0, $zero ## $t0 = 00000000 -/* 005E0 80893CC0 8FA30050 */ lw $v1, 0x0050($sp) -/* 005E4 80893CC4 C4440028 */ lwc1 $f4, 0x0028($v0) ## 00000028 -/* 005E8 80893CC8 E4640170 */ swc1 $f4, 0x0170($v1) ## 00000170 -.L80893CCC: -/* 005EC 80893CCC 8FA30050 */ lw $v1, 0x0050($sp) -/* 005F0 80893CD0 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 005F4 80893CD4 44814000 */ mtc1 $at, $f8 ## $f8 = 40.00 -/* 005F8 80893CD8 C4660028 */ lwc1 $f6, 0x0028($v1) ## 00000028 -/* 005FC 80893CDC C46C0024 */ lwc1 $f12, 0x0024($v1) ## 00000024 -/* 00600 80893CE0 8C66002C */ lw $a2, 0x002C($v1) ## 0000002C -/* 00604 80893CE4 AFA80048 */ sw $t0, 0x0048($sp) -/* 00608 80893CE8 246700B4 */ addiu $a3, $v1, 0x00B4 ## $a3 = 000000B4 -/* 0060C 80893CEC 0C0345A5 */ jal func_800D1694 -/* 00610 80893CF0 46083380 */ add.s $f14, $f6, $f8 -/* 00614 80893CF4 8FB80050 */ lw $t8, 0x0050($sp) -/* 00618 80893CF8 3C018089 */ lui $at, %hi(D_80894090) ## $at = 80890000 -/* 0061C 80893CFC C42C4090 */ lwc1 $f12, %lo(D_80894090)($at) -/* 00620 80893D00 3C018089 */ lui $at, %hi(D_80894094) ## $at = 80890000 -/* 00624 80893D04 C4304094 */ lwc1 $f16, %lo(D_80894094)($at) -/* 00628 80893D08 C70A0170 */ lwc1 $f10, 0x0170($t8) ## 00000170 -/* 0062C 80893D0C 3C018089 */ lui $at, %hi(D_80894098) ## $at = 80890000 -/* 00630 80893D10 C4244098 */ lwc1 $f4, %lo(D_80894098)($at) -/* 00634 80893D14 46105482 */ mul.s $f18, $f10, $f16 -/* 00638 80893D18 44066000 */ mfc1 $a2, $f12 -/* 0063C 80893D1C 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 00640 80893D20 0C0342A3 */ jal Matrix_Scale -/* 00644 80893D24 46049380 */ add.s $f14, $f18, $f4 -/* 00648 80893D28 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 0064C 80893D2C 8FA80048 */ lw $t0, 0x0048($sp) -/* 00650 80893D30 3C09DA38 */ lui $t1, 0xDA38 ## $t1 = DA380000 -/* 00654 80893D34 24590008 */ addiu $t9, $v0, 0x0008 ## $t9 = 00000008 -/* 00658 80893D38 AE1902D0 */ sw $t9, 0x02D0($s0) ## 000002D0 -/* 0065C 80893D3C 35290003 */ ori $t1, $t1, 0x0003 ## $t1 = DA380003 -/* 00660 80893D40 AC490000 */ sw $t1, 0x0000($v0) ## 00000000 -/* 00664 80893D44 8FAA0054 */ lw $t2, 0x0054($sp) -/* 00668 80893D48 3C058089 */ lui $a1, %hi(D_80894048) ## $a1 = 80890000 -/* 0066C 80893D4C 24A54048 */ addiu $a1, $a1, %lo(D_80894048) ## $a1 = 80894048 -/* 00670 80893D50 8D440000 */ lw $a0, 0x0000($t2) ## 00000000 -/* 00674 80893D54 240601C9 */ addiu $a2, $zero, 0x01C9 ## $a2 = 000001C9 -/* 00678 80893D58 AFA20030 */ sw $v0, 0x0030($sp) -/* 0067C 80893D5C 0C0346A2 */ jal Matrix_NewMtx -/* 00680 80893D60 AFA80048 */ sw $t0, 0x0048($sp) -/* 00684 80893D64 8FA30030 */ lw $v1, 0x0030($sp) -/* 00688 80893D68 8FA80048 */ lw $t0, 0x0048($sp) -/* 0068C 80893D6C 3C0D0601 */ lui $t5, %hi(D_0600BC70) ## $t5 = 06010000 -/* 00690 80893D70 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00694 80893D74 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 00698 80893D78 25ADBC70 */ addiu $t5, $t5, %lo(D_0600BC70) ## $t5 = 0600BC70 -/* 0069C 80893D7C 3C0CDE00 */ lui $t4, 0xDE00 ## $t4 = DE000000 -/* 006A0 80893D80 244B0008 */ addiu $t3, $v0, 0x0008 ## $t3 = 00000008 -/* 006A4 80893D84 AE0B02D0 */ sw $t3, 0x02D0($s0) ## 000002D0 -/* 006A8 80893D88 AC4D0004 */ sw $t5, 0x0004($v0) ## 00000004 -/* 006AC 80893D8C 11000024 */ beq $t0, $zero, .L80893E20 -/* 006B0 80893D90 AC4C0000 */ sw $t4, 0x0000($v0) ## 00000000 -/* 006B4 80893D94 3C078089 */ lui $a3, %hi(D_80893F4C) ## $a3 = 80890000 -/* 006B8 80893D98 24E73F4C */ addiu $a3, $a3, %lo(D_80893F4C) ## $a3 = 80893F4C -/* 006BC 80893D9C C50C0024 */ lwc1 $f12, 0x0024($t0) ## 00000024 -/* 006C0 80893DA0 C50E0028 */ lwc1 $f14, 0x0028($t0) ## 00000028 -/* 006C4 80893DA4 0C0345A5 */ jal func_800D1694 -/* 006C8 80893DA8 8D06002C */ lw $a2, 0x002C($t0) ## 0000002C -/* 006CC 80893DAC 3C018089 */ lui $at, %hi(D_8089409C) ## $at = 80890000 -/* 006D0 80893DB0 C42C409C */ lwc1 $f12, %lo(D_8089409C)($at) -/* 006D4 80893DB4 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 006D8 80893DB8 44066000 */ mfc1 $a2, $f12 -/* 006DC 80893DBC 0C0342A3 */ jal Matrix_Scale -/* 006E0 80893DC0 46006386 */ mov.s $f14, $f12 -/* 006E4 80893DC4 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 006E8 80893DC8 3C0FDA38 */ lui $t7, 0xDA38 ## $t7 = DA380000 -/* 006EC 80893DCC 35EF0003 */ ori $t7, $t7, 0x0003 ## $t7 = DA380003 -/* 006F0 80893DD0 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008 -/* 006F4 80893DD4 AE0E02D0 */ sw $t6, 0x02D0($s0) ## 000002D0 -/* 006F8 80893DD8 AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 -/* 006FC 80893DDC 8FB80054 */ lw $t8, 0x0054($sp) -/* 00700 80893DE0 3C058089 */ lui $a1, %hi(D_80894060) ## $a1 = 80890000 -/* 00704 80893DE4 24A54060 */ addiu $a1, $a1, %lo(D_80894060) ## $a1 = 80894060 -/* 00708 80893DE8 8F040000 */ lw $a0, 0x0000($t8) ## 00000000 -/* 0070C 80893DEC 240601D3 */ addiu $a2, $zero, 0x01D3 ## $a2 = 000001D3 -/* 00710 80893DF0 0C0346A2 */ jal Matrix_NewMtx -/* 00714 80893DF4 AFA20028 */ sw $v0, 0x0028($sp) -/* 00718 80893DF8 8FA30028 */ lw $v1, 0x0028($sp) -/* 0071C 80893DFC 3C0A0601 */ lui $t2, %hi(D_0600BD80) ## $t2 = 06010000 -/* 00720 80893E00 254ABD80 */ addiu $t2, $t2, %lo(D_0600BD80) ## $t2 = 0600BD80 -/* 00724 80893E04 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00728 80893E08 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 0072C 80893E0C 3C09DE00 */ lui $t1, 0xDE00 ## $t1 = DE000000 -/* 00730 80893E10 24590008 */ addiu $t9, $v0, 0x0008 ## $t9 = 00000008 -/* 00734 80893E14 AE1902D0 */ sw $t9, 0x02D0($s0) ## 000002D0 -/* 00738 80893E18 AC4A0004 */ sw $t2, 0x0004($v0) ## 00000004 -/* 0073C 80893E1C AC490000 */ sw $t1, 0x0000($v0) ## 00000000 -.L80893E20: -/* 00740 80893E20 8FAB0054 */ lw $t3, 0x0054($sp) -/* 00744 80893E24 3C068089 */ lui $a2, %hi(D_80894078) ## $a2 = 80890000 -/* 00748 80893E28 24C64078 */ addiu $a2, $a2, %lo(D_80894078) ## $a2 = 80894078 -/* 0074C 80893E2C 27A40034 */ addiu $a0, $sp, 0x0034 ## $a0 = FFFFFFE4 -/* 00750 80893E30 240701DC */ addiu $a3, $zero, 0x01DC ## $a3 = 000001DC -/* 00754 80893E34 0C031AD5 */ jal Graph_CloseDisps -/* 00758 80893E38 8D650000 */ lw $a1, 0x0000($t3) ## 00000000 -/* 0075C 80893E3C 8FBF001C */ lw $ra, 0x001C($sp) -/* 00760 80893E40 8FB00018 */ lw $s0, 0x0018($sp) -/* 00764 80893E44 27BD0050 */ addiu $sp, $sp, 0x0050 ## $sp = 00000000 -/* 00768 80893E48 03E00008 */ jr $ra -/* 0076C 80893E4C 00000000 */ nop diff --git a/data/overlays/actors/z_bg_jya_bigmirror.data.s b/data/overlays/actors/z_bg_jya_bigmirror.data.s deleted file mode 100644 index cfab2f4688..0000000000 --- a/data/overlays/actors/z_bg_jya_bigmirror.data.s +++ /dev/null @@ -1,30 +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 D_80893ED0 - .word 0x00000000 -glabel Bg_Jya_Bigmirror_InitVars - .word 0x01580100, 0x00000030, 0x00F10000, 0x00000174 -.word BgJyaBigmirror_Init -.word BgJyaBigmirror_Destroy -.word BgJyaBigmirror_Update -.word BgJyaBigmirror_Draw -glabel D_80893EF4 - .word 0xC40C0000, 0x44D9E000, 0xC39B0000, 0xFF014000, 0x80000000, 0x42700000, 0x44D9E000, 0xC39B0000, 0xFF028000, 0xA0000000 -glabel D_80893F1C - .word 0x01020000 -glabel D_80893F20 - .word 0x00050007, 0x00080000 -glabel D_80893F28 - .word 0x42700000, 0x44E14000, 0xC489C000, 0xC40C0000, 0x44E10000, 0xC39B0000, 0x42700000, 0x44E10000, 0xC39B0000 -glabel D_80893F4C - .word 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_bg_jya_bigmirror.reloc.s b/data/overlays/actors/z_bg_jya_bigmirror.reloc.s deleted file mode 100644 index bf578fa9aa..0000000000 --- a/data/overlays/actors/z_bg_jya_bigmirror.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_808940A0 - .incbin "baserom/ovl_Bg_Jya_Bigmirror", 0x9C0, 0x00000100 diff --git a/include/functions.h b/include/functions.h index 29812ad146..cfd2a5428b 100644 --- a/include/functions.h +++ b/include/functions.h @@ -730,8 +730,9 @@ s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 camDataIdx, f32 a s16 timer3); s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera); Vec3f* Camera_GetSkyboxOffset(Vec3f* dst, Camera* camera); -void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3, - UNK_TYPE arg6); +void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, + void* data1, s16 data2, s16 data3, UNK_TYPE arg6); +s16 func_8005B1A4(Camera* camera); DamageTable* DamageTable_Get(s32 index); void func_8005B280(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC); void func_8005B2AC(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b); diff --git a/spec b/spec index 14dc8d5067..371394a10f 100644 --- a/spec +++ b/spec @@ -944,8 +944,7 @@ endseg beginseg name "ovl_Bg_Jya_Bigmirror" include "build/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.o" - include "build/data/overlays/actors/z_bg_jya_bigmirror.data.o" - include "build/data/overlays/actors/z_bg_jya_bigmirror.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Jya_Bigmirror/ovl_Bg_Jya_Bigmirror_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index a7336d6b6b..a62c0ab910 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -24,7 +24,7 @@ void func_80892E0C(BgJya1flift* this); void BgJya1flift_ResetMoveDelay(BgJya1flift* this); void BgJya1flift_DelayMove(BgJya1flift* this, GlobalContext* globalCtx); -static u8 sHasSpawned = false; +static u8 sIsSpawned = false; const ActorInit Bg_Jya_1flift_InitVars = { ACTOR_BG_JYA_1FLIFT, @@ -85,9 +85,9 @@ void BgJya1flift_InitCollision(Actor* thisx, GlobalContext* globalCtx) { void BgJya1flift_Init(Actor* thisx, GlobalContext* globalCtx) { BgJya1flift* this = THIS; // 1 F lift - osSyncPrintf("(1Fリフト)(flag %d)(room %d)\n", sHasSpawned, globalCtx->roomCtx.curRoom.num); + osSyncPrintf("(1Fリフト)(flag %d)(room %d)\n", sIsSpawned, globalCtx->roomCtx.curRoom.num); this->hasInitialized = false; - if (sHasSpawned) { + if (sIsSpawned) { Actor_Kill(thisx); return; } @@ -100,7 +100,7 @@ void BgJya1flift_Init(Actor* thisx, GlobalContext* globalCtx) { func_80892DB0(this); } thisx->room = -1; - sHasSpawned = true; + sIsSpawned = true; this->hasInitialized = true; } @@ -108,7 +108,7 @@ void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx) { BgJya1flift* this = THIS; if (this->hasInitialized) { - sHasSpawned = false; + sIsSpawned = false; Collider_DestroyCylinder(globalCtx, &this->collider); DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index f61af79478..593c0e28bf 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -1,20 +1,29 @@ +/* + * File: z_bg_jya_bigmirror.c + * Overlay: ovl_Bg_Jya_Bigmirror + * Description: Ceiling mirror and puzzle in Spirit Temple top rooms + */ + #include "z_bg_jya_bigmirror.h" #define FLAGS 0x00000030 #define THIS ((BgJyaBigmirror*)thisx) +#define BIGMIR_PUZZLE_COBRA1_SOLVED 1 << 0 +#define BIGMIR_PUZZLE_COBRA2_SOLVED 1 << 1 +#define BIGMIR_PUZZLE_BOMBIWA_DESTROYED 1 << 2 +#define BIGMIR_PUZZLE_IN_STATUE_ROOM 1 << 3 +#define BIGMIR_PUZZLE_IN_1ST_TOP_ROOM 1 << 4 +#define BIGMIR_PUZZLE_IN_2ND_TOP_ROOM 1 << 5 + void BgJyaBigmirror_Init(Actor* thisx, GlobalContext* globalCtx); void BgJyaBigmirror_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgJyaBigmirror_Update(Actor* thisx, GlobalContext* globalCtx); void BgJyaBigmirror_Draw(Actor* thisx, GlobalContext* globalCtx); -extern UNK_TYPE D_0600BC70; -extern UNK_TYPE D_0600BD80; -extern UNK_TYPE D_0600E1B0; -extern UNK_TYPE D_0600E2D0; +static u8 sIsSpawned = false; -/* const ActorInit Bg_Jya_Bigmirror_InitVars = { ACTOR_BG_JYA_BIGMIRROR, ACTORTYPE_BG, @@ -26,21 +35,235 @@ const ActorInit Bg_Jya_Bigmirror_InitVars = { (ActorFunc)BgJyaBigmirror_Update, (ActorFunc)BgJyaBigmirror_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_808936E0.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893750.s") +typedef struct { + /* 0x00 */ Vec3f pos; + /* 0x0C */ s16 params; + /* 0x0E */ s16 solvedRotY; + /* 0x10 */ s16 initRotY; +} BigMirrorDataEntry; // size = 0x14 -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089394C.s") +static BigMirrorDataEntry sCobraSpawnData[] = { + { { -560.0f, 1743.0f, -310.0f }, 0xFF01, 0x4000, 0x8000 }, + { { 60.0f, 1743.0f, -310.0f }, 0xFF02, 0x8000, 0xA000 }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_8089399C.s") +extern Gfx D_0600BC70[]; +extern Gfx D_0600BD80[]; +extern Gfx D_0600E1B0[]; +extern Gfx D_0600E2D0[]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Init.s") +void BgJyaBigmirror_SetRoomFlag(Actor* thisx, GlobalContext* globalCtx) { + BgJyaBigmirror* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Destroy.s") + this->puzzleFlags &= ~(BIGMIR_PUZZLE_IN_STATUE_ROOM | BIGMIR_PUZZLE_IN_1ST_TOP_ROOM | BIGMIR_PUZZLE_IN_2ND_TOP_ROOM); + if (globalCtx->roomCtx.curRoom.num == 5) { + this->puzzleFlags |= BIGMIR_PUZZLE_IN_STATUE_ROOM; + } else if (globalCtx->roomCtx.curRoom.num == 0x19) { + this->puzzleFlags |= BIGMIR_PUZZLE_IN_1ST_TOP_ROOM; + } else if (globalCtx->roomCtx.curRoom.num == 0x1A) { + this->puzzleFlags |= BIGMIR_PUZZLE_IN_2ND_TOP_ROOM; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Update.s") +void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) { + static u8 cobraPuzzleFlags[] = { BIGMIR_PUZZLE_COBRA1_SOLVED, BIGMIR_PUZZLE_COBRA2_SOLVED }; + BgJyaBigmirror* this = THIS; + BigMirrorDataEntry* curSpawnData; + BigmirrorCobra* curCobraInfo; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/func_80893C68.s") + if (this->puzzleFlags & (BIGMIR_PUZZLE_IN_1ST_TOP_ROOM | BIGMIR_PUZZLE_IN_2ND_TOP_ROOM)) { -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Bigmirror/BgJyaBigmirror_Draw.s") + for (i = 0; i < 2; i++) { + curSpawnData = &sCobraSpawnData[i]; + curCobraInfo = &this->cobraInfo[i]; + + if (curCobraInfo->cobra != NULL) { + curCobraInfo->rotY = curCobraInfo->cobra->actor.shape.rot.y; + + if (curCobraInfo->rotY == curSpawnData->solvedRotY) { + this->puzzleFlags |= cobraPuzzleFlags[i]; + } else { + this->puzzleFlags &= ~cobraPuzzleFlags[i]; + } + + if (curCobraInfo->cobra->actor.update == NULL) { + // Cobra deleted + osSyncPrintf("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203); + } + } else { + curCobraInfo->cobra = (BgJyaCobra*)Actor_SpawnAsChild( + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BG_JYA_COBRA, curSpawnData->pos.x, + curSpawnData->pos.y, curSpawnData->pos.z, 0, curCobraInfo->rotY, 0, curSpawnData->params); + this->actor.child = NULL; + + if (&curCobraInfo->cobra->actor == NULL) { + // Cobra generation failed + osSyncPrintf("Error : コブラ発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 221); + } + } + } + } else { + + for (i = 0; i < 2; i++) { + curCobraInfo = &this->cobraInfo[i]; + if (curCobraInfo->cobra != NULL) { + if (curCobraInfo->cobra->actor.child != NULL) { + Actor_Kill(curCobraInfo->cobra->actor.child); + curCobraInfo->cobra->actor.child = NULL; + } + Actor_Kill(&curCobraInfo->cobra->actor); + curCobraInfo->cobra = NULL; + } + } + } +} + +void BgJyaBigmirror_SetBombiwaFlag(Actor* thisx, GlobalContext* globalCtx) { + BgJyaBigmirror* this = THIS; + + if (Flags_GetSwitch(globalCtx, 0x29)) { + this->puzzleFlags |= BIGMIR_PUZZLE_BOMBIWA_DESTROYED; + } else { + this->puzzleFlags &= ~(BIGMIR_PUZZLE_BOMBIWA_DESTROYED); + } +} + +void BgJyaBigmirror_HandleMirRay(Actor* thisx, GlobalContext* globalCtx) { + static s16 sMirRayParamss[] = { 0x0005, 0x0007, 0x0008 }; + static Vec3f sMirRayPoss[] = { + { 60.0f, 1802.0f, -1102.0f }, + { -560.0f, 1800.0f, -310.0f }, + { 60.0f, 1800.0f, -310.0f }, + }; + BgJyaBigmirror* this = THIS; + s32 puzzleSolved; + s32 lightBeamToggles[3]; + s32 i; + s32 objBankIndex; + + objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MIR_RAY); + + if ((objBankIndex < 0) || (objBankIndex != this->mirRayObjIndex)) { + this->lightBeams[2] = NULL; + this->lightBeams[1] = NULL; + this->lightBeams[0] = NULL; + } else { + puzzleSolved = !!(this->puzzleFlags & (BIGMIR_PUZZLE_IN_STATUE_ROOM | BIGMIR_PUZZLE_IN_1ST_TOP_ROOM)); + + if (puzzleSolved) { + puzzleSolved = !!(this->puzzleFlags & BIGMIR_PUZZLE_COBRA2_SOLVED); + + if (puzzleSolved) { + puzzleSolved = !!(this->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED); + } + } + lightBeamToggles[0] = puzzleSolved; // Only spawn if puzzle solved + if (1) {} + lightBeamToggles[1] = lightBeamToggles[2] = + this->puzzleFlags & (BIGMIR_PUZZLE_IN_1ST_TOP_ROOM | BIGMIR_PUZZLE_IN_2ND_TOP_ROOM); + + for (i = 0; i < 3; i++) { + if (lightBeamToggles[i]) { + if ((this->lightBeams[i] == NULL) && Object_IsLoaded(&globalCtx->objectCtx, objBankIndex)) { + this->lightBeams[i] = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, sMirRayPoss[i].x, + sMirRayPoss[i].y, sMirRayPoss[i].z, 0, 0, 0, sMirRayParamss[i]); + + if (this->lightBeams[i] == NULL) { + // Mir Ray generation failed + osSyncPrintf("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 310); + } + } + } else { + if (this->lightBeams[i] != NULL) { + Actor_Kill(this->lightBeams[i]); + this->lightBeams[i] = NULL; + } + } + } + } + this->mirRayObjIndex = objBankIndex; +} + +void BgJyaBigmirror_Init(Actor* thisx, GlobalContext* globalCtx) { + BgJyaBigmirror* this = THIS; + + if (sIsSpawned) { + Actor_Kill(&this->actor); + return; + } + + Actor_SetScale(&this->actor, 0.1f); + this->cobraInfo[0].rotY = sCobraSpawnData[0].initRotY; + this->cobraInfo[1].rotY = sCobraSpawnData[1].initRotY; + this->actor.room = -1; + sIsSpawned = true; + this->spawned = true; + this->mirRayObjIndex = -1; + + // jya Bigmirror + osSyncPrintf("(jya 大鏡)(arg_data 0x%04x)\n", this->actor.params, this); +} + +void BgJyaBigmirror_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgJyaBigmirror* this = THIS; + + if (this->spawned) { + sIsSpawned = false; + } +} + +void BgJyaBigmirror_Update(Actor* thisx, GlobalContext* globalCtx) { + BgJyaBigmirror_SetRoomFlag(thisx, globalCtx); + BgJyaBigmirror_HandleCobra(thisx, globalCtx); + BgJyaBigmirror_SetBombiwaFlag(thisx, globalCtx); + BgJyaBigmirror_HandleMirRay(thisx, globalCtx); +} + +void BgJyaBigmirror_DrawLightBeam(Actor* thisx, GlobalContext* globalCtx) { + static Vec3s D_80893F4C = { 0, 0, 0 }; + BgJyaBigmirror* this = THIS; + Actor* lift; + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 435); + func_80093D84(globalCtx->state.gfxCtx); + lift = Actor_Find(&globalCtx->actorCtx, ACTOR_BG_JYA_LIFT, ACTORTYPE_BG); + if (lift != NULL) { + this->liftHeight = lift->posRot.pos.y; + } + func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z, + &this->actor.shape.rot); + // Second float seems to be either this or 1613/1280 + 0.13: both numerators relate to the lift height + Matrix_Scale(0.1f, (this->liftHeight * -(1.0f / 1280.0f)) + (973.0f / 1280.0f + 0.63f) /* 1.3901563f */, 0.1f, + MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 457), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, D_0600BC70); + + if (lift != NULL) { + if (1) {} + func_800D1694(lift->posRot.pos.x, lift->posRot.pos.y, lift->posRot.pos.z, &D_80893F4C); + Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 467), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, D_0600BD80); + } + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 476); +} + +void BgJyaBigmirror_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgJyaBigmirror* this = THIS; + + if (this->puzzleFlags & BIGMIR_PUZZLE_IN_1ST_TOP_ROOM) { + Gfx_DrawDListOpa(globalCtx, D_0600E1B0); + Gfx_DrawDListXlu(globalCtx, D_0600E2D0); + } + + if ((this->puzzleFlags & + (BIGMIR_PUZZLE_IN_STATUE_ROOM | BIGMIR_PUZZLE_IN_1ST_TOP_ROOM | BIGMIR_PUZZLE_IN_2ND_TOP_ROOM)) && + (this->puzzleFlags & BIGMIR_PUZZLE_COBRA2_SOLVED) && (this->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED)) { + BgJyaBigmirror_DrawLightBeam(&this->actor, globalCtx); + } +} diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h index 60c5ef5567..be19136b78 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h @@ -3,12 +3,23 @@ #include "ultra64.h" #include "global.h" +#include "overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h" struct BgJyaBigmirror; +typedef struct { + /* 0x00 */ BgJyaCobra* cobra; + /* 0x04 */ s16 rotY; +} BigmirrorCobra; // size = 0x08 + typedef struct BgJyaBigmirror { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x28]; + /* 0x014C */ BigmirrorCobra cobraInfo[2]; + /* 0x015C */ u8 puzzleFlags; + /* 0x015D */ u8 spawned; + /* 0x0160 */ Actor* lightBeams[3]; + /* 0x016C */ s32 mirRayObjIndex; + /* 0x0170 */ f32 liftHeight; } BgJyaBigmirror; // size = 0x0174 extern const ActorInit Bg_Jya_Bigmirror_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 3f422b3d42..08789dbad5 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -22,7 +22,7 @@ void BgJyaLift_DelayMove(BgJyaLift* this, GlobalContext* globalCtx); void BgJyaLift_SetupMove(BgJyaLift* this); void BgJyaLift_Move(BgJyaLift* this, GlobalContext* globalCtx); -static s16 D_8089A020 = 0; +static s16 sIsSpawned = false; const ActorInit Bg_Jya_Lift_InitVars = { ACTOR_BG_JYA_LIFT, @@ -52,14 +52,14 @@ void BgJyaLift_InitDynapoly(BgJyaLift* this, GlobalContext* globalCtx, u32 arg2, DynaPolyInfo_SetActorMove(&this->dyna, moveFlag); DynaPolyInfo_Alloc(arg2, &localConst); - this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, localConst); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, localConst); } void BgJyaLift_Init(Actor* thisx, GlobalContext* globalCtx) { BgJyaLift* this = THIS; this->unk_16A = 0; - if (D_8089A020) { + if (sIsSpawned) { Actor_Kill(thisx); return; } @@ -69,12 +69,12 @@ void BgJyaLift_Init(Actor* thisx, GlobalContext* globalCtx) { BgJyaLift_InitDynapoly(this, globalCtx, &D_0600D7E8, 0); Actor_ProcessInitChain(thisx, sInitChain); if (Flags_GetSwitch(globalCtx, (thisx->params & 0x3F))) { - BgJyaLift_SetFinalPosY(thisx); + BgJyaLift_SetFinalPosY(this); } else { - BgJyaLift_SetInitPosY(thisx); + BgJyaLift_SetInitPosY(this); } thisx->room = -1; - D_8089A020 = 1; + sIsSpawned = true; this->unk_16A = 1; } @@ -85,7 +85,7 @@ void BgJyaLift_Destroy(Actor* thisx, GlobalContext* globalCtx) { // Goddess Lift DT osSyncPrintf("女神リフト DT\n"); - D_8089A020 = 0; + sIsSpawned = false; DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } } @@ -138,7 +138,7 @@ void BgJyaLift_Update(Actor* thisx, GlobalContext* globalCtx) { GlobalContext* globalCtx2 = globalCtx; if (this->actionFunc != NULL) { - this->actionFunc(this); + this->actionFunc(this, globalCtx); } if ((this->dyna.unk_160 & 4) && ((this->unk_16B & 4) == 0)) { Camera_ChangeSetting(globalCtx2->cameraPtrs[0], CAM_SET_TEPPEN); diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h index 6fc9b52aa5..78dfc03759 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h @@ -5,7 +5,7 @@ #include "global.h" struct BgJyaLift; -typedef void (*BgJyaLiftActionFunc)(struct BgJyaLift*); +typedef void (*BgJyaLiftActionFunc)(struct BgJyaLift*, GlobalContext*); typedef struct BgJyaLift { /* 0x000 */ DynaPolyActor dyna; diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 5cc513f853..5771894599 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -18,7 +18,7 @@ void func_808A2008(BgMoriElevator* this, GlobalContext* globalCtx); void BgMoriElevator_MoveIntoGround(BgMoriElevator* this, GlobalContext* globalCtx); void BgMoriElevator_MoveAboveGround(BgMoriElevator* this, GlobalContext* globalCtx); -static s16 sIsSpawned = 0; +static s16 sIsSpawned = false; const ActorInit Bg_Mori_Elevator_InitVars = { ACTOR_BG_MORI_ELEVATOR, @@ -99,10 +99,10 @@ void BgMoriElevator_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("Error : 森の神殿 obj elevator バンク危険!(%s %d)\n", "../z_bg_mori_elevator.c", 277); } else { switch (sIsSpawned) { - case 0: + case false: // Forest Temple elevator CT osSyncPrintf("森の神殿 elevator CT\n"); - sIsSpawned = 1; + sIsSpawned = true; this->dyna.actor.room = -1; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyInfo_SetActorMove(&this->dyna, DPM_PLAYER); @@ -111,7 +111,7 @@ void BgMoriElevator_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, localConst); BgMoriElevator_SetupWaitAfterInit(this); break; - case 1: + case true: Actor_Kill(thisx); break; } @@ -125,7 +125,7 @@ void BgMoriElevator_Destroy(Actor* thisx, GlobalContext* globalCtx) { // Forest Temple elevator DT osSyncPrintf("森の神殿 elevator DT\n"); DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); - sIsSpawned = 0; + sIsSpawned = false; } } diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h index 3b79053c0a..d55593cce6 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h @@ -6,7 +6,7 @@ struct BgMoriElevator; -typedef void (*BgMoriElevatorActionFunc)(struct BgMoriElevator*, struct GlobalCtx*); +typedef void (*BgMoriElevatorActionFunc)(struct BgMoriElevator*, GlobalContext*); typedef struct BgMoriElevator { /* 0x0000 */ DynaPolyActor dyna; diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index 25b29caa95..510f2e8fd3 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -22,7 +22,7 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, GlobalContext* globalCtx); extern Gfx D_060049D0[]; -static s16 sAlreadyLoaded = false; +static s16 sIsSpawned = false; const ActorInit Bg_Mori_Idomizu_InitVars = { ACTOR_BG_MORI_IDOMIZU, @@ -52,7 +52,7 @@ void BgMoriIdomizu_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgMoriIdomizu* this = THIS; - if (sAlreadyLoaded) { + if (sIsSpawned) { Actor_Kill(&this->actor); return; } @@ -78,7 +78,7 @@ void BgMoriIdomizu_Init(Actor* thisx, GlobalContext* globalCtx) { return; } BgMoriIdomizu_SetupWaitForMoriTex(this); - sAlreadyLoaded = true; + sIsSpawned = true; this->isLoaded = true; this->actor.room = -1; // Forest Temple well water @@ -90,7 +90,7 @@ void BgMoriIdomizu_Destroy(Actor* thisx, GlobalContext* globalCtx) { BgMoriIdomizu* this = THIS; if (this->isLoaded) { - sAlreadyLoaded = false; + sIsSpawned = false; } }