From 9d636263431b89f854e999277a071d6ba66dff42 Mon Sep 17 00:00:00 2001 From: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Date: Sun, 6 Dec 2020 07:38:16 +0000 Subject: [PATCH] En_Changer OK (#501) * decomped most functions, 2 left * all functions decomped except for Init * just regalloc left in Init(?) * Init finally matched, translation, some naming * most other variables named * Delete asm * Whoops, actually deleted asm this time * review * review 2 Co-authored-by: fig02 --- .../actors/ovl_En_Changer/EnChanger_Destroy.s | 4 - .../actors/ovl_En_Changer/EnChanger_Init.s | 521 ------------------ .../actors/ovl_En_Changer/EnChanger_Update.s | 51 -- .../actors/ovl_En_Changer/func_809D2CCC.s | 47 -- .../actors/ovl_En_Changer/func_809D2D70.s | 155 ------ .../actors/ovl_En_Changer/func_809D2F74.s | 24 - data/overlays/actors/z_en_changer.data.s | 30 - data/overlays/actors/z_en_changer.reloc.s | 13 - spec | 3 +- .../actors/ovl_En_Changer/z_en_changer.c | 283 +++++++++- .../actors/ovl_En_Changer/z_en_changer.h | 15 +- .../ovl_Item_Etcetera/z_item_etcetera.c | 16 +- .../ovl_Item_Etcetera/z_item_etcetera.h | 32 +- 13 files changed, 314 insertions(+), 880 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2CCC.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2D70.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2F74.s delete mode 100644 data/overlays/actors/z_en_changer.data.s delete mode 100644 data/overlays/actors/z_en_changer.reloc.s diff --git a/asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Destroy.s b/asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Destroy.s deleted file mode 100644 index d6f9fda910..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Destroy.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel EnChanger_Destroy -/* 00000 809D2690 AFA40000 */ sw $a0, 0x0000($sp) -/* 00004 809D2694 03E00008 */ jr $ra -/* 00008 809D2698 AFA50004 */ sw $a1, 0x0004($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Init.s deleted file mode 100644 index 6545904ee4..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Init.s +++ /dev/null @@ -1,521 +0,0 @@ -.rdata -glabel D_809D3180 - .asciz "\n\n" - .balign 4 - -glabel D_809D3184 - .asciz "\x1b[32m☆☆☆☆☆ 宝発生(部屋はどれ?) %d\n\x1b[m" - .balign 4 - -glabel D_809D31B0 - .asciz "\x1b[32m☆☆☆☆☆ ビットは? %x\n\x1b[m" - .balign 4 - -glabel D_809D31D8 - .asciz "\x1b[32m☆☆☆☆☆ セーブBITは? %x\n\x1b[m" - .balign 4 - -glabel D_809D3204 - .asciz "\x1b[32m☆☆☆☆☆ もう、ゾンビ? %d\n\x1b[m" - .balign 4 - -glabel D_809D3230 - .asciz "\n\n" - .balign 4 - -glabel D_809D3234 - .asciz "\x1b[33m☆☆☆☆☆ 中央宝発生(GREAT) ☆☆☆☆☆ %x\n\x1b[m" - .balign 4 - -glabel D_809D3270 - .asciz "\x1b[35m☆☆☆☆☆ 左宝発生(ナニがはいってるの?) ☆☆☆☆☆ %x\n\x1b[m" - .balign 4 - -glabel D_809D32B4 - .asciz "\x1b[35m☆☆☆☆☆ 部屋番号は? %x\n\x1b[m" - .balign 4 - -glabel D_809D32DC - .asciz "\x1b[35m☆☆☆☆☆ ビットはなぁに? %x\n\x1b[m" - .balign 4 - -glabel D_809D3308 - .asciz "\x1b[35m☆☆☆☆☆ すけすけ君? %x\n\x1b[m" - .balign 4 - -glabel D_809D332C - .asciz "\n\n" - .balign 4 - -glabel D_809D3330 - .asciz "\x1b[36m☆☆☆☆☆ 右宝発生(ナニがはいってるの?) ☆☆☆☆☆ %x\n\x1b[m" - .balign 4 - -glabel D_809D3374 - .asciz "\x1b[36m☆☆☆☆☆ 部屋番号は? %d\n\x1b[m" - .balign 4 - -glabel D_809D339C - .asciz "\x1b[36m☆☆☆☆☆ ビットはなぁに? %x\n\x1b[m" - .balign 4 - -glabel D_809D33C8 - .asciz "\x1b[36m☆☆☆☆☆ すけすけ君? %x\n\x1b[m" - .balign 4 - -glabel D_809D33EC - .asciz "\n\n" - .balign 4 - -.late_rodata -glabel D_809D3448 - .word 0xC51C4000 -glabel D_809D344C - .word 0xC51C4000 -glabel D_809D3450 - .float 1.99000000954 - -.text -glabel EnChanger_Init -/* 0000C 809D269C 27BDFF88 */ addiu $sp, $sp, 0xFF88 ## $sp = FFFFFF88 -/* 00010 809D26A0 AFB20040 */ sw $s2, 0x0040($sp) -/* 00014 809D26A4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00018 809D26A8 AFBF0044 */ sw $ra, 0x0044($sp) -/* 0001C 809D26AC AFB1003C */ sw $s1, 0x003C($sp) -/* 00020 809D26B0 AFB00038 */ sw $s0, 0x0038($sp) -/* 00024 809D26B4 00A19021 */ addu $s2, $a1, $at -/* 00028 809D26B8 82431CBC */ lb $v1, 0x1CBC($s2) ## 00001CBC -/* 0002C 809D26BC 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 00030 809D26C0 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000 -/* 00034 809D26C4 2463FFFF */ addiu $v1, $v1, 0xFFFF ## $v1 = FFFFFFFF -/* 00038 809D26C8 00031C00 */ sll $v1, $v1, 16 -/* 0003C 809D26CC 00031C03 */ sra $v1, $v1, 16 -/* 00040 809D26D0 04610002 */ bgez $v1, .L809D26DC -/* 00044 809D26D4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00048 809D26D8 00001825 */ or $v1, $zero, $zero ## $v1 = 00000000 -.L809D26DC: -/* 0004C 809D26DC 3C0F809D */ lui $t7, %hi(D_809D3160) ## $t7 = 809D0000 -/* 00050 809D26E0 25EF3160 */ addiu $t7, $t7, %lo(D_809D3160) ## $t7 = 809D3160 -/* 00054 809D26E4 00037080 */ sll $t6, $v1, 2 -/* 00058 809D26E8 01CF1021 */ addu $v0, $t6, $t7 -/* 0005C 809D26EC 8C450000 */ lw $a1, 0x0000($v0) ## 00000000 -/* 00060 809D26F0 AFA20054 */ sw $v0, 0x0054($sp) -/* 00064 809D26F4 0C00B32C */ jal Flags_GetTreasure - -/* 00068 809D26F8 A7A30068 */ sh $v1, 0x0068($sp) -/* 0006C 809D26FC 10400003 */ beq $v0, $zero, .L809D270C -/* 00070 809D2700 87A30068 */ lh $v1, 0x0068($sp) -/* 00074 809D2704 24180001 */ addiu $t8, $zero, 0x0001 ## $t8 = 00000001 -/* 00078 809D2708 A6380168 */ sh $t8, 0x0168($s1) ## 00000168 -.L809D270C: -/* 0007C 809D270C 3C04809D */ lui $a0, %hi(D_809D3180) ## $a0 = 809D0000 -/* 00080 809D2710 24843180 */ addiu $a0, $a0, %lo(D_809D3180) ## $a0 = 809D3180 -/* 00084 809D2714 0C00084C */ jal osSyncPrintf - -/* 00088 809D2718 A7A30068 */ sh $v1, 0x0068($sp) -/* 0008C 809D271C 3C04809D */ lui $a0, %hi(D_809D3184) ## $a0 = 809D0000 -/* 00090 809D2720 24843184 */ addiu $a0, $a0, %lo(D_809D3184) ## $a0 = 809D3184 -/* 00094 809D2724 0C00084C */ jal osSyncPrintf - -/* 00098 809D2728 82451CBC */ lb $a1, 0x1CBC($s2) ## 00001CBC -/* 0009C 809D272C 3C04809D */ lui $a0, %hi(D_809D31B0) ## $a0 = 809D0000 -/* 000A0 809D2730 248431B0 */ addiu $a0, $a0, %lo(D_809D31B0) ## $a0 = 809D31B0 -/* 000A4 809D2734 0C00084C */ jal osSyncPrintf - -/* 000A8 809D2738 8E051D38 */ lw $a1, 0x1D38($s0) ## 00001D38 -/* 000AC 809D273C 8FB90054 */ lw $t9, 0x0054($sp) -/* 000B0 809D2740 3C04809D */ lui $a0, %hi(D_809D31D8) ## $a0 = 809D0000 -/* 000B4 809D2744 248431D8 */ addiu $a0, $a0, %lo(D_809D31D8) ## $a0 = 809D31D8 -/* 000B8 809D2748 0C00084C */ jal osSyncPrintf - -/* 000BC 809D274C 8F250000 */ lw $a1, 0x0000($t9) ## 00000000 -/* 000C0 809D2750 3C04809D */ lui $a0, %hi(D_809D3204) ## $a0 = 809D0000 -/* 000C4 809D2754 24843204 */ addiu $a0, $a0, %lo(D_809D3204) ## $a0 = 809D3204 -/* 000C8 809D2758 0C00084C */ jal osSyncPrintf - -/* 000CC 809D275C 86250168 */ lh $a1, 0x0168($s1) ## 00000168 -/* 000D0 809D2760 3C04809D */ lui $a0, %hi(D_809D3230) ## $a0 = 809D0000 -/* 000D4 809D2764 0C00084C */ jal osSyncPrintf - -/* 000D8 809D2768 24843230 */ addiu $a0, $a0, %lo(D_809D3230) ## $a0 = 809D3230 -/* 000DC 809D276C 87A30068 */ lh $v1, 0x0068($sp) -/* 000E0 809D2770 82491CBC */ lb $t1, 0x1CBC($s2) ## 00001CBC -/* 000E4 809D2774 3C0A8016 */ lui $t2, %hi(gSaveContext+0xef2) -/* 000E8 809D2778 00031840 */ sll $v1, $v1, 1 -/* 000EC 809D277C 00031C00 */ sll $v1, $v1, 16 -/* 000F0 809D2780 29210006 */ slti $at, $t1, 0x0006 -/* 000F4 809D2784 14200053 */ bne $at, $zero, .L809D28D4 -/* 000F8 809D2788 00031C03 */ sra $v1, $v1, 16 -/* 000FC 809D278C 954AF552 */ lhu $t2, %lo(gSaveContext+0xef2)($t2) -/* 00100 809D2790 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 00104 809D2794 44810000 */ mtc1 $at, $f0 ## $f0 = 20.00 -/* 00108 809D2798 314B0800 */ andi $t3, $t2, 0x0800 ## $t3 = 00000000 -/* 0010C 809D279C 11600003 */ beq $t3, $zero, .L809D27AC -/* 00110 809D27A0 3C0D809D */ lui $t5, %hi(D_809D3174) ## $t5 = 809D0000 -/* 00114 809D27A4 10000004 */ beq $zero, $zero, .L809D27B8 -/* 00118 809D27A8 24024EA0 */ addiu $v0, $zero, 0x4EA0 ## $v0 = 00004EA0 -.L809D27AC: -/* 0011C 809D27AC 240C4EC0 */ addiu $t4, $zero, 0x4EC0 ## $t4 = 00004EC0 -/* 00120 809D27B0 A7AC006A */ sh $t4, 0x006A($sp) -/* 00124 809D27B4 24024EC0 */ addiu $v0, $zero, 0x4EC0 ## $v0 = 00004EC0 -.L809D27B8: -/* 00128 809D27B8 8DAD3174 */ lw $t5, %lo(D_809D3174)($t5) -/* 0012C 809D27BC 3C01809D */ lui $at, %hi(D_809D3448) ## $at = 809D0000 -/* 00130 809D27C0 C4243448 */ lwc1 $f4, %lo(D_809D3448)($at) -/* 00134 809D27C4 01A21025 */ or $v0, $t5, $v0 ## $v0 = 809D4EC0 -/* 00138 809D27C8 00021400 */ sll $v0, $v0, 16 -/* 0013C 809D27CC 00021403 */ sra $v0, $v0, 16 -/* 00140 809D27D0 26041C24 */ addiu $a0, $s0, 0x1C24 ## $a0 = 00001C24 -/* 00144 809D27D4 240E7FFF */ addiu $t6, $zero, 0x7FFF ## $t6 = 00007FFF -/* 00148 809D27D8 AFAE0020 */ sw $t6, 0x0020($sp) -/* 0014C 809D27DC AFA4004C */ sw $a0, 0x004C($sp) -/* 00150 809D27E0 AFA20028 */ sw $v0, 0x0028($sp) -/* 00154 809D27E4 A7A2006A */ sh $v0, 0x006A($sp) -/* 00158 809D27E8 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 0015C 809D27EC 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00160 809D27F0 2407000A */ addiu $a3, $zero, 0x000A ## $a3 = 0000000A -/* 00164 809D27F4 E7A00010 */ swc1 $f0, 0x0010($sp) -/* 00168 809D27F8 E7A00014 */ swc1 $f0, 0x0014($sp) -/* 0016C 809D27FC AFA0001C */ sw $zero, 0x001C($sp) -/* 00170 809D2800 AFA00024 */ sw $zero, 0x0024($sp) -/* 00174 809D2804 A7A30068 */ sh $v1, 0x0068($sp) -/* 00178 809D2808 0C00C916 */ jal Actor_SpawnAsChild - -/* 0017C 809D280C E7A40018 */ swc1 $f4, 0x0018($sp) -/* 00180 809D2810 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 00184 809D2814 44810000 */ mtc1 $at, $f0 ## $f0 = 20.00 -/* 00188 809D2818 87A30068 */ lh $v1, 0x0068($sp) -/* 0018C 809D281C 1040002D */ beq $v0, $zero, .L809D28D4 -/* 00190 809D2820 AE220158 */ sw $v0, 0x0158($s1) ## 00000158 -/* 00194 809D2824 862F0168 */ lh $t7, 0x0168($s1) ## 00000168 -/* 00198 809D2828 3C188016 */ lui $t8, %hi(gSaveContext+0xef2) -/* 0019C 809D282C 8FA4004C */ lw $a0, 0x004C($sp) -/* 001A0 809D2830 11E00009 */ beq $t7, $zero, .L809D2858 -/* 001A4 809D2834 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 001A8 809D2838 87A5006A */ lh $a1, 0x006A($sp) -/* 001AC 809D283C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001B0 809D2840 0C00B331 */ jal Flags_SetTreasure - -/* 001B4 809D2844 30A5001F */ andi $a1, $a1, 0x001F ## $a1 = 00000000 -/* 001B8 809D2848 0C00B55C */ jal Actor_Kill - -/* 001BC 809D284C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 001C0 809D2850 10000119 */ beq $zero, $zero, .L809D2CB8 -/* 001C4 809D2854 8FBF0044 */ lw $ra, 0x0044($sp) -.L809D2858: -/* 001C8 809D2858 9718F552 */ lhu $t8, %lo(gSaveContext+0xef2)($t8) -/* 001CC 809D285C 44070000 */ mfc1 $a3, $f0 -/* 001D0 809D2860 2406010F */ addiu $a2, $zero, 0x010F ## $a2 = 0000010F -/* 001D4 809D2864 33190800 */ andi $t9, $t8, 0x0800 ## $t9 = 00000000 -/* 001D8 809D2868 13200003 */ beq $t9, $zero, .L809D2878 -/* 001DC 809D286C 3C01809D */ lui $at, %hi(D_809D344C) ## $at = 809D0000 -/* 001E0 809D2870 10000002 */ beq $zero, $zero, .L809D287C -/* 001E4 809D2874 2402000B */ addiu $v0, $zero, 0x000B ## $v0 = 0000000B -.L809D2878: -/* 001E8 809D2878 2402000C */ addiu $v0, $zero, 0x000C ## $v0 = 0000000C -.L809D287C: -/* 001EC 809D287C 3C09809D */ lui $t1, %hi(D_809D3174) ## $t1 = 809D0000 -/* 001F0 809D2880 8D293174 */ lw $t1, %lo(D_809D3174)($t1) -/* 001F4 809D2884 C426344C */ lwc1 $f6, %lo(D_809D344C)($at) -/* 001F8 809D2888 304C00FF */ andi $t4, $v0, 0x00FF ## $t4 = 0000000C -/* 001FC 809D288C 312A001F */ andi $t2, $t1, 0x001F ## $t2 = 00000000 -/* 00200 809D2890 000A5A00 */ sll $t3, $t2, 8 -/* 00204 809D2894 016C6821 */ addu $t5, $t3, $t4 -/* 00208 809D2898 AFAD0024 */ sw $t5, 0x0024($sp) -/* 0020C 809D289C E7A00010 */ swc1 $f0, 0x0010($sp) -/* 00210 809D28A0 AFA00018 */ sw $zero, 0x0018($sp) -/* 00214 809D28A4 AFA0001C */ sw $zero, 0x001C($sp) -/* 00218 809D28A8 AFA00020 */ sw $zero, 0x0020($sp) -/* 0021C 809D28AC 0C00C7D4 */ jal Actor_Spawn - ## ActorSpawn -/* 00220 809D28B0 E7A60014 */ swc1 $f6, 0x0014($sp) -/* 00224 809D28B4 3C04809D */ lui $a0, %hi(D_809D3234) ## $a0 = 809D0000 -/* 00228 809D28B8 24843234 */ addiu $a0, $a0, %lo(D_809D3234) ## $a0 = 809D3234 -/* 0022C 809D28BC 0C00084C */ jal osSyncPrintf - -/* 00230 809D28C0 87A5006A */ lh $a1, 0x006A($sp) -/* 00234 809D28C4 3C0E809D */ lui $t6, %hi(func_809D2F74) ## $t6 = 809D0000 -/* 00238 809D28C8 25CE2F74 */ addiu $t6, $t6, %lo(func_809D2F74) ## $t6 = 809D2F74 -/* 0023C 809D28CC 100000F9 */ beq $zero, $zero, .L809D2CB4 -/* 00240 809D28D0 AE2E014C */ sw $t6, 0x014C($s1) ## 0000014C -.L809D28D4: -/* 00244 809D28D4 824F1CBC */ lb $t7, 0x1CBC($s2) ## 00001CBC -/* 00248 809D28D8 3C06809D */ lui $a2, %hi(D_809D3130) ## $a2 = 809D0000 -/* 0024C 809D28DC 24C63130 */ addiu $a2, $a2, %lo(D_809D3130) ## $a2 = 809D3130 -/* 00250 809D28E0 000FC080 */ sll $t8, $t7, 2 -/* 00254 809D28E4 00D8C821 */ addu $t9, $a2, $t8 -/* 00258 809D28E8 8F220000 */ lw $v0, 0x0000($t9) ## 00000000 -/* 0025C 809D28EC A623015C */ sh $v1, 0x015C($s1) ## 0000015C -/* 00260 809D28F0 82491CBC */ lb $t1, 0x1CBC($s2) ## 00001CBC -/* 00264 809D28F4 3C0F809D */ lui $t7, %hi(D_809D3148) ## $t7 = 809D0000 -/* 00268 809D28F8 34644E21 */ ori $a0, $v1, 0x4E21 ## $a0 = 00004E21 -/* 0026C 809D28FC 00095080 */ sll $t2, $t1, 2 -/* 00270 809D2900 00CA5821 */ addu $t3, $a2, $t2 -/* 00274 809D2904 8D6C0000 */ lw $t4, 0x0000($t3) ## 00000000 -/* 00278 809D2908 34650001 */ ori $a1, $v1, 0x0001 ## $a1 = 00000001 -/* 0027C 809D290C 24180071 */ addiu $t8, $zero, 0x0071 ## $t8 = 00000071 -/* 00280 809D2910 A62C0160 */ sh $t4, 0x0160($s1) ## 00000160 -/* 00284 809D2914 824D1CBC */ lb $t5, 0x1CBC($s2) ## 00001CBC -/* 00288 809D2918 A7A4006C */ sh $a0, 0x006C($sp) -/* 0028C 809D291C 00021140 */ sll $v0, $v0, 5 -/* 00290 809D2920 000D7080 */ sll $t6, $t5, 2 -/* 00294 809D2924 01EE7821 */ addu $t7, $t7, $t6 -/* 00298 809D2928 8DEF3148 */ lw $t7, %lo(D_809D3148)($t7) -/* 0029C 809D292C 34424000 */ ori $v0, $v0, 0x4000 ## $v0 = 00004000 -/* 002A0 809D2930 00021400 */ sll $v0, $v0, 16 -/* 002A4 809D2934 A7AF0064 */ sh $t7, 0x0064($sp) -/* 002A8 809D2938 A625015E */ sh $a1, 0x015E($s1) ## 0000015E -/* 002AC 809D293C A6380162 */ sh $t8, 0x0162($s1) ## 00000162 -/* 002B0 809D2940 00021403 */ sra $v0, $v0, 16 -/* 002B4 809D2944 00431025 */ or $v0, $v0, $v1 ## $v0 = 00004000 -/* 002B8 809D2948 00021400 */ sll $v0, $v0, 16 -/* 002BC 809D294C 00021403 */ sra $v0, $v0, 16 -/* 002C0 809D2950 2419000D */ addiu $t9, $zero, 0x000D ## $t9 = 0000000D -/* 002C4 809D2954 26091C24 */ addiu $t1, $s0, 0x1C24 ## $t1 = 00001C24 -/* 002C8 809D2958 3C01809D */ lui $at, %hi(D_809D3450) ## $at = 809D0000 -/* 002CC 809D295C A7B90066 */ sh $t9, 0x0066($sp) -/* 002D0 809D2960 C42C3450 */ lwc1 $f12, %lo(D_809D3450)($at) -/* 002D4 809D2964 AFA9004C */ sw $t1, 0x004C($sp) -/* 002D8 809D2968 A7A2006E */ sh $v0, 0x006E($sp) -/* 002DC 809D296C AFA50050 */ sw $a1, 0x0050($sp) -/* 002E0 809D2970 AFA40054 */ sw $a0, 0x0054($sp) -/* 002E4 809D2974 0C00CFBE */ jal Math_Rand_ZeroFloat - -/* 002E8 809D2978 A7A30068 */ sh $v1, 0x0068($sp) -/* 002EC 809D297C 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 002F0 809D2980 44814000 */ mtc1 $at, $f8 ## $f8 = 1.00 -/* 002F4 809D2984 3C06809D */ lui $a2, %hi(D_809D3130) ## $a2 = 809D0000 -/* 002F8 809D2988 24C63130 */ addiu $a2, $a2, %lo(D_809D3130) ## $a2 = 809D3130 -/* 002FC 809D298C 4608003C */ c.lt.s $f0, $f8 -/* 00300 809D2990 87A30068 */ lh $v1, 0x0068($sp) -/* 00304 809D2994 8FA40054 */ lw $a0, 0x0054($sp) -/* 00308 809D2998 8FA50050 */ lw $a1, 0x0050($sp) -/* 0030C 809D299C 4500001F */ bc1f .L809D2A1C -/* 00310 809D29A0 2407000A */ addiu $a3, $zero, 0x000A ## $a3 = 0000000A -/* 00314 809D29A4 824A1CBC */ lb $t2, 0x1CBC($s2) ## 00001CBC -/* 00318 809D29A8 000A5880 */ sll $t3, $t2, 2 -/* 0031C 809D29AC 00CB6021 */ addu $t4, $a2, $t3 -/* 00320 809D29B0 8D880000 */ lw $t0, 0x0000($t4) ## 00000000 -/* 00324 809D29B4 A623015E */ sh $v1, 0x015E($s1) ## 0000015E -/* 00328 809D29B8 824D1CBC */ lb $t5, 0x1CBC($s2) ## 00001CBC -/* 0032C 809D29BC 3C0A809D */ lui $t2, %hi(D_809D3148) ## $t2 = 809D0000 -/* 00330 809D29C0 00084140 */ sll $t0, $t0, 5 -/* 00334 809D29C4 000D7080 */ sll $t6, $t5, 2 -/* 00338 809D29C8 00CE7821 */ addu $t7, $a2, $t6 -/* 0033C 809D29CC 8DF80000 */ lw $t8, 0x0000($t7) ## 00000000 -/* 00340 809D29D0 35084000 */ ori $t0, $t0, 0x4000 ## $t0 = 00004000 -/* 00344 809D29D4 00084400 */ sll $t0, $t0, 16 -/* 00348 809D29D8 A6380162 */ sh $t8, 0x0162($s1) ## 00000162 -/* 0034C 809D29DC 82591CBC */ lb $t9, 0x1CBC($s2) ## 00001CBC -/* 00350 809D29E0 00084403 */ sra $t0, $t0, 16 -/* 00354 809D29E4 A7A4006E */ sh $a0, 0x006E($sp) -/* 00358 809D29E8 00194880 */ sll $t1, $t9, 2 -/* 0035C 809D29EC 01495021 */ addu $t2, $t2, $t1 -/* 00360 809D29F0 8D4A3148 */ lw $t2, %lo(D_809D3148)($t2) -/* 00364 809D29F4 01034025 */ or $t0, $t0, $v1 ## $t0 = 00004000 -/* 00368 809D29F8 240B0071 */ addiu $t3, $zero, 0x0071 ## $t3 = 00000071 -/* 0036C 809D29FC A7AA0066 */ sh $t2, 0x0066($sp) -/* 00370 809D2A00 00084400 */ sll $t0, $t0, 16 -/* 00374 809D2A04 A625015C */ sh $a1, 0x015C($s1) ## 0000015C -/* 00378 809D2A08 A62B0160 */ sh $t3, 0x0160($s1) ## 00000160 -/* 0037C 809D2A0C 00084403 */ sra $t0, $t0, 16 -/* 00380 809D2A10 240C000D */ addiu $t4, $zero, 0x000D ## $t4 = 0000000D -/* 00384 809D2A14 A7AC0064 */ sh $t4, 0x0064($sp) -/* 00388 809D2A18 A7A8006C */ sh $t0, 0x006C($sp) -.L809D2A1C: -/* 0038C 809D2A1C 824D1CBC */ lb $t5, 0x1CBC($s2) ## 00001CBC -/* 00390 809D2A20 3C0F809D */ lui $t7, %hi(D_809D30A0) ## $t7 = 809D0000 -/* 00394 809D2A24 25EF30A0 */ addiu $t7, $t7, %lo(D_809D30A0) ## $t7 = 809D30A0 -/* 00398 809D2A28 000D7080 */ sll $t6, $t5, 2 -/* 0039C 809D2A2C 01CD7023 */ subu $t6, $t6, $t5 -/* 003A0 809D2A30 000E7080 */ sll $t6, $t6, 2 -/* 003A4 809D2A34 01CF1021 */ addu $v0, $t6, $t7 -/* 003A8 809D2A38 C44A0000 */ lwc1 $f10, 0x0000($v0) ## 00000000 -/* 003AC 809D2A3C C4500004 */ lwc1 $f16, 0x0004($v0) ## 00000004 -/* 003B0 809D2A40 C4520008 */ lwc1 $f18, 0x0008($v0) ## 00000008 -/* 003B4 809D2A44 87B9006E */ lh $t9, 0x006E($sp) -/* 003B8 809D2A48 2418C001 */ addiu $t8, $zero, 0xC001 ## $t8 = FFFFC001 -/* 003BC 809D2A4C AFB80020 */ sw $t8, 0x0020($sp) -/* 003C0 809D2A50 AFA00024 */ sw $zero, 0x0024($sp) -/* 003C4 809D2A54 AFA0001C */ sw $zero, 0x001C($sp) -/* 003C8 809D2A58 8FA4004C */ lw $a0, 0x004C($sp) -/* 003CC 809D2A5C 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 003D0 809D2A60 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 003D4 809D2A64 E7AA0010 */ swc1 $f10, 0x0010($sp) -/* 003D8 809D2A68 E7B00014 */ swc1 $f16, 0x0014($sp) -/* 003DC 809D2A6C E7B20018 */ swc1 $f18, 0x0018($sp) -/* 003E0 809D2A70 0C00C916 */ jal Actor_SpawnAsChild - -/* 003E4 809D2A74 AFB90028 */ sw $t9, 0x0028($sp) -/* 003E8 809D2A78 10400036 */ beq $v0, $zero, .L809D2B54 -/* 003EC 809D2A7C AE220150 */ sw $v0, 0x0150($s1) ## 00000150 -/* 003F0 809D2A80 3C04809D */ lui $a0, %hi(D_809D3270) ## $a0 = 809D0000 -/* 003F4 809D2A84 24843270 */ addiu $a0, $a0, %lo(D_809D3270) ## $a0 = 809D3270 -/* 003F8 809D2A88 0C00084C */ jal osSyncPrintf - -/* 003FC 809D2A8C 87A5006E */ lh $a1, 0x006E($sp) -/* 00400 809D2A90 3C04809D */ lui $a0, %hi(D_809D32B4) ## $a0 = 809D0000 -/* 00404 809D2A94 248432B4 */ addiu $a0, $a0, %lo(D_809D32B4) ## $a0 = 809D32B4 -/* 00408 809D2A98 0C00084C */ jal osSyncPrintf - -/* 0040C 809D2A9C 82451CBC */ lb $a1, 0x1CBC($s2) ## 00001CBC -/* 00410 809D2AA0 3C04809D */ lui $a0, %hi(D_809D32DC) ## $a0 = 809D0000 -/* 00414 809D2AA4 248432DC */ addiu $a0, $a0, %lo(D_809D32DC) ## $a0 = 809D32DC -/* 00418 809D2AA8 0C00084C */ jal osSyncPrintf - -/* 0041C 809D2AAC 8625015E */ lh $a1, 0x015E($s1) ## 0000015E -/* 00420 809D2AB0 3C04809D */ lui $a0, %hi(D_809D3308) ## $a0 = 809D0000 -/* 00424 809D2AB4 24843308 */ addiu $a0, $a0, %lo(D_809D3308) ## $a0 = 809D3308 -/* 00428 809D2AB8 0C00084C */ jal osSyncPrintf - -/* 0042C 809D2ABC 87A50066 */ lh $a1, 0x0066($sp) -/* 00430 809D2AC0 3C04809D */ lui $a0, %hi(D_809D332C) ## $a0 = 809D0000 -/* 00434 809D2AC4 0C00084C */ jal osSyncPrintf - -/* 00438 809D2AC8 2484332C */ addiu $a0, $a0, %lo(D_809D332C) ## $a0 = 809D332C -/* 0043C 809D2ACC 86290168 */ lh $t1, 0x0168($s1) ## 00000168 -/* 00440 809D2AD0 8FA4004C */ lw $a0, 0x004C($sp) -/* 00444 809D2AD4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00448 809D2AD8 11200007 */ beq $t1, $zero, .L809D2AF8 -/* 0044C 809D2ADC 2406010F */ addiu $a2, $zero, 0x010F ## $a2 = 0000010F -/* 00450 809D2AE0 8625015C */ lh $a1, 0x015C($s1) ## 0000015C -/* 00454 809D2AE4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00458 809D2AE8 0C00B331 */ jal Flags_SetTreasure - -/* 0045C 809D2AEC 30A5001F */ andi $a1, $a1, 0x001F ## $a1 = 00000000 -/* 00460 809D2AF0 10000019 */ beq $zero, $zero, .L809D2B58 -/* 00464 809D2AF4 824A1CBC */ lb $t2, 0x1CBC($s2) ## 00001CBC -.L809D2AF8: -/* 00468 809D2AF8 824A1CBC */ lb $t2, 0x1CBC($s2) ## 00001CBC -/* 0046C 809D2AFC 3C0C809D */ lui $t4, %hi(D_809D30A0) ## $t4 = 809D0000 -/* 00470 809D2B00 258C30A0 */ addiu $t4, $t4, %lo(D_809D30A0) ## $t4 = 809D30A0 -/* 00474 809D2B04 000A5880 */ sll $t3, $t2, 2 -/* 00478 809D2B08 016A5823 */ subu $t3, $t3, $t2 -/* 0047C 809D2B0C 000B5880 */ sll $t3, $t3, 2 -/* 00480 809D2B10 016C1021 */ addu $v0, $t3, $t4 -/* 00484 809D2B14 C4440004 */ lwc1 $f4, 0x0004($v0) ## 00000004 -/* 00488 809D2B18 C4460008 */ lwc1 $f6, 0x0008($v0) ## 00000008 -/* 0048C 809D2B1C AFA00020 */ sw $zero, 0x0020($sp) -/* 00490 809D2B20 AFA0001C */ sw $zero, 0x001C($sp) -/* 00494 809D2B24 AFA00018 */ sw $zero, 0x0018($sp) -/* 00498 809D2B28 E7A40010 */ swc1 $f4, 0x0010($sp) -/* 0049C 809D2B2C E7A60014 */ swc1 $f6, 0x0014($sp) -/* 004A0 809D2B30 862D015C */ lh $t5, 0x015C($s1) ## 0000015C -/* 004A4 809D2B34 87B80064 */ lh $t8, 0x0064($sp) -/* 004A8 809D2B38 8C470000 */ lw $a3, 0x0000($v0) ## 00000000 -/* 004AC 809D2B3C 31AE001F */ andi $t6, $t5, 0x001F ## $t6 = 00000000 -/* 004B0 809D2B40 000E7A00 */ sll $t7, $t6, 8 -/* 004B4 809D2B44 331900FF */ andi $t9, $t8, 0x00FF ## $t9 = 00000000 -/* 004B8 809D2B48 01F94821 */ addu $t1, $t7, $t9 -/* 004BC 809D2B4C 0C00C7D4 */ jal Actor_Spawn - ## ActorSpawn -/* 004C0 809D2B50 AFA90024 */ sw $t1, 0x0024($sp) -.L809D2B54: -/* 004C4 809D2B54 824A1CBC */ lb $t2, 0x1CBC($s2) ## 00001CBC -.L809D2B58: -/* 004C8 809D2B58 3C0C809D */ lui $t4, %hi(D_809D30E8) ## $t4 = 809D0000 -/* 004CC 809D2B5C 258C30E8 */ addiu $t4, $t4, %lo(D_809D30E8) ## $t4 = 809D30E8 -/* 004D0 809D2B60 000A5880 */ sll $t3, $t2, 2 -/* 004D4 809D2B64 016A5823 */ subu $t3, $t3, $t2 -/* 004D8 809D2B68 000B5880 */ sll $t3, $t3, 2 -/* 004DC 809D2B6C 016C1021 */ addu $v0, $t3, $t4 -/* 004E0 809D2B70 C4480000 */ lwc1 $f8, 0x0000($v0) ## 00000000 -/* 004E4 809D2B74 C44A0004 */ lwc1 $f10, 0x0004($v0) ## 00000004 -/* 004E8 809D2B78 C4500008 */ lwc1 $f16, 0x0008($v0) ## 00000008 -/* 004EC 809D2B7C 87AE006C */ lh $t6, 0x006C($sp) -/* 004F0 809D2B80 240D3FFF */ addiu $t5, $zero, 0x3FFF ## $t5 = 00003FFF -/* 004F4 809D2B84 AFAD0020 */ sw $t5, 0x0020($sp) -/* 004F8 809D2B88 AFA00024 */ sw $zero, 0x0024($sp) -/* 004FC 809D2B8C AFA0001C */ sw $zero, 0x001C($sp) -/* 00500 809D2B90 8FA4004C */ lw $a0, 0x004C($sp) -/* 00504 809D2B94 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 00508 809D2B98 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 0050C 809D2B9C 2407000A */ addiu $a3, $zero, 0x000A ## $a3 = 0000000A -/* 00510 809D2BA0 E7A80010 */ swc1 $f8, 0x0010($sp) -/* 00514 809D2BA4 E7AA0014 */ swc1 $f10, 0x0014($sp) -/* 00518 809D2BA8 E7B00018 */ swc1 $f16, 0x0018($sp) -/* 0051C 809D2BAC 0C00C916 */ jal Actor_SpawnAsChild - -/* 00520 809D2BB0 AFAE0028 */ sw $t6, 0x0028($sp) -/* 00524 809D2BB4 10400038 */ beq $v0, $zero, .L809D2C98 -/* 00528 809D2BB8 AE220154 */ sw $v0, 0x0154($s1) ## 00000154 -/* 0052C 809D2BBC 3C04809D */ lui $a0, %hi(D_809D3330) ## $a0 = 809D0000 -/* 00530 809D2BC0 24843330 */ addiu $a0, $a0, %lo(D_809D3330) ## $a0 = 809D3330 -/* 00534 809D2BC4 0C00084C */ jal osSyncPrintf - -/* 00538 809D2BC8 87A5006C */ lh $a1, 0x006C($sp) -/* 0053C 809D2BCC 3C04809D */ lui $a0, %hi(D_809D3374) ## $a0 = 809D0000 -/* 00540 809D2BD0 24843374 */ addiu $a0, $a0, %lo(D_809D3374) ## $a0 = 809D3374 -/* 00544 809D2BD4 0C00084C */ jal osSyncPrintf - -/* 00548 809D2BD8 82451CBC */ lb $a1, 0x1CBC($s2) ## 00001CBC -/* 0054C 809D2BDC 3C04809D */ lui $a0, %hi(D_809D339C) ## $a0 = 809D0000 -/* 00550 809D2BE0 2484339C */ addiu $a0, $a0, %lo(D_809D339C) ## $a0 = 809D339C -/* 00554 809D2BE4 0C00084C */ jal osSyncPrintf - -/* 00558 809D2BE8 8625015C */ lh $a1, 0x015C($s1) ## 0000015C -/* 0055C 809D2BEC 3C04809D */ lui $a0, %hi(D_809D33C8) ## $a0 = 809D0000 -/* 00560 809D2BF0 248433C8 */ addiu $a0, $a0, %lo(D_809D33C8) ## $a0 = 809D33C8 -/* 00564 809D2BF4 0C00084C */ jal osSyncPrintf - -/* 00568 809D2BF8 87A50064 */ lh $a1, 0x0064($sp) -/* 0056C 809D2BFC 3C04809D */ lui $a0, %hi(D_809D33EC) ## $a0 = 809D0000 -/* 00570 809D2C00 0C00084C */ jal osSyncPrintf - -/* 00574 809D2C04 248433EC */ addiu $a0, $a0, %lo(D_809D33EC) ## $a0 = 809D33EC -/* 00578 809D2C08 86380168 */ lh $t8, 0x0168($s1) ## 00000168 -/* 0057C 809D2C0C 8FA4004C */ lw $a0, 0x004C($sp) -/* 00580 809D2C10 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00584 809D2C14 13000009 */ beq $t8, $zero, .L809D2C3C -/* 00588 809D2C18 2406010F */ addiu $a2, $zero, 0x010F ## $a2 = 0000010F -/* 0058C 809D2C1C 8625015E */ lh $a1, 0x015E($s1) ## 0000015E -/* 00590 809D2C20 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00594 809D2C24 0C00B331 */ jal Flags_SetTreasure - -/* 00598 809D2C28 30A5001F */ andi $a1, $a1, 0x001F ## $a1 = 00000000 -/* 0059C 809D2C2C 0C00B55C */ jal Actor_Kill - -/* 005A0 809D2C30 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 005A4 809D2C34 10000020 */ beq $zero, $zero, .L809D2CB8 -/* 005A8 809D2C38 8FBF0044 */ lw $ra, 0x0044($sp) -.L809D2C3C: -/* 005AC 809D2C3C 824F1CBC */ lb $t7, 0x1CBC($s2) ## 00001CBC -/* 005B0 809D2C40 3C09809D */ lui $t1, %hi(D_809D30E8) ## $t1 = 809D0000 -/* 005B4 809D2C44 252930E8 */ addiu $t1, $t1, %lo(D_809D30E8) ## $t1 = 809D30E8 -/* 005B8 809D2C48 000FC880 */ sll $t9, $t7, 2 -/* 005BC 809D2C4C 032FC823 */ subu $t9, $t9, $t7 -/* 005C0 809D2C50 0019C880 */ sll $t9, $t9, 2 -/* 005C4 809D2C54 03291021 */ addu $v0, $t9, $t1 -/* 005C8 809D2C58 C4520004 */ lwc1 $f18, 0x0004($v0) ## 00000004 -/* 005CC 809D2C5C C4440008 */ lwc1 $f4, 0x0008($v0) ## 00000008 -/* 005D0 809D2C60 AFA00020 */ sw $zero, 0x0020($sp) -/* 005D4 809D2C64 AFA0001C */ sw $zero, 0x001C($sp) -/* 005D8 809D2C68 AFA00018 */ sw $zero, 0x0018($sp) -/* 005DC 809D2C6C E7B20010 */ swc1 $f18, 0x0010($sp) -/* 005E0 809D2C70 E7A40014 */ swc1 $f4, 0x0014($sp) -/* 005E4 809D2C74 862A015E */ lh $t2, 0x015E($s1) ## 0000015E -/* 005E8 809D2C78 87AD0066 */ lh $t5, 0x0066($sp) -/* 005EC 809D2C7C 8C470000 */ lw $a3, 0x0000($v0) ## 00000000 -/* 005F0 809D2C80 314B001F */ andi $t3, $t2, 0x001F ## $t3 = 00000000 -/* 005F4 809D2C84 000B6200 */ sll $t4, $t3, 8 -/* 005F8 809D2C88 31AE00FF */ andi $t6, $t5, 0x00FF ## $t6 = 00000000 -/* 005FC 809D2C8C 018EC021 */ addu $t8, $t4, $t6 -/* 00600 809D2C90 0C00C7D4 */ jal Actor_Spawn - ## ActorSpawn -/* 00604 809D2C94 AFB80024 */ sw $t8, 0x0024($sp) -.L809D2C98: -/* 00608 809D2C98 8E2F0004 */ lw $t7, 0x0004($s1) ## 00000004 -/* 0060C 809D2C9C 2401FFFE */ addiu $at, $zero, 0xFFFE ## $at = FFFFFFFE -/* 00610 809D2CA0 3C09809D */ lui $t1, %hi(func_809D2CCC) ## $t1 = 809D0000 -/* 00614 809D2CA4 25292CCC */ addiu $t1, $t1, %lo(func_809D2CCC) ## $t1 = 809D2CCC -/* 00618 809D2CA8 01E1C824 */ and $t9, $t7, $at -/* 0061C 809D2CAC AE390004 */ sw $t9, 0x0004($s1) ## 00000004 -/* 00620 809D2CB0 AE29014C */ sw $t1, 0x014C($s1) ## 0000014C -.L809D2CB4: -/* 00624 809D2CB4 8FBF0044 */ lw $ra, 0x0044($sp) -.L809D2CB8: -/* 00628 809D2CB8 8FB00038 */ lw $s0, 0x0038($sp) -/* 0062C 809D2CBC 8FB1003C */ lw $s1, 0x003C($sp) -/* 00630 809D2CC0 8FB20040 */ lw $s2, 0x0040($sp) -/* 00634 809D2CC4 03E00008 */ jr $ra -/* 00638 809D2CC8 27BD0078 */ addiu $sp, $sp, 0x0078 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Update.s deleted file mode 100644 index a56757fc86..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Update.s +++ /dev/null @@ -1,51 +0,0 @@ -glabel EnChanger_Update -/* 00934 809D2FC4 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8 -/* 00938 809D2FC8 AFBF0044 */ sw $ra, 0x0044($sp) -/* 0093C 809D2FCC AFA5004C */ sw $a1, 0x004C($sp) -/* 00940 809D2FD0 AFA40048 */ sw $a0, 0x0048($sp) -/* 00944 809D2FD4 8C99014C */ lw $t9, 0x014C($a0) ## 0000014C -/* 00948 809D2FD8 0320F809 */ jalr $ra, $t9 -/* 0094C 809D2FDC 00000000 */ nop -/* 00950 809D2FE0 8FA40048 */ lw $a0, 0x0048($sp) -/* 00954 809D2FE4 3C0F8016 */ lui $t7, %hi(gGameInfo) -/* 00958 809D2FE8 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 0095C 809D2FEC 84820166 */ lh $v0, 0x0166($a0) ## 00000166 -/* 00960 809D2FF0 240A00FF */ addiu $t2, $zero, 0x00FF ## $t2 = 000000FF -/* 00964 809D2FF4 240B00FF */ addiu $t3, $zero, 0x00FF ## $t3 = 000000FF -/* 00968 809D2FF8 10400002 */ beq $v0, $zero, .L809D3004 -/* 0096C 809D2FFC 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 00970 809D3000 A48E0166 */ sh $t6, 0x0166($a0) ## 00000166 -.L809D3004: -/* 00974 809D3004 8DEFFA90 */ lw $t7, %lo(gGameInfo)($t7) -/* 00978 809D3008 240C00FF */ addiu $t4, $zero, 0x00FF ## $t4 = 000000FF -/* 0097C 809D300C 240D0004 */ addiu $t5, $zero, 0x0004 ## $t5 = 00000004 -/* 00980 809D3010 85F812D4 */ lh $t8, 0x12D4($t7) ## 801612D4 -/* 00984 809D3014 53000017 */ beql $t8, $zero, .L809D3074 -/* 00988 809D3018 8FBF0044 */ lw $ra, 0x0044($sp) -/* 0098C 809D301C 84880032 */ lh $t0, 0x0032($a0) ## 00000032 -/* 00990 809D3020 C48C0024 */ lwc1 $f12, 0x0024($a0) ## 00000024 -/* 00994 809D3024 C48E0028 */ lwc1 $f14, 0x0028($a0) ## 00000028 -/* 00998 809D3028 8C86002C */ lw $a2, 0x002C($a0) ## 0000002C -/* 0099C 809D302C 84870030 */ lh $a3, 0x0030($a0) ## 00000030 -/* 009A0 809D3030 AFA80010 */ sw $t0, 0x0010($sp) -/* 009A4 809D3034 84890034 */ lh $t1, 0x0034($a0) ## 00000034 -/* 009A8 809D3038 44810000 */ mtc1 $at, $f0 ## $f0 = 1.00 -/* 009AC 809D303C 8FB9004C */ lw $t9, 0x004C($sp) -/* 009B0 809D3040 AFAD0034 */ sw $t5, 0x0034($sp) -/* 009B4 809D3044 AFAC0030 */ sw $t4, 0x0030($sp) -/* 009B8 809D3048 AFAB002C */ sw $t3, 0x002C($sp) -/* 009BC 809D304C AFA00028 */ sw $zero, 0x0028($sp) -/* 009C0 809D3050 AFAA0024 */ sw $t2, 0x0024($sp) -/* 009C4 809D3054 AFA90014 */ sw $t1, 0x0014($sp) -/* 009C8 809D3058 E7A00018 */ swc1 $f0, 0x0018($sp) -/* 009CC 809D305C E7A0001C */ swc1 $f0, 0x001C($sp) -/* 009D0 809D3060 E7A00020 */ swc1 $f0, 0x0020($sp) -/* 009D4 809D3064 8F2E0000 */ lw $t6, 0x0000($t9) ## 00000000 -/* 009D8 809D3068 0C018FA7 */ jal DebugDisplay_AddObject - -/* 009DC 809D306C AFAE0038 */ sw $t6, 0x0038($sp) -/* 009E0 809D3070 8FBF0044 */ lw $ra, 0x0044($sp) -.L809D3074: -/* 009E4 809D3074 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000 -/* 009E8 809D3078 03E00008 */ jr $ra -/* 009EC 809D307C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2CCC.s b/asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2CCC.s deleted file mode 100644 index 87aa343920..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2CCC.s +++ /dev/null @@ -1,47 +0,0 @@ -glabel func_809D2CCC -/* 0063C 809D2CCC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00640 809D2CD0 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00644 809D2CD4 8C8E0150 */ lw $t6, 0x0150($a0) ## 00000150 -/* 00648 809D2CD8 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 0064C 809D2CDC 00A03825 */ or $a3, $a1, $zero ## $a3 = 00000000 -/* 00650 809D2CE0 85CF01F4 */ lh $t7, 0x01F4($t6) ## 000001F4 -/* 00654 809D2CE4 24180050 */ addiu $t8, $zero, 0x0050 ## $t8 = 00000050 -/* 00658 809D2CE8 51E0000D */ beql $t7, $zero, .L809D2D20 -/* 0065C 809D2CEC 8CC80154 */ lw $t0, 0x0154($a2) ## 00000154 -/* 00660 809D2CF0 A4980166 */ sh $t8, 0x0166($a0) ## 00000166 -/* 00664 809D2CF4 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00668 809D2CF8 84C5015E */ lh $a1, 0x015E($a2) ## 0000015E -/* 0066C 809D2CFC AFA60018 */ sw $a2, 0x0018($sp) -/* 00670 809D2D00 0C00B331 */ jal Flags_SetTreasure - -/* 00674 809D2D04 30A5001F */ andi $a1, $a1, 0x001F ## $a1 = 00000000 -/* 00678 809D2D08 8FA60018 */ lw $a2, 0x0018($sp) -/* 0067C 809D2D0C 3C19809D */ lui $t9, %hi(func_809D2D70) ## $t9 = 809D0000 -/* 00680 809D2D10 27392D70 */ addiu $t9, $t9, %lo(func_809D2D70) ## $t9 = 809D2D70 -/* 00684 809D2D14 10000012 */ beq $zero, $zero, .L809D2D60 -/* 00688 809D2D18 ACD9014C */ sw $t9, 0x014C($a2) ## 0000014C -/* 0068C 809D2D1C 8CC80154 */ lw $t0, 0x0154($a2) ## 00000154 -.L809D2D20: -/* 00690 809D2D20 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 00694 809D2D24 240B0050 */ addiu $t3, $zero, 0x0050 ## $t3 = 00000050 -/* 00698 809D2D28 850901F4 */ lh $t1, 0x01F4($t0) ## 000001F4 -/* 0069C 809D2D2C 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 006A0 809D2D30 5120000C */ beql $t1, $zero, .L809D2D64 -/* 006A4 809D2D34 8FBF0014 */ lw $ra, 0x0014($sp) -/* 006A8 809D2D38 84C5015C */ lh $a1, 0x015C($a2) ## 0000015C -/* 006AC 809D2D3C A4CA0164 */ sh $t2, 0x0164($a2) ## 00000164 -/* 006B0 809D2D40 A4CB0166 */ sh $t3, 0x0166($a2) ## 00000166 -/* 006B4 809D2D44 AFA60018 */ sw $a2, 0x0018($sp) -/* 006B8 809D2D48 0C00B331 */ jal Flags_SetTreasure - -/* 006BC 809D2D4C 30A5001F */ andi $a1, $a1, 0x001F ## $a1 = 00000000 -/* 006C0 809D2D50 8FA60018 */ lw $a2, 0x0018($sp) -/* 006C4 809D2D54 3C0C809D */ lui $t4, %hi(func_809D2D70) ## $t4 = 809D0000 -/* 006C8 809D2D58 258C2D70 */ addiu $t4, $t4, %lo(func_809D2D70) ## $t4 = 809D2D70 -/* 006CC 809D2D5C ACCC014C */ sw $t4, 0x014C($a2) ## 0000014C -.L809D2D60: -/* 006D0 809D2D60 8FBF0014 */ lw $ra, 0x0014($sp) -.L809D2D64: -/* 006D4 809D2D64 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 006D8 809D2D68 03E00008 */ jr $ra -/* 006DC 809D2D6C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2D70.s b/asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2D70.s deleted file mode 100644 index adff9dd1d2..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2D70.s +++ /dev/null @@ -1,155 +0,0 @@ -.rdata -glabel D_809D33F0 - .asciz "\x1b[32m☆☆☆☆☆ 右宝開く ☆☆☆☆☆ %d\n\x1b[m" - .balign 4 - -glabel D_809D341C - .asciz "\x1b[32m☆☆☆☆☆ 左宝開く ☆☆☆☆☆ %d\n\x1b[m" - .balign 4 - -.text -glabel func_809D2D70 -/* 006E0 809D2D70 27BDFFB0 */ addiu $sp, $sp, 0xFFB0 ## $sp = FFFFFFB0 -/* 006E4 809D2D74 AFBF003C */ sw $ra, 0x003C($sp) -/* 006E8 809D2D78 AFB20038 */ sw $s2, 0x0038($sp) -/* 006EC 809D2D7C AFB10034 */ sw $s1, 0x0034($sp) -/* 006F0 809D2D80 AFB00030 */ sw $s0, 0x0030($sp) -/* 006F4 809D2D84 848E0166 */ lh $t6, 0x0166($a0) ## 00000166 -/* 006F8 809D2D88 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 006FC 809D2D8C 00809025 */ or $s2, $a0, $zero ## $s2 = 00000000 -/* 00700 809D2D90 8C820150 */ lw $v0, 0x0150($a0) ## 00000150 -/* 00704 809D2D94 15C00071 */ bne $t6, $zero, .L809D2F5C -/* 00708 809D2D98 8C830154 */ lw $v1, 0x0154($a0) ## 00000154 -/* 0070C 809D2D9C 84840164 */ lh $a0, 0x0164($a0) ## 00000164 -/* 00710 809D2DA0 24010071 */ addiu $at, $zero, 0x0071 ## $at = 00000071 -/* 00714 809D2DA4 50800007 */ beql $a0, $zero, .L809D2DC4 -/* 00718 809D2DA8 86420162 */ lh $v0, 0x0162($s2) ## 00000162 -/* 0071C 809D2DAC 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 00720 809D2DB0 50810037 */ beql $a0, $at, .L809D2E90 -/* 00724 809D2DB4 86430160 */ lh $v1, 0x0160($s2) ## 00000160 -/* 00728 809D2DB8 10000066 */ beq $zero, $zero, .L809D2F54 -/* 0072C 809D2DBC 00000000 */ nop -/* 00730 809D2DC0 86420162 */ lh $v0, 0x0162($s2) ## 00000162 -.L809D2DC4: -/* 00734 809D2DC4 C4600024 */ lwc1 $f0, 0x0024($v1) ## 00000024 -/* 00738 809D2DC8 C4620028 */ lwc1 $f2, 0x0028($v1) ## 00000028 -/* 0073C 809D2DCC 14410012 */ bne $v0, $at, .L809D2E18 -/* 00740 809D2DD0 C46C002C */ lwc1 $f12, 0x002C($v1) ## 0000002C -/* 00744 809D2DD4 44070000 */ mfc1 $a3, $f0 -/* 00748 809D2DD8 240F000F */ addiu $t7, $zero, 0x000F ## $t7 = 0000000F -/* 0074C 809D2DDC AFAF0024 */ sw $t7, 0x0024($sp) -/* 00750 809D2DE0 26241C24 */ addiu $a0, $s1, 0x1C24 ## $a0 = 00001C24 -/* 00754 809D2DE4 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 00758 809D2DE8 24060168 */ addiu $a2, $zero, 0x0168 ## $a2 = 00000168 -/* 0075C 809D2DEC E7A20010 */ swc1 $f2, 0x0010($sp) -/* 00760 809D2DF0 E7AC0014 */ swc1 $f12, 0x0014($sp) -/* 00764 809D2DF4 AFA00018 */ sw $zero, 0x0018($sp) -/* 00768 809D2DF8 AFA0001C */ sw $zero, 0x001C($sp) -/* 0076C 809D2DFC 0C00C7D4 */ jal Actor_Spawn - ## ActorSpawn -/* 00770 809D2E00 AFA00020 */ sw $zero, 0x0020($sp) -/* 00774 809D2E04 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00778 809D2E08 0C00B2DD */ jal Flags_SetSwitch - -/* 0077C 809D2E0C 24050032 */ addiu $a1, $zero, 0x0032 ## $a1 = 00000032 -/* 00780 809D2E10 10000050 */ beq $zero, $zero, .L809D2F54 -/* 00784 809D2E14 00000000 */ nop -.L809D2E18: -/* 00788 809D2E18 2450FF8E */ addiu $s0, $v0, 0xFF8E ## $s0 = FFFFFF8E -/* 0078C 809D2E1C 00108400 */ sll $s0, $s0, 16 -/* 00790 809D2E20 00108403 */ sra $s0, $s0, 16 -/* 00794 809D2E24 2610000A */ addiu $s0, $s0, 0x000A ## $s0 = FFFFFF98 -/* 00798 809D2E28 00108400 */ sll $s0, $s0, 16 -/* 0079C 809D2E2C 00108403 */ sra $s0, $s0, 16 -/* 007A0 809D2E30 3C04809D */ lui $a0, %hi(D_809D33F0) ## $a0 = 809D0000 -/* 007A4 809D2E34 248433F0 */ addiu $a0, $a0, %lo(D_809D33F0) ## $a0 = 809D33F0 -/* 007A8 809D2E38 02002825 */ or $a1, $s0, $zero ## $a1 = FFFFFF98 -/* 007AC 809D2E3C E7A00044 */ swc1 $f0, 0x0044($sp) -/* 007B0 809D2E40 E7A20048 */ swc1 $f2, 0x0048($sp) -/* 007B4 809D2E44 0C00084C */ jal osSyncPrintf - -/* 007B8 809D2E48 E7AC004C */ swc1 $f12, 0x004C($sp) -/* 007BC 809D2E4C C7A00044 */ lwc1 $f0, 0x0044($sp) -/* 007C0 809D2E50 C7A20048 */ lwc1 $f2, 0x0048($sp) -/* 007C4 809D2E54 C7AC004C */ lwc1 $f12, 0x004C($sp) -/* 007C8 809D2E58 44070000 */ mfc1 $a3, $f0 -/* 007CC 809D2E5C 26241C24 */ addiu $a0, $s1, 0x1C24 ## $a0 = 00001C24 -/* 007D0 809D2E60 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 007D4 809D2E64 24060168 */ addiu $a2, $zero, 0x0168 ## $a2 = 00000168 -/* 007D8 809D2E68 AFA00018 */ sw $zero, 0x0018($sp) -/* 007DC 809D2E6C AFA0001C */ sw $zero, 0x001C($sp) -/* 007E0 809D2E70 AFA00020 */ sw $zero, 0x0020($sp) -/* 007E4 809D2E74 AFB00024 */ sw $s0, 0x0024($sp) -/* 007E8 809D2E78 E7A20010 */ swc1 $f2, 0x0010($sp) -/* 007EC 809D2E7C 0C00C7D4 */ jal Actor_Spawn - ## ActorSpawn -/* 007F0 809D2E80 E7AC0014 */ swc1 $f12, 0x0014($sp) -/* 007F4 809D2E84 10000033 */ beq $zero, $zero, .L809D2F54 -/* 007F8 809D2E88 00000000 */ nop -/* 007FC 809D2E8C 86430160 */ lh $v1, 0x0160($s2) ## 00000160 -.L809D2E90: -/* 00800 809D2E90 24010071 */ addiu $at, $zero, 0x0071 ## $at = 00000071 -/* 00804 809D2E94 C4400024 */ lwc1 $f0, 0x0024($v0) ## 00000024 -/* 00808 809D2E98 C4420028 */ lwc1 $f2, 0x0028($v0) ## 00000028 -/* 0080C 809D2E9C 14610012 */ bne $v1, $at, .L809D2EE8 -/* 00810 809D2EA0 C44C002C */ lwc1 $f12, 0x002C($v0) ## 0000002C -/* 00814 809D2EA4 44070000 */ mfc1 $a3, $f0 -/* 00818 809D2EA8 2418000F */ addiu $t8, $zero, 0x000F ## $t8 = 0000000F -/* 0081C 809D2EAC AFB80024 */ sw $t8, 0x0024($sp) -/* 00820 809D2EB0 26241C24 */ addiu $a0, $s1, 0x1C24 ## $a0 = 00001C24 -/* 00824 809D2EB4 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 00828 809D2EB8 24060168 */ addiu $a2, $zero, 0x0168 ## $a2 = 00000168 -/* 0082C 809D2EBC E7A20010 */ swc1 $f2, 0x0010($sp) -/* 00830 809D2EC0 E7AC0014 */ swc1 $f12, 0x0014($sp) -/* 00834 809D2EC4 AFA00018 */ sw $zero, 0x0018($sp) -/* 00838 809D2EC8 AFA0001C */ sw $zero, 0x001C($sp) -/* 0083C 809D2ECC 0C00C7D4 */ jal Actor_Spawn - ## ActorSpawn -/* 00840 809D2ED0 AFA00020 */ sw $zero, 0x0020($sp) -/* 00844 809D2ED4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00848 809D2ED8 0C00B2DD */ jal Flags_SetSwitch - -/* 0084C 809D2EDC 24050032 */ addiu $a1, $zero, 0x0032 ## $a1 = 00000032 -/* 00850 809D2EE0 1000001C */ beq $zero, $zero, .L809D2F54 -/* 00854 809D2EE4 00000000 */ nop -.L809D2EE8: -/* 00858 809D2EE8 2470FF8E */ addiu $s0, $v1, 0xFF8E ## $s0 = FFFFFF8E -/* 0085C 809D2EEC 00108400 */ sll $s0, $s0, 16 -/* 00860 809D2EF0 00108403 */ sra $s0, $s0, 16 -/* 00864 809D2EF4 2610000A */ addiu $s0, $s0, 0x000A ## $s0 = FFFFFF98 -/* 00868 809D2EF8 00108400 */ sll $s0, $s0, 16 -/* 0086C 809D2EFC 00108403 */ sra $s0, $s0, 16 -/* 00870 809D2F00 3C04809D */ lui $a0, %hi(D_809D341C) ## $a0 = 809D0000 -/* 00874 809D2F04 2484341C */ addiu $a0, $a0, %lo(D_809D341C) ## $a0 = 809D341C -/* 00878 809D2F08 02002825 */ or $a1, $s0, $zero ## $a1 = FFFFFF98 -/* 0087C 809D2F0C E7A00044 */ swc1 $f0, 0x0044($sp) -/* 00880 809D2F10 E7A20048 */ swc1 $f2, 0x0048($sp) -/* 00884 809D2F14 0C00084C */ jal osSyncPrintf - -/* 00888 809D2F18 E7AC004C */ swc1 $f12, 0x004C($sp) -/* 0088C 809D2F1C C7A00044 */ lwc1 $f0, 0x0044($sp) -/* 00890 809D2F20 C7A20048 */ lwc1 $f2, 0x0048($sp) -/* 00894 809D2F24 C7AC004C */ lwc1 $f12, 0x004C($sp) -/* 00898 809D2F28 44070000 */ mfc1 $a3, $f0 -/* 0089C 809D2F2C 26241C24 */ addiu $a0, $s1, 0x1C24 ## $a0 = 00001C24 -/* 008A0 809D2F30 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 008A4 809D2F34 24060168 */ addiu $a2, $zero, 0x0168 ## $a2 = 00000168 -/* 008A8 809D2F38 AFA00018 */ sw $zero, 0x0018($sp) -/* 008AC 809D2F3C AFA0001C */ sw $zero, 0x001C($sp) -/* 008B0 809D2F40 AFA00020 */ sw $zero, 0x0020($sp) -/* 008B4 809D2F44 AFB00024 */ sw $s0, 0x0024($sp) -/* 008B8 809D2F48 E7A20010 */ swc1 $f2, 0x0010($sp) -/* 008BC 809D2F4C 0C00C7D4 */ jal Actor_Spawn - ## ActorSpawn -/* 008C0 809D2F50 E7AC0014 */ swc1 $f12, 0x0014($sp) -.L809D2F54: -/* 008C4 809D2F54 0C00B55C */ jal Actor_Kill - -/* 008C8 809D2F58 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -.L809D2F5C: -/* 008CC 809D2F5C 8FBF003C */ lw $ra, 0x003C($sp) -/* 008D0 809D2F60 8FB00030 */ lw $s0, 0x0030($sp) -/* 008D4 809D2F64 8FB10034 */ lw $s1, 0x0034($sp) -/* 008D8 809D2F68 8FB20038 */ lw $s2, 0x0038($sp) -/* 008DC 809D2F6C 03E00008 */ jr $ra -/* 008E0 809D2F70 27BD0050 */ addiu $sp, $sp, 0x0050 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2F74.s b/asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2F74.s deleted file mode 100644 index 1eef4d8c6e..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2F74.s +++ /dev/null @@ -1,24 +0,0 @@ -glabel func_809D2F74 -/* 008E4 809D2F74 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 008E8 809D2F78 AFBF0014 */ sw $ra, 0x0014($sp) -/* 008EC 809D2F7C AFA5001C */ sw $a1, 0x001C($sp) -/* 008F0 809D2F80 8C8E0158 */ lw $t6, 0x0158($a0) ## 00000158 -/* 008F4 809D2F84 3C038016 */ lui $v1, %hi(gSaveContext) -/* 008F8 809D2F88 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 008FC 809D2F8C 85CF01F4 */ lh $t7, 0x01F4($t6) ## 000001F4 -/* 00900 809D2F90 51E00009 */ beql $t7, $zero, .L809D2FB8 -/* 00904 809D2F94 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00908 809D2F98 94620EF2 */ lhu $v0, 0x0EF2($v1) ## 8015F552 -/* 0090C 809D2F9C 30580800 */ andi $t8, $v0, 0x0800 ## $t8 = 00000000 -/* 00910 809D2FA0 17000002 */ bne $t8, $zero, .L809D2FAC -/* 00914 809D2FA4 34590800 */ ori $t9, $v0, 0x0800 ## $t9 = 00000800 -/* 00918 809D2FA8 A4790EF2 */ sh $t9, 0x0EF2($v1) ## 8015F552 -.L809D2FAC: -/* 0091C 809D2FAC 0C00B55C */ jal Actor_Kill - -/* 00920 809D2FB0 00000000 */ nop -/* 00924 809D2FB4 8FBF0014 */ lw $ra, 0x0014($sp) -.L809D2FB8: -/* 00928 809D2FB8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0092C 809D2FBC 03E00008 */ jr $ra -/* 00930 809D2FC0 00000000 */ nop diff --git a/data/overlays/actors/z_en_changer.data.s b/data/overlays/actors/z_en_changer.data.s deleted file mode 100644 index 60b3c223b1..0000000000 --- a/data/overlays/actors/z_en_changer.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 En_Changer_InitVars - .word 0x01550600, 0x00000000, 0x00010000, 0x0000016C -.word EnChanger_Init -.word EnChanger_Destroy -.word EnChanger_Update -.word 0x00000000 -glabel D_809D30A0 - .word 0x00000000, 0x00000000, 0x00000000, 0xC2C80000, 0x41A00000, 0xC3750000, 0xC2C80000, 0x41A00000, 0xC42B4000, 0xC2C80000, 0x41A00000, 0xC48CA000, 0xC2C80000, 0x41A00000, 0xC4C3A000, 0xC2C80000, 0x41A00000, 0xC4FAA000 -glabel D_809D30E8 - .word 0x00000000, 0x00000000, 0x00000000, 0x430C0000, 0x41A00000, 0xC3750000, 0x430C0000, 0x41A00000, 0xC42B4000, 0x430C0000, 0x41A00000, 0xC48CA000, 0x430C0000, 0x41A00000, 0xC4C3A000, 0x430C0000, 0x41A00000, 0xC4FAA000 -glabel D_809D3130 - .word 0x00000000, 0x00000072, 0x00000072, 0x00000073, 0x00000073, 0x00000074 -glabel D_809D3148 - .word 0x00000000, 0x00000008, 0x00000008, 0x00000009, 0x00000009, 0x0000000A -glabel D_809D3160 - .word 0x00000000, 0x00000002, 0x00000004, 0x00000006, 0x00000008 -glabel D_809D3174 - .word 0x0000000A, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_en_changer.reloc.s b/data/overlays/actors/z_en_changer.reloc.s deleted file mode 100644 index cd0f368a7d..0000000000 --- a/data/overlays/actors/z_en_changer.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_809D3460 - .incbin "baserom/ovl_En_Changer", 0xDD0, 0x00000150 diff --git a/spec b/spec index 0f310bbae4..36148be4ed 100644 --- a/spec +++ b/spec @@ -2057,8 +2057,7 @@ endseg beginseg name "ovl_En_Changer" include "build/src/overlays/actors/ovl_En_Changer/z_en_changer.o" - include "build/data/overlays/actors/z_en_changer.data.o" - include "build/data/overlays/actors/z_en_changer.reloc.o" + include "build/src/overlays/actors/ovl_En_Changer/ovl_En_Changer_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/src/overlays/actors/ovl_En_Changer/z_en_changer.c index fadffbc87c..884dd02f75 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -1,14 +1,30 @@ +/* + * File: z_en_changer.c + * Overlay: ovl_En_Changer + * Description: Treasure Box Shop Minigame + */ + #include "z_en_changer.h" +#include "vt.h" +#include "overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h" #define FLAGS 0x00000000 #define THIS ((EnChanger*)thisx) +typedef enum { + /* 0 */ CHEST_LEFT, + /* 1 */ CHEST_RIGHT +} ChangerChestSide; + void EnChanger_Init(Actor* thisx, GlobalContext* globalCtx); void EnChanger_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnChanger_Update(Actor* thisx, GlobalContext* globalCtx); -/* +void EnChanger_Wait(EnChanger* this, GlobalContext* globalCtx); +void EnChanger_OpenChests(EnChanger* this, GlobalContext* globalCtx); +void EnChanger_SetHeartPieceFlag(EnChanger* this, GlobalContext* globalCtx); + const ActorInit En_Changer_InitVars = { ACTOR_EN_CHANGER, ACTORTYPE_PROP, @@ -20,15 +36,266 @@ const ActorInit En_Changer_InitVars = { (ActorFunc)EnChanger_Update, NULL, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Destroy.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Init.s") +static Vec3f sLeftChestPos[] = { + { 0.0f, 0.0f, 0.0f }, { -100.0f, 20.0f, -245.0f }, { -100.0f, 20.0f, -685.0f }, + { -100.0f, 20.0f, -1125.0f }, { -100.0f, 20.0f, -1565.0f }, { -100.0f, 20.0f, -2005.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2CCC.s") +static Vec3f sRightChestPos[] = { + { 0.0f, 0.0f, 0.0f }, { 140.0f, 20.0f, -245.0f }, { 140.0f, 20.0f, -685.0f }, + { 140.0f, 20.0f, -1125.0f }, { 140.0f, 20.0f, -1565.0f }, { 140.0f, 20.0f, -2005.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2D70.s") +static s32 sLoserGetItemIds[] = { + GI_NONE, GI_RUPEE_GREEN_LOSE, GI_RUPEE_GREEN_LOSE, GI_RUPEE_BLUE_LOSE, GI_RUPEE_BLUE_LOSE, GI_RUPEE_RED_LOSE, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Changer/func_809D2F74.s") +static s32 sItemEtcTypes[] = { + 0, + ITEM_ETC_RUPEE_GREEN_CHEST_GAME, + ITEM_ETC_RUPEE_GREEN_CHEST_GAME, + ITEM_ETC_RUPEE_BLUE_CHEST_GAME, + ITEM_ETC_RUPEE_BLUE_CHEST_GAME, + ITEM_ETC_RUPEE_RED_CHEST_GAME, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Changer/EnChanger_Update.s") +static s32 sTreasureFlags[] = { 0x0000, 0x0002, 0x0004, 0x0006, 0x0008, 0x000A }; + +void EnChanger_Destroy(Actor* thisx, GlobalContext* globalCtx) { +} + +void EnChanger_Init(Actor* thisx, GlobalContext* globalCtx2) { + EnChanger* this = THIS; + GlobalContext* globalCtx = globalCtx2; + s16 leftChestParams; + s16 rightChestParams; + s16 rewardChestParams; + s16 minigameRoomNum; + s16 rightChestItem; + s16 leftChestItem; + s16 temp_v1_3; + s16 new_var; + s32 rewardParams; + + if (1) {} + + minigameRoomNum = globalCtx->roomCtx.curRoom.num - 1; + if (minigameRoomNum < 0) { + minigameRoomNum = 0; + } + if (Flags_GetTreasure(globalCtx, sTreasureFlags[minigameRoomNum])) { + this->roomChestsOpened = true; + } + + osSyncPrintf("\n\n"); + // Treasure generation (which room is it?) + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 宝発生(部屋はどれ?) %d\n" VT_RST, globalCtx->roomCtx.curRoom.num); + // How is the Bit? + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ビットは? \t %x\n" VT_RST, globalCtx->actorCtx.flags.chest); + // How is the Save BIT? + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セーブBITは? %x\n" VT_RST, sTreasureFlags[minigameRoomNum]); + // Is it already a zombie? + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ もう、ゾンビ?\t %d\n" VT_RST, this->roomChestsOpened); + osSyncPrintf("\n\n"); + + minigameRoomNum *= 2; + // Spawn Heart Piece in chest (or Purple Rupee if won Heart Piece) + if (globalCtx->roomCtx.curRoom.num >= 6) { + rewardChestParams = ((gSaveContext.itemGetInf[1] & 0x800) ? (0x4EA0) : (0x4EC0)); + rewardChestParams = sTreasureFlags[5] | rewardChestParams; + this->finalChest = (EnBox*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_BOX, + 20.0f, 20.0f, -2500.0f, 0, 0x7FFF, 0, rewardChestParams); + if (this->finalChest != NULL) { + if (this->roomChestsOpened) { + Flags_SetTreasure(globalCtx, rewardChestParams & 0x1F); + Actor_Kill(&this->actor); + return; + } else { + rewardParams = ((gSaveContext.itemGetInf[1] & 0x800) ? (ITEM_ETC_RUPEE_PURPLE_CHEST_GAME) + : (ITEM_ETC_HEART_PIECE_CHEST_GAME)) & + 0xFF; + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_ETCETERA, 20.0f, 20.0f, -2500.0f, 0, 0, 0, + ((sTreasureFlags[5] & 0x1F) << 8) + rewardParams); + // Central treasure instance/occurrence (GREAT) + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 中央宝発生(GREAT) ☆☆☆☆☆ %x\n" VT_RST, rewardChestParams); + this->actionFunc = EnChanger_SetHeartPieceFlag; + return; + } + } + } + + temp_v1_3 = minigameRoomNum; + // Set up items in chests, swap them round with probability 1/2 + leftChestParams = (sLoserGetItemIds[globalCtx->roomCtx.curRoom.num] << 5) | 0x4000; + new_var = temp_v1_3; + this->leftChestNum = new_var; + this->leftChestGetItemId = sLoserGetItemIds[globalCtx->roomCtx.curRoom.num]; + leftChestItem = sItemEtcTypes[globalCtx->roomCtx.curRoom.num]; + leftChestParams |= new_var; + rightChestParams = new_var | 0x4E21; + this->rightChestNum = new_var | 1; + this->rightChestGetItemId = GI_DOOR_KEY; + rightChestItem = ITEM_ETC_KEY_SMALL_CHEST_GAME; + + if (Math_Rand_ZeroFloat(1.99f) < 1.0f) { + rightChestParams = (sLoserGetItemIds[globalCtx->roomCtx.curRoom.num] << 5) | 0x4000; + this->rightChestNum = new_var; + this->rightChestGetItemId = sLoserGetItemIds[globalCtx->roomCtx.curRoom.num]; + rightChestItem = sItemEtcTypes[globalCtx->roomCtx.curRoom.num]; + leftChestParams = new_var | 0x4E21; + rightChestParams |= new_var; + this->leftChestNum = temp_v1_3 | 1; + this->leftChestGetItemId = GI_DOOR_KEY; + leftChestItem = ITEM_ETC_KEY_SMALL_CHEST_GAME; + } + + this->leftChest = (EnBox*)Actor_SpawnAsChild( + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_BOX, sLeftChestPos[globalCtx->roomCtx.curRoom.num].x, + sLeftChestPos[globalCtx->roomCtx.curRoom.num].y, sLeftChestPos[globalCtx->roomCtx.curRoom.num].z, 0, -0x3FFF, 0, + leftChestParams); + + if (this->leftChest != NULL) { + // Left treasure generation (what does it contain?) + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 左宝発生(ナニがはいってるの?) ☆☆☆☆☆ %x\n" VT_RST, leftChestParams); + // What is the room number? + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 部屋番号は? %x\n" VT_RST, globalCtx->roomCtx.curRoom.num); + // What is the bit? + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ ビットはなぁに? %x\n" VT_RST, this->rightChestNum); + // Sukesuke-kun (something to do with being invisible) + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ すけすけ君? %x\n" VT_RST, rightChestItem); + osSyncPrintf("\n\n"); + if (this->roomChestsOpened) { + Flags_SetTreasure(globalCtx, this->leftChestNum & 0x1F); + } else { + Actor_Spawn( + &globalCtx->actorCtx, globalCtx, ACTOR_ITEM_ETCETERA, sLeftChestPos[globalCtx->roomCtx.curRoom.num].x, + sLeftChestPos[globalCtx->roomCtx.curRoom.num].y, sLeftChestPos[globalCtx->roomCtx.curRoom.num].z, 0, 0, + 0, ((this->leftChestNum & 0x1F) << 8) + (leftChestItem & 0xFF)); + } + } + + this->rightChest = (EnBox*)Actor_SpawnAsChild( + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_BOX, sRightChestPos[globalCtx->roomCtx.curRoom.num].x, + sRightChestPos[globalCtx->roomCtx.curRoom.num].y, sRightChestPos[globalCtx->roomCtx.curRoom.num].z, 0, 0x3FFF, + 0, rightChestParams); + + if (this->rightChest != NULL) { + // Right treasure generation (what does it contain?) + osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 右宝発生(ナニがはいってるの?) ☆☆☆☆☆ %x\n" VT_RST, rightChestParams); + // What is the room number? + osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 部屋番号は? %d\n" VT_RST, globalCtx->roomCtx.curRoom.num); + // What is the bit? + osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ ビットはなぁに? %x\n" VT_RST, this->leftChestNum); + // Sukesuke-kun (something to do with being invisible) + osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ すけすけ君? %x\n" VT_RST, leftChestItem); + osSyncPrintf("\n\n"); + + if (this->roomChestsOpened) { + Flags_SetTreasure(globalCtx, this->rightChestNum & 0x1F); + Actor_Kill(&this->actor); + return; + } + + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_ETCETERA, + sRightChestPos[globalCtx->roomCtx.curRoom.num].x, sRightChestPos[globalCtx->roomCtx.curRoom.num].y, + sRightChestPos[globalCtx->roomCtx.curRoom.num].z, 0, 0, 0, + ((this->rightChestNum & 0x1F) << 8) + (rightChestItem & 0xFF)); + } + + this->actor.flags &= ~1; + this->actionFunc = EnChanger_Wait; +} + +void EnChanger_Wait(EnChanger* this, GlobalContext* globalCtx) { + if (this->leftChest->unk_1F4 != 0) { + this->timer = 80; + Flags_SetTreasure(globalCtx, this->rightChestNum & 0x1F); + this->actionFunc = EnChanger_OpenChests; + } else if (this->rightChest->unk_1F4 != 0) { + this->chestOpened = CHEST_RIGHT; + this->timer = 80; + Flags_SetTreasure(globalCtx, this->leftChestNum & 0x1F); + this->actionFunc = EnChanger_OpenChests; + } +} + +// Spawns the EnExItem showing what was in the other chest +void EnChanger_OpenChests(EnChanger* this, GlobalContext* globalCtx) { + f32 zPos; + f32 yPos; + f32 xPos; + s16 temp_s0; + s16 temp_s0_2; + EnBox* left; + EnBox* right; + + left = this->leftChest; + right = this->rightChest; + + if (this->timer == 0) { + temp_s0_2 = temp_s0 = this->chestOpened; // Required to use the right registers + + switch (temp_s0_2) { + case CHEST_LEFT: + xPos = right->dyna.actor.posRot.pos.x; + yPos = right->dyna.actor.posRot.pos.y; + zPos = right->dyna.actor.posRot.pos.z; + + if (this->rightChestGetItemId == GI_DOOR_KEY) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, 0xF); + Flags_SetSwitch(globalCtx, 0x32); + } else { + temp_s0_2 = (s16)(this->rightChestGetItemId - 0x72) + 0xA; + // Open right treasure (chest) + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 右宝開く ☆☆☆☆☆ %d\n" VT_RST, temp_s0_2); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, + temp_s0_2); + } + break; + case CHEST_RIGHT: + xPos = left->dyna.actor.posRot.pos.x; + yPos = left->dyna.actor.posRot.pos.y; + zPos = left->dyna.actor.posRot.pos.z; + + if (this->leftChestGetItemId == GI_DOOR_KEY) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, 0xF); + Flags_SetSwitch(globalCtx, 0x32); + } else { + temp_s0_2 = (s16)(this->leftChestGetItemId - 0x72) + 0xA; + // Open left treasure (chest) + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 左宝開く ☆☆☆☆☆ %d\n" VT_RST, temp_s0_2); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, + temp_s0_2); + } + break; + } + + Actor_Kill(&this->actor); + } +} + +void EnChanger_SetHeartPieceFlag(EnChanger* this, GlobalContext* globalCtx) { + if (this->finalChest->unk_1F4 != 0) { + if (!(gSaveContext.itemGetInf[1] & 0x800)) { + gSaveContext.itemGetInf[1] |= 0x800; + } + Actor_Kill(&this->actor); + } +} + +void EnChanger_Update(Actor* thisx, GlobalContext* globalCtx) { + EnChanger* this = THIS; + + this->actionFunc(this, globalCtx); + + if (this->timer != 0) { + this->timer--; + } + + if (BREG(0)) { + DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, + this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + 1.0f, 255, 0, 255, 255, 4, globalCtx->state.gfxCtx); + } +} diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.h b/src/overlays/actors/ovl_En_Changer/z_en_changer.h index d36bdbe989..ebc95cbc03 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.h +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.h @@ -3,12 +3,25 @@ #include "ultra64.h" #include "global.h" +#include "overlays/actors/ovl_En_Box/z_en_box.h" struct EnChanger; +typedef void (*EnChangerActionFunc)(struct EnChanger*, GlobalContext*); + typedef struct EnChanger { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x20]; + /* 0x014C */ EnChangerActionFunc actionFunc; + /* 0x0150 */ EnBox* leftChest; + /* 0x0154 */ EnBox* rightChest; + /* 0x0158 */ EnBox* finalChest; + /* 0x015C */ s16 leftChestNum; + /* 0x015E */ s16 rightChestNum; + /* 0x0160 */ s16 leftChestGetItemId; + /* 0x0162 */ s16 rightChestGetItemId; + /* 0x0164 */ s16 chestOpened; + /* 0x0166 */ s16 timer; + /* 0x0168 */ s16 roomChestsOpened; } EnChanger; // size = 0x016C extern const ActorInit En_Changer_InitVars; diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 92cad046e3..e2d39b63ad 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -78,25 +78,25 @@ void ItemEtcetera_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.25f); ItemEtcetera_SetupAction(this, func_80B857D0); switch (type) { - case ITEM_ETCETERA_LETTER: + case ITEM_ETC_LETTER: Actor_SetScale(&this->actor, 0.5f); this->futureActionFunc = func_80B858B4; if (gSaveContext.eventChkInf[3] & 2) { Actor_Kill(&this->actor); } break; - case ITEM_ETCETERA_ARROW_FIRE: + case ITEM_ETC_ARROW_FIRE: this->futureActionFunc = ItemEtcetera_UpdateFireArrow; Actor_SetScale(&this->actor, 0.5f); this->actor.draw = NULL; this->actor.shape.unk_08 = 50.0f; break; - case ITEM_ETCETERA_RUPEE_GREEN_CHEST_GAME: - case ITEM_ETCETERA_RUPEE_BLUE_CHEST_GAME: - case ITEM_ETCETERA_RUPEE_RED_CHEST_GAME: - case ITEM_ETCETERA_RUPEE_PURPLE_CHEST_GAME: - case ITEM_ETCETERA_HEART_PIECE_CHEST_GAME: - case ITEM_ETCETERA_KEY_SMALL_CHEST_GAME: + case ITEM_ETC_RUPEE_GREEN_CHEST_GAME: + case ITEM_ETC_RUPEE_BLUE_CHEST_GAME: + case ITEM_ETC_RUPEE_RED_CHEST_GAME: + case ITEM_ETC_RUPEE_PURPLE_CHEST_GAME: + case ITEM_ETC_HEART_PIECE_CHEST_GAME: + case ITEM_ETC_KEY_SMALL_CHEST_GAME: Actor_SetScale(&this->actor, 0.5f); this->futureActionFunc = func_80B85B28; this->drawFunc = ItemEtcetera_DrawThroughLens; diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h index 420680601e..54e7b4a716 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h @@ -1,5 +1,5 @@ -#ifndef _Z_ITEM_ETCETERA_H_ -#define _Z_ITEM_ETCETERA_H_ +#ifndef _Z_ITEM_ETC_H_ +#define _Z_ITEM_ETC_H_ #include "ultra64.h" #include "global.h" @@ -19,20 +19,20 @@ typedef struct ItemEtcetera { } ItemEtcetera; // size = 0x0160 typedef enum { - /* 0x00 */ ITEM_ETCETERA_BOTTLE, - /* 0x01 */ ITEM_ETCETERA_LETTER, - /* 0x02 */ ITEM_ETCETERA_SHIELD_HYLIAN, - /* 0x03 */ ITEM_ETCETERA_QUIVER, - /* 0x04 */ ITEM_ETCETERA_SCALE_SILVER, - /* 0x05 */ ITEM_ETCETERA_SCALE_GOLD, - /* 0x06 */ ITEM_ETCETERA_KEY_SMALL, - /* 0x07 */ ITEM_ETCETERA_ARROW_FIRE, - /* 0x08 */ ITEM_ETCETERA_RUPEE_GREEN_CHEST_GAME, - /* 0x09 */ ITEM_ETCETERA_RUPEE_BLUE_CHEST_GAME, - /* 0x0A */ ITEM_ETCETERA_RUPEE_RED_CHEST_GAME, - /* 0x0B */ ITEM_ETCETERA_RUPEE_PURPLE_CHEST_GAME, - /* 0x0C */ ITEM_ETCETERA_HEART_PIECE_CHEST_GAME, - /* 0x0D */ ITEM_ETCETERA_KEY_SMALL_CHEST_GAME + /* 0x00 */ ITEM_ETC_BOTTLE, + /* 0x01 */ ITEM_ETC_LETTER, + /* 0x02 */ ITEM_ETC_SHIELD_HYLIAN, + /* 0x03 */ ITEM_ETC_QUIVER, + /* 0x04 */ ITEM_ETC_SCALE_SILVER, + /* 0x05 */ ITEM_ETC_SCALE_GOLD, + /* 0x06 */ ITEM_ETC_KEY_SMALL, + /* 0x07 */ ITEM_ETC_ARROW_FIRE, + /* 0x08 */ ITEM_ETC_RUPEE_GREEN_CHEST_GAME, + /* 0x09 */ ITEM_ETC_RUPEE_BLUE_CHEST_GAME, + /* 0x0A */ ITEM_ETC_RUPEE_RED_CHEST_GAME, + /* 0x0B */ ITEM_ETC_RUPEE_PURPLE_CHEST_GAME, + /* 0x0C */ ITEM_ETC_HEART_PIECE_CHEST_GAME, + /* 0x0D */ ITEM_ETC_KEY_SMALL_CHEST_GAME } ItemEtceteraType; extern const ActorInit Item_Etcetera_InitVars;