From 1ac9479caeccca1b4f03436a0cd7c91ee58cd505 Mon Sep 17 00:00:00 2001 From: mzxrules Date: Sun, 25 Apr 2021 19:36:43 -0400 Subject: [PATCH] z_bg_mizu_movebg and object_mizu_objects (#747) * OK a few functions * BgMizuMovebg_Draw OK, make tweaks to bg_mizu_bwall * migrate data * create mizu_objects, defines for water temple water level * clean up some code * implement most suggestions * review * review2 * formatting Co-authored-by: Fig02 --- .../ovl_Bg_Mizu_Movebg/BgMizuMovebg_Destroy.s | 59 --- .../ovl_Bg_Mizu_Movebg/BgMizuMovebg_Draw.s | 204 ---------- .../ovl_Bg_Mizu_Movebg/BgMizuMovebg_Update.s | 10 - .../actors/ovl_Bg_Mizu_Movebg/func_8089DC30.s | 33 -- .../actors/ovl_Bg_Mizu_Movebg/func_8089E108.s | 37 -- .../actors/ovl_Bg_Mizu_Movebg/func_8089E198.s | 115 ------ .../actors/ovl_Bg_Mizu_Movebg/func_8089E650.s | 121 ------ assets/xml/objects/object_mizu_objects.xml | 39 ++ data/overlays/actors/z_bg_mizu_movebg.bss.s | 14 - data/overlays/actors/z_bg_mizu_movebg.data.s | 30 -- spec | 9 +- .../ovl_Bg_Ice_Objects/z_bg_ice_objects.c | 2 +- .../ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c | 36 +- .../ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c | 372 +++++++++++++++++- .../ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h | 14 +- .../ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c | 11 +- .../actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c | 5 +- .../ovl_Bg_Mizu_Water/z_bg_mizu_water.c | 60 +-- .../ovl_Bg_Mizu_Water/z_bg_mizu_water.h | 9 + .../actors/ovl_Door_Shutter/z_door_shutter.c | 5 +- src/overlays/actors/ovl_En_Door/z_en_door.c | 7 +- src/overlays/actors/ovl_En_Tp/z_en_tp.c | 2 +- 22 files changed, 502 insertions(+), 692 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089DC30.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E108.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E198.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s create mode 100644 assets/xml/objects/object_mizu_objects.xml delete mode 100644 data/overlays/actors/z_bg_mizu_movebg.bss.s delete mode 100644 data/overlays/actors/z_bg_mizu_movebg.data.s diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Destroy.s deleted file mode 100644 index 3d4c847663..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Destroy.s +++ /dev/null @@ -1,59 +0,0 @@ -.late_rodata -glabel jtbl_8089EC3C -.word L8089E0AC -.word L8089E0AC -.word L8089E0AC -.word L8089E0AC -.word L8089E0D4 - -.text -glabel BgMizuMovebg_Destroy -/* 00428 8089E058 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0042C 8089E05C AFA40018 */ sw $a0, 0x0018($sp) -/* 00430 8089E060 8FAE0018 */ lw $t6, 0x0018($sp) -/* 00434 8089E064 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00438 8089E068 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 0043C 8089E06C 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810 -/* 00440 8089E070 0C00FB56 */ jal DynaPoly_DeleteBgActor - ## DynaPoly_DeleteBgActor -/* 00444 8089E074 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C -/* 00448 8089E078 8FA20018 */ lw $v0, 0x0018($sp) -/* 0044C 8089E07C 944F001C */ lhu $t7, 0x001C($v0) ## 0000001C -/* 00450 8089E080 000FC303 */ sra $t8, $t7, 12 -/* 00454 8089E084 3319000F */ andi $t9, $t8, 0x000F ## $t9 = 00000000 -/* 00458 8089E088 2728FFFD */ addiu $t0, $t9, 0xFFFD ## $t0 = FFFFFFFD -/* 0045C 8089E08C 2D010005 */ sltiu $at, $t0, 0x0005 -/* 00460 8089E090 10200019 */ beq $at, $zero, .L8089E0F8 -/* 00464 8089E094 00084080 */ sll $t0, $t0, 2 -/* 00468 8089E098 3C01808A */ lui $at, %hi(jtbl_8089EC3C) ## $at = 808A0000 -/* 0046C 8089E09C 00280821 */ addu $at, $at, $t0 -/* 00470 8089E0A0 8C28EC3C */ lw $t0, %lo(jtbl_8089EC3C)($at) -/* 00474 8089E0A4 01000008 */ jr $t0 -/* 00478 8089E0A8 00000000 */ nop -glabel L8089E0AC -/* 0047C 8089E0AC 9049017C */ lbu $t1, 0x017C($v0) ## 0000017C -/* 00480 8089E0B0 3C02808A */ lui $v0, %hi(D_8089EE40) ## $v0 = 808A0000 -/* 00484 8089E0B4 2442EE40 */ addiu $v0, $v0, %lo(D_8089EE40) ## $v0 = 8089EE40 -/* 00488 8089E0B8 312A0002 */ andi $t2, $t1, 0x0002 ## $t2 = 00000000 -/* 0048C 8089E0BC 5140000F */ beql $t2, $zero, .L8089E0FC -/* 00490 8089E0C0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00494 8089E0C4 904B0000 */ lbu $t3, 0x0000($v0) ## 8089EE40 -/* 00498 8089E0C8 316CFFFD */ andi $t4, $t3, 0xFFFD ## $t4 = 00000000 -/* 0049C 8089E0CC 1000000A */ beq $zero, $zero, .L8089E0F8 -/* 004A0 8089E0D0 A04C0000 */ sb $t4, 0x0000($v0) ## 8089EE40 -glabel L8089E0D4 -/* 004A4 8089E0D4 904D017C */ lbu $t5, 0x017C($v0) ## 8089EFBC -/* 004A8 8089E0D8 3C02808A */ lui $v0, %hi(D_8089EE40) ## $v0 = 808A0000 -/* 004AC 8089E0DC 2442EE40 */ addiu $v0, $v0, %lo(D_8089EE40) ## $v0 = 8089EE40 -/* 004B0 8089E0E0 31AE0001 */ andi $t6, $t5, 0x0001 ## $t6 = 00000000 -/* 004B4 8089E0E4 51C00005 */ beql $t6, $zero, .L8089E0FC -/* 004B8 8089E0E8 8FBF0014 */ lw $ra, 0x0014($sp) -/* 004BC 8089E0EC 904F0000 */ lbu $t7, 0x0000($v0) ## 8089EE40 -/* 004C0 8089E0F0 31F8FFFE */ andi $t8, $t7, 0xFFFE ## $t8 = 00000000 -/* 004C4 8089E0F4 A0580000 */ sb $t8, 0x0000($v0) ## 8089EE40 -.L8089E0F8: -/* 004C8 8089E0F8 8FBF0014 */ lw $ra, 0x0014($sp) -.L8089E0FC: -/* 004CC 8089E0FC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 004D0 8089E100 03E00008 */ jr $ra -/* 004D4 8089E104 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Draw.s deleted file mode 100644 index c99c70f81c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Draw.s +++ /dev/null @@ -1,204 +0,0 @@ -.rdata -glabel D_8089EBC0 - .asciz "../z_bg_mizu_movebg.c" - .balign 4 - -glabel D_8089EBD8 - .asciz "../z_bg_mizu_movebg.c" - .balign 4 - -glabel D_8089EBF0 - .asciz "../z_bg_mizu_movebg.c" - .balign 4 - -.text -glabel BgMizuMovebg_Draw -/* 00C00 8089E830 27BDFF70 */ addiu $sp, $sp, 0xFF70 ## $sp = FFFFFF70 -/* 00C04 8089E834 AFB10048 */ sw $s1, 0x0048($sp) -/* 00C08 8089E838 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 00C0C 8089E83C AFBF004C */ sw $ra, 0x004C($sp) -/* 00C10 8089E840 AFB00044 */ sw $s0, 0x0044($sp) -/* 00C14 8089E844 AFA40090 */ sw $a0, 0x0090($sp) -/* 00C18 8089E848 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 00C1C 8089E84C 3C06808A */ lui $a2, %hi(D_8089EBC0) ## $a2 = 808A0000 -/* 00C20 8089E850 24C6EBC0 */ addiu $a2, $a2, %lo(D_8089EBC0) ## $a2 = 8089EBC0 -/* 00C24 8089E854 27A40070 */ addiu $a0, $sp, 0x0070 ## $a0 = FFFFFFE0 -/* 00C28 8089E858 240702F2 */ addiu $a3, $zero, 0x02F2 ## $a3 = 000002F2 -/* 00C2C 8089E85C 0C031AB1 */ jal Graph_OpenDisps -/* 00C30 8089E860 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 00C34 8089E864 3C0E0001 */ lui $t6, 0x0001 ## $t6 = 00010000 -/* 00C38 8089E868 01D17021 */ addu $t6, $t6, $s1 -/* 00C3C 8089E86C 8DCE1DE4 */ lw $t6, 0x1DE4($t6) ## 00011DE4 -/* 00C40 8089E870 AFAE0084 */ sw $t6, 0x0084($sp) -/* 00C44 8089E874 0C024F46 */ jal func_80093D18 -/* 00C48 8089E878 8E240000 */ lw $a0, 0x0000($s1) ## 00000000 -/* 00C4C 8089E87C 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00C50 8089E880 3C18DB06 */ lui $t8, 0xDB06 ## $t8 = DB060000 -/* 00C54 8089E884 37180020 */ ori $t8, $t8, 0x0020 ## $t8 = DB060020 -/* 00C58 8089E888 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 00000008 -/* 00C5C 8089E88C AE0F02C0 */ sw $t7, 0x02C0($s0) ## 000002C0 -/* 00C60 8089E890 AC580000 */ sw $t8, 0x0000($v0) ## 00000000 -/* 00C64 8089E894 8E240000 */ lw $a0, 0x0000($s1) ## 00000000 -/* 00C68 8089E898 8FAC0090 */ lw $t4, 0x0090($sp) -/* 00C6C 8089E89C 24190020 */ addiu $t9, $zero, 0x0020 ## $t9 = 00000020 -/* 00C70 8089E8A0 24080020 */ addiu $t0, $zero, 0x0020 ## $t0 = 00000020 -/* 00C74 8089E8A4 24090001 */ addiu $t1, $zero, 0x0001 ## $t1 = 00000001 -/* 00C78 8089E8A8 240A0020 */ addiu $t2, $zero, 0x0020 ## $t2 = 00000020 -/* 00C7C 8089E8AC 240B0020 */ addiu $t3, $zero, 0x0020 ## $t3 = 00000020 -/* 00C80 8089E8B0 AFAB0028 */ sw $t3, 0x0028($sp) -/* 00C84 8089E8B4 AFAA0024 */ sw $t2, 0x0024($sp) -/* 00C88 8089E8B8 AFA90018 */ sw $t1, 0x0018($sp) -/* 00C8C 8089E8BC AFA80014 */ sw $t0, 0x0014($sp) -/* 00C90 8089E8C0 AFB90010 */ sw $t9, 0x0010($sp) -/* 00C94 8089E8C4 AFA00034 */ sw $zero, 0x0034($sp) -/* 00C98 8089E8C8 AFA00030 */ sw $zero, 0x0030($sp) -/* 00C9C 8089E8CC AFA0002C */ sw $zero, 0x002C($sp) -/* 00CA0 8089E8D0 AFA00020 */ sw $zero, 0x0020($sp) -/* 00CA4 8089E8D4 AFA0001C */ sw $zero, 0x001C($sp) -/* 00CA8 8089E8D8 8FA60084 */ lw $a2, 0x0084($sp) -/* 00CAC 8089E8DC 8D8D016C */ lw $t5, 0x016C($t4) ## 0000016C -/* 00CB0 8089E8E0 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00CB4 8089E8E4 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00CB8 8089E8E8 AFA2006C */ sw $v0, 0x006C($sp) -/* 00CBC 8089E8EC AFA60054 */ sw $a2, 0x0054($sp) -/* 00CC0 8089E8F0 0C02541A */ jal Gfx_TwoTexScrollEnvColor -/* 00CC4 8089E8F4 AFAD0038 */ sw $t5, 0x0038($sp) -/* 00CC8 8089E8F8 8FA3006C */ lw $v1, 0x006C($sp) -/* 00CCC 8089E8FC 3C0FDB06 */ lui $t7, 0xDB06 ## $t7 = DB060000 -/* 00CD0 8089E900 35EF0024 */ ori $t7, $t7, 0x0024 ## $t7 = DB060024 -/* 00CD4 8089E904 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00CD8 8089E908 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00CDC 8089E90C 24180020 */ addiu $t8, $zero, 0x0020 ## $t8 = 00000020 -/* 00CE0 8089E910 24190020 */ addiu $t9, $zero, 0x0020 ## $t9 = 00000020 -/* 00CE4 8089E914 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008 -/* 00CE8 8089E918 AE0E02C0 */ sw $t6, 0x02C0($s0) ## 000002C0 -/* 00CEC 8089E91C AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 -/* 00CF0 8089E920 8E240000 */ lw $a0, 0x0000($s1) ## 00000000 -/* 00CF4 8089E924 8FAB0090 */ lw $t3, 0x0090($sp) -/* 00CF8 8089E928 24080001 */ addiu $t0, $zero, 0x0001 ## $t0 = 00000001 -/* 00CFC 8089E92C 24090020 */ addiu $t1, $zero, 0x0020 ## $t1 = 00000020 -/* 00D00 8089E930 240A0020 */ addiu $t2, $zero, 0x0020 ## $t2 = 00000020 -/* 00D04 8089E934 AFAA0028 */ sw $t2, 0x0028($sp) -/* 00D08 8089E938 AFA90024 */ sw $t1, 0x0024($sp) -/* 00D0C 8089E93C AFA80018 */ sw $t0, 0x0018($sp) -/* 00D10 8089E940 AFA00034 */ sw $zero, 0x0034($sp) -/* 00D14 8089E944 AFA00030 */ sw $zero, 0x0030($sp) -/* 00D18 8089E948 AFA0002C */ sw $zero, 0x002C($sp) -/* 00D1C 8089E94C AFA00020 */ sw $zero, 0x0020($sp) -/* 00D20 8089E950 AFA0001C */ sw $zero, 0x001C($sp) -/* 00D24 8089E954 AFB90014 */ sw $t9, 0x0014($sp) -/* 00D28 8089E958 AFB80010 */ sw $t8, 0x0010($sp) -/* 00D2C 8089E95C 8D6C0170 */ lw $t4, 0x0170($t3) ## 00000170 -/* 00D30 8089E960 8FA60054 */ lw $a2, 0x0054($sp) -/* 00D34 8089E964 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00D38 8089E968 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00D3C 8089E96C AFA20068 */ sw $v0, 0x0068($sp) -/* 00D40 8089E970 0C02541A */ jal Gfx_TwoTexScrollEnvColor -/* 00D44 8089E974 AFAC0038 */ sw $t4, 0x0038($sp) -/* 00D48 8089E978 8FA30068 */ lw $v1, 0x0068($sp) -/* 00D4C 8089E97C 3C0EDB06 */ lui $t6, 0xDB06 ## $t6 = DB060000 -/* 00D50 8089E980 35CE0028 */ ori $t6, $t6, 0x0028 ## $t6 = DB060028 -/* 00D54 8089E984 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00D58 8089E988 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00D5C 8089E98C 240F0020 */ addiu $t7, $zero, 0x0020 ## $t7 = 00000020 -/* 00D60 8089E990 24180020 */ addiu $t8, $zero, 0x0020 ## $t8 = 00000020 -/* 00D64 8089E994 244D0008 */ addiu $t5, $v0, 0x0008 ## $t5 = 00000008 -/* 00D68 8089E998 AE0D02C0 */ sw $t5, 0x02C0($s0) ## 000002C0 -/* 00D6C 8089E99C AC4E0000 */ sw $t6, 0x0000($v0) ## 00000000 -/* 00D70 8089E9A0 8E240000 */ lw $a0, 0x0000($s1) ## 00000000 -/* 00D74 8089E9A4 8FAA0090 */ lw $t2, 0x0090($sp) -/* 00D78 8089E9A8 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 00D7C 8089E9AC 24080020 */ addiu $t0, $zero, 0x0020 ## $t0 = 00000020 -/* 00D80 8089E9B0 24090020 */ addiu $t1, $zero, 0x0020 ## $t1 = 00000020 -/* 00D84 8089E9B4 AFA90028 */ sw $t1, 0x0028($sp) -/* 00D88 8089E9B8 AFA80024 */ sw $t0, 0x0024($sp) -/* 00D8C 8089E9BC AFB90018 */ sw $t9, 0x0018($sp) -/* 00D90 8089E9C0 AFA00034 */ sw $zero, 0x0034($sp) -/* 00D94 8089E9C4 AFA00030 */ sw $zero, 0x0030($sp) -/* 00D98 8089E9C8 AFA0002C */ sw $zero, 0x002C($sp) -/* 00D9C 8089E9CC AFA00020 */ sw $zero, 0x0020($sp) -/* 00DA0 8089E9D0 AFA0001C */ sw $zero, 0x001C($sp) -/* 00DA4 8089E9D4 AFB80014 */ sw $t8, 0x0014($sp) -/* 00DA8 8089E9D8 AFAF0010 */ sw $t7, 0x0010($sp) -/* 00DAC 8089E9DC 8D4B0174 */ lw $t3, 0x0174($t2) ## 00000174 -/* 00DB0 8089E9E0 8FA60054 */ lw $a2, 0x0054($sp) -/* 00DB4 8089E9E4 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00DB8 8089E9E8 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00DBC 8089E9EC AFA20064 */ sw $v0, 0x0064($sp) -/* 00DC0 8089E9F0 0C02541A */ jal Gfx_TwoTexScrollEnvColor -/* 00DC4 8089E9F4 AFAB0038 */ sw $t3, 0x0038($sp) -/* 00DC8 8089E9F8 8FA30064 */ lw $v1, 0x0064($sp) -/* 00DCC 8089E9FC 3C0DDB06 */ lui $t5, 0xDB06 ## $t5 = DB060000 -/* 00DD0 8089EA00 35AD002C */ ori $t5, $t5, 0x002C ## $t5 = DB06002C -/* 00DD4 8089EA04 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00DD8 8089EA08 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00DDC 8089EA0C 240E0020 */ addiu $t6, $zero, 0x0020 ## $t6 = 00000020 -/* 00DE0 8089EA10 240F0020 */ addiu $t7, $zero, 0x0020 ## $t7 = 00000020 -/* 00DE4 8089EA14 244C0008 */ addiu $t4, $v0, 0x0008 ## $t4 = 00000008 -/* 00DE8 8089EA18 AE0C02C0 */ sw $t4, 0x02C0($s0) ## 000002C0 -/* 00DEC 8089EA1C AC4D0000 */ sw $t5, 0x0000($v0) ## 00000000 -/* 00DF0 8089EA20 8E240000 */ lw $a0, 0x0000($s1) ## 00000000 -/* 00DF4 8089EA24 8FA90090 */ lw $t1, 0x0090($sp) -/* 00DF8 8089EA28 8FA60084 */ lw $a2, 0x0084($sp) -/* 00DFC 8089EA2C 24180001 */ addiu $t8, $zero, 0x0001 ## $t8 = 00000001 -/* 00E00 8089EA30 24190020 */ addiu $t9, $zero, 0x0020 ## $t9 = 00000020 -/* 00E04 8089EA34 24080020 */ addiu $t0, $zero, 0x0020 ## $t0 = 00000020 -/* 00E08 8089EA38 AFA80028 */ sw $t0, 0x0028($sp) -/* 00E0C 8089EA3C AFB90024 */ sw $t9, 0x0024($sp) -/* 00E10 8089EA40 AFB80018 */ sw $t8, 0x0018($sp) -/* 00E14 8089EA44 AFA00034 */ sw $zero, 0x0034($sp) -/* 00E18 8089EA48 AFA00030 */ sw $zero, 0x0030($sp) -/* 00E1C 8089EA4C AFA0002C */ sw $zero, 0x002C($sp) -/* 00E20 8089EA50 AFA00020 */ sw $zero, 0x0020($sp) -/* 00E24 8089EA54 AFA0001C */ sw $zero, 0x001C($sp) -/* 00E28 8089EA58 AFAF0014 */ sw $t7, 0x0014($sp) -/* 00E2C 8089EA5C AFAE0010 */ sw $t6, 0x0010($sp) -/* 00E30 8089EA60 8D2A0178 */ lw $t2, 0x0178($t1) ## 00000178 -/* 00E34 8089EA64 00C00821 */ addu $at, $a2, $zero -/* 00E38 8089EA68 00063080 */ sll $a2, $a2, 2 -/* 00E3C 8089EA6C 00C13023 */ subu $a2, $a2, $at -/* 00E40 8089EA70 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00E44 8089EA74 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00E48 8089EA78 AFA20060 */ sw $v0, 0x0060($sp) -/* 00E4C 8089EA7C 0C02541A */ jal Gfx_TwoTexScrollEnvColor -/* 00E50 8089EA80 AFAA0038 */ sw $t2, 0x0038($sp) -/* 00E54 8089EA84 8FA30060 */ lw $v1, 0x0060($sp) -/* 00E58 8089EA88 3C0CDA38 */ lui $t4, 0xDA38 ## $t4 = DA380000 -/* 00E5C 8089EA8C 358C0003 */ ori $t4, $t4, 0x0003 ## $t4 = DA380003 -/* 00E60 8089EA90 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00E64 8089EA94 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00E68 8089EA98 3C05808A */ lui $a1, %hi(D_8089EBD8) ## $a1 = 808A0000 -/* 00E6C 8089EA9C 24A5EBD8 */ addiu $a1, $a1, %lo(D_8089EBD8) ## $a1 = 8089EBD8 -/* 00E70 8089EAA0 244B0008 */ addiu $t3, $v0, 0x0008 ## $t3 = 00000008 -/* 00E74 8089EAA4 AE0B02C0 */ sw $t3, 0x02C0($s0) ## 000002C0 -/* 00E78 8089EAA8 AC4C0000 */ sw $t4, 0x0000($v0) ## 00000000 -/* 00E7C 8089EAAC 8E240000 */ lw $a0, 0x0000($s1) ## 00000000 -/* 00E80 8089EAB0 24060314 */ addiu $a2, $zero, 0x0314 ## $a2 = 00000314 -/* 00E84 8089EAB4 0C0346A2 */ jal Matrix_NewMtx -/* 00E88 8089EAB8 AFA2005C */ sw $v0, 0x005C($sp) -/* 00E8C 8089EABC 8FA3005C */ lw $v1, 0x005C($sp) -/* 00E90 8089EAC0 3C06808A */ lui $a2, %hi(D_8089EBF0) ## $a2 = 808A0000 -/* 00E94 8089EAC4 24C6EBF0 */ addiu $a2, $a2, %lo(D_8089EBF0) ## $a2 = 8089EBF0 -/* 00E98 8089EAC8 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00E9C 8089EACC 8FAD0090 */ lw $t5, 0x0090($sp) -/* 00EA0 8089EAD0 27A40070 */ addiu $a0, $sp, 0x0070 ## $a0 = FFFFFFE0 -/* 00EA4 8089EAD4 2407031B */ addiu $a3, $zero, 0x031B ## $a3 = 0000031B -/* 00EA8 8089EAD8 8DAE0180 */ lw $t6, 0x0180($t5) ## 00000180 -/* 00EAC 8089EADC 11C00009 */ beq $t6, $zero, .L8089EB04 -/* 00EB0 8089EAE0 00000000 */ nop -/* 00EB4 8089EAE4 8E0202C0 */ lw $v0, 0x02C0($s0) ## 000002C0 -/* 00EB8 8089EAE8 3C18DE00 */ lui $t8, 0xDE00 ## $t8 = DE000000 -/* 00EBC 8089EAEC 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 00000008 -/* 00EC0 8089EAF0 AE0F02C0 */ sw $t7, 0x02C0($s0) ## 000002C0 -/* 00EC4 8089EAF4 AC580000 */ sw $t8, 0x0000($v0) ## 00000000 -/* 00EC8 8089EAF8 8FB90090 */ lw $t9, 0x0090($sp) -/* 00ECC 8089EAFC 8F280180 */ lw $t0, 0x0180($t9) ## 00000180 -/* 00ED0 8089EB00 AC480004 */ sw $t0, 0x0004($v0) ## 00000004 -.L8089EB04: -/* 00ED4 8089EB04 0C031AD5 */ jal Graph_CloseDisps -/* 00ED8 8089EB08 8E250000 */ lw $a1, 0x0000($s1) ## 00000000 -/* 00EDC 8089EB0C 8FBF004C */ lw $ra, 0x004C($sp) -/* 00EE0 8089EB10 8FB00044 */ lw $s0, 0x0044($sp) -/* 00EE4 8089EB14 8FB10048 */ lw $s1, 0x0048($sp) -/* 00EE8 8089EB18 03E00008 */ jr $ra -/* 00EEC 8089EB1C 27BD0090 */ addiu $sp, $sp, 0x0090 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Update.s deleted file mode 100644 index 7fe0f81c99..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Update.s +++ /dev/null @@ -1,10 +0,0 @@ -glabel BgMizuMovebg_Update -/* 00BDC 8089E80C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00BE0 8089E810 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00BE4 8089E814 8C990164 */ lw $t9, 0x0164($a0) ## 00000164 -/* 00BE8 8089E818 0320F809 */ jalr $ra, $t9 -/* 00BEC 8089E81C 00000000 */ nop -/* 00BF0 8089E820 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00BF4 8089E824 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00BF8 8089E828 03E00008 */ jr $ra -/* 00BFC 8089E82C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089DC30.s b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089DC30.s deleted file mode 100644 index fa0a5f74cf..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089DC30.s +++ /dev/null @@ -1,33 +0,0 @@ -glabel func_8089DC30 -/* 00000 8089DC30 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00004 8089DC34 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00008 8089DC38 AFA40018 */ sw $a0, 0x0018($sp) -/* 0000C 8089DC3C 0C00B2D0 */ jal Flags_GetSwitch - -/* 00010 8089DC40 2405001C */ addiu $a1, $zero, 0x001C ## $a1 = 0000001C -/* 00014 8089DC44 10400003 */ beq $v0, $zero, .L8089DC54 -/* 00018 8089DC48 8FA40018 */ lw $a0, 0x0018($sp) -/* 0001C 8089DC4C 1000000D */ beq $zero, $zero, .L8089DC84 -/* 00020 8089DC50 24030001 */ addiu $v1, $zero, 0x0001 ## $v1 = 00000001 -.L8089DC54: -/* 00024 8089DC54 0C00B2D0 */ jal Flags_GetSwitch - -/* 00028 8089DC58 2405001D */ addiu $a1, $zero, 0x001D ## $a1 = 0000001D -/* 0002C 8089DC5C 10400003 */ beq $v0, $zero, .L8089DC6C -/* 00030 8089DC60 8FA40018 */ lw $a0, 0x0018($sp) -/* 00034 8089DC64 10000007 */ beq $zero, $zero, .L8089DC84 -/* 00038 8089DC68 24030002 */ addiu $v1, $zero, 0x0002 ## $v1 = 00000002 -.L8089DC6C: -/* 0003C 8089DC6C 0C00B2D0 */ jal Flags_GetSwitch - -/* 00040 8089DC70 2405001E */ addiu $a1, $zero, 0x001E ## $a1 = 0000001E -/* 00044 8089DC74 10400003 */ beq $v0, $zero, .L8089DC84 -/* 00048 8089DC78 24030001 */ addiu $v1, $zero, 0x0001 ## $v1 = 00000001 -/* 0004C 8089DC7C 10000001 */ beq $zero, $zero, .L8089DC84 -/* 00050 8089DC80 24030003 */ addiu $v1, $zero, 0x0003 ## $v1 = 00000003 -.L8089DC84: -/* 00054 8089DC84 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00058 8089DC88 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0005C 8089DC8C 00601025 */ or $v0, $v1, $zero ## $v0 = 00000003 -/* 00060 8089DC90 03E00008 */ jr $ra -/* 00064 8089DC94 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E108.s b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E108.s deleted file mode 100644 index 104e57a581..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E108.s +++ /dev/null @@ -1,37 +0,0 @@ -glabel func_8089E108 -/* 004D8 8089E108 000670C0 */ sll $t6, $a2, 3 -/* 004DC 8089E10C 008E7821 */ addu $t7, $a0, $t6 -/* 004E0 8089E110 8DE80004 */ lw $t0, 0x0004($t7) ## 00000004 -/* 004E4 8089E114 3C0A8016 */ lui $t2, %hi(gSegments) -/* 004E8 8089E118 3C0100FF */ lui $at, 0x00FF ## $at = 00FF0000 -/* 004EC 8089E11C 0008C100 */ sll $t8, $t0, 4 -/* 004F0 8089E120 0018CF02 */ srl $t9, $t8, 28 -/* 004F4 8089E124 00194880 */ sll $t1, $t9, 2 -/* 004F8 8089E128 01495021 */ addu $t2, $t2, $t1 -/* 004FC 8089E12C 8D4A6FA8 */ lw $t2, %lo(gSegments)($t2) -/* 00500 8089E130 3421FFFF */ ori $at, $at, 0xFFFF ## $at = 00FFFFFF -/* 00504 8089E134 00076880 */ sll $t5, $a3, 2 -/* 00508 8089E138 01A76823 */ subu $t5, $t5, $a3 -/* 0050C 8089E13C 01015824 */ and $t3, $t0, $at -/* 00510 8089E140 000D6840 */ sll $t5, $t5, 1 -/* 00514 8089E144 014B6021 */ addu $t4, $t2, $t3 -/* 00518 8089E148 018D1821 */ addu $v1, $t4, $t5 -/* 0051C 8089E14C 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 00520 8089E150 00611821 */ addu $v1, $v1, $at -/* 00524 8089E154 846E0000 */ lh $t6, 0x0000($v1) ## 00000000 -/* 00528 8089E158 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 0052C 8089E15C 448E2000 */ mtc1 $t6, $f4 ## $f4 = 0.00 -/* 00530 8089E160 00000000 */ nop -/* 00534 8089E164 468021A0 */ cvt.s.w $f6, $f4 -/* 00538 8089E168 E4A60000 */ swc1 $f6, 0x0000($a1) ## 00000000 -/* 0053C 8089E16C 846F0002 */ lh $t7, 0x0002($v1) ## 00000002 -/* 00540 8089E170 448F4000 */ mtc1 $t7, $f8 ## $f8 = 0.00 -/* 00544 8089E174 00000000 */ nop -/* 00548 8089E178 468042A0 */ cvt.s.w $f10, $f8 -/* 0054C 8089E17C E4AA0004 */ swc1 $f10, 0x0004($a1) ## 00000004 -/* 00550 8089E180 84780004 */ lh $t8, 0x0004($v1) ## 00000004 -/* 00554 8089E184 44988000 */ mtc1 $t8, $f16 ## $f16 = 0.00 -/* 00558 8089E188 00000000 */ nop -/* 0055C 8089E18C 468084A0 */ cvt.s.w $f18, $f16 -/* 00560 8089E190 03E00008 */ jr $ra -/* 00564 8089E194 E4B20008 */ swc1 $f18, 0x0008($a1) ## 00000008 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E198.s b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E198.s deleted file mode 100644 index b60306f661..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E198.s +++ /dev/null @@ -1,115 +0,0 @@ -.late_rodata -glabel D_8089EC50 - .word 0x43DE8000 -glabel D_8089EC54 - .word 0x43DE8000 -glabel D_8089EC58 - .word 0x443F4000 -glabel D_8089EC5C - .word 0xC450C000 - -.text -glabel func_8089E198 -/* 00568 8089E198 8CAE07C0 */ lw $t6, 0x07C0($a1) ## 000007C0 -/* 0056C 8089E19C 3C01C170 */ lui $at, 0xC170 ## $at = C1700000 -/* 00570 8089E1A0 44811000 */ mtc1 $at, $f2 ## $f2 = -15.00 -/* 00574 8089E1A4 8DCF0028 */ lw $t7, 0x0028($t6) ## 00000028 -/* 00578 8089E1A8 240200FF */ addiu $v0, $zero, 0x00FF ## $v0 = 000000FF -/* 0057C 8089E1AC 3C01808A */ lui $at, %hi(D_8089EC54) ## $at = 808A0000 -/* 00580 8089E1B0 85F80022 */ lh $t8, 0x0022($t7) ## 00000022 -/* 00584 8089E1B4 240300A0 */ addiu $v1, $zero, 0x00A0 ## $v1 = 000000A0 -/* 00588 8089E1B8 44982000 */ mtc1 $t8, $f4 ## $f4 = 0.00 -/* 0058C 8089E1BC 00000000 */ nop -/* 00590 8089E1C0 46802020 */ cvt.s.w $f0, $f4 -/* 00594 8089E1C4 4602003C */ c.lt.s $f0, $f2 -/* 00598 8089E1C8 00000000 */ nop -/* 0059C 8089E1CC 45000007 */ bc1f .L8089E1EC -/* 005A0 8089E1D0 00000000 */ nop -/* 005A4 8089E1D4 3C0142BE */ lui $at, 0x42BE ## $at = 42BE0000 -/* 005A8 8089E1D8 44817000 */ mtc1 $at, $f14 ## $f14 = 95.00 -/* 005AC 8089E1DC 3C01808A */ lui $at, %hi(D_8089EC50) ## $at = 808A0000 -/* 005B0 8089E1E0 AC82016C */ sw $v0, 0x016C($a0) ## 0000016C -/* 005B4 8089E1E4 10000019 */ beq $zero, $zero, .L8089E24C -/* 005B8 8089E1E8 C42CEC50 */ lwc1 $f12, %lo(D_8089EC50)($at) -.L8089E1EC: -/* 005BC 8089E1EC C42CEC54 */ lwc1 $f12, %lo(D_8089EC54)($at) -/* 005C0 8089E1F0 240300A0 */ addiu $v1, $zero, 0x00A0 ## $v1 = 000000A0 -/* 005C4 8089E1F4 3C0142BE */ lui $at, 0x42BE ## $at = 42BE0000 -/* 005C8 8089E1F8 460C003C */ c.lt.s $f0, $f12 -/* 005CC 8089E1FC 240200FF */ addiu $v0, $zero, 0x00FF ## $v0 = 000000FF -/* 005D0 8089E200 45020011 */ bc1fl .L8089E248 -/* 005D4 8089E204 44817000 */ mtc1 $at, $f14 ## $f14 = 95.00 -/* 005D8 8089E208 3C0142BE */ lui $at, 0x42BE ## $at = 42BE0000 -/* 005DC 8089E20C 44817000 */ mtc1 $at, $f14 ## $f14 = 95.00 -/* 005E0 8089E210 46020181 */ sub.s $f6, $f0, $f2 -/* 005E4 8089E214 3C0143E6 */ lui $at, 0x43E6 ## $at = 43E60000 -/* 005E8 8089E218 44814000 */ mtc1 $at, $f8 ## $f8 = 460.00 -/* 005EC 8089E21C 240200FF */ addiu $v0, $zero, 0x00FF ## $v0 = 000000FF -/* 005F0 8089E220 240300A0 */ addiu $v1, $zero, 0x00A0 ## $v1 = 000000A0 -/* 005F4 8089E224 46083283 */ div.s $f10, $f6, $f8 -/* 005F8 8089E228 460E5402 */ mul.s $f16, $f10, $f14 -/* 005FC 8089E22C 4600848D */ trunc.w.s $f18, $f16 -/* 00600 8089E230 44089000 */ mfc1 $t0, $f18 -/* 00604 8089E234 00000000 */ nop -/* 00608 8089E238 00484823 */ subu $t1, $v0, $t0 -/* 0060C 8089E23C 10000003 */ beq $zero, $zero, .L8089E24C -/* 00610 8089E240 AC89016C */ sw $t1, 0x016C($a0) ## 0000016C -/* 00614 8089E244 44817000 */ mtc1 $at, $f14 ## $f14 = 460.00 -.L8089E248: -/* 00618 8089E248 AC83016C */ sw $v1, 0x016C($a0) ## 0000016C -.L8089E24C: -/* 0061C 8089E24C 460C003C */ c.lt.s $f0, $f12 -/* 00620 8089E250 3C01808A */ lui $at, %hi(D_8089EC58) ## $at = 808A0000 -/* 00624 8089E254 45000003 */ bc1f .L8089E264 -/* 00628 8089E258 00000000 */ nop -/* 0062C 8089E25C 10000013 */ beq $zero, $zero, .L8089E2AC -/* 00630 8089E260 AC820170 */ sw $v0, 0x0170($a0) ## 00000170 -.L8089E264: -/* 00634 8089E264 C424EC58 */ lwc1 $f4, %lo(D_8089EC58)($at) -/* 00638 8089E268 3C0143A0 */ lui $at, 0x43A0 ## $at = 43A00000 -/* 0063C 8089E26C 4604003C */ c.lt.s $f0, $f4 -/* 00640 8089E270 00000000 */ nop -/* 00644 8089E274 4502000D */ bc1fl .L8089E2AC -/* 00648 8089E278 AC830170 */ sw $v1, 0x0170($a0) ## 00000170 -/* 0064C 8089E27C 460C0181 */ sub.s $f6, $f0, $f12 -/* 00650 8089E280 44814000 */ mtc1 $at, $f8 ## $f8 = 320.00 -/* 00654 8089E284 00000000 */ nop -/* 00658 8089E288 46083283 */ div.s $f10, $f6, $f8 -/* 0065C 8089E28C 460E5402 */ mul.s $f16, $f10, $f14 -/* 00660 8089E290 4600848D */ trunc.w.s $f18, $f16 -/* 00664 8089E294 440B9000 */ mfc1 $t3, $f18 -/* 00668 8089E298 00000000 */ nop -/* 0066C 8089E29C 004B6023 */ subu $t4, $v0, $t3 -/* 00670 8089E2A0 10000002 */ beq $zero, $zero, .L8089E2AC -/* 00674 8089E2A4 AC8C0170 */ sw $t4, 0x0170($a0) ## 00000170 -/* 00678 8089E2A8 AC830170 */ sw $v1, 0x0170($a0) ## 00000170 -.L8089E2AC: -/* 0067C 8089E2AC 3C01808A */ lui $at, %hi(D_8089EC5C) ## $at = 808A0000 -/* 00680 8089E2B0 C42CEC5C */ lwc1 $f12, %lo(D_8089EC5C)($at) -/* 00684 8089E2B4 460C003C */ c.lt.s $f0, $f12 -/* 00688 8089E2B8 00000000 */ nop -/* 0068C 8089E2BC 45020004 */ bc1fl .L8089E2D0 -/* 00690 8089E2C0 4602003C */ c.lt.s $f0, $f2 -/* 00694 8089E2C4 10000011 */ beq $zero, $zero, .L8089E30C -/* 00698 8089E2C8 AC820174 */ sw $v0, 0x0174($a0) ## 00000174 -/* 0069C 8089E2CC 4602003C */ c.lt.s $f0, $f2 -.L8089E2D0: -/* 006A0 8089E2D0 3C01444D */ lui $at, 0x444D ## $at = 444D0000 -/* 006A4 8089E2D4 4502000D */ bc1fl .L8089E30C -/* 006A8 8089E2D8 AC830174 */ sw $v1, 0x0174($a0) ## 00000174 -/* 006AC 8089E2DC 460C0101 */ sub.s $f4, $f0, $f12 -/* 006B0 8089E2E0 44813000 */ mtc1 $at, $f6 ## $f6 = 820.00 -/* 006B4 8089E2E4 00000000 */ nop -/* 006B8 8089E2E8 46062203 */ div.s $f8, $f4, $f6 -/* 006BC 8089E2EC 460E4282 */ mul.s $f10, $f8, $f14 -/* 006C0 8089E2F0 4600540D */ trunc.w.s $f16, $f10 -/* 006C4 8089E2F4 440E8000 */ mfc1 $t6, $f16 -/* 006C8 8089E2F8 00000000 */ nop -/* 006CC 8089E2FC 004E7823 */ subu $t7, $v0, $t6 -/* 006D0 8089E300 10000002 */ beq $zero, $zero, .L8089E30C -/* 006D4 8089E304 AC8F0174 */ sw $t7, 0x0174($a0) ## 00000174 -/* 006D8 8089E308 AC830174 */ sw $v1, 0x0174($a0) ## 00000174 -.L8089E30C: -/* 006DC 8089E30C 8C980174 */ lw $t8, 0x0174($a0) ## 00000174 -/* 006E0 8089E310 03E00008 */ jr $ra -/* 006E4 8089E314 AC980178 */ sw $t8, 0x0178($a0) ## 00000178 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s deleted file mode 100644 index 2f9603b7ef..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s +++ /dev/null @@ -1,121 +0,0 @@ -.late_rodata -glabel D_8089EC88 - .float 0.1 - -.text -glabel func_8089E650 -/* 00A20 8089E650 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8 -/* 00A24 8089E654 AFBF001C */ sw $ra, 0x001C($sp) -/* 00A28 8089E658 AFB00018 */ sw $s0, 0x0018($sp) -/* 00A2C 8089E65C AFA5004C */ sw $a1, 0x004C($sp) -/* 00A30 8089E660 9482001C */ lhu $v0, 0x001C($a0) ## 0000001C -/* 00A34 8089E664 3C01808A */ lui $at, %hi(D_8089EC88) ## $at = 808A0000 -/* 00A38 8089E668 C428EC88 */ lwc1 $f8, %lo(D_8089EC88)($at) -/* 00A3C 8089E66C 00027103 */ sra $t6, $v0, 4 -/* 00A40 8089E670 31CF000F */ andi $t7, $t6, 0x000F ## $t7 = 00000000 -/* 00A44 8089E674 448F2000 */ mtc1 $t7, $f4 ## $f4 = 0.00 -/* 00A48 8089E678 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00A4C 8089E67C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00A50 8089E680 468021A0 */ cvt.s.w $f6, $f4 -/* 00A54 8089E684 00023203 */ sra $a2, $v0, 8 -/* 00A58 8089E688 30C6000F */ andi $a2, $a2, 0x000F ## $a2 = 00000000 -/* 00A5C 8089E68C 27A5003C */ addiu $a1, $sp, 0x003C ## $a1 = FFFFFFF4 -/* 00A60 8089E690 46083282 */ mul.s $f10, $f6, $f8 -/* 00A64 8089E694 E48A0068 */ swc1 $f10, 0x0068($a0) ## 00000068 -/* 00A68 8089E698 8FA3004C */ lw $v1, 0x004C($sp) -/* 00A6C 8089E69C 8E070184 */ lw $a3, 0x0184($s0) ## 00000184 -/* 00A70 8089E6A0 00611821 */ addu $v1, $v1, $at -/* 00A74 8089E6A4 8C641E08 */ lw $a0, 0x1E08($v1) ## 00001E08 -/* 00A78 8089E6A8 0C227842 */ jal func_8089E108 -/* 00A7C 8089E6AC AFA30028 */ sw $v1, 0x0028($sp) -/* 00A80 8089E6B0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00A84 8089E6B4 0C00B6DB */ jal Actor_WorldDistXYZToPoint -/* 00A88 8089E6B8 27A5003C */ addiu $a1, $sp, 0x003C ## $a1 = FFFFFFF4 -/* 00A8C 8089E6BC C6120068 */ lwc1 $f18, 0x0068($s0) ## 00000068 -/* 00A90 8089E6C0 26040024 */ addiu $a0, $s0, 0x0024 ## $a0 = 00000024 -/* 00A94 8089E6C4 27A5003C */ addiu $a1, $sp, 0x003C ## $a1 = FFFFFFF4 -/* 00A98 8089E6C8 4612003C */ c.lt.s $f0, $f18 -/* 00A9C 8089E6CC 26060030 */ addiu $a2, $s0, 0x0030 ## $a2 = 00000030 -/* 00AA0 8089E6D0 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 00AA4 8089E6D4 45000002 */ bc1f .L8089E6E0 -/* 00AA8 8089E6D8 00000000 */ nop -/* 00AAC 8089E6DC E6000068 */ swc1 $f0, 0x0068($s0) ## 00000068 -.L8089E6E0: -/* 00AB0 8089E6E0 0C00D611 */ jal func_80035844 -/* 00AB4 8089E6E4 AFA40020 */ sw $a0, 0x0020($sp) -/* 00AB8 8089E6E8 0C00B65F */ jal func_8002D97C -/* 00ABC 8089E6EC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00AC0 8089E6F0 C7A4003C */ lwc1 $f4, 0x003C($sp) -/* 00AC4 8089E6F4 C6060024 */ lwc1 $f6, 0x0024($s0) ## 00000024 -/* 00AC8 8089E6F8 3C014000 */ lui $at, 0x4000 ## $at = 40000000 -/* 00ACC 8089E6FC 44818000 */ mtc1 $at, $f16 ## $f16 = 2.00 -/* 00AD0 8089E700 46062081 */ sub.s $f2, $f4, $f6 -/* 00AD4 8089E704 C7A80040 */ lwc1 $f8, 0x0040($sp) -/* 00AD8 8089E708 C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028 -/* 00ADC 8089E70C C604002C */ lwc1 $f4, 0x002C($s0) ## 0000002C -/* 00AE0 8089E710 46001005 */ abs.s $f0, $f2 -/* 00AE4 8089E714 C7B20044 */ lwc1 $f18, 0x0044($sp) -/* 00AE8 8089E718 4610003C */ c.lt.s $f0, $f16 -/* 00AEC 8089E71C 460A4301 */ sub.s $f12, $f8, $f10 -/* 00AF0 8089E720 4500001E */ bc1f .L8089E79C -/* 00AF4 8089E724 46049381 */ sub.s $f14, $f18, $f4 -/* 00AF8 8089E728 46006005 */ abs.s $f0, $f12 -/* 00AFC 8089E72C 4610003C */ c.lt.s $f0, $f16 -/* 00B00 8089E730 00000000 */ nop -/* 00B04 8089E734 45000019 */ bc1f .L8089E79C -/* 00B08 8089E738 00000000 */ nop -/* 00B0C 8089E73C 46007005 */ abs.s $f0, $f14 -/* 00B10 8089E740 4610003C */ c.lt.s $f0, $f16 -/* 00B14 8089E744 00000000 */ nop -/* 00B18 8089E748 45000014 */ bc1f .L8089E79C -/* 00B1C 8089E74C 00000000 */ nop -/* 00B20 8089E750 8E180184 */ lw $t8, 0x0184($s0) ## 00000184 -/* 00B24 8089E754 8FA20028 */ lw $v0, 0x0028($sp) -/* 00B28 8089E758 9606001C */ lhu $a2, 0x001C($s0) ## 0000001C -/* 00B2C 8089E75C 27190001 */ addiu $t9, $t8, 0x0001 ## $t9 = 00000001 -/* 00B30 8089E760 AE190184 */ sw $t9, 0x0184($s0) ## 00000184 -/* 00B34 8089E764 8C491E08 */ lw $t1, 0x1E08($v0) ## 00001E08 -/* 00B38 8089E768 00063203 */ sra $a2, $a2, 8 -/* 00B3C 8089E76C 30C6000F */ andi $a2, $a2, 0x000F ## $a2 = 00000000 -/* 00B40 8089E770 000650C0 */ sll $t2, $a2, 3 -/* 00B44 8089E774 012A5821 */ addu $t3, $t1, $t2 -/* 00B48 8089E778 916C0000 */ lbu $t4, 0x0000($t3) ## 00000000 -/* 00B4C 8089E77C 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00B50 8089E780 032C082A */ slt $at, $t9, $t4 -/* 00B54 8089E784 14200005 */ bne $at, $zero, .L8089E79C -/* 00B58 8089E788 00000000 */ nop -/* 00B5C 8089E78C AE000184 */ sw $zero, 0x0184($s0) ## 00000184 -/* 00B60 8089E790 8FA50020 */ lw $a1, 0x0020($sp) -/* 00B64 8089E794 0C227842 */ jal func_8089E108 -/* 00B68 8089E798 8C441E08 */ lw $a0, 0x1E08($v0) ## 00001E08 -.L8089E79C: -/* 00B6C 8089E79C 3C03808A */ lui $v1, %hi(D_8089EE40) ## $v1 = 808A0000 -/* 00B70 8089E7A0 2463EE40 */ addiu $v1, $v1, %lo(D_8089EE40) ## $v1 = 8089EE40 -/* 00B74 8089E7A4 90620000 */ lbu $v0, 0x0000($v1) ## 8089EE40 -/* 00B78 8089E7A8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00B7C 8089E7AC 304D0001 */ andi $t5, $v0, 0x0001 ## $t5 = 00000000 -/* 00B80 8089E7B0 55A0000C */ bnel $t5, $zero, .L8089E7E4 -/* 00B84 8089E7B4 920B017C */ lbu $t3, 0x017C($s0) ## 0000017C -/* 00B88 8089E7B8 960E001C */ lhu $t6, 0x001C($s0) ## 0000001C -/* 00B8C 8089E7BC 34590001 */ ori $t9, $v0, 0x0001 ## $t9 = 00000001 -/* 00B90 8089E7C0 000E7903 */ sra $t7, $t6, 4 -/* 00B94 8089E7C4 31F8000F */ andi $t8, $t7, 0x000F ## $t8 = 00000000 -/* 00B98 8089E7C8 53000006 */ beql $t8, $zero, .L8089E7E4 -/* 00B9C 8089E7CC 920B017C */ lbu $t3, 0x017C($s0) ## 0000017C -/* 00BA0 8089E7D0 A0790000 */ sb $t9, 0x0000($v1) ## 8089EE40 -/* 00BA4 8089E7D4 9209017C */ lbu $t1, 0x017C($s0) ## 0000017C -/* 00BA8 8089E7D8 352A0001 */ ori $t2, $t1, 0x0001 ## $t2 = 00000001 -/* 00BAC 8089E7DC A20A017C */ sb $t2, 0x017C($s0) ## 0000017C -/* 00BB0 8089E7E0 920B017C */ lbu $t3, 0x017C($s0) ## 0000017C -.L8089E7E4: -/* 00BB4 8089E7E4 31680001 */ andi $t0, $t3, 0x0001 ## $t0 = 00000000 -/* 00BB8 8089E7E8 51000004 */ beql $t0, $zero, .L8089E7FC -/* 00BBC 8089E7EC 8FBF001C */ lw $ra, 0x001C($sp) -/* 00BC0 8089E7F0 0C00BE52 */ jal func_8002F948 -/* 00BC4 8089E7F4 24052082 */ addiu $a1, $zero, 0x2082 ## $a1 = 00002082 -/* 00BC8 8089E7F8 8FBF001C */ lw $ra, 0x001C($sp) -.L8089E7FC: -/* 00BCC 8089E7FC 8FB00018 */ lw $s0, 0x0018($sp) -/* 00BD0 8089E800 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000 -/* 00BD4 8089E804 03E00008 */ jr $ra -/* 00BD8 8089E808 00000000 */ nop diff --git a/assets/xml/objects/object_mizu_objects.xml b/assets/xml/objects/object_mizu_objects.xml new file mode 100644 index 0000000000..9042884490 --- /dev/null +++ b/assets/xml/objects/object_mizu_objects.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/overlays/actors/z_bg_mizu_movebg.bss.s b/data/overlays/actors/z_bg_mizu_movebg.bss.s deleted file mode 100644 index c834016af8..0000000000 --- a/data/overlays/actors/z_bg_mizu_movebg.bss.s +++ /dev/null @@ -1,14 +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 .bss - -.balign 16 - -glabel D_8089EE40 - .space 0x10 - diff --git a/data/overlays/actors/z_bg_mizu_movebg.data.s b/data/overlays/actors/z_bg_mizu_movebg.data.s deleted file mode 100644 index 6a64e460ec..0000000000 --- a/data/overlays/actors/z_bg_mizu_movebg.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 Bg_Mizu_Movebg_InitVars - .word 0x00640100, 0x00000010, 0x00590000, 0x00000188 -.word BgMizuMovebg_Init -.word BgMizuMovebg_Destroy -.word BgMizuMovebg_Update -.word BgMizuMovebg_Draw -glabel D_8089EB40 - .word 0xC2E66667, 0xC2E66667, 0xC2E66667, 0x00000000 -glabel D_8089EB50 - .word 0x06000190, 0x06000680, 0x06000C20, 0x06002E10, 0x06002E10, 0x06002E10, 0x06002E10, 0x060011F0 -glabel D_8089EB70 - .word 0x060003F0, 0x06000998, 0x06000ED0, 0x06003590, 0x06003590, 0x06003590, 0x06003590, 0x060015F8 -glabel D_8089EB90 - .word 0xB0F805DC, 0xB0FC044C, 0xB0F403E8, 0x48500064 -glabel D_8089EBA0 - .word 0x00000000, 0x42A00000, 0x41B80000 -glabel D_8089EBAC - .word 0x00000000, 0x42A00000, 0x41B80000, 0x00000000, 0x00000000 - diff --git a/spec b/spec index 18725d2d1d..7f421b877e 100644 --- a/spec +++ b/spec @@ -1028,9 +1028,11 @@ endseg beginseg name "ovl_Bg_Mizu_Movebg" include "build/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.o" - include "build/data/overlays/actors/z_bg_mizu_movebg.data.o" - include "build/data/overlays/actors/z_bg_mizu_movebg.bss.o" +#ifdef NON_MATCHING + include "build/src/overlays/actors/ovl_Bg_Mizu_Movebg/ovl_Bg_Mizu_Movebg_reloc.o" +#else include "build/data/overlays/actors/z_bg_mizu_movebg.reloc.o" +#endif endseg beginseg @@ -3969,7 +3971,8 @@ endseg beginseg name "object_mizu_objects" romalign 0x1000 - include "build/baserom/object_mizu_objects.o" + include "build/assets/objects/object_mizu_objects/object_mizu_objects.o" + number 6 endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c index 81a806d747..9b3ca174ef 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c +++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c @@ -39,7 +39,7 @@ const ActorInit Bg_Ice_Objects_InitVars = { (ActorFunc)BgIceObjects_Draw, }; -InitChainEntry sInitChain[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index cebddb99a5..f13eb68770 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -5,6 +5,8 @@ */ #include "z_bg_mizu_bwall.h" +#include "overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h" +#include "objects/object_mizu_objects/object_mizu_objects.h" #define FLAGS 0x00000010 @@ -148,10 +150,12 @@ static ColliderTrisInit sTrisInitStingerWall = { }; static Gfx* sDLists[] = { - 0x06001A30, 0x06002390, 0x06001CD0, 0x06002090, 0x06001770, + gObjectMizuObjectsBwallDL_001A30, gObjectMizuObjectsBwallDL_002390, gObjectMizuObjectsBwallDL_001CD0, + gObjectMizuObjectsBwallDL_002090, gObjectMizuObjectsBwallDL_001770, }; static CollisionHeader* sColHeaders[] = { - 0x06001C58, 0x060025A4, 0x06001DE8, 0x06001DE8, 0x06001DE8, + &gObjectMizuObjectsBwallCol_001C58, &gObjectMizuObjectsBwallCol_0025A4, &gObjectMizuObjectsBwallCol_001DE8, + &gObjectMizuObjectsBwallCol_001DE8, &gObjectMizuObjectsBwallCol_001DE8, }; static InitChainEntry D_8089D854[] = { @@ -378,34 +382,36 @@ void BgMizuBwall_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgMizuBwall_SetAlpha(BgMizuBwall* this, GlobalContext* globalCtx) { f32 waterLevel = globalCtx->colCtx.colHeader->waterBoxes[2].ySurface; - s32 alphaMod; if (globalCtx->colCtx.colHeader->waterBoxes) {} - if (waterLevel < -15.0f) { + if (waterLevel < WATER_TEMPLE_WATER_F1_Y) { this->scrollAlpha1 = 255; - } else if (waterLevel < 445.0f) { - alphaMod = ((waterLevel - -15.0f) / (445.0f - -15.0f)) * 95.0f; - this->scrollAlpha1 = 255 - alphaMod; + } else if (waterLevel < WATER_TEMPLE_WATER_F2_Y) { + this->scrollAlpha1 = 255 - (s32)((waterLevel - WATER_TEMPLE_WATER_F1_Y) / + (WATER_TEMPLE_WATER_F2_Y - WATER_TEMPLE_WATER_F1_Y) * (255 - 160)); } else { this->scrollAlpha1 = 160; } - if (waterLevel < 445.0f) { + + if (waterLevel < WATER_TEMPLE_WATER_F2_Y) { this->scrollAlpha2 = 255; - } else if (waterLevel < 765.0f) { - alphaMod = ((waterLevel - 445.0f) / (765.0f - 445.0f)) * 95.0f; - this->scrollAlpha2 = 255 - alphaMod; + } else if (waterLevel < WATER_TEMPLE_WATER_F3_Y) { + this->scrollAlpha2 = 255 - (s32)((waterLevel - WATER_TEMPLE_WATER_F2_Y) / + (WATER_TEMPLE_WATER_F3_Y - WATER_TEMPLE_WATER_F2_Y) * (255 - 160)); } else { this->scrollAlpha2 = 160; } - if (waterLevel < -835.0f) { + + if (waterLevel < WATER_TEMPLE_WATER_B1_Y) { this->scrollAlpha3 = 255; - } else if (waterLevel < -15.0f) { - alphaMod = ((waterLevel - -835.0f) / (-15.0f - -835.0f)) * 95.0f; - this->scrollAlpha3 = 255 - alphaMod; + } else if (waterLevel < WATER_TEMPLE_WATER_F1_Y) { + this->scrollAlpha3 = 255 - (s32)((waterLevel - WATER_TEMPLE_WATER_B1_Y) / + (WATER_TEMPLE_WATER_F1_Y - WATER_TEMPLE_WATER_B1_Y) * (255 - 160)); } else { this->scrollAlpha3 = 160; } + this->scrollAlpha4 = this->scrollAlpha3; } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index d0dfd33554..c7cd5ec3fe 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -1,15 +1,32 @@ +/* + * File: z_bg_mizu_movebg.c + * Overlay: ovl_Bg_Mizu_Movebg + * Description: Kakariko Village Well Water + */ + #include "z_bg_mizu_movebg.h" +#include "overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h" +#include "objects/object_mizu_objects/object_mizu_objects.h" #define FLAGS 0x00000010 #define THIS ((BgMizuMovebg*)thisx) +#define MOVEBG_TYPE(params) (((u16)(params) >> 0xC) & 0xF) +#define MOVEBG_FLAGS(params) ((u16)(params)&0x3F) +#define MOVEBG_PATH_ID(params) (((u16)(params) >> 0x8) & 0xF) +#define MOVEBG_POINT_ID(params) ((u16)(params)&0xF) +#define MOVEBG_SPEED(params) (((u16)(params) >> 0x4) & 0xF) + void BgMizuMovebg_Init(Actor* thisx, GlobalContext* globalCtx); void BgMizuMovebg_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgMizuMovebg_Update(Actor* thisx, GlobalContext* globalCtx); void BgMizuMovebg_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void func_8089E318(BgMizuMovebg* this, GlobalContext* globalCtx); +void func_8089E650(BgMizuMovebg* this, GlobalContext* globalCtx); +s32 func_8089E108(Path* pathList, Vec3f* pos, s32 pathId, s32 pointId); + const ActorInit Bg_Mizu_Movebg_InitVars = { ACTOR_BG_MIZU_MOVEBG, ACTORCAT_BG, @@ -21,21 +38,358 @@ const ActorInit Bg_Mizu_Movebg_InitVars = { (ActorFunc)BgMizuMovebg_Update, (ActorFunc)BgMizuMovebg_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089DC30.s") +static f32 D_8089EB40[] = { -115.200005f, -115.200005f, -115.200005f, 0.0f }; + +static Gfx* D_8089EB50[] = { + gObjectMizuObjectsMovebgDL_000190, gObjectMizuObjectsMovebgDL_000680, gObjectMizuObjectsMovebgDL_000C20, + gObjectMizuObjectsMovebgDL_002E10, gObjectMizuObjectsMovebgDL_002E10, gObjectMizuObjectsMovebgDL_002E10, + gObjectMizuObjectsMovebgDL_002E10, gObjectMizuObjectsMovebgDL_0011F0, +}; + +static CollisionHeader* D_8089EB70[] = { + &gObjectMizuObjectsMovebgCol_0003F0, &gObjectMizuObjectsMovebgCol_000998, &gObjectMizuObjectsMovebgCol_000ED0, + &gObjectMizuObjectsMovebgCol_003590, &gObjectMizuObjectsMovebgCol_003590, &gObjectMizuObjectsMovebgCol_003590, + &gObjectMizuObjectsMovebgCol_003590, &gObjectMizuObjectsMovebgCol_0015F8, +}; + +static InitChainEntry D_8089EB90[] = { + ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), +}; + +static Vec3f D_8089EBA0 = { 0.0f, 80.0f, 23.0f }; +static Vec3f D_8089EBAC = { 0.0f, 80.0f, 23.0f }; + +static u8 D_8089EE40; + +s32 func_8089DC30(GlobalContext* globalCtx) { + s32 result; + + if (Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F1_FLAG)) { + result = 1; + } else if (Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F2_FLAG)) { + result = 2; + } else if (Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F3_FLAG)) { + result = 3; + } else { + result = 1; + } + return result; +} + +#ifdef NON_MATCHING +// Codegen OK, Stack Issues +void BgMizuMovebg_Init(Actor* thisx, GlobalContext* globalCtx) { + BgMizuMovebg* this = THIS; + WaterBox* waterBoxes; + CollisionHeader* colHeader; + + waterBoxes = globalCtx->colCtx.colHeader->waterBoxes; + colHeader = NULL; + + Actor_ProcessInitChain(&this->dyna.actor, D_8089EB90); + this->homeY = this->dyna.actor.world.pos.y; + this->dlist = D_8089EB50[MOVEBG_TYPE(this->dyna.actor.params)]; + DynaPolyActor_Init(&this->dyna, DPM_PLAYER); + CollisionHeader_GetVirtual(D_8089EB70[MOVEBG_TYPE(this->dyna.actor.params)], &colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); + + switch (MOVEBG_TYPE(this->dyna.actor.params)) { + case 0: + if (waterBoxes[2].ySurface + 15.0f < this->homeY - 700.0f) { + this->dyna.actor.world.pos.y = this->homeY - 700.0f; + } else { + this->dyna.actor.world.pos.y = waterBoxes[2].ySurface + 15.0f; + } + this->actionFunc = func_8089E318; + break; + case 1: + if (waterBoxes[2].ySurface + 15.0f < this->homeY - 710.0f) { + this->dyna.actor.world.pos.y = this->homeY - 710.0f; + } else { + this->dyna.actor.world.pos.y = waterBoxes[2].ySurface + 15.0f; + } + this->actionFunc = func_8089E318; + break; + case 2: + if (waterBoxes[2].ySurface + 15.0f < this->homeY - 700.0f) { + this->dyna.actor.world.pos.y = this->homeY - 700.0f; + } else { + this->dyna.actor.world.pos.y = waterBoxes[2].ySurface + 15.0f; + } + this->actionFunc = func_8089E318; + break; + case 3: + this->dyna.actor.world.pos.y = this->homeY + D_8089EB40[func_8089DC30(globalCtx)]; + this->actionFunc = func_8089E318; + break; + case 4: + case 5: + case 6: + if (Flags_GetSwitch(globalCtx, MOVEBG_FLAGS(this->dyna.actor.params))) { + this->dyna.actor.world.pos.y = this->homeY + 115.2; + } else { + this->dyna.actor.world.pos.y = this->homeY; + } + this->actionFunc = func_8089E318; + break; + case 7: + this->scrollAlpha1 = 160; + this->scrollAlpha2 = 160; + this->scrollAlpha3 = 160; + this->scrollAlpha4 = 160; + this->waypointId = MOVEBG_POINT_ID(this->dyna.actor.params); + func_8089E108(globalCtx->setupPathList, &this->dyna.actor.world.pos, + MOVEBG_PATH_ID(this->dyna.actor.params), this->waypointId); + this->actionFunc = func_8089E650; + break; + } + switch (MOVEBG_TYPE(this->dyna.actor.params)) { + case 3: + case 4: + case 5: + case 6: { + Actor* actor; + Vec3f sp48; + Matrix_RotateY(this->dyna.actor.world.rot.y * (M_PI / 32768), MTXMODE_NEW); + Matrix_MultVec3f(&D_8089EBA0, &sp48); + actor = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_OBJ_HSBLOCK, + this->dyna.actor.world.pos.x + sp48.x, this->dyna.actor.world.pos.y + sp48.y, + this->dyna.actor.world.pos.z + sp48.z, this->dyna.actor.world.rot.x, + this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 2); + if (actor == NULL) { + Actor_Kill(&this->dyna.actor); + } + } + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Init.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Destroy.s") +void BgMizuMovebg_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgMizuMovebg* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E108.s") + DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); + switch (MOVEBG_TYPE(thisx->params)) { + case 3: + case 4: + case 5: + case 6: + if (this->sfxFlags & 2) { + D_8089EE40 &= ~2; + } + break; + case 7: + if (this->sfxFlags & 1) { + D_8089EE40 &= ~1; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E198.s") +s32 func_8089E108(Path* pathList, Vec3f* pos, s32 pathId, s32 pointId) { + Path* path = pathList; + Vec3s* point; + path += pathId; + point = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[pointId]; + + pos->x = point->x; + pos->y = point->y; + pos->z = point->z; + + return 0; +} + +void func_8089E198(BgMizuMovebg* this, GlobalContext* globalCtx) { + f32 waterLevel = globalCtx->colCtx.colHeader->waterBoxes[2].ySurface; + + if (waterLevel < WATER_TEMPLE_WATER_F1_Y) { + this->scrollAlpha1 = 255; + } else if (waterLevel < WATER_TEMPLE_WATER_F2_Y) { + this->scrollAlpha1 = 255 - (s32)((waterLevel - WATER_TEMPLE_WATER_F1_Y) / + (WATER_TEMPLE_WATER_F2_Y - WATER_TEMPLE_WATER_F1_Y) * (255 - 160)); + } else { + this->scrollAlpha1 = 160; + } + + if (waterLevel < WATER_TEMPLE_WATER_F2_Y) { + this->scrollAlpha2 = 255; + } else if (waterLevel < WATER_TEMPLE_WATER_F3_Y) { + this->scrollAlpha2 = 255 - (s32)((waterLevel - WATER_TEMPLE_WATER_F2_Y) / + (WATER_TEMPLE_WATER_F3_Y - WATER_TEMPLE_WATER_F2_Y) * (255 - 160)); + } else { + this->scrollAlpha2 = 160; + } + + if (waterLevel < WATER_TEMPLE_WATER_B1_Y) { + this->scrollAlpha3 = 255; + } else if (waterLevel < WATER_TEMPLE_WATER_F1_Y) { + this->scrollAlpha3 = 255 - (s32)((waterLevel - WATER_TEMPLE_WATER_B1_Y) / + (WATER_TEMPLE_WATER_F1_Y - WATER_TEMPLE_WATER_B1_Y) * (255 - 160)); + } else { + this->scrollAlpha3 = 160; + } + + this->scrollAlpha4 = this->scrollAlpha3; +} + +#ifdef NON_MATCHING +void func_8089E318(BgMizuMovebg* this, GlobalContext* globalCtx) { + WaterBox* waterBoxes; + f32 phi_f0; + Vec3f sp28; + + waterBoxes = globalCtx->colCtx.colHeader->waterBoxes; + func_8089E198(this, globalCtx); + switch (MOVEBG_TYPE(this->dyna.actor.params)) { + case 0: + case 2: + if (waterBoxes[2].ySurface + 15.0f < this->homeY - 700.0f) { + this->dyna.actor.world.pos.y = this->homeY - 700.0f; + } else { + this->dyna.actor.world.pos.y = waterBoxes[2].ySurface + 15.0f; + } + break; + case 1: + if (waterBoxes[2].ySurface + 15.0f < this->homeY - 710.0f) { + this->dyna.actor.world.pos.y = this->homeY - 710.0f; + } else { + this->dyna.actor.world.pos.y = waterBoxes[2].ySurface + 15.0f; + } + break; + case 3: + phi_f0 = this->homeY + D_8089EB40[func_8089DC30(globalCtx)]; + if (!Math_StepToF(&this->dyna.actor.world.pos.y, phi_f0, 1.0f)) { + if (!(D_8089EE40 & 2) && MOVEBG_SPEED(this->dyna.actor.params) != 0) { + D_8089EE40 |= 2; + this->sfxFlags |= 2; + } + if (this->sfxFlags & 2) { + if (this->dyna.actor.room == 0) { + func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + } else { + func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + } + } + } + break; + case 4: + case 5: + case 6: + if (Flags_GetSwitch(globalCtx, MOVEBG_FLAGS(this->dyna.actor.params))) { + phi_f0 = this->homeY + 115.200005f; + } else { + phi_f0 = this->homeY; + } + if (!Math_StepToF(&this->dyna.actor.world.pos.y, phi_f0, 1.0f)) { + if (!(D_8089EE40 & 2) && MOVEBG_SPEED(this->dyna.actor.params) != 0) { + D_8089EE40 |= 2; + this->sfxFlags |= 2; + } + if (this->sfxFlags & 2) { + func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); + } + } + break; + } + switch (MOVEBG_TYPE(this->dyna.actor.params)) { + case 3: + case 4: + case 5: + case 6: + if (globalCtx->roomCtx.curRoom.num == this->dyna.actor.room) { + Matrix_RotateY(this->dyna.actor.world.rot.y * (M_PI / 32768), MTXMODE_NEW); + Matrix_MultVec3f(&D_8089EBAC, &sp28); + this->dyna.actor.child->world.pos.x = this->dyna.actor.world.pos.x + sp28.x; + this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + sp28.y; + this->dyna.actor.child->world.pos.z = this->dyna.actor.world.pos.z + sp28.z; + this->dyna.actor.child->flags &= ~1; + } + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E318.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s") +void func_8089E650(BgMizuMovebg* this, GlobalContext* globalCtx) { + Vec3f waypoint; + f32 dist; + f32 dx; + f32 dy; + f32 dz; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Update.s") + this->dyna.actor.speedXZ = MOVEBG_SPEED(this->dyna.actor.params) * 0.1f; + func_8089E108(globalCtx->setupPathList, &waypoint, MOVEBG_PATH_ID(this->dyna.actor.params), this->waypointId); + dist = Actor_WorldDistXYZToPoint(&this->dyna.actor, &waypoint); + if (dist < this->dyna.actor.speedXZ) { + this->dyna.actor.speedXZ = dist; + } + func_80035844(&this->dyna.actor.world.pos, &waypoint, &this->dyna.actor.world.rot, 1); + func_8002D97C(&this->dyna.actor); + dx = waypoint.x - this->dyna.actor.world.pos.x; + dy = waypoint.y - this->dyna.actor.world.pos.y; + dz = waypoint.z - this->dyna.actor.world.pos.z; + if (fabsf(dx) < 2.0f && fabsf(dy) < 2.0f && fabsf(dz) < 2.0f) { + this->waypointId++; + if (this->waypointId >= globalCtx->setupPathList[MOVEBG_PATH_ID(this->dyna.actor.params)].count) { + this->waypointId = 0; + func_8089E108(globalCtx->setupPathList, &this->dyna.actor.world.pos, + MOVEBG_PATH_ID(this->dyna.actor.params), 0); + } + } + if (!(D_8089EE40 & 1) && MOVEBG_SPEED(this->dyna.actor.params) != 0) { + D_8089EE40 |= 1; + this->sfxFlags |= 1; + } + if (this->sfxFlags & 1) { + func_8002F948(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/BgMizuMovebg_Draw.s") +void BgMizuMovebg_Update(Actor* thisx, GlobalContext* globalCtx) { + BgMizuMovebg* this = THIS; + + this->actionFunc(this, globalCtx); +} + +void BgMizuMovebg_Draw(Actor* thisx, GlobalContext* globalCtx2) { + BgMizuMovebg* this = THIS; + GlobalContext* globalCtx = globalCtx2; + u32 frames; + + if (1) {} + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_mizu_movebg.c", 754); + + frames = globalCtx->gameplayFrames; + func_80093D18(globalCtx->state.gfxCtx); + + gSPSegment(POLY_OPA_DISP++, 0x08, + Gfx_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, frames * 1, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, + this->scrollAlpha1)); + + gSPSegment(POLY_OPA_DISP++, 0x09, + Gfx_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, frames * 1, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, + this->scrollAlpha2)); + + gSPSegment(POLY_OPA_DISP++, 0x0A, + Gfx_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, frames * 1, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, + this->scrollAlpha3)); + + gSPSegment(POLY_OPA_DISP++, 0x0B, + Gfx_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, frames * 3, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, + this->scrollAlpha4)); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_mizu_movebg.c", 788), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + if (this->dlist != NULL) { + gSPDisplayList(POLY_OPA_DISP++, this->dlist); + } + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_mizu_movebg.c", 795); +} diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h index 319d21b97a..73da599261 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h @@ -6,9 +6,19 @@ struct BgMizuMovebg; +typedef void (*BgMizuMovebgActionFunc)(struct BgMizuMovebg*, GlobalContext*); + typedef struct BgMizuMovebg { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x3C]; + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ BgMizuMovebgActionFunc actionFunc; + /* 0x0168 */ f32 homeY; + /* 0x016C */ s32 scrollAlpha1; + /* 0x0170 */ s32 scrollAlpha2; + /* 0x0174 */ s32 scrollAlpha3; + /* 0x0178 */ s32 scrollAlpha4; + /* 0x017C */ u8 sfxFlags; + /* 0x0180 */ Gfx* dlist; + /* 0x0184 */ s32 waypointId; } BgMizuMovebg; // size = 0x0188 extern const ActorInit Bg_Mizu_Movebg_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c index 13b73eb51d..ca51a07e59 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c @@ -1,4 +1,5 @@ #include "z_bg_mizu_shutter.h" +#include "objects/object_mizu_objects/object_mizu_objects.h" #define FLAGS 0x00000010 @@ -29,12 +30,18 @@ const ActorInit Bg_Mizu_Shutter_InitVars = { (ActorFunc)BgMizuShutter_Draw, }; -static Gfx* sDisplayLists[] = { 0x06007130, 0x060072D0 }; -static CollisionHeader* sCollisionHeaders[] = { 0x06007250, 0x060073F0 }; +static Gfx* sDisplayLists[] = { gObjectMizuObjectsShutterDL_007130, gObjectMizuObjectsShutterDL_0072D0 }; + +static CollisionHeader* sCollisionHeaders[] = { + &gObjectMizuObjectsShutterCol_007250, + &gObjectMizuObjectsShutterCol_0073F0, +}; + static Vec3f sDisplacements[] = { { 0.0f, 100.0f, 0.0f }, { 0.0f, 140.0f, 0.0f }, }; + static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_CONTINUE), diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c index 685722bbfa..dd98542226 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c @@ -5,6 +5,7 @@ */ #include "z_bg_mizu_uzu.h" +#include "objects/object_mizu_objects/object_mizu_objects.h" #define FLAGS 0x00000000 @@ -35,8 +36,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern CollisionHeader D_060074EC; - void BgMizuUzu_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgMizuUzu* this = THIS; @@ -45,7 +44,7 @@ void BgMizuUzu_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); - CollisionHeader_GetVirtual(&D_060074EC, &colHeader); + CollisionHeader_GetVirtual(&gObjectMizuObjectsUzuCol_0074EC, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); this->actionFunc = func_8089F788; } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index 367ddfd281..cae79ecb0e 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -5,6 +5,7 @@ */ #include "z_bg_mizu_water.h" +#include "objects/object_mizu_objects/object_mizu_objects.h" #define FLAGS 0x00000030 @@ -18,8 +19,6 @@ void BgMizuWater_Draw(Actor* thisx, GlobalContext* globalCtx); void BgMizuWater_WaitForAction(BgMizuWater* this, GlobalContext* globalCtx); void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx); -extern Gfx D_06004B20[]; - typedef struct { s32 switchFlag; s32 yDiff; @@ -27,9 +26,9 @@ typedef struct { static WaterLevel sWaterLevels[] = { { 0x00, 0 }, - { 0x1E, 0 }, - { 0x1D, -320 }, - { 0x1C, -780 }, + { WATER_TEMPLE_WATER_F3_FLAG, 0 }, + { WATER_TEMPLE_WATER_F2_FLAG, WATER_TEMPLE_WATER_F2_Y - WATER_TEMPLE_WATER_F3_Y }, + { WATER_TEMPLE_WATER_F1_FLAG, WATER_TEMPLE_WATER_F1_Y - WATER_TEMPLE_WATER_F3_Y }, }; const ActorInit Bg_Mizu_Water_InitVars = { @@ -59,22 +58,22 @@ u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, GlobalContext* globalCt if (bREG(0) != 0) { switch (bREG(1)) { case 0: - Flags_SetSwitch(globalCtx, 0x1C); + Flags_SetSwitch(globalCtx, WATER_TEMPLE_WATER_F1_FLAG); break; case 1: - Flags_SetSwitch(globalCtx, 0x1D); + Flags_SetSwitch(globalCtx, WATER_TEMPLE_WATER_F2_FLAG); break; case 2: - Flags_SetSwitch(globalCtx, 0x1E); + Flags_SetSwitch(globalCtx, WATER_TEMPLE_WATER_F3_FLAG); break; } bREG(0) = 0; } - if (Flags_GetSwitch(globalCtx, 0x1C) && (switchFlag != 0x1C)) { + if (Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F1_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F1_FLAG)) { ret = 3; - } else if (Flags_GetSwitch(globalCtx, 0x1D) && (switchFlag != 0x1D)) { + } else if (Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F2_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F2_FLAG)) { ret = 2; - } else if (Flags_GetSwitch(globalCtx, 0x1E) && (switchFlag != 0x1E)) { + } else if (Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F3_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F3_FLAG)) { ret = 1; } else { ret = 0; @@ -108,27 +107,28 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) { switch (this->type) { case 0: if (bREG(15) == 0) { - osSyncPrintf("<コンストラクト>%x %x %x\n", Flags_GetSwitch(globalCtx, 0x1C), - Flags_GetSwitch(globalCtx, 0x1D), Flags_GetSwitch(globalCtx, 0x1E)); + osSyncPrintf("<コンストラクト>%x %x %x\n", Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F1_FLAG), + Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F2_FLAG), + Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F3_FLAG)); } waterLevelActionIndex = BgMizuWater_GetWaterLevelActionIndex(-1, globalCtx); this->actor.world.pos.y = sWaterLevels[waterLevelActionIndex].yDiff + this->baseY; BgMizuWater_SetWaterBoxesHeight(waterBoxes, this->actor.world.pos.y); this->actor.params = sWaterLevels[waterLevelActionIndex].switchFlag; - Flags_UnsetSwitch(globalCtx, 0x1C); - Flags_UnsetSwitch(globalCtx, 0x1D); - Flags_UnsetSwitch(globalCtx, 0x1E); + Flags_UnsetSwitch(globalCtx, WATER_TEMPLE_WATER_F1_FLAG); + Flags_UnsetSwitch(globalCtx, WATER_TEMPLE_WATER_F2_FLAG); + Flags_UnsetSwitch(globalCtx, WATER_TEMPLE_WATER_F3_FLAG); switch (this->actor.params) { case 0x1E: - Flags_SetSwitch(globalCtx, 0x1E); + Flags_SetSwitch(globalCtx, WATER_TEMPLE_WATER_F3_FLAG); break; case 0x1D: - Flags_SetSwitch(globalCtx, 0x1D); + Flags_SetSwitch(globalCtx, WATER_TEMPLE_WATER_F2_FLAG); break; case 0x1C: default: - Flags_SetSwitch(globalCtx, 0x1C); + Flags_SetSwitch(globalCtx, WATER_TEMPLE_WATER_F1_FLAG); break; } this->targetY = this->actor.world.pos.y; @@ -300,23 +300,25 @@ void BgMizuWater_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; if (bREG(15) == 0) { - osSyncPrintf("%x %x %x\n", Flags_GetSwitch(globalCtx, 0x1C), Flags_GetSwitch(globalCtx, 0x1D), - Flags_GetSwitch(globalCtx, 0x1E)); + osSyncPrintf("%x %x %x\n", Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F1_FLAG), + Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F2_FLAG), + Flags_GetSwitch(globalCtx, WATER_TEMPLE_WATER_F3_FLAG)); } - if (this->type == 0) { posY = this->actor.world.pos.y; unk0 = 0; unk1 = 0; - if (posY < -15.0f) { + if (posY < WATER_TEMPLE_WATER_F1_Y) { unk0 = 0; - unk1 = ((posY - -835.0f) / 820.0f) * 200.0f; - } else if (posY < 445.0f) { + unk1 = (posY - WATER_TEMPLE_WATER_B1_Y) / (WATER_TEMPLE_WATER_F1_Y - WATER_TEMPLE_WATER_B1_Y) * 200; + } else if (posY < WATER_TEMPLE_WATER_F2_Y) { unk0 = 1; - unk1 = 0xFF - (s32)(((posY - -15.0f) / 460.0f) * 95.0f); - } else if (posY <= 765.0f) { + unk1 = 255 - (s32)((posY - WATER_TEMPLE_WATER_F1_Y) / (WATER_TEMPLE_WATER_F2_Y - WATER_TEMPLE_WATER_F1_Y) * + (255 - 160)); + } else if (posY <= WATER_TEMPLE_WATER_F3_Y) { unk0 = 2; - unk1 = 0xFF - (s32)(((posY - 445.0f) / 320.0f) * 95.0f); + unk1 = 255 - (s32)((posY - WATER_TEMPLE_WATER_F2_Y) / (WATER_TEMPLE_WATER_F3_Y - WATER_TEMPLE_WATER_F2_Y) * + (255 - 160)); } globalCtx->unk_11D30[1] = ((u8)unk0 << 8) | (unk1 & 0xFF); } @@ -343,7 +345,7 @@ void BgMizuWater_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 102); - gSPDisplayList(POLY_XLU_DISP++, D_06004B20); + gSPDisplayList(POLY_XLU_DISP++, gObjectMizuObjectsWaterDL_004B20); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_mizu_water.c", 756); } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h index 628dd9acee..44c0edb4e6 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h @@ -19,4 +19,13 @@ typedef struct BgMizuWater { extern const ActorInit Bg_Mizu_Water_InitVars; +#define WATER_TEMPLE_WATER_F3_Y 765.0f +#define WATER_TEMPLE_WATER_F2_Y 445.0f +#define WATER_TEMPLE_WATER_F1_Y -15.0f +#define WATER_TEMPLE_WATER_B1_Y -835.0f + +#define WATER_TEMPLE_WATER_F3_FLAG 0x1E +#define WATER_TEMPLE_WATER_F2_FLAG 0x1D +#define WATER_TEMPLE_WATER_F1_FLAG 0x1C + #endif diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 2499695370..4e12788258 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -11,6 +11,7 @@ #include "objects/object_goma/object_goma.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_hidan_objects/object_hidan_objects.h" +#include "objects/object_mizu_objects/object_mizu_objects.h" #define FLAGS 0x00000010 @@ -97,8 +98,8 @@ static ShutterInfo D_80998134[] = { { gFireTempleDoorFrontDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, { gFireTempleDoorBackDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, { 0x060000C0, gDoorMetalBarsDL, 130, 12, 20, 15 }, - { 0x06005D90, gDoorMetalBarsDL, 130, 12, 20, 15 }, - { 0x06007000, gDoorMetalBarsDL, 130, 12, 20, 15 }, + { gObjectMizuObjectsDoorShutterDL_005D90, gDoorMetalBarsDL, 130, 12, 20, 15 }, + { gObjectMizuObjectsDoorShutterDL_007000, gDoorMetalBarsDL, 130, 12, 20, 15 }, { 0x06002620, gDoorMetalBarsDL, 130, 12, 20, 15 }, { 0x06003890, gDoorMetalBarsDL, 130, 12, 20, 15 }, { 0x06001D10, gDoorMetalBarsDL, 130, 12, 20, 15 }, diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 426d9d8d10..1bd7aa1193 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -7,6 +7,7 @@ #include "z_en_door.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_hidan_objects/object_hidan_objects.h" +#include "objects/object_mizu_objects/object_mizu_objects.h" #define FLAGS 0x00000010 @@ -68,8 +69,10 @@ static u8 sDoorAnimOpenFrames[] = { 25, 25, 25, 25 }; static u8 sDoorAnimCloseFrames[] = { 60, 70, 60, 70 }; static Gfx* D_809FCEE4[5][2] = { - { gDoorLeftDL, gDoorRightDL }, { gFireTempleDoorWithHandleFrontDL, gFireTempleDoorWithHandleBackDL }, - { 0x06004958, 0x06004A10 }, { 0x060013B8, 0x06001420 }, + { gDoorLeftDL, gDoorRightDL }, + { gFireTempleDoorWithHandleFrontDL, gFireTempleDoorWithHandleBackDL }, + { gWaterTempleDoorLeftDL, gWaterTempleDoorRightDL }, + { 0x060013B8, 0x06001420 }, { 0x050047A0, 0x05004978 }, }; diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index a5973b83f2..bcc9652ca4 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -164,7 +164,7 @@ void EnTp_Init(Actor* thisx, GlobalContext* globalCtx2) { for (i = 0; i <= 6; i++) { temp_s4 = 0; - + next = (EnTp*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_TP, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, temp_s4);