Decompile menuhandlerAlwaysShowTarget, optionsGetAlwaysShowTarget and optionsSetAlwaysShowTarget

This commit is contained in:
Ryan Dwyer 2019-12-30 23:39:56 +10:00
parent 8da450a353
commit 6cfbe0e3ea
7 changed files with 50 additions and 102 deletions

View File

@ -9465,7 +9465,7 @@ glabel func0f0dca48
/* f0dcd44: 8d640070 */ lw $a0,0x70($t3)
/* f0dcd48: 0003602b */ sltu $t4,$zero,$v1
/* f0dcd4c: 01801825 */ or $v1,$t4,$zero
/* f0dcd50: 0fc54a1f */ jal func0f15287c
/* f0dcd50: 0fc54a1f */ jal optionsGetAlwaysShowTarget
/* f0dcd54: afac001c */ sw $t4,0x1c($sp)
/* f0dcd58: 10400003 */ beqz $v0,.L0f0dcd68
/* f0dcd5c: 8fa3001c */ lw $v1,0x1c($sp)

View File

@ -1092,58 +1092,31 @@ s32 menuhandlerShowMissionTime(u32 operation, struct menu_item *item, bool *enab
return 0;
}
GLOBAL_ASM(
glabel menuhandlerAlwaysShowTarget
/* f102f94: 3c02800a */ lui $v0,%hi(g_Vars)
/* f102f98: 24429fc0 */ addiu $v0,$v0,%lo(g_Vars)
/* f102f9c: 8c4e0298 */ lw $t6,0x298($v0)
/* f102fa0: 27bdffe8 */ addiu $sp,$sp,-24
/* f102fa4: afbf0014 */ sw $ra,0x14($sp)
/* f102fa8: 05c10004 */ bgez $t6,.L0f102fbc
/* f102fac: 00803825 */ or $a3,$a0,$zero
/* f102fb0: 8c4f029c */ lw $t7,0x29c($v0)
/* f102fb4: 05e20005 */ bltzl $t7,.L0f102fcc
/* f102fb8: 8ca4000c */ lw $a0,0xc($a1)
.L0f102fbc:
/* f102fbc: 8c580288 */ lw $t8,0x288($v0)
/* f102fc0: 10000002 */ beqz $zero,.L0f102fcc
/* f102fc4: 8f040070 */ lw $a0,0x70($t8)
/* f102fc8: 8ca4000c */ lw $a0,0xc($a1)
.L0f102fcc:
/* f102fcc: 24010006 */ addiu $at,$zero,0x6
/* f102fd0: 10e1000f */ beq $a3,$at,.L0f103010
/* f102fd4: 24010008 */ addiu $at,$zero,0x8
/* f102fd8: 10e10009 */ beq $a3,$at,.L0f103000
/* f102fdc: 2401000c */ addiu $at,$zero,0xc
/* f102fe0: 54e10013 */ bnel $a3,$at,.L0f103030
/* f102fe4: 00001025 */ or $v0,$zero,$zero
/* f102fe8: 0fc54a04 */ jal func0f152810
/* f102fec: 00000000 */ sll $zero,$zero,0x0
/* f102ff0: 5440000f */ bnezl $v0,.L0f103030
/* f102ff4: 00001025 */ or $v0,$zero,$zero
/* f102ff8: 1000000d */ beqz $zero,.L0f103030
/* f102ffc: 24020001 */ addiu $v0,$zero,0x1
.L0f103000:
/* f103000: 0fc54a1f */ jal func0f15287c
/* f103004: 00000000 */ sll $zero,$zero,0x0
/* f103008: 1000000a */ beqz $zero,.L0f103034
/* f10300c: 8fbf0014 */ lw $ra,0x14($sp)
.L0f103010:
/* f103010: 0fc54aec */ jal func0f152bb0
/* f103014: 8cc50000 */ lw $a1,0x0($a2)
/* f103018: 3c02800a */ lui $v0,%hi(g_Vars)
/* f10301c: 24429fc0 */ addiu $v0,$v0,%lo(g_Vars)
/* f103020: 8c590458 */ lw $t9,0x458($v0)
/* f103024: 37280001 */ ori $t0,$t9,0x1
/* f103028: ac480458 */ sw $t0,0x458($v0)
/* f10302c: 00001025 */ or $v0,$zero,$zero
.L0f103030:
/* f103030: 8fbf0014 */ lw $ra,0x14($sp)
.L0f103034:
/* f103034: 27bd0018 */ addiu $sp,$sp,0x18
/* f103038: 03e00008 */ jr $ra
/* f10303c: 00000000 */ sll $zero,$zero,0x0
);
s32 menuhandlerAlwaysShowTarget(u32 operation, struct menu_item *item, bool *enable)
{
u32 optionsindex;
if (g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) {
optionsindex = g_Vars.unk000288->optionsindex;
} else {
optionsindex = item->right;
}
switch (operation) {
case MENUOP_CHECKDISABLED:
if (func0f152810(optionsindex) == 0) {
return true;
}
break;
case MENUOP_GET:
return optionsGetAlwaysShowTarget(optionsindex);
case MENUOP_SET:
optionsSetAlwaysShowTarget(optionsindex, *enable);
g_Vars.unk000458 |= 1;
}
return 0;
}
GLOBAL_ASM(
glabel menuhandlerShowZoomRange

View File

@ -2831,7 +2831,7 @@ glabel func0f10f204
/* f10f328: 0fc47961 */ jal func0f11e584
/* f10f32c: 02002825 */ or $a1,$s0,$zero
/* f10f330: 8fa40024 */ lw $a0,0x24($sp)
/* f10f334: 0fc54aec */ jal func0f152bb0
/* f10f334: 0fc54aec */ jal optionsSetAlwaysShowTarget
/* f10f338: 00402825 */ or $a1,$v0,$zero
/* f10f33c: 24040017 */ addiu $a0,$zero,0x17
/* f10f340: 0fc47961 */ jal func0f11e584
@ -2903,7 +2903,7 @@ glabel func0f10f204
/* f10f448: 0fc47961 */ jal func0f11e584
/* f10f44c: 02002825 */ or $a1,$s0,$zero
/* f10f450: 8fa40020 */ lw $a0,0x20($sp)
/* f10f454: 0fc54aec */ jal func0f152bb0
/* f10f454: 0fc54aec */ jal optionsSetAlwaysShowTarget
/* f10f458: 00402825 */ or $a1,$v0,$zero
/* f10f45c: 24040018 */ addiu $a0,$zero,0x18
/* f10f460: 0fc47961 */ jal func0f11e584
@ -3709,7 +3709,7 @@ glabel func0f10feac
/* f10ffe4: 02002825 */ or $a1,$s0,$zero
/* f10ffe8: 0fc4794c */ jal func0f11e530
/* f10ffec: 00403025 */ or $a2,$v0,$zero
/* f10fff0: 0fc54a1f */ jal func0f15287c
/* f10fff0: 0fc54a1f */ jal optionsGetAlwaysShowTarget
/* f10fff4: 02602025 */ or $a0,$s3,$zero
/* f10fff8: 24040015 */ addiu $a0,$zero,0x15
/* f10fffc: 02002825 */ or $a1,$s0,$zero
@ -3781,7 +3781,7 @@ glabel func0f10feac
/* f110104: 02002825 */ or $a1,$s0,$zero
/* f110108: 0fc4794c */ jal func0f11e530
/* f11010c: 00403025 */ or $a2,$v0,$zero
/* f110110: 0fc54a1f */ jal func0f15287c
/* f110110: 0fc54a1f */ jal optionsGetAlwaysShowTarget
/* f110114: 02202025 */ or $a0,$s1,$zero
/* f110118: 24040016 */ addiu $a0,$zero,0x16
/* f11011c: 02002825 */ or $a1,$s0,$zero

View File

@ -126,18 +126,10 @@ s32 optionsGetShowGunFunction(s32 optionsindex)
return (g_Options[optionsindex].unk48 & OPTION_SHOWGUNFUNCTION) != 0;
}
GLOBAL_ASM(
glabel func0f15287c
/* f15287c: 00047080 */ sll $t6,$a0,0x2
/* f152880: 01c47021 */ addu $t6,$t6,$a0
/* f152884: 000e7140 */ sll $t6,$t6,0x5
/* f152888: 3c02800b */ lui $v0,0x800b
/* f15288c: 004e1021 */ addu $v0,$v0,$t6
/* f152890: 9442c800 */ lhu $v0,-0x3800($v0)
/* f152894: 304f0200 */ andi $t7,$v0,0x200
/* f152898: 03e00008 */ jr $ra
/* f15289c: 000f102b */ sltu $v0,$zero,$t7
);
s32 optionsGetAlwaysShowTarget(s32 optionsindex)
{
return (g_Options[optionsindex].unk48 & OPTION_ALWAYSSHOWTARGET) != 0;
}
GLOBAL_ASM(
glabel func0f1528a0
@ -350,32 +342,14 @@ void optionsSetShowGunFunction(s32 optionsindex, bool enable)
}
}
GLOBAL_ASM(
glabel func0f152bb0
/* f152bb0: 10a0000b */ beqz $a1,.L0f152be0
/* f152bb4: 00044080 */ sll $t0,$a0,0x2
/* f152bb8: 00047080 */ sll $t6,$a0,0x2
/* f152bbc: 01c47021 */ addu $t6,$t6,$a0
/* f152bc0: 3c0f800b */ lui $t7,%hi(g_Options)
/* f152bc4: 25efc7b8 */ addiu $t7,$t7,%lo(g_Options)
/* f152bc8: 000e7140 */ sll $t6,$t6,0x5
/* f152bcc: 01cf1021 */ addu $v0,$t6,$t7
/* f152bd0: 94580048 */ lhu $t8,0x48($v0)
/* f152bd4: 37190200 */ ori $t9,$t8,0x200
/* f152bd8: 03e00008 */ jr $ra
/* f152bdc: a4590048 */ sh $t9,0x48($v0)
.L0f152be0:
/* f152be0: 01044021 */ addu $t0,$t0,$a0
/* f152be4: 3c09800b */ lui $t1,%hi(g_Options)
/* f152be8: 2529c7b8 */ addiu $t1,$t1,%lo(g_Options)
/* f152bec: 00084140 */ sll $t0,$t0,0x5
/* f152bf0: 01091021 */ addu $v0,$t0,$t1
/* f152bf4: 944a0048 */ lhu $t2,0x48($v0)
/* f152bf8: 314bfdff */ andi $t3,$t2,0xfdff
/* f152bfc: a44b0048 */ sh $t3,0x48($v0)
/* f152c00: 03e00008 */ jr $ra
/* f152c04: 00000000 */ sll $zero,$zero,0x0
);
void optionsSetAlwaysShowTarget(s32 optionsindex, bool enable)
{
if (enable) {
g_Options[optionsindex].unk48 |= OPTION_ALWAYSSHOWTARGET;
} else {
g_Options[optionsindex].unk48 &= ~OPTION_ALWAYSSHOWTARGET;
}
}
GLOBAL_ASM(
glabel func0f152c08

View File

@ -658,9 +658,10 @@
#define OPERATOR_LESS_THAN 0
#define OPERATOR_GREATER_THAN 1
#define OPTION_AMMOONSCREEN 0x0020
#define OPTION_SHOWGUNFUNCTION 0x0040
#define OPTION_SHOWMISSIONTIME 0x8000
#define OPTION_AMMOONSCREEN 0x0020
#define OPTION_SHOWGUNFUNCTION 0x0040
#define OPTION_ALWAYSSHOWTARGET 0x0200
#define OPTION_SHOWMISSIONTIME 0x8000
#define OUTFIT_DEFAULT 0x00
#define OUTFIT_ELVIS 0x01

View File

@ -48,7 +48,7 @@ s32 menuhandler00106394(u32, u32, u32 *);
s32 menuhandler00106644(u32, u32, u32 *);
s32 menuhandlerAimControl(u32, u32, u32 *);
s32 menuhandlerAlternativeTitle(u32, u32, u32 *);
s32 menuhandlerAlwaysShowTarget(u32, u32, u32 *);
s32 menuhandlerAlwaysShowTarget(u32 operation, struct menu_item *item, bool *enable);
s32 menuhandlerAmmoOnScreen(u32 operation, struct menu_item *item, bool *enable);
s32 menuhandlerAntiPlayer(u32, u32, u32 *);
s32 menuhandlerAntiRadar(u32, u32, u32 *);

View File

@ -11,10 +11,10 @@ u32 func0f152780(void);
u32 func0f1527a4(void);
u32 func0f1527c8(void);
u32 func0f1527ec(void);
u32 func0f152810(void);
s32 func0f152810(s32 optionsindex);
s32 optionsGetAmmoOnScreen(s32 optionsindex);
s32 optionsGetShowGunFunction(s32 optionsindex);
u32 func0f15287c(void);
s32 optionsGetAlwaysShowTarget(s32 optionsindex);
u32 func0f1528a0(void);
u32 func0f1528c4(void);
s32 optionsGetShowMissionTime(s32 optionsindex);
@ -28,7 +28,7 @@ u32 func0f152a50(void);
u32 func0f152aa8(void);
void optionsSetAmmoOnScreen(s32 optionsindex, bool enable);
void optionsSetShowGunFunction(s32 optionsindex, bool enable);
u32 func0f152bb0(void);
void optionsSetAlwaysShowTarget(s32 optionsindex, bool enable);
u32 func0f152c08(void);
u32 func0f152c60(void);
void optionsSetShowMissionTime(s32 optionsindex, bool enable);