From 73e9e3b3e6645b3e9368bac696c311778e47b91f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 4 Jul 2022 20:53:11 +1000 Subject: [PATCH] Decompile func0f153e94 --- src/game/game_1531a0.c | 415 ++++++----------------------------------- 1 file changed, 56 insertions(+), 359 deletions(-) diff --git a/src/game/game_1531a0.c b/src/game/game_1531a0.c index 4e15f67a7..d4736d991 100644 --- a/src/game/game_1531a0.c +++ b/src/game/game_1531a0.c @@ -823,365 +823,62 @@ s32 func0f153e58(void) && (var800a45d0.unk18 == 0 || var800a45d0.unk18 == 2); } -GLOBAL_ASM( -glabel func0f153e94 -.late_rodata -glabel var7f1b7400 -.word 0x453b8000 -.text -/* f153e94: 3c09800a */ lui $t1,%hi(var800a45d0) -/* f153e98: 252945d0 */ addiu $t1,$t1,%lo(var800a45d0) -/* f153e9c: 912e0000 */ lbu $t6,0x0($t1) -/* f153ea0: 27bdffd8 */ addiu $sp,$sp,-40 -/* f153ea4: afbf0014 */ sw $ra,0x14($sp) -/* f153ea8: 31cf0001 */ andi $t7,$t6,0x1 -/* f153eac: 00c03825 */ or $a3,$a2,$zero -/* f153eb0: 11e00139 */ beqz $t7,.L0f154398 -/* f153eb4: 00c04025 */ or $t0,$a2,$zero -/* f153eb8: 8d38000c */ lw $t8,0xc($t1) -/* f153ebc: 00981023 */ subu $v0,$a0,$t8 -/* f153ec0: 2841f449 */ slti $at,$v0,-2999 -/* f153ec4: 1420001c */ bnez $at,.L0f153f38 -/* f153ec8: 28410bb8 */ slti $at,$v0,0xbb8 -/* f153ecc: 1020001a */ beqz $at,.L0f153f38 -/* f153ed0: 00000000 */ nop -/* f153ed4: 8d390010 */ lw $t9,0x10($t1) -/* f153ed8: 00b91823 */ subu $v1,$a1,$t9 -/* f153edc: 2861f449 */ slti $at,$v1,-2999 -/* f153ee0: 14200015 */ bnez $at,.L0f153f38 -/* f153ee4: 28610bb8 */ slti $at,$v1,0xbb8 -/* f153ee8: 10200013 */ beqz $at,.L0f153f38 -/* f153eec: 00000000 */ nop -/* f153ef0: 00420019 */ multu $v0,$v0 -/* f153ef4: afa60030 */ sw $a2,0x30($sp) -/* f153ef8: afa60018 */ sw $a2,0x18($sp) -/* f153efc: 00005012 */ mflo $t2 -/* f153f00: 00000000 */ nop -/* f153f04: 00000000 */ nop -/* f153f08: 00630019 */ multu $v1,$v1 -/* f153f0c: 00005812 */ mflo $t3 -/* f153f10: 014b6021 */ addu $t4,$t2,$t3 -/* f153f14: 448c2000 */ mtc1 $t4,$f4 -/* f153f18: 0c012974 */ jal sqrtf -/* f153f1c: 46802320 */ cvt.s.w $f12,$f4 -/* f153f20: 3c09800a */ lui $t1,%hi(var800a45d0) -/* f153f24: 252945d0 */ addiu $t1,$t1,%lo(var800a45d0) -/* f153f28: 8fa70030 */ lw $a3,0x30($sp) -/* f153f2c: 8fa80018 */ lw $t0,0x18($sp) -/* f153f30: 10000003 */ b .L0f153f40 -/* f153f34: 46000306 */ mov.s $f12,$f0 -.L0f153f38: -/* f153f38: 3c017f1b */ lui $at,%hi(var7f1b7400) -/* f153f3c: c42c7400 */ lwc1 $f12,%lo(var7f1b7400)($at) -.L0f153f40: -/* f153f40: 3c0d8008 */ lui $t5,%hi(var8007fbac) -/* f153f44: 8dadfbac */ lw $t5,%lo(var8007fbac)($t5) -/* f153f48: 3c014f80 */ lui $at,0x4f80 -/* f153f4c: 3c0e8008 */ lui $t6,%hi(var8007fbb0) -/* f153f50: 448d3000 */ mtc1 $t5,$f6 -/* f153f54: 3c0f8008 */ lui $t7,%hi(var8007fbb4) -/* f153f58: 05a10004 */ bgez $t5,.L0f153f6c -/* f153f5c: 468033a0 */ cvt.s.w $f14,$f6 -/* f153f60: 44814000 */ mtc1 $at,$f8 -/* f153f64: 00000000 */ nop -/* f153f68: 46087380 */ add.s $f14,$f14,$f8 -.L0f153f6c: -/* f153f6c: 8dcefbb0 */ lw $t6,%lo(var8007fbb0)($t6) -/* f153f70: 3c014f80 */ lui $at,0x4f80 -/* f153f74: 448e5000 */ mtc1 $t6,$f10 -/* f153f78: 05c10004 */ bgez $t6,.L0f153f8c -/* f153f7c: 468054a0 */ cvt.s.w $f18,$f10 -/* f153f80: 44812000 */ mtc1 $at,$f4 -/* f153f84: 00000000 */ nop -/* f153f88: 46049480 */ add.s $f18,$f18,$f4 -.L0f153f8c: -/* f153f8c: 8deffbb4 */ lw $t7,%lo(var8007fbb4)($t7) -/* f153f90: 3c014f80 */ lui $at,0x4f80 -/* f153f94: 448f3000 */ mtc1 $t7,$f6 -/* f153f98: 05e10004 */ bgez $t7,.L0f153fac -/* f153f9c: 46803420 */ cvt.s.w $f16,$f6 -/* f153fa0: 44814000 */ mtc1 $at,$f8 -/* f153fa4: 00000000 */ nop -/* f153fa8: 46088400 */ add.s $f16,$f16,$f8 -.L0f153fac: -/* f153fac: 91220018 */ lbu $v0,0x18($t1) -/* f153fb0: 24010002 */ addiu $at,$zero,0x2 -/* f153fb4: 14400082 */ bnez $v0,.L0f1541c0 -/* f153fb8: 00000000 */ nop -/* f153fbc: c5200014 */ lwc1 $f0,0x14($t1) -/* f153fc0: 460c003c */ c.lt.s $f0,$f12 -/* f153fc4: 00000000 */ nop -/* f153fc8: 45020004 */ bc1fl .L0f153fdc -/* f153fcc: 460e0081 */ sub.s $f2,$f0,$f14 -/* f153fd0: 100000f1 */ b .L0f154398 -/* f153fd4: 00004025 */ or $t0,$zero,$zero -/* f153fd8: 460e0081 */ sub.s $f2,$f0,$f14 -.L0f153fdc: -/* f153fdc: 240a00ff */ addiu $t2,$zero,0xff -/* f153fe0: 460c103c */ c.lt.s $f2,$f12 -/* f153fe4: 00000000 */ nop -/* f153fe8: 45020030 */ bc1fl .L0f1540ac -/* f153fec: 46107280 */ add.s $f10,$f14,$f16 -/* f153ff0: 46026281 */ sub.s $f10,$f12,$f2 -/* f153ff4: 3c01437f */ lui $at,0x437f -/* f153ff8: 44813000 */ mtc1 $at,$f6 -/* f153ffc: 24190001 */ addiu $t9,$zero,0x1 -/* f154000: 460e5103 */ div.s $f4,$f10,$f14 -/* f154004: 3c014f00 */ lui $at,0x4f00 -/* f154008: 46062002 */ mul.s $f0,$f4,$f6 -/* f15400c: 4458f800 */ cfc1 $t8,$31 -/* f154010: 44d9f800 */ ctc1 $t9,$31 -/* f154014: 00000000 */ nop -/* f154018: 46000224 */ cvt.w.s $f8,$f0 -/* f15401c: 4459f800 */ cfc1 $t9,$31 -/* f154020: 00000000 */ nop -/* f154024: 33390078 */ andi $t9,$t9,0x78 -/* f154028: 53200013 */ beqzl $t9,.L0f154078 -/* f15402c: 44194000 */ mfc1 $t9,$f8 -/* f154030: 44814000 */ mtc1 $at,$f8 -/* f154034: 24190001 */ addiu $t9,$zero,0x1 -/* f154038: 46080201 */ sub.s $f8,$f0,$f8 -/* f15403c: 44d9f800 */ ctc1 $t9,$31 -/* f154040: 00000000 */ nop -/* f154044: 46004224 */ cvt.w.s $f8,$f8 -/* f154048: 4459f800 */ cfc1 $t9,$31 -/* f15404c: 00000000 */ nop -/* f154050: 33390078 */ andi $t9,$t9,0x78 -/* f154054: 17200005 */ bnez $t9,.L0f15406c -/* f154058: 00000000 */ nop -/* f15405c: 44194000 */ mfc1 $t9,$f8 -/* f154060: 3c018000 */ lui $at,0x8000 -/* f154064: 10000007 */ b .L0f154084 -/* f154068: 0321c825 */ or $t9,$t9,$at -.L0f15406c: -/* f15406c: 10000005 */ b .L0f154084 -/* f154070: 2419ffff */ addiu $t9,$zero,-1 -/* f154074: 44194000 */ mfc1 $t9,$f8 -.L0f154078: -/* f154078: 00000000 */ nop -/* f15407c: 0720fffb */ bltz $t9,.L0f15406c -/* f154080: 00000000 */ nop -.L0f154084: -/* f154084: 01591023 */ subu $v0,$t2,$t9 -/* f154088: 00025a00 */ sll $t3,$v0,0x8 -/* f15408c: 01626025 */ or $t4,$t3,$v0 -/* f154090: 00026c00 */ sll $t5,$v0,0x10 -/* f154094: 018d7025 */ or $t6,$t4,$t5 -/* f154098: 00027e00 */ sll $t7,$v0,0x18 -/* f15409c: 44d8f800 */ ctc1 $t8,$31 -/* f1540a0: 100000bd */ b .L0f154398 -/* f1540a4: 01cf4025 */ or $t0,$t6,$t7 -/* f1540a8: 46107280 */ add.s $f10,$f14,$f16 -.L0f1540ac: -/* f1540ac: 30f800ff */ andi $t8,$a3,0xff -/* f1540b0: 270a00ff */ addiu $t2,$t8,0xff -/* f1540b4: 2401ff00 */ addiu $at,$zero,-256 -/* f1540b8: 460a0101 */ sub.s $f4,$f0,$f10 -/* f1540bc: 00e15824 */ and $t3,$a3,$at -/* f1540c0: 000ac842 */ srl $t9,$t2,0x1 -/* f1540c4: 460c203c */ c.lt.s $f4,$f12 -/* f1540c8: 00000000 */ nop -/* f1540cc: 45020004 */ bc1fl .L0f1540e0 -/* f1540d0: 46127180 */ add.s $f6,$f14,$f18 -/* f1540d4: 100000b0 */ b .L0f154398 -/* f1540d8: 032b4025 */ or $t0,$t9,$t3 -/* f1540dc: 46127180 */ add.s $f6,$f14,$f18 -.L0f1540e0: -/* f1540e0: 241900ff */ addiu $t9,$zero,0xff -/* f1540e4: 46103200 */ add.s $f8,$f6,$f16 -/* f1540e8: 46080081 */ sub.s $f2,$f0,$f8 -/* f1540ec: 460c103c */ c.lt.s $f2,$f12 -/* f1540f0: 00000000 */ nop -/* f1540f4: 450200a9 */ bc1fl .L0f15439c -/* f1540f8: 8fbf0014 */ lw $ra,0x14($sp) -/* f1540fc: 46026281 */ sub.s $f10,$f12,$f2 -/* f154100: 3c01437f */ lui $at,0x437f -/* f154104: 44813000 */ mtc1 $at,$f6 -/* f154108: 240a0001 */ addiu $t2,$zero,0x1 -/* f15410c: 46125103 */ div.s $f4,$f10,$f18 -/* f154110: 30ec00ff */ andi $t4,$a3,0xff -/* f154114: 258d00ff */ addiu $t5,$t4,0xff -/* f154118: 2401ff00 */ addiu $at,$zero,-256 -/* f15411c: 00e17824 */ and $t7,$a3,$at -/* f154120: 000d7042 */ srl $t6,$t5,0x1 -/* f154124: 01cf2825 */ or $a1,$t6,$t7 -/* f154128: 3c014f00 */ lui $at,0x4f00 -/* f15412c: 00e02025 */ or $a0,$a3,$zero -/* f154130: 46062002 */ mul.s $f0,$f4,$f6 -/* f154134: 4458f800 */ cfc1 $t8,$31 -/* f154138: 44caf800 */ ctc1 $t2,$31 -/* f15413c: 00000000 */ nop -/* f154140: 46000224 */ cvt.w.s $f8,$f0 -/* f154144: 444af800 */ cfc1 $t2,$31 -/* f154148: 00000000 */ nop -/* f15414c: 314a0078 */ andi $t2,$t2,0x78 -/* f154150: 51400013 */ beqzl $t2,.L0f1541a0 -/* f154154: 440a4000 */ mfc1 $t2,$f8 -/* f154158: 44814000 */ mtc1 $at,$f8 -/* f15415c: 240a0001 */ addiu $t2,$zero,0x1 -/* f154160: 46080201 */ sub.s $f8,$f0,$f8 -/* f154164: 44caf800 */ ctc1 $t2,$31 -/* f154168: 00000000 */ nop -/* f15416c: 46004224 */ cvt.w.s $f8,$f8 -/* f154170: 444af800 */ cfc1 $t2,$31 -/* f154174: 00000000 */ nop -/* f154178: 314a0078 */ andi $t2,$t2,0x78 -/* f15417c: 15400005 */ bnez $t2,.L0f154194 -/* f154180: 00000000 */ nop -/* f154184: 440a4000 */ mfc1 $t2,$f8 -/* f154188: 3c018000 */ lui $at,0x8000 -/* f15418c: 10000007 */ b .L0f1541ac -/* f154190: 01415025 */ or $t2,$t2,$at -.L0f154194: -/* f154194: 10000005 */ b .L0f1541ac -/* f154198: 240affff */ addiu $t2,$zero,-1 -/* f15419c: 440a4000 */ mfc1 $t2,$f8 -.L0f1541a0: -/* f1541a0: 00000000 */ nop -/* f1541a4: 0540fffb */ bltz $t2,.L0f154194 -/* f1541a8: 00000000 */ nop -.L0f1541ac: -/* f1541ac: 44d8f800 */ ctc1 $t8,$31 -/* f1541b0: 0fc01a40 */ jal colourBlend -/* f1541b4: 032a3023 */ subu $a2,$t9,$t2 -/* f1541b8: 10000077 */ b .L0f154398 -/* f1541bc: 00404025 */ or $t0,$v0,$zero -.L0f1541c0: -/* f1541c0: 54410076 */ bnel $v0,$at,.L0f15439c -/* f1541c4: 8fbf0014 */ lw $ra,0x14($sp) -/* f1541c8: c5200014 */ lwc1 $f0,0x14($t1) -/* f1541cc: 460c003c */ c.lt.s $f0,$f12 -/* f1541d0: 00000000 */ nop -/* f1541d4: 45020004 */ bc1fl .L0f1541e8 -/* f1541d8: 460e0081 */ sub.s $f2,$f0,$f14 -/* f1541dc: 1000006e */ b .L0f154398 -/* f1541e0: 00004025 */ or $t0,$zero,$zero -/* f1541e4: 460e0081 */ sub.s $f2,$f0,$f14 -.L0f1541e8: -/* f1541e8: 460c103c */ c.lt.s $f2,$f12 -/* f1541ec: 00000000 */ nop -/* f1541f0: 4502002e */ bc1fl .L0f1542ac -/* f1541f4: 44808000 */ mtc1 $zero,$f16 -/* f1541f8: 46026281 */ sub.s $f10,$f12,$f2 -/* f1541fc: 3c01437f */ lui $at,0x437f -/* f154200: 44813000 */ mtc1 $at,$f6 -/* f154204: 24060001 */ addiu $a2,$zero,0x1 -/* f154208: 460e5103 */ div.s $f4,$f10,$f14 -/* f15420c: 3c014f00 */ lui $at,0x4f00 -/* f154210: 00002025 */ or $a0,$zero,$zero -/* f154214: 30e500ff */ andi $a1,$a3,0xff -/* f154218: 46062002 */ mul.s $f0,$f4,$f6 -/* f15421c: 444bf800 */ cfc1 $t3,$31 -/* f154220: 44c6f800 */ ctc1 $a2,$31 -/* f154224: 00000000 */ nop -/* f154228: 46000224 */ cvt.w.s $f8,$f0 -/* f15422c: 4446f800 */ cfc1 $a2,$31 -/* f154230: 00000000 */ nop -/* f154234: 30c60078 */ andi $a2,$a2,0x78 -/* f154238: 50c00013 */ beqzl $a2,.L0f154288 -/* f15423c: 44064000 */ mfc1 $a2,$f8 -/* f154240: 44814000 */ mtc1 $at,$f8 -/* f154244: 24060001 */ addiu $a2,$zero,0x1 -/* f154248: 46080201 */ sub.s $f8,$f0,$f8 -/* f15424c: 44c6f800 */ ctc1 $a2,$31 -/* f154250: 00000000 */ nop -/* f154254: 46004224 */ cvt.w.s $f8,$f8 -/* f154258: 4446f800 */ cfc1 $a2,$31 -/* f15425c: 00000000 */ nop -/* f154260: 30c60078 */ andi $a2,$a2,0x78 -/* f154264: 14c00005 */ bnez $a2,.L0f15427c -/* f154268: 00000000 */ nop -/* f15426c: 44064000 */ mfc1 $a2,$f8 -/* f154270: 3c018000 */ lui $at,0x8000 -/* f154274: 10000007 */ b .L0f154294 -/* f154278: 00c13025 */ or $a2,$a2,$at -.L0f15427c: -/* f15427c: 10000005 */ b .L0f154294 -/* f154280: 2406ffff */ addiu $a2,$zero,-1 -/* f154284: 44064000 */ mfc1 $a2,$f8 -.L0f154288: -/* f154288: 00000000 */ nop -/* f15428c: 04c0fffb */ bltz $a2,.L0f15427c -/* f154290: 00000000 */ nop -.L0f154294: -/* f154294: 44cbf800 */ ctc1 $t3,$31 -/* f154298: 0fc01a40 */ jal colourBlend -/* f15429c: 00000000 */ nop -/* f1542a0: 1000003d */ b .L0f154398 -/* f1542a4: 00404025 */ or $t0,$v0,$zero -/* f1542a8: 44808000 */ mtc1 $zero,$f16 -.L0f1542ac: -/* f1542ac: 00000000 */ nop -/* f1542b0: 46107280 */ add.s $f10,$f14,$f16 -/* f1542b4: 460a0101 */ sub.s $f4,$f0,$f10 -/* f1542b8: 460c203c */ c.lt.s $f4,$f12 -/* f1542bc: 00000000 */ nop -/* f1542c0: 45020004 */ bc1fl .L0f1542d4 -/* f1542c4: 46127180 */ add.s $f6,$f14,$f18 -/* f1542c8: 10000033 */ b .L0f154398 -/* f1542cc: 30e800ff */ andi $t0,$a3,0xff -/* f1542d0: 46127180 */ add.s $f6,$f14,$f18 -.L0f1542d4: -/* f1542d4: 46103200 */ add.s $f8,$f6,$f16 -/* f1542d8: 46080081 */ sub.s $f2,$f0,$f8 -/* f1542dc: 460c103c */ c.lt.s $f2,$f12 -/* f1542e0: 00000000 */ nop -/* f1542e4: 4502002d */ bc1fl .L0f15439c -/* f1542e8: 8fbf0014 */ lw $ra,0x14($sp) -/* f1542ec: 46026281 */ sub.s $f10,$f12,$f2 -/* f1542f0: 3c01437f */ lui $at,0x437f -/* f1542f4: 44813000 */ mtc1 $at,$f6 -/* f1542f8: 24060001 */ addiu $a2,$zero,0x1 -/* f1542fc: 46125103 */ div.s $f4,$f10,$f18 -/* f154300: 3c014f00 */ lui $at,0x4f00 -/* f154304: 30e400ff */ andi $a0,$a3,0xff -/* f154308: 00e02825 */ or $a1,$a3,$zero -/* f15430c: 46062002 */ mul.s $f0,$f4,$f6 -/* f154310: 444cf800 */ cfc1 $t4,$31 -/* f154314: 44c6f800 */ ctc1 $a2,$31 -/* f154318: 00000000 */ nop -/* f15431c: 46000224 */ cvt.w.s $f8,$f0 -/* f154320: 4446f800 */ cfc1 $a2,$31 -/* f154324: 00000000 */ nop -/* f154328: 30c60078 */ andi $a2,$a2,0x78 -/* f15432c: 50c00013 */ beqzl $a2,.L0f15437c -/* f154330: 44064000 */ mfc1 $a2,$f8 -/* f154334: 44814000 */ mtc1 $at,$f8 -/* f154338: 24060001 */ addiu $a2,$zero,0x1 -/* f15433c: 46080201 */ sub.s $f8,$f0,$f8 -/* f154340: 44c6f800 */ ctc1 $a2,$31 -/* f154344: 00000000 */ nop -/* f154348: 46004224 */ cvt.w.s $f8,$f8 -/* f15434c: 4446f800 */ cfc1 $a2,$31 -/* f154350: 00000000 */ nop -/* f154354: 30c60078 */ andi $a2,$a2,0x78 -/* f154358: 14c00005 */ bnez $a2,.L0f154370 -/* f15435c: 00000000 */ nop -/* f154360: 44064000 */ mfc1 $a2,$f8 -/* f154364: 3c018000 */ lui $at,0x8000 -/* f154368: 10000007 */ b .L0f154388 -/* f15436c: 00c13025 */ or $a2,$a2,$at -.L0f154370: -/* f154370: 10000005 */ b .L0f154388 -/* f154374: 2406ffff */ addiu $a2,$zero,-1 -/* f154378: 44064000 */ mfc1 $a2,$f8 -.L0f15437c: -/* f15437c: 00000000 */ nop -/* f154380: 04c0fffb */ bltz $a2,.L0f154370 -/* f154384: 00000000 */ nop -.L0f154388: -/* f154388: 44ccf800 */ ctc1 $t4,$31 -/* f15438c: 0fc01a40 */ jal colourBlend -/* f154390: 00000000 */ nop -/* f154394: 00404025 */ or $t0,$v0,$zero -.L0f154398: -/* f154398: 8fbf0014 */ lw $ra,0x14($sp) -.L0f15439c: -/* f15439c: 27bd0028 */ addiu $sp,$sp,0x28 -/* f1543a0: 01001025 */ or $v0,$t0,$zero -/* f1543a4: 03e00008 */ jr $ra -/* f1543a8: 00000000 */ nop -); +u32 func0f153e94(s32 x, s32 y, u32 colour) +{ + u32 stack[2]; + f32 zero = 0.0f; + u32 result = colour; + + if (var800a45d0.unk00 & 1) { + f32 weightf; + f32 f12; + f32 f14; + f32 f16; + f32 f18; + + if (x - var800a45d0.unk0c > -3000 && x - var800a45d0.unk0c < 3000 + && y - var800a45d0.unk10 > -3000 && y - var800a45d0.unk10 < 3000) { + f12 = sqrtf((x - var800a45d0.unk0c) * (x - var800a45d0.unk0c) + (y - var800a45d0.unk10) * (y - var800a45d0.unk10)); + } else { + f12 = 3000.0f; + } + + f14 = var8007fbac; + f18 = var8007fbb0; + f16 = var8007fbb4; + + if (var800a45d0.unk18 == 0) { + if (var800a45d0.unk14 < f12) { + result = 0; + } else if (var800a45d0.unk14 - f14 < f12) { + u32 intensity; + weightf = (f12 - (var800a45d0.unk14 - f14)) / f14 * 255.0f; + intensity = 255 - (u32) weightf; + result = intensity << 8 | intensity | intensity << 16 | intensity << 24; + } else if (var800a45d0.unk14 - (f14 + f16) < f12) { + result = ((colour & 0xff) + 0xff) >> 1 | colour & 0xffffff00; + } else if ((var800a45d0.unk14 - (f14 + f18 + f16)) < f12) { + u32 colour2 = (((colour & 0xff) + 0xff) / 2) | (colour & 0xffffff00); + weightf = (f12 - (var800a45d0.unk14 - (f14 + f18 + f16))) / f18 * 255.0f; + result = colourBlend(colour, colour2, 0xff - (u32) weightf); + } + } else if (var800a45d0.unk18 == 2) { + if (var800a45d0.unk14 < f12) { + result = 0x00000000; + } else if (var800a45d0.unk14 - f14 < f12) { + weightf = (f12 - (var800a45d0.unk14 - f14)) / f14 * 255.0f; + result = colourBlend(0x00000000, colour & 0xff, weightf); + } else if (var800a45d0.unk14 - (f14 + zero) < f12) { + result = colour & 0xff; + } else if ((var800a45d0.unk14 - (f14 + f18 + zero)) < f12) { + weightf = (f12 - (var800a45d0.unk14 - (f14 + f18 + zero))) / f18 * 255.0f; + result = colourBlend(colour & 0xff, colour, weightf); + } + } + } + + return result; +} GLOBAL_ASM( glabel func0f1543ac