Decompile frGetSlot

This commit is contained in:
Ryan Dwyer
2020-04-11 21:57:26 +10:00
parent d10c53b47a
commit 15a2f134e8
5 changed files with 20 additions and 22 deletions
+1 -1
View File
@@ -5252,7 +5252,7 @@ glabel func0f09bd58
/* f09bd70: 11c00013 */ beqz $t6,.L0f09bdc0
/* f09bd74: 8c63a244 */ lw $v1,%lo(g_Vars+0x284)($v1)
/* f09bd78: afa3001c */ sw $v1,0x1c($sp)
/* f09bd7c: 0fc67494 */ jal func0f19d250
/* f09bd7c: 0fc67494 */ jal frGetSlot
/* f09bd80: afa40020 */ sw $a0,0x20($sp)
/* f09bd84: 0fc6749a */ jal frGetWeaponBySlot
/* f09bd88: 00402025 */ or $a0,$v0,$zero
+1 -1
View File
@@ -624,7 +624,7 @@ void activemenuApply(s32 slot)
pass = true;
if (var80088804 != 0) {
uVar6 = frGetWeaponBySlot(func0f19d250());
uVar6 = frGetWeaponBySlot(frGetSlot());
if (uVar6 == g_Vars.currentplayer->unk0638[0].unk0638) {
pass = false;
+6 -8
View File
@@ -631,19 +631,17 @@ glabel var7f1b93b8
/* f19d24c: 00000000 */ sll $zero,$zero,0x0
);
GLOBAL_ASM(
glabel func0f19d250
/* f19d250: 3c02800b */ lui $v0,%hi(g_FiringRangeData+0x456)
/* f19d254: 03e00008 */ jr $ra
/* f19d258: 9442d176 */ lhu $v0,%lo(g_FiringRangeData+0x456)($v0)
);
u32 frGetSlot(void)
{
return g_FiringRangeData.slot;
}
void frSetSlot(s32 slot)
void frSetSlot(u32 slot)
{
g_FiringRangeData.slot = slot;
}
u32 frGetWeaponBySlot(s32 slot)
u32 frGetWeaponBySlot(u32 slot)
{
s32 index = -1;
s32 weapon;
+9 -9
View File
@@ -54,7 +54,7 @@ glabel menuhandler001a3340
/* f1a3370: 00000000 */ sll $zero,$zero,0x0
/* f1a3374: 1440002d */ bnez $v0,.L0f1a342c
/* f1a3378: 00000000 */ sll $zero,$zero,0x0
/* f1a337c: 0fc67494 */ jal func0f19d250
/* f1a337c: 0fc67494 */ jal frGetSlot
/* f1a3380: 00000000 */ sll $zero,$zero,0x0
/* f1a3384: 0fc6749a */ jal frGetWeaponBySlot
/* f1a3388: 00402025 */ or $a0,$v0,$zero
@@ -231,7 +231,7 @@ glabel var7f1b9940
/* f1a3578: 24848f60 */ addiu $a0,$a0,%lo(menudialog_frtraininginfo2)
/* f1a357c: 10000106 */ beqz $zero,.L0f1a3998
/* f1a3580: 00001025 */ or $v0,$zero,$zero
/* f1a3584: 0fc67494 */ jal func0f19d250
/* f1a3584: 0fc67494 */ jal frGetSlot
/* f1a3588: afa600b0 */ sw $a2,0xb0($sp)
/* f1a358c: 8fa600b0 */ lw $a2,0xb0($sp)
/* f1a3590: 10000100 */ beqz $zero,.L0f1a3994
@@ -528,7 +528,7 @@ glabel var7f1b9944
/* f1a39d0: 10000044 */ beqz $zero,.L0f1a3ae4
/* f1a39d4: 8fbf0014 */ lw $ra,0x14($sp)
.L0f1a39d8:
/* f1a39d8: 0fc67494 */ jal func0f19d250
/* f1a39d8: 0fc67494 */ jal frGetSlot
/* f1a39dc: 00000000 */ sll $zero,$zero,0x0
/* f1a39e0: 0fc6749a */ jal frGetWeaponBySlot
/* f1a39e4: 00402025 */ or $a0,$v0,$zero
@@ -648,7 +648,7 @@ glabel menudialog001a3af4
/* f1a3b84: 10000020 */ beqz $zero,.L0f1a3c08
/* f1a3b88: 00001025 */ or $v0,$zero,$zero
.L0f1a3b8c:
/* f1a3b8c: 0fc67494 */ jal func0f19d250
/* f1a3b8c: 0fc67494 */ jal frGetSlot
/* f1a3b90: afa60030 */ sw $a2,0x30($sp)
/* f1a3b94: 0fc6726c */ jal ciGetFiringRangeScore
/* f1a3b98: 00402025 */ or $a0,$v0,$zero
@@ -704,7 +704,7 @@ glabel menuhandlerFrDifficulty
/* f1a3c38: 24010018 */ addiu $at,$zero,0x18
/* f1a3c3c: 54810028 */ bnel $a0,$at,.L0f1a3ce0
/* f1a3c40: 00001025 */ or $v0,$zero,$zero
/* f1a3c44: 0fc67494 */ jal func0f19d250
/* f1a3c44: 0fc67494 */ jal frGetSlot
/* f1a3c48: 00000000 */ sll $zero,$zero,0x0
/* f1a3c4c: 0fc6749a */ jal frGetWeaponBySlot
/* f1a3c50: 00402025 */ or $a0,$v0,$zero
@@ -729,7 +729,7 @@ glabel menuhandlerFrDifficulty
/* f1a3c98: 10000011 */ beqz $zero,.L0f1a3ce0
/* f1a3c9c: 00001025 */ or $v0,$zero,$zero
.L0f1a3ca0:
/* f1a3ca0: 0fc67494 */ jal func0f19d250
/* f1a3ca0: 0fc67494 */ jal frGetSlot
/* f1a3ca4: 00000000 */ sll $zero,$zero,0x0
/* f1a3ca8: 0fc6749a */ jal frGetWeaponBySlot
/* f1a3cac: 00402025 */ or $a0,$v0,$zero
@@ -752,7 +752,7 @@ glabel menuhandlerFrDifficulty
/* f1a3cec: 00000000 */ sll $zero,$zero,0x0
/* f1a3cf0: 27bdffe8 */ addiu $sp,$sp,-24
/* f1a3cf4: afbf0014 */ sw $ra,0x14($sp)
/* f1a3cf8: 0fc67494 */ jal func0f19d250
/* f1a3cf8: 0fc67494 */ jal frGetSlot
/* f1a3cfc: afa40018 */ sw $a0,0x18($sp)
/* f1a3d00: 0fc6749a */ jal frGetWeaponBySlot
/* f1a3d04: 00402025 */ or $a0,$v0,$zero
@@ -775,7 +775,7 @@ glabel menuhandlerFrDifficulty
/* f1a3d40: 00000000 */ sll $zero,$zero,0x0
/* f1a3d44: 27bdffe8 */ addiu $sp,$sp,-24
/* f1a3d48: afbf0014 */ sw $ra,0x14($sp)
/* f1a3d4c: 0fc67494 */ jal func0f19d250
/* f1a3d4c: 0fc67494 */ jal frGetSlot
/* f1a3d50: afa40018 */ sw $a0,0x18($sp)
/* f1a3d54: 0fc6749a */ jal frGetWeaponBySlot
/* f1a3d58: 00402025 */ or $a0,$v0,$zero
@@ -858,7 +858,7 @@ char *frMenuTextGoalScoreValueUnconditional(struct menu_item *item)
char *frMenuTextWeaponName(struct menu_item *item)
{
return weaponGetName(frGetWeaponBySlot(func0f19d250()));
return weaponGetName(frGetWeaponBySlot(frGetSlot()));
}
char *frMenuTextTargetsDestroyedValue(struct menu_item *item)
+3 -3
View File
@@ -17,9 +17,9 @@ bool func0f19cc50(u32 arg0);
u32 func0f19ccc0(u32 weaponnum);
u32 func0f19cdf0(u32 weaponnum);
u32 func0f19cf20(s32 stage_index); // firing range related
u32 func0f19d250(void);
void frSetSlot(s32 slot);
u32 frGetWeaponBySlot(s32 slot);
u32 frGetSlot(void);
void frSetSlot(u32 slot);
u32 frGetWeaponBySlot(u32 slot);
u32 func0f19d2e0(void);
u32 func0f19d338(void);
u32 func0f19d414(void);