Decompile dtGetWeaponByDeviceIndex

This commit is contained in:
Ryan Dwyer
2020-04-10 22:27:17 +10:00
parent cafc4f95b7
commit 0909485450
5 changed files with 26 additions and 43 deletions
+13 -10
View File
@@ -712,16 +712,19 @@ u8 var80088adc = 0;
u32 var80088ae0 = 0x39383736;
u32 var80088ae4 = 0x35343332;
u32 var80088ae8 = 0x31300000;
u32 var80088aec = 0x00000036;
u32 var80088af0 = 0x00000035;
u32 var80088af4 = 0x0000002e;
u32 var80088af8 = 0x0000002d;
u32 var80088afc = 0x00000039;
u32 var80088b00 = 0x00000037;
u32 var80088b04 = 0x00000030;
u32 var80088b08 = 0x0000002f;
u32 var80088b0c = 0x00000041;
u32 var80088b10 = 0x00000031;
u32 g_CiDeviceWeapons[] = {
WEAPON_DATAUPLINK,
WEAPON_ECMMINE,
WEAPON_CAMSPY,
WEAPON_NIGHTVISION,
WEAPON_DOORDECODER,
WEAPON_RTRACKER,
WEAPON_IRSCANNER,
WEAPON_XRAYSCANNER,
WEAPON_DISGUISE41,
WEAPON_CLOAKINGDEVICE,
};
u32 g_CiDeviceStageFlags[] = {
STAGEFLAG_CI_TRIGGER_UPLINK,
+7 -27
View File
@@ -5820,7 +5820,7 @@ void dtRestorePlayer(void)
g_DeviceTrainingData.obj = NULL;
if (func0f1a1de0(func0f1a1d68(var80088ad8)) == WEAPON_ECMMINE) {
if (dtGetWeaponByDeviceIndex(func0f1a1d68(var80088ad8)) == WEAPON_ECMMINE) {
currentPlayerGiveAmmo(AMMOTYPE_ECM_MINE, 0);
}
@@ -6032,32 +6032,12 @@ glabel func0f1a1d68
/* f1a1ddc: 27bd0028 */ addiu $sp,$sp,0x28
);
GLOBAL_ASM(
glabel func0f1a1de0
/* f1a1de0: 27bdffd8 */ addiu $sp,$sp,-40
/* f1a1de4: 3c0e8009 */ lui $t6,%hi(var80088aec)
/* f1a1de8: 27a30000 */ addiu $v1,$sp,0x0
/* f1a1dec: 25ce8aec */ addiu $t6,$t6,%lo(var80088aec)
/* f1a1df0: 25d90024 */ addiu $t9,$t6,0x24
/* f1a1df4: 00604025 */ or $t0,$v1,$zero
.L0f1a1df8:
/* f1a1df8: 8dc10000 */ lw $at,0x0($t6)
/* f1a1dfc: 25ce000c */ addiu $t6,$t6,0xc
/* f1a1e00: 2508000c */ addiu $t0,$t0,0xc
/* f1a1e04: ad01fff4 */ sw $at,-0xc($t0)
/* f1a1e08: 8dc1fff8 */ lw $at,-0x8($t6)
/* f1a1e0c: ad01fff8 */ sw $at,-0x8($t0)
/* f1a1e10: 8dc1fffc */ lw $at,-0x4($t6)
/* f1a1e14: 15d9fff8 */ bne $t6,$t9,.L0f1a1df8
/* f1a1e18: ad01fffc */ sw $at,-0x4($t0)
/* f1a1e1c: 8dc10000 */ lw $at,0x0($t6)
/* f1a1e20: 00044880 */ sll $t1,$a0,0x2
/* f1a1e24: 00695021 */ addu $t2,$v1,$t1
/* f1a1e28: ad010000 */ sw $at,0x0($t0)
/* f1a1e2c: 8d420000 */ lw $v0,0x0($t2)
/* f1a1e30: 03e00008 */ jr $ra
/* f1a1e34: 27bd0028 */ addiu $sp,$sp,0x28
);
u32 dtGetWeaponByDeviceIndex(s32 deviceindex)
{
u32 weapons[10] = g_CiDeviceWeapons;
return weapons[deviceindex];
}
u32 ciGetStageFlagByDeviceIndex(u32 deviceindex)
{
+4 -4
View File
@@ -3103,7 +3103,7 @@ glabel var7f1b9994
/* f1a6424: acc20000 */ sw $v0,0x0($a2)
/* f1a6428: 0fc6875a */ jal func0f1a1d68
/* f1a642c: 8cc40000 */ lw $a0,0x0($a2)
/* f1a6430: 0fc68778 */ jal func0f1a1de0
/* f1a6430: 0fc68778 */ jal dtGetWeaponByDeviceIndex
/* f1a6434: 00402025 */ or $a0,$v0,$zero
/* f1a6438: 0fc28857 */ jal weaponGetName
/* f1a643c: 00402025 */ or $a0,$v0,$zero
@@ -3144,7 +3144,7 @@ glabel func0f1a64a0
/* f1a64ac: 3c048009 */ lui $a0,%hi(var80088ad8)
/* f1a64b0: 0fc6875a */ jal func0f1a1d68
/* f1a64b4: 90848ad8 */ lbu $a0,%lo(var80088ad8)($a0)
/* f1a64b8: 0fc68778 */ jal func0f1a1de0
/* f1a64b8: 0fc68778 */ jal dtGetWeaponByDeviceIndex
/* f1a64bc: 00402025 */ or $a0,$v0,$zero
/* f1a64c0: 0fc28857 */ jal weaponGetName
/* f1a64c4: 00402025 */ or $a0,$v0,$zero
@@ -3197,7 +3197,7 @@ glabel var7f1b9998
/* f1a6578: 3c048009 */ lui $a0,%hi(var80088ad8)
/* f1a657c: 0fc6875a */ jal func0f1a1d68
/* f1a6580: 90848ad8 */ lbu $a0,%lo(var80088ad8)($a0)
/* f1a6584: 0fc68778 */ jal func0f1a1de0
/* f1a6584: 0fc68778 */ jal dtGetWeaponByDeviceIndex
/* f1a6588: 00402025 */ or $a0,$v0,$zero
/* f1a658c: 3c0f8009 */ lui $t7,%hi(var800893f8)
/* f1a6590: 25ef93f8 */ addiu $t7,$t7,%lo(var800893f8)
@@ -3290,7 +3290,7 @@ glabel var7f1b9998
/* f1a66e0: 8fbf0014 */ lw $ra,0x14($sp)
/* f1a66e4: 0fc6875a */ jal func0f1a1d68
/* f1a66e8: 90848ad8 */ lbu $a0,%lo(var80088ad8)($a0)
/* f1a66ec: 0fc68778 */ jal func0f1a1de0
/* f1a66ec: 0fc68778 */ jal dtGetWeaponByDeviceIndex
/* f1a66f0: 00402025 */ or $a0,$v0,$zero
/* f1a66f4: 24010041 */ addiu $at,$zero,0x41
/* f1a66f8: 14410013 */ bne $v0,$at,.L0f1a6748
+1 -1
View File
@@ -34,7 +34,7 @@ extern u32 place_bios[];
extern u8 var80088ad8;
extern u8 var80088adc;
extern u32 var80088ae0;
extern u32 var80088aec;
extern u32 g_CiDeviceWeapons[10];
extern u32 g_CiDeviceStageFlags[10];
extern u32 device_descriptions[10];
extern u32 device_tips1[10];
+1 -1
View File
@@ -84,7 +84,7 @@ void dtEnd(void);
u32 func0f1a1c98(void);
u32 func0f1a1d10(void);
u32 func0f1a1d68(u32 arg0);
u32 func0f1a1de0(u32 arg0);
u32 dtGetWeaponByDeviceIndex(s32 deviceindex);
u32 ciGetStageFlagByDeviceIndex(u32 deviceindex);
char *dtGetDescription(void);
char *dtGetTip1(void);