Rename many filemgr symbols and improve menu data structure

This commit is contained in:
Ryan Dwyer
2021-09-16 23:26:54 +10:00
parent cf418683a2
commit 6ef216fa18
15 changed files with 481 additions and 453 deletions
+54 -54
View File
@@ -315,7 +315,7 @@ char *menuTitleStageCompleted(struct menuitem *item)
{
#if VERSION >= VERSION_NTSC_1_0
sprintf(g_StringPointer, "%s: %s\n",
langGet(g_StageNames[g_Menus[g_MpPlayerNum].data.endscreen.stageindex].name3),
langGet(g_StageNames[g_Menus[g_MpPlayerNum].endscreen.stageindex].name3),
langGet(L_OPTIONS_276)); // "Completed"
#else
sprintf(g_StringPointer, "%s: %s\n",
@@ -533,7 +533,7 @@ void endscreenHandleContinue(s32 context)
menuPopDialog();
} else {
if (g_Vars.stagenum == STAGE_DEEPSEA || g_Vars.stagenum == STAGE_SKEDARRUINS) {
if (context == 2 || g_Menus[g_MpPlayerNum].data.endscreen.isfirstcompletion) {
if (context == 2 || g_Menus[g_MpPlayerNum].endscreen.isfirstcompletion) {
// Pressed continue
if (g_Vars.stagenum == STAGE_DEEPSEA) {
if (!isStageDifficultyUnlocked(g_MissionConfig.stageindex + 1, g_MissionConfig.difficulty)) {
@@ -625,7 +625,7 @@ void endscreenHandleContinue(s32 context)
s32 menudialogSolo2PEndscreenCompleted(s32 operation, struct menudialog *dialog, union handlerdata *data)
{
if (operation == MENUOP_OPEN) {
g_Menus[g_MpPlayerNum].data.endscreen.unke1c = 0;
g_Menus[g_MpPlayerNum].endscreen.unke1c = 0;
}
if (operation == MENUOP_TICK) {
@@ -635,15 +635,15 @@ s32 menudialogSolo2PEndscreenCompleted(s32 operation, struct menudialog *dialog,
struct menuinputs *inputs = data->dialog2.inputs;
if (inputs->select || inputs->back || inputs->start) {
g_Menus[g_MpPlayerNum].data.endscreen.unke1c = 6;
g_Menus[g_MpPlayerNum].endscreen.unke1c = 6;
}
if (g_Menus[g_MpPlayerNum].data.endscreen.unke1c) {
if (g_Menus[g_MpPlayerNum].endscreen.unke1c) {
if (var8009dfc0) {
g_Menus[g_MpPlayerNum].data.endscreen.unke1c--;
g_Menus[g_MpPlayerNum].endscreen.unke1c--;
}
if (g_Menus[g_MpPlayerNum].data.endscreen.unke1c == 0) {
if (g_Menus[g_MpPlayerNum].endscreen.unke1c == 0) {
endscreenHandleContinue(0);
}
}
@@ -911,7 +911,7 @@ glabel menudialogSolo2PEndscreenCompleted
s32 menudialogSolo2PEndscreenFailed(s32 operation, struct menudialog *dialog, union handlerdata *data)
{
if (operation == MENUOP_OPEN) {
g_Menus[g_MpPlayerNum].data.endscreen.unke1c = 0;
g_Menus[g_MpPlayerNum].endscreen.unke1c = 0;
}
if (operation == MENUOP_TICK) {
@@ -921,15 +921,15 @@ s32 menudialogSolo2PEndscreenFailed(s32 operation, struct menudialog *dialog, un
struct menuinputs *inputs = data->dialog2.inputs;
if (inputs->select || inputs->back || inputs->start) {
g_Menus[g_MpPlayerNum].data.endscreen.unke1c = 6;
g_Menus[g_MpPlayerNum].endscreen.unke1c = 6;
}
if (g_Menus[g_MpPlayerNum].data.endscreen.unke1c) {
if (g_Menus[g_MpPlayerNum].endscreen.unke1c) {
if (var8009dfc0) {
g_Menus[g_MpPlayerNum].data.endscreen.unke1c--;
g_Menus[g_MpPlayerNum].endscreen.unke1c--;
}
if (g_Menus[g_MpPlayerNum].data.endscreen.unke1c == 0) {
if (g_Menus[g_MpPlayerNum].endscreen.unke1c == 0) {
if (g_Vars.antiplayernum >= 0
|| (g_Vars.coopplayernum >= 0 && PLAYERCOUNT() >= 2)
|| stageGetIndex(g_MissionConfig.stagenum) < 0
@@ -1021,14 +1021,14 @@ struct menuitem g_MissionEndscreenMenuItems[] = {
s32 menuhandlerEndscreenCheats(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_GETCOLOUR
&& ((g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x200) || item->param == 5)) {
&& ((g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x200) || item->param == 5)) {
// Timed cheat just got unlocked, and this item is the timed cheat name
u32 weight = func0f006b08(40) * 255;
func0000db30("ctcol", &g_CheatColour);
if (item->param == 0
&& cheatGetTime(g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0xff) == 0) {
&& cheatGetTime(g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0xff) == 0) {
return 0;
}
@@ -1045,7 +1045,7 @@ s32 menuhandlerEndscreenCheats(s32 operation, struct menuitem *item, union handl
if (operation == MENUOP_CHECKHIDDEN) {
if (item->param == 1) { // target time
u32 info = g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo;
u32 info = g_Menus[g_MpPlayerNum].endscreen.cheatinfo;
if (info & 0x800) { // completion cheat just got unlocked
return true;
@@ -1059,19 +1059,19 @@ s32 menuhandlerEndscreenCheats(s32 operation, struct menuitem *item, union handl
}
return true;
} else if (item->param == 2 && (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0xa00) == 0) {
} else if (item->param == 2 && (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0xa00) == 0) {
// new cheat available
return true;
} else if (item->param == 3 && (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x200) == 0) {
} else if (item->param == 3 && (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x200) == 0) {
// completion cheat name
return true;
} else if (item->param == 4 && (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0xa00)) {
} else if (item->param == 4 && (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0xa00)) {
// others (shots)
return true;
} else if (item->param == 6 && (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0xa00) == 0xa00) {
} else if (item->param == 6 && (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0xa00) == 0xa00) {
// limb shots
return true;
} else if (item->param == 5 && (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x800) == 0) {
} else if (item->param == 5 && (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x800) == 0) {
// timed cheat name
return true;
}
@@ -1084,8 +1084,8 @@ s32 menuhandlerEndscreenCheats(s32 operation, struct menuitem *item, union handl
#if VERSION >= VERSION_NTSC_1_0
char *soloMenuTextTimedCheatName(struct menuitem *item)
{
if (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x00000300) {
return cheatGetName(g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0xff);
if (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x00000300) {
return cheatGetName(g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0xff);
}
return NULL;
@@ -1095,8 +1095,8 @@ char *soloMenuTextTimedCheatName(struct menuitem *item)
#if VERSION >= VERSION_NTSC_1_0
char *soloMenuTextCompletionCheatName(struct menuitem *item)
{
if (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x00000800) {
return cheatGetName((g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo >> 16) & 0xff);
if (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x00000800) {
return cheatGetName((g_Menus[g_MpPlayerNum].endscreen.cheatinfo >> 16) & 0xff);
}
return NULL;
@@ -1162,11 +1162,11 @@ const char var7f1b38bc[] = "\n";
//{
// s32 time;
//
// if ((g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x00000100) == 0) {
// if ((g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x00000100) == 0) {
// return NULL;
// }
//
// time = cheatGetTime(g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0xff);
// time = cheatGetTime(g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0xff);
//
// if (!time) {
// return NULL;
@@ -1183,7 +1183,7 @@ void endscreenSetCoopCompleted(void)
if (g_CheatsActiveBank0 == 0 && g_CheatsActiveBank1 == 0) {
#if VERSION >= VERSION_NTSC_1_0
if (g_GameFile.coopcompletions[g_MissionConfig.difficulty] & (1 << g_MissionConfig.stageindex)) {
g_Menus[g_MpPlayerNum].data.endscreen.isfirstcompletion = true;
g_Menus[g_MpPlayerNum].endscreen.isfirstcompletion = true;
}
#endif
@@ -1222,11 +1222,11 @@ void endscreenPrepare(void)
u16 prevbest;
bool nowunlocked;
g_Menus[g_MpPlayerNum].data.endscreen.stageindex = g_MissionConfig.stageindex;
g_Menus[g_MpPlayerNum].endscreen.stageindex = g_MissionConfig.stageindex;
if (g_MenuData.root != MENUROOT_ENDSCREEN && g_Vars.mplayerisrunning == false) {
g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo = 0;
g_Menus[g_MpPlayerNum].data.endscreen.isfirstcompletion = false;
g_Menus[g_MpPlayerNum].endscreen.cheatinfo = 0;
g_Menus[g_MpPlayerNum].endscreen.isfirstcompletion = false;
g_Menus[g_MpPlayerNum].playernum = 0;
// Set cheat info
@@ -1237,11 +1237,11 @@ void endscreenPrepare(void)
complcheatid = cheatGetByCompletedStageIndex(g_MissionConfig.stageindex);
if (timedcheatid >= 0) {
g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo = 0x0100 | timedcheatid;
g_Menus[g_MpPlayerNum].endscreen.cheatinfo = 0x0100 | timedcheatid;
}
if (complcheatid >= 0) {
g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo |= 0x1000 | (complcheatid << 16);
g_Menus[g_MpPlayerNum].endscreen.cheatinfo |= 0x1000 | (complcheatid << 16);
}
}
@@ -1263,17 +1263,17 @@ void endscreenPrepare(void)
complalreadyunlocked = false;
// If there's a timed cheat for this stage + difficulty
if (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x100) {
timedalreadyunlocked = cheatIsUnlocked(g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0xff);
if (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x100) {
timedalreadyunlocked = cheatIsUnlocked(g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0xff);
if (timedalreadyunlocked) {
g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo |= 0x400;
g_Menus[g_MpPlayerNum].endscreen.cheatinfo |= 0x400;
}
}
// If there's a completion cheat for this stage (ie. not a special stage)
if (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x1000) {
complalreadyunlocked = cheatIsUnlocked((g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo >> 16) & 0xff);
if (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x1000) {
complalreadyunlocked = cheatIsUnlocked((g_Menus[g_MpPlayerNum].endscreen.cheatinfo >> 16) & 0xff);
}
// Update total mission time
@@ -1315,7 +1315,7 @@ void endscreenPrepare(void)
prevbest = g_GameFile.besttimes[g_MissionConfig.stageindex][g_MissionConfig.difficulty];
if (prevbest == 0) {
g_Menus[g_MpPlayerNum].data.endscreen.isfirstcompletion = true;
g_Menus[g_MpPlayerNum].endscreen.isfirstcompletion = true;
}
if (secs < prevbest || prevbest == 0) {
@@ -1339,19 +1339,19 @@ void endscreenPrepare(void)
}
}
if (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x100) {
nowunlocked = cheatIsUnlocked(g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0xff);
if (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x100) {
nowunlocked = cheatIsUnlocked(g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0xff);
if (!timedalreadyunlocked && nowunlocked) {
g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo |= 0x0200;
g_Menus[g_MpPlayerNum].endscreen.cheatinfo |= 0x0200;
}
}
if (g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo & 0x1000) {
nowunlocked = cheatIsUnlocked((g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo >> 16) & 0xff);
if (g_Menus[g_MpPlayerNum].endscreen.cheatinfo & 0x1000) {
nowunlocked = cheatIsUnlocked((g_Menus[g_MpPlayerNum].endscreen.cheatinfo >> 16) & 0xff);
if (!complalreadyunlocked && nowunlocked) {
g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo |= 0x0800;
g_Menus[g_MpPlayerNum].endscreen.cheatinfo |= 0x0800;
}
}
@@ -1365,7 +1365,7 @@ void endscreenPrepare(void)
}
}
func0f1094e4(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
filemgrSaveOrLoad(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
}
if (g_MenuData.root == MENUROOT_ENDSCREEN) {
@@ -1569,7 +1569,7 @@ glabel endscreenPrepare
/* f1091c8: 3c04800a */ lui $a0,0x800a
/* f1091cc: 248467b0 */ addiu $a0,$a0,0x67b0
/* f1091d0: 00002825 */ or $a1,$zero,$zero
/* f1091d4: 0fc41358 */ jal func0f1094e4
/* f1091d4: 0fc41358 */ jal filemgrSaveOrLoad
/* f1091d8: 00003025 */ or $a2,$zero,$zero
/* f1091dc: 3c03800a */ lui $v1,0x800a
/* f1091e0: 8c635eb4 */ lw $v1,0x5eb4($v1)
@@ -1637,9 +1637,9 @@ void soloPushCoopModeEndscreen(void)
g_MpPlayerNum = g_Vars.currentplayerstats->mpindex;
#if VERSION >= VERSION_NTSC_1_0
g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo = 0;
g_Menus[g_MpPlayerNum].data.endscreen.isfirstcompletion = false;
g_Menus[g_MpPlayerNum].data.endscreen.stageindex = g_MissionConfig.stageindex;
g_Menus[g_MpPlayerNum].endscreen.cheatinfo = 0;
g_Menus[g_MpPlayerNum].endscreen.isfirstcompletion = false;
g_Menus[g_MpPlayerNum].endscreen.stageindex = g_MissionConfig.stageindex;
#endif
g_Menus[g_MpPlayerNum].playernum = g_Vars.currentplayernum;
@@ -1666,7 +1666,7 @@ void soloPushCoopModeEndscreen(void)
}
if (g_Vars.currentplayer == g_Vars.bond) {
func0f1094e4(&g_GameFileGuid, FILEOP_SAVE_GAME_000, NULL);
filemgrSaveOrLoad(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
}
g_MpPlayerNum = prevplayernum;
@@ -1781,9 +1781,9 @@ void soloPushAntiModeEndscreen(void)
g_MpPlayerNum = g_Vars.currentplayerstats->mpindex;
#if VERSION >= VERSION_NTSC_1_0
g_Menus[g_MpPlayerNum].data.endscreen.cheatinfo = 0;
g_Menus[g_MpPlayerNum].data.endscreen.isfirstcompletion = false;
g_Menus[g_MpPlayerNum].data.endscreen.stageindex = g_MissionConfig.stageindex;
g_Menus[g_MpPlayerNum].endscreen.cheatinfo = 0;
g_Menus[g_MpPlayerNum].endscreen.isfirstcompletion = false;
g_Menus[g_MpPlayerNum].endscreen.stageindex = g_MissionConfig.stageindex;
#endif
g_Menus[g_MpPlayerNum].playernum = g_Vars.currentplayernum;
@@ -1806,7 +1806,7 @@ void soloPushAntiModeEndscreen(void)
}
}
func0f1094e4(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
filemgrSaveOrLoad(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
} else {
if (g_Vars.anti->aborted == 0 &&
(g_Vars.bond->isdead || g_Vars.bond->aborted || objectiveIsAllComplete() == false)) {
+8 -8
View File
@@ -970,10 +970,10 @@ glabel var7f1a863c
/* f01cc3c: 00000000 */ nop
.PF0f01cc40:
/* f01cc40: a0590000 */ sb $t9,0x0($v0)
/* f01cc44: 0fc445cf */ jal func0f110c5c
/* f01cc44: 0fc445cf */ jal filelistCreate
/* f01cc48: 24050002 */ li $a1,0x2
/* f01cc4c: 02c02025 */ move $a0,$s6
/* f01cc50: 0fc445cf */ jal func0f110c5c
/* f01cc50: 0fc445cf */ jal filelistCreate
/* f01cc54: 24050001 */ li $a1,0x1
.PF0f01cc58:
/* f01cc58: 3c0e8006 */ lui $t6,0x8006
@@ -2747,10 +2747,10 @@ glabel var7f1a863c
/* f01cb6c: 00000000 */ nop
.L0f01cb70:
/* f01cb70: a04e0000 */ sb $t6,0x0($v0)
/* f01cb74: 0fc44317 */ jal func0f110c5c
/* f01cb74: 0fc44317 */ jal filelistCreate
/* f01cb78: 24050002 */ addiu $a1,$zero,0x2
/* f01cb7c: 02c02025 */ or $a0,$s6,$zero
/* f01cb80: 0fc44317 */ jal func0f110c5c
/* f01cb80: 0fc44317 */ jal filelistCreate
/* f01cb84: 24050001 */ addiu $a1,$zero,0x1
.L0f01cb88:
/* f01cb88: 3c188006 */ lui $t8,%hi(var80062944)
@@ -4515,10 +4515,10 @@ glabel var7f1a863c
/* f01c84c: 00000000 */ sll $zero,$zero,0x0
.NB0f01c850:
/* f01c850: a04e0000 */ sb $t6,0x0($v0)
/* f01c854: 0fc42c33 */ jal func0f110c5c
/* f01c854: 0fc42c33 */ jal filelistCreate
/* f01c858: 24050002 */ addiu $a1,$zero,0x2
/* f01c85c: 02c02025 */ or $a0,$s6,$zero
/* f01c860: 0fc42c33 */ jal func0f110c5c
/* f01c860: 0fc42c33 */ jal filelistCreate
/* f01c864: 24050001 */ addiu $a1,$zero,0x1
.NB0f01c868:
/* f01c868: 3c188006 */ lui $t8,0x8006
@@ -5805,8 +5805,8 @@ glabel var7f1a863c
// if (var80062948 == 0 &&
// (g_MenuData.root == MENUROOT_MPSETUP || g_MenuData.root == MENUROOT_4MBMAINMENU)) {
// var80062948 = 1;
// func0f110c5c(0, FILETYPE_MPPLAYER);
// func0f110c5c(1, FILETYPE_MPSETUP);
// filelistCreate(0, FILETYPE_MPPLAYER);
// filelistCreate(1, FILETYPE_MPSETUP);
// }
//
// if (var80062944) {
+11 -11
View File
@@ -4831,7 +4831,7 @@ glabel func0f0f3220
/* f0f3304: 3c04800a */ lui $a0,%hi(g_GameFileGuid)
/* f0f3308: 248422c0 */ addiu $a0,$a0,%lo(g_GameFileGuid)
/* f0f330c: afa80024 */ sw $t0,0x24($sp)
/* f0f3310: 0fc42539 */ jal func0f1094e4
/* f0f3310: 0fc42539 */ jal filemgrSaveOrLoad
/* f0f3314: afa9001c */ sw $t1,0x1c($sp)
/* f0f3318: 3c078007 */ lui $a3,%hi(g_MpPlayerNum)
/* f0f331c: 24e71448 */ addiu $a3,$a3,%lo(g_MpPlayerNum)
@@ -4858,7 +4858,7 @@ glabel func0f0f3220
/* f0f3368: 24050003 */ addiu $a1,$zero,0x3
/* f0f336c: 00603025 */ or $a2,$v1,$zero
/* f0f3370: afa80024 */ sw $t0,0x24($sp)
/* f0f3374: 0fc42539 */ jal func0f1094e4
/* f0f3374: 0fc42539 */ jal filemgrSaveOrLoad
/* f0f3378: afad0018 */ sw $t5,0x18($sp)
/* f0f337c: 8fb90018 */ lw $t9,0x18($sp)
/* f0f3380: 3c078007 */ lui $a3,%hi(g_MpPlayerNum)
@@ -4909,7 +4909,7 @@ glabel func0f0f3220
/* f0efe94: 248467b0 */ addiu $a0,$a0,0x67b0
/* f0efe98: 00002825 */ or $a1,$zero,$zero
/* f0efe9c: 00003025 */ or $a2,$zero,$zero
/* f0efea0: 0fc41358 */ jal func0f1094e4
/* f0efea0: 0fc41358 */ jal filemgrSaveOrLoad
/* f0efea4: afa80020 */ sw $t0,0x20($sp)
/* f0efea8: 8fa80020 */ lw $t0,0x20($sp)
/* f0efeac: 3c078007 */ lui $a3,0x8007
@@ -4935,7 +4935,7 @@ glabel func0f0f3220
/* f0efef8: 00601025 */ or $v0,$v1,$zero
/* f0efefc: 24050003 */ addiu $a1,$zero,0x3
/* f0eff00: 00603025 */ or $a2,$v1,$zero
/* f0eff04: 0fc41358 */ jal func0f1094e4
/* f0eff04: 0fc41358 */ jal filemgrSaveOrLoad
/* f0eff08: afb8001c */ sw $t8,0x1c($sp)
/* f0eff0c: 8fac001c */ lw $t4,0x1c($sp)
/* f0eff10: 3c078007 */ lui $a3,0x8007
@@ -21929,7 +21929,7 @@ glabel var7f1b2ac8
/* f0fb010: afab00f0 */ sw $t3,0xf0($sp)
/* f0fb014: afac012c */ sw $t4,0x12c($sp)
/* f0fb018: afae00cc */ sw $t6,0xcc($sp)
/* f0fb01c: 0fc42793 */ jal func0f1094e4
/* f0fb01c: 0fc42793 */ jal filemgrSaveOrLoad
/* f0fb020: a7af00d0 */ sh $t7,0xd0($sp)
/* f0fb024: 8fa80124 */ lw $t0,0x124($sp)
/* f0fb028: 8fa90128 */ lw $t1,0x128($sp)
@@ -22980,7 +22980,7 @@ glabel var7f1b2ac8
/* f0fa8d4: afab00f0 */ sw $t3,0xf0($sp)
/* f0fa8d8: afac012c */ sw $t4,0x12c($sp)
/* f0fa8dc: afae00cc */ sw $t6,0xcc($sp)
/* f0fa8e0: 0fc42539 */ jal func0f1094e4
/* f0fa8e0: 0fc42539 */ jal filemgrSaveOrLoad
/* f0fa8e4: a7af00d0 */ sh $t7,0xd0($sp)
/* f0fa8e8: 8fa80124 */ lw $t0,0x124($sp)
/* f0fa8ec: 8fa90128 */ lw $t1,0x128($sp)
@@ -27492,7 +27492,7 @@ s32 menudialog000fcd48(s32 operation, struct menudialog *dialog, union handlerda
if (operation == MENUOP_TICK) {
if (g_Menus[g_MpPlayerNum].curframe
&& g_Menus[g_MpPlayerNum].curframe->dialog == dialog
&& joy000155b4(g_Menus[g_MpPlayerNum].savedevice) == 0) {
&& joy000155b4(g_Menus[g_MpPlayerNum].fm.device3) == 0) {
func0f0f3704(&g_PakRemovedMenuDialog);
}
}
@@ -27524,7 +27524,7 @@ glabel func0f0fcdd0
s32 menuhandlerRepairPak(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
if (pakRepair(g_Menus[g_MpPlayerNum].savedevice)) {
if (pakRepair(g_Menus[g_MpPlayerNum].fm.device3)) {
func0f0f3704(&g_PakRepairSuccessMenuDialog);
} else {
func0f0f3704(&g_PakRepairFailedMenuDialog);
@@ -27703,8 +27703,8 @@ char *menuTextSaveDeviceName(struct menuitem *item)
#endif
};
if ((u8)g_Menus[g_MpPlayerNum].savedevice < ARRAYCOUNT(devices)) {
return langGet(devices[(u8)g_Menus[g_MpPlayerNum].savedevice]);
if ((u8)g_Menus[g_MpPlayerNum].fm.device3 < ARRAYCOUNT(devices)) {
return langGet(devices[(u8)g_Menus[g_MpPlayerNum].fm.device3]);
}
return NULL;
@@ -27717,7 +27717,7 @@ s32 menuhandlerRetrySavePak(s32 operation, struct menuitem *item, union handlerd
menuPopDialog();
g_Vars.unk0004e4 &= 0xfff0;
g_Vars.unk0004e4 |= 8;
g_Vars.unk0004e4 |= 1 << ((u8)g_Menus[g_MpPlayerNum].savedevice + 8);
g_Vars.unk0004e4 |= 1 << ((u8)g_Menus[g_MpPlayerNum].fm.device3 + 8);
}
return 0;
+27 -31
View File
@@ -103,11 +103,11 @@ s32 menuhandlerControlStyleImpl(s32 operation, struct menuitem *item, union hand
break;
case MENUOP_GETOPTIONVALUE:
data->list.value = optionsGetControlMode(mpindex);
g_Menus[g_MpPlayerNum].data.main.mpindex = mpindex;
g_Menus[g_MpPlayerNum].main.mpindex = mpindex;
break;
case MENUOP_LISTITEMFOCUS:
if (g_MenuData.root == MENUROOT_MAINMENU) {
g_Menus[g_MpPlayerNum].data.main.controlmode = data->list.value;
g_Menus[g_MpPlayerNum].main.controlmode = data->list.value;
}
break;
}
@@ -4147,7 +4147,7 @@ s32 menudialog0010559c(s32 operation, struct menudialog *dialog, union handlerda
break;
case MENUOP_CLOSE:
if ((g_Vars.modifiedfiles & MODFILE_GAME) && g_Vars.coopplayernum < 0 && g_Vars.antiplayernum < 0) {
if (func0f1094e4(&g_GameFileGuid, FILEOP_SAVE_GAME_001, 0) == 0) {
if (filemgrSaveOrLoad(&g_GameFileGuid, FILEOP_SAVE_GAME_001, 0) == 0) {
data->dialog1.preventclose = true;
}
@@ -4248,7 +4248,7 @@ s32 menuhandlerControlStyle(s32 operation, struct menuitem *item, union handlerd
s32 menuhandler001057ec(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
func0f1094e4(&g_GameFileGuid, FILEOP_SAVE_GAME_002, 0);
filemgrSaveOrLoad(&g_GameFileGuid, FILEOP_SAVE_GAME_002, 0);
}
return 0;
@@ -5786,7 +5786,7 @@ s32 menudialogMainMenu(s32 operation, struct menudialog *dialog, union handlerda
{
switch (operation) {
case MENUOP_OPEN:
g_Menus[g_MpPlayerNum].data.main.unke2c = 0;
g_Menus[g_MpPlayerNum].main.unke2c = 0;
break;
case MENUOP_TICK:
if (g_Menus[g_MpPlayerNum].curframe &&
@@ -5875,34 +5875,30 @@ bool soloChoosePauseDialog(void)
}
handled = true;
} else {
if (room == CIROOM_DEVICEROOM) {
if (dtdata->intraining) {
menuPushRootDialog(&g_DtDetailsMenuDialog, MENUROOT_TRAINING);
} else if (dtdata->finished) {
dtPushEndscreen();
} else {
menuPushRootDialog(&g_DtListMenuDialog, MENUROOT_TRAINING);
}
handled = true;
} else if (room == CIROOM_DEVICEROOM) {
if (dtdata->intraining) {
menuPushRootDialog(&g_DtDetailsMenuDialog, MENUROOT_TRAINING);
} else if (dtdata->finished) {
dtPushEndscreen();
} else {
if (dtdata->intraining) {
menuPushRootDialog(&g_DtDetailsMenuDialog, MENUROOT_TRAINING);
handled = true;
} else if (dtdata->finished) {
dtPushEndscreen();
handled = true;
} else if (room == CIROOM_FIRINGRANGE) {
if (frIsInTraining()) {
menuPushRootDialog(&g_FrTrainingInfoInGameMenuDialog, MENUROOT_TRAINING);
} else {
menuPushRootDialog(&g_FrWeaponListMenuDialog, MENUROOT_TRAINING);
}
handled = true;
}
menuPushRootDialog(&g_DtListMenuDialog, MENUROOT_TRAINING);
}
handled = true;
} else if (dtdata->intraining) {
menuPushRootDialog(&g_DtDetailsMenuDialog, MENUROOT_TRAINING);
handled = true;
} else if (dtdata->finished) {
dtPushEndscreen();
handled = true;
} else if (room == CIROOM_FIRINGRANGE) {
if (frIsInTraining()) {
menuPushRootDialog(&g_FrTrainingInfoInGameMenuDialog, MENUROOT_TRAINING);
} else {
menuPushRootDialog(&g_FrWeaponListMenuDialog, MENUROOT_TRAINING);
}
handled = true;
}
}
+243 -199
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -51,7 +51,7 @@ s32 menuhandler4MbAdvancedSetup(s32 operation, struct menuitem *item, union hand
s32 menuhandler0010cabc(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
mpSetCurrentChallenge(g_Menus[g_MpPlayerNum].data.main4mb.slotindex);
mpSetCurrentChallenge(g_Menus[g_MpPlayerNum].main4mb.slotindex);
func0f0f820c(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
}
+40 -40
View File
@@ -253,7 +253,7 @@ void func0f110bf8(void)
/**
* Allocate and build a file list.
*/
void func0f110c5c(s32 listnum, u8 filetype)
void filelistCreate(s32 listnum, u8 filetype)
{
if (g_FileLists[listnum] == NULL) {
func0f15e5b8(align16(sizeof(struct filelist)), 1);
@@ -270,7 +270,7 @@ void func0f110c5c(s32 listnum, u8 filetype)
var80062944 = 1;
}
s32 func0f110cf8(u8 filetype)
s32 filelistFindOrCreate(u8 filetype)
{
s32 bestindex = -1;
s32 i;
@@ -288,7 +288,7 @@ s32 func0f110cf8(u8 filetype)
}
if (bestindex >= 0) {
func0f110c5c(bestindex, filetype);
filelistCreate(bestindex, filetype);
return bestindex;
}
@@ -302,6 +302,9 @@ void func0f110d90(s32 index)
}
#endif
const char var7f1b39c8[] = "";
const char var7f1b39cc[] = "";
void filelistsTick(void)
{
u32 updateall;
@@ -361,6 +364,7 @@ void filelistsTick(void)
}
if (update) {
osSyncPrintf("Rebuilding pakWad %d:\n", i);
filelistUpdate(g_FileLists[i]);
g_FileLists[i]->updatedthisframe = true;
}
@@ -372,10 +376,6 @@ void filelistsTick(void)
}
}
const char var7f1b39c8[] = "";
const char var7f1b39cc[] = "";
const char var7f1b39d0[] = "Rebuilding pakWad %d:\n";
void filelistUpdate(struct filelist *list)
{
const u32 sp3a88[] = {0x80, 0x40, 0x20, 0x08};
@@ -444,7 +444,7 @@ void filelistUpdate(struct filelist *list)
// Iterating files
for (i = 0; i < len; i++) {
struct filelistfile *file = &list->files[list->numfiles];
s32 maybepfserr = func0f116800(filedevices[i], sp1288[i], file->unk06, 0x10);
s32 maybepfserr = func0f116800(filedevices[i], sp1288[i], file->name, sizeof(file->name));
if (maybepfserr);
@@ -593,50 +593,50 @@ const char var7f1b3a14[] = "gamefile.c";
//
// if (g_Menus[playernum].headtextures == NULL) {
// if (textures == NULL) {
// g_Menus[playernum].unke40_01 = true;
// g_Menus[playernum].fm.unke40_01 = true;
// func0f15e5b8(align16(sizeof(struct perfectheadtexturelist)), 1);
// g_Menus[playernum].headtextures = func00012ab0(align16(sizeof(struct perfectheadtexturelist)));
// g_Menus[playernum].fm.headtextures = func00012ab0(align16(sizeof(struct perfectheadtexturelist)));
// } else {
// g_Menus[playernum].headtextures = textures;
// g_Menus[playernum].unke40_01 = false;
// g_Menus[playernum].fm.headtextures = textures;
// g_Menus[playernum].fm.unke40_01 = false;
// }
// }
//
// if (g_Menus[playernum].headtextures == NULL) {
// if (g_Menus[playernum].fm.headtextures == NULL) {
// faultAssert("tc != NULL", "gamefile.c", 458);
// }
//
// for (i = 0; i != ARRAYCOUNT(g_Menus[playernum].headtextures->fileguids); i++) {
// g_Menus[playernum].headtextures->fileguids[i].filenum = 0;
// g_Menus[playernum].headtextures->fileguids[i].deviceserial = 0;
// g_Menus[playernum].fm.headtextures->fileguids[i].filenum = 0;
// g_Menus[playernum].fm.headtextures->fileguids[i].deviceserial = 0;
// }
//
// g_Menus[playernum].headtextures->lastupdated240 = 0;
// g_Menus[playernum].fm.headtextures->lastupdated240 = 0;
//
// g_Menus[playernum].headtextures->selectedtexture.width = 16;
// g_Menus[playernum].headtextures->selectedtexture.height = 16;
// g_Menus[playernum].headtextures->selectedtexture.level = 0;
// g_Menus[playernum].headtextures->selectedtexture.format = G_IM_FMT_I;
// g_Menus[playernum].headtextures->selectedtexture.depth = 0;
// g_Menus[playernum].headtextures->selectedtexture.s = 0;
// g_Menus[playernum].headtextures->selectedtexture.t = 1;
// g_Menus[playernum].headtextures->selectedtexture.unk0b = 0;
// g_Menus[playernum].fm.headtextures->selectedtexture.width = 16;
// g_Menus[playernum].fm.headtextures->selectedtexture.height = 16;
// g_Menus[playernum].fm.headtextures->selectedtexture.level = 0;
// g_Menus[playernum].fm.headtextures->selectedtexture.format = G_IM_FMT_I;
// g_Menus[playernum].fm.headtextures->selectedtexture.depth = 0;
// g_Menus[playernum].fm.headtextures->selectedtexture.s = 0;
// g_Menus[playernum].fm.headtextures->selectedtexture.t = 1;
// g_Menus[playernum].fm.headtextures->selectedtexture.unk0b = 0;
//
// for (j = 0; j < 16; j++) {
// for (k = 0; k < 0x80; k++) {
// g_Menus[playernum].headtextures->unk000[j][k] = k;
// g_Menus[playernum].fm.headtextures->unk000[j][k] = k;
// }
// }
//}
void pheadFreeTextures(s32 playernum)
{
if (g_Menus[playernum].headtextures != NULL) {
if (g_Menus[playernum].unke40_01) {
func00012cb4(g_Menus[playernum].headtextures, align16(sizeof(struct perfectheadtexturelist)));
if (g_Menus[playernum].fm.headtextures != NULL) {
if (g_Menus[playernum].fm.unke40_01) {
func00012cb4(g_Menus[playernum].fm.headtextures, align16(sizeof(struct perfectheadtexturelist)));
}
g_Menus[playernum].headtextures = NULL;
g_Menus[playernum].fm.headtextures = NULL;
}
}
@@ -647,14 +647,14 @@ struct textureconfig *pheadGetTexture(s32 playernum, s32 filenum, u16 deviceseri
s32 indextouse = -1;
for (i = 0; i < 16; i++) {
if (g_Menus[playernum].headtextures->fileguids[i].filenum == filenum
&& g_Menus[playernum].headtextures->fileguids[i].deviceserial == deviceserial) {
if (g_Menus[playernum].fm.headtextures->fileguids[i].filenum == filenum
&& g_Menus[playernum].fm.headtextures->fileguids[i].deviceserial == deviceserial) {
indextouse = i;
break;
}
if (g_Menus[playernum].headtextures->fileguids[i].filenum == 0) {
if (g_Menus[playernum].headtextures->fileguids[i].deviceserial == 0) {
if (g_Menus[playernum].fm.headtextures->fileguids[i].filenum == 0) {
if (g_Menus[playernum].fm.headtextures->fileguids[i].deviceserial == 0) {
freeslot = i;
}
}
@@ -671,16 +671,16 @@ struct textureconfig *pheadGetTexture(s32 playernum, s32 filenum, u16 deviceseri
return NULL;
}
if (g_Vars.thisframe240 - g_Menus[playernum].headtextures->lastupdated240 < 20) {
if (g_Vars.thisframe240 - g_Menus[playernum].fm.headtextures->lastupdated240 < 20) {
return NULL;
}
g_Menus[playernum].headtextures->lastupdated240 = g_Vars.thisframe240;
g_Menus[playernum].fm.headtextures->lastupdated240 = g_Vars.thisframe240;
func0f15015c(device, filenum, g_Menus[playernum].headtextures->unk000[freeslot]);
func0f15015c(device, filenum, g_Menus[playernum].fm.headtextures->unk000[freeslot]);
g_Menus[playernum].headtextures->fileguids[freeslot].filenum = filenum;
g_Menus[playernum].headtextures->fileguids[freeslot].deviceserial = deviceserial;
g_Menus[playernum].fm.headtextures->fileguids[freeslot].filenum = filenum;
g_Menus[playernum].fm.headtextures->fileguids[freeslot].deviceserial = deviceserial;
indextouse = freeslot;
}
@@ -689,7 +689,7 @@ struct textureconfig *pheadGetTexture(s32 playernum, s32 filenum, u16 deviceseri
return NULL;
}
g_Menus[playernum].headtextures->selectedtexture.textureptr = g_Menus[playernum].headtextures->unk000[indextouse];
g_Menus[playernum].fm.headtextures->selectedtexture.textureptr = g_Menus[playernum].fm.headtextures->unk000[indextouse];
return &g_Menus[playernum].headtextures->selectedtexture;
return &g_Menus[playernum].fm.headtextures->selectedtexture;
}
+15 -15
View File
@@ -8215,7 +8215,7 @@ char *menuItemScrollableGetText(u32 type)
{
switch (type) {
case DESCRIPTION_MPCONFIG:
return mpconfigGetDescription(g_Menus[g_MpPlayerNum].data.train.mpconfig);
return mpconfigGetDescription(g_Menus[g_MpPlayerNum].training.mpconfig);
case DESCRIPTION_MPCHALLENGE:
if (!mpIsChallengeLoaded()) {
g_Menus[g_MpPlayerNum].unk850 = 0x4fac5ace;
@@ -11488,17 +11488,17 @@ u16 menuControllerGetButtonAction(s32 mode, s32 buttonnum)
u32 textid = var80071354[mode][buttonnum];
if (textid == L_MPWEAPONS_194 // "AIM"
&& optionsGetAimControl(g_Menus[g_MpPlayerNum].data.main.mpindex) == AIMCONTROL_TOGGLE) {
&& optionsGetAimControl(g_Menus[g_MpPlayerNum].main.mpindex) == AIMCONTROL_TOGGLE) {
textid = L_MPWEAPONS_195; // "AIM TOGGLE"
}
if (textid == L_MPWEAPONS_196 // "LOOK UP"
&& optionsGetForwardPitch(g_Menus[g_MpPlayerNum].data.main.mpindex) == false) {
&& optionsGetForwardPitch(g_Menus[g_MpPlayerNum].main.mpindex) == false) {
textid = L_MPWEAPONS_198; // "LOOK DOWN"
}
if (textid == L_MPWEAPONS_197 // "LOOK DOWN"
&& optionsGetForwardPitch(g_Menus[g_MpPlayerNum].data.main.mpindex) == false) {
&& optionsGetForwardPitch(g_Menus[g_MpPlayerNum].main.mpindex) == false) {
textid = L_MPWEAPONS_199; // "LOOK UP"
}
@@ -11796,21 +11796,21 @@ Gfx *menuRenderItemController(Gfx *gdl, struct menurendercontext *context)
func0f153d24();
// If changing modes within the same group (eg. within 1.x)
if (data->curmode != (g_Menus[g_MpPlayerNum].data.main.controlmode & 0xff)) {
if (data->curmode != (g_Menus[g_MpPlayerNum].main.controlmode & 0xff)) {
data->prevmode = data->curmode;
data->curmode = g_Menus[g_MpPlayerNum].data.main.controlmode;
data->curmode = g_Menus[g_MpPlayerNum].main.controlmode;
data->textfadetimer = 0;
}
// If changing control group (eg. 1.4 -> 2.1)
if (data->controlgroup == 1) {
if (g_Menus[g_MpPlayerNum].data.main.controlmode < CONTROLMODE_21) {
if (g_Menus[g_MpPlayerNum].main.controlmode < CONTROLMODE_21) {
data->controlgroup = 2;
data->contfadetimer = 0;
data->prevmode = -1;
}
} else {
if (g_Menus[g_MpPlayerNum].data.main.controlmode >= CONTROLMODE_21) {
if (g_Menus[g_MpPlayerNum].main.controlmode >= CONTROLMODE_21) {
data->controlgroup = 1;
data->contfadetimer = 0;
data->prevmode = -1;
@@ -11860,13 +11860,13 @@ Gfx *menuRenderItemController(Gfx *gdl, struct menurendercontext *context)
g_MenuColourPalettes3[frame->type].unfocused,
g_MenuColourPalettes2[frame->type].unfocused);
if (g_Menus[g_MpPlayerNum].data.main.controlmode >= CONTROLMODE_21) {
if (g_Menus[g_MpPlayerNum].main.controlmode >= CONTROLMODE_21) {
sprintf(text, langGet(L_MPWEAPONS_213), // "Control Style %s %s"
langGet(g_ControlStyleOptions[g_Menus[g_MpPlayerNum].data.main.controlmode]),
langGet(g_ControlStyleOptions[g_Menus[g_MpPlayerNum].main.controlmode]),
langGet(L_MPWEAPONS_215)); // "(Two-Handed)"
} else {
sprintf(text, langGet(L_MPWEAPONS_213), // "Control Style %s %s"
langGet(g_ControlStyleOptions[g_Menus[g_MpPlayerNum].data.main.controlmode]),
langGet(g_ControlStyleOptions[g_Menus[g_MpPlayerNum].main.controlmode]),
langGet(L_MPWEAPONS_214)); // "(One-Handed)"
}
@@ -11879,16 +11879,16 @@ Gfx *menuRenderItemController(Gfx *gdl, struct menurendercontext *context)
textcolour = colourBlend(colour, colour & 0xffffff00, textalpha);
colour = colourBlend(colour, colour & 0xffffff00, contalpha);
if (g_Menus[g_MpPlayerNum].data.main.controlmode >= CONTROLMODE_21) {
if (g_Menus[g_MpPlayerNum].main.controlmode >= CONTROLMODE_21) {
gdl = menuRenderControllerInfo(gdl, context, 0, 12,
g_Menus[g_MpPlayerNum].data.main.controlmode,
g_Menus[g_MpPlayerNum].main.controlmode,
contalpha, textcolour, colour, data->prevmode);
gdl = menuRenderControllerInfo(gdl, context, 0, 80,
g_Menus[g_MpPlayerNum].data.main.controlmode + 4,
g_Menus[g_MpPlayerNum].main.controlmode + 4,
contalpha, textcolour, colour, data->prevmode);
} else {
gdl = menuRenderControllerInfo(gdl, context, 0, PAL ? 19 : 15,
g_Menus[g_MpPlayerNum].data.main.controlmode,
g_Menus[g_MpPlayerNum].main.controlmode,
contalpha, textcolour, colour, data->prevmode);
x = context->x;
+1 -1
View File
@@ -202,7 +202,7 @@ char *menutextMatchTime(s32 arg0)
char *mpMenuTextWeaponDescription(struct menuitem *item)
{
struct weapon *weapon = weaponFindById(g_Menus[g_MpPlayerNum].data.mppause.weaponnum);
struct weapon *weapon = weaponFindById(g_Menus[g_MpPlayerNum].mppause.weaponnum);
if (weapon) {
return langGet(weapon->description);
+32 -32
View File
@@ -575,7 +575,7 @@ s32 menuhandlerMpSaveSetupOverwrite(s32 operation, struct menuitem *item, union
{
if (operation == MENUOP_SET) {
menuPopDialog();
func0f1094e4(&g_MpSetup.fileguid, FILEOP_SAVE_MPSETUP, NULL);
filemgrSaveOrLoad(&g_MpSetup.fileguid, FILEOP_SAVE_MPSETUP, 0);
}
return 0;
@@ -3651,7 +3651,7 @@ glabel var7f1b818c
/* f17bc40: afae0024 */ sw $t6,0x24($sp)
/* f17bc44: 946d0004 */ lhu $t5,0x4($v1)
/* f17bc48: 00003025 */ or $a2,$zero,$zero
/* f17bc4c: 0fc42539 */ jal func0f1094e4
/* f17bc4c: 0fc42539 */ jal filemgrSaveOrLoad
/* f17bc50: a7ad0028 */ sh $t5,0x28($sp)
/* f17bc54: 8faf0034 */ lw $t7,0x34($sp)
.L0f17bc58:
@@ -3921,7 +3921,7 @@ glabel var7f1b818c
/* f1763a0: afae0024 */ sw $t6,0x24($sp)
/* f1763a4: 946d0004 */ lhu $t5,0x4($v1)
/* f1763a8: 00003025 */ or $a2,$zero,$zero
/* f1763ac: 0fc41358 */ jal func0f1094e4
/* f1763ac: 0fc41358 */ jal filemgrSaveOrLoad
/* f1763b0: a7ad0028 */ sh $t5,0x28($sp)
/* f1763b4: 8faf0034 */ lw $t7,0x34($sp)
.NB0f1763b8:
@@ -4061,14 +4061,14 @@ char *mpMenuTextMpconfigMarquee(struct menuitem *item)
s32 arenanum;
s32 i;
if (g_Menus[g_MpPlayerNum].data.mpsetup.slotindex < 0xffff && g_FileLists[1]) {
if (g_Menus[g_MpPlayerNum].mpsetup.slotindex < 0xffff && g_FileLists[1]) {
#if VERSION >= VERSION_NTSC_1_0
arenanum = -1;
#else
arenanum = 0;
#endif
mpsetupfileGetOverview(g_FileLists[1]->files[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].unk06,
mpsetupfileGetOverview(g_FileLists[1]->files[g_Menus[g_MpPlayerNum].mpsetup.slotindex].name,
filename, &numsims, &stagenum, &scenarionum);
for (i = 0; i < ARRAYCOUNT(g_MpArenas); i++) {
@@ -4211,7 +4211,7 @@ glabel var7f1b81a8
/* f17c108: 3c068007 */ lui $a2,%hi(g_MpPlayerNum)
/* f17c10c: 8cc61448 */ lw $a2,%lo(g_MpPlayerNum)($a2)
/* f17c110: 27a40044 */ addiu $a0,$sp,0x44
/* f17c114: 0fc42539 */ jal func0f1094e4
/* f17c114: 0fc42539 */ jal filemgrSaveOrLoad
/* f17c118: 24050065 */ addiu $a1,$zero,0x65
/* f17c11c: 10000018 */ b .L0f17c180
/* f17c120: 00001025 */ or $v0,$zero,$zero
@@ -4360,7 +4360,7 @@ glabel var7f1b81a8
/* f176828: 3c068007 */ lui $a2,0x8007
/* f17682c: 8cc63af0 */ lw $a2,0x3af0($a2)
/* f176830: 27a40044 */ addiu $a0,$sp,0x44
/* f176834: 0fc41358 */ jal func0f1094e4
/* f176834: 0fc41358 */ jal filemgrSaveOrLoad
/* f176838: 24050065 */ addiu $a1,$zero,0x65
/* f17683c: 10000018 */ beqz $zero,.NB0f1768a0
/* f176840: 00001025 */ or $v0,$zero,$zero
@@ -4521,7 +4521,7 @@ s32 menudialogMpReady(s32 operation, struct menudialog *dialog, union handlerdat
{
if (operation == MENUOP_OPEN) {
if (g_MpPlayers[g_MpPlayerNum].fileguid.filenum && g_MpPlayers[g_MpPlayerNum].fileguid.deviceserial) {
func0f1094e4(&g_MpPlayers[g_MpPlayerNum].fileguid, FILEOP_SAVE_MPPLAYER, (void *)g_MpPlayerNum);
filemgrSaveOrLoad(&g_MpPlayers[g_MpPlayerNum].fileguid, FILEOP_SAVE_MPPLAYER, g_MpPlayerNum);
}
}
@@ -4531,7 +4531,7 @@ s32 menudialogMpReady(s32 operation, struct menudialog *dialog, union handlerdat
s32 menudialogMpSimulant(s32 operation, struct menudialog *dialog, union handlerdata *data)
{
if (operation == MENUOP_TICK) {
if ((u8)g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.name[0] == '\0') {
if ((u8)g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.name[0] == '\0') {
menuPopDialog();
}
}
@@ -4977,7 +4977,7 @@ glabel var7f1b81e8
char *mpMenuTextSimulantDescription(struct menuitem *item)
{
return langGet(L_MISC_106 + g_Menus[g_MpPlayerNum].data.mpsetup.unke24);
return langGet(L_MISC_106 + g_Menus[g_MpPlayerNum].mpsetup.unke24);
}
s32 menuhandlerMpSimulantHead(s32 operation, struct menuitem *item, union handlerdata *data)
@@ -4995,28 +4995,28 @@ s32 menuhandlerMpSimulantHead(s32 operation, struct menuitem *item, union handle
*/
switch (operation) {
case MENUOP_SET:
g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.mpheadnum = start + data->carousel.value;
g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpheadnum = start + data->carousel.value;
case MENUOP_FOCUS:
if (operation == MENUOP_FOCUS
&& item->param2 == 1
&& g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.mpheadnum < start) {
g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.mpheadnum = start;
&& g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpheadnum < start) {
g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpheadnum = start;
}
break;
}
return func0f17b4f8(operation, item, data, g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.mpheadnum, 0);
return func0f17b4f8(operation, item, data, g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpheadnum, 0);
}
s32 menuhandlerMpSimulantBody(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.mpbodynum = data->carousel.value;
g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpbodynum = data->carousel.value;
}
return func0f179da4(operation, item, data,
g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.mpbodynum,
g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.mpheadnum,
g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpbodynum,
g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpheadnum,
0);
}
@@ -5294,7 +5294,7 @@ glabel menuhandlerMpSimulantDifficulty
s32 menuhandlerMpDeleteSimulant(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
mpRemoveSimulant(g_Menus[g_MpPlayerNum].data.mpsetup.slotindex);
mpRemoveSimulant(g_Menus[g_MpPlayerNum].mpsetup.slotindex);
menuPopDialog();
}
@@ -5303,7 +5303,7 @@ s32 menuhandlerMpDeleteSimulant(s32 operation, struct menuitem *item, union hand
char *mpMenuTitleEditSimulant(struct menudialog *dialog)
{
sprintf(g_StringPointer, "%s", &g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.name);
sprintf(g_StringPointer, "%s", &g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.name);
return g_StringPointer;
}
@@ -5313,8 +5313,8 @@ s32 menuhandlerMpChangeSimulantType(s32 operation, struct menuitem *item, union
s32 i;
s32 count = 0;
s32 simtypeindex = mpGetSimTypeIndex(
g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.simtype,
g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].difficulty);
g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.simtype,
g_MpSimulants[g_Menus[g_MpPlayerNum].mpsetup.slotindex].difficulty);
for (i = 0; i < simtypeindex; i++) {
if (mpIsFeatureUnlocked(g_MpSimulantTypes[i].requirefeature)) {
@@ -5322,7 +5322,7 @@ s32 menuhandlerMpChangeSimulantType(s32 operation, struct menuitem *item, union
}
}
g_Menus[g_MpPlayerNum].data.mpsetup.slotcount = count;
g_Menus[g_MpPlayerNum].mpsetup.slotcount = count;
menuPushDialog(&g_MpChangeSimulantMenuDialog);
}
@@ -5346,7 +5346,7 @@ s32 menuhandlerMpAddSimulant(s32 operation, struct menuitem *item, union handler
{
switch (operation) {
case MENUOP_SET:
g_Menus[g_MpPlayerNum].data.mpsetup.slotindex = -1;
g_Menus[g_MpPlayerNum].mpsetup.slotindex = -1;
menuPushDialog(&g_MpAddSimulantMenuDialog);
break;
case MENUOP_CHECKDISABLED:
@@ -5362,7 +5362,7 @@ s32 menuhandlerMpSimulantSlot(s32 operation, struct menuitem *item, union handle
{
switch (operation) {
case MENUOP_SET:
g_Menus[g_MpPlayerNum].data.mpsetup.slotindex = item->param;
g_Menus[g_MpPlayerNum].mpsetup.slotindex = item->param;
if ((g_MpSetup.chrslots & (1 << (item->param + 4))) == 0) {
menuPushDialog(&g_MpAddSimulantMenuDialog);
@@ -5413,7 +5413,7 @@ char *func0f17d3dc(struct menuitem *item)
s32 menudialogMpSimulants(s32 operation, struct menudialog *dialog, union handlerdata *data)
{
if (operation == MENUOP_OPEN) {
g_Menus[g_MpPlayerNum].data.mpsetup.slotcount = 0;
g_Menus[g_MpPlayerNum].mpsetup.slotcount = 0;
}
return false;
@@ -6313,7 +6313,7 @@ char *mpMenuTextTeamName(struct menuitem *item)
s32 menuhandlerMpTeamNameSlot(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
g_Menus[g_MpPlayerNum].data.mpsetup.slotindex = item->param2 - 0x5608;
g_Menus[g_MpPlayerNum].mpsetup.slotindex = item->param2 - 0x5608;
menuPushDialog(&g_MpChangeTeamNameMenuDialog);
}
@@ -6322,7 +6322,7 @@ s32 menuhandlerMpTeamNameSlot(s32 operation, struct menuitem *item, union handle
char *func0f17e318(struct menudialog *dialog)
{
sprintf(g_StringPointer, langGet(L_MPMENU_056), mpGetChallengeNameBySlot(g_Menus[g_MpPlayerNum].data.mpsetup.slotindex));
sprintf(g_StringPointer, langGet(L_MPMENU_056), mpGetChallengeNameBySlot(g_Menus[g_MpPlayerNum].mpsetup.slotindex));
return g_StringPointer;
}
@@ -6337,7 +6337,7 @@ s32 menuhandler0017e38c(s32 operation, struct menuitem *item, union handlerdata
#endif
menuPopDialog();
mpSetCurrentChallenge(g_Menus[g_MpPlayerNum].data.mpsetup.slotindex);
mpSetCurrentChallenge(g_Menus[g_MpPlayerNum].mpsetup.slotindex);
}
return 0;
@@ -6349,8 +6349,8 @@ s32 menudialog0017e3fc(s32 operation, struct menudialog *dialog, union handlerda
case MENUOP_OPEN:
g_Menus[g_MpPlayerNum].unk850 = 0;
g_Menus[g_MpPlayerNum].data.train.mpconfig = mpGetNthAvailableChallengeSomething(
g_Menus[g_MpPlayerNum].data.train.unke1c,
g_Menus[g_MpPlayerNum].training.mpconfig = mpGetNthAvailableChallengeSomething(
g_Menus[g_MpPlayerNum].training.unke1c,
g_Menus[g_MpPlayerNum].mpconfigbuffer,
g_Menus[g_MpPlayerNum].mpconfigbufferlen);
break;
@@ -7211,7 +7211,7 @@ s32 mpCombatChallengesMenuDialog(s32 operation, struct menudialog *dialog, union
s32 menuhandler0017ec64(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
mpSetCurrentChallenge(g_Menus[g_MpPlayerNum].data.mpsetup.slotindex);
mpSetCurrentChallenge(g_Menus[g_MpPlayerNum].mpsetup.slotindex);
func0f0f820c(&g_MpQuickGoMenuDialog, 3);
}
@@ -7450,7 +7450,7 @@ s32 menuhandlerMpSaveSettings(s32 operation, struct menuitem *item, union handle
menuPushDialog(&g_MpSaveSetupNameMenuDialog);
} else {
#if VERSION >= VERSION_NTSC_1_0
func0f108324(g_MpSetup.fileguid.deviceserial);
filemgrSetDevice1BySerial(g_MpSetup.fileguid.deviceserial);
#endif
menuPushDialog(&g_MpSaveSetupExistsMenuDialog);
+2 -2
View File
@@ -883,7 +883,7 @@ s32 frTrainingInfoMenuDialog(s32 operation, struct menudialog *dialog, union han
switch (operation) {
case MENUOP_OPEN:
weaponnum = frGetWeaponBySlot(frGetSlot());
g_Menus[g_MpPlayerNum].data.train.weaponnum = weaponnum;
g_Menus[g_MpPlayerNum].training.weaponnum = weaponnum;
func0f105948(weaponnum);
if (!frIsInTraining()) {
@@ -4996,7 +4996,7 @@ s32 dtTrainingDetailsMenuDialog(s32 operation, struct menudialog *dialog, union
s32 weaponnum = dtGetWeaponByDeviceIndex(dtGetIndexBySlot(g_DtSlot));
u16 unused[] = {64250, 38500, 25650, 25700, 12950};
func0f1a1ac0();
g_Menus[g_MpPlayerNum].data.train.weaponnum = weaponnum;
g_Menus[g_MpPlayerNum].training.weaponnum = weaponnum;
func0f105948(weaponnum);
#if VERSION >= VERSION_PAL_FINAL
+4 -4
View File
@@ -3201,7 +3201,7 @@ glabel var7f1b94e4
/* f1a0ce0: 3c04800a */ lui $a0,0x800a
/* f1a0ce4: 24842860 */ addiu $a0,$a0,0x2860
/* f1a0ce8: 00002825 */ move $a1,$zero
/* f1a0cec: 0fc42793 */ jal func0f1094e4
/* f1a0cec: 0fc42793 */ jal filemgrSaveOrLoad
/* f1a0cf0: 00003025 */ move $a2,$zero
/* f1a0cf4: 10000339 */ b .PF0f1a19dc
/* f1a0cf8: 8fbf007c */ lw $ra,0x7c($sp)
@@ -4301,7 +4301,7 @@ glabel var7f1b94e4
/* f19fbcc: 3c04800a */ lui $a0,%hi(g_GameFileGuid)
/* f19fbd0: 248422c0 */ addiu $a0,$a0,%lo(g_GameFileGuid)
/* f19fbd4: 00002825 */ or $a1,$zero,$zero
/* f19fbd8: 0fc42539 */ jal func0f1094e4
/* f19fbd8: 0fc42539 */ jal filemgrSaveOrLoad
/* f19fbdc: 00003025 */ or $a2,$zero,$zero
/* f19fbe0: 10000344 */ b .L0f1a08f4
/* f19fbe4: 8fbf007c */ lw $ra,0x7c($sp)
@@ -5460,7 +5460,7 @@ glabel var7f1b94e4
/* f199c7c: 3c04800a */ lui $a0,0x800a
/* f199c80: 248467b0 */ addiu $a0,$a0,0x67b0
/* f199c84: 00002825 */ or $a1,$zero,$zero
/* f199c88: 0fc41358 */ jal func0f1094e4
/* f199c88: 0fc41358 */ jal filemgrSaveOrLoad
/* f199c8c: 00003025 */ or $a2,$zero,$zero
/* f199c90: 1000031c */ beqz $zero,.NB0f19a904
/* f199c94: 8fbf007c */ lw $ra,0x7c($sp)
@@ -6426,7 +6426,7 @@ glabel var7f1b94e4
// case FRMENUTYPE_COMPLETED:
// sndStart(var80095200, SFX_TRAINING_COMPLETE, NULL, -1, -1, -1, -1, -1);
// func0f0f85e0(&g_FrCompletedMenuDialog, MENUROOT_TRAINING);
// func0f1094e4(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
// filemgrSaveOrLoad(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
// break;
// }
// }
+6 -6
View File
@@ -8,9 +8,9 @@ char *filemgrGetDeviceName(s32 index);
char *filemgrMenuTextDeviceName(struct menuitem *item);
void filemgrGetSelectName(char *buffer, struct filelistfile *file, u32 filetype);
char *filemgrMenuTextDeleteFileName(struct menuitem *item);
void func0f108324(s32 deviceserial);
void func0f1083b0(struct filelistfile *file);
void func0f1083d0(struct filelistfile *file, s32 filetype);
void filemgrSetDevice1BySerial(s32 deviceserial);
void filemgrSetDevice1ByFile(struct filelistfile *file);
void filemgrSetFileToDelete(struct filelistfile *file, s32 filetype);
char *filemgrMenuTextFailReason(struct menuitem *item);
char *filemgrMenuTextDeviceNameForError(struct menuitem *item);
void filemgrPushErrorDialog(u16 errno);
@@ -23,15 +23,15 @@ void filemgrEraseCorruptFile(void);
char *filemgrMenuTextInsertOriginalPak(struct menuitem *item);
void filemgrRetrySave(s32 arg0);
bool filemgrAttemptOperation(s32 device, bool closeonsuccess);
bool func0f1094e4(struct fileguid *guid, s32 fileop, void *arg2);
bool filemgrSaveOrLoad(struct fileguid *guid, s32 fileop, u32 playernum);
void filemgrDeleteCurrentFile(void);
void func0f1097d0(s32 device);
void func0f109954(s32 arg0);
void filemgrSaveGameToDevice(s32 device);
void filemgrGetFileName(char *dst, struct filelistfile *file);
void filemgrGetRenameName(char *buffer);
void filemgrSetRenameName(char *name);
bool filemgrIsNameAvailable(s32 arg0);
void func0f109ec4(void);
void filemgrSaveToDevice(void);
char *filemgrMenuTextDeviceNameContainingDuplicateFile(struct menuitem *item);
char *filemgrMenuTextDuplicateFileName(struct menuitem *item);
char *filemgrMenuTextLocationName2(struct menuitem *item);
+2 -2
View File
@@ -11,8 +11,8 @@ void bossfileSave(void);
void bossfileSetDefaults(void);
void func0f110bf0(void);
void func0f110bf8(void);
void func0f110c5c(s32 listnum, u8 filetype);
s32 func0f110cf8(u8 filetype);
void filelistCreate(s32 listnum, u8 filetype);
s32 filelistFindOrCreate(u8 filetype);
void func0f110d90(s32 index);
void filelistsTick(void);
void filelistUpdate(struct filelist *list);
+35 -47
View File
@@ -3839,27 +3839,44 @@ struct menudata_mpend {
u32 unke1c;
};
// Not sure if filemgr and pak are the same struct
struct menudata_filemgr {
u32 filetypeplusone;
u32 device;
u32 unke24;
u32 isdeletingforsave;
u32 unke2c;
};
struct menudata_pak {
u32 unke1c;
u32 device;
u32 unke24;
u32 noteindex;
/*0xe1c*/ u32 filetypeplusone;
/*0xe20*/ u32 device;
/*0xe24*/ u32 unke24;
union {
u32 isdeletingforsave;
u32 noteindex;
};
/*0xe2c*/ u32 unke2c;
/*0xe30*/ u32 unke30;
/*0xe34*/ u16 errno;
/*0xe38*/ struct filelistfile *filetodelete;
/*0xe3c*/ u8 device1;
/*0xe3d*/ u8 filetypetodelete;
/*0xe3e*/ u8 unke3e;
/*0xe3f*/ u8 listnum;
/*0xe40*/ u16 unke40_00 : 1;
/*0xe40*/ u16 unke40_01 : 1;
/*0xe40*/ u16 unke40_02 : 14;
/*0xe42*/ u8 fileop;
union {
void *unke44;
s32 mpplayernum;
};
/*0xe48*/ u32 filenum;
/*0xe4c*/ u32 deviceserial;
/*0xe50*/ u16 isretryingsave;
/*0xe52*/ u8 device2;
/*0xe53*/ char filename[20];
/*0xe68*/ struct perfectheadtexturelist *headtextures;
/*0xe6c*/ s8 device3;
};
struct menudata_main4mb {
u32 slotindex;
};
struct menudata_train {
struct menudata_training {
u32 unke1c;
struct mpconfigfull *mpconfig;
u32 unke24;
@@ -4491,36 +4508,10 @@ struct menu {
struct menudata_mpsetup mpsetup;
struct menudata_mppause mppause;
struct menudata_mpend mpend;
struct menudata_filemgr filemgr;
struct menudata_pak pak;
struct menudata_filemgr fm;
struct menudata_main4mb main4mb;
struct menudata_train train;
} data;
/*0xe30*/ u32 unke30;
/*0xe34*/ u16 errno;
/*0xe38*/ struct filelistfile *unke38;
/*0xe3c*/ u8 unke3c;
/*0xe3d*/ u8 unke3d;
/*0xe3e*/ u8 unke3e;
/*0xe3f*/ u8 listnum;
/*0xe40*/ u16 unke40_00 : 1;
/*0xe40*/ u16 unke40_01 : 1;
/*0xe40*/ u16 unke40_02 : 14;
/*0xe42*/ u8 fileop;
/*0xe44*/ void *unke44;
/*0xe48*/ u32 filenum;
/*0xe4c*/ u32 deviceserial;
/*0xe50*/ u16 isretryingsave;
/*0xe52*/ u8 device;
/*0xe53*/ char unke53[1];
/*0xe54*/ u32 unke54;
/*0xe58*/ u32 unke58;
/*0xe5c*/ u32 unke5c;
/*0xe60*/ u32 unke60;
/*0xe64*/ u32 unke64;
/*0xe68*/ struct perfectheadtexturelist *headtextures;
/*0xe6c*/ s8 savedevice; // 0-3 = controller pak 1-4, 4 = game pak
struct menudata_training training;
};
};
struct gamefile {
@@ -4689,10 +4680,7 @@ struct mparena {
struct filelistfile {
s32 filenum;
u16 deviceserial;
char unk06[6]; // length unknown
u32 unk0c;
u32 unk10;
u32 unk14;
char name[16];
};
// This stores information about all files of a particular filetype across all