Decompile currentPlayerGiveWeapon

This commit is contained in:
Ryan Dwyer
2020-02-05 08:07:45 +10:00
parent 9e40c7e553
commit c21b170552
4 changed files with 37 additions and 51 deletions
+27 -47
View File
@@ -542,53 +542,33 @@ bool func0f111cf8(s32 weapon1, s32 weapon2)
return func0f111ab0(weapon1, weapon2);
}
GLOBAL_ASM(
glabel currentPlayerGiveWeapon
/* f111d88: 27bdffe0 */ addiu $sp,$sp,-32
/* f111d8c: afbf001c */ sw $ra,0x1c($sp)
/* f111d90: afb00018 */ sw $s0,0x18($sp)
/* f111d94: 0fc672ce */ jal func0f19cb38
/* f111d98: 00808025 */ or $s0,$a0,$zero
/* f111d9c: 0fc4468a */ jal func0f111a28
/* f111da0: 02002025 */ or $a0,$s0,$zero
/* f111da4: 1440001a */ bnez $v0,.L0f111e10
/* f111da8: 3c0e800a */ lui $t6,0x800a
/* f111dac: 8dcea244 */ lw $t6,-0x5dbc($t6)
/* f111db0: 2a01002d */ slti $at,$s0,0x2d
/* f111db4: 8dcf1870 */ lw $t7,0x1870($t6)
/* f111db8: 11e00009 */ beqz $t7,.L0f111de0
/* f111dbc: 00000000 */ sll $zero,$zero,0x0
/* f111dc0: 10200007 */ beqz $at,.L0f111de0
/* f111dc4: 00000000 */ sll $zero,$zero,0x0
/* f111dc8: 0fc4470c */ jal currentPlayerCanHaveAllGunsWeapon
/* f111dcc: 02002025 */ or $a0,$s0,$zero
/* f111dd0: 10400003 */ beqz $v0,.L0f111de0
/* f111dd4: 00000000 */ sll $zero,$zero,0x0
/* f111dd8: 1000000e */ beqz $zero,.L0f111e14
/* f111ddc: 00001025 */ or $v0,$zero,$zero
.L0f111de0:
/* f111de0: 0fc4464a */ jal func0f111928
/* f111de4: 00000000 */ sll $zero,$zero,0x0
/* f111de8: 10400007 */ beqz $v0,.L0f111e08
/* f111dec: 00402025 */ or $a0,$v0,$zero
/* f111df0: 24180001 */ addiu $t8,$zero,0x1
/* f111df4: 2419ffff */ addiu $t9,$zero,-1
/* f111df8: ac580000 */ sw $t8,0x0($v0)
/* f111dfc: a4500004 */ sh $s0,0x4($v0)
/* f111e00: 0fc445e7 */ jal func0f11179c
/* f111e04: a4590006 */ sh $t9,0x6($v0)
.L0f111e08:
/* f111e08: 10000002 */ beqz $zero,.L0f111e14
/* f111e0c: 24020001 */ addiu $v0,$zero,0x1
.L0f111e10:
/* f111e10: 00001025 */ or $v0,$zero,$zero
.L0f111e14:
/* f111e14: 8fbf001c */ lw $ra,0x1c($sp)
/* f111e18: 8fb00018 */ lw $s0,0x18($sp)
/* f111e1c: 27bd0020 */ addiu $sp,$sp,0x20
/* f111e20: 03e00008 */ jr $ra
/* f111e24: 00000000 */ sll $zero,$zero,0x0
);
bool currentPlayerGiveWeapon(s32 weaponnum)
{
func0f19cb38(weaponnum);
if (func0f111a28(weaponnum) == 0) {
struct invitem *item;
if (g_Vars.currentplayer->equipallguns &&
weaponnum <= WEAPON_PSYCHOSISGUN &&
currentPlayerCanHaveAllGunsWeapon(weaponnum)) {
return false;
}
item = func0f111928();
if (item) {
item->unk00 = 1;
item->weapon04 = weaponnum;
item->weapon06 = -1;
func0f11179c(item);
}
return true;
}
return false;
}
GLOBAL_ASM(
glabel func0f111e28
+3 -3
View File
@@ -5,9 +5,9 @@
void func0f111600(void);
u32 func0f11165c(void);
u32 func0f11179c(void);
void func0f11179c(struct invitem *item);
u32 func0f1118cc(void);
u32 func0f111928(void);
struct invitem *func0f111928(void);
void currentPlayerSetAllGuns(bool enable);
u32 func0f1119d0(void);
bool func0f111a28(s32 weaponnum);
@@ -19,7 +19,7 @@ u32 func0f111be8(void);
bool currentPlayerCanHaveAllGunsWeapon(s32 weaponnum);
bool currentPlayerCanHaveWeapon(s32 weaponnum);
bool func0f111cf8(s32 weapon1, s32 weapon2);
void currentPlayerGiveWeapon(s32 weapon);
bool currentPlayerGiveWeapon(s32 weaponnum);
void func0f111e28(s32 weapon, s32 weaponarg);
void func0f111ea4(u32 arg0);
u32 func0f111fcc(void);
+1 -1
View File
@@ -7,7 +7,7 @@ bool ciIsTourDone(void);
u8 ciGetFiringRangeScore(s32 weapon_id);
u32 func0f19c9e4(void);
u32 func0f19cad4(void);
u32 func0f19cb38(void);
void func0f19cb38(s32 weaponnum);
u32 func0f19cb80(void);
u32 func0f19cbcc(void);
u32 func0f19cc50(void);
+6
View File
@@ -5067,4 +5067,10 @@ struct memorypool {
/*0x10*/ u32 unk10;
};
struct invitem {
/*0x00*/ u32 unk00;
/*0x04*/ s16 weapon04;
/*0x06*/ s16 weapon06;
};
#endif