Decompile mpsetupfileLoad

This commit is contained in:
Ryan Dwyer
2021-09-13 23:58:01 +10:00
parent fcecbb557b
commit b2278c2850
16 changed files with 142 additions and 208 deletions
+7 -7
View File
@@ -2431,7 +2431,7 @@ glabel var7f1a863c
/* f01c70c: 2401000b */ addiu $at,$zero,0xb
/* f01c710: 3050ffff */ andi $s0,$v0,0xffff
/* f01c714: 17010014 */ bne $t8,$at,.L0f01c768
/* f01c718: 3c0e800b */ lui $t6,%hi(g_MpSetupSaveFile+0x60)
/* f01c718: 3c0e800b */ lui $t6,%hi(g_MpSetupFile+0x60)
/* f01c71c: 8e790490 */ lw $t9,0x490($s3)
/* f01c720: 24010002 */ addiu $at,$zero,0x2
/* f01c724: 02c02025 */ or $a0,$s6,$zero
@@ -2457,7 +2457,7 @@ glabel var7f1a863c
.L0f01c768:
/* f01c768: 02c02025 */ or $a0,$s6,$zero
.L0f01c76c:
/* f01c76c: 91cecc10 */ lbu $t6,%lo(g_MpSetupSaveFile+0x60)($t6)
/* f01c76c: 91cecc10 */ lbu $t6,%lo(g_MpSetupFile+0x60)($t6)
/* f01c770: 24010005 */ addiu $at,$zero,0x5
/* f01c774: 0011c080 */ sll $t8,$s1,0x2
/* f01c778: 15c10005 */ bne $t6,$at,.L0f01c790
@@ -3264,8 +3264,8 @@ glabel var7f1a863c
.L0f01d2b8:
/* f01d2b8: 0fc625cb */ jal mpSetPaused
/* f01d2bc: 00002025 */ or $a0,$zero,$zero
/* f01d2c0: 3c02800b */ lui $v0,%hi(g_MpSetupSaveFile)
/* f01d2c4: 2442cbb0 */ addiu $v0,$v0,%lo(g_MpSetupSaveFile)
/* f01d2c0: 3c02800b */ lui $v0,%hi(g_MpSetupFile)
/* f01d2c4: 2442cbb0 */ addiu $v0,$v0,%lo(g_MpSetupFile)
/* f01d2c8: 904e0060 */ lbu $t6,0x60($v0)
/* f01d2cc: 24010005 */ addiu $at,$zero,0x5
/* f01d2d0: ae600314 */ sw $zero,0x314($s3)
@@ -5699,7 +5699,7 @@ glabel var7f1a863c
// }
//
// // c76c
// if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
// if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
// g_MpPlayers[i].base.team = 0;
// }
//
@@ -5994,8 +5994,8 @@ glabel var7f1a863c
// g_Vars.normmplayerisrunning = false;
// g_Vars.lvmpbotlevel = 0;
//
// if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
// g_MpSetupSaveFile.locktype = MPLOCKTYPE_NONE;
// if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
// g_MpSetupFile.locktype = MPLOCKTYPE_NONE;
// }
//
// // d2ec
+1 -1
View File
@@ -14284,7 +14284,7 @@ Gfx *currentPlayerRenderHud(Gfx *gdl)
numdeaths += g_Vars.playerstats[i].kills[playernum];
}
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_Vars.currentplayer->deadtimer < 0) {
g_Vars.currentplayer->deadtimer = PALDOWN(600);
}
+3 -3
View File
@@ -923,10 +923,10 @@ void func0f0d575c(struct savebuffer *buffer, u32 *arg1)
savebufferOr(buffer, *(u16 *) (arg1 + 1), 13);
}
void func0f0d579c(struct savebuffer *buffer, u32 *arg1)
void func0f0d579c(struct savebuffer *buffer, struct maybesavelocation_2d8 *arg1)
{
*(s32 *) arg1 = savebufferReadBits(buffer, 7);
*(u16 *) (arg1 + 1) = savebufferReadBits(buffer, 13);
arg1->unk00 = savebufferReadBits(buffer, 7);
arg1->unk04 = savebufferReadBits(buffer, 13);
}
GLOBAL_ASM(
+1
View File
@@ -4,6 +4,7 @@
#include "game/game_0d4690.h"
#include "game/game_0f09f0.h"
#include "game/game_107fb0.h"
#include "game/game_110680.h"
#include "game/game_1531a0.h"
#include "game/gamefile.h"
#include "game/lang.h"
+79 -138
View File
@@ -5,6 +5,7 @@
#include "game/cheats.h"
#include "game/game_0b69d0.h"
#include "game/game_0d4690.h"
#include "game/game_110680.h"
#include "game/bg.h"
#include "game/game_19aa80.h"
#include "game/training/training.h"
@@ -85,7 +86,7 @@ GLOBAL_ASM(
glabel func0f1106c8
/* f111198: 27bdffe8 */ addiu $sp,$sp,-24
/* f11119c: afbf0014 */ sw $ra,0x14($sp)
/* f1111a0: 0fc444ba */ jal func0f11080c
/* f1111a0: 0fc444ba */ jal mpsetupfileLoad
/* f1111a4: 00000000 */ nop
/* f1111a8: 3c04800a */ lui $a0,0x800a
/* f1111ac: 0fc5bdd7 */ jal func0f16f75c
@@ -99,7 +100,7 @@ glabel func0f1106c8
#else
bool func0f1106c8(void)
{
func0f11080c();
mpsetupfileLoad();
return true;
}
#endif
@@ -194,126 +195,66 @@ glabel func0f110720
/* f110808: 27bd0850 */ addiu $sp,$sp,0x850
);
GLOBAL_ASM(
glabel func0f11080c
/* f11080c: 27bdfed8 */ addiu $sp,$sp,-296
/* f110810: afbf0024 */ sw $ra,0x24($sp)
/* f110814: afb20020 */ sw $s2,0x20($sp)
/* f110818: afb1001c */ sw $s1,0x1c($sp)
/* f11081c: afb00018 */ sw $s0,0x18($sp)
/* f110820: 0fc441c8 */ jal func0f110720
/* f110824: afa00124 */ sw $zero,0x124($sp)
/* f110828: 14400005 */ bnez $v0,.L0f110840
/* f11082c: 00408025 */ or $s0,$v0,$zero
/* f110830: 240e0001 */ addiu $t6,$zero,0x1
/* f110834: afae0124 */ sw $t6,0x124($sp)
/* f110838: 1000000c */ b .L0f11086c
/* f11083c: 27b20044 */ addiu $s2,$sp,0x44
.L0f110840:
/* f110840: 27b20044 */ addiu $s2,$sp,0x44
/* f110844: 0fc35517 */ jal savebufferClear
/* f110848: 02402025 */ or $a0,$s2,$zero
/* f11084c: 24040004 */ addiu $a0,$zero,0x4
/* f110850: 02002825 */ or $a1,$s0,$zero
/* f110854: 27a60048 */ addiu $a2,$sp,0x48
/* f110858: 0fc45a00 */ jal func0f116800
/* f11085c: 00003825 */ or $a3,$zero,$zero
/* f110860: 10400002 */ beqz $v0,.L0f11086c
/* f110864: 240f0001 */ addiu $t7,$zero,0x1
/* f110868: afaf0124 */ sw $t7,0x124($sp)
.L0f11086c:
/* f11086c: 8fb80124 */ lw $t8,0x124($sp)
/* f110870: 02402025 */ or $a0,$s2,$zero
/* f110874: 57000046 */ bnezl $t8,.L0f110990
/* f110878: 8faa0124 */ lw $t2,0x124($sp)
/* f11087c: 0fc355e7 */ jal func0f0d579c
/* f110880: 27a50034 */ addiu $a1,$sp,0x34
/* f110884: 8fb90034 */ lw $t9,0x34($sp)
/* f110888: 97a80038 */ lhu $t0,0x38($sp)
/* f11088c: 3c11800a */ lui $s1,%hi(g_Vars)
/* f110890: 26319fc0 */ addiu $s1,$s1,%lo(g_Vars)
/* f110894: 02402025 */ or $a0,$s2,$zero
/* f110898: 24050001 */ addiu $a1,$zero,0x1
/* f11089c: ae39047c */ sw $t9,0x47c($s1)
/* f1108a0: 0fc354fe */ jal savebufferReadBits
/* f1108a4: a6280480 */ sh $t0,0x480($s1)
/* f1108a8: 3c01800b */ lui $at,%hi(g_MpSetup+0x89)
/* f1108ac: a022cc11 */ sb $v0,%lo(g_MpSetup+0x89)($at)
/* f1108b0: 02402025 */ or $a0,$s2,$zero
/* f1108b4: 0fc354fe */ jal savebufferReadBits
/* f1108b8: 24050004 */ addiu $a1,$zero,0x4
/* f1108bc: a6220482 */ sh $v0,0x482($s1)
/* f1108c0: 3c11800b */ lui $s1,%hi(g_MpSetup+0x88)
/* f1108c4: 3c10800b */ lui $s0,%hi(g_MpSetup+0x28)
/* f1108c8: 2610cbb0 */ addiu $s0,$s0,%lo(g_MpSetup+0x28)
/* f1108cc: 2631cc10 */ addiu $s1,$s1,%lo(g_MpSetup+0x88)
/* f1108d0: 02402025 */ or $a0,$s2,$zero
.L0f1108d4:
/* f1108d4: 02002825 */ or $a1,$s0,$zero
/* f1108d8: 0fc35539 */ jal savebufferReadString
/* f1108dc: 24060001 */ addiu $a2,$zero,0x1
/* f1108e0: 2610000c */ addiu $s0,$s0,0xc
/* f1108e4: 0211082b */ sltu $at,$s0,$s1
/* f1108e8: 5420fffa */ bnezl $at,.L0f1108d4
/* f1108ec: 02402025 */ or $a0,$s2,$zero
/* f1108f0: 02402025 */ or $a0,$s2,$zero
/* f1108f4: 0fc354fe */ jal savebufferReadBits
/* f1108f8: 24050008 */ addiu $a1,$zero,0x8
/* f1108fc: 304300ff */ andi $v1,$v0,0xff
/* f110900: 240100ff */ addiu $at,$zero,0xff
/* f110904: 14610005 */ bne $v1,$at,.L0f11091c
/* f110908: 3c10800b */ lui $s0,%hi(g_MpSetup+0x28)
/* f11090c: 2409ffff */ addiu $t1,$zero,-1
/* f110910: 3c01800b */ lui $at,%hi(g_MpSetupSaveFile+0x64)
/* f110914: 10000003 */ b .L0f110924
/* f110918: a029cc14 */ sb $t1,%lo(g_MpSetupSaveFile+0x64)($at)
.L0f11091c:
/* f11091c: 3c01800b */ lui $at,%hi(g_MpSetupSaveFile+0x64)
/* f110920: a023cc14 */ sb $v1,%lo(g_MpSetupSaveFile+0x64)($at)
.L0f110924:
/* f110924: 3c11800b */ lui $s1,%hi(g_MpSetup+0x2e)
/* f110928: 2631cbb6 */ addiu $s1,$s1,%lo(g_MpSetup+0x2e)
/* f11092c: 2610cbb0 */ addiu $s0,$s0,%lo(g_MpSetup+0x28)
.L0f110930:
/* f110930: 02402025 */ or $a0,$s2,$zero
/* f110934: 0fc354fe */ jal savebufferReadBits
/* f110938: 24050008 */ addiu $a1,$zero,0x8
/* f11093c: 26100001 */ addiu $s0,$s0,0x1
/* f110940: 1611fffb */ bne $s0,$s1,.L0f110930
/* f110944: a2020064 */ sb $v0,0x64($s0)
/* f110948: 02402025 */ or $a0,$s2,$zero
/* f11094c: 0fc354fe */ jal savebufferReadBits
/* f110950: 24050001 */ addiu $a1,$zero,0x1
/* f110954: 3c01800b */ lui $at,%hi(g_MpSetup+0x8a)
/* f110958: a022cc12 */ sb $v0,%lo(g_MpSetup+0x8a)($at)
/* f11095c: 02402025 */ or $a0,$s2,$zero
/* f110960: 0fc354fe */ jal savebufferReadBits
/* f110964: 24050001 */ addiu $a1,$zero,0x1
/* f110968: 3c01800a */ lui $at,%hi(var800a2328+0x3)
/* f11096c: a022232b */ sb $v0,%lo(var800a2328+0x3)($at)
/* f110970: 02402025 */ or $a0,$s2,$zero
/* f110974: 0fc354fe */ jal savebufferReadBits
/* f110978: 24050001 */ addiu $a1,$zero,0x1
/* f11097c: 3c01800a */ lui $at,%hi(g_AltTitle)
/* f110980: a022232c */ sb $v0,%lo(g_AltTitle)($at)
/* f110984: 0fc35531 */ jal func0f0d54c4
/* f110988: 02402025 */ or $a0,$s2,$zero
/* f11098c: 8faa0124 */ lw $t2,0x124($sp)
.L0f110990:
/* f110990: 51400006 */ beqzl $t2,.L0f1109ac
/* f110994: 8fbf0024 */ lw $ra,0x24($sp)
/* f110998: 0fc442da */ jal func0f110b68
/* f11099c: 00000000 */ nop
/* f1109a0: 0fc44270 */ jal func0f1109c0
/* f1109a4: 00000000 */ nop
/* f1109a8: 8fbf0024 */ lw $ra,0x24($sp)
.L0f1109ac:
/* f1109ac: 8fb00018 */ lw $s0,0x18($sp)
/* f1109b0: 8fb1001c */ lw $s1,0x1c($sp)
/* f1109b4: 8fb20020 */ lw $s2,0x20($sp)
/* f1109b8: 03e00008 */ jr $ra
/* f1109bc: 27bd0128 */ addiu $sp,$sp,0x128
);
void mpsetupfileLoad(void)
{
bool sp124 = false;
struct savebuffer buffer;
s32 i;
s32 tmp;
struct maybesavelocation_2d8 thing;
tmp = func0f110720();
if (tmp == 0) {
sp124 = true;
} else {
savebufferClear(&buffer);
if (func0f116800(4, tmp, buffer.bytes, 0)) {
sp124 = true;
}
}
if (!sp124) {
u8 tracknum;
func0f0d579c(&buffer, &thing);
g_Vars.unk00047c = thing.unk00;
g_Vars.unk000480 = thing.unk04;
g_MpSetupFile.unk89 = savebufferReadBits(&buffer, 1);
g_Vars.unk000482 = savebufferReadBits(&buffer, 4);
for (i = 0; i < 8; i++) {
savebufferReadString(&buffer, g_MpSetupFile.teamnames[i], 1);
}
tracknum = savebufferReadBits(&buffer, 8);
if (tracknum == 0xff) {
g_MpSetupFile.tracknum = -1;
} else {
g_MpSetupFile.tracknum = tracknum;
}
for (i = 0; i < 6; i++) {
g_MpSetupFile.multipletracknums[i] = savebufferReadBits(&buffer, 8);
}
g_MpSetupFile.usingmultipletunes = savebufferReadBits(&buffer, 1);
g_SoloCompleted = savebufferReadBits(&buffer, 1);
g_AltTitle = savebufferReadBits(&buffer, 1);
func0f0d54c4(&buffer);
}
if (sp124) {
func0f110b68();
func0f1109c0();
}
}
#if VERSION >= VERSION_PAL_FINAL
GLOBAL_ASM(
@@ -357,8 +298,8 @@ glabel func0f1109c0
/* f110a4c: 0211082b */ sltu $at,$s0,$s1
/* f110a50: 5420fffb */ bnezl $at,.L0f110a40
/* f110a54: 02402025 */ or $a0,$s2,$zero
/* f110a58: 3c02800b */ lui $v0,%hi(g_MpSetupSaveFile+0x64)
/* f110a5c: 8042cc14 */ lb $v0,%lo(g_MpSetupSaveFile+0x64)($v0)
/* f110a58: 3c02800b */ lui $v0,%hi(g_MpSetupFile+0x64)
/* f110a5c: 8042cc14 */ lb $v0,%lo(g_MpSetupFile+0x64)($v0)
/* f110a60: 2401ffff */ addiu $at,$zero,-1
/* f110a64: 02402025 */ or $a0,$s2,$zero
/* f110a68: 14410007 */ bne $v0,$at,.L0f110a88
@@ -473,8 +414,8 @@ glabel func0f1109c0
/* f110a4c: 0211082b */ sltu $at,$s0,$s1
/* f110a50: 5420fffb */ bnezl $at,.L0f110a40
/* f110a54: 02402025 */ or $a0,$s2,$zero
/* f110a58: 3c02800b */ lui $v0,%hi(g_MpSetupSaveFile+0x64)
/* f110a5c: 8042cc14 */ lb $v0,%lo(g_MpSetupSaveFile+0x64)($v0)
/* f110a58: 3c02800b */ lui $v0,%hi(g_MpSetupFile+0x64)
/* f110a5c: 8042cc14 */ lb $v0,%lo(g_MpSetupFile+0x64)($v0)
/* f110a60: 2401ffff */ addiu $at,$zero,-1
/* f110a64: 02402025 */ or $a0,$s2,$zero
/* f110a68: 14410007 */ bne $v0,$at,.L0f110a88
@@ -551,20 +492,20 @@ glabel func0f1109c0
void func0f110b68(void)
{
g_MpSetupSaveFile.teamnames[0][0] = '\0';
g_MpSetupSaveFile.teamnames[1][0] = '\0';
g_MpSetupSaveFile.teamnames[2][0] = '\0';
g_MpSetupSaveFile.teamnames[3][0] = '\0';
g_MpSetupSaveFile.teamnames[4][0] = '\0';
g_MpSetupSaveFile.teamnames[5][0] = '\0';
g_MpSetupSaveFile.teamnames[6][0] = '\0';
g_MpSetupSaveFile.teamnames[7][0] = '\0';
g_MpSetupFile.teamnames[0][0] = '\0';
g_MpSetupFile.teamnames[1][0] = '\0';
g_MpSetupFile.teamnames[2][0] = '\0';
g_MpSetupFile.teamnames[3][0] = '\0';
g_MpSetupFile.teamnames[4][0] = '\0';
g_MpSetupFile.teamnames[5][0] = '\0';
g_MpSetupFile.teamnames[6][0] = '\0';
g_MpSetupFile.teamnames[7][0] = '\0';
g_MpSetupSaveFile.tracknum = -1;
g_MpSetupFile.tracknum = -1;
mpEnableAllMultiTracks();
g_MpSetupSaveFile.usingmultipletunes = false;
g_MpSetupSaveFile.unk89 = 0;
g_MpSetupSaveFile.locktype = MPLOCKTYPE_NONE;
g_MpSetupFile.usingmultipletunes = false;
g_MpSetupFile.unk89 = 0;
g_MpSetupFile.locktype = MPLOCKTYPE_NONE;
g_Vars.unk00047c = 0;
g_Vars.unk000480 = 0;
g_Vars.unk000482 = (PAL ? 7 : 0);
+1 -1
View File
@@ -999,7 +999,7 @@ glabel mpDetermineUnlockedFeatures
void mpPerformSanityChecks(void)
{
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
s32 numplayers = 0;
s32 i;
+1 -1
View File
@@ -9531,7 +9531,7 @@ Gfx *menuRenderItemRanking(Gfx *gdl, struct menurendercontext *context)
y = context->y + i * 10 - data->scrolloffset + 14;
if (team) {
gdl = textRenderProjected(gdl, &x, &y, g_MpSetupSaveFile.teamnames[thisinfo->teamnum],
gdl = textRenderProjected(gdl, &x, &y, g_MpSetupFile.teamnames[thisinfo->teamnum],
g_CharsHandelGothicSm, g_FontHandelGothicSm, textcolour, context->width, context->height, 0, 0);
} else {
gdl = textRenderProjected(gdl, &x, &y, thisinfo->mpchr->name,
+2 -2
View File
@@ -115,7 +115,7 @@ s32 menuhandlerMpEndGame(s32 operation, struct menuitem *item, union handlerdata
s32 menuhandler00178018(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_CHECKHIDDEN) {
if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype != MPLOCKTYPE_CHALLENGE) {
return true;
}
}
@@ -584,7 +584,7 @@ void mpPushEndscreenDialog(u32 arg0, u32 playernum)
g_Menus[g_MpPlayerNum].playernum = arg0;
if (g_MpSetup.options & MPOPTION_TEAMSENABLED) {
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_CheatsActiveBank0 || g_CheatsActiveBank1) {
menuPushRootDialog(&g_MpEndscreenChallengeCheatedMenuDialog, MENUROOT_MPENDSCREEN);
} else if (mpIsChallengeCompleteForEndscreen()) {
+25 -25
View File
@@ -38,7 +38,7 @@ u8 g_MpSimulantDifficultiesPerNumPlayers[32];
struct mpplayer g_MpPlayers[6];
u8 g_AmBotCommands[16];
struct mpsetup g_MpSetup;
struct savefile_setup g_MpSetupSaveFile;
struct mpsetupfile g_MpSetupFile;
u32 var800acc1c;
struct mplockinfo g_MpLockInfo;
struct modelfiledata *var800acc28[18];
@@ -621,8 +621,8 @@ void mpSetDefaultNamesIfEmpty(void)
// Team names
for (i = 0; i < 8; i++) {
if (g_MpSetupSaveFile.teamnames[i][0] == '\0') {
strcpy(g_MpSetupSaveFile.teamnames[i], langGet(L_OPTIONS_008 + i)); // "Red", "Yellow" etc
if (g_MpSetupFile.teamnames[i][0] == '\0') {
strcpy(g_MpSetupFile.teamnames[i], langGet(L_OPTIONS_008 + i)); // "Red", "Yellow" etc
}
}
@@ -639,7 +639,7 @@ s32 mpCalculateTeamScoreLimit(void)
s32 limit = g_MpSetup.teamscorelimit;
s32 i;
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE
&& g_MpSetup.teamscorelimit != 400
&& (g_MpSetup.scenario == MPSCENARIO_COMBAT || g_MpSetup.scenario == MPSCENARIO_KINGOFTHEHILL)) {
s32 numchrs = 0;
@@ -6941,7 +6941,7 @@ void mpEndMatch(void)
setCurrentPlayerNum(prevplayernum);
func0f18a56c();
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
mpConsiderMarkingCurrentChallengeComplete();
}
@@ -7205,9 +7205,9 @@ glabel mpChooseRandomLockPlayer
bool mpSetLock(s32 locktype, s32 playernum)
{
g_MpSetupSaveFile.locktype = locktype;
g_MpSetupFile.locktype = locktype;
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_RANDOM) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_RANDOM) {
g_MpLockInfo.lockedplayernum = mpChooseRandomLockPlayer();
} else {
g_MpLockInfo.lockedplayernum = playernum;
@@ -7218,7 +7218,7 @@ bool mpSetLock(s32 locktype, s32 playernum)
s32 mpGetLockType(void)
{
return g_MpSetupSaveFile.locktype;
return g_MpSetupFile.locktype;
}
u32 mpGetLockPlayerNum(void)
@@ -7228,7 +7228,7 @@ u32 mpGetLockPlayerNum(void)
bool mpIsPlayerLockedOut(u32 playernum)
{
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_NONE) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_NONE) {
return false;
}
@@ -7241,16 +7241,16 @@ bool mpIsPlayerLockedOut(u32 playernum)
void mpCalculateLockIfLastWinnerOrLoser(void)
{
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_LASTWINNER && g_MpLockInfo.lastwinner >= 0) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_LASTWINNER && g_MpLockInfo.lastwinner >= 0) {
g_MpLockInfo.lockedplayernum = g_MpLockInfo.lastwinner;
}
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_LASTLOSER && g_MpLockInfo.lastloser >= 0) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_LASTLOSER && g_MpLockInfo.lastloser >= 0) {
g_MpLockInfo.lockedplayernum = g_MpLockInfo.lastloser;
}
if (g_MpLockInfo.lockedplayernum >= 0
&& g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE
&& g_MpSetupFile.locktype != MPLOCKTYPE_CHALLENGE
&& (g_MpSetup.chrslots & (1 << g_MpLockInfo.lockedplayernum)) == 0) {
g_MpLockInfo.lastwinner = g_MpLockInfo.lastloser = -1;
g_MpLockInfo.lockedplayernum = mpChooseRandomLockPlayer();
@@ -7376,12 +7376,12 @@ char *mpGetTrackName(s32 slotindex)
void mpSetUsingMultipleTunes(bool enable)
{
g_MpSetupSaveFile.usingmultipletunes = enable;
g_MpSetupFile.usingmultipletunes = enable;
}
bool mpGetUsingMultipleTunes(void)
{
return g_MpSetupSaveFile.usingmultipletunes;
return g_MpSetupFile.usingmultipletunes;
}
bool mpIsMultiTrackSlotEnabled(s32 slot)
@@ -7390,7 +7390,7 @@ bool mpIsMultiTrackSlotEnabled(s32 slot)
u8 index = tracknum >> 3;
u8 value = 1 << (tracknum & 7);
if ((g_MpSetupSaveFile.multipletracknums[index] & value) == 0) {
if ((g_MpSetupFile.multipletracknums[index] & value) == 0) {
return false;
}
@@ -7404,9 +7404,9 @@ void mpSetMultiTrackSlotEnabled(s32 slot, bool enable)
u8 index = tracknum >> 3;
if (enable) {
g_MpSetupSaveFile.multipletracknums[index] |= value;
g_MpSetupFile.multipletracknums[index] |= value;
} else {
g_MpSetupSaveFile.multipletracknums[index] &= ~value;
g_MpSetupFile.multipletracknums[index] &= ~value;
}
}
@@ -7415,7 +7415,7 @@ void mpSetTrackSlotEnabled(s32 slot)
if (mpGetUsingMultipleTunes()) {
mpSetMultiTrackSlotEnabled(slot, 1 - mpIsMultiTrackSlotEnabled(slot));
} else {
g_MpSetupSaveFile.tracknum = mpGetTrackNumAtSlotIndex(slot);
g_MpSetupFile.tracknum = mpGetTrackNumAtSlotIndex(slot);
}
}
@@ -7424,7 +7424,7 @@ void mpEnableAllMultiTracks(void)
s32 i;
for (i = 0; i != 6; i++) {
g_MpSetupSaveFile.multipletracknums[i] = 0xff;
g_MpSetupFile.multipletracknums[i] = 0xff;
}
}
@@ -7433,7 +7433,7 @@ void mpDisableAllMultiTracks(void)
s32 i;
for (i = 0; i != 6; i++) {
g_MpSetupSaveFile.multipletracknums[i] = 0;
g_MpSetupFile.multipletracknums[i] = 0;
}
}
@@ -7442,22 +7442,22 @@ void mpRandomiseMultiTracks(void)
s32 i;
for (i = 0; i != 6; i++) {
g_MpSetupSaveFile.multipletracknums[i] = random();
g_MpSetupFile.multipletracknums[i] = random();
}
}
void mpSetTrackToRandom(void)
{
g_MpSetupSaveFile.tracknum = -1;
g_MpSetupFile.tracknum = -1;
}
s32 mpGetCurrentTrackSlotNum(void)
{
if (g_MpSetupSaveFile.tracknum < 0) {
return g_MpSetupSaveFile.tracknum;
if (g_MpSetupFile.tracknum < 0) {
return g_MpSetupFile.tracknum;
}
return mpGetTrackSlotIndex(g_MpSetupSaveFile.tracknum);
return mpGetTrackSlotIndex(g_MpSetupFile.tracknum);
}
#if VERSION >= VERSION_PAL_FINAL
+2 -2
View File
@@ -8894,7 +8894,7 @@ void mpCreateMatchStartHudmsgs(void)
char challengename[60];
char scenarioname[60];
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
sprintf(challengename, "%s:\n", mpGetChallengeNameBySlot(mpGetCurrentChallengeIndex()));
}
@@ -8904,7 +8904,7 @@ void mpCreateMatchStartHudmsgs(void)
if (g_MpPlayerChrs[i]->aibot == NULL) {
setCurrentPlayerNum(i);
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
hudmsgCreateWithFlags(challengename, HUDMSGTYPE_DEFAULT, HUDMSGFLAG_ONLYIFALIVE);
}
+10 -10
View File
@@ -5899,7 +5899,7 @@ s32 func0f17dac4(s32 operation, struct menuitem *item, union handlerdata *data)
return (s32) "\n";
}
return (s32) g_MpSetupSaveFile.teamnames[data->list.value];
return (s32) g_MpSetupFile.teamnames[data->list.value];
}
return menuhandlerMpTeamsLabel(operation, item, data);
@@ -6307,7 +6307,7 @@ char *mpMenuTextTeamName(struct menuitem *item)
s32 index = item->param2;
index -= L_OPTIONS_008;
return g_MpSetupSaveFile.teamnames[index];
return g_MpSetupFile.teamnames[index];
}
s32 menuhandlerMpTeamNameSlot(s32 operation, struct menuitem *item, union handlerdata *data)
@@ -6357,7 +6357,7 @@ s32 menudialog0017e3fc(s32 operation, struct menudialog *dialog, union handlerda
case MENUOP_CLOSE:
break;
case MENUOP_TICK:
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
menuPopDialog();
}
break;
@@ -7135,7 +7135,7 @@ glabel var7f1b2b7cnb
s32 menuhandler0017e9d8(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_CHECKHIDDEN) {
if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype != MPLOCKTYPE_CHALLENGE) {
return true;
}
}
@@ -7146,7 +7146,7 @@ s32 menuhandler0017e9d8(s32 operation, struct menuitem *item, union handlerdata
s32 menuhandlerMpAbortChallenge(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_CHECKHIDDEN) {
if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype != MPLOCKTYPE_CHALLENGE) {
return true;
}
}
@@ -7161,7 +7161,7 @@ s32 menuhandlerMpAbortChallenge(s32 operation, struct menuitem *item, union hand
s32 menuhandlerMpStartChallenge(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_CHECKHIDDEN) {
if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype != MPLOCKTYPE_CHALLENGE) {
return true;
}
}
@@ -7175,7 +7175,7 @@ s32 menuhandlerMpStartChallenge(s32 operation, struct menuitem *item, union hand
char *mpMenuTextChallengeName(struct menuitem *item)
{
#if VERSION >= VERSION_NTSC_1_0
if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype != MPLOCKTYPE_CHALLENGE) {
return langGet(L_MPMENU_050); // "Combat Challenges"
}
#endif
@@ -7187,7 +7187,7 @@ char *mpMenuTextChallengeName(struct menuitem *item)
s32 mpCombatChallengesMenuDialog(s32 operation, struct menudialog *dialog, union handlerdata *data)
{
if (operation == MENUOP_TICK) {
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE
&& g_Menus[g_MpPlayerNum].curframe
&& g_Menus[g_MpPlayerNum].curframe->dialog == dialog
&& !mpIsChallengeLoaded()) {
@@ -7645,7 +7645,7 @@ s32 menuhandlerPlayerTeam(s32 operation, struct menuitem *item, union handlerdat
data->dropdown.value = 8;
break;
case MENUOP_GETOPTIONTEXT:
return (s32) &g_MpSetupSaveFile.teamnames[data->dropdown.value];
return (s32) &g_MpSetupFile.teamnames[data->dropdown.value];
case MENUOP_SET:
g_Vars.mpplayerteams[item->param] = data->dropdown.value;
break;
@@ -8206,7 +8206,7 @@ void func0f17fcb0(s32 silent)
menuPushRootDialog(&g_AdvancedSetup4MbMenuDialog, MENUROOT_4MBMAINMENU);
func0f0f8300();
} else {
if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_CHALLENGE) {
if (g_MpSetupFile.locktype == MPLOCKTYPE_CHALLENGE) {
menuPushRootDialog(&g_MpChallengeListOrDetailsViaAdvChallengeMenuDialog, MENUROOT_MPSETUP);
} else {
menuPushRootDialog(&g_MpAdvancedSetupMenuDialog, MENUROOT_MPSETUP);
+1 -1
View File
@@ -302,7 +302,7 @@ extern u8 g_MpSimulantDifficultiesPerNumPlayers[32];
extern struct mpplayer g_MpPlayers[6];
extern u8 g_AmBotCommands[16];
extern struct mpsetup g_MpSetup;
extern struct savefile_setup g_MpSetupSaveFile;
extern struct mpsetupfile g_MpSetupFile;
extern struct chrdata *g_MpSimulantChrs[MAX_SIMULANTS];
#endif
+1 -1
View File
@@ -22,7 +22,7 @@ void func0f0d55a4(struct savebuffer *buffer, char *src);
void func0f0d564c(u8 *data, char *dst, bool addlinebreak);
void func0f0d5690(u8 *dst, char *buffer);
void func0f0d575c(struct savebuffer *buffer, u32 *arg1);
void func0f0d579c(struct savebuffer *buffer, u32 *arg1);
void func0f0d579c(struct savebuffer *buffer, struct maybesavelocation_2d8 *arg1);
void formatTime(char *dst, s32 time, u32 arg2);
void func0f0d5a7c(void);
+1 -1
View File
@@ -6,7 +6,7 @@
bool func0f1106c8(void);
u32 func0f110720(void);
u32 func0f11080c(void);
void mpsetupfileLoad(void);
void func0f1109c0(void);
void func0f110b68(void);
void func0f110bf0(void);
-13
View File
@@ -13,18 +13,5 @@ void gamefileLoadDefaults(struct gamefile *file);
s32 gamefileLoad(s32 arg0);
s32 gamefileSave(s32 arg0, s32 arg1, u16 arg2);
void gamefileGetOverview(char *arg0, char *name, u8 *stage, u8 *difficulty, u32 *time);
bool func0f1106c8(void);
u32 func0f110720(void);
u32 func0f11080c(void);
void func0f1109c0(void);
void func0f110b68(void);
void func0f110bf0(void);
void func0f110bf8(void);
void func0f110c5c(s32 listnum, u8 filetype);
u8 func0f110cf8(u8 arg0);
u32 func0f110d90(void);
void func0f110da8(void);
u32 func0f110f4c(void);
struct textureconfig *func0f111460(s32 playernum, s32 arg1, s32 arg2);
#endif
+7 -2
View File
@@ -4539,6 +4539,11 @@ struct savelocation_2d8 {
u16 unk04;
};
struct maybesavelocation_2d8 {
u32 unk00;
u16 unk04;
};
struct mpplayer {
/*0x00*/ struct mpchr base;
/*0x48*/ u16 options;
@@ -4614,14 +4619,14 @@ struct mpsetup {
/*0x800acba8*/ struct savelocation_2d8 unk20;
};
struct savefile_setup {
struct mpsetupfile {
/*0x00*/ char teamnames[8][12];
/*0x60*/ u8 locktype;
/*0x61*/ u8 unk89;
/*0x62*/ u8 usingmultipletunes;
/*0x63*/ u8 unk8b;
/*0x64*/ s8 tracknum; // -1 = random
/*0x8d*/ u8 multipletracknums[5];
/*0x8d*/ u8 multipletracknums[6];
};
struct savebuffer {