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

Decompiled ovl_Item_B_Heart <3 (#271)

* Decompiled ovl_Item_B_Heart <3

* Update src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Ethan Roseman 2020-07-19 12:54:30 -04:00 committed by GitHub
parent 5f7bce6e2e
commit 15f75b0ddd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 91 additions and 325 deletions

View file

@ -1,4 +0,0 @@
glabel ItemBHeart_Destroy
/* 00068 80B851B8 AFA40000 */ sw $a0, 0x0000($sp)
/* 0006C 80B851BC 03E00008 */ jr $ra
/* 00070 80B851C0 AFA50004 */ sw $a1, 0x0004($sp)

View file

@ -1,135 +0,0 @@
.rdata
glabel D_80B85540
.asciz "../z_item_b_heart.c"
.balign 4
glabel D_80B85554
.asciz "../z_item_b_heart.c"
.balign 4
glabel D_80B85568
.asciz "../z_item_b_heart.c"
.balign 4
glabel D_80B8557C
.asciz "../z_item_b_heart.c"
.balign 4
.text
glabel ItemBHeart_Draw
/* 00204 80B85354 27BDFFA0 */ addiu $sp, $sp, 0xFFA0 ## $sp = FFFFFFA0
/* 00208 80B85358 AFBF001C */ sw $ra, 0x001C($sp)
/* 0020C 80B8535C AFB10018 */ sw $s1, 0x0018($sp)
/* 00210 80B85360 AFB00014 */ sw $s0, 0x0014($sp)
/* 00214 80B85364 AFA50064 */ sw $a1, 0x0064($sp)
/* 00218 80B85368 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000
/* 0021C 80B8536C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00220 80B85370 3C0680B8 */ lui $a2, %hi(D_80B85540) ## $a2 = 80B80000
/* 00224 80B85374 24C65540 */ addiu $a2, $a2, %lo(D_80B85540) ## $a2 = 80B85540
/* 00228 80B85378 27A40040 */ addiu $a0, $sp, 0x0040 ## $a0 = FFFFFFE0
/* 0022C 80B8537C A3A00057 */ sb $zero, 0x0057($sp)
/* 00230 80B85380 240701FA */ addiu $a3, $zero, 0x01FA ## $a3 = 000001FA
/* 00234 80B85384 0C031AB1 */ jal Graph_OpenDisps
/* 00238 80B85388 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000
/* 0023C 80B8538C 8FA50064 */ lw $a1, 0x0064($sp)
/* 00240 80B85390 93A80057 */ lbu $t0, 0x0057($sp)
/* 00244 80B85394 2403005D */ addiu $v1, $zero, 0x005D ## $v1 = 0000005D
/* 00248 80B85398 8CA21C6C */ lw $v0, 0x1C6C($a1) ## 00001C6C
/* 0024C 80B8539C 1040000F */ beq $v0, $zero, .L80B853DC
/* 00250 80B853A0 00000000 */ nop
/* 00254 80B853A4 844F0000 */ lh $t7, 0x0000($v0) ## 00000000
.L80B853A8:
/* 00258 80B853A8 546F000A */ bnel $v1, $t7, .L80B853D4
/* 0025C 80B853AC 8C420124 */ lw $v0, 0x0124($v0) ## 00000124
/* 00260 80B853B0 C60400EC */ lwc1 $f4, 0x00EC($s0) ## 000000EC
/* 00264 80B853B4 C44600EC */ lwc1 $f6, 0x00EC($v0) ## 000000EC
/* 00268 80B853B8 4606203C */ c.lt.s $f4, $f6
/* 0026C 80B853BC 00000000 */ nop
/* 00270 80B853C0 45020004 */ bc1fl .L80B853D4
/* 00274 80B853C4 8C420124 */ lw $v0, 0x0124($v0) ## 00000124
/* 00278 80B853C8 10000004 */ beq $zero, $zero, .L80B853DC
/* 0027C 80B853CC 24080001 */ addiu $t0, $zero, 0x0001 ## $t0 = 00000001
/* 00280 80B853D0 8C420124 */ lw $v0, 0x0124($v0) ## 00000124
.L80B853D4:
/* 00284 80B853D4 5440FFF4 */ bnel $v0, $zero, .L80B853A8
/* 00288 80B853D8 844F0000 */ lh $t7, 0x0000($v0) ## 00000000
.L80B853DC:
/* 0028C 80B853DC 11000021 */ beq $t0, $zero, .L80B85464
/* 00290 80B853E0 00000000 */ nop
/* 00294 80B853E4 0C024F61 */ jal func_80093D84
/* 00298 80B853E8 8CA40000 */ lw $a0, 0x0000($a1) ## 00000000
/* 0029C 80B853EC 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0
/* 002A0 80B853F0 3C19DA38 */ lui $t9, 0xDA38 ## $t9 = DA380000
/* 002A4 80B853F4 37390003 */ ori $t9, $t9, 0x0003 ## $t9 = DA380003
/* 002A8 80B853F8 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008
/* 002AC 80B853FC AE3802D0 */ sw $t8, 0x02D0($s1) ## 000002D0
/* 002B0 80B85400 AC590000 */ sw $t9, 0x0000($v0) ## 00000000
/* 002B4 80B85404 8FA90064 */ lw $t1, 0x0064($sp)
/* 002B8 80B85408 3C0580B8 */ lui $a1, %hi(D_80B85554) ## $a1 = 80B80000
/* 002BC 80B8540C 24A55554 */ addiu $a1, $a1, %lo(D_80B85554) ## $a1 = 80B85554
/* 002C0 80B85410 24060227 */ addiu $a2, $zero, 0x0227 ## $a2 = 00000227
/* 002C4 80B85414 00408025 */ or $s0, $v0, $zero ## $s0 = 00000000
/* 002C8 80B85418 0C0346A2 */ jal Matrix_NewMtx
/* 002CC 80B8541C 8D240000 */ lw $a0, 0x0000($t1) ## 00000000
/* 002D0 80B85420 AE020004 */ sw $v0, 0x0004($s0) ## 00000004
/* 002D4 80B85424 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0
/* 002D8 80B85428 3C0B0600 */ lui $t3, 0x0600 ## $t3 = 06000000
/* 002DC 80B8542C 256B1290 */ addiu $t3, $t3, 0x1290 ## $t3 = 06001290
/* 002E0 80B85430 244A0008 */ addiu $t2, $v0, 0x0008 ## $t2 = 00000008
/* 002E4 80B85434 AE2A02D0 */ sw $t2, 0x02D0($s1) ## 000002D0
/* 002E8 80B85438 3C04DE00 */ lui $a0, 0xDE00 ## $a0 = DE000000
/* 002EC 80B8543C AC440000 */ sw $a0, 0x0000($v0) ## 00000000
/* 002F0 80B85440 AC4B0004 */ sw $t3, 0x0004($v0) ## 00000004
/* 002F4 80B85444 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0
/* 002F8 80B85448 3C0D0600 */ lui $t5, 0x0600 ## $t5 = 06000000
/* 002FC 80B8544C 25AD1470 */ addiu $t5, $t5, 0x1470 ## $t5 = 06001470
/* 00300 80B85450 244C0008 */ addiu $t4, $v0, 0x0008 ## $t4 = 00000008
/* 00304 80B85454 AE2C02D0 */ sw $t4, 0x02D0($s1) ## 000002D0
/* 00308 80B85458 AC4D0004 */ sw $t5, 0x0004($v0) ## 00000004
/* 0030C 80B8545C 10000020 */ beq $zero, $zero, .L80B854E0
/* 00310 80B85460 AC440000 */ sw $a0, 0x0000($v0) ## 00000000
.L80B85464:
/* 00314 80B85464 0C024F46 */ jal func_80093D18
/* 00318 80B85468 8CA40000 */ lw $a0, 0x0000($a1) ## 00000000
/* 0031C 80B8546C 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 00320 80B85470 3C0FDA38 */ lui $t7, 0xDA38 ## $t7 = DA380000
/* 00324 80B85474 35EF0003 */ ori $t7, $t7, 0x0003 ## $t7 = DA380003
/* 00328 80B85478 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008
/* 0032C 80B8547C AE2E02C0 */ sw $t6, 0x02C0($s1) ## 000002C0
/* 00330 80B85480 AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000
/* 00334 80B85484 8FB80064 */ lw $t8, 0x0064($sp)
/* 00338 80B85488 3C0580B8 */ lui $a1, %hi(D_80B85568) ## $a1 = 80B80000
/* 0033C 80B8548C 24A55568 */ addiu $a1, $a1, %lo(D_80B85568) ## $a1 = 80B85568
/* 00340 80B85490 2406022D */ addiu $a2, $zero, 0x022D ## $a2 = 0000022D
/* 00344 80B85494 00408025 */ or $s0, $v0, $zero ## $s0 = 00000000
/* 00348 80B85498 0C0346A2 */ jal Matrix_NewMtx
/* 0034C 80B8549C 8F040000 */ lw $a0, 0x0000($t8) ## 00000000
/* 00350 80B854A0 AE020004 */ sw $v0, 0x0004($s0) ## 00000004
/* 00354 80B854A4 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 00358 80B854A8 3C090600 */ lui $t1, 0x0600 ## $t1 = 06000000
/* 0035C 80B854AC 25291290 */ addiu $t1, $t1, 0x1290 ## $t1 = 06001290
/* 00360 80B854B0 24590008 */ addiu $t9, $v0, 0x0008 ## $t9 = 00000008
/* 00364 80B854B4 AE3902C0 */ sw $t9, 0x02C0($s1) ## 000002C0
/* 00368 80B854B8 3C04DE00 */ lui $a0, 0xDE00 ## $a0 = DE000000
/* 0036C 80B854BC AC440000 */ sw $a0, 0x0000($v0) ## 00000000
/* 00370 80B854C0 AC490004 */ sw $t1, 0x0004($v0) ## 00000004
/* 00374 80B854C4 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 00378 80B854C8 3C0B0600 */ lui $t3, 0x0600 ## $t3 = 06000000
/* 0037C 80B854CC 256B1470 */ addiu $t3, $t3, 0x1470 ## $t3 = 06001470
/* 00380 80B854D0 244A0008 */ addiu $t2, $v0, 0x0008 ## $t2 = 00000008
/* 00384 80B854D4 AE2A02C0 */ sw $t2, 0x02C0($s1) ## 000002C0
/* 00388 80B854D8 AC4B0004 */ sw $t3, 0x0004($v0) ## 00000004
/* 0038C 80B854DC AC440000 */ sw $a0, 0x0000($v0) ## 00000000
.L80B854E0:
/* 00390 80B854E0 8FAC0064 */ lw $t4, 0x0064($sp)
/* 00394 80B854E4 3C0680B8 */ lui $a2, %hi(D_80B8557C) ## $a2 = 80B80000
/* 00398 80B854E8 24C6557C */ addiu $a2, $a2, %lo(D_80B8557C) ## $a2 = 80B8557C
/* 0039C 80B854EC 27A40040 */ addiu $a0, $sp, 0x0040 ## $a0 = FFFFFFE0
/* 003A0 80B854F0 24070231 */ addiu $a3, $zero, 0x0231 ## $a3 = 00000231
/* 003A4 80B854F4 0C031AD5 */ jal Graph_CloseDisps
/* 003A8 80B854F8 8D850000 */ lw $a1, 0x0000($t4) ## 00000000
/* 003AC 80B854FC 8FBF001C */ lw $ra, 0x001C($sp)
/* 003B0 80B85500 8FB00014 */ lw $s0, 0x0014($sp)
/* 003B4 80B85504 8FB10018 */ lw $s1, 0x0018($sp)
/* 003B8 80B85508 03E00008 */ jr $ra
/* 003BC 80B8550C 27BD0060 */ addiu $sp, $sp, 0x0060 ## $sp = 00000000

View file

@ -1,33 +0,0 @@
glabel ItemBHeart_Init
/* 00000 80B85150 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00004 80B85154 AFA40018 */ sw $a0, 0x0018($sp)
/* 00008 80B85158 AFBF0014 */ sw $ra, 0x0014($sp)
/* 0000C 80B8515C 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 00010 80B85160 0C00B35B */ jal Flags_GetCollectible
/* 00014 80B85164 2405001F */ addiu $a1, $zero, 0x001F ## $a1 = 0000001F
/* 00018 80B85168 10400005 */ beq $v0, $zero, .L80B85180
/* 0001C 80B8516C 8FA40018 */ lw $a0, 0x0018($sp)
/* 00020 80B85170 0C00B55C */ jal Actor_Kill
/* 00024 80B85174 8FA40018 */ lw $a0, 0x0018($sp)
/* 00028 80B85178 1000000C */ beq $zero, $zero, .L80B851AC
/* 0002C 80B8517C 8FBF0014 */ lw $ra, 0x0014($sp)
.L80B85180:
/* 00030 80B85180 3C0580B8 */ lui $a1, %hi(D_80B85530) ## $a1 = 80B80000
/* 00034 80B85184 0C01E037 */ jal Actor_ProcessInitChain
/* 00038 80B85188 24A55530 */ addiu $a1, $a1, %lo(D_80B85530) ## $a1 = 80B85530
/* 0003C 80B8518C 8FA40018 */ lw $a0, 0x0018($sp)
/* 00040 80B85190 3C073F4C */ lui $a3, 0x3F4C ## $a3 = 3F4C0000
/* 00044 80B85194 34E7CCCD */ ori $a3, $a3, 0xCCCD ## $a3 = 3F4CCCCD
/* 00048 80B85198 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000
/* 0004C 80B8519C 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000
/* 00050 80B851A0 0C00AC78 */ jal ActorShape_Init
/* 00054 80B851A4 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4
/* 00058 80B851A8 8FBF0014 */ lw $ra, 0x0014($sp)
.L80B851AC:
/* 0005C 80B851AC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 00060 80B851B0 03E00008 */ jr $ra
/* 00064 80B851B4 00000000 */ nop

View file

@ -1,45 +0,0 @@
glabel ItemBHeart_Update
/* 00074 80B851C4 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8
/* 00078 80B851C8 AFBF0024 */ sw $ra, 0x0024($sp)
/* 0007C 80B851CC AFB10020 */ sw $s1, 0x0020($sp)
/* 00080 80B851D0 AFB0001C */ sw $s0, 0x001C($sp)
/* 00084 80B851D4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00088 80B851D8 0C2E1499 */ jal func_80B85264
/* 0008C 80B851DC 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000
/* 00090 80B851E0 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00
/* 00094 80B851E4 240E0004 */ addiu $t6, $zero, 0x0004 ## $t6 = 00000004
/* 00098 80B851E8 AFAE0014 */ sw $t6, 0x0014($sp)
/* 0009C 80B851EC 44060000 */ mfc1 $a2, $f0
/* 000A0 80B851F0 44070000 */ mfc1 $a3, $f0
/* 000A4 80B851F4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000
/* 000A8 80B851F8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000
/* 000AC 80B851FC 0C00B92D */ jal func_8002E4B4
/* 000B0 80B85200 E7A00010 */ swc1 $f0, 0x0010($sp)
/* 000B4 80B85204 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 000B8 80B85208 0C00BD04 */ jal func_8002F410
/* 000BC 80B8520C 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000
/* 000C0 80B85210 10400008 */ beq $v0, $zero, .L80B85234
/* 000C4 80B85214 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 000C8 80B85218 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000
/* 000CC 80B8521C 0C00B368 */ jal Flags_SetCollectible
/* 000D0 80B85220 2405001F */ addiu $a1, $zero, 0x001F ## $a1 = 0000001F
/* 000D4 80B85224 0C00B55C */ jal Actor_Kill
/* 000D8 80B85228 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 000DC 80B8522C 10000009 */ beq $zero, $zero, .L80B85254
/* 000E0 80B85230 8FBF0024 */ lw $ra, 0x0024($sp)
.L80B85234:
/* 000E4 80B85234 3C014220 */ lui $at, 0x4220 ## $at = 42200000
/* 000E8 80B85238 44812000 */ mtc1 $at, $f4 ## $f4 = 40.00
/* 000EC 80B8523C 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000
/* 000F0 80B85240 2406004F */ addiu $a2, $zero, 0x004F ## $a2 = 0000004F
/* 000F4 80B85244 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000
/* 000F8 80B85248 0C00BD0D */ jal func_8002F434
/* 000FC 80B8524C E7A40010 */ swc1 $f4, 0x0010($sp)
/* 00100 80B85250 8FBF0024 */ lw $ra, 0x0024($sp)
.L80B85254:
/* 00104 80B85254 8FB0001C */ lw $s0, 0x001C($sp)
/* 00108 80B85258 8FB10020 */ lw $s1, 0x0020($sp)
/* 0010C 80B8525C 03E00008 */ jr $ra
/* 00110 80B85260 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000

View file

@ -1,65 +0,0 @@
glabel func_80B85264
/* 00114 80B85264 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 00118 80B85268 AFBF001C */ sw $ra, 0x001C($sp)
/* 0011C 80B8526C AFB00018 */ sw $s0, 0x0018($sp)
/* 00120 80B85270 AFA50024 */ sw $a1, 0x0024($sp)
/* 00124 80B85274 848E0164 */ lh $t6, 0x0164($a0) ## 00000164
/* 00128 80B85278 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 0012C 80B8527C 25CF0001 */ addiu $t7, $t6, 0x0001 ## $t7 = 00000001
/* 00130 80B85280 A48F0164 */ sh $t7, 0x0164($a0) ## 00000164
/* 00134 80B85284 84840164 */ lh $a0, 0x0164($a0) ## 00000164
/* 00138 80B85288 00800821 */ addu $at, $a0, $zero
/* 0013C 80B8528C 00042080 */ sll $a0, $a0, 2
/* 00140 80B85290 00812023 */ subu $a0, $a0, $at
/* 00144 80B85294 00042140 */ sll $a0, $a0, 5
/* 00148 80B85298 00812021 */ addu $a0, $a0, $at
/* 0014C 80B8529C 00042080 */ sll $a0, $a0, 2
/* 00150 80B852A0 00812023 */ subu $a0, $a0, $at
/* 00154 80B852A4 00042080 */ sll $a0, $a0, 2
/* 00158 80B852A8 00042400 */ sll $a0, $a0, 16
/* 0015C 80B852AC 0C01DE1C */ jal Math_Sins
## sins?
/* 00160 80B852B0 00042403 */ sra $a0, $a0, 16
/* 00164 80B852B4 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000
/* 00168 80B852B8 44812000 */ mtc1 $at, $f4 ## $f4 = 5.00
/* 0016C 80B852BC 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000
/* 00170 80B852C0 44814000 */ mtc1 $at, $f8 ## $f8 = 20.00
/* 00174 80B852C4 46040182 */ mul.s $f6, $f0, $f4
/* 00178 80B852C8 C610000C */ lwc1 $f16, 0x000C($s0) ## 0000000C
/* 0017C 80B852CC 3C063DCC */ lui $a2, 0x3DCC ## $a2 = 3DCC0000
/* 00180 80B852D0 34C6CCCD */ ori $a2, $a2, 0xCCCD ## $a2 = 3DCCCCCD
/* 00184 80B852D4 26040028 */ addiu $a0, $s0, 0x0028 ## $a0 = 00000028
/* 00188 80B852D8 8E070158 */ lw $a3, 0x0158($s0) ## 00000158
/* 0018C 80B852DC 46083280 */ add.s $f10, $f6, $f8
/* 00190 80B852E0 460A8480 */ add.s $f18, $f16, $f10
/* 00194 80B852E4 44059000 */ mfc1 $a1, $f18
/* 00198 80B852E8 0C01E107 */ jal Math_SmoothScaleMaxF
/* 0019C 80B852EC 00000000 */ nop
/* 001A0 80B852F0 3C073DCC */ lui $a3, 0x3DCC ## $a3 = 3DCC0000
/* 001A4 80B852F4 34E7CCCD */ ori $a3, $a3, 0xCCCD ## $a3 = 3DCCCCCD
/* 001A8 80B852F8 26040158 */ addiu $a0, $s0, 0x0158 ## $a0 = 00000158
/* 001AC 80B852FC 3C054000 */ lui $a1, 0x4000 ## $a1 = 40000000
/* 001B0 80B85300 0C01E107 */ jal Math_SmoothScaleMaxF
/* 001B4 80B85304 3C063F80 */ lui $a2, 0x3F80 ## $a2 = 3F800000
/* 001B8 80B85308 861800B6 */ lh $t8, 0x00B6($s0) ## 000000B6
/* 001BC 80B8530C 3C053ECC */ lui $a1, 0x3ECC ## $a1 = 3ECC0000
/* 001C0 80B85310 3C063DCC */ lui $a2, 0x3DCC ## $a2 = 3DCC0000
/* 001C4 80B85314 3C073C23 */ lui $a3, 0x3C23 ## $a3 = 3C230000
/* 001C8 80B85318 27190400 */ addiu $t9, $t8, 0x0400 ## $t9 = 00000400
/* 001CC 80B8531C A61900B6 */ sh $t9, 0x00B6($s0) ## 000000B6
/* 001D0 80B85320 34E7D70A */ ori $a3, $a3, 0xD70A ## $a3 = 3C23D70A
/* 001D4 80B85324 34C6CCCD */ ori $a2, $a2, 0xCCCD ## $a2 = 3DCCCCCD
/* 001D8 80B85328 34A5CCCD */ ori $a1, $a1, 0xCCCD ## $a1 = 3ECCCCCD
/* 001DC 80B8532C 0C01E107 */ jal Math_SmoothScaleMaxF
/* 001E0 80B85330 26040050 */ addiu $a0, $s0, 0x0050 ## $a0 = 00000050
/* 001E4 80B85334 C6000050 */ lwc1 $f0, 0x0050($s0) ## 00000050
/* 001E8 80B85338 E6000058 */ swc1 $f0, 0x0058($s0) ## 00000058
/* 001EC 80B8533C E6000054 */ swc1 $f0, 0x0054($s0) ## 00000054
/* 001F0 80B85340 8FBF001C */ lw $ra, 0x001C($sp)
/* 001F4 80B85344 8FB00018 */ lw $s0, 0x0018($sp)
/* 001F8 80B85348 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 001FC 80B8534C 03E00008 */ jr $ra
/* 00200 80B85350 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 Item_B_Heart_InitVars
.word 0x005F0800, 0x00000000, 0x00BD0000, 0x0000016C
.word ItemBHeart_Init
.word ItemBHeart_Destroy
.word ItemBHeart_Update
.word ItemBHeart_Draw
glabel D_80B85530
.word 0xC8500000, 0xB0F40FA0, 0xB0F80320, 0x30FC0320

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_80B85590
.incbin "baserom/ovl_Item_B_Heart", 0x440, 0x00000060

3
spec
View file

@ -3511,8 +3511,7 @@ endseg
beginseg beginseg
name "ovl_Item_B_Heart" name "ovl_Item_B_Heart"
include "build/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.o" include "build/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.o"
include "build/data/overlays/actors/z_item_b_heart.data.o" include "build/src/overlays/actors/ovl_Item_B_Heart/ovl_Item_B_Heart_reloc.o"
include "build/data/overlays/actors/z_item_b_heart.reloc.o"
endseg endseg
beginseg beginseg

View file

@ -15,7 +15,11 @@ void ItemBHeart_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx); void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx);
void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx); void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx);
/* void func_80B85264(ItemBHeart* this, GlobalContext* globalCtx);
extern Gfx D_06001290[];
extern Gfx D_06001470[];
const ActorInit Item_B_Heart_InitVars = { const ActorInit Item_B_Heart_InitVars = {
ACTOR_ITEM_B_HEART, ACTOR_ITEM_B_HEART,
ACTORTYPE_MISC, ACTORTYPE_MISC,
@ -27,13 +31,87 @@ const ActorInit Item_B_Heart_InitVars = {
(ActorFunc)ItemBHeart_Update, (ActorFunc)ItemBHeart_Update,
(ActorFunc)ItemBHeart_Draw, (ActorFunc)ItemBHeart_Draw,
}; };
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Item_B_Heart/ItemBHeart_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Item_B_Heart/ItemBHeart_Destroy.s") static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 0, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 800, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 800, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Item_B_Heart/ItemBHeart_Update.s") void ItemBHeart_Init(Actor* thisx, GlobalContext* globalCtx) {
ItemBHeart* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Item_B_Heart/func_80B85264.s") if (Flags_GetCollectible(globalCtx, 0x1F)) {
Actor_Kill(&this->actor);
} else {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.8f);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Item_B_Heart/ItemBHeart_Draw.s") void ItemBHeart_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx) {
ItemBHeart* this = THIS;
func_80B85264(this, globalCtx);
func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
if (func_8002F410(&this->actor, globalCtx)) {
Flags_SetCollectible(globalCtx, 0x1F);
Actor_Kill(&this->actor);
} else {
func_8002F434(&this->actor, globalCtx, GI_HEART_CONTAINER_2, 30.0f, 40.0f);
}
}
void func_80B85264(ItemBHeart* this, GlobalContext* globalCtx) {
f32 temp;
this->unk_164 += 1;
temp = ((Math_Sins(this->unk_164 * 1548) * 5.0f) + 20.0f);
Math_SmoothScaleMaxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + temp, 0.1f, this->unk_158);
Math_SmoothScaleMaxF(&this->unk_158, 2.0f, 1.0f, 0.1f);
this->actor.shape.rot.y += 0x400;
Math_SmoothScaleMaxF(&this->actor.scale.x, 0.4f, 0.1f, 0.01f);
this->actor.scale.y = this->actor.scale.z = this->actor.scale.x;
}
void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx) {
ItemBHeart* this = THIS;
Actor* actorIt;
u8 flag = 0;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* dispRefs[4];
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_item_b_heart.c", 506);
actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first;
while (actorIt != NULL) {
if ((actorIt->id == ACTOR_DOOR_WARP1) && (actorIt->projectedPos.z > this->actor.projectedPos.z)) {
flag = 1;
break;
} else {
actorIt = actorIt->next;
}
}
if (flag) {
func_80093D84(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_item_b_heart.c", 551),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyXlu.p++, D_06001290);
gSPDisplayList(gfxCtx->polyXlu.p++, D_06001470);
} else {
func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_item_b_heart.c", 557),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, D_06001290);
gSPDisplayList(gfxCtx->polyOpa.p++, D_06001470);
}
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_item_b_heart.c", 561);
}

View file

@ -8,7 +8,11 @@ struct ItemBHeart;
typedef struct ItemBHeart { typedef struct ItemBHeart {
/* 0x0000 */ Actor actor; /* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x20]; /* 0x014C */ char unk_14C[0xC];
/* 0x0158 */ f32 unk_158;
/* 0x015C */ char unk_15C[0x8];
/* 0x0164 */ s16 unk_164;
/* 0x0166 */ char unk_166[0x6];
} ItemBHeart; // size = 0x016C } ItemBHeart; // size = 0x016C
extern const ActorInit Item_B_Heart_InitVars; extern const ActorInit Item_B_Heart_InitVars;