Decompile mainMenuTextLabel

This commit is contained in:
Ryan Dwyer
2020-03-20 22:44:50 +10:00
parent 11e748bddf
commit 4ac17c0c48
4 changed files with 20 additions and 56 deletions
+6 -6
View File
@@ -2800,7 +2800,7 @@ struct menu_dialog g_SelectMissionMenuDialog = {
};
// 199e0
u16 mainmenulabels_nocheats[] = {
u16 g_MainMenuLabelsNoCheats[] = {
L_OPTIONS(117), // "Solo Missions"
L_OPTIONS(118), // "Combat Simulator"
L_OPTIONS(119), // "Co-Operative"
@@ -2808,7 +2808,7 @@ u16 mainmenulabels_nocheats[] = {
};
// 199e8
u16 mainmenulabels_withcheats[] = {
u16 g_MainMenuLabelsWithCheats[] = {
L_MPWEAPONS(130), // "Cheat Solo Missions"
L_MPWEAPONS(131), // "Cheat Combat Simulator"
L_MPWEAPONS(132), // "Cheat Co-Operative"
@@ -2818,10 +2818,10 @@ u16 mainmenulabels_withcheats[] = {
// 199f0
struct menu_item menuitems_mainmenu[] = {
{ MENUITEMTYPE_SELECTABLE, 0, 0x00400008, L_MISC(446), 0x00000001, NULL }, // "Carrington Institute"
{ MENUITEMTYPE_SELECTABLE, 0, 0x00400000, (u32)&func0f106a7c, 0x00000002, menuhandlerMainMenuSoloMissions },
{ MENUITEMTYPE_SELECTABLE, 1, 0x00400000, (u32)&func0f106a7c, 0x00000003, menuhandlerMainMenuCombatSimulator },
{ MENUITEMTYPE_SELECTABLE, 2, 0x00400000, (u32)&func0f106a7c, 0x00000004, menuhandlerMainMenuCooperative },
{ MENUITEMTYPE_SELECTABLE, 3, 0x00400000, (u32)&func0f106a7c, 0x00000005, menuhandlerMainMenuCounterOperative },
{ MENUITEMTYPE_SELECTABLE, 0, 0x00400000, (u32)&mainMenuTextLabel, 0x00000002, menuhandlerMainMenuSoloMissions },
{ MENUITEMTYPE_SELECTABLE, 1, 0x00400000, (u32)&mainMenuTextLabel, 0x00000003, menuhandlerMainMenuCombatSimulator },
{ MENUITEMTYPE_SELECTABLE, 2, 0x00400000, (u32)&mainMenuTextLabel, 0x00000004, menuhandlerMainMenuCooperative },
{ MENUITEMTYPE_SELECTABLE, 3, 0x00400000, (u32)&mainMenuTextLabel, 0x00000005, menuhandlerMainMenuCounterOperative },
{ MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(187), 0x00000006, &menudialog_changeagent }, // "Change Agent..."
{ MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL },
};
+11 -47
View File
@@ -4617,53 +4617,17 @@ bool menudialogMainMenu(u32 operation, struct menu_dialog *dialog, struct menust
return false;
}
GLOBAL_ASM(
glabel func0f106a7c
/* f106a7c: 27bdffd8 */ addiu $sp,$sp,-40
/* f106a80: 3c0e8007 */ lui $t6,%hi(mainmenulabels_nocheats)
/* f106a84: afbf0014 */ sw $ra,0x14($sp)
/* f106a88: 25ce39c0 */ addiu $t6,$t6,%lo(mainmenulabels_nocheats)
/* f106a8c: 8dc10000 */ lw $at,0x0($t6)
/* f106a90: 27a20020 */ addiu $v0,$sp,0x20
/* f106a94: 3c088007 */ lui $t0,%hi(mainmenulabels_withcheats)
/* f106a98: ac410000 */ sw $at,0x0($v0)
/* f106a9c: 8dd90004 */ lw $t9,0x4($t6)
/* f106aa0: 250839c8 */ addiu $t0,$t0,%lo(mainmenulabels_withcheats)
/* f106aa4: 27a30018 */ addiu $v1,$sp,0x18
/* f106aa8: ac590004 */ sw $t9,0x4($v0)
/* f106aac: 8d010000 */ lw $at,0x0($t0)
/* f106ab0: 3c0c800a */ lui $t4,%hi(g_CheatsEnabledBank0)
/* f106ab4: 00802825 */ or $a1,$a0,$zero
/* f106ab8: ac610000 */ sw $at,0x0($v1)
/* f106abc: 8d0b0004 */ lw $t3,0x4($t0)
/* f106ac0: 3c0d800a */ lui $t5,%hi(g_CheatsEnabledBank1)
/* f106ac4: ac6b0004 */ sw $t3,0x4($v1)
/* f106ac8: 8d8c21d8 */ lw $t4,%lo(g_CheatsEnabledBank0)($t4)
/* f106acc: 55800005 */ bnezl $t4,.L0f106ae4
/* f106ad0: 90b80001 */ lbu $t8,0x1($a1)
/* f106ad4: 8dad21dc */ lw $t5,%lo(g_CheatsEnabledBank1)($t5)
/* f106ad8: 51a00009 */ beqzl $t5,.L0f106b00
/* f106adc: 90b90001 */ lbu $t9,0x1($a1)
/* f106ae0: 90b80001 */ lbu $t8,0x1($a1)
.L0f106ae4:
/* f106ae4: 00187840 */ sll $t7,$t8,0x1
/* f106ae8: 006f7021 */ addu $t6,$v1,$t7
/* f106aec: 0fc5b9f1 */ jal langGet
/* f106af0: 95c40000 */ lhu $a0,0x0($t6)
/* f106af4: 10000007 */ beqz $zero,.L0f106b14
/* f106af8: 8fbf0014 */ lw $ra,0x14($sp)
/* f106afc: 90b90001 */ lbu $t9,0x1($a1)
.L0f106b00:
/* f106b00: 00195040 */ sll $t2,$t9,0x1
/* f106b04: 004a4821 */ addu $t1,$v0,$t2
/* f106b08: 0fc5b9f1 */ jal langGet
/* f106b0c: 95240000 */ lhu $a0,0x0($t1)
/* f106b10: 8fbf0014 */ lw $ra,0x14($sp)
.L0f106b14:
/* f106b14: 27bd0028 */ addiu $sp,$sp,0x28
/* f106b18: 03e00008 */ jr $ra
/* f106b1c: 00000000 */ sll $zero,$zero,0x0
);
char *mainMenuTextLabel(struct menu_item *item)
{
u16 nocheats[4] = g_MainMenuLabelsNoCheats;
u16 withcheats[4] = g_MainMenuLabelsWithCheats;
if (g_CheatsEnabledBank0 || g_CheatsEnabledBank1) {
return langGet(withcheats[item->param]);
}
return langGet(nocheats[item->param]);
}
GLOBAL_ASM(
glabel func0f106b20
+2 -2
View File
@@ -214,8 +214,8 @@ extern struct menu_dialog menudialog_status;
extern struct cutsceneentry cutscenetable[];
extern struct cutscenegroup cutscenegrouptable[];
extern struct menu_dialog g_SelectMissionMenuDialog;
extern u16 mainmenulabels_nocheats[];
extern u16 mainmenulabels_withcheats[];
extern u16 g_MainMenuLabelsNoCheats[4];
extern u16 g_MainMenuLabelsWithCheats[4];
extern struct menu_dialog g_MainMenuMenuDialog;
extern struct menu_dialog g_MainMenu4MbMenuDialog;
extern struct cheat g_Cheats[NUM_CHEATS];
+1 -1
View File
@@ -23,7 +23,7 @@ char *invMenuTextWeaponManufacturer(struct menu_item *item);
char *invMenuTextWeaponDescription(struct menu_item *item);
u32 func0f106508(void);
u32 func0f1065c0(void);
u32 func0f106a7c(void);
char *mainMenuTextLabel(struct menu_item *item);
u32 func0f106b20(void);
s32 menudialog00103368(u32, u32, u32 *);
void menudialog00103608(void);