From 3e550e4dc3727d4e567e9648784c378580433b7c Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 6 Jan 2021 12:13:14 +1000 Subject: [PATCH] Decompile chrRender --- src/game/chr/chr.c | 1256 +++++++--------------- src/game/chr/chraction.c | 14 +- src/game/core.c | 2 +- src/game/data/data_003dc0.c | 2 +- src/game/data/data_0083d0.c | 89 -- src/game/data/data_0160b0.c | 2 +- src/game/dlights.c | 28 +- src/game/explosions/explosions.c | 8 +- src/game/game_00c490.c | 12 +- src/game/game_011110.c | 6 +- src/game/game_0601b0.c | 12 +- src/game/game_097ba0.c | 14 +- src/game/game_0abe70.c | 2 +- src/game/game_0b63b0.c | 34 +- src/game/game_0dcdb0.c | 18 +- src/game/game_0f09f0.c | 6 +- src/game/game_11f000.c | 4 +- src/game/game_129210.c | 2 +- src/game/game_13c510.c | 12 +- src/game/game_157db0.c | 8 +- src/game/mplayer/mplayer.c | 8 +- src/game/propobj.c | 42 +- src/game/sparks/sparks.c | 8 +- src/game/title.c | 8 +- src/gvars/gvars.c | 2 +- src/include/constants.h | 4 +- src/include/game/chr/chr.h | 14 +- src/include/game/data/data_0160b0.h | 2 +- src/include/game/explosions/explosions.h | 2 +- src/include/game/game_0601b0.h | 2 +- src/include/game/game_0b63b0.h | 2 +- src/include/game/game_0c33f0.h | 2 +- src/include/game/game_165670.h | 2 +- src/include/game/mplayer/setup.h | 2 +- src/include/game/propobj.h | 20 +- src/include/game/smoke/smoke.h | 2 +- src/include/gvars/gvars.h | 2 +- src/include/lib/lib_1a500.h | 6 +- src/include/types.h | 39 +- src/lib/lib_1a500.c | 34 +- 40 files changed, 603 insertions(+), 1131 deletions(-) diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index a10cee690..1ee3e80d0 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -55,6 +55,79 @@ const char var7f1a8690[] = "chr/chr.c"; const char var7f1a869c[] = "selectanimnum"; +u8 g_FileState = 0; +u8 var80062944 = 0; +u8 var80062948 = 0; +u8 var8006294c = 0; +u32 var80062950 = 0x00000064; +bool g_WeatherTickEnabled = true; +u32 var80062958 = 0x00000000; +u32 var8006295c = 0x00000000; +void *var80062960 = NULL; +u32 var80062964 = 0x00000000; +f32 var80062968 = 0; +u32 var8006296c = 0x00000000; +u32 var80062970 = 0x00000000; +u32 var80062974 = 0x00000000; +u32 var80062978 = 0x00000000; +u32 var8006297c = 0; +u32 var80062980 = 0; +s32 g_NextChrnum = 5000; + +// 80062988 +struct chrdata *g_ChrSlots = NULL; + +// 8006298c +s32 g_NumChrSlots = 0; + +u32 var80062990 = 0x00000000; +u32 var80062994 = 0x00000000; +u32 var80062998 = 0x00000000; +u32 var8006299c = 0x00000001; +u32 var800629a0 = 0x00000003; +u32 var800629a4 = 0x00000000; +u32 var800629a8 = 0x00000000; +u32 var800629ac = 0x00000000; +u32 var800629b0 = 0x00000000; +u32 var800629b4 = 0x00000000; +u32 var800629b8 = 0x00000000; +u32 var800629bc = 0x00000000; +u32 var800629c0 = 0x00000000; +u32 var800629c4 = 0x00000000; +u32 var800629c8 = 0x00000000; +u32 var800629cc = 0x00000000; +u32 var800629d0 = 0x00000000; +u32 var800629d4 = 0x00000000; +u32 var800629d8 = 0x00000000; +u32 var800629dc = 0x00000000; +u32 var800629e0 = 0x00000000; +u32 var800629e4 = 0x1a000003; +u32 var800629e8 = 0x3f800000; +u32 var800629ec = 0x00000000; +u32 var800629f0 = 0x00000000; +u32 var800629f4 = 0x00000000; +u32 var800629f8 = 0x00000000; +u32 var800629fc = 0x00000000; +u32 var80062a00 = 0x00000001; +u32 var80062a04 = 0x00000003; +u32 var80062a08 = 0x00000000; +u32 var80062a0c = 0x00000000; +u32 var80062a10 = 0x00000000; +u32 var80062a14 = 0x00000000; +u32 var80062a18 = 0x00000000; +u32 var80062a1c = 0x00000000; +u32 var80062a20 = 0x00000000; +u32 var80062a24 = 0x00000000; +u32 var80062a28 = 0x00000000; +u32 var80062a2c = 0x00000000; +u32 var80062a30 = 0x00000000; +u32 var80062a34 = 0x00000000; +u32 var80062a38 = 0x00000000; +u32 var80062a3c = 0x00000000; +u32 var80062a40 = 0x00000000; +u32 var80062a44 = 0x00000000; +u8 var80062a48[] = { 64, 10, 10 }; + void func0f01e250(void) { s32 i; @@ -2557,10 +2630,10 @@ struct prop *func0f020b14(struct prop *prop, struct model *model, func0f0220ac(chr); modelSetRootPosition(model, &prop->pos); - nodetype = chr->model->unk08->rootnode->type; + nodetype = chr->model->filedata->rootnode->type; if ((nodetype & 0xff) == MODELNODETYPE_ROOT) { - struct modeldata_root *data = modelGetNodeData(chr->model, chr->model->unk08->rootnode); + struct modeldata_root *data = modelGetNodeData(chr->model, chr->model->filedata->rootnode); data->ground = ground; } @@ -5847,16 +5920,16 @@ void chrDropItems(struct chrdata *chr) void chrSetHudpieceVisible(struct chrdata *chr, bool visible) { - struct model08 *model08 = chr->model->unk08; + struct modelfiledata *modelfiledata = chr->model->filedata; - if (model08->unk04 == &stagethinglist_22e60) { - struct modelnode *node = modelGetPart(model08, MODELPART_HUDPIECE); + if (modelfiledata->unk04 == &stagethinglist_22e60) { + struct modelnode *node = modelGetPart(modelfiledata, MODELPART_HUDPIECE); if (node && node->type == MODELNODETYPE_HEADSPOT) { struct modeldata_headspot *data = modelGetNodeData(chr->model, node); - if (data->model08) { - struct modelnode *node2 = modelGetPart(data->model08, MODELPART_HUDPIECE); + if (data->modelfiledata) { + struct modelnode *node2 = modelGetPart(data->modelfiledata, MODELPART_HUDPIECE); if (node2) { struct modeldata_partid *data2 = modelGetNodeData(chr->model, node2); @@ -6575,7 +6648,7 @@ glabel func0f025074 /* f0250a8: 8c900004 */ lw $s0,0x4($a0) /* f0250ac: 02202025 */ or $a0,$s1,$zero /* f0250b0: 8e050018 */ lw $a1,0x18($s0) -/* f0250b4: 0c0087bd */ jal func00021ef4 +/* f0250b4: 0c0087bd */ jal modelRender /* f0250b8: afa5002c */ sw $a1,0x2c($sp) /* f0250bc: 92190002 */ lbu $t9,0x2($s0) /* f0250c0: 24080001 */ addiu $t0,$zero,0x1 @@ -6678,856 +6751,321 @@ void bodyGetBloodColour(s16 bodynum, u8 *colour1, u32 *colour2) } } +extern void *var8005efc4; -GLOBAL_ASM( -glabel propchrRender -.late_rodata -glabel var7f1a88f4 -.word 0x3c088889 -glabel var7f1a88f8 -.word 0x3b808081 -glabel var7f1a88fc -.word 0x3b83126f -glabel var7f1a8900 -.word 0x3ecccccd -.text -/* f025288: 27bdfee0 */ addiu $sp,$sp,-288 -/* f02528c: afbf002c */ sw $ra,0x2c($sp) -/* f025290: afb00028 */ sw $s0,0x28($sp) -/* f025294: afa40120 */ sw $a0,0x120($sp) -/* f025298: afa50124 */ sw $a1,0x124($sp) -/* f02529c: afa60128 */ sw $a2,0x128($sp) -/* f0252a0: 8c900004 */ lw $s0,0x4($a0) -/* f0252a4: 24010003 */ addiu $at,$zero,0x3 -/* f0252a8: 00001825 */ or $v1,$zero,$zero -/* f0252ac: 8e0f0020 */ lw $t7,0x20($s0) -/* f0252b0: a3a000eb */ sb $zero,0xeb($sp) -/* f0252b4: 12000003 */ beqz $s0,.L0f0252c4 -/* f0252b8: afaf0118 */ sw $t7,0x118($sp) -/* f0252bc: 10000001 */ b .L0f0252c4 -/* f0252c0: 920302fe */ lbu $v1,0x2fe($s0) -.L0f0252c4: -/* f0252c4: 54610015 */ bnel $v1,$at,.L0f02531c -/* f0252c8: 8e0a0018 */ lw $t2,0x18($s0) -/* f0252cc: 0fc0f011 */ jal chrToEyespy -/* f0252d0: 02002025 */ or $a0,$s0,$zero -/* f0252d4: 50400011 */ beqzl $v0,.L0f02531c -/* f0252d8: 8e0a0018 */ lw $t2,0x18($s0) -/* f0252dc: 90580035 */ lbu $t8,0x35($v0) -/* f0252e0: 3c19800a */ lui $t9,%hi(g_Vars+0x284) -/* f0252e4: 17000003 */ bnez $t8,.L0f0252f4 -/* f0252e8: 00000000 */ nop -/* f0252ec: 100002e8 */ b .L0f025e90 -/* f0252f0: 8fa20124 */ lw $v0,0x124($sp) -.L0f0252f4: -/* f0252f4: 8f39a244 */ lw $t9,%lo(g_Vars+0x284)($t9) -/* f0252f8: 8f280480 */ lw $t0,0x480($t9) -/* f0252fc: 54480007 */ bnel $v0,$t0,.L0f02531c -/* f025300: 8e0a0018 */ lw $t2,0x18($s0) -/* f025304: 80490037 */ lb $t1,0x37($v0) -/* f025308: 51200004 */ beqzl $t1,.L0f02531c -/* f02530c: 8e0a0018 */ lw $t2,0x18($s0) -/* f025310: 100002df */ b .L0f025e90 -/* f025314: 8fa20124 */ lw $v0,0x124($sp) -/* f025318: 8e0a0018 */ lw $t2,0x18($s0) -.L0f02531c: -/* f02531c: 240c00ff */ addiu $t4,$zero,0xff -/* f025320: 27a500ec */ addiu $a1,$sp,0xec -/* f025324: 000a5a00 */ sll $t3,$t2,0x8 -/* f025328: 05610003 */ bgez $t3,.L0f025338 -/* f02532c: 00003025 */ or $a2,$zero,$zero -/* f025330: 10000003 */ b .L0f025340 -/* f025334: afac00fc */ sw $t4,0xfc($sp) -.L0f025338: -/* f025338: 920d000c */ lbu $t5,0xc($s0) -/* f02533c: afad00fc */ sw $t5,0xfc($sp) -.L0f025340: -/* f025340: 8e0202d4 */ lw $v0,0x2d4($s0) -/* f025344: 10400013 */ beqz $v0,.L0f025394 -/* f025348: 00000000 */ nop -/* f02534c: 90430058 */ lbu $v1,0x58($v0) -/* f025350: 240f0078 */ addiu $t7,$zero,0x78 -/* f025354: 8fae00fc */ lw $t6,0xfc($sp) -/* f025358: 1860000e */ blez $v1,.L0f025394 -/* f02535c: 01e3c023 */ subu $t8,$t7,$v1 -/* f025360: 448e2000 */ mtc1 $t6,$f4 -/* f025364: 44984000 */ mtc1 $t8,$f8 -/* f025368: 3c017f1b */ lui $at,%hi(var7f1a88f4) -/* f02536c: 468021a0 */ cvt.s.w $f6,$f4 -/* f025370: c43288f4 */ lwc1 $f18,%lo(var7f1a88f4)($at) -/* f025374: 468042a0 */ cvt.s.w $f10,$f8 -/* f025378: 460a3402 */ mul.s $f16,$f6,$f10 -/* f02537c: 00000000 */ nop -/* f025380: 46128102 */ mul.s $f4,$f16,$f18 -/* f025384: 4600220d */ trunc.w.s $f8,$f4 -/* f025388: 44084000 */ mfc1 $t0,$f8 -/* f02538c: 00000000 */ nop -/* f025390: afa800fc */ sw $t0,0xfc($sp) -.L0f025394: -/* f025394: 0fc09451 */ jal bodyGetBloodColour -/* f025398: 86040010 */ lh $a0,0x10($s0) -/* f02539c: 0fc091b9 */ jal func0f0246e4 -/* f0253a0: 27a400ec */ addiu $a0,$sp,0xec -/* f0253a4: 0c006be0 */ jal func0001af80 -/* f0253a8: 8fa40118 */ lw $a0,0x118($sp) -/* f0253ac: 44050000 */ mfc1 $a1,$f0 -/* f0253b0: 0fc239af */ jal func0f08e6bc -/* f0253b4: 8fa40120 */ lw $a0,0x120($sp) -/* f0253b8: 8fa900fc */ lw $t1,0xfc($sp) -/* f0253bc: 3c03800a */ lui $v1,%hi(g_Vars+0x284) -/* f0253c0: 8c63a244 */ lw $v1,%lo(g_Vars+0x284)($v1) -/* f0253c4: 44893000 */ mtc1 $t1,$f6 -/* f0253c8: 24010001 */ addiu $at,$zero,0x1 -/* f0253cc: 8fa20120 */ lw $v0,0x120($sp) -/* f0253d0: 468032a0 */ cvt.s.w $f10,$f6 -/* f0253d4: 46005402 */ mul.s $f16,$f10,$f0 -/* f0253d8: 4600848d */ trunc.w.s $f18,$f16 -/* f0253dc: 440b9000 */ mfc1 $t3,$f18 -/* f0253e0: 00000000 */ nop -/* f0253e4: afab00fc */ sw $t3,0xfc($sp) -/* f0253e8: 946c0010 */ lhu $t4,0x10($v1) -/* f0253ec: 5581003e */ bnel $t4,$at,.L0f0254e8 -/* f0253f0: 8c7800d8 */ lw $t8,0xd8($v1) -/* f0253f4: c4460008 */ lwc1 $f6,0x8($v0) -/* f0253f8: c46a0018 */ lwc1 $f10,0x18($v1) -/* f0253fc: c4440010 */ lwc1 $f4,0x10($v0) -/* f025400: c4680020 */ lwc1 $f8,0x20($v1) -/* f025404: 460a3081 */ sub.s $f2,$f6,$f10 -/* f025408: c450000c */ lwc1 $f16,0xc($v0) -/* f02540c: c472001c */ lwc1 $f18,0x1c($v1) -/* f025410: 46082001 */ sub.s $f0,$f4,$f8 -/* f025414: 46021102 */ mul.s $f4,$f2,$f2 -/* f025418: 46128381 */ sub.s $f14,$f16,$f18 -/* f02541c: 460e7202 */ mul.s $f8,$f14,$f14 -/* f025420: 46082180 */ add.s $f6,$f4,$f8 -/* f025424: 46000282 */ mul.s $f10,$f0,$f0 -/* f025428: 0c012974 */ jal sqrtf -/* f02542c: 46065300 */ add.s $f12,$f10,$f6 -/* f025430: 3c03800a */ lui $v1,%hi(g_Vars+0x284) -/* f025434: 8c63a244 */ lw $v1,%lo(g_Vars+0x284)($v1) -/* f025438: 3c014316 */ lui $at,0x4316 -/* f02543c: c4620024 */ lwc1 $f2,0x24($v1) -/* f025440: 4600103c */ c.lt.s $f2,$f0 -/* f025444: 00000000 */ nop -/* f025448: 45020004 */ bc1fl .L0f02545c -/* f02544c: 44818000 */ mtc1 $at,$f16 -/* f025450: 1000028f */ b .L0f025e90 -/* f025454: 8fa20124 */ lw $v0,0x124($sp) -/* f025458: 44818000 */ mtc1 $at,$f16 -.L0f02545c: -/* f02545c: 240d0080 */ addiu $t5,$zero,0x80 -/* f025460: afad00fc */ sw $t5,0xfc($sp) -/* f025464: 46101301 */ sub.s $f12,$f2,$f16 -/* f025468: 3c014316 */ lui $at,0x4316 -/* f02546c: 4600603c */ c.lt.s $f12,$f0 -/* f025470: 00000000 */ nop -/* f025474: 4502000f */ bc1fl .L0f0254b4 -/* f025478: 46020283 */ div.s $f10,$f0,$f2 -/* f02547c: 460c0481 */ sub.s $f18,$f0,$f12 -/* f025480: 44812000 */ mtc1 $at,$f4 -/* f025484: 3c013f80 */ lui $at,0x3f80 -/* f025488: 44815000 */ mtc1 $at,$f10 -/* f02548c: 46049203 */ div.s $f8,$f18,$f4 -/* f025490: 3c014300 */ lui $at,0x4300 -/* f025494: 44818000 */ mtc1 $at,$f16 -/* f025498: 46085181 */ sub.s $f6,$f10,$f8 -/* f02549c: 46103482 */ mul.s $f18,$f6,$f16 -/* f0254a0: 4600910d */ trunc.w.s $f4,$f18 -/* f0254a4: 440f2000 */ mfc1 $t7,$f4 -/* f0254a8: 00000000 */ nop -/* f0254ac: afaf00fc */ sw $t7,0xfc($sp) -/* f0254b0: 46020283 */ div.s $f10,$f0,$f2 -.L0f0254b4: -/* f0254b4: 3c013f80 */ lui $at,0x3f80 -/* f0254b8: 44814000 */ mtc1 $at,$f8 -/* f0254bc: 3c013f80 */ lui $at,0x3f80 -/* f0254c0: e7aa00f0 */ swc1 $f10,0xf0($sp) -/* f0254c4: c7a600f0 */ lwc1 $f6,0xf0($sp) -/* f0254c8: 4606403c */ c.lt.s $f8,$f6 -/* f0254cc: 00000000 */ nop -/* f0254d0: 45020005 */ bc1fl .L0f0254e8 -/* f0254d4: 8c7800d8 */ lw $t8,0xd8($v1) -/* f0254d8: 44818000 */ mtc1 $at,$f16 -/* f0254dc: 00000000 */ nop -/* f0254e0: e7b000f0 */ swc1 $f16,0xf0($sp) -/* f0254e4: 8c7800d8 */ lw $t8,0xd8($v1) -.L0f0254e8: -/* f0254e8: 3c198007 */ lui $t9,%hi(var80070764) -/* f0254ec: 17000013 */ bnez $t8,.L0f02553c -/* f0254f0: 00000000 */ nop -/* f0254f4: 8f390764 */ lw $t9,%lo(var80070764)($t9) -/* f0254f8: 17200010 */ bnez $t9,.L0f02553c -/* f0254fc: 00000000 */ nop -/* f025500: 8c620480 */ lw $v0,0x480($v1) -/* f025504: 50400007 */ beqzl $v0,.L0f025524 -/* f025508: 8c6a1c54 */ lw $t2,0x1c54($v1) -/* f02550c: 1040000b */ beqz $v0,.L0f02553c -/* f025510: 00000000 */ nop -/* f025514: 80480037 */ lb $t0,0x37($v0) -/* f025518: 15000008 */ bnez $t0,.L0f02553c -/* f02551c: 00000000 */ nop -/* f025520: 8c6a1c54 */ lw $t2,0x1c54($v1) -.L0f025524: -/* f025524: 8c6900c4 */ lw $t1,0xc4($v1) -/* f025528: 01405827 */ nor $t3,$t2,$zero -/* f02552c: 012b6024 */ and $t4,$t1,$t3 -/* f025530: 318d0008 */ andi $t5,$t4,0x8 -/* f025534: 55a00011 */ bnezl $t5,.L0f02557c -/* f025538: 8fa800fc */ lw $t0,0xfc($sp) -.L0f02553c: -/* f02553c: 0fc08af9 */ jal func0f022be4 -/* f025540: 02002025 */ or $a0,$s0,$zero -/* f025544: 8fae00fc */ lw $t6,0xfc($sp) -/* f025548: 3c017f1b */ lui $at,%hi(var7f1a88f8) -/* f02554c: c42a88f8 */ lwc1 $f10,%lo(var7f1a88f8)($at) -/* f025550: 004e0019 */ multu $v0,$t6 -/* f025554: 00007812 */ mflo $t7 -/* f025558: 448f9000 */ mtc1 $t7,$f18 -/* f02555c: 00000000 */ nop -/* f025560: 46809120 */ cvt.s.w $f4,$f18 -/* f025564: 460a2202 */ mul.s $f8,$f4,$f10 -/* f025568: 4600418d */ trunc.w.s $f6,$f8 -/* f02556c: 44193000 */ mfc1 $t9,$f6 -/* f025570: 00000000 */ nop -/* f025574: afb900fc */ sw $t9,0xfc($sp) -/* f025578: 8fa800fc */ lw $t0,0xfc($sp) -.L0f02557c: -/* f02557c: 8faa0128 */ lw $t2,0x128($sp) -/* f025580: 8fab0128 */ lw $t3,0x128($sp) -/* f025584: 290100ff */ slti $at,$t0,0xff -/* f025588: 10200007 */ beqz $at,.L0f0255a8 -/* f02558c: 27a50108 */ addiu $a1,$sp,0x108 -/* f025590: 15400003 */ bnez $t2,.L0f0255a0 -/* f025594: 24090003 */ addiu $t1,$zero,0x3 -/* f025598: 1000023d */ b .L0f025e90 -/* f02559c: 8fa20124 */ lw $v0,0x124($sp) -.L0f0255a0: -/* f0255a0: 10000007 */ b .L0f0255c0 -/* f0255a4: afa90100 */ sw $t1,0x100($sp) -.L0f0255a8: -/* f0255a8: 15600004 */ bnez $t3,.L0f0255bc -/* f0255ac: 240d0002 */ addiu $t5,$zero,0x2 -/* f0255b0: 240c0001 */ addiu $t4,$zero,0x1 -/* f0255b4: 10000002 */ b .L0f0255c0 -/* f0255b8: afac0100 */ sw $t4,0x100($sp) -.L0f0255bc: -/* f0255bc: afad0100 */ sw $t5,0x100($sp) -.L0f0255c0: -/* f0255c0: 0fc599fd */ jal func0f1667f4 -/* f0255c4: 8fa40120 */ lw $a0,0x120($sp) -/* f0255c8: afa20104 */ sw $v0,0x104($sp) -/* f0255cc: 8e0e032c */ lw $t6,0x32c($s0) -/* f0255d0: 260500fc */ addiu $a1,$s0,0xfc -/* f0255d4: 000ec480 */ sll $t8,$t6,0x12 -/* f0255d8: 07030008 */ bgezl $t8,.L0f0255fc -/* f0255dc: 8faa0104 */ lw $t2,0x104($sp) -/* f0255e0: 8e04001c */ lw $a0,0x1c($s0) -/* f0255e4: 0fc1a451 */ jal func0f069144 -/* f0255e8: 9606018a */ lhu $a2,0x18a($s0) -/* f0255ec: 9219032e */ lbu $t9,0x32e($s0) -/* f0255f0: 3328ffdf */ andi $t0,$t9,0xffdf -/* f0255f4: a208032e */ sb $t0,0x32e($s0) -/* f0255f8: 8faa0104 */ lw $t2,0x104($sp) -.L0f0255fc: -/* f0255fc: 8fa900fc */ lw $t1,0xfc($sp) -/* f025600: 51400223 */ beqzl $t2,.L0f025e90 -/* f025604: 8fa20124 */ lw $v0,0x124($sp) -/* f025608: 19200220 */ blez $t1,.L0f025e8c -/* f02560c: 27ab00a0 */ addiu $t3,$sp,0xa0 -/* f025610: 3c0c8006 */ lui $t4,%hi(var80062a4c) -/* f025614: 258c2a4c */ addiu $t4,$t4,%lo(var80062a4c) -/* f025618: 258e003c */ addiu $t6,$t4,0x3c -.L0f02561c: -/* f02561c: 8d810000 */ lw $at,0x0($t4) -/* f025620: 258c000c */ addiu $t4,$t4,0xc -/* f025624: 256b000c */ addiu $t3,$t3,0xc -/* f025628: ad61fff4 */ sw $at,-0xc($t3) -/* f02562c: 8d81fff8 */ lw $at,-0x8($t4) -/* f025630: ad61fff8 */ sw $at,-0x8($t3) -/* f025634: 8d81fffc */ lw $at,-0x4($t4) -/* f025638: 158efff8 */ bne $t4,$t6,.L0f02561c -/* f02563c: ad61fffc */ sw $at,-0x4($t3) -/* f025640: 8d810000 */ lw $at,0x0($t4) -/* f025644: ad610000 */ sw $at,0x0($t3) -/* f025648: 8faf0128 */ lw $t7,0x128($sp) -/* f02564c: 51e0000f */ beqzl $t7,.L0f02568c -/* f025650: 8fa40120 */ lw $a0,0x120($sp) -/* f025654: 921802e1 */ lbu $t8,0x2e1($s0) -/* f025658: 0018c842 */ srl $t9,$t8,0x1 -/* f02565c: 5b20000b */ blezl $t9,.L0f02568c -/* f025660: 8fa40120 */ lw $a0,0x120($sp) -/* f025664: 960802e0 */ lhu $t0,0x2e0($s0) -/* f025668: 310a0001 */ andi $t2,$t0,0x1 -/* f02566c: 55400007 */ bnezl $t2,.L0f02568c -/* f025670: 8fa40120 */ lw $a0,0x120($sp) -/* f025674: 8e05001c */ lw $a1,0x1c($s0) -/* f025678: 8fa40124 */ lw $a0,0x124($sp) -/* f02567c: 0fc0af7e */ jal func0f02bdf8 -/* f025680: 00a03025 */ or $a2,$a1,$zero -/* f025684: afa20124 */ sw $v0,0x124($sp) -/* f025688: 8fa40120 */ lw $a0,0x120($sp) -.L0f02568c: -/* f02568c: 27a50098 */ addiu $a1,$sp,0x98 -/* f025690: 0fc2396a */ jal func0f08e5a8 -/* f025694: 24840028 */ addiu $a0,$a0,0x28 -/* f025698: 1840000d */ blez $v0,.L0f0256d0 -/* f02569c: 00000000 */ nop -/* f0256a0: 8e090018 */ lw $t1,0x18($s0) -/* f0256a4: 8fa40124 */ lw $a0,0x124($sp) -/* f0256a8: 87a50098 */ lh $a1,0x98($sp) -/* f0256ac: 00096a00 */ sll $t5,$t1,0x8 -/* f0256b0: 05a00007 */ bltz $t5,.L0f0256d0 -/* f0256b4: 87a6009a */ lh $a2,0x9a($sp) -/* f0256b8: 87ae009e */ lh $t6,0x9e($sp) -/* f0256bc: 87a7009c */ lh $a3,0x9c($sp) -/* f0256c0: 0fc57306 */ jal currentPlayerSetScissor -/* f0256c4: afae0010 */ sw $t6,0x10($sp) -/* f0256c8: 10000004 */ b .L0f0256dc -/* f0256cc: 8fac0100 */ lw $t4,0x100($sp) -.L0f0256d0: -/* f0256d0: 0fc572dd */ jal func0f15cb74 -/* f0256d4: 8fa40124 */ lw $a0,0x124($sp) -/* f0256d8: 8fac0100 */ lw $t4,0x100($sp) -.L0f0256dc: -/* f0256dc: 3c03800a */ lui $v1,%hi(g_Vars+0x284) -/* f0256e0: 8c63a244 */ lw $v1,%lo(g_Vars+0x284)($v1) -/* f0256e4: 240b0001 */ addiu $t3,$zero,0x1 -/* f0256e8: afab00a4 */ sw $t3,0xa4($sp) -/* f0256ec: afa200ac */ sw $v0,0xac($sp) -/* f0256f0: afac00a8 */ sw $t4,0xa8($sp) -/* f0256f4: 8c6f00d8 */ lw $t7,0xd8($v1) -/* f0256f8: 15e00019 */ bnez $t7,.L0f025760 -/* f0256fc: 3c188007 */ lui $t8,%hi(var80070764) -/* f025700: 8f180764 */ lw $t8,%lo(var80070764)($t8) -/* f025704: 57000017 */ bnezl $t8,.L0f025764 -/* f025708: 920b00f8 */ lbu $t3,0xf8($s0) -/* f02570c: 8c620480 */ lw $v0,0x480($v1) -/* f025710: 50400007 */ beqzl $v0,.L0f025730 -/* f025714: 8c6a1c54 */ lw $t2,0x1c54($v1) -/* f025718: 50400012 */ beqzl $v0,.L0f025764 -/* f02571c: 920b00f8 */ lbu $t3,0xf8($s0) -/* f025720: 80590037 */ lb $t9,0x37($v0) -/* f025724: 5720000f */ bnezl $t9,.L0f025764 -/* f025728: 920b00f8 */ lbu $t3,0xf8($s0) -/* f02572c: 8c6a1c54 */ lw $t2,0x1c54($v1) -.L0f025730: -/* f025730: 8c6800c4 */ lw $t0,0xc4($v1) -/* f025734: 240c00ff */ addiu $t4,$zero,0xff -/* f025738: 01404827 */ nor $t1,$t2,$zero -/* f02573c: 01096824 */ and $t5,$t0,$t1 -/* f025740: 31ae0008 */ andi $t6,$t5,0x8 -/* f025744: 11c00006 */ beqz $t6,.L0f025760 -/* f025748: 24040080 */ addiu $a0,$zero,0x80 -/* f02574c: afac0088 */ sw $t4,0x88($sp) -/* f025750: afa0008c */ sw $zero,0x8c($sp) -/* f025754: afa00090 */ sw $zero,0x90($sp) -/* f025758: 10000009 */ b .L0f025780 -/* f02575c: afa40094 */ sw $a0,0x94($sp) -.L0f025760: -/* f025760: 920b00f8 */ lbu $t3,0xf8($s0) -.L0f025764: -/* f025764: afab0088 */ sw $t3,0x88($sp) -/* f025768: 920f00f9 */ lbu $t7,0xf9($s0) -/* f02576c: afaf008c */ sw $t7,0x8c($sp) -/* f025770: 921800fa */ lbu $t8,0xfa($s0) -/* f025774: afb80090 */ sw $t8,0x90($sp) -/* f025778: 921900fb */ lbu $t9,0xfb($s0) -/* f02577c: afb90094 */ sw $t9,0x94($sp) -.L0f025780: -/* f025780: 3c0a800a */ lui $t2,%hi(g_Vars+0x318) -/* f025784: 8d4aa2d8 */ lw $t2,%lo(g_Vars+0x318)($t2) -/* f025788: 51400006 */ beqzl $t2,.L0f0257a4 -/* f02578c: 93a800eb */ lbu $t0,0xeb($sp) -/* f025790: 8fa40120 */ lw $a0,0x120($sp) -/* f025794: 0fc61788 */ jal func0f185e20 -/* f025798: 27a50088 */ addiu $a1,$sp,0x88 -/* f02579c: a3a200eb */ sb $v0,0xeb($sp) -/* f0257a0: 93a800eb */ lbu $t0,0xeb($sp) -.L0f0257a4: -/* f0257a4: 5500000e */ bnezl $t0,.L0f0257e0 -/* f0257a8: 27a40088 */ addiu $a0,$sp,0x88 -/* f0257ac: 8fa40120 */ lw $a0,0x120($sp) -/* f0257b0: 0fc1a3f2 */ jal func0f068fc8 -/* f0257b4: 24050001 */ addiu $a1,$zero,0x1 -/* f0257b8: 8fa40094 */ lw $a0,0x94($sp) -/* f0257bc: 00822023 */ subu $a0,$a0,$v0 -/* f0257c0: 28810100 */ slti $at,$a0,0x100 -/* f0257c4: 14200002 */ bnez $at,.L0f0257d0 -/* f0257c8: 00000000 */ nop -/* f0257cc: 240400ff */ addiu $a0,$zero,0xff -.L0f0257d0: -/* f0257d0: 04810002 */ bgez $a0,.L0f0257dc -/* f0257d4: afa40094 */ sw $a0,0x94($sp) -/* f0257d8: afa00094 */ sw $zero,0x94($sp) -.L0f0257dc: -/* f0257dc: 27a40088 */ addiu $a0,$sp,0x88 -.L0f0257e0: -/* f0257e0: 8fa50104 */ lw $a1,0x104($sp) -/* f0257e4: 0fc1a5d4 */ jal func0f069750 -/* f0257e8: 27a60108 */ addiu $a2,$sp,0x108 -/* f0257ec: 3c03800a */ lui $v1,%hi(g_Vars+0x284) -/* f0257f0: 8c63a244 */ lw $v1,%lo(g_Vars+0x284)($v1) -/* f0257f4: 3c0d8007 */ lui $t5,%hi(var80070764) -/* f0257f8: 8c6900d8 */ lw $t1,0xd8($v1) -/* f0257fc: 5520001c */ bnezl $t1,.L0f025870 -/* f025800: 946a0010 */ lhu $t2,0x10($v1) -/* f025804: 8dad0764 */ lw $t5,%lo(var80070764)($t5) -/* f025808: 55a00019 */ bnezl $t5,.L0f025870 -/* f02580c: 946a0010 */ lhu $t2,0x10($v1) -/* f025810: 8c620480 */ lw $v0,0x480($v1) -/* f025814: 50400007 */ beqzl $v0,.L0f025834 -/* f025818: 8c6b1c54 */ lw $t3,0x1c54($v1) -/* f02581c: 50400014 */ beqzl $v0,.L0f025870 -/* f025820: 946a0010 */ lhu $t2,0x10($v1) -/* f025824: 804e0037 */ lb $t6,0x37($v0) -/* f025828: 55c00011 */ bnezl $t6,.L0f025870 -/* f02582c: 946a0010 */ lhu $t2,0x10($v1) -/* f025830: 8c6b1c54 */ lw $t3,0x1c54($v1) -.L0f025834: -/* f025834: 8c6c00c4 */ lw $t4,0xc4($v1) -/* f025838: 3c02800a */ lui $v0,%hi(var8009caec+0x3) -/* f02583c: 01607827 */ nor $t7,$t3,$zero -/* f025840: 018fc024 */ and $t8,$t4,$t7 -/* f025844: 33190001 */ andi $t9,$t8,0x1 -/* f025848: 53200009 */ beqzl $t9,.L0f025870 -/* f02584c: 946a0010 */ lhu $t2,0x10($v1) -/* f025850: 9042caef */ lbu $v0,%lo(var8009caec+0x3)($v0) -/* f025854: 3c04800a */ lui $a0,%hi(var8009caf0) -/* f025858: 9084caf0 */ lbu $a0,%lo(var8009caf0)($a0) -/* f02585c: afa20088 */ sw $v0,0x88($sp) -/* f025860: afa2008c */ sw $v0,0x8c($sp) -/* f025864: afa20090 */ sw $v0,0x90($sp) -/* f025868: afa40094 */ sw $a0,0x94($sp) -/* f02586c: 946a0010 */ lhu $t2,0x10($v1) -.L0f025870: -/* f025870: 24010001 */ addiu $at,$zero,0x1 -/* f025874: 3c028006 */ lui $v0,%hi(var80062a48) -/* f025878: 1541001e */ bne $t2,$at,.L0f0258f4 -/* f02587c: 24422a48 */ addiu $v0,$v0,%lo(var80062a48) -/* f025880: 3c01437f */ lui $at,0x437f -/* f025884: 44810000 */ mtc1 $at,$f0 -/* f025888: c7b000f0 */ lwc1 $f16,0xf0($sp) -/* f02588c: 906d0270 */ lbu $t5,0x270($v1) -/* f025890: 3c013f80 */ lui $at,0x3f80 -/* f025894: 46008482 */ mul.s $f18,$f16,$f0 -/* f025898: 000d7080 */ sll $t6,$t5,0x2 -/* f02589c: 03ae5821 */ addu $t3,$sp,$t6 -/* f0258a0: 44815000 */ mtc1 $at,$f10 -/* f0258a4: 240e00ff */ addiu $t6,$zero,0xff -/* f0258a8: 4600910d */ trunc.w.s $f4,$f18 -/* f0258ac: 44092000 */ mfc1 $t1,$f4 -/* f0258b0: 00000000 */ nop -/* f0258b4: ad690088 */ sw $t1,0x88($t3) -/* f0258b8: c7a800f0 */ lwc1 $f8,0xf0($sp) -/* f0258bc: 90780271 */ lbu $t8,0x271($v1) -/* f0258c0: 46085181 */ sub.s $f6,$f10,$f8 -/* f0258c4: 0018c880 */ sll $t9,$t8,0x2 -/* f0258c8: 03b95021 */ addu $t2,$sp,$t9 -/* f0258cc: 46003402 */ mul.s $f16,$f6,$f0 -/* f0258d0: 4600848d */ trunc.w.s $f18,$f16 -/* f0258d4: 440f9000 */ mfc1 $t7,$f18 -/* f0258d8: 00000000 */ nop -/* f0258dc: ad4f0088 */ sw $t7,0x88($t2) -/* f0258e0: 90680272 */ lbu $t0,0x272($v1) -/* f0258e4: 00086880 */ sll $t5,$t0,0x2 -/* f0258e8: 03ad4821 */ addu $t1,$sp,$t5 -/* f0258ec: ad200088 */ sw $zero,0x88($t1) -/* f0258f0: afae0094 */ sw $t6,0x94($sp) -.L0f0258f4: -/* f0258f4: 904b0002 */ lbu $t3,0x2($v0) -/* f0258f8: 90580000 */ lbu $t8,0x0($v0) -/* f0258fc: 904a0001 */ lbu $t2,0x1($v0) -/* f025900: 000b6200 */ sll $t4,$t3,0x8 -/* f025904: 00187e00 */ sll $t7,$t8,0x18 -/* f025908: 8fad0088 */ lw $t5,0x88($sp) -/* f02590c: 018fc825 */ or $t9,$t4,$t7 -/* f025910: 8fa40094 */ lw $a0,0x94($sp) -/* f025914: 8fab008c */ lw $t3,0x8c($sp) -/* f025918: 000a4400 */ sll $t0,$t2,0x10 -/* f02591c: 8faf0090 */ lw $t7,0x90($sp) -/* f025920: 03281825 */ or $v1,$t9,$t0 -/* f025924: 8fa800fc */ lw $t0,0xfc($sp) -/* f025928: 000d4e00 */ sll $t1,$t5,0x18 -/* f02592c: 00897025 */ or $t6,$a0,$t1 -/* f025930: 000bc400 */ sll $t8,$t3,0x10 -/* f025934: 01d86025 */ or $t4,$t6,$t8 -/* f025938: 000f5200 */ sll $t2,$t7,0x8 -/* f02593c: 018ac825 */ or $t9,$t4,$t2 -/* f025940: 290100ff */ slti $at,$t0,0xff -/* f025944: 10200007 */ beqz $at,.L0f025964 -/* f025948: afb900d8 */ sw $t9,0xd8($sp) -/* f02594c: 93a900ff */ lbu $t1,0xff($sp) -/* f025950: 240d0008 */ addiu $t5,$zero,0x8 -/* f025954: afad00d0 */ sw $t5,0xd0($sp) -/* f025958: 00691825 */ or $v1,$v1,$t1 -/* f02595c: 10000004 */ b .L0f025970 -/* f025960: afa300d4 */ sw $v1,0xd4($sp) -.L0f025964: -/* f025964: 240b0007 */ addiu $t3,$zero,0x7 -/* f025968: afa300d4 */ sw $v1,0xd4($sp) -/* f02596c: afab00d0 */ sw $t3,0xd0($sp) -.L0f025970: -/* f025970: 8fae0118 */ lw $t6,0x118($sp) -/* f025974: 3c188008 */ lui $t8,%hi(stagethinglist_22eb8) -/* f025978: 2718ce98 */ addiu $t8,$t8,%lo(stagethinglist_22eb8) -/* f02597c: 8dc40008 */ lw $a0,0x8($t6) -/* f025980: 8c8f0004 */ lw $t7,0x4($a0) -/* f025984: 570f0020 */ bnel $t8,$t7,.L0f025a08 -/* f025988: 82020006 */ lb $v0,0x6($s0) -/* f02598c: 0c006a47 */ jal modelGetPart -/* f025990: 24050004 */ addiu $a1,$zero,0x4 -/* f025994: 8fac0118 */ lw $t4,0x118($sp) -/* f025998: 24050005 */ addiu $a1,$zero,0x5 -/* f02599c: 8d840008 */ lw $a0,0x8($t4) -/* f0259a0: 0c006a47 */ jal modelGetPart -/* f0259a4: afa20080 */ sw $v0,0x80($sp) -/* f0259a8: 8fa60080 */ lw $a2,0x80($sp) -/* f0259ac: 50c00016 */ beqzl $a2,.L0f025a08 -/* f0259b0: 82020006 */ lb $v0,0x6($s0) -/* f0259b4: 10400013 */ beqz $v0,.L0f025a04 -/* f0259b8: 8fa40118 */ lw $a0,0x118($sp) -/* f0259bc: 00c02825 */ or $a1,$a2,$zero -/* f0259c0: 0c006a87 */ jal modelGetNodeData -/* f0259c4: afa2007c */ sw $v0,0x7c($sp) -/* f0259c8: 8fa5007c */ lw $a1,0x7c($sp) -/* f0259cc: afa20078 */ sw $v0,0x78($sp) -/* f0259d0: 0c006a87 */ jal modelGetNodeData -/* f0259d4: 8fa40118 */ lw $a0,0x118($sp) -/* f0259d8: 82040007 */ lb $a0,0x7($s0) -/* f0259dc: 38830004 */ xori $v1,$a0,0x4 -/* f0259e0: 2c630001 */ sltiu $v1,$v1,0x1 -/* f0259e4: 54600004 */ bnezl $v1,.L0f0259f8 -/* f0259e8: ac430000 */ sw $v1,0x0($v0) -/* f0259ec: 38830005 */ xori $v1,$a0,0x5 -/* f0259f0: 2c630001 */ sltiu $v1,$v1,0x1 -/* f0259f4: ac430000 */ sw $v1,0x0($v0) -.L0f0259f8: -/* f0259f8: 8fb90078 */ lw $t9,0x78($sp) -/* f0259fc: 2c6a0001 */ sltiu $t2,$v1,0x1 -/* f025a00: af2a0000 */ sw $t2,0x0($t9) -.L0f025a04: -/* f025a04: 82020006 */ lb $v0,0x6($s0) -.L0f025a08: -/* f025a08: 2401000f */ addiu $at,$zero,0xf -/* f025a0c: 8fa80118 */ lw $t0,0x118($sp) -/* f025a10: 10410007 */ beq $v0,$at,.L0f025a30 -/* f025a14: 24010005 */ addiu $at,$zero,0x5 -/* f025a18: 10410005 */ beq $v0,$at,.L0f025a30 -/* f025a1c: 24010029 */ addiu $at,$zero,0x29 -/* f025a20: 10410003 */ beq $v0,$at,.L0f025a30 -/* f025a24: 2401003a */ addiu $at,$zero,0x3a -/* f025a28: 54410035 */ bnel $v0,$at,.L0f025b00 -/* f025a2c: 920c02fe */ lbu $t4,0x2fe($s0) -.L0f025a30: -/* f025a30: 8d040008 */ lw $a0,0x8($t0) -/* f025a34: 3c0d8008 */ lui $t5,%hi(stagethinglist_22e60) -/* f025a38: 25adce40 */ addiu $t5,$t5,%lo(stagethinglist_22e60) -/* f025a3c: 8c890004 */ lw $t1,0x4($a0) -/* f025a40: 55a9002f */ bnel $t5,$t1,.L0f025b00 -/* f025a44: 920c02fe */ lbu $t4,0x2fe($s0) -/* f025a48: 0c006a47 */ jal modelGetPart -/* f025a4c: 24050004 */ addiu $a1,$zero,0x4 -/* f025a50: 1040002a */ beqz $v0,.L0f025afc -/* f025a54: 00402825 */ or $a1,$v0,$zero -/* f025a58: 944b0000 */ lhu $t3,0x0($v0) -/* f025a5c: 24010017 */ addiu $at,$zero,0x17 -/* f025a60: 55610027 */ bnel $t3,$at,.L0f025b00 -/* f025a64: 920c02fe */ lbu $t4,0x2fe($s0) -/* f025a68: 0c006a87 */ jal modelGetNodeData -/* f025a6c: 8fa40118 */ lw $a0,0x118($sp) -/* f025a70: 8c4e0000 */ lw $t6,0x0($v0) -/* f025a74: 24050002 */ addiu $a1,$zero,0x2 -/* f025a78: 51c00021 */ beqzl $t6,.L0f025b00 -/* f025a7c: 920c02fe */ lbu $t4,0x2fe($s0) -/* f025a80: 8c440000 */ lw $a0,0x0($v0) -/* f025a84: 0c006a47 */ jal modelGetPart -/* f025a88: afa2006c */ sw $v0,0x6c($sp) -/* f025a8c: 8fa3006c */ lw $v1,0x6c($sp) -/* f025a90: 24050003 */ addiu $a1,$zero,0x3 -/* f025a94: 8c640000 */ lw $a0,0x0($v1) -/* f025a98: 0c006a47 */ jal modelGetPart -/* f025a9c: afa20068 */ sw $v0,0x68($sp) -/* f025aa0: 8fa60068 */ lw $a2,0x68($sp) -/* f025aa4: 50c00016 */ beqzl $a2,.L0f025b00 -/* f025aa8: 920c02fe */ lbu $t4,0x2fe($s0) -/* f025aac: 10400013 */ beqz $v0,.L0f025afc -/* f025ab0: 8fa40118 */ lw $a0,0x118($sp) -/* f025ab4: 00c02825 */ or $a1,$a2,$zero -/* f025ab8: 0c006a87 */ jal modelGetNodeData -/* f025abc: afa20064 */ sw $v0,0x64($sp) -/* f025ac0: 8fa50064 */ lw $a1,0x64($sp) -/* f025ac4: afa20060 */ sw $v0,0x60($sp) -/* f025ac8: 0c006a87 */ jal modelGetNodeData -/* f025acc: 8fa40118 */ lw $a0,0x118($sp) -/* f025ad0: 82040007 */ lb $a0,0x7($s0) -/* f025ad4: 38830004 */ xori $v1,$a0,0x4 -/* f025ad8: 2c630001 */ sltiu $v1,$v1,0x1 -/* f025adc: 54600004 */ bnezl $v1,.L0f025af0 -/* f025ae0: ac430000 */ sw $v1,0x0($v0) -/* f025ae4: 38830005 */ xori $v1,$a0,0x5 -/* f025ae8: 2c630001 */ sltiu $v1,$v1,0x1 -/* f025aec: ac430000 */ sw $v1,0x0($v0) -.L0f025af0: -/* f025af0: 8faf0060 */ lw $t7,0x60($sp) -/* f025af4: 2c780001 */ sltiu $t8,$v1,0x1 -/* f025af8: adf80000 */ sw $t8,0x0($t7) -.L0f025afc: -/* f025afc: 920c02fe */ lbu $t4,0x2fe($s0) -.L0f025b00: -/* f025b00: 24010002 */ addiu $at,$zero,0x2 -/* f025b04: 15810009 */ bne $t4,$at,.L0f025b2c -/* f025b08: 00000000 */ nop -/* f025b0c: 96050362 */ lhu $a1,0x362($s0) -/* f025b10: 92060362 */ lbu $a2,0x362($s0) -/* f025b14: 02002025 */ or $a0,$s0,$zero -/* f025b18: 00055302 */ srl $t2,$a1,0xc -/* f025b1c: 30d9000f */ andi $t9,$a2,0xf -/* f025b20: 03203025 */ or $a2,$t9,$zero -/* f025b24: 0fc0b32d */ jal func0f02ccb4 -/* f025b28: 01402825 */ or $a1,$t2,$zero -.L0f025b2c: -/* f025b2c: 3c02800a */ lui $v0,%hi(g_Vars+0x288) -/* f025b30: 8c42a248 */ lw $v0,%lo(g_Vars+0x288)($v0) -/* f025b34: 02002025 */ or $a0,$s0,$zero -/* f025b38: 8c480034 */ lw $t0,0x34($v0) -/* f025b3c: 250d0001 */ addiu $t5,$t0,0x1 -/* f025b40: 0fc091ce */ jal func0f024738 -/* f025b44: ac4d0034 */ sw $t5,0x34($v0) -/* f025b48: 10400005 */ beqz $v0,.L0f025b60 -/* f025b4c: 27a400a0 */ addiu $a0,$sp,0xa0 -/* f025b50: 3c097f02 */ lui $t1,%hi(func0f024b18) -/* f025b54: 25294b18 */ addiu $t1,$t1,%lo(func0f024b18) -/* f025b58: 3c018006 */ lui $at,%hi(var8005efc4) -/* f025b5c: ac29efc4 */ sw $t1,%lo(var8005efc4)($at) -.L0f025b60: -/* f025b60: 0c0087bd */ jal func00021ef4 -/* f025b64: 8fa50118 */ lw $a1,0x118($sp) -/* f025b68: 8fab0120 */ lw $t3,0x120($sp) -/* f025b6c: 8d64001c */ lw $a0,0x1c($t3) -/* f025b70: 10800009 */ beqz $a0,.L0f025b98 -/* f025b74: 27a500a0 */ addiu $a1,$sp,0xa0 -.L0f025b78: -/* f025b78: 8fa60128 */ lw $a2,0x128($sp) -/* f025b7c: 02003825 */ or $a3,$s0,$zero -/* f025b80: 0fc0941d */ jal func0f025074 -/* f025b84: afa400f4 */ sw $a0,0xf4($sp) -/* f025b88: 8fa400f4 */ lw $a0,0xf4($sp) -/* f025b8c: 8c840020 */ lw $a0,0x20($a0) -/* f025b90: 5480fff9 */ bnezl $a0,.L0f025b78 -/* f025b94: 27a500a0 */ addiu $a1,$sp,0xa0 -.L0f025b98: -/* f025b98: 8fb80128 */ lw $t8,0x128($sp) -/* f025b9c: 8fae00ac */ lw $t6,0xac($sp) -/* f025ba0: 3c018006 */ lui $at,%hi(var8005efc4) -/* f025ba4: ac20efc4 */ sw $zero,%lo(var8005efc4)($at) -/* f025ba8: 130000b8 */ beqz $t8,.L0f025e8c -/* f025bac: afae0124 */ sw $t6,0x124($sp) -/* f025bb0: 8e0f031c */ lw $t7,0x31c($s0) -/* f025bb4: 55e0008e */ bnezl $t7,.L0f025df0 -/* f025bb8: 8fab0118 */ lw $t3,0x118($sp) -/* f025bbc: 820c0007 */ lb $t4,0x7($s0) -/* f025bc0: 24010023 */ addiu $at,$zero,0x23 -/* f025bc4: 5181008a */ beql $t4,$at,.L0f025df0 -/* f025bc8: 8fab0118 */ lw $t3,0x118($sp) -/* f025bcc: c60000b8 */ lwc1 $f0,0xb8($s0) -/* f025bd0: 44802000 */ mtc1 $zero,$f4 -/* f025bd4: 00001825 */ or $v1,$zero,$zero -/* f025bd8: 46002032 */ c.eq.s $f4,$f0 -/* f025bdc: 00000000 */ nop -/* f025be0: 45020003 */ bc1fl .L0f025bf0 -/* f025be4: 44834000 */ mtc1 $v1,$f8 -/* f025be8: 24030001 */ addiu $v1,$zero,0x1 -/* f025bec: 44834000 */ mtc1 $v1,$f8 -.L0f025bf0: -/* f025bf0: 3c01c780 */ lui $at,0xc780 -/* f025bf4: 44815000 */ mtc1 $at,$f10 -/* f025bf8: 468041a0 */ cvt.s.w $f6,$f8 -/* f025bfc: 3c014780 */ lui $at,0x4780 -/* f025c00: 4606503c */ c.lt.s $f10,$f6 -/* f025c04: 00000000 */ nop -/* f025c08: 45020079 */ bc1fl .L0f025df0 -/* f025c0c: 8fab0118 */ lw $t3,0x118($sp) -/* f025c10: 44818000 */ mtc1 $at,$f16 -/* f025c14: 8faa0120 */ lw $t2,0x120($sp) -/* f025c18: 4610003c */ c.lt.s $f0,$f16 -/* f025c1c: 00000000 */ nop -/* f025c20: 45020073 */ bc1fl .L0f025df0 -/* f025c24: 8fab0118 */ lw $t3,0x118($sp) -/* f025c28: c552000c */ lwc1 $f18,0xc($t2) -/* f025c2c: 3c0143c8 */ lui $at,0x43c8 -/* f025c30: 44817000 */ mtc1 $at,$f14 -/* f025c34: 46009301 */ sub.s $f12,$f18,$f0 -/* f025c38: 3c19800a */ lui $t9,%hi(g_Vars+0x284) -/* f025c3c: 460e603e */ c.le.s $f12,$f14 -/* f025c40: 00000000 */ nop -/* f025c44: 4502006a */ bc1fl .L0f025df0 -/* f025c48: 8fab0118 */ lw $t3,0x118($sp) -/* f025c4c: 8f39a244 */ lw $t9,%lo(g_Vars+0x284)($t9) -/* f025c50: 24010001 */ addiu $at,$zero,0x1 -/* f025c54: 2404000b */ addiu $a0,$zero,0xb -/* f025c58: 97280010 */ lhu $t0,0x10($t9) -/* f025c5c: 51010064 */ beql $t0,$at,.L0f025df0 -/* f025c60: 8fab0118 */ lw $t3,0x118($sp) -/* f025c64: 86020010 */ lh $v0,0x10($s0) -/* f025c68: 2401005c */ addiu $at,$zero,0x5c -/* f025c6c: 8fab0104 */ lw $t3,0x104($sp) -/* f025c70: 10410002 */ beq $v0,$at,.L0f025c7c -/* f025c74: 24010093 */ addiu $at,$zero,0x93 -/* f025c78: 14410004 */ bne $v0,$at,.L0f025c8c -.L0f025c7c: -/* f025c7c: 3c0142a0 */ lui $at,0x42a0 -/* f025c80: 44811000 */ mtc1 $at,$f2 -/* f025c84: 1000000b */ b .L0f025cb4 -/* f025c88: 8e0d0018 */ lw $t5,0x18($s0) -.L0f025c8c: -/* f025c8c: 2401006c */ addiu $at,$zero,0x6c -/* f025c90: 14410004 */ bne $v0,$at,.L0f025ca4 -/* f025c94: 3c014140 */ lui $at,0x4140 -/* f025c98: 44811000 */ mtc1 $at,$f2 -/* f025c9c: 10000005 */ b .L0f025cb4 -/* f025ca0: 8e0d0018 */ lw $t5,0x18($s0) -.L0f025ca4: -/* f025ca4: 3c01420c */ lui $at,0x420c -/* f025ca8: 44811000 */ mtc1 $at,$f2 -/* f025cac: 00000000 */ nop -/* f025cb0: 8e0d0018 */ lw $t5,0x18($s0) -.L0f025cb4: -/* f025cb4: 24010001 */ addiu $at,$zero,0x1 -/* f025cb8: 31a92000 */ andi $t1,$t5,0x2000 -/* f025cbc: 11200003 */ beqz $t1,.L0f025ccc -/* f025cc0: 00000000 */ nop -/* f025cc4: 1000001b */ b .L0f025d34 -/* f025cc8: 00001825 */ or $v1,$zero,$zero -.L0f025ccc: -/* f025ccc: 15610013 */ bne $t3,$at,.L0f025d1c -/* f025cd0: 8fa300fc */ lw $v1,0xfc($sp) -/* f025cd4: 8fae00fc */ lw $t6,0xfc($sp) -/* f025cd8: 3c013f80 */ lui $at,0x3f80 -/* f025cdc: 44812000 */ mtc1 $at,$f4 -/* f025ce0: 000ec080 */ sll $t8,$t6,0x2 -/* f025ce4: 030ec023 */ subu $t8,$t8,$t6 -/* f025ce8: 0018c0c0 */ sll $t8,$t8,0x3 -/* f025cec: 030ec021 */ addu $t8,$t8,$t6 -/* f025cf0: 0018c080 */ sll $t8,$t8,0x2 -/* f025cf4: 00187a03 */ sra $t7,$t8,0x8 -/* f025cf8: 448f3000 */ mtc1 $t7,$f6 -/* f025cfc: c7a80114 */ lwc1 $f8,0x114($sp) -/* f025d00: 46803420 */ cvt.s.w $f16,$f6 -/* f025d04: 46082281 */ sub.s $f10,$f4,$f8 -/* f025d08: 46105482 */ mul.s $f18,$f10,$f16 -/* f025d0c: 4600910d */ trunc.w.s $f4,$f18 -/* f025d10: 44032000 */ mfc1 $v1,$f4 -/* f025d14: 10000008 */ b .L0f025d38 -/* f025d18: 3c014316 */ lui $at,0x4316 -.L0f025d1c: -/* f025d1c: 00035080 */ sll $t2,$v1,0x2 -/* f025d20: 01435023 */ subu $t2,$t2,$v1 -/* f025d24: 000a50c0 */ sll $t2,$t2,0x3 -/* f025d28: 01435021 */ addu $t2,$t2,$v1 -/* f025d2c: 000a5080 */ sll $t2,$t2,0x2 -/* f025d30: 000a1a03 */ sra $v1,$t2,0x8 -.L0f025d34: -/* f025d34: 3c014316 */ lui $at,0x4316 -.L0f025d38: -/* f025d38: 44814000 */ mtc1 $at,$f8 -/* f025d3c: 00000000 */ nop -/* f025d40: 460c403e */ c.le.s $f8,$f12 -/* f025d44: 00000000 */ nop -/* f025d48: 4502000d */ bc1fl .L0f025d80 -/* f025d4c: afa30058 */ sw $v1,0x58($sp) -/* f025d50: 44833000 */ mtc1 $v1,$f6 -/* f025d54: 460c7401 */ sub.s $f16,$f14,$f12 -/* f025d58: 3c017f1b */ lui $at,%hi(var7f1a88fc) -/* f025d5c: c42488fc */ lwc1 $f4,%lo(var7f1a88fc)($at) -/* f025d60: 468032a0 */ cvt.s.w $f10,$f6 -/* f025d64: 46105482 */ mul.s $f18,$f10,$f16 -/* f025d68: 00000000 */ nop -/* f025d6c: 46049202 */ mul.s $f8,$f18,$f4 -/* f025d70: 4600418d */ trunc.w.s $f6,$f8 -/* f025d74: 44033000 */ mfc1 $v1,$f6 -/* f025d78: 00000000 */ nop -/* f025d7c: afa30058 */ sw $v1,0x58($sp) -.L0f025d80: -/* f025d80: 0fc41b99 */ jal cheatIsActive -/* f025d84: e7a20050 */ swc1 $f2,0x50($sp) -/* f025d88: 8fa30058 */ lw $v1,0x58($sp) -/* f025d8c: 10400005 */ beqz $v0,.L0f025da4 -/* f025d90: c7a20050 */ lwc1 $f2,0x50($sp) -/* f025d94: 3c017f1b */ lui $at,%hi(var7f1a8900) -/* f025d98: c42a8900 */ lwc1 $f10,%lo(var7f1a8900)($at) -/* f025d9c: 460a1082 */ mul.s $f2,$f2,$f10 -/* f025da0: 00000000 */ nop -.L0f025da4: -/* f025da4: 02002025 */ or $a0,$s0,$zero -/* f025da8: afa30058 */ sw $v1,0x58($sp) -/* f025dac: 0fc0f917 */ jal chrGetInverseTheta -/* f025db0: e7a20050 */ swc1 $f2,0x50($sp) -/* f025db4: 8fad0120 */ lw $t5,0x120($sp) -/* f025db8: 8fa30058 */ lw $v1,0x58($sp) -/* f025dbc: c7a20050 */ lwc1 $f2,0x50($sp) -/* f025dc0: 8e0600b8 */ lw $a2,0xb8($s0) -/* f025dc4: 2401ff00 */ addiu $at,$zero,-256 -/* f025dc8: 8da50008 */ lw $a1,0x8($t5) -/* f025dcc: 8da70010 */ lw $a3,0x10($t5) -/* f025dd0: 00614825 */ or $t1,$v1,$at -/* f025dd4: afa90018 */ sw $t1,0x18($sp) -/* f025dd8: e7a00010 */ swc1 $f0,0x10($sp) -/* f025ddc: 8fa40124 */ lw $a0,0x124($sp) -/* f025de0: 0fc203e3 */ jal func0f080f8c -/* f025de4: e7a20014 */ swc1 $f2,0x14($sp) -/* f025de8: afa20124 */ sw $v0,0x124($sp) -/* f025dec: 8fab0118 */ lw $t3,0x118($sp) -.L0f025df0: -/* f025df0: 8d6e0008 */ lw $t6,0x8($t3) -/* f025df4: 8d64000c */ lw $a0,0xc($t3) -/* f025df8: 0fc30cfc */ jal func0f0c33f0 -/* f025dfc: 85c5000e */ lh $a1,0xe($t6) -/* f025e00: 3c03800a */ lui $v1,%hi(g_Vars+0x284) -/* f025e04: 8c63a244 */ lw $v1,%lo(g_Vars+0x284)($v1) -/* f025e08: 3c0f8007 */ lui $t7,%hi(var80070764) -/* f025e0c: 8fa40124 */ lw $a0,0x124($sp) -/* f025e10: 8c7800d8 */ lw $t8,0xd8($v1) -/* f025e14: 02002825 */ or $a1,$s0,$zero -/* f025e18: 17000019 */ bnez $t8,.L0f025e80 -/* f025e1c: 00000000 */ nop -/* f025e20: 8def0764 */ lw $t7,%lo(var80070764)($t7) -/* f025e24: 15e00016 */ bnez $t7,.L0f025e80 -/* f025e28: 00000000 */ nop -/* f025e2c: 8c620480 */ lw $v0,0x480($v1) -/* f025e30: 50400007 */ beqzl $v0,.L0f025e50 -/* f025e34: 8c791c54 */ lw $t9,0x1c54($v1) -/* f025e38: 10400011 */ beqz $v0,.L0f025e80 -/* f025e3c: 00000000 */ nop -/* f025e40: 804c0037 */ lb $t4,0x37($v0) -/* f025e44: 1580000e */ bnez $t4,.L0f025e80 -/* f025e48: 00000000 */ nop -/* f025e4c: 8c791c54 */ lw $t9,0x1c54($v1) -.L0f025e50: -/* f025e50: 8c6a00c4 */ lw $t2,0xc4($v1) -/* f025e54: 24060080 */ addiu $a2,$zero,0x80 -/* f025e58: 03204027 */ nor $t0,$t9,$zero -/* f025e5c: 01486824 */ and $t5,$t2,$t0 -/* f025e60: 31a90008 */ andi $t1,$t5,0x8 -/* f025e64: 11200006 */ beqz $t1,.L0f025e80 -/* f025e68: 00000000 */ nop -/* f025e6c: 8fa40124 */ lw $a0,0x124($sp) -/* f025e70: 0fc0b1b8 */ jal func0f02c6e0 -/* f025e74: 02002825 */ or $a1,$s0,$zero -/* f025e78: 10000004 */ b .L0f025e8c -/* f025e7c: afa20124 */ sw $v0,0x124($sp) -.L0f025e80: -/* f025e80: 0fc0b1b8 */ jal func0f02c6e0 -/* f025e84: 8fa600fc */ lw $a2,0xfc($sp) -/* f025e88: afa20124 */ sw $v0,0x124($sp) -.L0f025e8c: -/* f025e8c: 8fa20124 */ lw $v0,0x124($sp) -.L0f025e90: -/* f025e90: 8fbf002c */ lw $ra,0x2c($sp) -/* f025e94: 8fb00028 */ lw $s0,0x28($sp) -/* f025e98: 27bd0120 */ addiu $sp,$sp,0x120 -/* f025e9c: 03e00008 */ jr $ra -/* f025ea0: 00000000 */ nop -); +Gfx *chrRender(struct prop *prop, Gfx *gdl, bool withalpha) +{ + struct chrdata *chr = prop->chr; + struct model *model = chr->model; + f32 sp108[4]; + s32 sp104; + s32 sp100; + s32 alpha; + struct eyespy *eyespy; + struct prop *child; + f32 xrayalphafrac; + u8 spec[4]; + u8 speb = 0; + + // Don't render the eyespy if we're the one controlling it + if (CHRRACE(chr) == RACE_EYESPY) { + eyespy = chrToEyespy(chr); + + if (eyespy) { + if (!eyespy->initialised) { + return gdl; + } + + if (eyespy == g_Vars.currentplayer->eyespy && eyespy->active) { + return gdl; + } + } + } + + if (chr->chrflags & CHRCFLAG_UNPLAYABLE) { + alpha = 0xff; + } else { + alpha = chr->fadealpha; + } + + if (chr->aibot && chr->aibot->unk058 > 0) { + alpha = (f32)alpha * (120 - chr->aibot->unk058) * 0.0083333337679505f; + } + + bodyGetBloodColour(chr->bodynum, spec, NULL); + func0f0246e4(spec); + alpha *= func0f08e6bc(prop, func0001af80(model)); + + if (g_Vars.currentplayer->visionmode == VISIONMODE_XRAY) { + f32 fadedist; + f32 chrdist = sqrtf((prop->pos.z - g_Vars.currentplayer->eraserpos.z) * (prop->pos.z - g_Vars.currentplayer->eraserpos.z) + + ((prop->pos.x - g_Vars.currentplayer->eraserpos.x) * (prop->pos.x - g_Vars.currentplayer->eraserpos.x) + + (prop->pos.y - g_Vars.currentplayer->eraserpos.y) * (prop->pos.y - g_Vars.currentplayer->eraserpos.y))); + + if (chrdist > g_Vars.currentplayer->eraserpropdist) { + return gdl; + } + + alpha = 128; + fadedist = g_Vars.currentplayer->eraserpropdist - 150; + + if (chrdist > fadedist) { + alpha = (1.0f - (chrdist - fadedist) / 150.0f) * 128; + } + + xrayalphafrac = chrdist / g_Vars.currentplayer->eraserpropdist; + + if (xrayalphafrac > 1.0f) { + xrayalphafrac = 1.0f; + } + } + + if (g_Vars.currentplayer->isdead + || g_InCutscene + || !EYESPYINACTIVE() + || (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_IRSCANNER) == 0) { + alpha = func0f022be4(chr) * alpha * 0.0039215688593686f; + } + + if (alpha < 0xff) { + if (!withalpha) { + return gdl; + } + + sp100 = 3; + } else { + if (!withalpha) { + sp100 = 1; + } else { + sp100 = 2; + } + } + + sp104 = func0f1667f4(prop, sp108); + + if (chr->unk32c_18) { + func0f069144(chr->prop, chr->nextcol, chr->floorcol); + chr->unk32c_18 = false; + } + + if (sp104 && alpha > 0) { + struct modelrenderdata renderdata = {0, 1, 3}; + struct screenbox screenbox; + s32 colour[4]; // rgba levels, but allowing > 256 temporarily + u32 stack; + + if (withalpha && chr->cloakfadefrac > 0 && !chr->cloakfadefinished) { + gdl = func0f02bdf8(gdl, chr->prop, chr->prop); + } + + if (func0f08e5a8(prop->rooms, &screenbox) > 0 && (chr->chrflags & CHRCFLAG_UNPLAYABLE) == 0) { + gdl = currentPlayerSetScissor(gdl, screenbox.xmin, screenbox.ymin, screenbox.xmax, screenbox.ymax); + } else { + gdl = func0f15cb74(gdl); + } + + renderdata.unk08 = sp100; + renderdata.unk04 = 1; + renderdata.gdl = gdl; + + // Configure colours for IR scanner or default + if (!g_Vars.currentplayer->isdead + && !g_InCutscene + && EYESPYINACTIVE() + && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_IRSCANNER)) { + colour[0] = 0xff; + colour[1] = 0; + colour[2] = 0; + colour[3] = 0x80; + } else { + colour[0] = chr->shadecol[0]; + colour[1] = chr->shadecol[1]; + colour[2] = chr->shadecol[2]; + colour[3] = chr->shadecol[3]; + } + + if (g_Vars.normmplayerisrunning) { + speb = func0f185e20(prop, colour); + } + + if (!speb) { + colour[3] = colour[3] - func0f068fc8(prop, true); + + if (colour[3] > 0xff) { + colour[3] = 0xff; + } + + if (colour[3] < 0) { + colour[3] = 0; + } + } + + func0f069750(colour, sp104, sp108); + + // Configure colours for night vision if in use + if (!g_Vars.currentplayer->isdead + && !g_InCutscene + && EYESPYINACTIVE() + && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_NIGHTVISION)) { + colour[0] = var8009caec[3]; + colour[1] = var8009caec[3]; + colour[2] = var8009caec[3]; + colour[3] = var8009caf0; + } + + // Configure colours for xray if in use + if (g_Vars.currentplayer->visionmode == VISIONMODE_XRAY) { + colour[g_Vars.currentplayer->epcol_0] = xrayalphafrac * 255; + colour[g_Vars.currentplayer->epcol_1] = (1 - xrayalphafrac) * 255; + colour[g_Vars.currentplayer->epcol_2] = 0; + colour[3] = 0xff; + } + + renderdata.colour34 = var80062a48[0] << 24 | var80062a48[1] << 16 | var80062a48[2] << 8; + renderdata.colour38 = colour[0] << 24 | colour[1] << 16 | colour[2] << 8 | colour[3]; + + if (alpha < 0xff) { + renderdata.unk30 = 8; + renderdata.colour34 |= (u8)alpha; + } else { + renderdata.unk30 = 7; + } + + // Set Skedar eyes open or closed? + if (model->filedata->unk04 == &stagethinglist_22eb8) { + struct modelnode *node1 = modelGetPart(model->filedata, MODELPART_04); + struct modelnode *node2 = modelGetPart(model->filedata, MODELPART_05); + + if (node1 && node2) { + struct modeldata_partid *data1 = modelGetNodeData(model, node1); + struct modeldata_partid *data2 = modelGetNodeData(model, node2); + + data2->visible.u32 = chr->actiontype == ACT_DIE || chr->actiontype == ACT_DEAD; + data1->visible.u32 = !data2->visible.u32; + } + } + + // Set Maian eyes open or closed + if (chr->headnum == HEAD_THEKING + || chr->headnum == HEAD_ELVIS + || chr->headnum == HEAD_MAIAN_S + || chr->headnum == HEAD_ELVIS_GOGS) { + if (model->filedata->unk04 == &stagethinglist_22e60) { + struct modelnode *node = modelGetPart(model->filedata, MODELPART_04); + + if (node && node->type == MODELNODETYPE_HEADSPOT) { + struct modeldata_headspot *headdata = modelGetNodeData(model, node); + + if (headdata->modelfiledata) { + struct modelnode *node1 = modelGetPart(headdata->modelfiledata, MODELPART_02); + struct modelnode *node2 = modelGetPart(headdata->modelfiledata, MODELPART_03); + + if (node1 && node2) { + struct modeldata_partid *data1 = modelGetNodeData(model, node1); + struct modeldata_partid *data2 = modelGetNodeData(model, node2); + + data2->visible.u32 = chr->actiontype == ACT_DIE || chr->actiontype == ACT_DEAD; + data1->visible.u32 = !data2->visible.u32; + } + } + } + } + } + + if (chr->race == RACE_DRCAROLL) { + func0f02ccb4(chr, chr->drcarollimage_left, chr->drcarollimage_right); + } + + g_Vars.currentplayerstats->drawplayercount++; + + if (func0f024738(chr)) { + var8005efc4 = func0f024b18; + } + + // Render the chr's model + modelRender(&renderdata, model); + + // Render attached props (eg. held guns and attached mines/knives/bolts) + child = prop->child; + + while (child) { + func0f025074(child, &renderdata, withalpha, chr); + child = child->next; + } + + gdl = renderdata.gdl; + + var8005efc4 = 0; + + // Render shadow + if (withalpha) { + if (!chr->onladder && chr->actiontype != ACT_SKJUMP) { + s32 shadowalpha = 0; + + if (chr->ground == 0) { + shadowalpha = 1; + } + + // @bug: The wrong variable is being used in the minimum bounds + // check. However, the approach to this is also flawed. The RSP + // can crash if drawing outside of its allowed range, which is + // actually -32768.99 to 32767.99. And this range is relative + // to the camera, not in world coordinates. This bad check + // doesn't cause any crashes though, because even if a chr falls + // out of the geometry they likely wouldn't be rendered due to + // not being in an active room and also being out of the draw + // distance. + if (shadowalpha > -65536.0f && chr->ground < 65536.0f) { + f32 gaptoground = prop->pos.y - chr->ground; + f32 size; // unsure if radius or diameter + + if (gaptoground <= 400 && g_Vars.currentplayer->visionmode != VISIONMODE_XRAY) { + if (chr->bodynum == BODY_SKEDAR || chr->bodynum == BODY_SKEDARKING) { + size = 80; + } else if (chr->bodynum == BODY_EYESPY) { + size = 12; + } else { + size = 35; + } + + if (chr->chrflags & CHRCFLAG_NOSHADOW) { + shadowalpha = 0; + } else if (sp104 == 1) { + shadowalpha = (1.0f - sp108[3]) * ((alpha * 100) >> 8); + } else { + shadowalpha = (s32)(alpha * 100) >> 8; + } + + if (gaptoground >= 150.0f) { + shadowalpha = shadowalpha * (400 - gaptoground) * 0.004f; + } + + if (cheatIsActive(CHEAT_SMALLCHARACTERS)) { + size *= 0.4f; + } + + gdl = gfxRenderRadialShadow(gdl, prop->pos.x, chr->ground, prop->pos.z, chrGetInverseTheta(chr), size, shadowalpha | ~0xff); + } + } + } + + func0f0c33f0(model->unk0c, model->filedata->unk0e); + + if (!g_Vars.currentplayer->isdead + && !g_InCutscene + && EYESPYINACTIVE() + && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_IRSCANNER)) { + gdl = func0f02c6e0(gdl, chr, 0x80); + } else { + gdl = func0f02c6e0(gdl, chr, alpha); + } + } + } + + return gdl; +} + +struct var80062a8c *var80062a8c = NULL; void chrEmitSparks(struct chrdata *chr, struct prop *prop, s32 arg2, struct coord *coord, struct coord *coord2, struct chrdata *chr2) { @@ -10360,11 +9898,11 @@ glabel func0f028a50 /* f028abc: 05430019 */ bgezl $t2,.L0f028b24 /* f028ac0: 908a0000 */ lbu $t2,0x0($a0) /* f028ac4: 8cc30284 */ lw $v1,0x284($a2) -/* f028ac8: 3c0c8007 */ lui $t4,%hi(var80070764) +/* f028ac8: 3c0c8007 */ lui $t4,%hi(g_InCutscene) /* f028acc: 8c6b00d8 */ lw $t3,0xd8($v1) /* f028ad0: 5560009b */ bnezl $t3,.L0f028d40 /* f028ad4: 00001025 */ or $v0,$zero,$zero -/* f028ad8: 8d8c0764 */ lw $t4,%lo(var80070764)($t4) +/* f028ad8: 8d8c0764 */ lw $t4,%lo(g_InCutscene)($t4) /* f028adc: 55800098 */ bnezl $t4,.L0f028d40 /* f028ae0: 00001025 */ or $v0,$zero,$zero /* f028ae4: 8c620480 */ lw $v0,0x480($v1) diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 71fd900e5..fe09bbb8b 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -8204,11 +8204,11 @@ glabel func0f036c08 /* f036c44: 07010018 */ bgez $t8,.L0f036ca8 /* f036c48: 25040008 */ addiu $a0,$t0,0x8 /* f036c4c: 8e630284 */ lw $v1,0x284($s3) -/* f036c50: 3c098007 */ lui $t1,%hi(var80070764) +/* f036c50: 3c098007 */ lui $t1,%hi(g_InCutscene) /* f036c54: 8c7900d8 */ lw $t9,0xd8($v1) /* f036c58: 57200049 */ bnezl $t9,.L0f036d80 /* f036c5c: 8fab0060 */ lw $t3,0x60($sp) -/* f036c60: 8d290764 */ lw $t1,%lo(var80070764)($t1) +/* f036c60: 8d290764 */ lw $t1,%lo(g_InCutscene)($t1) /* f036c64: 55200046 */ bnezl $t1,.L0f036d80 /* f036c68: 8fab0060 */ lw $t3,0x60($sp) /* f036c6c: 8c620480 */ lw $v0,0x480($v1) @@ -18356,7 +18356,7 @@ void robotSetMuzzleFlash(struct chrdata *chr, bool right, bool enabled) partnum = MODELPART_ROBOTMUZZLEFLASHL; } - node = modelGetPart(chr->model->unk08, partnum); + node = modelGetPart(chr->model->filedata, partnum); if (node) { data = modelGetNodeData(chr->model, node); @@ -26230,10 +26230,10 @@ bool chrMoveToPos(struct chrdata *chr, struct coord *pos, s16 *rooms, f32 angle, func0f0220ac(chr); modelSetRootPosition(chr->model, &pos2); - nodetype = chr->model->unk08->rootnode->type; + nodetype = chr->model->filedata->rootnode->type; if ((nodetype & 0xff) == MODELNODETYPE_ROOT) { - data = modelGetNodeData(chr->model, chr->model->unk08->rootnode); + data = modelGetNodeData(chr->model, chr->model->filedata->rootnode); data->ground = ground; } @@ -27511,8 +27511,8 @@ s32 func0f004cd84(s32 arg0, s32 arg1) void chrToggleModelPart(struct chrdata *chr, s32 partnum) { - if (chr && chr->model && chr->model->unk08) { - struct modelnode *node = modelGetPart(chr->model->unk08, partnum); + if (chr && chr->model && chr->model->filedata) { + struct modelnode *node = modelGetPart(chr->model->filedata, partnum); struct modeldata_partid *data = NULL; if (node) { diff --git a/src/game/core.c b/src/game/core.c index 4385efe61..31906faf4 100644 --- a/src/game/core.c +++ b/src/game/core.c @@ -1616,7 +1616,7 @@ Gfx *coreRender(Gfx *gdl) if (chr->hidden & CHRHFLAG_CLOAKED) { if (g_Vars.currentplayer->isdead - || var80070764 + || g_InCutscene || !EYESPYINACTIVE() || (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_IRSCANNER) == false) { g_Vars.currentplayer->lookingatprop.prop = NULL; diff --git a/src/game/data/data_003dc0.c b/src/game/data/data_003dc0.c index ee31dec9d..99474fb54 100644 --- a/src/game/data/data_003dc0.c +++ b/src/game/data/data_003dc0.c @@ -58,7 +58,7 @@ u32 var8005efb4 = 0x00000000; u32 var8005efb8 = 0x3f800000; u32 var8005efbc = 0x00000000; u32 var8005efc0 = 0x00000000; -u32 var8005efc4 = 0x00000000; +void *var8005efc4 = NULL; // pointer to a function void *var8005efc8 = NULL; // pointer to a function u32 var8005efcc = 0x00000000; u32 var8005efd0 = 0x00000000; diff --git a/src/game/data/data_0083d0.c b/src/game/data/data_0083d0.c index cb06b2c35..41a4596b9 100644 --- a/src/game/data/data_0083d0.c +++ b/src/game/data/data_0083d0.c @@ -9,95 +9,6 @@ #include "stagesetup.h" #include "types.h" -u8 g_FileState = 0; -u8 var80062944 = 0; -u8 var80062948 = 0; -u8 var8006294c = 0; -u32 var80062950 = 0x00000064; -bool g_WeatherTickEnabled = true; -u32 var80062958 = 0x00000000; -u32 var8006295c = 0x00000000; -void *var80062960 = NULL; -u32 var80062964 = 0x00000000; -f32 var80062968 = 0; -u32 var8006296c = 0x00000000; -u32 var80062970 = 0x00000000; -u32 var80062974 = 0x00000000; -u32 var80062978 = 0x00000000; -u32 var8006297c = 0; -u32 var80062980 = 0; -s32 g_NextChrnum = 5000; - -// 80062988 -struct chrdata *g_ChrSlots = NULL; - -// 8006298c -s32 g_NumChrSlots = 0; - -u32 var80062990 = 0x00000000; -u32 var80062994 = 0x00000000; -u32 var80062998 = 0x00000000; -u32 var8006299c = 0x00000001; -u32 var800629a0 = 0x00000003; -u32 var800629a4 = 0x00000000; -u32 var800629a8 = 0x00000000; -u32 var800629ac = 0x00000000; -u32 var800629b0 = 0x00000000; -u32 var800629b4 = 0x00000000; -u32 var800629b8 = 0x00000000; -u32 var800629bc = 0x00000000; -u32 var800629c0 = 0x00000000; -u32 var800629c4 = 0x00000000; -u32 var800629c8 = 0x00000000; -u32 var800629cc = 0x00000000; -u32 var800629d0 = 0x00000000; -u32 var800629d4 = 0x00000000; -u32 var800629d8 = 0x00000000; -u32 var800629dc = 0x00000000; -u32 var800629e0 = 0x00000000; -u32 var800629e4 = 0x1a000003; -u32 var800629e8 = 0x3f800000; -u32 var800629ec = 0x00000000; -u32 var800629f0 = 0x00000000; -u32 var800629f4 = 0x00000000; -u32 var800629f8 = 0x00000000; -u32 var800629fc = 0x00000000; -u32 var80062a00 = 0x00000001; -u32 var80062a04 = 0x00000003; -u32 var80062a08 = 0x00000000; -u32 var80062a0c = 0x00000000; -u32 var80062a10 = 0x00000000; -u32 var80062a14 = 0x00000000; -u32 var80062a18 = 0x00000000; -u32 var80062a1c = 0x00000000; -u32 var80062a20 = 0x00000000; -u32 var80062a24 = 0x00000000; -u32 var80062a28 = 0x00000000; -u32 var80062a2c = 0x00000000; -u32 var80062a30 = 0x00000000; -u32 var80062a34 = 0x00000000; -u32 var80062a38 = 0x00000000; -u32 var80062a3c = 0x00000000; -u32 var80062a40 = 0x00000000; -u32 var80062a44 = 0x00000000; -u8 var80062a48[] = { 64, 10, 10 }; -u32 var80062a4c = 0x00000000; -u32 var80062a50 = 0x00000001; -u32 var80062a54 = 0x00000003; -u32 var80062a58 = 0x00000000; -u32 var80062a5c = 0x00000000; -u32 var80062a60 = 0x00000000; -u32 var80062a64 = 0x00000000; -u32 var80062a68 = 0x00000000; -u32 var80062a6c = 0x00000000; -u32 var80062a70 = 0x00000000; -u32 var80062a74 = 0x00000000; -u32 var80062a78 = 0x00000000; -u32 var80062a7c = 0x00000000; -u32 var80062a80 = 0x00000000; -u32 var80062a84 = 0x00000000; -u32 var80062a88 = 0x00000000; -struct var80062a8c *var80062a8c = NULL; s32 var80062a90 = false; u32 var80062a94 = 0x00000000; u32 var80062a98 = 0x00000000; diff --git a/src/game/data/data_0160b0.c b/src/game/data/data_0160b0.c index 627119004..ecc3de3ce 100644 --- a/src/game/data/data_0160b0.c +++ b/src/game/data/data_0160b0.c @@ -126,7 +126,7 @@ bool g_PlayersWithControl[] = { }; bool g_PlayerInvincible = false; -s32 var80070764 = 0x00000000; +s32 g_InCutscene = 0x00000000; s16 g_DeathAnimations[] = { ANIM_DEATH_001A, diff --git a/src/game/dlights.c b/src/game/dlights.c index 1882e8a5a..af36c5131 100644 --- a/src/game/dlights.c +++ b/src/game/dlights.c @@ -116,15 +116,15 @@ u8 func0f000a10(s32 roomnum) s32 value = g_Rooms[roomnum].unk52; if ((g_Vars.currentplayer->isdead == false - && var80070764 == 0 + && g_InCutscene == 0 && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_NIGHTVISION)) || (g_Vars.currentplayer->isdead == false - && var80070764 == 0 + && g_InCutscene == 0 && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_IRSCANNER))) { - value += var8009caec; + value += var8009caec[0]; } else { value += g_Rooms[roomnum].unk4b; } @@ -150,15 +150,15 @@ u8 func0f000b24(s32 roomnum) u32 value; if ((g_Vars.currentplayer->isdead == false - && var80070764 == 0 + && g_InCutscene == 0 && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_NIGHTVISION)) || (g_Vars.currentplayer->isdead == false - && var80070764 == 0 + && g_InCutscene == 0 && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_IRSCANNER))) { - return var8009caec; + return var8009caec[0]; } if (g_Rooms[roomnum].flags & ROOMFLAG_0040) { @@ -3282,8 +3282,8 @@ glabel var7f1a7ddc /* f00471c: 00008825 */ or $s1,$zero,$zero /* f004720: 19c0014c */ blez $t6,.L0f004c54 /* f004724: 00a05025 */ or $t2,$a1,$zero -/* f004728: 3c1f8007 */ lui $ra,%hi(var80070764) -/* f00472c: 27ff0764 */ addiu $ra,$ra,%lo(var80070764) +/* f004728: 3c1f8007 */ lui $ra,%hi(g_InCutscene) +/* f00472c: 27ff0764 */ addiu $ra,$ra,%lo(g_InCutscene) /* f004730: 00804825 */ or $t1,$a0,$zero .L0f004734: /* f004734: 8cef0000 */ lw $t7,0x0($a3) @@ -3592,8 +3592,8 @@ glabel var7f1a7ddc /* f004b84: afaa0040 */ sw $t2,0x40($sp) /* f004b88: 0fc6192e */ jal scenarioCallback38 /* f004b8c: afac0074 */ sw $t4,0x74($sp) -/* f004b90: 3c1f8007 */ lui $ra,%hi(var80070764) -/* f004b94: 27ff0764 */ addiu $ra,$ra,%lo(var80070764) +/* f004b90: 3c1f8007 */ lui $ra,%hi(g_InCutscene) +/* f004b94: 27ff0764 */ addiu $ra,$ra,%lo(g_InCutscene) /* f004b98: 8fa9003c */ lw $t1,0x3c($sp) /* f004b9c: 8faa0040 */ lw $t2,0x40($sp) /* f004ba0: 8fac0074 */ lw $t4,0x74($sp) @@ -4746,9 +4746,9 @@ glabel func0f005bb0 /* f005bd0: 24e79fc0 */ addiu $a3,$a3,%lo(g_Vars) /* f005bd4: 8ce80284 */ lw $t0,0x284($a3) /* f005bd8: afa2002c */ sw $v0,0x2c($sp) -/* f005bdc: 3c068007 */ lui $a2,%hi(var80070764) +/* f005bdc: 3c068007 */ lui $a2,%hi(g_InCutscene) /* f005be0: 8d0500d8 */ lw $a1,0xd8($t0) -/* f005be4: 24c60764 */ addiu $a2,$a2,%lo(var80070764) +/* f005be4: 24c60764 */ addiu $a2,$a2,%lo(g_InCutscene) /* f005be8: 14a00013 */ bnez $a1,.L0f005c38 /* f005bec: 00000000 */ nop /* f005bf0: 8cd80000 */ lw $t8,0x0($a2) @@ -4771,9 +4771,9 @@ glabel func0f005bb0 /* f005c30: 55a00017 */ bnezl $t5,.L0f005c90 /* f005c34: 8d0c1c1c */ lw $t4,0x1c1c($t0) .L0f005c38: -/* f005c38: 3c068007 */ lui $a2,%hi(var80070764) +/* f005c38: 3c068007 */ lui $a2,%hi(g_InCutscene) /* f005c3c: 14a00016 */ bnez $a1,.L0f005c98 -/* f005c40: 24c60764 */ addiu $a2,$a2,%lo(var80070764) +/* f005c40: 24c60764 */ addiu $a2,$a2,%lo(g_InCutscene) /* f005c44: 8cce0000 */ lw $t6,0x0($a2) /* f005c48: 15c00013 */ bnez $t6,.L0f005c98 /* f005c4c: 00000000 */ nop diff --git a/src/game/explosions/explosions.c b/src/game/explosions/explosions.c index 8150646fe..f739773a7 100644 --- a/src/game/explosions/explosions.c +++ b/src/game/explosions/explosions.c @@ -2931,11 +2931,11 @@ glabel explosionRender /* f12c7c4: 26739fc0 */ addiu $s3,$s3,%lo(g_Vars) /* f12c7c8: 8e640284 */ lw $a0,0x284($s3) /* f12c7cc: 00408825 */ or $s1,$v0,$zero -/* f12c7d0: 3c098007 */ lui $t1,%hi(var80070764) +/* f12c7d0: 3c098007 */ lui $t1,%hi(g_InCutscene) /* f12c7d4: 8c8500d8 */ lw $a1,0xd8($a0) /* f12c7d8: 14a00013 */ bnez $a1,.L0f12c828 /* f12c7dc: 00000000 */ nop -/* f12c7e0: 8d290764 */ lw $t1,%lo(var80070764)($t1) +/* f12c7e0: 8d290764 */ lw $t1,%lo(g_InCutscene)($t1) /* f12c7e4: 15200010 */ bnez $t1,.L0f12c828 /* f12c7e8: 00000000 */ nop /* f12c7ec: 8c830480 */ lw $v1,0x480($a0) @@ -2956,8 +2956,8 @@ glabel explosionRender /* f12c824: 240effff */ addiu $t6,$zero,-1 .L0f12c828: /* f12c828: 14a00015 */ bnez $a1,.L0f12c880 -/* f12c82c: 3c188007 */ lui $t8,%hi(var80070764) -/* f12c830: 8f180764 */ lw $t8,%lo(var80070764)($t8) +/* f12c82c: 3c188007 */ lui $t8,%hi(g_InCutscene) +/* f12c830: 8f180764 */ lw $t8,%lo(g_InCutscene)($t8) /* f12c834: 57000013 */ bnezl $t8,.L0f12c884 /* f12c838: 948f0010 */ lhu $t7,0x10($a0) /* f12c83c: 8c830480 */ lw $v1,0x480($a0) diff --git a/src/game/game_00c490.c b/src/game/game_00c490.c index 8c90696dd..84b093ba3 100644 --- a/src/game/game_00c490.c +++ b/src/game/game_00c490.c @@ -1582,7 +1582,7 @@ void setupCamera(struct cameraobj *camera, s32 cmdindex) if (camera->lookatpadnum >= 0) { struct coord lenspos; - union modelnode_data *lens = modelGetPartNodeData(obj->model->unk08, MODELPART_LENS); + union modelnode_data *lens = modelGetPartNodeData(obj->model->filedata, MODELPART_LENS); struct pad pad; f32 xdiff; f32 ydiff; @@ -1718,13 +1718,13 @@ void setupSingleMonitor(struct singlemonitorobj *monitor, s32 cmdindex) monitor->base.model->attachedto = owner->model; if (monitor->ownerpart == MODELPART_00) { - monitor->base.model->unk1c = modelGetPart(owner->model->unk08, MODELPART_00); + monitor->base.model->unk1c = modelGetPart(owner->model->filedata, MODELPART_00); } else if (monitor->ownerpart == MODELPART_01) { - monitor->base.model->unk1c = modelGetPart(owner->model->unk08, MODELPART_01); + monitor->base.model->unk1c = modelGetPart(owner->model->filedata, MODELPART_01); } else if (monitor->ownerpart == MODELPART_02) { - monitor->base.model->unk1c = modelGetPart(owner->model->unk08, MODELPART_02); + monitor->base.model->unk1c = modelGetPart(owner->model->filedata, MODELPART_02); } else { - monitor->base.model->unk1c = modelGetPart(owner->model->unk08, MODELPART_03); + monitor->base.model->unk1c = modelGetPart(owner->model->filedata, MODELPART_03); } propReparent(prop, owner->prop); @@ -3292,7 +3292,7 @@ void setupParseObjects(s32 stagenum) setupGenericObject(obj, index); if (obj->model) { - struct modelnode *node = modelGetPart(obj->model->unk08, 5); + struct modelnode *node = modelGetPart(obj->model->filedata, 5); if (node) { struct modeldata_05 *data = modelGetNodeData(obj->model, node); diff --git a/src/game/game_011110.c b/src/game/game_011110.c index 502e541aa..58b5b1058 100644 --- a/src/game/game_011110.c +++ b/src/game/game_011110.c @@ -522,8 +522,8 @@ glabel var7f1a827c /* f011940: e7a40088 */ swc1 $f4,0x88($sp) /* f011944: 0fc63956 */ jal func0f18e558 /* f011948: 00000000 */ nop -/* f01194c: 3c018007 */ lui $at,%hi(var80070764) -/* f011950: ac200764 */ sw $zero,%lo(var80070764)($at) +/* f01194c: 3c018007 */ lui $at,%hi(g_InCutscene) +/* f011950: ac200764 */ sw $zero,%lo(g_InCutscene)($at) /* f011954: 3c01800a */ lui $at,%hi(var8009de20) /* f011958: ac20de20 */ sw $zero,%lo(var8009de20)($at) /* f01195c: 24030001 */ addiu $v1,$zero,0x1 @@ -1307,7 +1307,7 @@ glabel var7f1a827c // viResetDefaultModeIf4Mb(); // func0f18e558(); // -// var80070764 = 0; +// g_InCutscene = 0; // var8009de20 = 0; // var8007072c = 1; // var80070738 = 0; diff --git a/src/game/game_0601b0.c b/src/game/game_0601b0.c index b4118e068..957a9c8e5 100644 --- a/src/game/game_0601b0.c +++ b/src/game/game_0601b0.c @@ -340,7 +340,7 @@ void propDetach(struct prop *prop) } } -Gfx *propRender(Gfx *gdl, struct prop *prop, bool arg2) +Gfx *propRender(Gfx *gdl, struct prop *prop, bool withalpha) { switch (prop->type) { case 0: @@ -348,19 +348,19 @@ Gfx *propRender(Gfx *gdl, struct prop *prop, bool arg2) case PROPTYPE_OBJ: case PROPTYPE_DOOR: case PROPTYPE_WEAPON: - gdl = propobjRender(prop, gdl, arg2); + gdl = propobjRender(prop, gdl, withalpha); break; case PROPTYPE_CHR: - gdl = propchrRender(prop, gdl, arg2); + gdl = chrRender(prop, gdl, withalpha); break; case PROPTYPE_PLAYER: - gdl = playerRender(prop, gdl, arg2); + gdl = playerRender(prop, gdl, withalpha); break; case PROPTYPE_EXPLOSION: - gdl = explosionRender(prop, gdl, arg2); + gdl = explosionRender(prop, gdl, withalpha); break; case PROPTYPE_EFFECT: - gdl = smokeRender(prop, gdl, arg2); + gdl = smokeRender(prop, gdl, withalpha); break; } diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index 2bdf41b78..c37395c7c 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -18703,10 +18703,10 @@ glabel var7f1aca90 /* f0a75bc: afac013c */ sw $t4,0x13c($sp) /* f0a75c0: afaf0118 */ sw $t7,0x118($sp) /* f0a75c4: 8ca300d8 */ lw $v1,0xd8($a1) -/* f0a75c8: 3c078007 */ lui $a3,%hi(var80070764) +/* f0a75c8: 3c078007 */ lui $a3,%hi(g_InCutscene) /* f0a75cc: 14600013 */ bnez $v1,.L0f0a761c /* f0a75d0: 00000000 */ nop -/* f0a75d4: 8ce70764 */ lw $a3,%lo(var80070764)($a3) +/* f0a75d4: 8ce70764 */ lw $a3,%lo(g_InCutscene)($a3) /* f0a75d8: 14e00010 */ bnez $a3,.L0f0a761c /* f0a75dc: 00000000 */ nop /* f0a75e0: 8ca20480 */ lw $v0,0x480($a1) @@ -18727,8 +18727,8 @@ glabel var7f1aca90 /* f0a7618: 92681615 */ lbu $t0,0x1615($s3) .L0f0a761c: /* f0a761c: 14600078 */ bnez $v1,.L0f0a7800 -/* f0a7620: 3c078007 */ lui $a3,%hi(var80070764) -/* f0a7624: 8ce70764 */ lw $a3,%lo(var80070764)($a3) +/* f0a7620: 3c078007 */ lui $a3,%hi(g_InCutscene) +/* f0a7624: 8ce70764 */ lw $a3,%lo(g_InCutscene)($a3) /* f0a7628: 54e00076 */ bnezl $a3,.L0f0a7804 /* f0a762c: 926d1614 */ lbu $t5,0x1614($s3) /* f0a7630: 8ca20480 */ lw $v0,0x480($a1) @@ -18957,7 +18957,7 @@ glabel var7f1aca90 /* f0a7964: 1100000d */ beqz $t0,.L0f0a799c /* f0a7968: 00c02825 */ or $a1,$a2,$zero /* f0a796c: afaa0094 */ sw $t2,0x94($sp) -/* f0a7970: 0c0087bd */ jal func00021ef4 +/* f0a7970: 0c0087bd */ jal modelRender /* f0a7974: afa60098 */ sw $a2,0x98($sp) /* f0a7978: 8fa60098 */ lw $a2,0x98($sp) /* f0a797c: 8ccb0008 */ lw $t3,0x8($a2) @@ -19081,7 +19081,7 @@ glabel var7f1aca90 .L0f0a7b28: /* f0a7b28: 27a4010c */ addiu $a0,$sp,0x10c .L0f0a7b2c: -/* f0a7b2c: 0c0087bd */ jal func00021ef4 +/* f0a7b2c: 0c0087bd */ jal modelRender /* f0a7b30: 8fa5003c */ lw $a1,0x3c($sp) /* f0a7b34: 8e791594 */ lw $t9,0x1594($s3) /* f0a7b38: 3c0f8007 */ lui $t7,%hi(var800702dc) @@ -19100,7 +19100,7 @@ glabel var7f1aca90 /* f0a7b6c: afa50054 */ sw $a1,0x54($sp) /* f0a7b70: 8fa50054 */ lw $a1,0x54($sp) /* f0a7b74: afb50140 */ sw $s5,0x140($sp) -/* f0a7b78: 0c0087bd */ jal func00021ef4 +/* f0a7b78: 0c0087bd */ jal modelRender /* f0a7b7c: 27a4010c */ addiu $a0,$sp,0x10c /* f0a7b80: 8fa4007c */ lw $a0,0x7c($sp) /* f0a7b84: afa40140 */ sw $a0,0x140($sp) diff --git a/src/game/game_0abe70.c b/src/game/game_0abe70.c index 4a28f6b8d..0ab0a6c9d 100644 --- a/src/game/game_0abe70.c +++ b/src/game/game_0abe70.c @@ -3194,7 +3194,7 @@ glabel var7f1acd6c /* f0aeb98: 030a4825 */ or $t1,$t8,$t2 /* f0aeb9c: afa900bc */ sw $t1,0xbc($sp) /* f0aeba0: 27a40088 */ addiu $a0,$sp,0x88 -/* f0aeba4: 0c0087bd */ jal func00021ef4 +/* f0aeba4: 0c0087bd */ jal modelRender /* f0aeba8: 27a500c8 */ addiu $a1,$sp,0xc8 /* f0aebac: 8fac0094 */ lw $t4,0x94($sp) /* f0aebb0: 8fb900fc */ lw $t9,0xfc($sp) diff --git a/src/game/game_0b63b0.c b/src/game/game_0b63b0.c index 230d1ef61..45094b0dc 100644 --- a/src/game/game_0b63b0.c +++ b/src/game/game_0b63b0.c @@ -1957,8 +1957,8 @@ bool currentPlayerAssumeChrForAnti(struct chrdata *hostchr, bool force) modelCopyAnimData(hostchr->model, playerchr->model); func0f02e9a0(playerchr, 12); - chrrootnode = modelGetNodeData(hostchr->model, hostchr->model->unk08->rootnode); - playerrootnode = modelGetNodeData(playerchr->model, playerchr->model->unk08->rootnode); + chrrootnode = modelGetNodeData(hostchr->model, hostchr->model->filedata->rootnode); + playerrootnode = modelGetNodeData(playerchr->model, playerchr->model->filedata->rootnode); *playerrootnode = *chrrootnode; @@ -3550,7 +3550,7 @@ void func0f0ba010(void) g_CameraAnimCurFrame = var8009de20 >> 2; g_CutsceneBlurFrac = 0; var8009de2c = -1; - var80070764 = 1; + g_InCutscene = 1; func0f11dcb0(1); g_Vars.in_cutscene = g_Vars.tickmode == TICKMODE_CUTSCENE && g_CameraAnimCurFrame < animGetNumFrames(g_CameraAnimNum) - 1; g_Vars.unk0004e2 = 0; @@ -4965,7 +4965,7 @@ bool func0f0bc4c0(void) return true; } - return (var80070764 && !var8005d9d0) || menuGetRoot() == MENUROOT_COOPCONTINUE; + return (g_InCutscene && !var8005d9d0) || menuGetRoot() == MENUROOT_COOPCONTINUE; } s16 currentPlayerGetViewportWidth(void) @@ -5065,7 +5065,7 @@ s16 currentPlayerGetViewportHeight(void) height = g_ViModes[g_ViMode].wideheight; } else if (optionsGetEffectiveScreenSize() == SCREENSIZE_CINEMA) { height = g_ViModes[g_ViMode].cinemaheight; - } else if (var80070764 && !var8009dfc0) { + } else if (g_InCutscene && !var8009dfc0) { if (var8009de2c >= 1) { f32 a = g_ViModes[g_ViMode].wideheight; f32 b = g_ViModes[g_ViMode].fullheight; @@ -5104,7 +5104,7 @@ s16 currentPlayerGetViewportTop(void) } } else { if (optionsGetEffectiveScreenSize() == SCREENSIZE_WIDE) { - if (var80070764 && optionsGetCutsceneSubtitles() && g_Vars.stagenum != STAGE_CITRAINING) { + if (g_InCutscene && optionsGetCutsceneSubtitles() && g_Vars.stagenum != STAGE_CITRAINING) { if (var8009de2c >= 1) { f32 a = g_ViModes[g_ViMode].fulltop; f32 b = g_ViModes[g_ViMode].widetop; @@ -5120,7 +5120,7 @@ s16 currentPlayerGetViewportTop(void) } else if (optionsGetEffectiveScreenSize() == SCREENSIZE_CINEMA) { top = g_ViModes[g_ViMode].cinematop; } else { - if (var80070764 && !var8009dfc0 + if (g_InCutscene && !var8009dfc0 && (!optionsGetCutsceneSubtitles() || g_Vars.stagenum == STAGE_CITRAINING)) { if (var8009de2c >= 1) { f32 a = g_ViModes[g_ViMode].widetop; @@ -5563,8 +5563,8 @@ glabel var7f1ad6ac /* f0bdca0: 24010001 */ addiu $at,$zero,0x1 /* f0bdca4: 1461000d */ bne $v1,$at,.L0f0bdcdc .L0f0bdca8: -/* f0bdca8: 3c0f8007 */ lui $t7,%hi(var80070764) -/* f0bdcac: 8def0764 */ lw $t7,%lo(var80070764)($t7) +/* f0bdca8: 3c0f8007 */ lui $t7,%hi(g_InCutscene) +/* f0bdcac: 8def0764 */ lw $t7,%lo(g_InCutscene)($t7) /* f0bdcb0: 3c188006 */ lui $t8,%hi(var8005d9d0) /* f0bdcb4: 55e0000a */ bnezl $t7,.L0f0bdce0 /* f0bdcb8: 8e6b0284 */ lw $t3,0x284($s3) @@ -5778,8 +5778,8 @@ glabel var7f1ad6ac .L0f0bdfb8: /* f0bdfb8: 24010006 */ addiu $at,$zero,0x6 /* f0bdfbc: 10610002 */ beq $v1,$at,.L0f0bdfc8 -/* f0bdfc0: 3c018007 */ lui $at,%hi(var80070764) -/* f0bdfc4: ac200764 */ sw $zero,%lo(var80070764)($at) +/* f0bdfc0: 3c018007 */ lui $at,%hi(g_InCutscene) +/* f0bdfc4: ac200764 */ sw $zero,%lo(g_InCutscene)($at) .L0f0bdfc8: /* f0bdfc8: 24010006 */ addiu $at,$zero,0x6 /* f0bdfcc: 54610054 */ bnel $v1,$at,.L0f0be120 @@ -7755,7 +7755,7 @@ glabel var7f1ad6ac // // // dc9c // if ((g_Vars.tickmode == TICKMODE_0 || g_Vars.tickmode == TICKMODE_NORMAL) -// && var80070764 == 0 +// && g_InCutscene == 0 // && var8005d9d0 == 0) { // g_Vars.currentplayer->bondviewlevtime60 += g_Vars.lvupdate240_60; // } @@ -7858,7 +7858,7 @@ glabel var7f1ad6ac // // // dfb8 // if (g_Vars.tickmode != TICKMODE_CUTSCENE) { -// var80070764 = 0; +// g_InCutscene = 0; // } // // // dfc8 @@ -9828,13 +9828,13 @@ Gfx *func0f0c07c8(Gfx *gdl) } if (g_Vars.currentplayer->isdead == false - && var80070764 == 0 + && g_InCutscene == 0 && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) && ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit) & DEVICE_NIGHTVISION)) { gdl = bviewRenderNvLens(gdl); gdl = bviewRenderNvBinoculars(gdl); } else if (g_Vars.currentplayer->isdead == false - && var80070764 == 0 + && g_InCutscene == 0 && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) && ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit) & DEVICE_IRSCANNER)) { gdl = bviewRenderIrLens(gdl); @@ -11892,10 +11892,10 @@ glabel var7f1ad744 /* f0c329c: 00000000 */ nop ); -Gfx *playerRender(struct prop *prop, Gfx *gdl, bool arg2) +Gfx *playerRender(struct prop *prop, Gfx *gdl, bool withalpha) { if (g_Vars.players[propGetPlayerNum(prop)]->haschrbody) { - gdl = propchrRender(prop, gdl, arg2); + gdl = chrRender(prop, gdl, withalpha); } return gdl; diff --git a/src/game/game_0dcdb0.c b/src/game/game_0dcdb0.c index 141e1db78..963ba855d 100644 --- a/src/game/game_0dcdb0.c +++ b/src/game/game_0dcdb0.c @@ -2339,8 +2339,8 @@ glabel var7f1adec0 /* f0dea24: 1000008f */ b .L0f0dec64 /* f0dea28: 8c6901d0 */ lw $t1,0x1d0($v1) .L0f0dea2c: -/* f0dea2c: 3c198007 */ lui $t9,%hi(var80070764) -/* f0dea30: 8f390764 */ lw $t9,%lo(var80070764)($t9) +/* f0dea2c: 3c198007 */ lui $t9,%hi(g_InCutscene) +/* f0dea30: 8f390764 */ lw $t9,%lo(g_InCutscene)($t9) /* f0dea34: 3c07800a */ lui $a3,%hi(g_Vars+0x68) /* f0dea38: 3c0a800a */ lui $t2,%hi(g_Vars+0x64) /* f0dea3c: 3c0d800a */ lui $t5,%hi(g_Vars+0x70) @@ -2399,8 +2399,8 @@ glabel var7f1adec0 /* f0deaf4: 90780000 */ lbu $t8,0x0($v1) /* f0deaf8: 17f8001f */ bne $ra,$t8,.L0f0deb78 .L0f0deafc: -/* f0deafc: 3c198007 */ lui $t9,%hi(var80070764) -/* f0deb00: 8f390764 */ lw $t9,%lo(var80070764)($t9) +/* f0deafc: 3c198007 */ lui $t9,%hi(g_InCutscene) +/* f0deb00: 8f390764 */ lw $t9,%lo(g_InCutscene)($t9) /* f0deb04: 3c0f8006 */ lui $t7,%hi(var8005d9d0) /* f0deb08: 53200005 */ beqzl $t9,.L0f0deb20 /* f0deb0c: 906e0000 */ lbu $t6,0x0($v1) @@ -2564,8 +2564,8 @@ glabel var7f1adec0 /* f0ded30: 0305c821 */ addu $t9,$t8,$a1 /* f0ded34: 03267821 */ addu $t7,$t9,$a2 /* f0ded38: 15e1001b */ bne $t7,$at,.L0f0deda8 -/* f0ded3c: 3c0e8007 */ lui $t6,%hi(var80070764) -/* f0ded40: 8dce0764 */ lw $t6,%lo(var80070764)($t6) +/* f0ded3c: 3c0e8007 */ lui $t6,%hi(g_InCutscene) +/* f0ded40: 8dce0764 */ lw $t6,%lo(g_InCutscene)($t6) /* f0ded44: 3c188006 */ lui $t8,%hi(var8005d9d0) /* f0ded48: 3c198009 */ lui $t9,%hi(g_Is4Mb) /* f0ded4c: 11c00004 */ beqz $t6,.L0f0ded60 @@ -3720,8 +3720,8 @@ glabel var7f1adef4 /* f0dfb6c: 0500000e */ bltz $t0,.L0f0dfba8 /* f0dfb70: 00000000 */ nop .L0f0dfb74: -/* f0dfb74: 3c098007 */ lui $t1,%hi(var80070764) -/* f0dfb78: 8d290764 */ lw $t1,%lo(var80070764)($t1) +/* f0dfb74: 3c098007 */ lui $t1,%hi(g_InCutscene) +/* f0dfb78: 8d290764 */ lw $t1,%lo(g_InCutscene)($t1) /* f0dfb7c: 1120000a */ beqz $t1,.L0f0dfba8 /* f0dfb80: 00000000 */ nop /* f0dfb84: 3c0a8006 */ lui $t2,%hi(var8005d9d0) @@ -4541,7 +4541,7 @@ glabel var7f1adef4 // // // b4c // if ((g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) -// && var80070764 +// && g_InCutscene // && var8005d9d0 == 0 // && g_Vars.currentplayernum == 0) { // // ba4 diff --git a/src/game/game_0f09f0.c b/src/game/game_0f09f0.c index d3956d1bc..06012a22d 100644 --- a/src/game/game_0f09f0.c +++ b/src/game/game_0f09f0.c @@ -4577,7 +4577,7 @@ glabel var7f1b2948 /* f0f4e0c: afab03bc */ sw $t3,0x3bc($sp) /* f0f4e10: 8fa5003c */ lw $a1,0x3c($sp) /* f0f4e14: 27a403b8 */ addiu $a0,$sp,0x3b8 -/* f0f4e18: 0c0087bd */ jal func00021ef4 +/* f0f4e18: 0c0087bd */ jal modelRender /* f0f4e1c: afb903c4 */ sw $t9,0x3c4($sp) /* f0f4e20: 8fad03c4 */ lw $t5,0x3c4($sp) /* f0f4e24: 0c0059d8 */ jal func00016760 @@ -11791,8 +11791,8 @@ glabel var7f1b2ac8 /* f0fb3b8: 00000000 */ nop /* f0fb3bc: 10000027 */ b .L0f0fb45c /* f0fb3c0: 8fbf003c */ lw $ra,0x3c($sp) -/* f0fb3c4: 3c0f8007 */ lui $t7,%hi(var80070764) -/* f0fb3c8: 8def0764 */ lw $t7,%lo(var80070764)($t7) +/* f0fb3c4: 3c0f8007 */ lui $t7,%hi(g_InCutscene) +/* f0fb3c8: 8def0764 */ lw $t7,%lo(g_InCutscene)($t7) /* f0fb3cc: 51e00010 */ beqzl $t7,.L0f0fb410 /* f0fb3d0: 240f000a */ addiu $t7,$zero,0xa /* f0fb3d4: 0fc3e048 */ jal func0f0f8120 diff --git a/src/game/game_11f000.c b/src/game/game_11f000.c index b86ddb475..6c3d489e0 100644 --- a/src/game/game_11f000.c +++ b/src/game/game_11f000.c @@ -9100,8 +9100,8 @@ glabel var7f1b5140 /* f12752c: 0fc49d24 */ jal func0f127490 /* f127530: 8c651c30 */ lw $a1,0x1c30($v1) /* f127534: 8e380284 */ lw $t8,0x284($s1) -/* f127538: 3c0c8007 */ lui $t4,%hi(var80070764) -/* f12753c: 258c0764 */ addiu $t4,$t4,%lo(var80070764) +/* f127538: 3c0c8007 */ lui $t4,%hi(g_InCutscene) +/* f12753c: 258c0764 */ addiu $t4,$t4,%lo(g_InCutscene) /* f127540: af021c30 */ sw $v0,0x1c30($t8) /* f127544: 8e230284 */ lw $v1,0x284($s1) /* f127548: 8c6a1c2c */ lw $t2,0x1c2c($v1) diff --git a/src/game/game_129210.c b/src/game/game_129210.c index 2b89b36df..97ae3ecd1 100644 --- a/src/game/game_129210.c +++ b/src/game/game_129210.c @@ -30,7 +30,7 @@ void func0f129210(void *find, void *replacement) if (prop->type == PROPTYPE_OBJ) { struct defaultobj *obj = prop->obj; struct model *model = obj->model; - struct model08 *filedata = model->unk08; + struct modelfiledata *filedata = model->filedata; struct modelnode *node = filedata->rootnode; struct modelnode_displaylist *data; diff --git a/src/game/game_13c510.c b/src/game/game_13c510.c index 46801e2dc..f60e8da89 100644 --- a/src/game/game_13c510.c +++ b/src/game/game_13c510.c @@ -1438,7 +1438,7 @@ glabel func0f13d568 /* f13d8e8: 00000000 */ nop /* f13d8ec: 00000000 */ nop /* f13d8f0: 01c30019 */ multu $t6,$v1 -/* f13d8f4: 3c0e8007 */ lui $t6,%hi(var80070764) +/* f13d8f4: 3c0e8007 */ lui $t6,%hi(g_InCutscene) /* f13d8f8: 0000a812 */ mflo $s5 /* f13d8fc: 00000000 */ nop /* f13d900: 00000000 */ nop @@ -1469,7 +1469,7 @@ glabel func0f13d568 /* f13d950: 8c6d00d8 */ lw $t5,0xd8($v1) /* f13d954: 55a0001f */ bnezl $t5,.L0f13d9d4 /* f13d958: 926d0002 */ lbu $t5,0x2($s3) -/* f13d95c: 8dce0764 */ lw $t6,%lo(var80070764)($t6) +/* f13d95c: 8dce0764 */ lw $t6,%lo(g_InCutscene)($t6) /* f13d960: 55c0001c */ bnezl $t6,.L0f13d9d4 /* f13d964: 926d0002 */ lbu $t5,0x2($s3) /* f13d968: 8c620480 */ lw $v0,0x480($v1) @@ -1589,7 +1589,7 @@ glabel func0f13d568 /* f13db1c: 46000007 */ neg.s $f0,$f0 /* f13db20: 3c013f80 */ lui $at,0x3f80 /* f13db24: 4610003c */ c.lt.s $f0,$f16 -/* f13db28: 3c0e8007 */ lui $t6,%hi(var80070764) +/* f13db28: 3c0e8007 */ lui $t6,%hi(g_InCutscene) /* f13db2c: 8fa40164 */ lw $a0,0x164($sp) /* f13db30: 45020005 */ bc1fl .L0f13db48 /* f13db34: 46000506 */ mov.s $f20,$f0 @@ -1640,7 +1640,7 @@ glabel func0f13d568 /* f13dbd8: 4610b582 */ mul.s $f22,$f22,$f16 /* f13dbdc: 15a0001a */ bnez $t5,.L0f13dc48 /* f13dbe0: 00000000 */ nop -/* f13dbe4: 8dce0764 */ lw $t6,%lo(var80070764)($t6) +/* f13dbe4: 8dce0764 */ lw $t6,%lo(g_InCutscene)($t6) /* f13dbe8: 15c00017 */ bnez $t6,.L0f13dc48 /* f13dbec: 00000000 */ nop /* f13dbf0: 8c620480 */ lw $v0,0x480($v1) @@ -1761,7 +1761,7 @@ glabel func0f13d568 /* f13dda4: 461c4403 */ div.s $f16,$f8,$f28 /* f13dda8: 926c0001 */ lbu $t4,0x1($s3) /* f13ddac: 3c014f80 */ lui $at,0x4f80 -/* f13ddb0: 3c0d8007 */ lui $t5,%hi(var80070764) +/* f13ddb0: 3c0d8007 */ lui $t5,%hi(g_InCutscene) /* f13ddb4: 448c3000 */ mtc1 $t4,$f6 /* f13ddb8: 27a600d4 */ addiu $a2,$sp,0xd4 /* f13ddbc: 24070040 */ addiu $a3,$zero,0x40 @@ -1795,7 +1795,7 @@ glabel func0f13d568 /* f13de24: 460a0002 */ mul.s $f0,$f0,$f10 /* f13de28: 5700001b */ bnezl $t8,.L0f13de98 /* f13de2c: 4600e03c */ c.lt.s $f28,$f0 -/* f13de30: 8dad0764 */ lw $t5,%lo(var80070764)($t5) +/* f13de30: 8dad0764 */ lw $t5,%lo(g_InCutscene)($t5) /* f13de34: 55a00018 */ bnezl $t5,.L0f13de98 /* f13de38: 4600e03c */ c.lt.s $f28,$f0 /* f13de3c: 8c620480 */ lw $v0,0x480($v1) diff --git a/src/game/game_157db0.c b/src/game/game_157db0.c index 3d9a43e74..3b6962262 100644 --- a/src/game/game_157db0.c +++ b/src/game/game_157db0.c @@ -2982,8 +2982,8 @@ glabel func0f15a6f4 /* f15a820: 00408825 */ or $s1,$v0,$zero /* f15a824: 8c6400d8 */ lw $a0,0xd8($v1) /* f15a828: 14800013 */ bnez $a0,.L0f15a878 -/* f15a82c: 3c0e8007 */ lui $t6,%hi(var80070764) -/* f15a830: 8dce0764 */ lw $t6,%lo(var80070764)($t6) +/* f15a82c: 3c0e8007 */ lui $t6,%hi(g_InCutscene) +/* f15a830: 8dce0764 */ lw $t6,%lo(g_InCutscene)($t6) /* f15a834: 15c00010 */ bnez $t6,.L0f15a878 /* f15a838: 00000000 */ nop /* f15a83c: 8c620480 */ lw $v0,0x480($v1) @@ -3004,8 +3004,8 @@ glabel func0f15a6f4 /* f15a874: 02202025 */ or $a0,$s1,$zero .L0f15a878: /* f15a878: 14800012 */ bnez $a0,.L0f15a8c4 -/* f15a87c: 3c0e8007 */ lui $t6,%hi(var80070764) -/* f15a880: 8dce0764 */ lw $t6,%lo(var80070764)($t6) +/* f15a87c: 3c0e8007 */ lui $t6,%hi(g_InCutscene) +/* f15a880: 8dce0764 */ lw $t6,%lo(g_InCutscene)($t6) /* f15a884: 15c0000f */ bnez $t6,.L0f15a8c4 /* f15a888: 00000000 */ nop /* f15a88c: 8c620480 */ lw $v0,0x480($v1) diff --git a/src/game/mplayer/mplayer.c b/src/game/mplayer/mplayer.c index 081b4cec1..ca06b4c62 100644 --- a/src/game/mplayer/mplayer.c +++ b/src/game/mplayer/mplayer.c @@ -2084,10 +2084,10 @@ glabel func0f18973c /* f18999c: 8fbf0034 */ lw $ra,0x34($sp) /* f1899a0: 8c4a1c10 */ lw $t2,0x1c10($v0) .L0f1899a4: -/* f1899a4: 3c098007 */ lui $t1,%hi(var80070764) +/* f1899a4: 3c098007 */ lui $t1,%hi(g_InCutscene) /* f1899a8: 514000c1 */ beqzl $t2,.L0f189cb0 /* f1899ac: 8fbf0034 */ lw $ra,0x34($sp) -/* f1899b0: 8d290764 */ lw $t1,%lo(var80070764)($t1) +/* f1899b0: 8d290764 */ lw $t1,%lo(g_InCutscene)($t1) /* f1899b4: 552000be */ bnezl $t1,.L0f189cb0 /* f1899b8: 8fbf0034 */ lw $ra,0x34($sp) /* f1899bc: 8c6b029c */ lw $t3,0x29c($v1) @@ -2096,10 +2096,10 @@ glabel func0f18973c /* f1899c4: 05600008 */ bltz $t3,.L0f1899e8 /* f1899c8: 00000000 */ nop /* f1899cc: 8c6c02a8 */ lw $t4,0x2a8($v1) -/* f1899d0: 3c0d8007 */ lui $t5,%hi(var80070764) +/* f1899d0: 3c0d8007 */ lui $t5,%hi(g_InCutscene) /* f1899d4: 558200b6 */ bnel $t4,$v0,.L0f189cb0 /* f1899d8: 8fbf0034 */ lw $ra,0x34($sp) -/* f1899dc: 8dad0764 */ lw $t5,%lo(var80070764)($t5) +/* f1899dc: 8dad0764 */ lw $t5,%lo(g_InCutscene)($t5) /* f1899e0: 55a000b3 */ bnezl $t5,.L0f189cb0 /* f1899e4: 8fbf0034 */ lw $ra,0x34($sp) .L0f1899e8: diff --git a/src/game/propobj.c b/src/game/propobj.c index d7a382945..42aabb223 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -5020,7 +5020,7 @@ glabel func0f06a1ec /* f06a528: 00c01025 */ or $v0,$a2,$zero ); -struct prop *func0f06a52c(struct singlemonitorobj *monitor, struct model08 *filedata) +struct prop *func0f06a52c(struct singlemonitorobj *monitor, struct modelfiledata *filedata) { return func0f06a1ec(monitor, filedata, 0, 0); } @@ -19513,7 +19513,7 @@ glabel var7f1aa43c // } // // // Consider playing a sound effect -// if (model->unk08->unk04 == &stagethinglist_20ec8) { +// if (model->filedata->unk04 == &stagethinglist_20ec8) { // f32 soundpoint = door->maxfrac * 0.3f; // // if (door->frac > soundpoint) { @@ -19556,8 +19556,8 @@ void doorUpdatePortalIfWindowed(struct prop *doorprop, s32 playercount) canhide = false; } - if (model->unk08->unk04 == &stagethinglist_20ef8) { - node = modelGetPart(model->unk08, MODELPART_01); + if (model->filedata->unk04 == &stagethinglist_20ef8) { + node = modelGetPart(model->filedata, MODELPART_01); partdata = modelGetNodeData(model, node); if (partdata->visible.u32 == 0) { @@ -27702,7 +27702,7 @@ void func0f07e058(struct prop *prop) struct defaultobj *obj = prop->obj; struct model *model = obj->model; - struct modelnode *node = modelGetPart(model->unk08, MODELPART_6E); + struct modelnode *node = modelGetPart(model->filedata, MODELPART_6E); if (node) { struct modeldata_partid *data = modelGetNodeData(model, node); @@ -28185,7 +28185,7 @@ s32 objTick(struct prop *prop) } sp556 = true; - sp476.unk10 = gfxAllocate(model->unk08->unk0e * sizeof(Mtxf)); + sp476.unk10 = gfxAllocate(model->filedata->unk0e * sizeof(Mtxf)); sp476.matrix = currentPlayerGetMatrix1740(); func0001cebc(&sp476, model); @@ -28268,7 +28268,7 @@ s32 objTick(struct prop *prop) sp144 = floorf(model->anim->frame); for (i = sp148; i <= sp144; i++) { - func00024b64(0, 0, model->unk08->unk04, model->anim->animnum, i, &sp128, 0); + func00024b64(0, 0, model->filedata->unk04, model->anim->animnum, i, &sp128, 0); sp116.x += sp128.x * 0.1f; sp112 = sp128.y * 0.1f; @@ -28283,7 +28283,7 @@ s32 objTick(struct prop *prop) func00015a00(currentPlayerGetMatrix1740(), &sp248, &sp152); sp556 = true; - sp312.unk10 = gfxAllocate(model->unk08->unk0e * sizeof(Mtxf)); + sp312.unk10 = gfxAllocate(model->filedata->unk0e * sizeof(Mtxf)); sp312.matrix = &sp152; func0001cebc(&sp312, model); @@ -28431,14 +28431,14 @@ s32 objTick(struct prop *prop) if (obj->type == OBJTYPE_FAN) { func0f078be0(prop); - } else if (obj->model->unk08->unk04 == &stagethinglist_20e10) { + } else if (obj->model->filedata->unk04 == &stagethinglist_20e10) { func0f07e058(prop); } if (sp556 == false) { - model->unk0c = gfxAllocate(model->unk08->unk0e * 64); + model->unk0c = gfxAllocate(model->filedata->unk0e * 64); func0f07e2cc(prop); - func0001cb0c(model, model->unk08->rootnode); + func0001cb0c(model, model->filedata->rootnode); } prop->z = -model->unk0c->m[3][2]; @@ -30117,7 +30117,7 @@ glabel func0f0809c4 .L0f080de8: /* f080de8: ae11000c */ sw $s1,0xc($s0) /* f080dec: 8fa50070 */ lw $a1,0x70($sp) -/* f080df0: 0c0087bd */ jal func00021ef4 +/* f080df0: 0c0087bd */ jal modelRender /* f080df4: 02002025 */ or $a0,$s0,$zero /* f080df8: 8fae0074 */ lw $t6,0x74($sp) /* f080dfc: 8e11000c */ lw $s1,0xc($s0) @@ -30232,7 +30232,7 @@ glabel func0f0809c4 ); GLOBAL_ASM( -glabel func0f080f8c +glabel gfxRenderRadialShadow /* f080f8c: 27bdff00 */ addiu $sp,$sp,-256 /* f080f90: afbf002c */ sw $ra,0x2c($sp) /* f080f94: afa40100 */ sw $a0,0x100($sp) @@ -30439,7 +30439,7 @@ glabel func0f081220 /* f081298: e7a00010 */ swc1 $f0,0x10($sp) /* f08129c: 02202025 */ or $a0,$s1,$zero /* f0812a0: 8fa60038 */ lw $a2,0x38($sp) -/* f0812a4: 0fc203e3 */ jal func0f080f8c +/* f0812a4: 0fc203e3 */ jal gfxRenderRadialShadow /* f0812a8: e7a40014 */ swc1 $f4,0x14($sp) /* f0812ac: 10000012 */ b .L0f0812f8 /* f0812b0: 00408825 */ or $s1,$v0,$zero @@ -30458,7 +30458,7 @@ glabel func0f081220 /* f0812e0: e7a00010 */ swc1 $f0,0x10($sp) /* f0812e4: 02202025 */ or $a0,$s1,$zero /* f0812e8: 8fa60038 */ lw $a2,0x38($sp) -/* f0812ec: 0fc203e3 */ jal func0f080f8c +/* f0812ec: 0fc203e3 */ jal gfxRenderRadialShadow /* f0812f0: e7a60014 */ swc1 $f6,0x14($sp) /* f0812f4: 00408825 */ or $s1,$v0,$zero .L0f0812f8: @@ -30974,8 +30974,8 @@ glabel var7f1aa82c /* f081a30: 27a500a0 */ addiu $a1,$sp,0xa0 /* f081a34: 8c4400d8 */ lw $a0,0xd8($v0) /* f081a38: 14800021 */ bnez $a0,.L0f081ac0 -/* f081a3c: 3c0b8007 */ lui $t3,%hi(var80070764) -/* f081a40: 8d6b0764 */ lw $t3,%lo(var80070764)($t3) +/* f081a3c: 3c0b8007 */ lui $t3,%hi(g_InCutscene) +/* f081a40: 8d6b0764 */ lw $t3,%lo(g_InCutscene)($t3) /* f081a44: 1560001e */ bnez $t3,.L0f081ac0 /* f081a48: 00000000 */ nop /* f081a4c: 8c430480 */ lw $v1,0x480($v0) @@ -31011,8 +31011,8 @@ glabel var7f1aa82c /* f081abc: 8faf0088 */ lw $t7,0x88($sp) .L0f081ac0: /* f081ac0: 14800021 */ bnez $a0,.L0f081b48 -/* f081ac4: 3c0b8007 */ lui $t3,%hi(var80070764) -/* f081ac8: 8d6b0764 */ lw $t3,%lo(var80070764)($t3) +/* f081ac4: 3c0b8007 */ lui $t3,%hi(g_InCutscene) +/* f081ac8: 8d6b0764 */ lw $t3,%lo(g_InCutscene)($t3) /* f081acc: 5560001f */ bnezl $t3,.L0f081b4c /* f081ad0: 8faf0088 */ lw $t7,0x88($sp) /* f081ad4: 8c430480 */ lw $v1,0x480($v0) @@ -48327,8 +48327,8 @@ glabel var7f1ab214 void objSetModelPartVisible(struct defaultobj *obj, s32 partnum, bool visible) { - if (obj && obj->model && obj->model->unk08) { - struct modelnode *node = modelGetPart(obj->model->unk08, partnum); + if (obj && obj->model && obj->model->filedata) { + struct modelnode *node = modelGetPart(obj->model->filedata, partnum); if (node) { struct modeldata_partid *data = modelGetNodeData(obj->model, node); diff --git a/src/game/sparks/sparks.c b/src/game/sparks/sparks.c index 3eb243c37..a2ac2fd02 100644 --- a/src/game/sparks/sparks.c +++ b/src/game/sparks/sparks.c @@ -982,10 +982,10 @@ glabel func0f130044 /* f1304c0: c7b00138 */ lwc1 $f16,0x138($sp) /* f1304c4: 00408825 */ or $s1,$v0,$zero /* f1304c8: 8e0400d8 */ lw $a0,0xd8($s0) -/* f1304cc: 3c0e8007 */ lui $t6,%hi(var80070764) +/* f1304cc: 3c0e8007 */ lui $t6,%hi(g_InCutscene) /* f1304d0: 14800013 */ bnez $a0,.L0f130520 /* f1304d4: 00000000 */ nop -/* f1304d8: 8dce0764 */ lw $t6,%lo(var80070764)($t6) +/* f1304d8: 8dce0764 */ lw $t6,%lo(g_InCutscene)($t6) /* f1304dc: 15c00010 */ bnez $t6,.L0f130520 /* f1304e0: 00000000 */ nop /* f1304e4: 8e030480 */ lw $v1,0x480($s0) @@ -1006,8 +1006,8 @@ glabel func0f130044 /* f13051c: 8e48001c */ lw $t0,0x1c($s2) .L0f130520: /* f130520: 14800018 */ bnez $a0,.L0f130584 -/* f130524: 3c0b8007 */ lui $t3,%hi(var80070764) -/* f130528: 8d6b0764 */ lw $t3,%lo(var80070764)($t3) +/* f130524: 3c0b8007 */ lui $t3,%hi(g_InCutscene) +/* f130528: 8d6b0764 */ lw $t3,%lo(g_InCutscene)($t3) /* f13052c: 55600016 */ bnezl $t3,.L0f130588 /* f130530: 960a0010 */ lhu $t2,0x10($s0) /* f130534: 8e030480 */ lw $v1,0x480($s0) diff --git a/src/game/title.c b/src/game/title.c index 1d69b8eea..8ae6333e1 100644 --- a/src/game/title.c +++ b/src/game/title.c @@ -1870,7 +1870,7 @@ glabel func0f017248 /* f0178d0: afa00114 */ sw $zero,0x114($sp) /* f0178d4: 27a40110 */ addiu $a0,$sp,0x110 /* f0178d8: 02e02825 */ or $a1,$s7,$zero -/* f0178dc: 0c0087bd */ jal func00021ef4 +/* f0178dc: 0c0087bd */ jal modelRender /* f0178e0: afac011c */ sw $t4,0x11c($sp) /* f0178e4: 8fb9011c */ lw $t9,0x11c($sp) /* f0178e8: 00008025 */ or $s0,$zero,$zero @@ -3846,7 +3846,7 @@ glabel var7f1a84a0 /* f0199d8: afa00154 */ sw $zero,0x154($sp) /* f0199dc: 02402025 */ or $a0,$s2,$zero /* f0199e0: 8e650000 */ lw $a1,0x0($s3) -/* f0199e4: 0c0087bd */ jal func00021ef4 +/* f0199e4: 0c0087bd */ jal modelRender /* f0199e8: afa8015c */ sw $t0,0x15c($sp) /* f0199ec: 8fa9015c */ lw $t1,0x15c($sp) /* f0199f0: 8e620000 */ lw $v0,0x0($s3) @@ -4313,7 +4313,7 @@ glabel var7f1a84bc /* f01a1cc: afa00164 */ sw $zero,0x164($sp) /* f01a1d0: afb4016c */ sw $s4,0x16c($sp) /* f01a1d4: 8e650000 */ lw $a1,0x0($s3) -/* f01a1d8: 0c0087bd */ jal func00021ef4 +/* f01a1d8: 0c0087bd */ jal modelRender /* f01a1dc: 27a40160 */ addiu $a0,$sp,0x160 /* f01a1e0: 8e6b0000 */ lw $t3,0x0($s3) /* f01a1e4: 8fb4016c */ lw $s4,0x16c($sp) @@ -4370,7 +4370,7 @@ glabel var7f1a84bc /* f01a2a4: afa00164 */ sw $zero,0x164($sp) /* f01a2a8: afb4016c */ sw $s4,0x16c($sp) /* f01a2ac: 8e650000 */ lw $a1,0x0($s3) -/* f01a2b0: 0c0087bd */ jal func00021ef4 +/* f01a2b0: 0c0087bd */ jal modelRender /* f01a2b4: 27a40160 */ addiu $a0,$sp,0x160 /* f01a2b8: 8e620000 */ lw $v0,0x0($s3) /* f01a2bc: 8fb4016c */ lw $s4,0x16c($sp) diff --git a/src/gvars/gvars.c b/src/gvars/gvars.c index 9e50692c5..27967b879 100644 --- a/src/gvars/gvars.c +++ b/src/gvars/gvars.c @@ -14507,7 +14507,7 @@ u32 var8009cadc = 0; u32 var8009cae0 = 0; u32 var8009cae4 = 0; u32 var8009cae8 = 0; -u8 var8009caec = 0; +u8 var8009caec[4] = {0}; u8 var8009caf0 = 0; u32 var8009caf4 = 0; u32 var8009caf8 = 0; diff --git a/src/include/constants.h b/src/include/constants.h index 1bea96873..4401c70da 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -464,7 +464,7 @@ #define CHRCFLAG_HIDDEN 0x00000400 #define CHRCFLAG_NOAUTOAIM 0x00000800 #define CHRCFLAG_UNEXPLODABLE 0x00001000 -#define CHRCFLAG_00002000 0x00002000 // Not used in scripts +#define CHRCFLAG_NOSHADOW 0x00002000 #define CHRCFLAG_HAS_SPECIAL_DEATH_ANIMATION 0x00004000 #define CHRCFLAG_00008000 0x00008000 // Not used in scripts #define CHRCFLAG_00010000 0x00010000 // Related to dead people in intro cutscenes @@ -1694,6 +1694,8 @@ #define MODELPART_03 0x03 #define MODELPART_ROBOTMUZZLEFLASHL 0x03 #define MODELPART_HUDPIECE 0x04 +#define MODELPART_04 0x04 +#define MODELPART_05 0x05 #define MODELPART_NECKLACE 0x07 #define MODELPART_NEWCLIP 0x28 #define MODELPART_NEWCLIP2 0x29 diff --git a/src/include/game/chr/chr.h b/src/include/game/chr/chr.h index f025c7ba1..5aedf1400 100644 --- a/src/include/game/chr/chr.h +++ b/src/include/game/chr/chr.h @@ -21,7 +21,7 @@ void func0f021fa8(struct chrdata *chr, struct coord *pos, s16 *rooms); void func0f0220ec(struct chrdata *chr, s32 arg1, s32 arg2); u32 func0f022214(void); void chrUpdateCloak(struct chrdata *chr); -u32 func0f022be4(void); +s32 func0f022be4(struct chrdata *chr); void chrSetPoisoned(struct chrdata *chr, void *arg1); u32 func0f022d60(void); bool propchrDoFireslotThing(struct prop *prop); @@ -30,11 +30,11 @@ void chrDropItems(struct chrdata *chr); void chrSetHudpieceVisible(struct chrdata *chr, bool visible); void chrDropWeapons(struct chrdata *chr); void func0f0246e4(u8 *arg0); -u32 func0f024738(void); +bool func0f024738(struct chrdata *chr); u32 func0f024b18(void); -u32 func0f025074(void); +void func0f025074(struct prop *prop, struct modelrenderdata *renderdata, bool withalpha, struct chrdata *chr); void bodyGetBloodColour(s16 bodynum, u8 *colour1, u32 *colour2); -Gfx *propchrRender(struct prop *prop, Gfx *gdl, bool arg2); +Gfx *chrRender(struct prop *prop, Gfx *gdl, bool withalpha); void chrEmitSparks(struct chrdata *chr, struct prop *prop, s32 arg2, struct coord *coord, struct coord *coord2, struct chrdata *chr2); u32 func0f0260c4(void); u32 func0f0268bc(void); @@ -58,10 +58,10 @@ void func0f0295f8(f32 arg0, s32 *arg1, s32 *arg2, s32 *arg3); f32 propGetShieldThing(struct prop **propptr); u32 func0f02983c(void); u32 func0f02b7d4(void); -u32 func0f02bdf8(void); -u32 func0f02c6e0(void); +Gfx *func0f02bdf8(Gfx *gdl, struct prop *chr1, struct prop *chr2); +Gfx *func0f02c6e0(Gfx *gdl, struct chrdata *chr, u32 alpha); u32 func0f02c9b0(void); -u32 func0f02ccb4(void); +void func0f02ccb4(struct chrdata *drcaroll, s32 imageleft, s32 imageright); s32 getNumChrSlots(void); void chrRegister(s32 chrnum, s32 chrindex); void func0f01e760(s32 arg0); diff --git a/src/include/game/data/data_0160b0.h b/src/include/game/data/data_0160b0.h index 23a19dfa3..253dd6a26 100644 --- a/src/include/game/data/data_0160b0.h +++ b/src/include/game/data/data_0160b0.h @@ -66,7 +66,7 @@ extern u32 var80070748; extern u32 var8007074c; extern bool g_PlayersWithControl[]; extern bool g_PlayerInvincible; -extern s32 var80070764; +extern s32 g_InCutscene; extern s16 g_DeathAnimations[]; extern u32 g_NumDeathAnimations; extern u32 var80070780; diff --git a/src/include/game/explosions/explosions.h b/src/include/game/explosions/explosions.h index e4f031d94..e99d22f7d 100644 --- a/src/include/game/explosions/explosions.h +++ b/src/include/game/explosions/explosions.h @@ -15,7 +15,7 @@ bool func0f12af5c(struct explosion *exp, struct prop *prop, struct coord *pos1, u32 func0f12b0e0(void); u32 func0f12bbdc(struct prop *prop); u32 explosionUpdateZ(struct prop *prop); -Gfx *explosionRender(struct prop *prop, Gfx *gdl, bool arg2); +Gfx *explosionRender(struct prop *prop, Gfx *gdl, bool withalpha); u32 func0f12cd64(void); #endif diff --git a/src/include/game/game_0601b0.h b/src/include/game/game_0601b0.h index 1b2a81580..fe61c01da 100644 --- a/src/include/game/game_0601b0.h +++ b/src/include/game/game_0601b0.h @@ -15,7 +15,7 @@ void func0f060538(struct prop *prop); void func0f0605c4(struct prop *prop); void propReparent(struct prop *mover, struct prop *adopter); void propDetach(struct prop *prop); -Gfx *propRender(Gfx *gdl, struct prop *prop, bool arg2); +Gfx *propRender(Gfx *gdl, struct prop *prop, bool withalpha); Gfx *propsRender(Gfx *gdl, s16 arg1, s32 arg2, s16 *arg3); u32 func0f060984(void); u32 func0f060bac(void); diff --git a/src/include/game/game_0b63b0.h b/src/include/game/game_0b63b0.h index 06605302d..2c74b911f 100644 --- a/src/include/game/game_0b63b0.h +++ b/src/include/game/game_0b63b0.h @@ -84,7 +84,7 @@ s32 getMissionTime(void); s32 func0f0c228c(struct prop *prop); u32 func0f0c2364(void); u32 func0f0c2a58(void); -Gfx *playerRender(struct prop *prop, Gfx *gdl, bool arg2); +Gfx *playerRender(struct prop *prop, Gfx *gdl, bool withalpha); Gfx *currentPlayerLoadMatrix(Gfx *gdl); u32 func0f0c3320(void); void setTickMode(s32 tickmode); diff --git a/src/include/game/game_0c33f0.h b/src/include/game/game_0c33f0.h index 87de24b54..2935d4934 100644 --- a/src/include/game/game_0c33f0.h +++ b/src/include/game/game_0c33f0.h @@ -3,6 +3,6 @@ #include #include "types.h" -u32 func0f0c33f0(void); +void func0f0c33f0(Mtxf *matrix, s32 arg1); #endif diff --git a/src/include/game/game_165670.h b/src/include/game/game_165670.h index 80998a909..dc08a1289 100644 --- a/src/include/game/game_165670.h +++ b/src/include/game/game_165670.h @@ -17,6 +17,6 @@ Gfx *func0f1664a0(Gfx *gdl, u32 arg1); Gfx *gfxConsiderDisableFog(Gfx *gdl); u32 func0f1666f8(void); u32 func0f1667e8(void); -u32 func0f1667f4(void); +s32 func0f1667f4(struct prop *prop, f32 *arg1); #endif diff --git a/src/include/game/mplayer/setup.h b/src/include/game/mplayer/setup.h index b84992b66..d5b6efc1b 100644 --- a/src/include/game/mplayer/setup.h +++ b/src/include/game/mplayer/setup.h @@ -106,7 +106,7 @@ s32 menuhandler00185068(u32 operation, struct menuitem *item, union handlerdata void func0f185568(void); Gfx *func0f185774(Gfx *gdl); u32 func0f185c14(void); -u32 func0f185e20(void); +bool func0f185e20(struct prop *prop, s32 *arg1); void mpPrepareScenario(void); u32 func0f186508(void); void func0f1866b8(s32 playernum, char *message); diff --git a/src/include/game/propobj.h b/src/include/game/propobj.h index a4ecc2473..d42ddc7f7 100644 --- a/src/include/game/propobj.h +++ b/src/include/game/propobj.h @@ -84,11 +84,11 @@ u32 func0f068ad4(void); struct model08thing *func0f068af4(struct defaultobj *obj); u32 func0f068b14(void); u32 func0f068c04(void); -u32 func0f068fc8(void); +s32 func0f068fc8(struct prop *prop, bool arg1); void func0f069144(struct prop *prop, u8 *nextcol, u16 floorcol); void func0f069630(struct prop *prop, u8 *nextcol, u16 floorcol); void func0f069710(u8 *shadecol, u8 *nextcol); -u32 func0f069750(void); +void func0f069750(s32 *arg0, s32 arg1, f32 *arg2); void func0f069850(struct defaultobj *obj, struct coord *pos, f32 *realrot, struct geo *geo); void func0f069b4c(struct defaultobj *obj); void func0f069c1c(struct defaultobj *obj); @@ -96,8 +96,8 @@ void func0f069c70(struct defaultobj *obj, bool arg1, bool arg2); u32 func0f069cd8(void); u32 func0f069d38(void); u32 func0f06a170(void); -struct prop *func0f06a1ec(struct singlemonitorobj *monitor, struct model08 *filedata, u32 arg2, u32 arg3); -struct prop *func0f06a52c(struct singlemonitorobj *monitor, struct model08 *model08); +struct prop *func0f06a1ec(struct singlemonitorobj *monitor, struct modelfiledata *filedata, u32 arg2, u32 arg3); +struct prop *func0f06a52c(struct singlemonitorobj *monitor, struct modelfiledata *modelfiledata); struct prop *func0f06a550(struct singlemonitorobj *monitor); u32 func0f06a580(void); f32 func0f06a620(struct defaultobj *obj); @@ -208,9 +208,9 @@ void imageSlotSetImage(struct monitorscreen *screen, u32 arg1); u32 func0f07fbf0(void); u32 func0f07fbf8(void); u32 func0f0809c4(void); -u32 func0f080f8c(void); +Gfx *gfxRenderRadialShadow(Gfx *gdl, f32 x, f32 y, f32 z, f32 angle, f32 size, u32 alpha); u32 func0f081220(void); -Gfx *propobjRender(struct prop *prop, Gfx *gdl, bool arg2); +Gfx *propobjRender(struct prop *prop, Gfx *gdl, bool withalpha); u32 func0f081c18(void); u32 func0f081ccc(void); u32 func0f0826cc(void); @@ -262,7 +262,7 @@ u32 func0f088840(struct prop *prop, bool showhudmsg); u32 func0f089014(void); bool func0f0899dc(struct prop *prop, f32 *arg0, f32 *arg1, f32 *arg2); void func0f089a94(bool arg0, struct model *model); -void func0f089c70(struct hatobj *hat, struct chrdata *chr, struct model08 *filedata, u32 arg3, u32 arg4); +void func0f089c70(struct hatobj *hat, struct chrdata *chr, struct modelfiledata *filedata, u32 arg3, u32 arg4); void func0f089d64(struct hatobj *hat, struct chrdata *chr); void hatAssignToChr(struct hatobj *hat, struct chrdata *chr); u32 chrTryEquipHat(struct chrdata *chr, u32 model, u32 flags); @@ -281,7 +281,7 @@ void propweaponSetDual(struct weaponobj *weapon1, struct weaponobj *weapon2); u32 func0f08adc8(void); u32 func0f08ae0c(void); u32 func0f08ae54(struct defaultobj *obj, struct chrdata *chr); -u32 func0f08b108(struct weaponobj *weapon, struct chrdata *chr, struct model08 *model08, u32 arg3, u32 arg4); +u32 func0f08b108(struct weaponobj *weapon, struct chrdata *chr, struct modelfiledata *modelfiledata, u32 arg3, u32 arg4); void func0f08b208(struct weaponobj *weapon, struct chrdata *chr); void func0f08b25c(struct weaponobj *weapon, struct chrdata *chr); u32 func0f08b27c(void); @@ -322,8 +322,8 @@ void doorSetMode(struct doorobj *door, s32 newmode); void doorActivate(struct doorobj *door, s32 newmode); s32 doorIsClosed(struct doorobj *door); s32 doorIsOpen(struct doorobj *door); -u32 func0f08e5a8(void); -u32 func0f08e6bc(void); +s32 func0f08e5a8(s16 *rooms, struct screenbox *box); +f32 func0f08e6bc(struct prop *prop, f32 arg1); u32 func0f08e794(void); bool func0f08e8ac(struct prop *prop, struct coord *coord, f32 arg2, u32 arg3); bool posIsInDrawDistance(struct coord *arg); diff --git a/src/include/game/smoke/smoke.h b/src/include/game/smoke/smoke.h index 815773d80..6fddc0731 100644 --- a/src/include/game/smoke/smoke.h +++ b/src/include/game/smoke/smoke.h @@ -13,7 +13,7 @@ void smokeClearForProp(struct prop *prop); struct smoke *smokeCreateSimple(struct coord *pos, s16 *rooms, s16 type); u32 func0f12e848(struct prop *prop); u32 smokeUpdateZ(struct prop *prop); -Gfx *smokeRender(struct prop *prop, Gfx *gdl, bool arg2); +Gfx *smokeRender(struct prop *prop, Gfx *gdl, bool withalpha); u32 func0f12f5f8(void); #endif diff --git a/src/include/gvars/gvars.h b/src/include/gvars/gvars.h index 8bf568be7..bf8c2aa3b 100644 --- a/src/include/gvars/gvars.h +++ b/src/include/gvars/gvars.h @@ -491,7 +491,7 @@ extern u32 var8009ca84; extern u32 var8009cad0; extern u32 var8009cadc; extern u32 var8009cae0; -extern u8 var8009caec; +extern u8 var8009caec[4]; extern u8 var8009caf0; extern struct var8009cb08 var8009cb08[6]; extern u32 var8009cbf8; diff --git a/src/include/lib/lib_1a500.h b/src/include/lib/lib_1a500.h index 18aeeda2f..b0a9fa9f7 100644 --- a/src/include/lib/lib_1a500.h +++ b/src/include/lib/lib_1a500.h @@ -14,8 +14,8 @@ u32 func0001a740(void); u32 func0001a784(void); u32 func0001a7cc(void); u32 func0001a85c(void); -struct modelnode *modelGetPart(struct model08 *arg0, s32 partnum); -union modelnode_data *modelGetPartNodeData(struct model08 *model08, s32 partnum); +struct modelnode *modelGetPart(struct modelfiledata *arg0, s32 partnum); +union modelnode_data *modelGetPartNodeData(struct modelfiledata *modelfiledata, s32 partnum); u32 func0001a9e8(void); void *modelGetNodeData(struct model *model, struct modelnode *node); void modelNodeGetPosition(struct model *model, struct modelnode *node, struct coord *pos); @@ -88,7 +88,7 @@ u32 func00020f30(void); u32 func0002124c(void); u32 func000216cc(void); u32 func0002170c(void); -u32 func00021ef4(void); +void modelRender(struct modelrenderdata *renderdata, struct model *model); u32 func000220fc(void); u32 func000225d4(void); u32 func000227a4(void); diff --git a/src/include/types.h b/src/include/types.h index 2be82461a..436919a9b 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -275,7 +275,7 @@ struct modelnode { /*0x14*/ struct modelnode *child; }; -struct model08 { // raw model file data +struct modelfiledata { struct modelnode *rootnode; struct stagethinglist *unk04; @@ -292,7 +292,7 @@ struct model { /*0x00*/ u8 unk00; /*0x01*/ u8 unk01; /*0x04*/ struct chrdata *chr; - /*0x08*/ struct model08 *unk08; + /*0x08*/ struct modelfiledata *filedata; /*0x0c*/ Mtxf *unk0c; /*0x10*/ void **datas; // array of pointers to modeldata structs /*0x14*/ f32 unk14; @@ -331,7 +331,7 @@ struct modeldata_05 { }; struct modeldata_headspot { // type 0x17 - struct model08 *model08; + struct modelfiledata *modelfiledata; void *datas; }; @@ -2188,10 +2188,8 @@ struct player { /*0x0004*/ struct coord memcampos; /*0x0010*/ u16 visionmode; /*0x0014*/ s32 memcamroom; - /*0x0018*/ u32 unk0018; - /*0x001c*/ u32 unk001c; - /*0x0020*/ u32 unk0020; - /*0x0024*/ u32 unk0024; + /*0x0018*/ struct coord eraserpos; + /*0x0024*/ f32 eraserpropdist; /*0x0028*/ u32 unk0028; /*0x002c*/ u32 unk002c; /*0x0030*/ bool isfalling; @@ -2335,7 +2333,10 @@ struct player { /*0x0264*/ struct weaponobj *slayerrocket; /*0x0268*/ bool eyesshut; /*0x026c*/ f32 eyesshutfrac; - /*0x0270*/ u32 unk0270; + /*0x0270*/ u8 epcol_0; + /*0x0270*/ u8 epcol_1; + /*0x0270*/ u8 epcol_2; + /*0x0270*/ u8 flashbang; /*0x0274*/ bool waitforzrelease; /*0x0278*/ f32 shieldshowrot; /*0x027c*/ u32 shieldshowrnd; @@ -4931,7 +4932,7 @@ struct chrnumaction { }; struct propdefinition { - struct model08 *filedata; + struct modelfiledata *filedata; u16 fileid; u16 scale; }; @@ -5887,6 +5888,26 @@ struct objticksp476 { /*0x3c*/ u32 unk3c; }; +// Suspected to be the same as objticksp476 +struct modelrenderdata { + /*0x00*/ u32 unk00; + /*0x04*/ s32 unk04; + /*0x08*/ u32 unk08; + /*0x0c*/ Gfx *gdl; + /*0x10*/ u32 unk10; + /*0x14*/ u32 unk14; + /*0x18*/ u32 unk18; + /*0x1c*/ u32 unk1c; + /*0x20*/ u32 unk20; + /*0x24*/ u32 unk24; + /*0x28*/ u32 unk28; + /*0x2c*/ u32 unk2c; + /*0x30*/ u32 unk30; + /*0x34*/ u32 colour34; + /*0x38*/ u32 colour38; + /*0x3c*/ u32 unk3c; +}; + struct rend_vidat { /*0x00*/ void *unk00; /*0x04*/ u16 x; diff --git a/src/lib/lib_1a500.c b/src/lib/lib_1a500.c index 35e620403..846cdc713 100644 --- a/src/lib/lib_1a500.c +++ b/src/lib/lib_1a500.c @@ -374,26 +374,26 @@ glabel func0001a85c /* 1a918: 00601025 */ or $v0,$v1,$zero ); -struct modelnode *modelGetPart(struct model08 *model08, s32 partnum) +struct modelnode *modelGetPart(struct modelfiledata *modelfiledata, s32 partnum) { s32 upper; s32 lower; u32 i; s16 *partnums; - if (model08->numparts == 0) { + if (modelfiledata->numparts == 0) { return NULL; } - partnums = (s16 *)&model08->parts[model08->numparts]; + partnums = (s16 *)&modelfiledata->parts[modelfiledata->numparts]; lower = 0; - upper = model08->numparts; + upper = modelfiledata->numparts; while (upper >= lower) { i = (lower + upper) / 2; if (partnum == partnums[i]) { - return model08->parts[i]; + return modelfiledata->parts[i]; } if (partnum < partnums[i]) { @@ -406,9 +406,9 @@ struct modelnode *modelGetPart(struct model08 *model08, s32 partnum) return NULL; } -union modelnode_data *modelGetPartNodeData(struct model08 *model08, s32 partnum) +union modelnode_data *modelGetPartNodeData(struct modelfiledata *modelfiledata, s32 partnum) { - struct modelnode *node = modelGetPart(model08, partnum); + struct modelnode *node = modelGetPart(modelfiledata, partnum); if (node) { return node->data; @@ -558,12 +558,12 @@ void modelNodeSetPosition(struct model *model, struct modelnode *node, struct co void modelGetRootPosition(struct model *model, struct coord *pos) { - modelNodeGetPosition(model, model->unk08->rootnode, pos); + modelNodeGetPosition(model, model->filedata->rootnode, pos); } void modelSetRootPosition(struct model *model, struct coord *pos) { - modelNodeSetPosition(model, model->unk08->rootnode, pos); + modelNodeSetPosition(model, model->filedata->rootnode, pos); } GLOBAL_ASM( @@ -634,8 +634,8 @@ glabel func0001ad5c f32 func0001ae44(struct model *model) { - if ((model->unk08->rootnode->type & 0xff) == MODELNODETYPE_ROOT) { - struct modeldata_root *data = modelGetNodeData(model, model->unk08->rootnode); + if ((model->filedata->rootnode->type & 0xff) == MODELNODETYPE_ROOT) { + struct modeldata_root *data = modelGetNodeData(model, model->filedata->rootnode); return data->unk14; } @@ -644,8 +644,8 @@ f32 func0001ae44(struct model *model) void func0001ae90(struct model *model, f32 angle) { - if ((model->unk08->rootnode->type & 0xff) == MODELNODETYPE_ROOT) { - struct modeldata_root *data = modelGetNodeData(model, model->unk08->rootnode); + if ((model->filedata->rootnode->type & 0xff) == MODELNODETYPE_ROOT) { + struct modeldata_root *data = modelGetNodeData(model, model->filedata->rootnode); f32 diff = angle - data->unk14; if (diff < 0) { @@ -682,7 +682,7 @@ void modelSetAnimScale(struct model *model, f32 scale) f32 func0001af80(struct model *model) { - return model->unk08->unk10 * model->unk14; + return model->filedata->unk10 * model->unk14; } GLOBAL_ASM( @@ -962,7 +962,7 @@ glabel func0001b0e8 void func0001b3bc(struct model *model) { - struct modelnode *node = model->unk08->rootnode; + struct modelnode *node = model->filedata->rootnode; if (node && (node->type & 0xff) == MODELNODETYPE_ROOT) { func0001b0e8(model, node); @@ -3494,7 +3494,7 @@ void modelCopyAnimForMerge(struct model *model, f32 arg1) return; } - node = model->unk08->rootnode; + node = model->filedata->rootnode; nodetype = node->type & 0xff; anim->frame2 = anim->frame; @@ -8352,7 +8352,7 @@ glabel var70054454 ); GLOBAL_ASM( -glabel func00021ef4 +glabel modelRender .late_rodata glabel var70054458 .word 0x7002209c