1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00

ovl_Bg_Ice_Shutter (#377)

* Starting work on Bg_Ice_Shutter, want to commit
before attempting to use the permuter.

* Forgot to use the new UNK_TPYE in DynaPolyInfo_Alloc

* Resolving last asm issues by re-ordering and
updating .c file.

* Attempting to match by reordering things, removing no
longer used .s files from spec file.

* Adding in proper include path for _reloc file

* Removing unneeded parens and casts

* Removing extra space.

* Updated with review fixes

* Another round of review comments.

* Adding description to comment to clarify what these are.

* Adding in newline before draw function
This commit is contained in:
Andrew Zwicky 2020-09-19 14:12:42 -05:00 committed by GitHub
parent 14191307e9
commit 44dac7af67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 110 additions and 336 deletions

View file

@ -1,14 +0,0 @@
glabel BgIceShutter_Destroy
/* 00204 80891CC4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00208 80891CC8 AFA40018 */ sw $a0, 0x0018($sp)
/* 0020C 80891CCC 8FAE0018 */ lw $t6, 0x0018($sp)
/* 00210 80891CD0 AFBF0014 */ sw $ra, 0x0014($sp)
/* 00214 80891CD4 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 00218 80891CD8 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810
/* 0021C 80891CDC 0C00FB56 */ jal DynaPolyInfo_Free
## DynaPolyInfo_delReserve
/* 00220 80891CE0 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C
/* 00224 80891CE4 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00228 80891CE8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 0022C 80891CEC 03E00008 */ jr $ra
/* 00230 80891CF0 00000000 */ nop

View file

@ -1,14 +0,0 @@
glabel BgIceShutter_Draw
/* 003A0 80891E60 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 003A4 80891E64 AFA40018 */ sw $a0, 0x0018($sp)
/* 003A8 80891E68 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 003AC 80891E6C AFBF0014 */ sw $ra, 0x0014($sp)
/* 003B0 80891E70 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000
/* 003B4 80891E74 0C00D498 */ jal Gfx_DrawDListOpa
/* 003B8 80891E78 24A52740 */ addiu $a1, $a1, 0x2740 ## $a1 = 06002740
/* 003BC 80891E7C 8FBF0014 */ lw $ra, 0x0014($sp)
/* 003C0 80891E80 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 003C4 80891E84 03E00008 */ jr $ra
/* 003C8 80891E88 00000000 */ nop
/* 003CC 80891E8C 00000000 */ nop

View file

@ -1,115 +0,0 @@
glabel BgIceShutter_Init
/* 0008C 80891B4C 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8
/* 00090 80891B50 AFA5003C */ sw $a1, 0x003C($sp)
/* 00094 80891B54 AFBF001C */ sw $ra, 0x001C($sp)
/* 00098 80891B58 AFB00018 */ sw $s0, 0x0018($sp)
/* 0009C 80891B5C 3C058089 */ lui $a1, %hi(D_80891EB0) ## $a1 = 80890000
/* 000A0 80891B60 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 000A4 80891B64 AFA0002C */ sw $zero, 0x002C($sp)
/* 000A8 80891B68 0C01E037 */ jal Actor_ProcessInitChain
/* 000AC 80891B6C 24A51EB0 */ addiu $a1, $a1, %lo(D_80891EB0) ## $a1 = 80891EB0
/* 000B0 80891B70 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 000B4 80891B74 0C010D20 */ jal DynaPolyInfo_SetActorMove
/* 000B8 80891B78 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000
/* 000BC 80891B7C 8602001C */ lh $v0, 0x001C($s0) ## 0000001C
/* 000C0 80891B80 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000
/* 000C4 80891B84 24842854 */ addiu $a0, $a0, 0x2854 ## $a0 = 06002854
/* 000C8 80891B88 304E00FF */ andi $t6, $v0, 0x00FF ## $t6 = 00000000
/* 000CC 80891B8C 00027A03 */ sra $t7, $v0, 8
/* 000D0 80891B90 AFAE0028 */ sw $t6, 0x0028($sp)
/* 000D4 80891B94 31F800FF */ andi $t8, $t7, 0x00FF ## $t8 = 00000000
/* 000D8 80891B98 A618001C */ sh $t8, 0x001C($s0) ## 0000001C
/* 000DC 80891B9C 0C010620 */ jal DynaPolyInfo_Alloc
/* 000E0 80891BA0 27A5002C */ addiu $a1, $sp, 0x002C ## $a1 = FFFFFFF4
/* 000E4 80891BA4 8FA4003C */ lw $a0, 0x003C($sp)
/* 000E8 80891BA8 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000
/* 000EC 80891BAC 8FA7002C */ lw $a3, 0x002C($sp)
/* 000F0 80891BB0 0C00FA9D */ jal DynaPolyInfo_RegisterActor
## DynaPolyInfo_setActor
/* 000F4 80891BB4 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810
/* 000F8 80891BB8 8FA30028 */ lw $v1, 0x0028($sp)
/* 000FC 80891BBC 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002
/* 00100 80891BC0 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C
/* 00104 80891BC4 14610002 */ bne $v1, $at, .L80891BD0
/* 00108 80891BC8 2419C000 */ addiu $t9, $zero, 0xC000 ## $t9 = FFFFC000
/* 0010C 80891BCC A61900B4 */ sh $t9, 0x00B4($s0) ## 000000B4
.L80891BD0:
/* 00110 80891BD0 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001
/* 00114 80891BD4 1061000D */ beq $v1, $at, .L80891C0C
/* 00118 80891BD8 8FA4003C */ lw $a0, 0x003C($sp)
/* 0011C 80891BDC 8FA4003C */ lw $a0, 0x003C($sp)
/* 00120 80891BE0 0C00B337 */ jal Flags_GetClear
/* 00124 80891BE4 82050003 */ lb $a1, 0x0003($s0) ## 00000003
/* 00128 80891BE8 10400005 */ beq $v0, $zero, .L80891C00
/* 0012C 80891BEC 3C088089 */ lui $t0, %hi(func_80891CF4) ## $t0 = 80890000
/* 00130 80891BF0 0C00B55C */ jal Actor_Kill
/* 00134 80891BF4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00138 80891BF8 1000000F */ beq $zero, $zero, .L80891C38
/* 0013C 80891BFC 8FAA0028 */ lw $t2, 0x0028($sp)
.L80891C00:
/* 00140 80891C00 25081CF4 */ addiu $t0, $t0, %lo(func_80891CF4) ## $t0 = 00001CF4
/* 00144 80891C04 1000000B */ beq $zero, $zero, .L80891C34
/* 00148 80891C08 AE080164 */ sw $t0, 0x0164($s0) ## 00000164
.L80891C0C:
/* 0014C 80891C0C 0C00B2D0 */ jal Flags_GetSwitch
/* 00150 80891C10 8605001C */ lh $a1, 0x001C($s0) ## 0000001C
/* 00154 80891C14 10400005 */ beq $v0, $zero, .L80891C2C
/* 00158 80891C18 3C098089 */ lui $t1, %hi(func_80891D6C) ## $t1 = 80890000
/* 0015C 80891C1C 0C00B55C */ jal Actor_Kill
/* 00160 80891C20 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00164 80891C24 10000004 */ beq $zero, $zero, .L80891C38
/* 00168 80891C28 8FAA0028 */ lw $t2, 0x0028($sp)
.L80891C2C:
/* 0016C 80891C2C 25291D6C */ addiu $t1, $t1, %lo(func_80891D6C) ## $t1 = 00001D6C
/* 00170 80891C30 AE090164 */ sw $t1, 0x0164($s0) ## 00000164
.L80891C34:
/* 00174 80891C34 8FAA0028 */ lw $t2, 0x0028($sp)
.L80891C38:
/* 00178 80891C38 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002
/* 0017C 80891C3C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00180 80891C40 15410019 */ bne $t2, $at, .L80891CA8
/* 00184 80891C44 00000000 */ nop
/* 00188 80891C48 0C01DE1C */ jal Math_Sins
## sins?
/* 0018C 80891C4C 860400B4 */ lh $a0, 0x00B4($s0) ## 000000B4
/* 00190 80891C50 3C014248 */ lui $at, 0x4248 ## $at = 42480000
/* 00194 80891C54 44812000 */ mtc1 $at, $f4 ## $f4 = 50.00
/* 00198 80891C58 00000000 */ nop
/* 0019C 80891C5C 46040182 */ mul.s $f6, $f0, $f4
/* 001A0 80891C60 E7A60024 */ swc1 $f6, 0x0024($sp)
/* 001A4 80891C64 0C01DE1C */ jal Math_Sins
## sins?
/* 001A8 80891C68 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6
/* 001AC 80891C6C C7A80024 */ lwc1 $f8, 0x0024($sp)
/* 001B0 80891C70 C6100008 */ lwc1 $f16, 0x0008($s0) ## 00000008
/* 001B4 80891C74 C604000C */ lwc1 $f4, 0x000C($s0) ## 0000000C
/* 001B8 80891C78 46080282 */ mul.s $f10, $f0, $f8
/* 001BC 80891C7C 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6
/* 001C0 80891C80 E604003C */ swc1 $f4, 0x003C($s0) ## 0000003C
/* 001C4 80891C84 46105480 */ add.s $f18, $f10, $f16
/* 001C8 80891C88 0C01DE0D */ jal Math_Coss
## coss?
/* 001CC 80891C8C E6120038 */ swc1 $f18, 0x0038($s0) ## 00000038
/* 001D0 80891C90 C7A60024 */ lwc1 $f6, 0x0024($sp)
/* 001D4 80891C94 C60A0010 */ lwc1 $f10, 0x0010($s0) ## 00000010
/* 001D8 80891C98 46060202 */ mul.s $f8, $f0, $f6
/* 001DC 80891C9C 460A4400 */ add.s $f16, $f8, $f10
/* 001E0 80891CA0 10000003 */ beq $zero, $zero, .L80891CB0
/* 001E4 80891CA4 E6100040 */ swc1 $f16, 0x0040($s0) ## 00000040
.L80891CA8:
/* 001E8 80891CA8 0C00B56E */ jal Actor_SetHeight
/* 001EC 80891CAC 3C054248 */ lui $a1, 0x4248 ## $a1 = 42480000
.L80891CB0:
/* 001F0 80891CB0 8FBF001C */ lw $ra, 0x001C($sp)
/* 001F4 80891CB4 8FB00018 */ lw $s0, 0x0018($sp)
/* 001F8 80891CB8 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000
/* 001FC 80891CBC 03E00008 */ jr $ra
/* 00200 80891CC0 00000000 */ nop

View file

@ -1,10 +0,0 @@
glabel BgIceShutter_Update
/* 0037C 80891E3C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00380 80891E40 AFBF0014 */ sw $ra, 0x0014($sp)
/* 00384 80891E44 8C990164 */ lw $t9, 0x0164($a0) ## 00000164
/* 00388 80891E48 0320F809 */ jalr $ra, $t9
/* 0038C 80891E4C 00000000 */ nop
/* 00390 80891E50 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00394 80891E54 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00398 80891E58 03E00008 */ jr $ra
/* 0039C 80891E5C 00000000 */ nop

View file

@ -1,40 +0,0 @@
glabel func_80891AC0
/* 00000 80891AC0 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8
/* 00004 80891AC4 AFB00018 */ sw $s0, 0x0018($sp)
/* 00008 80891AC8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 0000C 80891ACC AFBF001C */ sw $ra, 0x001C($sp)
/* 00010 80891AD0 0C01DE1C */ jal Math_Sins
## sins?
/* 00014 80891AD4 848400B4 */ lh $a0, 0x00B4($a0) ## 000000B4
/* 00018 80891AD8 C6040060 */ lwc1 $f4, 0x0060($s0) ## 00000060
/* 0001C 80891ADC 46040182 */ mul.s $f6, $f0, $f4
/* 00020 80891AE0 E7A60024 */ swc1 $f6, 0x0024($sp)
/* 00024 80891AE4 0C01DE0D */ jal Math_Coss
## coss?
/* 00028 80891AE8 860400B4 */ lh $a0, 0x00B4($s0) ## 000000B4
/* 0002C 80891AEC C6080060 */ lwc1 $f8, 0x0060($s0) ## 00000060
/* 00030 80891AF0 C610000C */ lwc1 $f16, 0x000C($s0) ## 0000000C
/* 00034 80891AF4 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6
/* 00038 80891AF8 46080282 */ mul.s $f10, $f0, $f8
/* 0003C 80891AFC 46105480 */ add.s $f18, $f10, $f16
/* 00040 80891B00 0C01DE1C */ jal Math_Sins
## sins?
/* 00044 80891B04 E6120028 */ swc1 $f18, 0x0028($s0) ## 00000028
/* 00048 80891B08 C7A40024 */ lwc1 $f4, 0x0024($sp)
/* 0004C 80891B0C C6080008 */ lwc1 $f8, 0x0008($s0) ## 00000008
/* 00050 80891B10 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6
/* 00054 80891B14 46040182 */ mul.s $f6, $f0, $f4
/* 00058 80891B18 46083280 */ add.s $f10, $f6, $f8
/* 0005C 80891B1C 0C01DE0D */ jal Math_Coss
## coss?
/* 00060 80891B20 E60A0024 */ swc1 $f10, 0x0024($s0) ## 00000024
/* 00064 80891B24 C7B00024 */ lwc1 $f16, 0x0024($sp)
/* 00068 80891B28 C6040010 */ lwc1 $f4, 0x0010($s0) ## 00000010
/* 0006C 80891B2C 46100482 */ mul.s $f18, $f0, $f16
/* 00070 80891B30 46049180 */ add.s $f6, $f18, $f4
/* 00074 80891B34 E606002C */ swc1 $f6, 0x002C($s0) ## 0000002C
/* 00078 80891B38 8FBF001C */ lw $ra, 0x001C($sp)
/* 0007C 80891B3C 8FB00018 */ lw $s0, 0x0018($sp)
/* 00080 80891B40 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000
/* 00084 80891B44 03E00008 */ jr $ra
/* 00088 80891B48 00000000 */ nop

View file

@ -1,35 +0,0 @@
glabel func_80891CF4
/* 00234 80891CF4 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 00238 80891CF8 AFB00018 */ sw $s0, 0x0018($sp)
/* 0023C 80891CFC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00240 80891D00 AFBF001C */ sw $ra, 0x001C($sp)
/* 00244 80891D04 AFA50024 */ sw $a1, 0x0024($sp)
/* 00248 80891D08 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 0024C 80891D0C 0C00B349 */ jal Flags_GetTempClear
/* 00250 80891D10 82050003 */ lb $a1, 0x0003($s0) ## 00000003
/* 00254 80891D14 10400010 */ beq $v0, $zero, .L80891D58
/* 00258 80891D18 8FA40024 */ lw $a0, 0x0024($sp)
/* 0025C 80891D1C 0C00B33C */ jal Flags_SetClear
/* 00260 80891D20 82050003 */ lb $a1, 0x0003($s0) ## 00000003
/* 00264 80891D24 8FA40024 */ lw $a0, 0x0024($sp)
/* 00268 80891D28 26050024 */ addiu $a1, $s0, 0x0024 ## $a1 = 00000024
/* 0026C 80891D2C 2406001E */ addiu $a2, $zero, 0x001E ## $a2 = 0000001E
/* 00270 80891D30 0C01AEB6 */ jal Audio_PlaySoundAtPosition
/* 00274 80891D34 24072814 */ addiu $a3, $zero, 0x2814 ## $a3 = 00002814
/* 00278 80891D38 860F00B4 */ lh $t7, 0x00B4($s0) ## 000000B4
/* 0027C 80891D3C 3C0E8089 */ lui $t6, %hi(func_80891DD4) ## $t6 = 80890000
/* 00280 80891D40 25CE1DD4 */ addiu $t6, $t6, %lo(func_80891DD4) ## $t6 = 80891DD4
/* 00284 80891D44 15E00004 */ bne $t7, $zero, .L80891D58
/* 00288 80891D48 AE0E0164 */ sw $t6, 0x0164($s0) ## 00000164
/* 0028C 80891D4C 8FA40024 */ lw $a0, 0x0024($sp)
/* 00290 80891D50 0C020120 */ jal func_80080480
/* 00294 80891D54 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000
.L80891D58:
/* 00298 80891D58 8FBF001C */ lw $ra, 0x001C($sp)
/* 0029C 80891D5C 8FB00018 */ lw $s0, 0x0018($sp)
/* 002A0 80891D60 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 002A4 80891D64 03E00008 */ jr $ra
/* 002A8 80891D68 00000000 */ nop

View file

@ -1,30 +0,0 @@
glabel func_80891D6C
/* 002AC 80891D6C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 002B0 80891D70 AFA40018 */ sw $a0, 0x0018($sp)
/* 002B4 80891D74 8FAE0018 */ lw $t6, 0x0018($sp)
/* 002B8 80891D78 AFBF0014 */ sw $ra, 0x0014($sp)
/* 002BC 80891D7C AFA5001C */ sw $a1, 0x001C($sp)
/* 002C0 80891D80 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 002C4 80891D84 0C00B2D0 */ jal Flags_GetSwitch
/* 002C8 80891D88 85C5001C */ lh $a1, 0x001C($t6) ## 0000001C
/* 002CC 80891D8C 1040000D */ beq $v0, $zero, .L80891DC4
/* 002D0 80891D90 8FA4001C */ lw $a0, 0x001C($sp)
/* 002D4 80891D94 8FA50018 */ lw $a1, 0x0018($sp)
/* 002D8 80891D98 2406001E */ addiu $a2, $zero, 0x001E ## $a2 = 0000001E
/* 002DC 80891D9C 24072814 */ addiu $a3, $zero, 0x2814 ## $a3 = 00002814
/* 002E0 80891DA0 0C01AEB6 */ jal Audio_PlaySoundAtPosition
/* 002E4 80891DA4 24A50024 */ addiu $a1, $a1, 0x0024 ## $a1 = 00000024
/* 002E8 80891DA8 8FB80018 */ lw $t8, 0x0018($sp)
/* 002EC 80891DAC 3C0F8089 */ lui $t7, %hi(func_80891DD4) ## $t7 = 80890000
/* 002F0 80891DB0 25EF1DD4 */ addiu $t7, $t7, %lo(func_80891DD4) ## $t7 = 80891DD4
/* 002F4 80891DB4 AF0F0164 */ sw $t7, 0x0164($t8) ## 00000164
/* 002F8 80891DB8 8FA50018 */ lw $a1, 0x0018($sp)
/* 002FC 80891DBC 0C020120 */ jal func_80080480
/* 00300 80891DC0 8FA4001C */ lw $a0, 0x001C($sp)
.L80891DC4:
/* 00304 80891DC4 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00308 80891DC8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 0030C 80891DCC 03E00008 */ jr $ra
/* 00310 80891DD0 00000000 */ nop

View file

@ -1,32 +0,0 @@
glabel func_80891DD4
/* 00314 80891DD4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00318 80891DD8 AFBF0014 */ sw $ra, 0x0014($sp)
/* 0031C 80891DDC AFA5001C */ sw $a1, 0x001C($sp)
/* 00320 80891DE0 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000
/* 00324 80891DE4 AFA70018 */ sw $a3, 0x0018($sp)
/* 00328 80891DE8 24840068 */ addiu $a0, $a0, 0x0068 ## $a0 = 00000068
/* 0032C 80891DEC 3C0541F0 */ lui $a1, 0x41F0 ## $a1 = 41F00000
/* 00330 80891DF0 0C01DE80 */ jal Math_ApproxF
/* 00334 80891DF4 3C064000 */ lui $a2, 0x4000 ## $a2 = 40000000
/* 00338 80891DF8 8FA70018 */ lw $a3, 0x0018($sp)
/* 0033C 80891DFC 3C054352 */ lui $a1, 0x4352 ## $a1 = 43520000
/* 00340 80891E00 24E40060 */ addiu $a0, $a3, 0x0060 ## $a0 = 00000060
/* 00344 80891E04 0C01DE80 */ jal Math_ApproxF
/* 00348 80891E08 8CE60068 */ lw $a2, 0x0068($a3) ## 00000068
/* 0034C 80891E0C 10400005 */ beq $v0, $zero, .L80891E24
/* 00350 80891E10 8FA70018 */ lw $a3, 0x0018($sp)
/* 00354 80891E14 0C00B55C */ jal Actor_Kill
/* 00358 80891E18 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000
/* 0035C 80891E1C 10000004 */ beq $zero, $zero, .L80891E30
/* 00360 80891E20 8FBF0014 */ lw $ra, 0x0014($sp)
.L80891E24:
/* 00364 80891E24 0C2246B0 */ jal func_80891AC0
/* 00368 80891E28 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000
/* 0036C 80891E2C 8FBF0014 */ lw $ra, 0x0014($sp)
.L80891E30:
/* 00370 80891E30 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00374 80891E34 03E00008 */ jr $ra
/* 00378 80891E38 00000000 */ nop

View file

@ -1,20 +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_Ice_Shutter_InitVars
.word 0x01C80600, 0x00000010, 0x006B0000, 0x00000168
.word BgIceShutter_Init
.word BgIceShutter_Destroy
.word BgIceShutter_Update
.word BgIceShutter_Draw
glabel D_80891EB0
.word 0x48500064, 0x00000000, 0x00000000, 0x00000000

View file

@ -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_80891EC0
.incbin "baserom/ovl_Bg_Ice_Shutter", 0x400, 0x00000060

3
spec
View file

@ -933,8 +933,7 @@ endseg
beginseg
name "ovl_Bg_Ice_Shutter"
include "build/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.o"
include "build/data/overlays/actors/z_bg_ice_shutter.data.o"
include "build/data/overlays/actors/z_bg_ice_shutter.reloc.o"
include "build/src/overlays/actors/ovl_Bg_Ice_Shutter/ovl_Bg_Ice_Shutter_reloc.o"
endseg
beginseg

View file

@ -1,7 +1,7 @@
/*
* File: z_bg_ice_shutter.c
* Overlay: ovl_Bg_Ice_Shutter
* Description: 2D Ice Bars
* Description: Vertical Ice Bars (Doors) in Ice Cavern
*/
#include "z_bg_ice_shutter.h"
@ -15,7 +15,10 @@ void BgIceShutter_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgIceShutter_Update(Actor* thisx, GlobalContext* globalCtx);
void BgIceShutter_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
void func_80891CF4(BgIceShutter* thisx, GlobalContext* globalCtx);
void func_80891D6C(BgIceShutter* thisx, GlobalContext* globalCtx);
void func_80891DD4(BgIceShutter* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Ice_Shutter_InitVars = {
ACTOR_BG_ICE_SHUTTER,
ACTORTYPE_PROP,
@ -27,19 +30,110 @@ const ActorInit Bg_Ice_Shutter_InitVars = {
(ActorFunc)BgIceShutter_Update,
(ActorFunc)BgIceShutter_Draw,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/func_80891AC0.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/BgIceShutter_Init.s")
extern UNK_TYPE D_06002854;
extern Gfx D_06002740[];
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/BgIceShutter_Destroy.s")
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/func_80891CF4.s")
void func_80891AC0(BgIceShutter* this) {
f32 sp24;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/func_80891D6C.s")
sp24 = Math_Sins(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y;
this->dyna.actor.posRot.pos.y =
(Math_Coss(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y) + this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.posRot.pos.x =
(Math_Sins(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.initPosRot.pos.x;
this->dyna.actor.posRot.pos.z =
(Math_Coss(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.initPosRot.pos.z;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/func_80891DD4.s")
void BgIceShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
BgIceShutter* this = THIS;
f32 sp24;
s32 localC;
s32 sp28;
f32 temp_f6;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/BgIceShutter_Update.s")
localC = 0;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyInfo_SetActorMove(&this->dyna, 0);
sp28 = this->dyna.actor.params & 0xFF;
this->dyna.actor.params = (this->dyna.actor.params >> 8) & 0xFF;
DynaPolyInfo_Alloc(&D_06002854, &localC);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, localC);
if (sp28 == 2) {
this->dyna.actor.shape.rot.x = -0x4000;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shutter/BgIceShutter_Draw.s")
if (sp28 != 1) {
if (Flags_GetClear(globalCtx, this->dyna.actor.room)) {
Actor_Kill(&this->dyna.actor);
} else {
this->actionFunc = func_80891CF4;
}
} else {
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params)) {
Actor_Kill(&this->dyna.actor);
} else {
this->actionFunc = func_80891D6C;
}
}
if (sp28 == 2) {
temp_f6 = Math_Sins(this->dyna.actor.shape.rot.x) * 50.0f;
this->dyna.actor.posRot2.pos.x =
(Math_Sins(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.initPosRot.pos.x;
this->dyna.actor.posRot2.pos.y = this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.posRot2.pos.z =
this->dyna.actor.initPosRot.pos.z + (Math_Coss(this->dyna.actor.shape.rot.y) * temp_f6);
} else {
Actor_SetHeight(&this->dyna.actor, 50.0f);
}
}
void BgIceShutter_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgIceShutter* this = THIS;
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
}
void func_80891CF4(BgIceShutter* this, GlobalContext* globalCtx) {
if (Flags_GetTempClear(globalCtx, this->dyna.actor.room)) {
Flags_SetClear(globalCtx, this->dyna.actor.room);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN);
this->actionFunc = func_80891DD4;
if (this->dyna.actor.shape.rot.x == 0) {
func_80080480(globalCtx, this);
}
}
}
void func_80891D6C(BgIceShutter* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params)) {
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN);
this->actionFunc = func_80891DD4;
func_80080480(globalCtx, this);
}
}
void func_80891DD4(BgIceShutter* this, GlobalContext* globalCtx) {
Math_ApproxF(&this->dyna.actor.speedXZ, 30.0f, 2.0f);
if (Math_ApproxF(&this->dyna.actor.velocity.y, 210.0f, this->dyna.actor.speedXZ)) {
Actor_Kill(&this->dyna.actor);
return;
}
func_80891AC0(this);
}
void BgIceShutter_Update(Actor* thisx, GlobalContext* globalCtx) {
BgIceShutter* this = THIS;
this->actionFunc(this, globalCtx);
}
void BgIceShutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, D_06002740);
}

View file

@ -1028,6 +1028,10 @@ D_040184B0 = 0x040184B0;
// z_item_ocarina
D_0200F870 = 0x0200F870;
//z_bg_ice_shutter
D_06002854 = 0x6002854;
D_06002740 = 0x6002740;
// z_bg_ingate
D_060011B8 = 0x060011B8;
D_06001040 = 0x06001040;