mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-08-18 21:18:03 -04:00
Decompile gamefileLoad
This commit is contained in:
+8
-8
@@ -76,23 +76,23 @@ u32 cheatIsUnlocked(s32 cheat_id)
|
||||
unlocked++;
|
||||
}
|
||||
} else if (cheat->flags & CHEATFLAG_COMPLETION) {
|
||||
if (g_SoloSaveFile.besttimes[cheat->stage_index][0]) {
|
||||
if (g_GameFile.besttimes[cheat->stage_index][0]) {
|
||||
unlocked++;
|
||||
}
|
||||
if (g_SoloSaveFile.besttimes[cheat->stage_index][1]) {
|
||||
if (g_GameFile.besttimes[cheat->stage_index][1]) {
|
||||
unlocked++;
|
||||
}
|
||||
if (g_SoloSaveFile.besttimes[cheat->stage_index][2]) {
|
||||
if (g_GameFile.besttimes[cheat->stage_index][2]) {
|
||||
unlocked++;
|
||||
}
|
||||
} else {
|
||||
if (g_SoloSaveFile.besttimes[cheat->stage_index][cheat->difficulty] &&
|
||||
g_SoloSaveFile.besttimes[cheat->stage_index][cheat->difficulty] <= cheat->time) {
|
||||
if (g_GameFile.besttimes[cheat->stage_index][cheat->difficulty] &&
|
||||
g_GameFile.besttimes[cheat->stage_index][cheat->difficulty] <= cheat->time) {
|
||||
unlocked++;
|
||||
}
|
||||
}
|
||||
|
||||
if ((cheat->flags & CHEATFLAG_TRANSFERPAK) && savefileHasFlag(SAVEFILEFLAG_USED_TRANSFERPAK)) {
|
||||
if ((cheat->flags & CHEATFLAG_TRANSFERPAK) && gamefileHasFlag(GAMEFILEFLAG_USED_TRANSFERPAK)) {
|
||||
unlocked++;
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ s32 cheatMenuHandleDialog(s32 operation, struct menudialog *dialog, union handle
|
||||
func0f14a52c();
|
||||
|
||||
if (func0f11e78c()) {
|
||||
savefileSetFlag(SAVEFILEFLAG_USED_TRANSFERPAK);
|
||||
gamefileSetFlag(GAMEFILEFLAG_USED_TRANSFERPAK);
|
||||
}
|
||||
|
||||
#if PIRACYCHECKS
|
||||
@@ -498,7 +498,7 @@ s32 cheatMenuHandleDialog(s32 operation, struct menudialog *dialog, union handle
|
||||
|
||||
if (operation == MENUOP_CLOSE) {
|
||||
if (func0f11e78c()) {
|
||||
savefileSetFlag(SAVEFILEFLAG_USED_TRANSFERPAK);
|
||||
gamefileSetFlag(GAMEFILEFLAG_USED_TRANSFERPAK);
|
||||
}
|
||||
|
||||
func0f14a560();
|
||||
|
||||
@@ -11315,7 +11315,7 @@ bool aiIfObjectDistanceToPadLessThan(void)
|
||||
bool aiSetSavefileFlag(void)
|
||||
{
|
||||
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
|
||||
savefileSetFlag(cmd[2]);
|
||||
gamefileSetFlag(cmd[2]);
|
||||
g_Vars.aioffset += 3;
|
||||
|
||||
return false;
|
||||
@@ -11327,7 +11327,7 @@ bool aiSetSavefileFlag(void)
|
||||
bool aiUnsetSavefileFlag(void)
|
||||
{
|
||||
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
|
||||
savefileUnsetFlag(cmd[2]);
|
||||
gamefileUnsetFlag(cmd[2]);
|
||||
g_Vars.aioffset += 3;
|
||||
|
||||
return false;
|
||||
@@ -11340,7 +11340,7 @@ bool aiIfSavefileFlagIsSet(void)
|
||||
{
|
||||
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
|
||||
|
||||
if (savefileHasFlag(cmd[2])) {
|
||||
if (gamefileHasFlag(cmd[2])) {
|
||||
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[3]);
|
||||
} else {
|
||||
g_Vars.aioffset += 4;
|
||||
@@ -11356,7 +11356,7 @@ bool aiIfSavefileFlagIsUnset(void)
|
||||
{
|
||||
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
|
||||
|
||||
if (!savefileHasFlag(cmd[2])) {
|
||||
if (!gamefileHasFlag(cmd[2])) {
|
||||
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[3]);
|
||||
} else {
|
||||
g_Vars.aioffset += 4;
|
||||
|
||||
+10
-10
@@ -698,25 +698,25 @@ glabel var7f1af4ecnb
|
||||
/* f1197bc: 24420001 */ addiu $v0,$v0,0x1
|
||||
/* f1197c0: 1444fffe */ bne $v0,$a0,.NB0f1197bc
|
||||
/* f1197c4: a04300ab */ sb $v1,0xab($v0)
|
||||
/* f1197c8: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f1197c8: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f1197cc: 24040030 */ addiu $a0,$zero,0x30
|
||||
/* f1197d0: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f1197d0: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f1197d4: 24040031 */ addiu $a0,$zero,0x31
|
||||
/* f1197d8: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f1197d8: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f1197dc: 24040032 */ addiu $a0,$zero,0x32
|
||||
/* f1197e0: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f1197e0: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f1197e4: 24040033 */ addiu $a0,$zero,0x33
|
||||
/* f1197e8: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f1197e8: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f1197ec: 24040034 */ addiu $a0,$zero,0x34
|
||||
/* f1197f0: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f1197f0: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f1197f4: 24040035 */ addiu $a0,$zero,0x35
|
||||
/* f1197f8: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f1197f8: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f1197fc: 24040036 */ addiu $a0,$zero,0x36
|
||||
/* f119800: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f119800: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f119804: 24040037 */ addiu $a0,$zero,0x37
|
||||
/* f119808: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f119808: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f11980c: 24040038 */ addiu $a0,$zero,0x38
|
||||
/* f119810: 0fc425a7 */ jal savefileSetFlag
|
||||
/* f119810: 0fc425a7 */ jal gamefileSetFlag
|
||||
/* f119814: 24040039 */ addiu $a0,$zero,0x39
|
||||
/* f119818: 1000001f */ beqz $zero,.NB0f119898
|
||||
/* f11981c: 8faf001c */ lw $t7,0x1c($sp)
|
||||
|
||||
+14
-14
@@ -1182,12 +1182,12 @@ void endscreenSetCoopCompleted(void)
|
||||
{
|
||||
if (g_CheatsActiveBank0 == 0 && g_CheatsActiveBank1 == 0) {
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
if (g_SoloSaveFile.coopcompletions[g_MissionConfig.difficulty] & (1 << g_MissionConfig.stageindex)) {
|
||||
if (g_GameFile.coopcompletions[g_MissionConfig.difficulty] & (1 << g_MissionConfig.stageindex)) {
|
||||
g_Menus[g_MpPlayerNum].data.endscreen.isfirstcompletion = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
g_SoloSaveFile.coopcompletions[g_MissionConfig.difficulty] |= (1 << g_MissionConfig.stageindex);
|
||||
g_GameFile.coopcompletions[g_MissionConfig.difficulty] |= (1 << g_MissionConfig.stageindex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1280,15 +1280,15 @@ void endscreenPrepare(void)
|
||||
secs = getMissionTime() / 60;
|
||||
|
||||
if (secs != 0) {
|
||||
if (secs >= S32_MAX || S32_MAX - secs <= g_SoloSaveFile.totaltime) {
|
||||
g_SoloSaveFile.totaltime = S32_MAX;
|
||||
if (secs >= S32_MAX || S32_MAX - secs <= g_GameFile.totaltime) {
|
||||
g_GameFile.totaltime = S32_MAX;
|
||||
} else {
|
||||
g_SoloSaveFile.totaltime += secs;
|
||||
g_GameFile.totaltime += secs;
|
||||
}
|
||||
}
|
||||
|
||||
g_SoloSaveFile.autostageindex = g_MissionConfig.stageindex;
|
||||
g_SoloSaveFile.autodifficulty = g_MissionConfig.difficulty;
|
||||
g_GameFile.autostageindex = g_MissionConfig.stageindex;
|
||||
g_GameFile.autodifficulty = g_MissionConfig.difficulty;
|
||||
|
||||
if (g_CheatsActiveBank0 == 0
|
||||
&& g_CheatsActiveBank1 == 0
|
||||
@@ -1312,28 +1312,28 @@ void endscreenPrepare(void)
|
||||
}
|
||||
|
||||
// Set best time
|
||||
prevbest = g_SoloSaveFile.besttimes[g_MissionConfig.stageindex][g_MissionConfig.difficulty];
|
||||
prevbest = g_GameFile.besttimes[g_MissionConfig.stageindex][g_MissionConfig.difficulty];
|
||||
|
||||
if (prevbest == 0) {
|
||||
g_Menus[g_MpPlayerNum].data.endscreen.isfirstcompletion = true;
|
||||
}
|
||||
|
||||
if (secs < prevbest || prevbest == 0) {
|
||||
g_SoloSaveFile.besttimes[g_MissionConfig.stageindex][g_MissionConfig.difficulty] = secs;
|
||||
g_GameFile.besttimes[g_MissionConfig.stageindex][g_MissionConfig.difficulty] = secs;
|
||||
}
|
||||
|
||||
// Recalculate thumbnail for file select screen
|
||||
if (g_MissionConfig.stageindex <= SOLOSTAGEINDEX_SKEDARRUINS) {
|
||||
g_SoloSaveFile.autostageindex = g_MissionConfig.stageindex + 1;
|
||||
g_GameFile.autostageindex = g_MissionConfig.stageindex + 1;
|
||||
|
||||
if (g_SoloSaveFile.autostageindex > SOLOSTAGEINDEX_SKEDARRUINS) {
|
||||
g_SoloSaveFile.autostageindex = SOLOSTAGEINDEX_SKEDARRUINS;
|
||||
if (g_GameFile.autostageindex > SOLOSTAGEINDEX_SKEDARRUINS) {
|
||||
g_GameFile.autostageindex = SOLOSTAGEINDEX_SKEDARRUINS;
|
||||
}
|
||||
|
||||
for (d = 0; d != 3; d++) {
|
||||
for (s = 0; s <= SOLOSTAGEINDEX_SKEDARRUINS; s++) {
|
||||
if (g_SoloSaveFile.besttimes[s][d]) {
|
||||
g_SoloSaveFile.thumbnail = s + 1;
|
||||
if (g_GameFile.besttimes[s][d]) {
|
||||
g_GameFile.thumbnail = s + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -1209,9 +1209,9 @@ glabel var7f1a863c
|
||||
/* f01cf9c: 240f0002 */ li $t7,0x2
|
||||
/* f01cfa0: 3c018006 */ lui $at,0x8006
|
||||
/* f01cfa4: a02f2610 */ sb $t7,0x2610($at)
|
||||
/* f01cfa8: 0fc4402b */ jal savefileLoadDefaults
|
||||
/* f01cfa8: 0fc4402b */ jal gamefileLoadDefaults
|
||||
/* f01cfac: 02002025 */ move $a0,$s0
|
||||
/* f01cfb0: 0fc43ee5 */ jal savefileApplyOptions
|
||||
/* f01cfb0: 0fc43ee5 */ jal gamefileApplyOptions
|
||||
/* f01cfb4: 02002025 */ move $a0,$s0
|
||||
/* f01cfb8: 3c0d8009 */ lui $t5,0x8009
|
||||
/* f01cfbc: 91ad1040 */ lbu $t5,0x1040($t5)
|
||||
@@ -2981,14 +2981,14 @@ glabel var7f1a863c
|
||||
/* f01ceb8: 00008025 */ or $s0,$zero,$zero
|
||||
/* f01cebc: 0fc06fa8 */ jal func0f01bea0
|
||||
/* f01cec0: afa40158 */ sw $a0,0x158($sp)
|
||||
/* f01cec4: 3c10800a */ lui $s0,%hi(g_SoloSaveFile)
|
||||
/* f01cec8: 26102200 */ addiu $s0,$s0,%lo(g_SoloSaveFile)
|
||||
/* f01cec4: 3c10800a */ lui $s0,%hi(g_GameFile)
|
||||
/* f01cec8: 26102200 */ addiu $s0,$s0,%lo(g_GameFile)
|
||||
/* f01cecc: 24190002 */ addiu $t9,$zero,0x2
|
||||
/* f01ced0: 3c018006 */ lui $at,%hi(g_FileState)
|
||||
/* f01ced4: a0392940 */ sb $t9,%lo(g_FileState)($at)
|
||||
/* f01ced8: 0fc43da6 */ jal savefileLoadDefaults
|
||||
/* f01ced8: 0fc43da6 */ jal gamefileLoadDefaults
|
||||
/* f01cedc: 02002025 */ or $a0,$s0,$zero
|
||||
/* f01cee0: 0fc43c81 */ jal savefileApplyOptions
|
||||
/* f01cee0: 0fc43c81 */ jal gamefileApplyOptions
|
||||
/* f01cee4: 02002025 */ or $a0,$s0,$zero
|
||||
/* f01cee8: 3c0f8009 */ lui $t7,%hi(g_Is4Mb)
|
||||
/* f01ceec: 91ef0af0 */ lbu $t7,%lo(g_Is4Mb)($t7)
|
||||
@@ -4754,9 +4754,9 @@ glabel var7f1a863c
|
||||
/* f01cbac: 24190002 */ addiu $t9,$zero,0x2
|
||||
/* f01cbb0: 3c018006 */ lui $at,0x8006
|
||||
/* f01cbb4: a0394e50 */ sb $t9,0x4e50($at)
|
||||
/* f01cbb8: 0fc426fe */ jal savefileLoadDefaults
|
||||
/* f01cbb8: 0fc426fe */ jal gamefileLoadDefaults
|
||||
/* f01cbbc: 02002025 */ or $a0,$s0,$zero
|
||||
/* f01cbc0: 0fc425d9 */ jal savefileApplyOptions
|
||||
/* f01cbc0: 0fc425d9 */ jal gamefileApplyOptions
|
||||
/* f01cbc4: 02002025 */ or $a0,$s0,$zero
|
||||
/* f01cbc8: 3c0f8009 */ lui $t7,0x8009
|
||||
/* f01cbcc: 91ef30e0 */ lbu $t7,0x30e0($t7)
|
||||
@@ -5913,8 +5913,8 @@ glabel var7f1a863c
|
||||
// } else /*ceb0*/ if (g_MenuData.unk008 == -7) {
|
||||
// func0f01bea0();
|
||||
// g_FileState = FILESTATE_CHANGINGAGENT;
|
||||
// savefileLoadDefaults(&g_SoloSaveFile);
|
||||
// savefileApplyOptions(&g_SoloSaveFile);
|
||||
// gamefileLoadDefaults(&g_GameFile);
|
||||
// gamefileApplyOptions(&g_GameFile);
|
||||
// mainSetStageNum(IS4MB() ? STAGE_4MBMENU : STAGE_CITRAINING);
|
||||
// func0f16d3d0();
|
||||
// } else {
|
||||
|
||||
+36
-36
@@ -912,9 +912,9 @@ glabel isStageDifficultyUnlocked
|
||||
/* f1038ec: 28810011 */ slti $at,$a0,0x11
|
||||
/* f1038f0: 14200024 */ bnez $at,.L0f103984
|
||||
/* f1038f4: 00a03025 */ or $a2,$a1,$zero
|
||||
/* f1038f8: 3c05800a */ lui $a1,%hi(g_SoloSaveFile)
|
||||
/* f1038f8: 3c05800a */ lui $a1,%hi(g_GameFile)
|
||||
/* f1038fc: 00001025 */ or $v0,$zero,$zero
|
||||
/* f103900: 24a52200 */ addiu $a1,$a1,%lo(g_SoloSaveFile)
|
||||
/* f103900: 24a52200 */ addiu $a1,$a1,%lo(g_GameFile)
|
||||
/* f103904: 00001825 */ or $v1,$zero,$zero
|
||||
.L0f103908:
|
||||
/* f103908: 94ae0080 */ lhu $t6,0x80($a1)
|
||||
@@ -936,8 +936,8 @@ glabel isStageDifficultyUnlocked
|
||||
/* f103940: 00001825 */ or $v1,$zero,$zero
|
||||
/* f103944: 00047880 */ sll $t7,$a0,0x2
|
||||
/* f103948: 01e47823 */ subu $t7,$t7,$a0
|
||||
/* f10394c: 3c18800a */ lui $t8,%hi(g_SoloSaveFile)
|
||||
/* f103950: 27182200 */ addiu $t8,$t8,%lo(g_SoloSaveFile)
|
||||
/* f10394c: 3c18800a */ lui $t8,%hi(g_GameFile)
|
||||
/* f103950: 27182200 */ addiu $t8,$t8,%lo(g_GameFile)
|
||||
/* f103954: 000f7840 */ sll $t7,$t7,0x1
|
||||
/* f103958: 01f81021 */ addu $v0,$t7,$t8
|
||||
.L0f10395c:
|
||||
@@ -977,13 +977,13 @@ glabel isStageDifficultyUnlocked
|
||||
/* f1039d0: 01a46823 */ subu $t5,$t5,$a0
|
||||
/* f1039d4: 000d6840 */ sll $t5,$t5,0x1
|
||||
/* f1039d8: 00037040 */ sll $t6,$v1,0x1
|
||||
/* f1039dc: 3c18800a */ lui $t8,%hi(g_SoloSaveFile)
|
||||
/* f1039e0: 27182200 */ addiu $t8,$t8,%lo(g_SoloSaveFile)
|
||||
/* f1039dc: 3c18800a */ lui $t8,%hi(g_GameFile)
|
||||
/* f1039e0: 27182200 */ addiu $t8,$t8,%lo(g_GameFile)
|
||||
/* f1039e4: 01ae7821 */ addu $t7,$t5,$t6
|
||||
/* f1039e8: 3c0a800a */ lui $t2,%hi(g_SoloSaveFile)
|
||||
/* f1039e8: 3c0a800a */ lui $t2,%hi(g_GameFile)
|
||||
/* f1039ec: 3c09800a */ lui $t1,%hi(g_MissionConfig)
|
||||
/* f1039f0: 2529dfe8 */ addiu $t1,$t1,%lo(g_MissionConfig)
|
||||
/* f1039f4: 254a2200 */ addiu $t2,$t2,%lo(g_SoloSaveFile)
|
||||
/* f1039f4: 254a2200 */ addiu $t2,$t2,%lo(g_GameFile)
|
||||
/* f1039f8: 01f81021 */ addu $v0,$t7,$t8
|
||||
/* f1039fc: 240b0003 */ addiu $t3,$zero,0x3
|
||||
.L0f103a00:
|
||||
@@ -1016,8 +1016,8 @@ glabel isStageDifficultyUnlocked
|
||||
/* f103a5c: 24420002 */ addiu $v0,$v0,0x2
|
||||
.L0f103a60:
|
||||
/* f103a60: 3c09800a */ lui $t1,%hi(g_MissionConfig)
|
||||
/* f103a64: 3c0a800a */ lui $t2,%hi(g_SoloSaveFile)
|
||||
/* f103a68: 254a2200 */ addiu $t2,$t2,%lo(g_SoloSaveFile)
|
||||
/* f103a64: 3c0a800a */ lui $t2,%hi(g_GameFile)
|
||||
/* f103a68: 254a2200 */ addiu $t2,$t2,%lo(g_GameFile)
|
||||
/* f103a6c: 2529dfe8 */ addiu $t1,$t1,%lo(g_MissionConfig)
|
||||
/* f103a70: 18800052 */ blez $a0,.L0f103bbc
|
||||
/* f103a74: 240b0003 */ addiu $t3,$zero,0x3
|
||||
@@ -1120,8 +1120,8 @@ glabel isStageDifficultyUnlocked
|
||||
/* f103bc0: 2401002a */ addiu $at,$zero,0x2a
|
||||
/* f103bc4: 10a10047 */ beq $a1,$at,.L0f103ce4
|
||||
/* f103bc8: 00003825 */ or $a3,$zero,$zero
|
||||
/* f103bcc: 3c05800a */ lui $a1,%hi(g_SoloSaveFile)
|
||||
/* f103bd0: 24a52200 */ addiu $a1,$a1,%lo(g_SoloSaveFile)
|
||||
/* f103bcc: 3c05800a */ lui $a1,%hi(g_GameFile)
|
||||
/* f103bd0: 24a52200 */ addiu $a1,$a1,%lo(g_GameFile)
|
||||
.L0f103bd4:
|
||||
/* f103bd4: 00001825 */ or $v1,$zero,$zero
|
||||
/* f103bd8: 00001025 */ or $v0,$zero,$zero
|
||||
@@ -1159,8 +1159,8 @@ glabel isStageDifficultyUnlocked
|
||||
/* f103c44: 1420ffe3 */ bnez $at,.L0f103bd4
|
||||
/* f103c48: 24a50006 */ addiu $a1,$a1,0x6
|
||||
.L0f103c4c:
|
||||
/* f103c4c: 3c18800a */ lui $t8,%hi(g_SoloSaveFile+0x66)
|
||||
/* f103c50: 27182266 */ addiu $t8,$t8,%lo(g_SoloSaveFile+0x66)
|
||||
/* f103c4c: 3c18800a */ lui $t8,%hi(g_GameFile+0x66)
|
||||
/* f103c50: 27182266 */ addiu $t8,$t8,%lo(g_GameFile+0x66)
|
||||
/* f103c54: 00b8082b */ sltu $at,$a1,$t8
|
||||
/* f103c58: 14200022 */ bnez $at,.L0f103ce4
|
||||
/* f103c5c: 24c2ffff */ addiu $v0,$a2,-1
|
||||
@@ -1497,7 +1497,7 @@ s32 menuhandlerSoloDifficulty(s32 operation, struct menuitem *item, union handle
|
||||
if (item->param3 == 0) {
|
||||
return true;
|
||||
}
|
||||
if (item->param <= (u32)g_SoloSaveFile.autodifficulty) {
|
||||
if (item->param <= (u32)g_GameFile.autodifficulty) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1505,7 +1505,7 @@ s32 menuhandlerSoloDifficulty(s32 operation, struct menuitem *item, union handle
|
||||
if (item->param3 == 0) {
|
||||
return true;
|
||||
}
|
||||
if (item->param <= (u32)g_SoloSaveFile.autodifficulty) {
|
||||
if (item->param <= (u32)g_GameFile.autodifficulty) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -1533,7 +1533,7 @@ s32 menuhandlerPdMode(s32 operation, struct menuitem *item, union handlerdata *d
|
||||
menuPushDialog(&g_PdModeSettingsMenuDialog);
|
||||
break;
|
||||
case MENUOP_CHECKHIDDEN:
|
||||
if (g_SoloSaveFile.besttimes[SOLOSTAGEINDEX_SKEDARRUINS][DIFF_PA] == 0) {
|
||||
if (g_GameFile.besttimes[SOLOSTAGEINDEX_SKEDARRUINS][DIFF_PA] == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1543,7 +1543,7 @@ s32 menuhandlerPdMode(s32 operation, struct menuitem *item, union handlerdata *d
|
||||
|
||||
char *soloMenuTextBestTime(struct menuitem *item)
|
||||
{
|
||||
u16 time = g_SoloSaveFile.besttimes[g_MissionConfig.stageindex][item->param];
|
||||
u16 time = g_GameFile.besttimes[g_MissionConfig.stageindex][item->param];
|
||||
s32 hours = time / 3600;
|
||||
|
||||
if (time == 0) {
|
||||
@@ -1611,7 +1611,7 @@ s32 getMaxAiBuddies(void)
|
||||
s32 d;
|
||||
|
||||
for (d = 0; d != 3; d++) {
|
||||
if ((g_SoloSaveFile.coopcompletions[d] | 0xfffe0000) == 0xffffffff) {
|
||||
if ((g_GameFile.coopcompletions[d] | 0xfffe0000) == 0xffffffff) {
|
||||
extra = d + 1;
|
||||
}
|
||||
}
|
||||
@@ -2126,7 +2126,7 @@ s32 getNumUnlockedSpecialStages(void)
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (g_SoloSaveFile.besttimes[SOLOSTAGEINDEX_SKEDARRUINS][i]) {
|
||||
if (g_GameFile.besttimes[SOLOSTAGEINDEX_SKEDARRUINS][i]) {
|
||||
next = i + 1;
|
||||
}
|
||||
}
|
||||
@@ -2150,7 +2150,7 @@ s32 func0f104720(s32 value)
|
||||
s32 d;
|
||||
|
||||
for (d = 0; d != 3; d++) {
|
||||
if (g_SoloSaveFile.besttimes[SOLOSTAGEINDEX_SKEDARRUINS][d]) {
|
||||
if (g_GameFile.besttimes[SOLOSTAGEINDEX_SKEDARRUINS][d]) {
|
||||
next = d + 1;
|
||||
}
|
||||
}
|
||||
@@ -2264,13 +2264,13 @@ glabel var7f1b2dfc
|
||||
/* f1047e0: 8c2f2d9c */ lw $t7,%lo(var7f1b2d9c)($at)
|
||||
/* f1047e4: 01e00008 */ jr $t7
|
||||
/* f1047e8: 00000000 */ nop
|
||||
/* f1047ec: 3c0a800a */ lui $t2,%hi(g_SoloSaveFile)
|
||||
/* f1047f0: 3c09800a */ lui $t1,%hi(g_SoloSaveFile)
|
||||
/* f1047ec: 3c0a800a */ lui $t2,%hi(g_GameFile)
|
||||
/* f1047f0: 3c09800a */ lui $t1,%hi(g_GameFile)
|
||||
/* f1047f4: 3c08800a */ lui $t0,%hi(g_MissionConfig)
|
||||
/* f1047f8: ae000000 */ sw $zero,0x0($s0)
|
||||
/* f1047fc: 2508dfe8 */ addiu $t0,$t0,%lo(g_MissionConfig)
|
||||
/* f104800: 25292200 */ addiu $t1,$t1,%lo(g_SoloSaveFile)
|
||||
/* f104804: 254a2200 */ addiu $t2,$t2,%lo(g_SoloSaveFile)
|
||||
/* f104800: 25292200 */ addiu $t1,$t1,%lo(g_GameFile)
|
||||
/* f104804: 254a2200 */ addiu $t2,$t2,%lo(g_GameFile)
|
||||
/* f104808: 00003025 */ or $a2,$zero,$zero
|
||||
/* f10480c: 240b0011 */ addiu $t3,$zero,0x11
|
||||
/* f104810: 24070003 */ addiu $a3,$zero,0x3
|
||||
@@ -2427,8 +2427,8 @@ glabel var7f1b2dfc
|
||||
/* f104a3c: 072202d2 */ bltzl $t9,.L0f105588
|
||||
/* f104a40: 00001025 */ or $v0,$zero,$zero
|
||||
/* f104a44: 8d0f0000 */ lw $t7,0x0($t0)
|
||||
/* f104a48: 3c09800a */ lui $t1,%hi(g_SoloSaveFile)
|
||||
/* f104a4c: 25292200 */ addiu $t1,$t1,%lo(g_SoloSaveFile)
|
||||
/* f104a48: 3c09800a */ lui $t1,%hi(g_GameFile)
|
||||
/* f104a4c: 25292200 */ addiu $t1,$t1,%lo(g_GameFile)
|
||||
/* f104a50: 000fc640 */ sll $t8,$t7,0x19
|
||||
/* f104a54: 070202cc */ bltzl $t8,.L0f105588
|
||||
/* f104a58: 00001025 */ or $v0,$zero,$zero
|
||||
@@ -2459,8 +2459,8 @@ glabel var7f1b2dfc
|
||||
.L0f104abc:
|
||||
/* f104abc: 0fc411c8 */ jal func0f104720
|
||||
/* f104ac0: afa40160 */ sw $a0,0x160($sp)
|
||||
/* f104ac4: 3c09800a */ lui $t1,%hi(g_SoloSaveFile)
|
||||
/* f104ac8: 25292200 */ addiu $t1,$t1,%lo(g_SoloSaveFile)
|
||||
/* f104ac4: 3c09800a */ lui $t1,%hi(g_GameFile)
|
||||
/* f104ac8: 25292200 */ addiu $t1,$t1,%lo(g_GameFile)
|
||||
/* f104acc: 9138000c */ lbu $t8,0xc($t1)
|
||||
/* f104ad0: 8fa30164 */ lw $v1,0x164($sp)
|
||||
/* f104ad4: 8fa40160 */ lw $a0,0x160($sp)
|
||||
@@ -2772,15 +2772,15 @@ glabel var7f1b2dfc
|
||||
/* f104f78: 8faf00ec */ lw $t7,0xec($sp)
|
||||
/* f104f7c: 3c098008 */ lui $t1,%hi(g_ScaleX)
|
||||
/* f104f80: 240e0001 */ addiu $t6,$zero,0x1
|
||||
/* f104f84: 3c06800a */ lui $a2,%hi(g_SoloSaveFile)
|
||||
/* f104f88: 3c10800a */ lui $s0,%hi(g_SoloSaveFile+0xc)
|
||||
/* f104f84: 3c06800a */ lui $a2,%hi(g_GameFile)
|
||||
/* f104f88: 3c10800a */ lui $s0,%hi(g_GameFile+0xc)
|
||||
/* f104f8c: 3c0b0010 */ lui $t3,0x10
|
||||
/* f104f90: 2529fac0 */ addiu $t1,$t1,%lo(g_ScaleX)
|
||||
/* f104f94: 3c0dfb00 */ lui $t5,0xfb00
|
||||
/* f104f98: 241fff00 */ addiu $ra,$zero,-256
|
||||
/* f104f9c: 356b01c0 */ ori $t3,$t3,0x1c0
|
||||
/* f104fa0: 2610220c */ addiu $s0,$s0,%lo(g_SoloSaveFile+0xc)
|
||||
/* f104fa4: 24c62200 */ addiu $a2,$a2,%lo(g_SoloSaveFile)
|
||||
/* f104fa0: 2610220c */ addiu $s0,$s0,%lo(g_GameFile+0xc)
|
||||
/* f104fa4: 24c62200 */ addiu $a2,$a2,%lo(g_GameFile)
|
||||
/* f104fa8: 2405003f */ addiu $a1,$zero,0x3f
|
||||
/* f104fac: 2408003f */ addiu $t0,$zero,0x3f
|
||||
/* f104fb0: 01ee6004 */ sllv $t4,$t6,$t7
|
||||
@@ -2962,8 +2962,8 @@ glabel var7f1b2dfc
|
||||
/* f105258: 01ffc825 */ or $t9,$t7,$ra
|
||||
/* f10525c: acf90004 */ sw $t9,0x4($a3)
|
||||
/* f105260: 8fb800ec */ lw $t8,0xec($sp)
|
||||
/* f105264: 3c0f800a */ lui $t7,%hi(g_SoloSaveFile)
|
||||
/* f105268: 25ef2200 */ addiu $t7,$t7,%lo(g_SoloSaveFile)
|
||||
/* f105264: 3c0f800a */ lui $t7,%hi(g_GameFile)
|
||||
/* f105268: 25ef2200 */ addiu $t7,$t7,%lo(g_GameFile)
|
||||
/* f10526c: 00187080 */ sll $t6,$t8,0x2
|
||||
/* f105270: 01d87023 */ subu $t6,$t6,$t8
|
||||
/* f105274: 000e7040 */ sll $t6,$t6,0x1
|
||||
@@ -5607,7 +5607,7 @@ s32 getNumCompletedMissions(void)
|
||||
bool done = false;
|
||||
|
||||
for (d = 0; d != 3; d++) {
|
||||
if (g_SoloSaveFile.besttimes[s][d] || (g_SoloSaveFile.coopcompletions[d] & (1 << s))) {
|
||||
if (g_GameFile.besttimes[s][d] || (g_GameFile.coopcompletions[d] & (1 << s))) {
|
||||
count++;
|
||||
done = true;
|
||||
break;
|
||||
|
||||
@@ -22,7 +22,7 @@ struct savelocation_2d8 g_FilemgrFileToCopy;
|
||||
struct savelocation_2d8 var800a21e8;
|
||||
struct savelocation_2d8 g_FilemgrFileToDelete;
|
||||
struct savelocation_2d8 var800a21f8;
|
||||
struct savefile_solo g_SoloSaveFile;
|
||||
struct gamefile g_GameFile;
|
||||
u32 var800a22bc;
|
||||
struct savelocation_2d8 g_FilemgrLoadedMainFile;
|
||||
|
||||
@@ -750,7 +750,7 @@ bool fileSave(s32 arg0, bool arg1)
|
||||
var80075bd0[g_Menus[g_MpPlayerNum].unke42 - 6] = 1;
|
||||
break;
|
||||
case 100:
|
||||
errno = func0f10fac8(arg0);
|
||||
errno = gamefileLoad(arg0);
|
||||
break;
|
||||
case 101:
|
||||
errno = func0f18dac0(
|
||||
@@ -941,7 +941,7 @@ glabel var7f1ad424nb
|
||||
/* f104c28: 002b0821 */ addu $at,$at,$t3
|
||||
/* f104c2c: 1000001b */ beqz $zero,.NB0f104c9c
|
||||
/* f104c30: ac2f7f58 */ sw $t7,0x7f58($at)
|
||||
/* f104c34: 0fc427fe */ jal func0f10fac8
|
||||
/* f104c34: 0fc427fe */ jal gamefileLoad
|
||||
/* f104c38: 8fa40048 */ lw $a0,0x48($sp)
|
||||
/* f104c3c: 10000017 */ beqz $zero,.NB0f104c9c
|
||||
/* f104c40: 00403025 */ or $a2,$v0,$zero
|
||||
@@ -1276,7 +1276,7 @@ void filemgrGetRenameName(char *buffer)
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
strcpy(buffer, g_SoloSaveFile.name);
|
||||
strcpy(buffer, g_GameFile.name);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -1319,7 +1319,7 @@ void filemgrSetRenameName(char *name)
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
strcpy(g_SoloSaveFile.name, name);
|
||||
strcpy(g_GameFile.name, name);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -2551,10 +2551,10 @@ s32 filemgrAgentNameKeyboardMenuHandler(s32 operation, struct menuitem *item, un
|
||||
|
||||
switch (operation) {
|
||||
case MENUOP_GETTEXT:
|
||||
strcpy(name, g_SoloSaveFile.name);
|
||||
strcpy(name, g_GameFile.name);
|
||||
break;
|
||||
case MENUOP_SETTEXT:
|
||||
strcpy(g_SoloSaveFile.name, name);
|
||||
strcpy(g_GameFile.name, name);
|
||||
break;
|
||||
case MENUOP_SET:
|
||||
filemgrPushSelectLocationDialog(0, 0);
|
||||
@@ -2646,7 +2646,7 @@ s32 filemgrChooseAgentListMenuHandler(s32 operation, struct menuitem *item, unio
|
||||
file = &g_FileLists[0]->files[data->list.unk04];
|
||||
|
||||
if (file) {
|
||||
savefileGetOverview(file->unk06, name, &stage, &difficulty, &time);
|
||||
gamefileGetOverview(file->unk06, name, &stage, &difficulty, &time);
|
||||
|
||||
seconds = time % 60;
|
||||
time = time / 60;
|
||||
@@ -2756,7 +2756,7 @@ s32 filemgrChooseAgentListMenuHandler(s32 operation, struct menuitem *item, unio
|
||||
break;
|
||||
case MENUOP_SET:
|
||||
if (data->list.value == g_FileLists[0]->numfiles) {
|
||||
savefileLoadDefaults(&g_SoloSaveFile);
|
||||
gamefileLoadDefaults(&g_GameFile);
|
||||
menuPushDialog(&g_FilemgrEnterNameMenuDialog);
|
||||
} else {
|
||||
struct filelistfile *file = &g_FileLists[0]->files[data->list.value];
|
||||
|
||||
+228
-644
File diff suppressed because it is too large
Load Diff
@@ -7313,7 +7313,7 @@ bool mpIsTrackUnlocked(s32 tracknum)
|
||||
unlocked = true;
|
||||
} else {
|
||||
for (i = 0; i != 3; i++) {
|
||||
if (g_SoloSaveFile.besttimes[stageindex][i]) {
|
||||
if (g_GameFile.besttimes[stageindex][i]) {
|
||||
unlocked = true;
|
||||
break;
|
||||
}
|
||||
|
||||
+5
-5
@@ -3011,8 +3011,8 @@ void func0f1189d8(void)
|
||||
func0f1169c8(SAVEDEVICE_GAMEPAK, 1);
|
||||
func0f1106c8();
|
||||
|
||||
savefileLoadDefaults(&g_SoloSaveFile);
|
||||
savefileApplyOptions(&g_SoloSaveFile);
|
||||
gamefileLoadDefaults(&g_GameFile);
|
||||
gamefileApplyOptions(&g_GameFile);
|
||||
|
||||
g_FilemgrLoadedMainFile.unk04 = 0;
|
||||
g_Vars.unk0004e4 = 0xf5;
|
||||
@@ -3087,9 +3087,9 @@ glabel func0f1189d8
|
||||
/* f112e20: 00000000 */ sll $zero,$zero,0x0
|
||||
/* f112e24: 3c10800a */ lui $s0,0x800a
|
||||
/* f112e28: 261066f0 */ addiu $s0,$s0,0x66f0
|
||||
/* f112e2c: 0fc426fe */ jal savefileLoadDefaults
|
||||
/* f112e2c: 0fc426fe */ jal gamefileLoadDefaults
|
||||
/* f112e30: 02002025 */ or $a0,$s0,$zero
|
||||
/* f112e34: 0fc425d9 */ jal savefileApplyOptions
|
||||
/* f112e34: 0fc425d9 */ jal gamefileApplyOptions
|
||||
/* f112e38: 02002025 */ or $a0,$s0,$zero
|
||||
/* f112e3c: 8fbf002c */ lw $ra,0x2c($sp)
|
||||
/* f112e40: 3c01800a */ lui $at,0x800a
|
||||
@@ -16862,7 +16862,7 @@ void pakClearAllBitflags(u8 *flags)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i <= SAVEFILEFLAG_4E; i++) {
|
||||
for (i = 0; i <= GAMEFILEFLAG_4E; i++) {
|
||||
pakSetBitflag(i, flags, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,13 +62,13 @@ u16 g_FrPads[] = {
|
||||
|
||||
bool ciIsTourDone(void)
|
||||
{
|
||||
return savefileHasFlag(SAVEFILEFLAG_CI_TOUR_DONE);
|
||||
return gamefileHasFlag(GAMEFILEFLAG_CI_TOUR_DONE);
|
||||
}
|
||||
|
||||
u8 ciGetFiringRangeScore(s32 weaponindex)
|
||||
{
|
||||
// Data at firingrangescores is a u8 array where each score uses 2 bits
|
||||
return (g_SoloSaveFile.firingrangescores[weaponindex >> 2] >> (weaponindex % 4) * 2) & 3;
|
||||
return (g_GameFile.firingrangescores[weaponindex >> 2] >> (weaponindex % 4) * 2) & 3;
|
||||
}
|
||||
|
||||
void frSaveScoreIfBest(s32 weaponindex, s32 difficulty)
|
||||
@@ -76,13 +76,13 @@ void frSaveScoreIfBest(s32 weaponindex, s32 difficulty)
|
||||
if (ciGetFiringRangeScore(weaponindex) < difficulty) {
|
||||
u32 byteindex = weaponindex >> 2;
|
||||
u32 shiftamount = (weaponindex % 4) * 2;
|
||||
u32 value = g_SoloSaveFile.firingrangescores[byteindex];
|
||||
u32 value = g_GameFile.firingrangescores[byteindex];
|
||||
u32 mask = (1 << shiftamount) + (1 << (shiftamount + 1));
|
||||
|
||||
value &= 255 - mask;
|
||||
value += (difficulty << shiftamount) & mask;
|
||||
|
||||
g_SoloSaveFile.firingrangescores[byteindex] = value;
|
||||
g_GameFile.firingrangescores[byteindex] = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,35 +145,35 @@ u8 frIsWeaponFound(s32 weaponnum)
|
||||
}
|
||||
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
if (weaponnum < (s32)sizeof(g_SoloSaveFile.weaponsfound) * 8) {
|
||||
if (weaponnum < (s32)sizeof(g_GameFile.weaponsfound) * 8) {
|
||||
byteindex = weaponnum >> 3;
|
||||
return g_SoloSaveFile.weaponsfound[byteindex] & (1 << (weaponnum % 8));
|
||||
return g_GameFile.weaponsfound[byteindex] & (1 << (weaponnum % 8));
|
||||
}
|
||||
|
||||
return false;
|
||||
#else
|
||||
byteindex = weaponnum >> 3;
|
||||
return g_SoloSaveFile.weaponsfound[byteindex] & (1 << (weaponnum % 8));
|
||||
return g_GameFile.weaponsfound[byteindex] & (1 << (weaponnum % 8));
|
||||
#endif
|
||||
}
|
||||
|
||||
void frSetWeaponFound(s32 weaponnum)
|
||||
{
|
||||
if (weaponnum < (s32)sizeof(g_SoloSaveFile.weaponsfound) * 8) {
|
||||
if (weaponnum < (s32)sizeof(g_GameFile.weaponsfound) * 8) {
|
||||
u32 byteindex = weaponnum >> 3;
|
||||
u32 value = g_SoloSaveFile.weaponsfound[byteindex];
|
||||
u32 value = g_GameFile.weaponsfound[byteindex];
|
||||
|
||||
value |= (1 << (weaponnum % 8));
|
||||
|
||||
g_SoloSaveFile.weaponsfound[byteindex] = value;
|
||||
g_GameFile.weaponsfound[byteindex] = value;
|
||||
}
|
||||
}
|
||||
|
||||
s32 ciIsStageComplete(s32 stageindex)
|
||||
{
|
||||
return g_SoloSaveFile.besttimes[stageindex][0]
|
||||
|| g_SoloSaveFile.besttimes[stageindex][1]
|
||||
|| g_SoloSaveFile.besttimes[stageindex][2];
|
||||
return g_GameFile.besttimes[stageindex][0]
|
||||
|| g_GameFile.besttimes[stageindex][1]
|
||||
|| g_GameFile.besttimes[stageindex][2];
|
||||
}
|
||||
|
||||
bool func0f19cbcc(s32 weapon)
|
||||
@@ -7568,16 +7568,16 @@ void dtEnd(void)
|
||||
bool dtIsAvailable(s32 deviceindex)
|
||||
{
|
||||
u8 flags[] = {
|
||||
SAVEFILEFLAG_CI_UPLINK_DONE,
|
||||
SAVEFILEFLAG_CI_ECMMINE_DONE,
|
||||
SAVEFILEFLAG_CI_CAMSPY_DONE,
|
||||
SAVEFILEFLAG_CI_NIGHTVISION_DONE,
|
||||
SAVEFILEFLAG_CI_DOORDECODER_DONE,
|
||||
SAVEFILEFLAG_CI_RTRACKER_DONE,
|
||||
SAVEFILEFLAG_CI_IR_DONE,
|
||||
SAVEFILEFLAG_CI_XRAY_DONE,
|
||||
SAVEFILEFLAG_CI_DISGUISE_DONE,
|
||||
SAVEFILEFLAG_CI_CLOAK_DONE,
|
||||
GAMEFILEFLAG_CI_UPLINK_DONE,
|
||||
GAMEFILEFLAG_CI_ECMMINE_DONE,
|
||||
GAMEFILEFLAG_CI_CAMSPY_DONE,
|
||||
GAMEFILEFLAG_CI_NIGHTVISION_DONE,
|
||||
GAMEFILEFLAG_CI_DOORDECODER_DONE,
|
||||
GAMEFILEFLAG_CI_RTRACKER_DONE,
|
||||
GAMEFILEFLAG_CI_IR_DONE,
|
||||
GAMEFILEFLAG_CI_XRAY_DONE,
|
||||
GAMEFILEFLAG_CI_DISGUISE_DONE,
|
||||
GAMEFILEFLAG_CI_CLOAK_DONE,
|
||||
};
|
||||
|
||||
deviceindex--;
|
||||
@@ -7586,7 +7586,7 @@ bool dtIsAvailable(s32 deviceindex)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (deviceindex < 0 || savefileHasFlag(flags[deviceindex])) {
|
||||
if (deviceindex < 0 || gamefileHasFlag(flags[deviceindex])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user