From 4c8ed0e328d374376aee322b6d9d472e6dc64a11 Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Wed, 22 Jul 2020 03:48:31 -0400 Subject: [PATCH] Bg jya1flift (#269) * Update ZAP2 * BgJya1flift progress * BgJya1flift Progress * Rename unknown variables * BgJya1flift Progress * Finish Decomp for BgJya1flift FInished decomp and added missing functions to functions.h * Fix struct padding * PR fixes * PR fixes * Pr Fixes --- .../ovl_Bg_Jya_1flift/BgJya1flift_Destroy.s | 25 --- .../ovl_Bg_Jya_1flift/BgJya1flift_Draw.s | 16 -- .../ovl_Bg_Jya_1flift/BgJya1flift_Init.s | 88 --------- .../ovl_Bg_Jya_1flift/BgJya1flift_Update.s | 82 -------- .../actors/ovl_Bg_Jya_1flift/func_80892B60.s | 50 ----- .../actors/ovl_Bg_Jya_1flift/func_80892BE8.s | 25 --- .../actors/ovl_Bg_Jya_1flift/func_80892DB0.s | 8 - .../actors/ovl_Bg_Jya_1flift/func_80892DCC.s | 19 -- .../actors/ovl_Bg_Jya_1flift/func_80892E0C.s | 8 - .../actors/ovl_Bg_Jya_1flift/func_80892E28.s | 4 - .../actors/ovl_Bg_Jya_1flift/func_80892E34.s | 10 - .../actors/ovl_Bg_Jya_1flift/func_80892E58.s | 69 ------- .../actors/ovl_Bg_Jya_1flift/func_80892F3C.s | 6 - .../actors/ovl_Bg_Jya_1flift/func_80892F50.s | 18 -- data/overlays/actors/z_bg_jya_1flift.data.s | 26 --- data/overlays/actors/z_bg_jya_1flift.reloc.s | 13 -- include/functions.h | 5 +- spec | 3 +- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.c | 181 ++++++++++++++++-- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.h | 11 +- undefined_syms.txt | 4 + 21 files changed, 181 insertions(+), 490 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892B60.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892BE8.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DB0.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DCC.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E0C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E28.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E34.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E58.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F3C.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F50.s delete mode 100644 data/overlays/actors/z_bg_jya_1flift.data.s delete mode 100644 data/overlays/actors/z_bg_jya_1flift.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Destroy.s deleted file mode 100644 index 1fd9cc4393..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Destroy.s +++ /dev/null @@ -1,25 +0,0 @@ -glabel BgJya1flift_Destroy -/* 001FC 80892D5C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00200 80892D60 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00204 80892D64 AFA5001C */ sw $a1, 0x001C($sp) -/* 00208 80892D68 908E01B7 */ lbu $t6, 0x01B7($a0) ## 000001B7 -/* 0020C 80892D6C 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 00210 80892D70 3C018089 */ lui $at, %hi(D_808930E0) ## $at = 80890000 -/* 00214 80892D74 11C0000A */ beq $t6, $zero, .L80892DA0 -/* 00218 80892D78 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 0021C 80892D7C A02030E0 */ sb $zero, %lo(D_808930E0)($at) -/* 00220 80892D80 24E50164 */ addiu $a1, $a3, 0x0164 ## $a1 = 00000164 -/* 00224 80892D84 0C0170EB */ jal Collider_DestroyCylinder - -/* 00228 80892D88 AFA70018 */ sw $a3, 0x0018($sp) -/* 0022C 80892D8C 8FA4001C */ lw $a0, 0x001C($sp) -/* 00230 80892D90 8FA70018 */ lw $a3, 0x0018($sp) -/* 00234 80892D94 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 00238 80892D98 0C00FB56 */ jal DynaPolyInfo_Free - ## DynaPolyInfo_delReserve -/* 0023C 80892D9C 8CE6014C */ lw $a2, 0x014C($a3) ## 0000014C -.L80892DA0: -/* 00240 80892DA0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00244 80892DA4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00248 80892DA8 03E00008 */ jr $ra -/* 0024C 80892DAC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Draw.s deleted file mode 100644 index 4d8b7acbc0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Draw.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel BgJya1flift_Draw -/* 00548 808930A8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0054C 808930AC AFA40018 */ sw $a0, 0x0018($sp) -/* 00550 808930B0 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00554 808930B4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00558 808930B8 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 0055C 808930BC 0C00D498 */ jal Gfx_DrawDListOpa - -/* 00560 808930C0 24A501F0 */ addiu $a1, $a1, 0x01F0 ## $a1 = 060001F0 -/* 00564 808930C4 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00568 808930C8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0056C 808930CC 03E00008 */ jr $ra -/* 00570 808930D0 00000000 */ nop -/* 00574 808930D4 00000000 */ nop -/* 00578 808930D8 00000000 */ nop -/* 0057C 808930DC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Init.s deleted file mode 100644 index 96effe8ce3..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Init.s +++ /dev/null @@ -1,88 +0,0 @@ -.rdata -glabel D_808931A8 - .asciz "(1Fリフト)(flag %d)(room %d)\n" - .balign 4 - -.text -glabel BgJya1flift_Init -/* 000E0 80892C40 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 000E4 80892C44 AFA50024 */ sw $a1, 0x0024($sp) -/* 000E8 80892C48 8FAE0024 */ lw $t6, 0x0024($sp) -/* 000EC 80892C4C AFB00018 */ sw $s0, 0x0018($sp) -/* 000F0 80892C50 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 000F4 80892C54 3C060001 */ lui $a2, 0x0001 ## $a2 = 00010000 -/* 000F8 80892C58 AFBF001C */ sw $ra, 0x001C($sp) -/* 000FC 80892C5C 3C048089 */ lui $a0, %hi(D_808931A8) ## $a0 = 80890000 -/* 00100 80892C60 3C058089 */ lui $a1, %hi(D_808930E0) ## $a1 = 80890000 -/* 00104 80892C64 00CE3021 */ addu $a2, $a2, $t6 -/* 00108 80892C68 80C61CBC */ lb $a2, 0x1CBC($a2) ## 00011CBC -/* 0010C 80892C6C 90A530E0 */ lbu $a1, %lo(D_808930E0)($a1) -/* 00110 80892C70 0C00084C */ jal osSyncPrintf - -/* 00114 80892C74 248431A8 */ addiu $a0, $a0, %lo(D_808931A8) ## $a0 = 808931A8 -/* 00118 80892C78 A20001B7 */ sb $zero, 0x01B7($s0) ## 000001B7 -/* 0011C 80892C7C 3C0F8089 */ lui $t7, %hi(D_808930E0) ## $t7 = 80890000 -/* 00120 80892C80 91EF30E0 */ lbu $t7, %lo(D_808930E0)($t7) -/* 00124 80892C84 8FA50024 */ lw $a1, 0x0024($sp) -/* 00128 80892C88 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0012C 80892C8C 11E00005 */ beq $t7, $zero, .L80892CA4 -/* 00130 80892C90 3C060600 */ lui $a2, 0x0600 ## $a2 = 06000000 -/* 00134 80892C94 0C00B55C */ jal Actor_Kill - -/* 00138 80892C98 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0013C 80892C9C 1000002B */ beq $zero, $zero, .L80892D4C -/* 00140 80892CA0 8FBF001C */ lw $ra, 0x001C($sp) -.L80892CA4: -/* 00144 80892CA4 24C604A8 */ addiu $a2, $a2, 0x04A8 ## $a2 = 000004A8 -/* 00148 80892CA8 0C224AD8 */ jal func_80892B60 -/* 0014C 80892CAC 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00150 80892CB0 3C058089 */ lui $a1, %hi(D_80893138) ## $a1 = 80890000 -/* 00154 80892CB4 24A53138 */ addiu $a1, $a1, %lo(D_80893138) ## $a1 = 80893138 -/* 00158 80892CB8 0C01E037 */ jal Actor_ProcessInitChain - -/* 0015C 80892CBC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00160 80892CC0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00164 80892CC4 0C224AFA */ jal func_80892BE8 -/* 00168 80892CC8 8FA50024 */ lw $a1, 0x0024($sp) -/* 0016C 80892CCC 8605001C */ lh $a1, 0x001C($s0) ## 0000001C -/* 00170 80892CD0 8FA40024 */ lw $a0, 0x0024($sp) -/* 00174 80892CD4 0C00B2D0 */ jal Flags_GetSwitch - -/* 00178 80892CD8 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 0017C 80892CDC 10400012 */ beq $v0, $zero, .L80892D28 -/* 00180 80892CE0 3C188016 */ lui $t8, %hi(gSaveContext+4) -/* 00184 80892CE4 8F18E664 */ lw $t8, %lo(gSaveContext+4)($t8) -/* 00188 80892CE8 24010011 */ addiu $at, $zero, 0x0011 ## $at = 00000011 -/* 0018C 80892CEC 24020011 */ addiu $v0, $zero, 0x0011 ## $v0 = 00000011 -/* 00190 80892CF0 13000003 */ beq $t8, $zero, .L80892D00 -/* 00194 80892CF4 00000000 */ nop -/* 00198 80892CF8 10000001 */ beq $zero, $zero, .L80892D00 -/* 0019C 80892CFC 24020005 */ addiu $v0, $zero, 0x0005 ## $v0 = 00000005 -.L80892D00: -/* 001A0 80892D00 14410005 */ bne $v0, $at, .L80892D18 -/* 001A4 80892D04 00000000 */ nop -/* 001A8 80892D08 0C224B8D */ jal func_80892E34 -/* 001AC 80892D0C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001B0 80892D10 10000008 */ beq $zero, $zero, .L80892D34 -/* 001B4 80892D14 2419FFFF */ addiu $t9, $zero, 0xFFFF ## $t9 = FFFFFFFF -.L80892D18: -/* 001B8 80892D18 0C224B83 */ jal func_80892E0C -/* 001BC 80892D1C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001C0 80892D20 10000004 */ beq $zero, $zero, .L80892D34 -/* 001C4 80892D24 2419FFFF */ addiu $t9, $zero, 0xFFFF ## $t9 = FFFFFFFF -.L80892D28: -/* 001C8 80892D28 0C224B6C */ jal func_80892DB0 -/* 001CC 80892D2C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001D0 80892D30 2419FFFF */ addiu $t9, $zero, 0xFFFF ## $t9 = FFFFFFFF -.L80892D34: -/* 001D4 80892D34 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 001D8 80892D38 A2190003 */ sb $t9, 0x0003($s0) ## 00000003 -/* 001DC 80892D3C 3C018089 */ lui $at, %hi(D_808930E0) ## $at = 80890000 -/* 001E0 80892D40 A02230E0 */ sb $v0, %lo(D_808930E0)($at) -/* 001E4 80892D44 A20201B7 */ sb $v0, 0x01B7($s0) ## 000001B7 -/* 001E8 80892D48 8FBF001C */ lw $ra, 0x001C($sp) -.L80892D4C: -/* 001EC 80892D4C 8FB00018 */ lw $s0, 0x0018($sp) -/* 001F0 80892D50 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 001F4 80892D54 03E00008 */ jr $ra -/* 001F8 80892D58 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Update.s deleted file mode 100644 index 6dedeb91b6..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Update.s +++ /dev/null @@ -1,82 +0,0 @@ -glabel BgJya1flift_Update -/* 00430 80892F90 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 00434 80892F94 3C020001 */ lui $v0, 0x0001 ## $v0 = 00010000 -/* 00438 80892F98 AFBF001C */ sw $ra, 0x001C($sp) -/* 0043C 80892F9C AFB10018 */ sw $s1, 0x0018($sp) -/* 00440 80892FA0 AFB00014 */ sw $s0, 0x0014($sp) -/* 00444 80892FA4 00451021 */ addu $v0, $v0, $a1 -/* 00448 80892FA8 80421CBC */ lb $v0, 0x1CBC($v0) ## 00011CBC -/* 0044C 80892FAC 24010006 */ addiu $at, $zero, 0x0006 ## $at = 00000006 -/* 00450 80892FB0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00454 80892FB4 10410003 */ beq $v0, $at, .L80892FC4 -/* 00458 80892FB8 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 0045C 80892FBC 14400033 */ bne $v0, $zero, .L8089308C -/* 00460 80892FC0 00000000 */ nop -.L80892FC4: -/* 00464 80892FC4 8E1901B0 */ lw $t9, 0x01B0($s0) ## 000001B0 -/* 00468 80892FC8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0046C 80892FCC 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 00470 80892FD0 0320F809 */ jalr $ra, $t9 -/* 00474 80892FD4 00000000 */ nop -/* 00478 80892FD8 0C010D5B */ jal func_8004356C -/* 0047C 80892FDC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00480 80892FE0 10400003 */ beq $v0, $zero, .L80892FF0 -/* 00484 80892FE4 00001825 */ or $v1, $zero, $zero ## $v1 = 00000000 -/* 00488 80892FE8 10000001 */ beq $zero, $zero, .L80892FF0 -/* 0048C 80892FEC 24030001 */ addiu $v1, $zero, 0x0001 ## $v1 = 00000001 -.L80892FF0: -/* 00490 80892FF0 8E0201B0 */ lw $v0, 0x01B0($s0) ## 000001B0 -/* 00494 80892FF4 3C0E8089 */ lui $t6, %hi(func_80892E58) ## $t6 = 80890000 -/* 00498 80892FF8 25CE2E58 */ addiu $t6, $t6, %lo(func_80892E58) ## $t6 = 80892E58 -/* 0049C 80892FFC 11C20004 */ beq $t6, $v0, .L80893010 -/* 004A0 80893000 3C0F8089 */ lui $t7, %hi(func_80892F50) ## $t7 = 80890000 -/* 004A4 80893004 25EF2F50 */ addiu $t7, $t7, %lo(func_80892F50) ## $t7 = 80892F50 -/* 004A8 80893008 55E20013 */ bnel $t7, $v0, .L80893058 -/* 004AC 8089300C A20301B8 */ sb $v1, 0x01B8($s0) ## 000001B8 -.L80893010: -/* 004B0 80893010 10600006 */ beq $v1, $zero, .L8089302C -/* 004B4 80893014 24050030 */ addiu $a1, $zero, 0x0030 ## $a1 = 00000030 -/* 004B8 80893018 8E240790 */ lw $a0, 0x0790($s1) ## 00000790 -/* 004BC 8089301C 0C0169DF */ jal func_8005A77C -/* 004C0 80893020 AFA30024 */ sw $v1, 0x0024($sp) -/* 004C4 80893024 1000000B */ beq $zero, $zero, .L80893054 -/* 004C8 80893028 8FA30024 */ lw $v1, 0x0024($sp) -.L8089302C: -/* 004CC 8089302C 5460000A */ bnel $v1, $zero, .L80893058 -/* 004D0 80893030 A20301B8 */ sb $v1, 0x01B8($s0) ## 000001B8 -/* 004D4 80893034 921801B8 */ lbu $t8, 0x01B8($s0) ## 000001B8 -/* 004D8 80893038 24050003 */ addiu $a1, $zero, 0x0003 ## $a1 = 00000003 -/* 004DC 8089303C 53000006 */ beql $t8, $zero, .L80893058 -/* 004E0 80893040 A20301B8 */ sb $v1, 0x01B8($s0) ## 000001B8 -/* 004E4 80893044 8E240790 */ lw $a0, 0x0790($s1) ## 00000790 -/* 004E8 80893048 0C0169DF */ jal func_8005A77C -/* 004EC 8089304C AFA30024 */ sw $v1, 0x0024($sp) -/* 004F0 80893050 8FA30024 */ lw $v1, 0x0024($sp) -.L80893054: -/* 004F4 80893054 A20301B8 */ sb $v1, 0x01B8($s0) ## 000001B8 -.L80893058: -/* 004F8 80893058 26060164 */ addiu $a2, $s0, 0x0164 ## $a2 = 00000164 -/* 004FC 8089305C 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000164 -/* 00500 80893060 AFA60020 */ sw $a2, 0x0020($sp) -/* 00504 80893064 0C0189B7 */ jal Collider_CylinderUpdate - -/* 00508 80893068 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0050C 8089306C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00510 80893070 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 00514 80893074 8FA60020 */ lw $a2, 0x0020($sp) -/* 00518 80893078 02212821 */ addu $a1, $s1, $at -/* 0051C 8089307C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT -/* 00520 80893080 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00524 80893084 10000004 */ beq $zero, $zero, .L80893098 -/* 00528 80893088 8FBF001C */ lw $ra, 0x001C($sp) -.L8089308C: -/* 0052C 8089308C 0C00B55C */ jal Actor_Kill - -/* 00530 80893090 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00534 80893094 8FBF001C */ lw $ra, 0x001C($sp) -.L80893098: -/* 00538 80893098 8FB00014 */ lw $s0, 0x0014($sp) -/* 0053C 8089309C 8FB10018 */ lw $s1, 0x0018($sp) -/* 00540 808930A0 03E00008 */ jr $ra -/* 00544 808930A4 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892B60.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892B60.s deleted file mode 100644 index 9cb9f5bb37..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892B60.s +++ /dev/null @@ -1,50 +0,0 @@ -.rdata -glabel D_80893150 - .asciz "Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n" - .balign 4 - -glabel D_80893190 - .asciz "../z_bg_jya_1flift.c" - .balign 4 - -.text -glabel func_80892B60 -/* 00000 80892B60 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 00004 80892B64 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00008 80892B68 AFB00020 */ sw $s0, 0x0020($sp) -/* 0000C 80892B6C AFA5003C */ sw $a1, 0x003C($sp) -/* 00010 80892B70 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00014 80892B74 AFA60040 */ sw $a2, 0x0040($sp) -/* 00018 80892B78 AFA00030 */ sw $zero, 0x0030($sp) -/* 0001C 80892B7C 0C010D20 */ jal DynaPolyInfo_SetActorMove - -/* 00020 80892B80 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 -/* 00024 80892B84 8FA40040 */ lw $a0, 0x0040($sp) -/* 00028 80892B88 0C010620 */ jal DynaPolyInfo_Alloc - -/* 0002C 80892B8C 27A50030 */ addiu $a1, $sp, 0x0030 ## $a1 = FFFFFFF8 -/* 00030 80892B90 8FA4003C */ lw $a0, 0x003C($sp) -/* 00034 80892B94 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00038 80892B98 8FA70030 */ lw $a3, 0x0030($sp) -/* 0003C 80892B9C 0C00FA9D */ jal DynaPolyInfo_RegisterActor - ## DynaPolyInfo_setActor -/* 00040 80892BA0 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 00044 80892BA4 24010032 */ addiu $at, $zero, 0x0032 ## $at = 00000032 -/* 00048 80892BA8 1441000A */ bne $v0, $at, .L80892BD4 -/* 0004C 80892BAC AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 00050 80892BB0 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 00054 80892BB4 3C048089 */ lui $a0, %hi(D_80893150) ## $a0 = 80890000 -/* 00058 80892BB8 3C058089 */ lui $a1, %hi(D_80893190) ## $a1 = 80890000 -/* 0005C 80892BBC 86070000 */ lh $a3, 0x0000($s0) ## 00000000 -/* 00060 80892BC0 24A53190 */ addiu $a1, $a1, %lo(D_80893190) ## $a1 = 80893190 -/* 00064 80892BC4 24843150 */ addiu $a0, $a0, %lo(D_80893150) ## $a0 = 80893150 -/* 00068 80892BC8 240600B3 */ addiu $a2, $zero, 0x00B3 ## $a2 = 000000B3 -/* 0006C 80892BCC 0C00084C */ jal osSyncPrintf - -/* 00070 80892BD0 AFAE0010 */ sw $t6, 0x0010($sp) -.L80892BD4: -/* 00074 80892BD4 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00078 80892BD8 8FB00020 */ lw $s0, 0x0020($sp) -/* 0007C 80892BDC 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 00080 80892BE0 03E00008 */ jr $ra -/* 00084 80892BE4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892BE8.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892BE8.s deleted file mode 100644 index d9cefdd6f1..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892BE8.s +++ /dev/null @@ -1,25 +0,0 @@ -glabel func_80892BE8 -/* 00088 80892BE8 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 0008C 80892BEC AFA40020 */ sw $a0, 0x0020($sp) -/* 00090 80892BF0 AFA50024 */ sw $a1, 0x0024($sp) -/* 00094 80892BF4 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00098 80892BF8 8FA50020 */ lw $a1, 0x0020($sp) -/* 0009C 80892BFC AFBF0014 */ sw $ra, 0x0014($sp) -/* 000A0 80892C00 24A50164 */ addiu $a1, $a1, 0x0164 ## $a1 = 00000164 -/* 000A4 80892C04 0C0170D9 */ jal Collider_InitCylinder - -/* 000A8 80892C08 AFA50018 */ sw $a1, 0x0018($sp) -/* 000AC 80892C0C 3C078089 */ lui $a3, %hi(D_80893104) ## $a3 = 80890000 -/* 000B0 80892C10 8FA50018 */ lw $a1, 0x0018($sp) -/* 000B4 80892C14 8FA60020 */ lw $a2, 0x0020($sp) -/* 000B8 80892C18 24E73104 */ addiu $a3, $a3, %lo(D_80893104) ## $a3 = 80893104 -/* 000BC 80892C1C 0C01712B */ jal Collider_SetCylinder - -/* 000C0 80892C20 8FA40024 */ lw $a0, 0x0024($sp) -/* 000C4 80892C24 8FAF0020 */ lw $t7, 0x0020($sp) -/* 000C8 80892C28 240E00FF */ addiu $t6, $zero, 0x00FF ## $t6 = 000000FF -/* 000CC 80892C2C A1EE00AE */ sb $t6, 0x00AE($t7) ## 000000AE -/* 000D0 80892C30 8FBF0014 */ lw $ra, 0x0014($sp) -/* 000D4 80892C34 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 000D8 80892C38 03E00008 */ jr $ra -/* 000DC 80892C3C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DB0.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DB0.s deleted file mode 100644 index 1ce4e4e90d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DB0.s +++ /dev/null @@ -1,8 +0,0 @@ -glabel func_80892DB0 -/* 00250 80892DB0 3C0E8089 */ lui $t6, %hi(func_80892DCC) ## $t6 = 80890000 -/* 00254 80892DB4 25CE2DCC */ addiu $t6, $t6, %lo(func_80892DCC) ## $t6 = 80892DCC -/* 00258 80892DB8 AC8E01B0 */ sw $t6, 0x01B0($a0) ## 000001B0 -/* 0025C 80892DBC 3C018089 */ lui $at, %hi(D_80893130) ## $at = 80890000 -/* 00260 80892DC0 C4243130 */ lwc1 $f4, %lo(D_80893130)($at) -/* 00264 80892DC4 03E00008 */ jr $ra -/* 00268 80892DC8 E4840028 */ swc1 $f4, 0x0028($a0) ## 00000028 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DCC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DCC.s deleted file mode 100644 index 0a842741b1..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DCC.s +++ /dev/null @@ -1,19 +0,0 @@ -glabel func_80892DCC -/* 0026C 80892DCC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00270 80892DD0 AFA40018 */ sw $a0, 0x0018($sp) -/* 00274 80892DD4 8FAE0018 */ lw $t6, 0x0018($sp) -/* 00278 80892DD8 AFBF0014 */ sw $ra, 0x0014($sp) -/* 0027C 80892DDC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00280 80892DE0 85C5001C */ lh $a1, 0x001C($t6) ## 0000001C -/* 00284 80892DE4 0C00B2D0 */ jal Flags_GetSwitch - -/* 00288 80892DE8 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 0028C 80892DEC 50400004 */ beql $v0, $zero, .L80892E00 -/* 00290 80892DF0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00294 80892DF4 0C224B8D */ jal func_80892E34 -/* 00298 80892DF8 8FA40018 */ lw $a0, 0x0018($sp) -/* 0029C 80892DFC 8FBF0014 */ lw $ra, 0x0014($sp) -.L80892E00: -/* 002A0 80892E00 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 002A4 80892E04 03E00008 */ jr $ra -/* 002A8 80892E08 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E0C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E0C.s deleted file mode 100644 index 5b9d7d1ee0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E0C.s +++ /dev/null @@ -1,8 +0,0 @@ -glabel func_80892E0C -/* 002AC 80892E0C 3C0E8089 */ lui $t6, %hi(func_80892E28) ## $t6 = 80890000 -/* 002B0 80892E10 25CE2E28 */ addiu $t6, $t6, %lo(func_80892E28) ## $t6 = 80892E28 -/* 002B4 80892E14 AC8E01B0 */ sw $t6, 0x01B0($a0) ## 000001B0 -/* 002B8 80892E18 3C018089 */ lui $at, %hi(D_80893130) ## $at = 80890000 -/* 002BC 80892E1C C4243130 */ lwc1 $f4, %lo(D_80893130)($at) -/* 002C0 80892E20 03E00008 */ jr $ra -/* 002C4 80892E24 E4840028 */ swc1 $f4, 0x0028($a0) ## 00000028 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E28.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E28.s deleted file mode 100644 index dbf8fd784e..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E28.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel func_80892E28 -/* 002C8 80892E28 AFA40000 */ sw $a0, 0x0000($sp) -/* 002CC 80892E2C 03E00008 */ jr $ra -/* 002D0 80892E30 AFA50004 */ sw $a1, 0x0004($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E34.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E34.s deleted file mode 100644 index d921d3c31d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E34.s +++ /dev/null @@ -1,10 +0,0 @@ -glabel func_80892E34 -/* 002D4 80892E34 908F01B6 */ lbu $t7, 0x01B6($a0) ## 000001B6 -/* 002D8 80892E38 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 002DC 80892E3C 3C0E8089 */ lui $t6, %hi(func_80892E58) ## $t6 = 80890000 -/* 002E0 80892E40 25CE2E58 */ addiu $t6, $t6, %lo(func_80892E58) ## $t6 = 80892E58 -/* 002E4 80892E44 39F80001 */ xori $t8, $t7, 0x0001 ## $t8 = 00000001 -/* 002E8 80892E48 AC8E01B0 */ sw $t6, 0x01B0($a0) ## 000001B0 -/* 002EC 80892E4C A09801B6 */ sb $t8, 0x01B6($a0) ## 000001B6 -/* 002F0 80892E50 03E00008 */ jr $ra -/* 002F4 80892E54 E4840060 */ swc1 $f4, 0x0060($a0) ## 00000060 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E58.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E58.s deleted file mode 100644 index 5a3f8d01a1..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E58.s +++ /dev/null @@ -1,69 +0,0 @@ -.late_rodata -glabel D_808931C8 - .float 0.001 - -.text -glabel func_80892E58 -/* 002F8 80892E58 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 002FC 80892E5C AFB00020 */ sw $s0, 0x0020($sp) -/* 00300 80892E60 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00304 80892E64 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00308 80892E68 AFA5002C */ sw $a1, 0x002C($sp) -/* 0030C 80892E6C 3C063ECC */ lui $a2, 0x3ECC ## $a2 = 3ECC0000 -/* 00310 80892E70 34C6CCCD */ ori $a2, $a2, 0xCCCD ## $a2 = 3ECCCCCD -/* 00314 80892E74 3C0540C0 */ lui $a1, 0x40C0 ## $a1 = 40C00000 -/* 00318 80892E78 0C01DE80 */ jal Math_ApproxF - -/* 0031C 80892E7C 24840060 */ addiu $a0, $a0, 0x0060 ## $a0 = 00000060 -/* 00320 80892E80 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 00324 80892E84 44816000 */ mtc1 $at, $f12 ## $f12 = 1.00 -/* 00328 80892E88 C6000060 */ lwc1 $f0, 0x0060($s0) ## 00000060 -/* 0032C 80892E8C 26040028 */ addiu $a0, $s0, 0x0028 ## $a0 = 00000028 -/* 00330 80892E90 3C058089 */ lui $a1, %hi(D_80893130) ## $a1 = 80890000 -/* 00334 80892E94 460C003C */ c.lt.s $f0, $f12 -/* 00338 80892E98 3C063F00 */ lui $a2, 0x3F00 ## $a2 = 3F000000 -/* 0033C 80892E9C 45020004 */ bc1fl .L80892EB0 -/* 00340 80892EA0 46000086 */ mov.s $f2, $f0 -/* 00344 80892EA4 10000002 */ beq $zero, $zero, .L80892EB0 -/* 00348 80892EA8 46006086 */ mov.s $f2, $f12 -/* 0034C 80892EAC 46000086 */ mov.s $f2, $f0 -.L80892EB0: -/* 00350 80892EB0 920E01B6 */ lbu $t6, 0x01B6($s0) ## 000001B6 -/* 00354 80892EB4 44071000 */ mfc1 $a3, $f2 -/* 00358 80892EB8 E7AC0010 */ swc1 $f12, 0x0010($sp) -/* 0035C 80892EBC 000E7880 */ sll $t7, $t6, 2 -/* 00360 80892EC0 00AF2821 */ addu $a1, $a1, $t7 -/* 00364 80892EC4 0C01E0C4 */ jal Math_SmoothScaleMaxMinF - -/* 00368 80892EC8 8CA53130 */ lw $a1, %lo(D_80893130)($a1) -/* 0036C 80892ECC 3C018089 */ lui $at, %hi(D_808931C8) ## $at = 80890000 -/* 00370 80892ED0 C42431C8 */ lwc1 $f4, %lo(D_808931C8)($at) -/* 00374 80892ED4 46000005 */ abs.s $f0, $f0 -/* 00378 80892ED8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0037C 80892EDC 4604003C */ c.lt.s $f0, $f4 -/* 00380 80892EE0 00000000 */ nop -/* 00384 80892EE4 4500000E */ bc1f .L80892F20 -/* 00388 80892EE8 00000000 */ nop -/* 0038C 80892EEC 921801B6 */ lbu $t8, 0x01B6($s0) ## 000001B6 -/* 00390 80892EF0 3C018089 */ lui $at, %hi(D_80893130) ## $at = 80890000 -/* 00394 80892EF4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00398 80892EF8 0018C880 */ sll $t9, $t8, 2 -/* 0039C 80892EFC 00390821 */ addu $at, $at, $t9 -/* 003A0 80892F00 C4263130 */ lwc1 $f6, %lo(D_80893130)($at) -/* 003A4 80892F04 0C224BCF */ jal func_80892F3C -/* 003A8 80892F08 E6060028 */ swc1 $f6, 0x0028($s0) ## 00000028 -/* 003AC 80892F0C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 003B0 80892F10 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 003B4 80892F14 24052835 */ addiu $a1, $zero, 0x2835 ## $a1 = 00002835 -/* 003B8 80892F18 10000004 */ beq $zero, $zero, .L80892F2C -/* 003BC 80892F1C 8FBF0024 */ lw $ra, 0x0024($sp) -.L80892F20: -/* 003C0 80892F20 0C00BE5D */ jal func_8002F974 -/* 003C4 80892F24 240520B9 */ addiu $a1, $zero, 0x20B9 ## $a1 = 000020B9 -/* 003C8 80892F28 8FBF0024 */ lw $ra, 0x0024($sp) -.L80892F2C: -/* 003CC 80892F2C 8FB00020 */ lw $s0, 0x0020($sp) -/* 003D0 80892F30 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 003D4 80892F34 03E00008 */ jr $ra -/* 003D8 80892F38 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F3C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F3C.s deleted file mode 100644 index 10e299a8e4..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F3C.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel func_80892F3C -/* 003DC 80892F3C 3C0E8089 */ lui $t6, %hi(func_80892F50) ## $t6 = 80890000 -/* 003E0 80892F40 25CE2F50 */ addiu $t6, $t6, %lo(func_80892F50) ## $t6 = 80892F50 -/* 003E4 80892F44 AC8E01B0 */ sw $t6, 0x01B0($a0) ## 000001B0 -/* 003E8 80892F48 03E00008 */ jr $ra -/* 003EC 80892F4C A48001B4 */ sh $zero, 0x01B4($a0) ## 000001B4 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F50.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F50.s deleted file mode 100644 index bb08ee2dfb..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F50.s +++ /dev/null @@ -1,18 +0,0 @@ -glabel func_80892F50 -/* 003F0 80892F50 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 003F4 80892F54 AFBF0014 */ sw $ra, 0x0014($sp) -/* 003F8 80892F58 AFA5001C */ sw $a1, 0x001C($sp) -/* 003FC 80892F5C 848E01B4 */ lh $t6, 0x01B4($a0) ## 000001B4 -/* 00400 80892F60 25CF0001 */ addiu $t7, $t6, 0x0001 ## $t7 = 00000001 -/* 00404 80892F64 A48F01B4 */ sh $t7, 0x01B4($a0) ## 000001B4 -/* 00408 80892F68 849801B4 */ lh $t8, 0x01B4($a0) ## 000001B4 -/* 0040C 80892F6C 2B010015 */ slti $at, $t8, 0x0015 -/* 00410 80892F70 54200004 */ bnel $at, $zero, .L80892F84 -/* 00414 80892F74 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00418 80892F78 0C224B8D */ jal func_80892E34 -/* 0041C 80892F7C 00000000 */ nop -/* 00420 80892F80 8FBF0014 */ lw $ra, 0x0014($sp) -.L80892F84: -/* 00424 80892F84 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00428 80892F88 03E00008 */ jr $ra -/* 0042C 80892F8C 00000000 */ nop diff --git a/data/overlays/actors/z_bg_jya_1flift.data.s b/data/overlays/actors/z_bg_jya_1flift.data.s deleted file mode 100644 index 955bb633dd..0000000000 --- a/data/overlays/actors/z_bg_jya_1flift.data.s +++ /dev/null @@ -1,26 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purpose registers - -.section .data - -.balign 16 - -glabel D_808930E0 - .word 0x00000000 -glabel Bg_Jya_1flift_InitVars - .word 0x018E0100, 0x00000010, 0x00F10000, 0x000001BC -.word BgJya1flift_Init -.word BgJya1flift_Destroy -.word BgJya1flift_Update -.word BgJya1flift_Draw -glabel D_80893104 - .word 0x0A000039, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00460050, 0xFFAE0000, 0x00000000 -glabel D_80893130 - .word 0x43DD8000, 0xC2480000 -glabel D_80893138 - .word 0xC8500064, 0xB0F404B0, 0xB0F80190, 0x30FC04B0, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_bg_jya_1flift.reloc.s b/data/overlays/actors/z_bg_jya_1flift.reloc.s deleted file mode 100644 index 7414843f71..0000000000 --- a/data/overlays/actors/z_bg_jya_1flift.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_808931D0 - .incbin "baserom/ovl_Bg_Jya_1flift", 0x670, 0x000000F0 diff --git a/include/functions.h b/include/functions.h index e6a59bde93..cd850336d9 100644 --- a/include/functions.h +++ b/include/functions.h @@ -615,9 +615,8 @@ void func_80042FC4(GlobalContext*, CollisionContext*); void DynaPolyInfo_SetActorMove(DynaPolyActor* actor, DynaPolyMoveFlag flags); void func_800434A0(DynaPolyActor* dynaActor); void func_800434A8(DynaPolyActor* actor); -// ? func_800434B8(?); -// ? func_800434F8(?); -void func_80043538(DynaPolyActor* actor); +void func_80043538(DynaPolyActor* dynaActor); +s32 func_8004356C(DynaPolyActor* dynaActor); f32 func_800437F0(f32, f32); // ? func_8004389C(?); // ? func_800438DC(?); diff --git a/spec b/spec index ac3ce8a26e..4617c6578c 100644 --- a/spec +++ b/spec @@ -965,8 +965,7 @@ endseg beginseg name "ovl_Bg_Jya_1flift" include "build/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.o" - include "build/data/overlays/actors/z_bg_jya_1flift.data.o" - include "build/data/overlays/actors/z_bg_jya_1flift.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Jya_1flift/ovl_Bg_Jya_1flift_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 3906aafd8a..b9542da5a4 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 @@ -1,3 +1,9 @@ +/* + * File: z_bg_jya_1flift.c + * Overlay: ovl_Bg_Jya_1flift + * Description: Shortcut Elevator used in the vanilla version of the Spirit Temple + */ + #include "z_bg_jya_1flift.h" #define FLAGS 0x00000010 @@ -9,7 +15,17 @@ void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgJya1flift_Update(Actor* thisx, GlobalContext* globalCtx); void BgJya1flift_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void func_80892DB0(BgJya1flift* this); +void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx); +void BgJya1flift_DoNothing(BgJya1flift* this, GlobalContext* globalCtx); +void BgJya1flift_ChangeDirection(BgJya1flift* this); +void BgJya1flift_Move(BgJya1flift* this, GlobalContext* globalCtx); +void func_80892E0C(BgJya1flift* this); +void BgJya1flift_ResetMoveDelay(BgJya1flift* this); +void BgJya1flift_DelayMove(BgJya1flift* this, GlobalContext* globalCtx); + +u8 sHasSpawned = false; + const ActorInit Bg_Jya_1flift_InitVars = { ACTOR_BG_JYA_1FLIFT, ACTORTYPE_BG, @@ -21,31 +37,164 @@ const ActorInit Bg_Jya_1flift_InitVars = { (ActorFunc)BgJya1flift_Update, (ActorFunc)BgJya1flift_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892B60.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892BE8.s") +static ColliderCylinderInit sCylinderInit = { + { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, + { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { 70, 80, -82, { 0, 0, 0 } }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Init.s") +f32 finalPositions[] = { 443.0f, -50.0f }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Destroy.s") +static InitChainEntry sInitChain[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneForward, 1200, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 1200, ICHAIN_STOP), +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DB0.s") +extern UNK_TYPE D_060004A8; +extern Gfx D_060001F0[]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892DCC.s") +void BgJya1flift_InitDynapoly(BgJya1flift* this, GlobalContext* globalCtx, UNK_PTR arg2, s32 moveFlag) { + s32 pad; + s32 localConst; + s32 pad2; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E0C.s") + localConst = 0; + DynaPolyInfo_SetActorMove(&this->dyna, moveFlag); + DynaPolyInfo_Alloc(arg2, &localConst); + this->dyna.dynaPolyId = + DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, localConst); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E28.s") + if (this->dyna.dynaPolyId == 0x32) { + // Warning : move BG login failed + osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_1flift.c", 0xB3, + this->dyna.actor.id, this->dyna.actor.params); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E34.s") +void BgJya1flift_InitCollision(Actor* thisx, GlobalContext* globalCtx) { + BgJya1flift* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892E58.s") + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); + this->dyna.actor.colChkInfo.mass = 0xFF; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F3C.s") +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); + this->hasInitialized = false; + if (sHasSpawned) { + Actor_Kill(thisx); + return; + } + BgJya1flift_InitDynapoly(this, globalCtx, &D_060004A8, 0); + Actor_ProcessInitChain(thisx, sInitChain); + BgJya1flift_InitCollision(thisx, globalCtx); + if (Flags_GetSwitch(globalCtx, (thisx->params & 0x3F))) { + LINK_AGE_IN_YEARS == YEARS_ADULT ? BgJya1flift_ChangeDirection(this) : func_80892E0C(this); + } else { + func_80892DB0(this); + } + thisx->room = -1; + sHasSpawned = true; + this->hasInitialized = true; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/func_80892F50.s") +void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgJya1flift* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Update.s") + if (this->hasInitialized) { + sHasSpawned = false; + Collider_DestroyCylinder(globalCtx, &this->collider); + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_1flift/BgJya1flift_Draw.s") +void func_80892DB0(BgJya1flift* this) { + this->actionFunc = func_80892DCC; + this->dyna.actor.posRot.pos.y = finalPositions[0]; +} + +void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx) { + if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x3F))) { + BgJya1flift_ChangeDirection(this); + } +} + +void func_80892E0C(BgJya1flift* this) { + this->actionFunc = BgJya1flift_DoNothing; + this->dyna.actor.posRot.pos.y = finalPositions[0]; +} + +void BgJya1flift_DoNothing(BgJya1flift* this, GlobalContext* globalCtx) { +} + +void BgJya1flift_ChangeDirection(BgJya1flift* this) { + this->actionFunc = BgJya1flift_Move; + this->isMovingDown ^= true; + this->dyna.actor.velocity.y = 0.0f; +} + +void BgJya1flift_Move(BgJya1flift* this, GlobalContext* globalCtx) { + f32 tempVelocity; + + Math_ApproxF(&this->dyna.actor.velocity.y, 6.0f, 0.4f); + if (this->dyna.actor.velocity.y < 1.0f) { + tempVelocity = 1.0f; + } else { + tempVelocity = this->dyna.actor.velocity.y; + } + if (fabsf(Math_SmoothScaleMaxMinF(&this->dyna.actor.posRot.pos.y, (finalPositions[this->isMovingDown]), 0.5f, + tempVelocity, 1.0f)) < 0.001f) { + this->dyna.actor.posRot.pos.y = finalPositions[this->isMovingDown]; + BgJya1flift_ResetMoveDelay(this); + Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + } else { + func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); + } +} + +void BgJya1flift_ResetMoveDelay(BgJya1flift* this) { + this->actionFunc = BgJya1flift_DelayMove; + this->moveDelay = 0; +} + +void BgJya1flift_DelayMove(BgJya1flift* this, GlobalContext* globalCtx) { + this->moveDelay++; + if (this->moveDelay >= 21) { + BgJya1flift_ChangeDirection(this); + } +} + +void BgJya1flift_Update(Actor* thisx, GlobalContext* globalCtx) { + BgJya1flift* this = THIS; + s32 pad; + s32 tempIsRiding; + + // Room 0 is the first room and 6 is the room that the lift starts on + if (globalCtx->roomCtx.curRoom.num == 6 || globalCtx->roomCtx.curRoom.num == 0) { + this->actionFunc(this, globalCtx); + if (globalCtx) {} + tempIsRiding = func_8004356C(&this->dyna) ? true : false; + if ((this->actionFunc == BgJya1flift_Move) || (this->actionFunc == BgJya1flift_DelayMove)) { + if (tempIsRiding) { + func_8005A77C(globalCtx->cameraPtrs[0], 0x30); + } else if (!tempIsRiding && this->isLinkRiding) { + func_8005A77C(globalCtx->cameraPtrs[0], 3); + } + } + this->isLinkRiding = tempIsRiding; + Collider_CylinderUpdate(thisx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + } else { + Actor_Kill(thisx); + } +} + +void BgJya1flift_Draw(Actor* thisx, GlobalContext* globalCtx) { + Gfx_DrawDListOpa(globalCtx, D_060001F0); +} diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h index 1c6c768eb4..a06c528113 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h @@ -6,9 +6,16 @@ struct BgJya1flift; +typedef void (*BgJya1fliftActionFunc)(struct BgJya1flift*, GlobalContext*); + typedef struct BgJya1flift { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x70]; + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ ColliderCylinder collider; + /* 0x01B0 */ BgJya1fliftActionFunc actionFunc; + /* 0x01B4 */ s16 moveDelay; + /* 0x01B6 */ u8 isMovingDown; + /* 0x01B7 */ u8 hasInitialized; + /* 0x01B8 */ u8 isLinkRiding; } BgJya1flift; // size = 0x01BC extern const ActorInit Bg_Jya_1flift_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 63f54f2eda..f19626273a 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -202,6 +202,10 @@ D_0600E1E8 = 0x0600E1E8; D_0600A7E0 = 0x0600A7E0; D_0600E568 = 0x0600E568; +// z_bg_jya_1flift +D_060004A8 = 0x060004A8; +D_060001F0 = 0x060001F0; + // z_bg_jya_amishutter D_0600C0A0 = 0x0600C0A0; D_0600C4C8 = 0x0600C4C8;