From a83df4f5db6a3b6ea9eb75a188cf71a761b037a5 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 20 Mar 2020 19:41:52 +1000 Subject: [PATCH] Decompile soloMenuTextNumKills --- src/game/data/data_01a3a0.c | 12 ++++---- src/game/game_0b0420.c | 2 +- src/game/game_102240.c | 10 +++---- src/game/game_10ccd0.c | 50 ++++++++++++---------------------- src/include/game/game_0b0420.h | 2 +- src/include/game/game_102240.h | 2 +- src/include/game/game_10ccd0.h | 4 +-- 7 files changed, 34 insertions(+), 48 deletions(-) diff --git a/src/game/data/data_01a3a0.c b/src/game/data/data_01a3a0.c index 7e8da74ad..37c320c58 100644 --- a/src/game/data/data_01a3a0.c +++ b/src/game/data/data_01a3a0.c @@ -831,14 +831,14 @@ struct menu_item menuitems_1b7bc[] = { { MENUITEMTYPE_LABEL, 0, L_AME(16), L_OPTIONS(279), 0x00000000, NULL }, // "Agent Status:" { MENUITEMTYPE_LABEL, 0, 0x00000020, (u32)&soloMenuTextAgentStatus, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, L_AME(16), L_OPTIONS(280), 0x00000000, NULL }, // "Mission Time:" - { MENUITEMTYPE_LABEL, 0, 0x00000020, (u32)&menutextMissionTime, 0x00000000, NULL }, + { MENUITEMTYPE_LABEL, 0, 0x00000020, (u32)&soloMenuTextMissionTime, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, L_AME(16), L_MPWEAPONS(129), 0x00000000, NULL }, // "Difficulty" - { MENUITEMTYPE_LABEL, 0, 0x00000020, (u32)menutextDifficulty, 0x00000000, NULL }, + { MENUITEMTYPE_LABEL, 0, 0x00000020, (u32)soloMenuTextDifficulty, 0x00000000, NULL }, { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, L_AME(16), L_OPTIONS(281), 0x00000000, NULL }, // "Weapon of Choice:" { MENUITEMTYPE_LABEL, 0, 0x00000020, (u32)&mpMenuTextWeaponOfChoiceName, 0x00000000, NULL }, { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(282), (u32)&func0f10d044, NULL }, // "Kills:" + { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(282), (u32)&soloMenuTextNumKills, NULL }, // "Kills:" { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(283), (u32)&func0f10d1d0, NULL }, // "Accuracy:" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(284), (u32)&func0f10d080, NULL }, // "Shot Total:" @@ -857,16 +857,16 @@ u32 var80075968 = 0xff7f7fff; struct menu_item menuitems_1b98c[] = { { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(278), (u32)&soloMenuTextMissionStatus, NULL }, // "Mission Status:" { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(279), (u32)&soloMenuTextAgentStatus, NULL }, // "Agent Status:" - { MENUITEMTYPE_LABEL, 0, 0x01000000, L_OPTIONS(280), (u32)&menutextMissionTime, menuhandler0010e064 }, // "Mission Time:" + { MENUITEMTYPE_LABEL, 0, 0x01000000, L_OPTIONS(280), (u32)&soloMenuTextMissionTime, menuhandler0010e064 }, // "Mission Time:" { MENUITEMTYPE_LABEL, 1, 0x01000000, L_MPWEAPONS(242), (u32)&func0f10e4d8, menuhandler0010e064 }, // "Target Time:" - { MENUITEMTYPE_LABEL, 0, 0x00000000, L_MPWEAPONS(129), (u32)&menutextDifficulty, NULL }, // "Difficulty:" + { MENUITEMTYPE_LABEL, 0, 0x00000000, L_MPWEAPONS(129), (u32)&soloMenuTextDifficulty, NULL }, // "Difficulty:" { MENUITEMTYPE_SEPARATOR, 2, 0x00000000, 0x00000000, 0x00000000, menuhandler0010e064 }, { MENUITEMTYPE_LABEL, 2, 0x00000000, L_MPWEAPONS(243), 0x00000000, menuhandler0010e064 }, // "New Cheat Available!:" { MENUITEMTYPE_LABEL, 3, 0x01000020, (u32)&func0f10e3fc, 0x00000000, menuhandler0010e064 }, { MENUITEMTYPE_LABEL, 5, 0x01000020, (u32)&func0f10e468, 0x00000000, menuhandler0010e064 }, { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(281), (u32)&mpMenuTextWeaponOfChoiceName, NULL }, // "Weapon of Choice" - { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(282), (u32)&func0f10d044, NULL }, // "Kills:" + { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(282), (u32)&soloMenuTextNumKills, NULL }, // "Kills:" { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(283), (u32)&func0f10d1d0, NULL }, // "Accuracy:" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(284), (u32)&func0f10d080, NULL }, // "Shot Total:" diff --git a/src/game/game_0b0420.c b/src/game/game_0b0420.c index 650b2238f..d63d31879 100644 --- a/src/game/game_0b0420.c +++ b/src/game/game_0b0420.c @@ -262,7 +262,7 @@ glabel func0f0b05a4 ); GLOBAL_ASM( -glabel func0f0b073c +glabel currentPlayerGetNumKills /* f0b073c: 3c0e800a */ lui $t6,%hi(g_Vars+0x288) /* f0b0740: 8dcea248 */ lw $t6,%lo(g_Vars+0x288)($t6) /* f0b0744: 03e00008 */ jr $ra diff --git a/src/game/game_102240.c b/src/game/game_102240.c index 9f42b815d..fc85f1fdf 100644 --- a/src/game/game_102240.c +++ b/src/game/game_102240.c @@ -80,20 +80,20 @@ glabel func0f102240 /* f102298: 27bd0018 */ addiu $sp,$sp,0x18 ); -char *menutextDifficulty(s32 arg0) +char *soloMenuTextDifficulty(struct menu_item *item) { if (g_MissionConfig.pdmode) { - return langGet(0x54dd); + return langGet(L_MPWEAPONS(221)); } switch (g_MissionConfig.difficulty) { case DIFF_SA: - return langGet(0x56fc); + return langGet(L_OPTIONS(252)); case DIFF_PA: - return langGet(0x56fd); + return langGet(L_OPTIONS(253)); case DIFF_A: default: - return langGet(0x56fb); + return langGet(L_OPTIONS(251)); } } diff --git a/src/game/game_10ccd0.c b/src/game/game_10ccd0.c index 0a1d6afe1..f6000ea9a 100644 --- a/src/game/game_10ccd0.c +++ b/src/game/game_10ccd0.c @@ -44,19 +44,6 @@ const char var7f1b3860[] = "%s: %s\n"; const char var7f1b3868[] = "%s: %s\n"; -const char var7f1b3870[] = "%d"; -const char var7f1b3874[] = "%d"; -const char var7f1b3878[] = "%d"; -const char var7f1b387c[] = "%d"; -const char var7f1b3880[] = "%d"; -const char var7f1b3884[] = "%d"; -const char var7f1b3888[] = "%s%s%.1f%%"; -const char var7f1b3894[] = ""; -const char var7f1b3898[] = ""; -const char var7f1b389c[] = "%s: %s\n"; -const char var7f1b38a4[] = "%s\n"; -const char var7f1b38a8[] = "%s: %s\n"; -//const char var7f1b38b0[] = "\n"; s32 menuhandlerDeclineMission(u32 operation, struct menu_item *item, s32 *value) { @@ -282,24 +269,11 @@ s32 menuhandlerReplayPreviousMission(u32 operation, struct menu_item *item, s32 return menuhandlerAcceptMission(operation, NULL, value); } -GLOBAL_ASM( -glabel func0f10d044 -/* f10d044: 27bdffe8 */ addiu $sp,$sp,-24 -/* f10d048: afbf0014 */ sw $ra,0x14($sp) -/* f10d04c: 0fc2c1cf */ jal func0f0b073c -/* f10d050: afa40018 */ sw $a0,0x18($sp) -/* f10d054: 3c048007 */ lui $a0,%hi(g_StringPointer) -/* f10d058: 3c057f1b */ lui $a1,%hi(var7f1b3870) -/* f10d05c: 24a53870 */ addiu $a1,$a1,%lo(var7f1b3870) -/* f10d060: 8c841440 */ lw $a0,%lo(g_StringPointer)($a0) -/* f10d064: 0c004dad */ jal sprintf -/* f10d068: 00403025 */ or $a2,$v0,$zero -/* f10d06c: 8fbf0014 */ lw $ra,0x14($sp) -/* f10d070: 3c028007 */ lui $v0,%hi(g_StringPointer) -/* f10d074: 8c421440 */ lw $v0,%lo(g_StringPointer)($v0) -/* f10d078: 03e00008 */ jr $ra -/* f10d07c: 27bd0018 */ addiu $sp,$sp,0x18 -); +char *soloMenuTextNumKills(struct menu_item *item) +{ + sprintf(g_StringPointer, "%d", currentPlayerGetNumKills()); + return g_StringPointer; +} GLOBAL_ASM( glabel func0f10d080 @@ -657,7 +631,19 @@ glabel func0f10d678 /* f10d6e0: 27bd0020 */ addiu $sp,$sp,0x20 ); -char *menutextMissionTime(s32 arg0) +const char var7f1b3874[] = "%d"; +const char var7f1b3878[] = "%d"; +const char var7f1b387c[] = "%d"; +const char var7f1b3880[] = "%d"; +const char var7f1b3884[] = "%d"; +const char var7f1b3888[] = "%s%s%.1f%%"; +const char var7f1b3894[] = ""; +const char var7f1b3898[] = ""; +const char var7f1b389c[] = "%s: %s\n"; +const char var7f1b38a4[] = "%s\n"; +const char var7f1b38a8[] = "%s: %s\n"; + +char *soloMenuTextMissionTime(struct menu_item *item) { formatTime(g_StringPointer, getMissionTime(), 3); strcat(g_StringPointer, "\n"); diff --git a/src/include/game/game_0b0420.h b/src/include/game/game_0b0420.h index 7dee72a3f..f7f65225b 100644 --- a/src/include/game/game_0b0420.h +++ b/src/include/game/game_0b0420.h @@ -13,7 +13,7 @@ void decrementKnockoutCount(void); u8 getKnockoutCount(void); u32 getKillCount(void); u32 func0f0b05a4(void); -u32 func0f0b073c(void); +u32 currentPlayerGetNumKills(void); u32 func0f0b0764(void); u32 func0f0b0818(void); s32 func0f0b09f4(s32 arg0, s32 playernum); diff --git a/src/include/game/game_102240.h b/src/include/game/game_102240.h index cd1d8eafa..f740c1c77 100644 --- a/src/include/game/game_102240.h +++ b/src/include/game/game_102240.h @@ -4,7 +4,7 @@ #include "types.h" u32 func0f102240(void); -char *menutextDifficulty(s32 arg0); +char *soloMenuTextDifficulty(struct menu_item *item); s32 func0f102330(u32 operation, struct menu_item *item, s32 *value, s32 arg3); u32 func0f103550(void); f32 func0f1036ac(s32 arg0, s32 arg1); diff --git a/src/include/game/game_10ccd0.h b/src/include/game/game_10ccd0.h index b46ef343c..b79b6a736 100644 --- a/src/include/game/game_10ccd0.h +++ b/src/include/game/game_10ccd0.h @@ -8,7 +8,7 @@ void savefileSetFlag(u32 value); void savefileUnsetFlag(u32 value); u32 func0f10ce74(void); u32 func0f10cf2c(void); -u32 func0f10d044(void); +char *soloMenuTextNumKills(struct menu_item *item); u32 func0f10d080(void); u32 func0f10d0c0(void); u32 func0f10d100(void); @@ -20,7 +20,7 @@ char *soloMenuTextAgentStatus(struct menu_item *item); u32 func0f10d588(void); u32 func0f10d61c(void); u32 func0f10d678(void); -char *menutextMissionTime(s32 arg0); +char *soloMenuTextMissionTime(struct menu_item *item); u32 func0f10d730(void); void func0f10d770(void); void func0f10d910(s32 arg0);