From b0e6f3b698cbb79f03297942729af33c9603557e Mon Sep 17 00:00:00 2001 From: Faschz Date: Wed, 18 Mar 2020 20:12:13 -0500 Subject: [PATCH] Decompiled ovl_En_Lightbox --- .../ovl_En_Lightbox/EnLightbox_Destroy.s | 16 -- .../actors/ovl_En_Lightbox/EnLightbox_Draw.s | 14 -- .../actors/ovl_En_Lightbox/EnLightbox_Init.s | 90 --------- .../ovl_En_Lightbox/EnLightbox_Update.s | 177 ------------------ data/overlays/actors/z_en_lightbox.data.s | 16 -- data/overlays/actors/z_en_lightbox.reloc.s | 11 -- data/overlays/actors/z_en_lightbox.rodata.s | 13 -- include/z64actor.h | 2 + spec | 4 +- .../actors/ovl_En_Lightbox/z_en_lightbox.c | 119 +++++++++++- .../actors/ovl_En_Lightbox/z_en_lightbox.h | 3 +- undefined_syms.txt | 6 +- 12 files changed, 118 insertions(+), 353 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Update.s delete mode 100644 data/overlays/actors/z_en_lightbox.data.s delete mode 100644 data/overlays/actors/z_en_lightbox.reloc.s delete mode 100644 data/overlays/actors/z_en_lightbox.rodata.s diff --git a/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Destroy.s b/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Destroy.s deleted file mode 100644 index c2dede8e43..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Destroy.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel EnLightbox_Destroy -/* 0012C 80A9EAFC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00130 80A9EB00 AFA40018 */ sw $a0, 0x0018($sp) -/* 00134 80A9EB04 8FAE0018 */ lw $t6, 0x0018($sp) -/* 00138 80A9EB08 AFBF0014 */ sw $ra, 0x0014($sp) -/* 0013C 80A9EB0C 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00140 80A9EB10 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810 -/* 00144 80A9EB14 0C00FB56 */ jal DynaPolyInfo_Free - ## DynaPolyInfo_delReserve -/* 00148 80A9EB18 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C -/* 0014C 80A9EB1C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00150 80A9EB20 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00154 80A9EB24 03E00008 */ jr $ra -/* 00158 80A9EB28 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Draw.s deleted file mode 100644 index 612026b121..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Draw.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel EnLightbox_Draw -/* 003E4 80A9EDB4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 003E8 80A9EDB8 AFA40018 */ sw $a0, 0x0018($sp) -/* 003EC 80A9EDBC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 003F0 80A9EDC0 AFBF0014 */ sw $ra, 0x0014($sp) -/* 003F4 80A9EDC4 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 -/* 003F8 80A9EDC8 0C00D498 */ jal Draw_DListOpa - -/* 003FC 80A9EDCC 24A50B70 */ addiu $a1, $a1, 0x0B70 ## $a1 = 06000B70 -/* 00400 80A9EDD0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00404 80A9EDD4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00408 80A9EDD8 03E00008 */ jr $ra -/* 0040C 80A9EDDC 00000000 */ nop - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Init.s deleted file mode 100644 index 29b877f5d7..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Init.s +++ /dev/null @@ -1,90 +0,0 @@ -glabel EnLightbox_Init -/* 00000 80A9E9D0 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 00004 80A9E9D4 AFBF001C */ sw $ra, 0x001C($sp) -/* 00008 80A9E9D8 AFB00018 */ sw $s0, 0x0018($sp) -/* 0000C 80A9E9DC AFA50044 */ sw $a1, 0x0044($sp) -/* 00010 80A9E9E0 AFA0003C */ sw $zero, 0x003C($sp) -/* 00014 80A9E9E4 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 00018 80A9E9E8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0001C 80A9E9EC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00020 80A9E9F0 1040000C */ beq $v0, $zero, .L80A9EA24 -/* 00024 80A9E9F4 3C053CCC */ lui $a1, 0x3CCC ## $a1 = 3CCC0000 -/* 00028 80A9E9F8 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 0002C 80A9E9FC 1041000D */ beq $v0, $at, .L80A9EA34 -/* 00030 80A9EA00 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00034 80A9EA04 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 00038 80A9EA08 1041000F */ beq $v0, $at, .L80A9EA48 -/* 0003C 80A9EA0C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00040 80A9EA10 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 00044 80A9EA14 10410011 */ beq $v0, $at, .L80A9EA5C -/* 00048 80A9EA18 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0004C 80A9EA1C 10000013 */ beq $zero, $zero, .L80A9EA6C -/* 00050 80A9EA20 8E0F0024 */ lw $t7, 0x0024($s0) ## 00000024 -.L80A9EA24: -/* 00054 80A9EA24 0C00B58B */ jal Actor_SetScale - -/* 00058 80A9EA28 34A5CCCD */ ori $a1, $a1, 0xCCCD ## $a1 = 3CCCCCCD -/* 0005C 80A9EA2C 1000000F */ beq $zero, $zero, .L80A9EA6C -/* 00060 80A9EA30 8E0F0024 */ lw $t7, 0x0024($s0) ## 00000024 -.L80A9EA34: -/* 00064 80A9EA34 3C053D4C */ lui $a1, 0x3D4C ## $a1 = 3D4C0000 -/* 00068 80A9EA38 0C00B58B */ jal Actor_SetScale - -/* 0006C 80A9EA3C 34A5CCCD */ ori $a1, $a1, 0xCCCD ## $a1 = 3D4CCCCD -/* 00070 80A9EA40 1000000A */ beq $zero, $zero, .L80A9EA6C -/* 00074 80A9EA44 8E0F0024 */ lw $t7, 0x0024($s0) ## 00000024 -.L80A9EA48: -/* 00078 80A9EA48 3C053D99 */ lui $a1, 0x3D99 ## $a1 = 3D990000 -/* 0007C 80A9EA4C 0C00B58B */ jal Actor_SetScale - -/* 00080 80A9EA50 34A5999A */ ori $a1, $a1, 0x999A ## $a1 = 3D99999A -/* 00084 80A9EA54 10000005 */ beq $zero, $zero, .L80A9EA6C -/* 00088 80A9EA58 8E0F0024 */ lw $t7, 0x0024($s0) ## 00000024 -.L80A9EA5C: -/* 0008C 80A9EA5C 3C053DCC */ lui $a1, 0x3DCC ## $a1 = 3DCC0000 -/* 00090 80A9EA60 0C00B58B */ jal Actor_SetScale - -/* 00094 80A9EA64 34A5CCCD */ ori $a1, $a1, 0xCCCD ## $a1 = 3DCCCCCD -/* 00098 80A9EA68 8E0F0024 */ lw $t7, 0x0024($s0) ## 00000024 -.L80A9EA6C: -/* 0009C 80A9EA6C 8E0E0028 */ lw $t6, 0x0028($s0) ## 00000028 -/* 000A0 80A9EA70 2418001E */ addiu $t8, $zero, 0x001E ## $t8 = 0000001E -/* 000A4 80A9EA74 AE0F0038 */ sw $t7, 0x0038($s0) ## 00000038 -/* 000A8 80A9EA78 8E0F002C */ lw $t7, 0x002C($s0) ## 0000002C -/* 000AC 80A9EA7C 24190032 */ addiu $t9, $zero, 0x0032 ## $t9 = 00000032 -/* 000B0 80A9EA80 3C068003 */ lui $a2, 0x8003 ## $a2 = 80030000 -/* 000B4 80A9EA84 A61800A8 */ sh $t8, 0x00A8($s0) ## 000000A8 -/* 000B8 80A9EA88 A61900AA */ sh $t9, 0x00AA($s0) ## 000000AA -/* 000BC 80A9EA8C 24C6B5EC */ addiu $a2, $a2, 0xB5EC ## $a2 = 8002B5EC -/* 000C0 80A9EA90 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 -/* 000C4 80A9EA94 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 -/* 000C8 80A9EA98 3C0740C0 */ lui $a3, 0x40C0 ## $a3 = 40C00000 -/* 000CC 80A9EA9C AE0E003C */ sw $t6, 0x003C($s0) ## 0000003C -/* 000D0 80A9EAA0 0C00AC78 */ jal ActorShape_Init - -/* 000D4 80A9EAA4 AE0F0040 */ sw $t7, 0x0040($s0) ## 00000040 -/* 000D8 80A9EAA8 3C01C000 */ lui $at, 0xC000 ## $at = C0000000 -/* 000DC 80A9EAAC 44812000 */ mtc1 $at, $f4 ## $f4 = -2.00 -/* 000E0 80A9EAB0 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 000E4 80A9EAB4 A2000160 */ sb $zero, 0x0160($s0) ## 00000160 -/* 000E8 80A9EAB8 AE00015C */ sw $zero, 0x015C($s0) ## 0000015C -/* 000EC 80A9EABC A200001F */ sb $zero, 0x001F($s0) ## 0000001F -/* 000F0 80A9EAC0 24841F10 */ addiu $a0, $a0, 0x1F10 ## $a0 = 06001F10 -/* 000F4 80A9EAC4 27A5003C */ addiu $a1, $sp, 0x003C ## $a1 = FFFFFFFC -/* 000F8 80A9EAC8 0C010620 */ jal DynaPolyInfo_Alloc - -/* 000FC 80A9EACC E604006C */ swc1 $f4, 0x006C($s0) ## 0000006C -/* 00100 80A9EAD0 8FA40044 */ lw $a0, 0x0044($sp) -/* 00104 80A9EAD4 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00108 80A9EAD8 8FA7003C */ lw $a3, 0x003C($sp) -/* 0010C 80A9EADC 0C00FA9D */ jal DynaPolyInfo_RegisterActor - ## DynaPolyInfo_setActor -/* 00110 80A9EAE0 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 00114 80A9EAE4 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 00118 80A9EAE8 8FBF001C */ lw $ra, 0x001C($sp) -/* 0011C 80A9EAEC 8FB00018 */ lw $s0, 0x0018($sp) -/* 00120 80A9EAF0 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 00124 80A9EAF4 03E00008 */ jr $ra -/* 00128 80A9EAF8 00000000 */ nop - - diff --git a/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Update.s deleted file mode 100644 index 75b8bc795c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Update.s +++ /dev/null @@ -1,177 +0,0 @@ -glabel EnLightbox_Update -/* 0015C 80A9EB2C 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00160 80A9EB30 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00164 80A9EB34 AFB00020 */ sw $s0, 0x0020($sp) -/* 00168 80A9EB38 AFA5002C */ sw $a1, 0x002C($sp) -/* 0016C 80A9EB3C 848E0162 */ lh $t6, 0x0162($a0) ## 00000162 -/* 00170 80A9EB40 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00174 80A9EB44 51C00008 */ beql $t6, $zero, .L80A9EB68 -/* 00178 80A9EB48 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0017C 80A9EB4C 0C00BD68 */ jal func_8002F5A0 -/* 00180 80A9EB50 00000000 */ nop -/* 00184 80A9EB54 1040007C */ beq $v0, $zero, .L80A9ED48 -/* 00188 80A9EB58 00000000 */ nop -/* 0018C 80A9EB5C 1000007A */ beq $zero, $zero, .L80A9ED48 -/* 00190 80A9EB60 A6000162 */ sh $zero, 0x0162($s0) ## 00000162 -/* 00194 80A9EB64 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80A9EB68: -/* 00198 80A9EB68 0C00BD04 */ jal func_8002F410 -/* 0019C 80A9EB6C 8FA5002C */ lw $a1, 0x002C($sp) -/* 001A0 80A9EB70 50400006 */ beql $v0, $zero, .L80A9EB8C -/* 001A4 80A9EB74 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 001A8 80A9EB78 860F0162 */ lh $t7, 0x0162($s0) ## 00000162 -/* 001AC 80A9EB7C 25F80001 */ addiu $t8, $t7, 0x0001 ## $t8 = 00000001 -/* 001B0 80A9EB80 10000071 */ beq $zero, $zero, .L80A9ED48 -/* 001B4 80A9EB84 A6180162 */ sh $t8, 0x0162($s0) ## 00000162 -/* 001B8 80A9EB88 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -.L80A9EB8C: -/* 001BC 80A9EB8C C6040068 */ lwc1 $f4, 0x0068($s0) ## 00000068 -/* 001C0 80A9EB90 46040032 */ c.eq.s $f0, $f4 -/* 001C4 80A9EB94 00000000 */ nop -/* 001C8 80A9EB98 4503001D */ bc1tl .L80A9EC10 -/* 001CC 80A9EB9C 960F0088 */ lhu $t7, 0x0088($s0) ## 00000088 -/* 001D0 80A9EBA0 96190088 */ lhu $t9, 0x0088($s0) ## 00000088 -/* 001D4 80A9EBA4 3C078013 */ lui $a3, 0x8013 ## $a3 = 80130000 -/* 001D8 80A9EBA8 24E733E0 */ addiu $a3, $a3, 0x33E0 ## $a3 = 801333E0 -/* 001DC 80A9EBAC 33280008 */ andi $t0, $t9, 0x0008 ## $t0 = 00000000 -/* 001E0 80A9EBB0 11000016 */ beq $t0, $zero, .L80A9EC0C -/* 001E4 80A9EBB4 2404282F */ addiu $a0, $zero, 0x282F ## $a0 = 0000282F -/* 001E8 80A9EBB8 86020032 */ lh $v0, 0x0032($s0) ## 00000032 -/* 001EC 80A9EBBC 8609007E */ lh $t1, 0x007E($s0) ## 0000007E -/* 001F0 80A9EBC0 3C0C8013 */ lui $t4, 0x8013 ## $t4 = 80130000 -/* 001F4 80A9EBC4 258C33E8 */ addiu $t4, $t4, 0x33E8 ## $t4 = 801333E8 -/* 001F8 80A9EBC8 00495021 */ addu $t2, $v0, $t1 -/* 001FC 80A9EBCC 01425823 */ subu $t3, $t2, $v0 -/* 00200 80A9EBD0 A60B0032 */ sh $t3, 0x0032($s0) ## 00000032 -/* 00204 80A9EBD4 AFAC0014 */ sw $t4, 0x0014($sp) -/* 00208 80A9EBD8 AFA70010 */ sw $a3, 0x0010($sp) -/* 0020C 80A9EBDC 260500E4 */ addiu $a1, $s0, 0x00E4 ## $a1 = 000000E4 -/* 00210 80A9EBE0 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 00214 80A9EBE4 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 00218 80A9EBE8 3C0180AA */ lui $at, %hi(D_80A9EE00) ## $at = 80AA0000 -/* 0021C 80A9EBEC C428EE00 */ lwc1 $f8, %lo(D_80A9EE00)($at) -/* 00220 80A9EBF0 C6060068 */ lwc1 $f6, 0x0068($s0) ## 00000068 -/* 00224 80A9EBF4 960D0088 */ lhu $t5, 0x0088($s0) ## 00000088 -/* 00228 80A9EBF8 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 0022C 80A9EBFC 46083282 */ mul.s $f10, $f6, $f8 -/* 00230 80A9EC00 31AEFFF7 */ andi $t6, $t5, 0xFFF7 ## $t6 = 00000000 -/* 00234 80A9EC04 A60E0088 */ sh $t6, 0x0088($s0) ## 00000088 -/* 00238 80A9EC08 E60A0068 */ swc1 $f10, 0x0068($s0) ## 00000068 -.L80A9EC0C: -/* 0023C 80A9EC0C 960F0088 */ lhu $t7, 0x0088($s0) ## 00000088 -.L80A9EC10: -/* 00240 80A9EC10 3C198016 */ lui $t9, 0x8016 ## $t9 = 80160000 -/* 00244 80A9EC14 3C098016 */ lui $t1, 0x8016 ## $t1 = 80160000 -/* 00248 80A9EC18 31F80001 */ andi $t8, $t7, 0x0001 ## $t8 = 00000000 -/* 0024C 80A9EC1C 17000010 */ bne $t8, $zero, .L80A9EC60 -/* 00250 80A9EC20 00000000 */ nop -/* 00254 80A9EC24 8F39FA90 */ lw $t9, -0x0570($t9) ## 8015FA90 -/* 00258 80A9EC28 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 0025C 80A9EC2C 44812000 */ mtc1 $at, $f4 ## $f4 = 100.00 -/* 00260 80A9EC30 87280746 */ lh $t0, 0x0746($t9) ## 80160746 -/* 00264 80A9EC34 44050000 */ mfc1 $a1, $f0 -/* 00268 80A9EC38 26040068 */ addiu $a0, $s0, 0x0068 ## $a0 = 00000068 -/* 0026C 80A9EC3C 44888000 */ mtc1 $t0, $f16 ## $f16 = 0.00 -/* 00270 80A9EC40 00000000 */ nop -/* 00274 80A9EC44 468084A0 */ cvt.s.w $f18, $f16 -/* 00278 80A9EC48 46049183 */ div.s $f6, $f18, $f4 -/* 0027C 80A9EC4C 44063000 */ mfc1 $a2, $f6 -/* 00280 80A9EC50 0C01DE80 */ jal Math_ApproxF - -/* 00284 80A9EC54 00000000 */ nop -/* 00288 80A9EC58 1000003B */ beq $zero, $zero, .L80A9ED48 -/* 0028C 80A9EC5C 00000000 */ nop -.L80A9EC60: -/* 00290 80A9EC60 8D29FA90 */ lw $t1, -0x0570($t1) ## FFFFFA90 -/* 00294 80A9EC64 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 00298 80A9EC68 44818000 */ mtc1 $at, $f16 ## $f16 = 100.00 -/* 0029C 80A9EC6C 852A0748 */ lh $t2, 0x0748($t1) ## 00000748 -/* 002A0 80A9EC70 44050000 */ mfc1 $a1, $f0 -/* 002A4 80A9EC74 26040068 */ addiu $a0, $s0, 0x0068 ## $a0 = 00000068 -/* 002A8 80A9EC78 448A4000 */ mtc1 $t2, $f8 ## $f8 = 0.00 -/* 002AC 80A9EC7C 00000000 */ nop -/* 002B0 80A9EC80 468042A0 */ cvt.s.w $f10, $f8 -/* 002B4 80A9EC84 46105483 */ div.s $f18, $f10, $f16 -/* 002B8 80A9EC88 44069000 */ mfc1 $a2, $f18 -/* 002BC 80A9EC8C 0C01DE80 */ jal Math_ApproxF - -/* 002C0 80A9EC90 00000000 */ nop -/* 002C4 80A9EC94 960B0088 */ lhu $t3, 0x0088($s0) ## 00000088 -/* 002C8 80A9EC98 3C0D8016 */ lui $t5, 0x8016 ## $t5 = 80160000 -/* 002CC 80A9EC9C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002D0 80A9ECA0 316C0002 */ andi $t4, $t3, 0x0002 ## $t4 = 00000000 -/* 002D4 80A9ECA4 11800026 */ beq $t4, $zero, .L80A9ED40 -/* 002D8 80A9ECA8 00000000 */ nop -/* 002DC 80A9ECAC 8DADFA90 */ lw $t5, -0x0570($t5) ## 8015FA90 -/* 002E0 80A9ECB0 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 002E4 80A9ECB4 44815000 */ mtc1 $at, $f10 ## $f10 = 100.00 -/* 002E8 80A9ECB8 85AE074A */ lh $t6, 0x074A($t5) ## 8016074A -/* 002EC 80A9ECBC C6040060 */ lwc1 $f4, 0x0060($s0) ## 00000060 -/* 002F0 80A9ECC0 3C0F8013 */ lui $t7, 0x8013 ## $t7 = 80130000 -/* 002F4 80A9ECC4 448E3000 */ mtc1 $t6, $f6 ## $f6 = 0.00 -/* 002F8 80A9ECC8 3C188013 */ lui $t8, 0x8013 ## $t8 = 80130000 -/* 002FC 80A9ECCC 271833E8 */ addiu $t8, $t8, 0x33E8 ## $t8 = 801333E8 -/* 00300 80A9ECD0 46803220 */ cvt.s.w $f8, $f6 -/* 00304 80A9ECD4 25E733E0 */ addiu $a3, $t7, 0x33E0 ## $a3 = 801333E0 -/* 00308 80A9ECD8 260500E4 */ addiu $a1, $s0, 0x00E4 ## $a1 = 000000E4 -/* 0030C 80A9ECDC 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 00310 80A9ECE0 460A4403 */ div.s $f16, $f8, $f10 -/* 00314 80A9ECE4 4610203C */ c.lt.s $f4, $f16 -/* 00318 80A9ECE8 00000000 */ nop -/* 0031C 80A9ECEC 45000014 */ bc1f .L80A9ED40 -/* 00320 80A9ECF0 00000000 */ nop -/* 00324 80A9ECF4 2404282F */ addiu $a0, $zero, 0x282F ## $a0 = 0000282F -/* 00328 80A9ECF8 AFA70010 */ sw $a3, 0x0010($sp) -/* 0032C 80A9ECFC 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 00330 80A9ED00 AFB80014 */ sw $t8, 0x0014($sp) -/* 00334 80A9ED04 3C198016 */ lui $t9, 0x8016 ## $t9 = 80160000 -/* 00338 80A9ED08 8F39FA90 */ lw $t9, -0x0570($t9) ## 8015FA90 -/* 0033C 80A9ED0C 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 00340 80A9ED10 44814000 */ mtc1 $at, $f8 ## $f8 = 100.00 -/* 00344 80A9ED14 8728074C */ lh $t0, 0x074C($t9) ## 8016074C -/* 00348 80A9ED18 C6040060 */ lwc1 $f4, 0x0060($s0) ## 00000060 -/* 0034C 80A9ED1C 96090088 */ lhu $t1, 0x0088($s0) ## 00000088 -/* 00350 80A9ED20 44889000 */ mtc1 $t0, $f18 ## $f18 = 0.00 -/* 00354 80A9ED24 312AFFFE */ andi $t2, $t1, 0xFFFE ## $t2 = 00000000 -/* 00358 80A9ED28 468091A0 */ cvt.s.w $f6, $f18 -/* 0035C 80A9ED2C A60A0088 */ sh $t2, 0x0088($s0) ## 00000088 -/* 00360 80A9ED30 46083283 */ div.s $f10, $f6, $f8 -/* 00364 80A9ED34 460A2402 */ mul.s $f16, $f4, $f10 -/* 00368 80A9ED38 10000003 */ beq $zero, $zero, .L80A9ED48 -/* 0036C 80A9ED3C E6100060 */ swc1 $f16, 0x0060($s0) ## 00000060 -.L80A9ED40: -/* 00370 80A9ED40 0C00BD60 */ jal func_8002F580 -/* 00374 80A9ED44 8FA5002C */ lw $a1, 0x002C($sp) -.L80A9ED48: -/* 00378 80A9ED48 0C00B638 */ jal Actor_MoveForward - -/* 0037C 80A9ED4C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00380 80A9ED50 860B00AA */ lh $t3, 0x00AA($s0) ## 000000AA -/* 00384 80A9ED54 860C00A8 */ lh $t4, 0x00A8($s0) ## 000000A8 -/* 00388 80A9ED58 240D001D */ addiu $t5, $zero, 0x001D ## $t5 = 0000001D -/* 0038C 80A9ED5C 448B9000 */ mtc1 $t3, $f18 ## $f18 = 0.00 -/* 00390 80A9ED60 448C3000 */ mtc1 $t4, $f6 ## $f6 = 0.00 -/* 00394 80A9ED64 AFAD0014 */ sw $t5, 0x0014($sp) -/* 00398 80A9ED68 468094A0 */ cvt.s.w $f18, $f18 -/* 0039C 80A9ED6C 8FA4002C */ lw $a0, 0x002C($sp) -/* 003A0 80A9ED70 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 003A4 80A9ED74 46803020 */ cvt.s.w $f0, $f6 -/* 003A8 80A9ED78 44069000 */ mfc1 $a2, $f18 -/* 003AC 80A9ED7C 44070000 */ mfc1 $a3, $f0 -/* 003B0 80A9ED80 0C00B92D */ jal func_8002E4B4 -/* 003B4 80A9ED84 E7A00010 */ swc1 $f0, 0x0010($sp) -/* 003B8 80A9ED88 8E0F0024 */ lw $t7, 0x0024($s0) ## 00000024 -/* 003BC 80A9ED8C 8E0E0028 */ lw $t6, 0x0028($s0) ## 00000028 -/* 003C0 80A9ED90 AE0F0038 */ sw $t7, 0x0038($s0) ## 00000038 -/* 003C4 80A9ED94 8E0F002C */ lw $t7, 0x002C($s0) ## 0000002C -/* 003C8 80A9ED98 AE0E003C */ sw $t6, 0x003C($s0) ## 0000003C -/* 003CC 80A9ED9C AE0F0040 */ sw $t7, 0x0040($s0) ## 00000040 -/* 003D0 80A9EDA0 8FBF0024 */ lw $ra, 0x0024($sp) -/* 003D4 80A9EDA4 8FB00020 */ lw $s0, 0x0020($sp) -/* 003D8 80A9EDA8 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 003DC 80A9EDAC 03E00008 */ jr $ra -/* 003E0 80A9EDB0 00000000 */ nop - - diff --git a/data/overlays/actors/z_en_lightbox.data.s b/data/overlays/actors/z_en_lightbox.data.s deleted file mode 100644 index 678fa31f26..0000000000 --- a/data/overlays/actors/z_en_lightbox.data.s +++ /dev/null @@ -1,16 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purposee registers - -.section .data - -glabel En_Lightbox_InitVars - .word 0x007C0600, 0x00000010, 0x00810000, 0x00000164 -.word EnLightbox_Init -.word EnLightbox_Destroy -.word EnLightbox_Update -.word EnLightbox_Draw - diff --git a/data/overlays/actors/z_en_lightbox.reloc.s b/data/overlays/actors/z_en_lightbox.reloc.s deleted file mode 100644 index 60affc2f04..0000000000 --- a/data/overlays/actors/z_en_lightbox.reloc.s +++ /dev/null @@ -1,11 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purposee registers - -.section .rodata -glabel D_80A9EE10 - -.incbin "baserom/ovl_En_Lightbox", 0x440, 0x00000030 diff --git a/data/overlays/actors/z_en_lightbox.rodata.s b/data/overlays/actors/z_en_lightbox.rodata.s deleted file mode 100644 index fc3c134c7b..0000000000 --- a/data/overlays/actors/z_en_lightbox.rodata.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 purposee registers - -.section .rodata - -glabel D_80A9EE00 - .word 0x3F333333, 0x00000000, 0x00000000, 0x00000000 - - diff --git a/include/z64actor.h b/include/z64actor.h index 6f81f04475..e2cf530ba5 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -329,6 +329,8 @@ typedef struct /* 0x15A */ u16 unk_15A; /* 0x15C */ u32 unk_15C; /* 0x160 */ u8 unk_160; + /* 0x161 */ char unk_161; + /* 0x162 */ s16 unk_162; } DynaPolyActor; // size = 0x164 typedef struct diff --git a/spec b/spec index 1a3b075a91..a60fc97868 100644 --- a/spec +++ b/spec @@ -3184,9 +3184,7 @@ endseg beginseg name "ovl_En_Lightbox" include "build/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.o" - include "build/data/overlays/actors/z_en_lightbox.data.o" - include "build/data/overlays/actors/z_en_lightbox.rodata.o" - include "build/data/overlays/actors/z_en_lightbox.reloc.o" + include "build/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index 4ae592df73..8a9019cf61 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -1,14 +1,19 @@ +/* + * File: z_en_lightbox.c + * Overlay: ovl_En_Lightbox + * Description: +*/ + #include "z_en_lightbox.h" #define ROOM 0x00 #define FLAGS 0x00000010 -void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx); -void EnLightbox_Destroy(EnLightbox* this, GlobalContext* globalCtx); -void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx); -void EnLightbox_Draw(EnLightbox* this, GlobalContext* globalCtx); +static void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx); +static void EnLightbox_Destroy(EnLightbox* this, GlobalContext* globalCtx); +static void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx); +static void EnLightbox_Draw(EnLightbox* this, GlobalContext* globalCtx); -/* const ActorInit En_Lightbox_InitVars = { ACTOR_EN_LIGHTBOX, @@ -22,11 +27,105 @@ const ActorInit En_Lightbox_InitVars = (ActorFunc)EnLightbox_Update, (ActorFunc)EnLightbox_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Destroy.s") +extern u32 D_06000B70; +extern u32 D_06001F10; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Update.s") +static void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx) +{ + u32 local_c = 0; + Actor* thisx = &this->dyna.actor; + s32 pad[4]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Lightbox/EnLightbox_Draw.s") + switch(thisx->params){ + case 0: + Actor_SetScale(thisx, 0.025f); + break; + case 1: + Actor_SetScale(thisx, 0.05f); + break; + case 2: + Actor_SetScale(thisx, 0.075f); + break; + case 3: + Actor_SetScale(thisx, 0.1f); + default: + break; + } + + thisx->posRot2.pos = thisx->posRot.pos; + thisx->sub_98.unk_10 = 0x1E; + thisx->sub_98.unk_12 = 0x32; + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f); + this->dyna.unk_160 = 0; + this->dyna.unk_15C = 0; + thisx->unk_1F = 0; + thisx->gravity = -2.0f; + DynaPolyInfo_Alloc(&D_06001F10, &local_c); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); +} + +static void EnLightbox_Destroy(EnLightbox* this, GlobalContext* globalCtx) +{ + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); +} + +static void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx) +{ + Actor* thisx = &this->dyna.actor; + + if (this->dyna.unk_162 != 0) + { + if (func_8002F5A0(thisx, globalCtx)) + { + this->dyna.unk_162 = 0; + } + } + else + { + if (func_8002F410(thisx, globalCtx)) + { + this->dyna.unk_162++; + } + else + { + if (thisx->speedXZ) + { + if (thisx->bgCheckFlags & 8) + { + thisx->posRot.rot.y = (thisx->posRot.rot.y + thisx->unk_7E) - thisx->posRot.rot.y; + Audio_PlaySoundGeneral(0x282F, &thisx->unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + thisx->speedXZ *= 0.7f; + thisx->bgCheckFlags &= ~0x8; + } + } + + if ((thisx->bgCheckFlags & 1) == 0) + { + Math_ApproxF(&thisx->speedXZ, 0, IREG(57) / 100.0f); + } + else + { + Math_ApproxF(&thisx->speedXZ, 0, IREG(58) / 100.0f); + if ((thisx->bgCheckFlags & 2) && (thisx->velocity.y < IREG(59) / 100.0f)) + { + Audio_PlaySoundGeneral(0x282F, &thisx->unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + thisx->velocity.y *= IREG(60) / 100.0f; + thisx->bgCheckFlags &= ~0x1; + } + else + { + func_8002F580(thisx, globalCtx); + } + } + } + } + Actor_MoveForward(thisx); + func_8002E4B4(globalCtx, thisx, thisx->sub_98.unk_12, thisx->sub_98.unk_10, thisx->sub_98.unk_10, 0x1D); + thisx->posRot2.pos = thisx->posRot.pos; +} + +static void EnLightbox_Draw(EnLightbox* this, GlobalContext* globalCtx) +{ + Draw_DListOpa(globalCtx, &D_06000B70); +} diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h index 29bdf530bb..a788ff50f4 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h @@ -6,8 +6,7 @@ typedef struct { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x18]; + /* 0x0000 */ DynaPolyActor dyna; } EnLightbox; // size = 0x0164 extern const ActorInit En_Lightbox_InitVars; diff --git a/undefined_syms.txt b/undefined_syms.txt index 102b185600..78ad998625 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -390,4 +390,8 @@ D_06009244 = 0x06009244; D_060041F4 = 0x060041F4; D_0600A054 = 0x0600A054; D_06008688 = 0x06008688; -D_04049210 = 0x04049210; \ No newline at end of file +D_04049210 = 0x04049210; + +// z_en_lightbox +D_06000B70 = 0x06000B70; +D_06001F10 = 0x06001F10; \ No newline at end of file