From 533118d18fcf81fd772b53fe8c540ce91e86be0f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 20 Mar 2020 20:01:06 +1000 Subject: [PATCH] Decompile soloMenuTextNumBodyShots --- src/game/data/data_01a3a0.c | 4 ++-- src/game/game_10ccd0.c | 25 +++++-------------------- src/include/game/game_10ccd0.h | 2 +- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/game/data/data_01a3a0.c b/src/game/data/data_01a3a0.c index 2acf7c60b..34fac8691 100644 --- a/src/game/data/data_01a3a0.c +++ b/src/game/data/data_01a3a0.c @@ -843,7 +843,7 @@ struct menu_item menuitems_1b7bc[] = { { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(284), (u32)&soloMenuTextNumShots, NULL }, // "Shot Total:" { MENUITEMTYPE_LABEL, 0, L_AME(0), L_OPTIONS(285), (u32)&soloMenuTextNumHeadShots, NULL }, // "Head Shots:" - { MENUITEMTYPE_LABEL, 0, L_AME(0), L_OPTIONS(286), (u32)&func0f10d100, NULL }, // "Body Shots:" + { MENUITEMTYPE_LABEL, 0, L_AME(0), L_OPTIONS(286), (u32)&soloMenuTextNumBodyShots, NULL }, // "Body Shots:" { MENUITEMTYPE_LABEL, 0, L_AME(0), L_OPTIONS(287), (u32)&func0f10d140, NULL }, // "Limb Shots:" { MENUITEMTYPE_LABEL, 0, L_AME(0), L_OPTIONS(288), (u32)&func0f10d180, NULL }, // "Others:" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, @@ -871,7 +871,7 @@ struct menu_item menuitems_1b98c[] = { { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(284), (u32)&soloMenuTextNumShots, NULL }, // "Shot Total:" { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(285), (u32)&soloMenuTextNumHeadShots, NULL }, // "Head Shots:" - { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(286), (u32)&func0f10d100, NULL }, // "Body Shots:" + { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(286), (u32)&soloMenuTextNumBodyShots, NULL }, // "Body Shots:" { MENUITEMTYPE_LABEL, 6, 0x00000000, L_OPTIONS(287), (u32)&func0f10d140, menuhandler0010e064 }, // "Limb Shots:" { MENUITEMTYPE_LABEL, 4, 0x00000000, L_OPTIONS(288), (u32)&func0f10d180, menuhandler0010e064 }, // "Others:" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, diff --git a/src/game/game_10ccd0.c b/src/game/game_10ccd0.c index e572019d7..056fc0532 100644 --- a/src/game/game_10ccd0.c +++ b/src/game/game_10ccd0.c @@ -287,25 +287,11 @@ char *soloMenuTextNumHeadShots(struct menu_item *item) return g_StringPointer; } -GLOBAL_ASM( -glabel func0f10d100 -/* f10d100: 27bdffe8 */ addiu $sp,$sp,-24 -/* f10d104: afbf0014 */ sw $ra,0x14($sp) -/* f10d108: afa40018 */ sw $a0,0x18($sp) -/* f10d10c: 0fc2c14b */ jal currentPlayerGetShotCount -/* f10d110: 24040002 */ addiu $a0,$zero,0x2 -/* f10d114: 3c048007 */ lui $a0,%hi(g_StringPointer) -/* f10d118: 3c057f1b */ lui $a1,%hi(var7f1b387c) -/* f10d11c: 24a5387c */ addiu $a1,$a1,%lo(var7f1b387c) -/* f10d120: 8c841440 */ lw $a0,%lo(g_StringPointer)($a0) -/* f10d124: 0c004dad */ jal sprintf -/* f10d128: 00403025 */ or $a2,$v0,$zero -/* f10d12c: 8fbf0014 */ lw $ra,0x14($sp) -/* f10d130: 3c028007 */ lui $v0,%hi(g_StringPointer) -/* f10d134: 8c421440 */ lw $v0,%lo(g_StringPointer)($v0) -/* f10d138: 03e00008 */ jr $ra -/* f10d13c: 27bd0018 */ addiu $sp,$sp,0x18 -); +char *soloMenuTextNumBodyShots(struct menu_item *item) +{ + sprintf(g_StringPointer, "%d", currentPlayerGetShotCount(2)); + return g_StringPointer; +} GLOBAL_ASM( glabel func0f10d140 @@ -603,7 +589,6 @@ glabel func0f10d678 /* f10d6e0: 27bd0020 */ addiu $sp,$sp,0x20 ); -const char var7f1b387c[] = "%d"; const char var7f1b3880[] = "%d"; const char var7f1b3884[] = "%d"; const char var7f1b3888[] = "%s%s%.1f%%"; diff --git a/src/include/game/game_10ccd0.h b/src/include/game/game_10ccd0.h index 0976a5b5b..d7f590206 100644 --- a/src/include/game/game_10ccd0.h +++ b/src/include/game/game_10ccd0.h @@ -11,7 +11,7 @@ u32 func0f10cf2c(void); char *soloMenuTextNumKills(struct menu_item *item); char *soloMenuTextNumShots(struct menu_item *item); char *soloMenuTextNumHeadShots(struct menu_item *item); -u32 func0f10d100(void); +char *soloMenuTextNumBodyShots(struct menu_item *item); u32 func0f10d140(void); u32 func0f10d180(void); u32 func0f10d1d0(void);