From 3a195050e4e32b889af8b8d6e539a5e0a95dcc2c Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 1 Aug 2020 22:48:33 +1000 Subject: [PATCH] Decompile frEndSession --- src/game/data/data_02e820.c | 4 +- src/game/explosion.c | 32 +-- src/game/game_013010.c | 16 +- src/game/game_015280.c | 4 +- src/game/game_0601b0.c | 10 +- src/game/game_167ae0.c | 2 +- src/game/game_190260.c | 4 +- src/game/game_19c990.c | 374 ++++++++++----------------------- src/game/game_1a3340.c | 8 +- src/game/propobj.c | 7 +- src/gvars/gvars.c | 4 +- src/include/game/game_0601b0.h | 6 +- src/include/game/game_157db0.h | 2 +- src/include/game/game_19c990.h | 4 +- src/include/game/game_1a3340.h | 2 +- src/include/game/propobj.h | 2 +- src/include/gvars/gvars.h | 4 +- src/include/types.h | 21 +- 18 files changed, 190 insertions(+), 316 deletions(-) diff --git a/src/game/data/data_02e820.c b/src/game/data/data_02e820.c index bfca1cd37..772099abe 100644 --- a/src/game/data/data_02e820.c +++ b/src/game/data/data_02e820.c @@ -92,7 +92,7 @@ struct menuitem menuitems_frtraininginfo[] = { { MENUITEMTYPE_SCROLLABLE, DESCRIPTION_FRWEAPON, 0x00004000, 0x0000010e, 0x0000005f, NULL }, { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000028, L_OPTIONS(3), L_MPMENU(428), frDetailsOkMenuHandler }, // "", "Resume" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000028, L_OPTIONS(3), L_MPMENU(430), menuhandler001a3448 }, // "", "Abort" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000028, L_OPTIONS(3), L_MPMENU(430), frAbortMenuHandler }, // "", "Abort" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -117,7 +117,7 @@ struct menuitem menuitems_frtraininginfo2[] = { { MENUITEMTYPE_SCROLLABLE, DESCRIPTION_FRWEAPON, 0x00004000, 0x0000010e, 0x0000005f, NULL }, { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000028, L_OPTIONS(3), L_MPMENU(427), frDetailsOkMenuHandler }, // "", "Ok" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000028, L_OPTIONS(3), L_MPMENU(429), menuhandler001a3448 }, // "", "Cancel" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000028, L_OPTIONS(3), L_MPMENU(429), frAbortMenuHandler }, // "", "Cancel" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; diff --git a/src/game/explosion.c b/src/game/explosion.c index 4158b4e16..38cff8b47 100644 --- a/src/game/explosion.c +++ b/src/game/explosion.c @@ -315,13 +315,13 @@ glabel var7f1b5584 /* f12a0c4: 100002f4 */ b .L0f12ac98 /* f12a0c8: 24020001 */ addiu $v0,$zero,0x1 .L0f12a0cc: -/* f12a0cc: 3c05800a */ lui $a1,%hi(var800a3434) -/* f12a0d0: 8ca53434 */ lw $a1,%lo(var800a3434)($a1) +/* f12a0cc: 3c05800a */ lui $a1,%hi(g_NumExplosions) +/* f12a0d0: 8ca53434 */ lw $a1,%lo(g_NumExplosions)($a1) /* f12a0d4: 24070001 */ addiu $a3,$zero,0x1 /* f12a0d8: 00008825 */ or $s1,$zero,$zero /* f12a0dc: 18a0000d */ blez $a1,.L0f12a114 -/* f12a0e0: 3c04800a */ lui $a0,%hi(var800a3430) -/* f12a0e4: 8c843430 */ lw $a0,%lo(var800a3430)($a0) +/* f12a0e0: 3c04800a */ lui $a0,%hi(g_Explosions) +/* f12a0e4: 8c843430 */ lw $a0,%lo(g_Explosions)($a0) /* f12a0e8: 00001825 */ or $v1,$zero,$zero /* f12a0ec: 00801025 */ or $v0,$a0,$zero .L0f12a0f0: @@ -341,8 +341,8 @@ glabel var7f1b5584 /* f12a11c: 02c03025 */ or $a2,$s6,$zero /* f12a120: 18a00010 */ blez $a1,.L0f12a164 /* f12a124: 00008825 */ or $s1,$zero,$zero -/* f12a128: 3c02800a */ lui $v0,%hi(var800a3430) -/* f12a12c: 8c423430 */ lw $v0,%lo(var800a3430)($v0) +/* f12a128: 3c02800a */ lui $v0,%hi(g_Explosions) +/* f12a12c: 8c423430 */ lw $v0,%lo(g_Explosions)($v0) .L0f12a130: /* f12a130: 804e03cc */ lb $t6,0x3cc($v0) /* f12a134: 54ee0008 */ bnel $a3,$t6,.L0f12a158 @@ -360,9 +360,9 @@ glabel var7f1b5584 /* f12a160: 24420478 */ addiu $v0,$v0,1144 .L0f12a164: /* f12a164: 04c00011 */ bltz $a2,.L0f12a1ac -/* f12a168: 3c11800a */ lui $s1,%hi(var800a3430) +/* f12a168: 3c11800a */ lui $s1,%hi(g_Explosions) /* f12a16c: 000680c0 */ sll $s0,$a2,0x3 -/* f12a170: 26313430 */ addiu $s1,$s1,%lo(var800a3430) +/* f12a170: 26313430 */ addiu $s1,$s1,%lo(g_Explosions) /* f12a174: 02068021 */ addu $s0,$s0,$a2 /* f12a178: 8e2f0000 */ lw $t7,0x0($s1) /* f12a17c: 00108100 */ sll $s0,$s0,0x4 @@ -1194,16 +1194,16 @@ glabel var7f1b558c /* f12ad90: 4600a306 */ mov.s $f12,$f20 /* f12ad94: c6320008 */ lwc1 $f18,0x8($s1) /* f12ad98: c6280000 */ lwc1 $f8,0x0($s1) -/* f12ad9c: 3c04800a */ lui $a0,%hi(var800a3434) +/* f12ad9c: 3c04800a */ lui $a0,%hi(g_NumExplosions) /* f12ada0: 46009102 */ mul.s $f4,$f18,$f0 -/* f12ada4: 8c843434 */ lw $a0,%lo(var800a3434)($a0) +/* f12ada4: 8c843434 */ lw $a0,%lo(g_NumExplosions)($a0) /* f12ada8: 4480b000 */ mtc1 $zero,$f22 /* f12adac: 4608c182 */ mul.s $f6,$f24,$f8 -/* f12adb0: 3c14800a */ lui $s4,%hi(var800a3430) -/* f12adb4: 26943430 */ addiu $s4,$s4,%lo(var800a3430) +/* f12adb0: 3c14800a */ lui $s4,%hi(g_Explosions) +/* f12adb4: 26943430 */ addiu $s4,$s4,%lo(g_Explosions) /* f12adb8: 00008825 */ or $s1,$zero,$zero /* f12adbc: 00008025 */ or $s0,$zero,$zero -/* f12adc0: 3c02800a */ lui $v0,%hi(var800a3430) +/* f12adc0: 3c02800a */ lui $v0,%hi(g_Explosions) /* f12adc4: 3c014170 */ lui $at,0x4170 /* f12adc8: 46062280 */ add.s $f10,$f4,$f6 /* f12adcc: 2415002c */ addiu $s5,$zero,0x2c @@ -1215,7 +1215,7 @@ glabel var7f1b558c /* f12ade4: 3c138008 */ lui $s3,%hi(g_ExplosionTypes) /* f12ade8: 2673e4b8 */ addiu $s3,$s3,%lo(g_ExplosionTypes) /* f12adec: c438558c */ lwc1 $f24,%lo(var7f1b558c)($at) -/* f12adf0: 8c423430 */ lw $v0,%lo(var800a3430)($v0) +/* f12adf0: 8c423430 */ lw $v0,%lo(g_Explosions)($v0) .L0f12adf4: /* f12adf4: 8c430000 */ lw $v1,0x0($v0) /* f12adf8: 50600022 */ beqzl $v1,.L0f12ae84 @@ -1242,8 +1242,8 @@ glabel var7f1b558c /* f12ae4c: 4600c086 */ mov.s $f2,$f24 /* f12ae50: 8e8f0000 */ lw $t7,0x0($s4) .L0f12ae54: -/* f12ae54: 3c04800a */ lui $a0,%hi(var800a3434) -/* f12ae58: 8c843434 */ lw $a0,%lo(var800a3434)($a0) +/* f12ae54: 3c04800a */ lui $a0,%hi(g_NumExplosions) +/* f12ae58: 8c843434 */ lw $a0,%lo(g_NumExplosions)($a0) /* f12ae5c: 01f11021 */ addu $v0,$t7,$s1 /* f12ae60: 805803cc */ lb $t8,0x3cc($v0) /* f12ae64: 03150019 */ multu $t8,$s5 diff --git a/src/game/game_013010.c b/src/game/game_013010.c index f7ce0d52b..97018f754 100644 --- a/src/game/game_013010.c +++ b/src/game/game_013010.c @@ -19,9 +19,9 @@ glabel func0f013010 /* f01301c: ac20e4a4 */ sw $zero,%lo(var8007e4a4)($at) /* f013020: 3c013f80 */ lui $at,0x3f80 /* f013024: 44812000 */ mtc1 $at,$f4 -/* f013028: 3c08800a */ lui $t0,%hi(var800a3434) +/* f013028: 3c08800a */ lui $t0,%hi(g_NumExplosions) /* f01302c: 3c018008 */ lui $at,0x8008 -/* f013030: 25083434 */ addiu $t0,$t0,%lo(var800a3434) +/* f013030: 25083434 */ addiu $t0,$t0,%lo(g_NumExplosions) /* f013034: 240e0006 */ addiu $t6,$zero,0x6 /* f013038: e424e4a8 */ swc1 $f4,-0x1b58($at) /* f01303c: ad0e0000 */ sw $t6,0x0($t0) @@ -31,11 +31,11 @@ glabel func0f013010 /* f01304c: afbf0014 */ sw $ra,0x14($sp) /* f013050: 29e1005a */ slti $at,$t7,0x5a /* f013054: 14200002 */ bnez $at,.L0f013060 -/* f013058: 3c05800a */ lui $a1,%hi(var800a3430) +/* f013058: 3c05800a */ lui $a1,%hi(g_Explosions) /* f01305c: ad000000 */ sw $zero,0x0($t0) .L0f013060: /* f013060: 8d020000 */ lw $v0,0x0($t0) -/* f013064: 24a53430 */ addiu $a1,$a1,%lo(var800a3430) +/* f013064: 24a53430 */ addiu $a1,$a1,%lo(g_Explosions) /* f013068: 54400004 */ bnezl $v0,.L0f01307c /* f01306c: 000220c0 */ sll $a0,$v0,0x3 /* f013070: 1000002b */ b .L0f013120 @@ -52,11 +52,11 @@ glabel func0f013010 /* f013098: 03002025 */ or $a0,$t8,$zero /* f01309c: 0c0048f2 */ jal malloc /* f0130a0: 24050004 */ addiu $a1,$zero,0x4 -/* f0130a4: 3c08800a */ lui $t0,%hi(var800a3434) -/* f0130a8: 25083434 */ addiu $t0,$t0,%lo(var800a3434) +/* f0130a4: 3c08800a */ lui $t0,%hi(g_NumExplosions) +/* f0130a8: 25083434 */ addiu $t0,$t0,%lo(g_NumExplosions) /* f0130ac: 8d190000 */ lw $t9,0x0($t0) -/* f0130b0: 3c05800a */ lui $a1,%hi(var800a3430) -/* f0130b4: 24a53430 */ addiu $a1,$a1,%lo(var800a3430) +/* f0130b0: 3c05800a */ lui $a1,%hi(g_Explosions) +/* f0130b4: 24a53430 */ addiu $a1,$a1,%lo(g_Explosions) /* f0130b8: aca20000 */ sw $v0,0x0($a1) /* f0130bc: 1b200018 */ blez $t9,.L0f013120 /* f0130c0: 00002025 */ or $a0,$zero,$zero diff --git a/src/game/game_015280.c b/src/game/game_015280.c index 218221300..bdf1163e0 100644 --- a/src/game/game_015280.c +++ b/src/game/game_015280.c @@ -23,8 +23,8 @@ glabel func0f015280 /* f015298: afb00018 */ sw $s0,0x18($sp) /* f01529c: 0c002a94 */ jal func0000aa50 /* f0152a0: ac20e4a0 */ sw $zero,%lo(var8007e4a0)($at) -/* f0152a4: 3c11800a */ lui $s1,%hi(var800a3430) -/* f0152a8: 26313430 */ addiu $s1,$s1,%lo(var800a3430) +/* f0152a4: 3c11800a */ lui $s1,%hi(g_Explosions) +/* f0152a8: 26313430 */ addiu $s1,$s1,%lo(g_Explosions) /* f0152ac: 8e2e0000 */ lw $t6,0x0($s1) /* f0152b0: 00008025 */ or $s0,$zero,$zero /* f0152b4: 24121ad0 */ addiu $s2,$zero,0x1ad0 diff --git a/src/game/game_0601b0.c b/src/game/game_0601b0.c index be0224d52..9ba2fe6de 100644 --- a/src/game/game_0601b0.c +++ b/src/game/game_0601b0.c @@ -6661,22 +6661,22 @@ glabel func0f065dd8 /* f065df8: 00000000 */ nop ); -void func0f065dfc(struct coord *pos, s16 *rooms, struct coord *newpos, s16 *newrooms, u32 arg4, u32 arg5) +void func0f065dfc(struct coord *pos, s16 *rooms, struct coord *newpos, s16 *newrooms, s16 *morerooms, u32 arg5) { - func0f065d1c(pos, rooms, newpos, newrooms, arg4, arg5); + func0f065d1c(pos, rooms, newpos, newrooms, morerooms, arg5); if (newrooms[0] == -1) { func0f065e98(pos, rooms, newpos, newrooms); - if (arg4) { - func0f0657d8(newrooms, arg4, arg5); + if (morerooms) { + func0f0657d8(newrooms, morerooms, arg5); } } } void func0f065e74(struct coord *pos, s16 *rooms, struct coord *newpos, s16 *newrooms) { - func0f065dfc(pos, rooms, newpos, newrooms, 0, 0); + func0f065dfc(pos, rooms, newpos, newrooms, NULL, 0); } GLOBAL_ASM( diff --git a/src/game/game_167ae0.c b/src/game/game_167ae0.c index 497c8c07b..2a1228768 100644 --- a/src/game/game_167ae0.c +++ b/src/game/game_167ae0.c @@ -995,7 +995,7 @@ glabel var7f1b784c // pass = true; // break; // case WEAPON_DRAGON: -// if (weapon->dragonthrown == 1U) { +// if (weapon->thrown == 1U) { // pass = true; // } // break; diff --git a/src/game/game_190260.c b/src/game/game_190260.c index 78e6f293e..bd01aa877 100644 --- a/src/game/game_190260.c +++ b/src/game/game_190260.c @@ -565,7 +565,7 @@ u32 propobjHandlePickupByAibot(struct prop *prop, struct chrdata *chr) qty = weaponGetPickupAmmoQty(weapon); if (qty) { - aibotGiveAmmoByWeapon(chr->aibot, weapon->weaponnum, weapon->dragonthrown, qty); + aibotGiveAmmoByWeapon(chr->aibot, weapon->weaponnum, weapon->thrown, qty); } if (itemtype) { @@ -1067,7 +1067,7 @@ s32 mpObjIsSafe(struct defaultobj *obj) weapon->weaponnum == WEAPON_REMOTEMINE || weapon->weaponnum == WEAPON_TIMEDMINE || weapon->weaponnum == WEAPON_ROCKET2 || - (weapon->weaponnum == WEAPON_DRAGON && weapon->dragonthrown == 1)) { + (weapon->weaponnum == WEAPON_DRAGON && weapon->thrown == 1)) { return false; } diff --git a/src/game/game_19c990.c b/src/game/game_19c990.c index bc45ac371..5423a61da 100644 --- a/src/game/game_19c990.c +++ b/src/game/game_19c990.c @@ -2081,259 +2081,115 @@ char *frGetWeaponDescription(void) return NULL; } -GLOBAL_ASM( -glabel func0f19ecdc -/* f19ecdc: 27bdfd60 */ addiu $sp,$sp,-672 -/* f19ece0: 3c0e8009 */ lui $t6,%hi(var80088808) -/* f19ece4: 91ce8808 */ lbu $t6,%lo(var80088808)($t6) -/* f19ece8: afb00018 */ sw $s0,0x18($sp) -/* f19ecec: 00808025 */ or $s0,$a0,$zero -/* f19ecf0: afbf002c */ sw $ra,0x2c($sp) -/* f19ecf4: afb40028 */ sw $s4,0x28($sp) -/* f19ecf8: afb30024 */ sw $s3,0x24($sp) -/* f19ecfc: afb20020 */ sw $s2,0x20($sp) -/* f19ed00: 11c000cf */ beqz $t6,.L0f19f040 -/* f19ed04: afb1001c */ sw $s1,0x1c($sp) -/* f19ed08: 0fc2556c */ jal objFindByTagId -/* f19ed0c: 2404007f */ addiu $a0,$zero,0x7f -/* f19ed10: 10400006 */ beqz $v0,.L0f19ed2c -/* f19ed14: 00000000 */ nop -/* f19ed18: 8c4f0008 */ lw $t7,0x8($v0) -/* f19ed1c: 3c01fdff */ lui $at,0xfdff -/* f19ed20: 3421ffff */ ori $at,$at,0xffff -/* f19ed24: 01e1c024 */ and $t8,$t7,$at -/* f19ed28: ac580008 */ sw $t8,0x8($v0) -.L0f19ed2c: -/* f19ed2c: 0fc679d5 */ jal frUnlockDoor -/* f19ed30: 00000000 */ nop -/* f19ed34: 3c14800a */ lui $s4,%hi(g_Vars) -/* f19ed38: 26949fc0 */ addiu $s4,$s4,%lo(g_Vars) -/* f19ed3c: 8e820284 */ lw $v0,0x284($s4) -/* f19ed40: 24010002 */ addiu $at,$zero,0x2 -/* f19ed44: 94590010 */ lhu $t9,0x10($v0) -/* f19ed48: 17210002 */ bne $t9,$at,.L0f19ed54 -/* f19ed4c: 00000000 */ nop -/* f19ed50: a4400010 */ sh $zero,0x10($v0) -.L0f19ed54: -/* f19ed54: 0fc2a4ab */ jal playersSetPassiveMode -/* f19ed58: 24040001 */ addiu $a0,$zero,0x1 -/* f19ed5c: 3c018009 */ lui $at,%hi(var80088804) -/* f19ed60: 0fc67505 */ jal func0f19d414 -/* f19ed64: a0208804 */ sb $zero,%lo(var80088804)($at) -/* f19ed68: 12000003 */ beqz $s0,.L0f19ed78 -/* f19ed6c: 00000000 */ nop -/* f19ed70: 0fc678f8 */ jal frHideAllTargets -/* f19ed74: 00000000 */ nop -.L0f19ed78: -/* f19ed78: 3c048007 */ lui $a0,%hi(g_ThrownLaptops) -/* f19ed7c: 8c849968 */ lw $a0,%lo(g_ThrownLaptops)($a0) -/* f19ed80: 8c890014 */ lw $t1,0x14($a0) -/* f19ed84: 51200004 */ beqzl $t1,.L0f19ed98 -/* f19ed88: 8e8a0284 */ lw $t2,0x284($s4) -/* f19ed8c: 0fc1acd3 */ jal setupParseObjectWithArg2False -/* f19ed90: 24050001 */ addiu $a1,$zero,0x1 -/* f19ed94: 8e8a0284 */ lw $t2,0x284($s4) -.L0f19ed98: -/* f19ed98: 27b2006c */ addiu $s2,$sp,0x6c -/* f19ed9c: 02402825 */ or $a1,$s2,$zero -/* f19eda0: 8d4400bc */ lw $a0,0xbc($t2) -/* f19eda4: 0fc195e9 */ jal roomsCopy -/* f19eda8: 24840028 */ addiu $a0,$a0,0x28 -/* f19edac: 8e8b0284 */ lw $t3,0x284($s4) -/* f19edb0: 2401ffff */ addiu $at,$zero,-1 -/* f19edb4: 00008825 */ or $s1,$zero,$zero -/* f19edb8: 8d6200bc */ lw $v0,0xbc($t3) -/* f19edbc: 00008025 */ or $s0,$zero,$zero -/* f19edc0: 844c0028 */ lh $t4,0x28($v0) -/* f19edc4: 51810014 */ beql $t4,$at,.L0f19ee18 -/* f19edc8: 27b00098 */ addiu $s0,$sp,0x98 -/* f19edcc: 84440028 */ lh $a0,0x28($v0) -/* f19edd0: 27b10054 */ addiu $s1,$sp,0x54 -/* f19edd4: 02202825 */ or $a1,$s1,$zero -.L0f19edd8: -/* f19edd8: 0fc5916a */ jal func0f1645a8 -/* f19eddc: 2406000a */ addiu $a2,$zero,0xa -/* f19ede0: 02202025 */ or $a0,$s1,$zero -/* f19ede4: 02402825 */ or $a1,$s2,$zero -/* f19ede8: 0fc195f6 */ jal func0f0657d8 -/* f19edec: 24060014 */ addiu $a2,$zero,0x14 -/* f19edf0: 8e8d0284 */ lw $t5,0x284($s4) -/* f19edf4: 26100002 */ addiu $s0,$s0,0x2 -/* f19edf8: 2401ffff */ addiu $at,$zero,-1 -/* f19edfc: 8dae00bc */ lw $t6,0xbc($t5) -/* f19ee00: 01d07821 */ addu $t7,$t6,$s0 -/* f19ee04: 85e40028 */ lh $a0,0x28($t7) -/* f19ee08: 5481fff3 */ bnel $a0,$at,.L0f19edd8 -/* f19ee0c: 02202825 */ or $a1,$s1,$zero -/* f19ee10: 00008825 */ or $s1,$zero,$zero -/* f19ee14: 27b00098 */ addiu $s0,$sp,0x98 -.L0f19ee18: -/* f19ee18: 02002825 */ or $a1,$s0,$zero -/* f19ee1c: 02402025 */ or $a0,$s2,$zero -/* f19ee20: 0fc197e0 */ jal roomGetProps -/* f19ee24: 24060100 */ addiu $a2,$zero,0x100 -/* f19ee28: 87b80098 */ lh $t8,0x98($sp) -/* f19ee2c: 02009025 */ or $s2,$s0,$zero -/* f19ee30: 27b90098 */ addiu $t9,$sp,0x98 -/* f19ee34: 07000042 */ bltz $t8,.L0f19ef40 -/* f19ee38: 24130001 */ addiu $s3,$zero,0x1 -/* f19ee3c: 87230000 */ lh $v1,0x0($t9) -/* f19ee40: 8e8a0338 */ lw $t2,0x338($s4) -.L0f19ee44: -/* f19ee44: 000348c0 */ sll $t1,$v1,0x3 -/* f19ee48: 01234821 */ addu $t1,$t1,$v1 -/* f19ee4c: 000948c0 */ sll $t1,$t1,0x3 -/* f19ee50: 012a1021 */ addu $v0,$t1,$t2 -/* f19ee54: 50400037 */ beqzl $v0,.L0f19ef34 -/* f19ee58: 86430002 */ lh $v1,0x2($s2) -/* f19ee5c: 904b0000 */ lbu $t3,0x0($v0) -/* f19ee60: 24010004 */ addiu $at,$zero,0x4 -/* f19ee64: 8c500004 */ lw $s0,0x4($v0) -/* f19ee68: 55610032 */ bnel $t3,$at,.L0f19ef34 -/* f19ee6c: 86430002 */ lh $v1,0x2($s2) -/* f19ee70: 92020003 */ lbu $v0,0x3($s0) -/* f19ee74: 2401000d */ addiu $at,$zero,0xd -/* f19ee78: 02002025 */ or $a0,$s0,$zero -/* f19ee7c: 54410005 */ bnel $v0,$at,.L0f19ee94 -/* f19ee80: 24010008 */ addiu $at,$zero,0x8 -/* f19ee84: 0fc1acd3 */ jal setupParseObjectWithArg2False -/* f19ee88: 02602825 */ or $a1,$s3,$zero -/* f19ee8c: 92020003 */ lbu $v0,0x3($s0) -/* f19ee90: 24010008 */ addiu $at,$zero,0x8 -.L0f19ee94: -/* f19ee94: 54410027 */ bnel $v0,$at,.L0f19ef34 -/* f19ee98: 86430002 */ lh $v1,0x2($s2) -/* f19ee9c: 9202005c */ lbu $v0,0x5c($s0) -/* f19eea0: 2401001f */ addiu $at,$zero,0x1f -/* f19eea4: 02002025 */ or $a0,$s0,$zero -/* f19eea8: 1041001f */ beq $v0,$at,.L0f19ef28 -/* f19eeac: 24010056 */ addiu $at,$zero,0x56 -/* f19eeb0: 1041001d */ beq $v0,$at,.L0f19ef28 -/* f19eeb4: 2401001a */ addiu $at,$zero,0x1a -/* f19eeb8: 1041001b */ beq $v0,$at,.L0f19ef28 -/* f19eebc: 24010054 */ addiu $at,$zero,0x54 -/* f19eec0: 10410019 */ beq $v0,$at,.L0f19ef28 -/* f19eec4: 2401001e */ addiu $at,$zero,0x1e -/* f19eec8: 10410017 */ beq $v0,$at,.L0f19ef28 -/* f19eecc: 24010055 */ addiu $at,$zero,0x55 -/* f19eed0: 10410015 */ beq $v0,$at,.L0f19ef28 -/* f19eed4: 24010021 */ addiu $at,$zero,0x21 -/* f19eed8: 10410013 */ beq $v0,$at,.L0f19ef28 -/* f19eedc: 24010022 */ addiu $at,$zero,0x22 -/* f19eee0: 10410011 */ beq $v0,$at,.L0f19ef28 -/* f19eee4: 24010053 */ addiu $at,$zero,0x53 -/* f19eee8: 1041000f */ beq $v0,$at,.L0f19ef28 -/* f19eeec: 24010020 */ addiu $at,$zero,0x20 -/* f19eef0: 1041000d */ beq $v0,$at,.L0f19ef28 -/* f19eef4: 24010058 */ addiu $at,$zero,0x58 -/* f19eef8: 1041000b */ beq $v0,$at,.L0f19ef28 -/* f19eefc: 2401000f */ addiu $at,$zero,0xf -/* f19ef00: 54410004 */ bnel $v0,$at,.L0f19ef14 -/* f19ef04: 2401000e */ addiu $at,$zero,0xe -/* f19ef08: 920c005f */ lbu $t4,0x5f($s0) -/* f19ef0c: 126c0006 */ beq $s3,$t4,.L0f19ef28 -/* f19ef10: 2401000e */ addiu $at,$zero,0xe -.L0f19ef14: -/* f19ef14: 54410007 */ bnel $v0,$at,.L0f19ef34 -/* f19ef18: 86430002 */ lh $v1,0x2($s2) -/* f19ef1c: 920d005f */ lbu $t5,0x5f($s0) -/* f19ef20: 566d0004 */ bnel $s3,$t5,.L0f19ef34 -/* f19ef24: 86430002 */ lh $v1,0x2($s2) -.L0f19ef28: -/* f19ef28: 0fc1acd3 */ jal setupParseObjectWithArg2False -/* f19ef2c: 02602825 */ or $a1,$s3,$zero -/* f19ef30: 86430002 */ lh $v1,0x2($s2) -.L0f19ef34: -/* f19ef34: 26520002 */ addiu $s2,$s2,0x2 -/* f19ef38: 0463ffc2 */ bgezl $v1,.L0f19ee44 -/* f19ef3c: 8e8a0338 */ lw $t2,0x338($s4) -.L0f19ef40: -/* f19ef40: 3c08800a */ lui $t0,%hi(var800a3434) -/* f19ef44: 25083434 */ addiu $t0,$t0,%lo(var800a3434) -/* f19ef48: 8d0e0000 */ lw $t6,0x0($t0) -/* f19ef4c: 00002825 */ or $a1,$zero,$zero -/* f19ef50: 24070100 */ addiu $a3,$zero,0x100 -/* f19ef54: 19c00019 */ blez $t6,.L0f19efbc -/* f19ef58: 240403c0 */ addiu $a0,$zero,0x3c0 -/* f19ef5c: 3c03800a */ lui $v1,%hi(var800a3430) -/* f19ef60: 24633430 */ addiu $v1,$v1,%lo(var800a3430) -/* f19ef64: 8c6f0000 */ lw $t7,0x0($v1) -.L0f19ef68: -/* f19ef68: 00001025 */ or $v0,$zero,$zero -/* f19ef6c: 01e5c021 */ addu $t8,$t7,$a1 -/* f19ef70: a70703c8 */ sh $a3,0x3c8($t8) -.L0f19ef74: -/* f19ef74: 001148c0 */ sll $t1,$s1,0x3 -/* f19ef78: 01314821 */ addu $t1,$t1,$s1 -/* f19ef7c: 8c790000 */ lw $t9,0x0($v1) -/* f19ef80: 00094900 */ sll $t1,$t1,0x4 -/* f19ef84: 01314823 */ subu $t1,$t1,$s1 -/* f19ef88: 000948c0 */ sll $t1,$t1,0x3 -/* f19ef8c: 03295021 */ addu $t2,$t9,$t1 -/* f19ef90: 01425821 */ addu $t3,$t2,$v0 -/* f19ef94: 24420018 */ addiu $v0,$v0,0x18 -/* f19ef98: 1444fff6 */ bne $v0,$a0,.L0f19ef74 -/* f19ef9c: a560001c */ sh $zero,0x1c($t3) -/* f19efa0: 8d0c0000 */ lw $t4,0x0($t0) -/* f19efa4: 26310001 */ addiu $s1,$s1,0x1 -/* f19efa8: 24a50478 */ addiu $a1,$a1,0x478 -/* f19efac: 022c082a */ slt $at,$s1,$t4 -/* f19efb0: 5420ffed */ bnezl $at,.L0f19ef68 -/* f19efb4: 8c6f0000 */ lw $t7,0x0($v1) -/* f19efb8: 00008825 */ or $s1,$zero,$zero -.L0f19efbc: -/* f19efbc: 3c08800a */ lui $t0,%hi(g_NumSmokes) -/* f19efc0: 25083444 */ addiu $t0,$t0,%lo(g_NumSmokes) -/* f19efc4: 8d0d0000 */ lw $t5,0x0($t0) -/* f19efc8: 24070100 */ addiu $a3,$zero,0x100 -/* f19efcc: 00002825 */ or $a1,$zero,$zero -/* f19efd0: 19a0001b */ blez $t5,.L0f19f040 -/* f19efd4: 24040190 */ addiu $a0,$zero,0x190 -/* f19efd8: 3c03800a */ lui $v1,%hi(g_Smokes) -/* f19efdc: 44800000 */ mtc1 $zero,$f0 -/* f19efe0: 24633440 */ addiu $v1,$v1,%lo(g_Smokes) -/* f19efe4: 8c6e0000 */ lw $t6,0x0($v1) -.L0f19efe8: -/* f19efe8: 00001025 */ or $v0,$zero,$zero -/* f19efec: 01c57821 */ addu $t7,$t6,$a1 -/* f19eff0: a5e70004 */ sh $a3,0x4($t7) -.L0f19eff4: -/* f19eff4: 0011c880 */ sll $t9,$s1,0x2 -/* f19eff8: 0331c823 */ subu $t9,$t9,$s1 -/* f19effc: 0019c880 */ sll $t9,$t9,0x2 -/* f19f000: 0331c821 */ addu $t9,$t9,$s1 -/* f19f004: 8c780000 */ lw $t8,0x0($v1) -/* f19f008: 0019c8c0 */ sll $t9,$t9,0x3 -/* f19f00c: 0331c823 */ subu $t9,$t9,$s1 -/* f19f010: 0019c880 */ sll $t9,$t9,0x2 -/* f19f014: 03194821 */ addu $t1,$t8,$t9 -/* f19f018: 01225021 */ addu $t2,$t1,$v0 -/* f19f01c: 24420028 */ addiu $v0,$v0,0x28 -/* f19f020: 1444fff4 */ bne $v0,$a0,.L0f19eff4 -/* f19f024: e5400014 */ swc1 $f0,0x14($t2) -/* f19f028: 8d0b0000 */ lw $t3,0x0($t0) -/* f19f02c: 26310001 */ addiu $s1,$s1,0x1 -/* f19f030: 24a5019c */ addiu $a1,$a1,0x19c -/* f19f034: 022b082a */ slt $at,$s1,$t3 -/* f19f038: 5420ffeb */ bnezl $at,.L0f19efe8 -/* f19f03c: 8c6e0000 */ lw $t6,0x0($v1) -.L0f19f040: -/* f19f040: 3c14800a */ lui $s4,%hi(g_Vars) -/* f19f044: 0fc2eda7 */ jal func0f0bb69c -/* f19f048: 26949fc0 */ addiu $s4,$s4,%lo(g_Vars) -/* f19f04c: 3c013f80 */ lui $at,0x3f80 -/* f19f050: 44812000 */ mtc1 $at,$f4 -/* f19f054: 8e8c0284 */ lw $t4,0x284($s4) -/* f19f058: e58400dc */ swc1 $f4,0xdc($t4) -/* f19f05c: 8fbf002c */ lw $ra,0x2c($sp) -/* f19f060: 8fb40028 */ lw $s4,0x28($sp) -/* f19f064: 8fb30024 */ lw $s3,0x24($sp) -/* f19f068: 8fb20020 */ lw $s2,0x20($sp) -/* f19f06c: 8fb1001c */ lw $s1,0x1c($sp) -/* f19f070: 8fb00018 */ lw $s0,0x18($sp) -/* f19f074: 03e00008 */ jr $ra -/* f19f078: 27bd02a0 */ addiu $sp,$sp,0x2a0 -); +void frEndSession(bool hidetargets) +{ + s32 i; + s32 j; + s16 propnums[256]; + s16 *propnumptr; + s16 rooms[20]; + u32 stack1; + s16 rooms2[10]; + u32 stack2; + + if (var80088808) { + struct defaultobj *terminal = objFindByTagId(0x7f); + + if (terminal) { + terminal->flags &= ~OBJFLAG_CANNOT_ACTIVATE; + } + + frUnlockDoor(); + + if (g_Vars.currentplayer->visionmode == VISIONMODE_SLAYERROCKET) { + g_Vars.currentplayer->visionmode = VISIONMODE_NORMAL; + } + + playersSetPassiveMode(true); + + var80088804 = 0; + + func0f19d414(); + + if (hidetargets) { + frHideAllTargets(); + } + + if (g_ThrownLaptops->base.prop) { + setupParseObjectWithArg2False(g_ThrownLaptops, true); + } + + roomsCopy(g_Vars.currentplayer->prop->rooms, rooms); + + for (i = 0; g_Vars.currentplayer->prop->rooms[i] != -1; i++) { + func0f1645a8(g_Vars.currentplayer->prop->rooms[i], rooms2, 10); + func0f0657d8(rooms2, rooms, 20); + } + + // Remove projectiles and throwables + roomGetProps(rooms, propnums, 256); + + propnumptr = propnums; + + while (*propnumptr >= 0) { + struct prop *prop = &g_Vars.props[*propnumptr]; + + if (prop) { + struct defaultobj *obj = prop->obj; + + if (prop->type == PROPTYPE_WEAPON) { + if (obj->type == OBJTYPE_AUTOGUN) { + setupParseObjectWithArg2False(obj, true); + } + + if (obj->type == OBJTYPE_WEAPON) { + struct weaponobj *weapon = (struct weaponobj *)obj; + + if (weapon->weaponnum == WEAPON_NBOMB + || weapon->weaponnum == WEAPON_BOLT + || weapon->weaponnum == WEAPON_COMBATKNIFE + || weapon->weaponnum == WEAPON_HOMINGROCKET + || weapon->weaponnum == WEAPON_GRENADE + || weapon->weaponnum == WEAPON_GRENADEROUND + || weapon->weaponnum == WEAPON_PROXIMITYMINE + || weapon->weaponnum == WEAPON_REMOTEMINE + || weapon->weaponnum == WEAPON_ROCKET + || weapon->weaponnum == WEAPON_TIMEDMINE + || weapon->weaponnum == WEAPON_ROCKET2 + || (weapon->weaponnum == WEAPON_DRAGON && weapon->thrown == true) + || (weapon->weaponnum == WEAPON_LAPTOPGUN && weapon->thrown == true)) { + setupParseObjectWithArg2False(obj, true); + } + } + } + } + + propnumptr++; + } + + // Remove explosions + for (i = 0; i < g_NumExplosions; i++) { + g_Explosions[i].age = 256; + + for (j = 0; j < 40; j++) { + g_Explosions[i].unk08[j].unk14 = 0; + } + } + + // Remove smoke + for (i = 0; i < g_NumSmokes; i++) { + g_Smokes[i].age = 256; + + for (j = 0; j < 10; j++) { + g_Smokes[i].smokebits[j].size = 0; + } + } + } + + func0f0bb69c(); + + g_Vars.currentplayer->bondhealth = 1; +} bool frWasTooInaccurate(void) { @@ -2355,7 +2211,7 @@ bool frWasTooInaccurate(void) void frSetFailReason(s32 failreason) { - func0f19ecdc(0); + frEndSession(false); g_FiringRangeData.failreason = frWasTooInaccurate() ? FRFAILREASON_INACCURATE : failreason; g_FiringRangeData.unk465_00 = 2; @@ -2364,7 +2220,7 @@ void frSetFailReason(s32 failreason) void func0f19f18c(void) { - func0f19ecdc(0); + frEndSession(false); if (frWasTooInaccurate()) { g_FiringRangeData.failreason = FRFAILREASON_INACCURATE; @@ -2605,7 +2461,7 @@ glabel func0f19f524 /* f19f5dc: 24c6cd20 */ addiu $a2,$a2,%lo(g_FiringRangeData) /* f19f5e0: 8cd90464 */ lw $t9,0x464($a2) /* f19f5e4: 00001025 */ or $v0,$zero,$zero -/* f19f5e8: 3c03800a */ lui $v1,%hi(var800a3430) +/* f19f5e8: 3c03800a */ lui $v1,%hi(g_Explosions) /* f19f5ec: 00197b40 */ sll $t7,$t9,0xd /* f19f5f0: 05e10006 */ bgez $t7,.L0f19f60c /* f19f5f4: 24041ad0 */ addiu $a0,$zero,0x1ad0 @@ -2615,7 +2471,7 @@ glabel func0f19f524 /* f19f604: 100000df */ b .L0f19f984 /* f19f608: a0d90465 */ sb $t9,0x465($a2) .L0f19f60c: -/* f19f60c: 8c633430 */ lw $v1,%lo(var800a3430)($v1) +/* f19f60c: 8c633430 */ lw $v1,%lo(g_Explosions)($v1) .L0f19f610: /* f19f610: 8c6e0000 */ lw $t6,0x0($v1) /* f19f614: 24420478 */ addiu $v0,$v0,0x478 @@ -3092,7 +2948,7 @@ glabel var7f1b94e4 /* f19fc6c: 3c02800a */ lui $v0,%hi(g_Vars+0x284) /* f19fc70: 8c42a244 */ lw $v0,%lo(g_Vars+0x284)($v0) /* f19fc74: 24040001 */ addiu $a0,$zero,0x1 -/* f19fc78: 0fc67b37 */ jal func0f19ecdc +/* f19fc78: 0fc67b37 */ jal frEndSession /* f19fc7c: ac401c08 */ sw $zero,0x1c08($v0) /* f19fc80: 00002025 */ or $a0,$zero,$zero /* f19fc84: 0fc127d2 */ jal chrUnsetStageFlag @@ -3105,7 +2961,7 @@ glabel var7f1b94e4 /* f19fc9c: 8c4c00d8 */ lw $t4,0xd8($v0) /* f19fca0: 51800004 */ beqzl $t4,.L0f19fcb4 /* f19fca4: 8ecd0034 */ lw $t5,0x34($s6) -/* f19fca8: 0fc67b37 */ jal func0f19ecdc +/* f19fca8: 0fc67b37 */ jal frEndSession /* f19fcac: 00002025 */ or $a0,$zero,$zero /* f19fcb0: 8ecd0034 */ lw $t5,0x34($s6) .L0f19fcb4: diff --git a/src/game/game_1a3340.c b/src/game/game_1a3340.c index db9f80bc3..f19e380bc 100644 --- a/src/game/game_1a3340.c +++ b/src/game/game_1a3340.c @@ -78,11 +78,11 @@ s32 frDetailsOkMenuHandler(u32 operation, struct menuitem *item, s32 *value) return 0; } -s32 menuhandler001a3448(u32 operation, struct menuitem *item, s32 *value) +s32 frAbortMenuHandler(u32 operation, struct menuitem *item, s32 *value) { if (operation == MENUOP_SET) { if (frIsInTraining()) { - func0f19ecdc(1); + frEndSession(true); } } @@ -559,7 +559,7 @@ glabel var7f1b9944 /* f1a3acc: 00000000 */ nop /* f1a3ad0: 54400004 */ bnezl $v0,.L0f1a3ae4 /* f1a3ad4: 8fbf0014 */ lw $ra,0x14($sp) -/* f1a3ad8: 0fc67b37 */ jal func0f19ecdc +/* f1a3ad8: 0fc67b37 */ jal frEndSession /* f1a3adc: 24040001 */ addiu $a0,$zero,0x1 .L0f1a3ae0: /* f1a3ae0: 8fbf0014 */ lw $ra,0x14($sp) @@ -582,7 +582,7 @@ glabel menudialog001a3af4 /* f1a3b10: 00000000 */ nop /* f1a3b14: 54400004 */ bnezl $v0,.L0f1a3b28 /* f1a3b18: 8fbf0014 */ lw $ra,0x14($sp) -/* f1a3b1c: 0fc67b37 */ jal func0f19ecdc +/* f1a3b1c: 0fc67b37 */ jal frEndSession /* f1a3b20: 24040001 */ addiu $a0,$zero,0x1 .L0f1a3b24: /* f1a3b24: 8fbf0014 */ lw $ra,0x14($sp) diff --git a/src/game/propobj.c b/src/game/propobj.c index 396e214cd..82e2345cc 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -6183,7 +6183,12 @@ glabel setupParseObject /* f06b348: 27bd0060 */ addiu $sp,$sp,0x60 ); -void setupParseObjectWithArg2False(void *ptr, bool arg1) +/** + * When called with arg1 = true, the object is removed. + * I'm unsure if that's due to arg1 being true or whether + * removing is determined by setupParseObject's arg2 being false. + */ +void setupParseObjectWithArg2False(void *ptr, s32 arg1) { setupParseObject(ptr, arg1, false); } diff --git a/src/gvars/gvars.c b/src/gvars/gvars.c index 77f3330dc..a19d6fca5 100644 --- a/src/gvars/gvars.c +++ b/src/gvars/gvars.c @@ -16575,8 +16575,8 @@ u32 var800a3420 = 0; u32 var800a3424 = 0; u32 var800a3428 = 0; u32 var800a342c = 0; -u32 var800a3430 = 0; -u32 var800a3434 = 0; +struct explosion *g_Explosions = NULL; +s32 g_NumExplosions = 0; u32 var800a3438 = 0; u32 var800a343c = 0; struct smoke *g_Smokes = NULL; diff --git a/src/include/game/game_0601b0.h b/src/include/game/game_0601b0.h index af86145a8..727d30e84 100644 --- a/src/include/game/game_0601b0.h +++ b/src/include/game/game_0601b0.h @@ -40,7 +40,7 @@ u32 func0f064ce8(void); u32 func0f0654e8(void); u32 func0f06554c(void); void roomsCopy(s16 *srcrooms, s16 *dstrooms); -void func0f0657d8(s16 *newrooms, u32 arg1, u32 arg2); +void func0f0657d8(s16 *newrooms, s16 *rooms, u32 arg2); bool arrayIntersects(s16 *a, s16 *b); u32 func0f0658e8(void); u32 func0f06593c(void); @@ -48,9 +48,9 @@ void func0f0659e4(struct prop *prop, s16 room); void func0f065ae0(struct prop *prop, s16 room); void func0f065c44(struct prop *prop); void func0f065cb0(struct prop *prop); -void func0f065d1c(struct coord *pos, s16 *rooms, struct coord *newpos, s16 *newrooms, u32 arg4, u32 arg5); +void func0f065d1c(struct coord *pos, s16 *rooms, struct coord *newpos, s16 *newrooms, s16 *morerooms, u32 arg5); u32 func0f065dd8(void); -void func0f065dfc(struct coord *pos, s16 *rooms, struct coord *newpos, s16 *newrooms, u32 arg4, u32 arg5); +void func0f065dfc(struct coord *pos, s16 *rooms, struct coord *newpos, s16 *newrooms, s16 *morerooms, u32 arg5); void func0f065e74(struct coord *pos, s16 *rooms, struct coord *newpos, s16 *newrooms); void func0f065e98(struct coord *pos, s16 *rooms, struct coord *pos2, s16 *rooms2); void roomGetProps(s16 *room, s16 *propnums, u32 size); diff --git a/src/include/game/game_157db0.h b/src/include/game/game_157db0.h index fd6cdc6fa..b6d591beb 100644 --- a/src/include/game/game_157db0.h +++ b/src/include/game/game_157db0.h @@ -89,7 +89,7 @@ u32 func0f16397c(void); void func0f163e34(void); u32 func0f164150(void); u32 func0f164534(void); -u32 func0f1645a8(void); +void func0f1645a8(s16 room, s16 *rooms, u32 arg2); u32 func0f1646b8(void); u32 func0f164748(void); u32 func0f1648cc(void); diff --git a/src/include/game/game_19c990.h b/src/include/game/game_19c990.h index de213bb4b..d5de9aab7 100644 --- a/src/include/game/game_19c990.h +++ b/src/include/game/game_19c990.h @@ -23,7 +23,7 @@ void frSetSlot(s32 slot); u32 frGetWeaponBySlot(s32 slot); s32 frGetNumWeaponsAvailable(void); u32 func0f19d338(void); -u32 func0f19d414(void); +void func0f19d414(void); void func0f19d4ec(void); void *func0f19d560(u32 len); void frSetDifficulty(s32 difficulty); @@ -46,7 +46,7 @@ u32 func0f19e7a8(void); u32 func0f19e900(s32 weapon); void func0f19e9c0(s32 weapon); char *frGetWeaponDescription(void); -void func0f19ecdc(s32 arg0); +void frEndSession(bool hidetargets); bool frWasTooInaccurate(void); void frSetFailReason(s32 failreason); void func0f19f18c(void); diff --git a/src/include/game/game_1a3340.h b/src/include/game/game_1a3340.h index cebf3ec6e..5bf421848 100644 --- a/src/include/game/game_1a3340.h +++ b/src/include/game/game_1a3340.h @@ -46,7 +46,7 @@ bool menudialog001a6aa4(u32 operation, struct menudialog *dialog, struct menu *m bool menudialogFiringRangeResults(u32 operation, struct menudialog *dialog, struct menu *menu); s32 menudialog001a737c(u32, u32, u32 *); s32 frDetailsOkMenuHandler(u32 operation, struct menuitem *item, s32 *value); -s32 menuhandler001a3448(u32 operation, struct menuitem *item, s32 *value); +s32 frAbortMenuHandler(u32 operation, struct menuitem *item, s32 *value); s32 menuhandler001a348c(u32, u32, u32 *); s32 menuhandler001a44c0(u32, u32, u32 *); s32 menuhandlerFrFailedContinue(u32 operation, struct menuitem *item, s32 *value); diff --git a/src/include/game/propobj.h b/src/include/game/propobj.h index 02806acf0..fdbcec553 100644 --- a/src/include/game/propobj.h +++ b/src/include/game/propobj.h @@ -94,7 +94,7 @@ u32 func0f06ab60(void); void func0f06ac40(struct defaultobj *obj); void func0f06ac90(struct prop *prop); void setupParseObject(void *ptr, bool arg1, bool arg2); -void setupParseObjectWithArg2False(void *ptr, bool arg1); +void setupParseObjectWithArg2False(void *ptr, s32 arg1); u32 func0f06b36c(void); bool func0f06b39c(struct coord *arg0, struct coord *arg1, struct coord *arg2, f32 arg3); u32 func0f06b488(void); diff --git a/src/include/gvars/gvars.h b/src/include/gvars/gvars.h index 0f1627bac..666348b32 100644 --- a/src/include/gvars/gvars.h +++ b/src/include/gvars/gvars.h @@ -683,8 +683,8 @@ extern u32 var800a33a8; extern u32 var800a33e8; extern u32 var800a3410; extern u32 var800a3420; -extern u32 var800a3430; -extern u32 var800a3434; +extern struct explosion *g_Explosions; +extern s32 g_NumExplosions; extern struct smoke *g_Smokes; extern s32 g_NumSmokes; extern u32 var800a3448; diff --git a/src/include/types.h b/src/include/types.h index 460d4bf34..31d0cd206 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -1207,7 +1207,7 @@ struct weaponobj { // objtype 0x08 /*0x5c*/ u8 weaponnum; /*0x5d*/ s8 unk5d; /*0x5e*/ s8 unk5e; - /*0x5f*/ u8 dragonthrown; + /*0x5f*/ u8 thrown; // Dragon and Laptop Gun /*0x60*/ s8 unk60; /*0x61*/ s8 dualweaponnum; @@ -4839,6 +4839,15 @@ struct explosiontype { /*0x28*/ f32 damage; }; +struct explosion08 { + u32 unk00; + u32 unk04; + u32 unk08; + u32 unk0c; + u32 unk10; + u16 unk14; +}; + struct explosionbb { // billboards? struct coord unk00; struct coord unk0c; @@ -4847,8 +4856,11 @@ struct explosionbb { // billboards? }; struct explosion { - u8 unk[0x3c8]; - /*0x3c8*/ s32 frame60; + u32 unk00; + u32 unk04; + struct explosion08 unk08[40]; + /*0x3c8*/ s16 age; + /*0x3ca*/ s16 frame60; /*0x3cc*/ s8 type; /*0x3cd*/ s8 makescorch; /*0x3ce*/ s8 owner; @@ -4859,7 +4871,8 @@ struct explosion { /*0x3dc*/ u32 unk3dc; /*0x3e0*/ u32 unk3e0; /*0x3e4*/ u32 unk3e4; - /*0x3e8*/ struct explosionbb bbs[1]; // length unknown + /*0x3e8*/ struct explosionbb bbs[5]; // may be smaller + /*0x474*/ u32 unk474; }; struct smoketype {