From 4499cec90c5474fd1866830c246cd762308caa93 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 20 Mar 2020 20:04:43 +1000 Subject: [PATCH] Decompile soloMenuTextNumOtherShots --- src/game/data/data_01a3a0.c | 4 ++-- src/game/game_10ccd0.c | 30 ++++++------------------------ src/include/game/game_10ccd0.h | 2 +- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/game/data/data_01a3a0.c b/src/game/data/data_01a3a0.c index 92d45be4b..c2b732395 100644 --- a/src/game/data/data_01a3a0.c +++ b/src/game/data/data_01a3a0.c @@ -845,7 +845,7 @@ struct menu_item menuitems_1b7bc[] = { { MENUITEMTYPE_LABEL, 0, L_AME(0), L_OPTIONS(285), (u32)&soloMenuTextNumHeadShots, NULL }, // "Head 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)&soloMenuTextNumLimbShots, NULL }, // "Limb Shots:" - { MENUITEMTYPE_LABEL, 0, L_AME(0), L_OPTIONS(288), (u32)&func0f10d180, NULL }, // "Others:" + { MENUITEMTYPE_LABEL, 0, L_AME(0), L_OPTIONS(288), (u32)&soloMenuTextNumOtherShots, NULL }, // "Others:" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000020, L_OPTIONS(289), 0x00000000, NULL }, // "Press START" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, @@ -873,7 +873,7 @@ struct menu_item menuitems_1b98c[] = { { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(285), (u32)&soloMenuTextNumHeadShots, NULL }, // "Head Shots:" { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(286), (u32)&soloMenuTextNumBodyShots, NULL }, // "Body Shots:" { MENUITEMTYPE_LABEL, 6, 0x00000000, L_OPTIONS(287), (u32)&soloMenuTextNumLimbShots, menuhandler0010e064 }, // "Limb Shots:" - { MENUITEMTYPE_LABEL, 4, 0x00000000, L_OPTIONS(288), (u32)&func0f10d180, menuhandler0010e064 }, // "Others:" + { MENUITEMTYPE_LABEL, 4, 0x00000000, L_OPTIONS(288), (u32)&soloMenuTextNumOtherShots, menuhandler0010e064 }, // "Others:" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000020, L_OPTIONS(289), 0x00000000, NULL }, // "Press START" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, diff --git a/src/game/game_10ccd0.c b/src/game/game_10ccd0.c index 3f17b3c76..9456ad679 100644 --- a/src/game/game_10ccd0.c +++ b/src/game/game_10ccd0.c @@ -299,29 +299,12 @@ char *soloMenuTextNumLimbShots(struct menu_item *item) return g_StringPointer; } -GLOBAL_ASM( -glabel func0f10d180 -/* f10d180: 27bdffe0 */ addiu $sp,$sp,-32 -/* f10d184: afbf0014 */ sw $ra,0x14($sp) -/* f10d188: afa40020 */ sw $a0,0x20($sp) -/* f10d18c: 0fc2c14b */ jal currentPlayerGetShotCount -/* f10d190: 24040004 */ addiu $a0,$zero,0x4 -/* f10d194: afa20018 */ sw $v0,0x18($sp) -/* f10d198: 0fc2c14b */ jal currentPlayerGetShotCount -/* f10d19c: 24040005 */ addiu $a0,$zero,0x5 -/* f10d1a0: 8fae0018 */ lw $t6,0x18($sp) -/* f10d1a4: 3c048007 */ lui $a0,%hi(g_StringPointer) -/* f10d1a8: 3c057f1b */ lui $a1,%hi(var7f1b3884) -/* f10d1ac: 24a53884 */ addiu $a1,$a1,%lo(var7f1b3884) -/* f10d1b0: 8c841440 */ lw $a0,%lo(g_StringPointer)($a0) -/* f10d1b4: 0c004dad */ jal sprintf -/* f10d1b8: 004e3021 */ addu $a2,$v0,$t6 -/* f10d1bc: 8fbf0014 */ lw $ra,0x14($sp) -/* f10d1c0: 3c028007 */ lui $v0,%hi(g_StringPointer) -/* f10d1c4: 8c421440 */ lw $v0,%lo(g_StringPointer)($v0) -/* f10d1c8: 03e00008 */ jr $ra -/* f10d1cc: 27bd0020 */ addiu $sp,$sp,0x20 -); +char *soloMenuTextNumOtherShots(struct menu_item *item) +{ + u32 total = currentPlayerGetShotCount(4) + currentPlayerGetShotCount(5); + sprintf(g_StringPointer, "%d", total); + return g_StringPointer; +} GLOBAL_ASM( glabel func0f10d1d0 @@ -575,7 +558,6 @@ glabel func0f10d678 /* f10d6e0: 27bd0020 */ addiu $sp,$sp,0x20 ); -const char var7f1b3884[] = "%d"; const char var7f1b3888[] = "%s%s%.1f%%"; const char var7f1b3894[] = ""; const char var7f1b3898[] = ""; diff --git a/src/include/game/game_10ccd0.h b/src/include/game/game_10ccd0.h index 567e82877..ba916ca91 100644 --- a/src/include/game/game_10ccd0.h +++ b/src/include/game/game_10ccd0.h @@ -13,7 +13,7 @@ char *soloMenuTextNumShots(struct menu_item *item); char *soloMenuTextNumHeadShots(struct menu_item *item); char *soloMenuTextNumBodyShots(struct menu_item *item); char *soloMenuTextNumLimbShots(struct menu_item *item); -u32 func0f10d180(void); +char *soloMenuTextNumOtherShots(struct menu_item *item); u32 func0f10d1d0(void); char *soloMenuTextMissionStatus(struct menu_item *item); char *soloMenuTextAgentStatus(struct menu_item *item);