diff --git a/src/game/game_177e00.c b/src/game/game_177e00.c index 8ad607dd3..8362dc974 100644 --- a/src/game/game_177e00.c +++ b/src/game/game_177e00.c @@ -180,7 +180,7 @@ s32 menuhandlerMpEndGame(u32 operation, struct menu_item *item, s32 *value) s32 menuhandler00178018(u32 operation, struct menu_item *item, s32 *value) { if (operation == MENUOP_CHECKHIDDEN) { - if (g_MpSetup.locktype != MPLOCKTYPE_CHALLENGE) { + if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) { return true; } } diff --git a/src/game/game_179060.c b/src/game/game_179060.c index 092585a70..78a4bfa02 100644 --- a/src/game/game_179060.c +++ b/src/game/game_179060.c @@ -5665,7 +5665,7 @@ glabel var7f1b8288 s32 menuhandler0017e9d8(u32 operation, struct menu_item *item, s32 *value) { if (operation == MENUOP_CHECKHIDDEN) { - if (g_MpSetup.locktype != MPLOCKTYPE_CHALLENGE) { + if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) { return true; } } @@ -5676,7 +5676,7 @@ s32 menuhandler0017e9d8(u32 operation, struct menu_item *item, s32 *value) s32 menuhandlerMpAbortChallenge(u32 operation, struct menu_item *item, s32 *value) { if (operation == MENUOP_CHECKHIDDEN) { - if (g_MpSetup.locktype != MPLOCKTYPE_CHALLENGE) { + if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) { return true; } } @@ -5691,7 +5691,7 @@ s32 menuhandlerMpAbortChallenge(u32 operation, struct menu_item *item, s32 *valu s32 menuhandlerMpStartChallenge(u32 operation, struct menu_item *item, s32 *value) { if (operation == MENUOP_CHECKHIDDEN) { - if (g_MpSetup.locktype != MPLOCKTYPE_CHALLENGE) { + if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) { return true; } } @@ -5704,7 +5704,7 @@ s32 menuhandlerMpStartChallenge(u32 operation, struct menu_item *item, s32 *valu char *mpMenuTextChallengeName(struct menu_item *item) { - if (g_MpSetup.locktype != MPLOCKTYPE_CHALLENGE) { + if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) { return langGet(L_MPMENU(50)); // "Combat Challenges" } diff --git a/src/game/gamefile.c b/src/game/gamefile.c index e60245310..324bd904e 100644 --- a/src/game/gamefile.c +++ b/src/game/gamefile.c @@ -1656,12 +1656,12 @@ glabel func0f11080c /* 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(var800acc14) +/* f110910: 3c01800b */ lui $at,%hi(g_MpSetupSaveFile+0x64) /* f110914: 10000003 */ beqz $zero,.L0f110924 -/* f110918: a029cc14 */ sb $t1,%lo(var800acc14)($at) +/* f110918: a029cc14 */ sb $t1,%lo(g_MpSetupSaveFile+0x64)($at) .L0f11091c: -/* f11091c: 3c01800b */ lui $at,%hi(var800acc14) -/* f110920: a023cc14 */ sb $v1,%lo(var800acc14)($at) +/* 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) @@ -1748,8 +1748,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(var800acc14) -/* f110a5c: 8042cc14 */ lb $v0,%lo(var800acc14)($v0) +/* f110a58: 3c02800b */ lui $v0,%hi(g_MpSetupSaveFile+0x64) +/* f110a5c: 8042cc14 */ lb $v0,%lo(g_MpSetupSaveFile+0x64)($v0) /* f110a60: 2401ffff */ addiu $at,$zero,-1 /* f110a64: 02402025 */ or $a0,$s2,$zero /* f110a68: 14410007 */ bne $v0,$at,.L0f110a88 @@ -1823,43 +1823,29 @@ glabel func0f1109c0 /* f110b64: 27bd0130 */ addiu $sp,$sp,0x130 ); -GLOBAL_ASM( -glabel func0f110b68 -/* f110b68: 3c02800b */ lui $v0,%hi(g_MpSetup+0x28) -/* f110b6c: 2442cbb0 */ addiu $v0,$v0,%lo(g_MpSetup+0x28) -/* f110b70: 27bdffe8 */ addiu $sp,$sp,-24 -/* f110b74: afbf0014 */ sw $ra,0x14($sp) -/* f110b78: 240effff */ addiu $t6,$zero,-1 -/* f110b7c: a0400000 */ sb $zero,0x0($v0) -/* f110b80: a040000c */ sb $zero,0xc($v0) -/* f110b84: a0400018 */ sb $zero,0x18($v0) -/* f110b88: a0400024 */ sb $zero,0x24($v0) -/* f110b8c: a0400030 */ sb $zero,0x30($v0) -/* f110b90: a040003c */ sb $zero,0x3c($v0) -/* f110b94: a0400048 */ sb $zero,0x48($v0) -/* f110b98: a0400054 */ sb $zero,0x54($v0) -/* f110b9c: 0fc630f9 */ jal func0f18c3e4 -/* f110ba0: a04e0064 */ sb $t6,0x64($v0) -/* f110ba4: 3c02800b */ lui $v0,%hi(g_MpSetup+0x28) -/* f110ba8: 3c03800a */ lui $v1,%hi(g_Vars) -/* f110bac: 24639fc0 */ addiu $v1,$v1,%lo(g_Vars) -/* f110bb0: 2442cbb0 */ addiu $v0,$v0,%lo(g_MpSetup+0x28) -/* f110bb4: a0400062 */ sb $zero,0x62($v0) -/* f110bb8: a0400061 */ sb $zero,0x61($v0) -/* f110bbc: a0400060 */ sb $zero,0x60($v0) -/* f110bc0: ac60047c */ sw $zero,0x47c($v1) -/* f110bc4: a4600480 */ sh $zero,0x480($v1) -/* f110bc8: a4600482 */ sh $zero,0x482($v1) -/* f110bcc: 3c01800a */ lui $at,%hi(var800a2328+0x3) -/* f110bd0: a020232b */ sb $zero,%lo(var800a2328+0x3)($at) -/* f110bd4: 3c01800a */ lui $at,%hi(g_AltTitle) -/* f110bd8: 0fc44270 */ jal func0f1109c0 -/* f110bdc: a020232c */ sb $zero,%lo(g_AltTitle)($at) -/* f110be0: 8fbf0014 */ lw $ra,0x14($sp) -/* f110be4: 27bd0018 */ addiu $sp,$sp,0x18 -/* f110be8: 03e00008 */ jr $ra -/* f110bec: 00000000 */ sll $zero,$zero,0x0 -); +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_MpSetupSaveFile.unk8c = -1; + func0f18c3e4(); + g_MpSetupSaveFile.usingmultipletunes = false; + g_MpSetupSaveFile.unk89 = 0; + g_MpSetupSaveFile.locktype = MPLOCKTYPE_NONE; + g_Vars.unk00047c = 0; + g_Vars.unk000480 = 0; + g_Vars.unk000482 = 0; + var800a2328[3] = 0; + g_AltTitle = false; + func0f1109c0(); +} void func0f110bf0(void) { diff --git a/src/game/mplayer.c b/src/game/mplayer.c index ceb8e0147..9678c1b0d 100644 --- a/src/game/mplayer.c +++ b/src/game/mplayer.c @@ -5206,7 +5206,7 @@ glabel mpSetLock u32 mpGetLockType(void) { - return g_MpSetup.locktype; + return g_MpSetupSaveFile.locktype; } u32 mpGetLockPlayerNum(void) @@ -5216,7 +5216,7 @@ u32 mpGetLockPlayerNum(void) bool mpIsPlayerLockedOut(u32 playernum) { - if (g_MpSetup.locktype == MPLOCKTYPE_NONE) { + if (g_MpSetupSaveFile.locktype == MPLOCKTYPE_NONE) { return false; } @@ -5390,12 +5390,12 @@ char *mpGetTrackName(s32 slotindex) void mpSetUsingMultipleTunes(bool enable) { - g_MpSetup.usingmultipletunes = enable; + g_MpSetupSaveFile.usingmultipletunes = enable; } bool mpGetUsingMultipleTunes(void) { - return g_MpSetup.usingmultipletunes; + return g_MpSetupSaveFile.usingmultipletunes; } GLOBAL_ASM( @@ -5406,9 +5406,9 @@ glabel func0f18c2b0 /* f18c2bc: 00000000 */ sll $zero,$zero,0x0 /* f18c2c0: 000270c3 */ sra $t6,$v0,0x3 /* f18c2c4: 31cf00ff */ andi $t7,$t6,0xff -/* f18c2c8: 3c18800b */ lui $t8,%hi(var800acc14+0x1) +/* f18c2c8: 3c18800b */ lui $t8,%hi(g_MpSetupSaveFile+0x65) /* f18c2cc: 030fc021 */ addu $t8,$t8,$t7 -/* f18c2d0: 9318cc15 */ lbu $t8,%lo(var800acc14+0x1)($t8) +/* f18c2d0: 9318cc15 */ lbu $t8,%lo(g_MpSetupSaveFile+0x65)($t8) /* f18c2d4: 30590007 */ andi $t9,$v0,0x7 /* f18c2d8: 24080001 */ addiu $t0,$zero,0x1 /* f18c2dc: 03284804 */ sllv $t1,$t0,$t9 @@ -5484,8 +5484,8 @@ glabel func0f18c38c .L0f18c3c4: /* f18c3c4: 0fc63065 */ jal mpGetTrackNumAtSlotIndex /* f18c3c8: 8fa40018 */ lw $a0,0x18($sp) -/* f18c3cc: 3c01800b */ lui $at,%hi(var800acc14) -/* f18c3d0: a022cc14 */ sb $v0,%lo(var800acc14)($at) +/* f18c3cc: 3c01800b */ lui $at,%hi(g_MpSetupSaveFile+0x64) +/* f18c3d0: a022cc14 */ sb $v0,%lo(g_MpSetupSaveFile+0x64)($at) /* f18c3d4: 8fbf0014 */ lw $ra,0x14($sp) .L0f18c3d8: /* f18c3d8: 27bd0018 */ addiu $sp,$sp,0x18 @@ -5548,15 +5548,15 @@ glabel func0f18c430 GLOBAL_ASM( glabel func0f18c478 /* f18c478: 240effff */ addiu $t6,$zero,-1 -/* f18c47c: 3c01800b */ lui $at,%hi(var800acc14) +/* f18c47c: 3c01800b */ lui $at,%hi(g_MpSetupSaveFile+0x64) /* f18c480: 03e00008 */ jr $ra -/* f18c484: a02ecc14 */ sb $t6,%lo(var800acc14)($at) +/* f18c484: a02ecc14 */ sb $t6,%lo(g_MpSetupSaveFile+0x64)($at) ); GLOBAL_ASM( glabel mpGetTrackNum -/* f18c488: 3c04800b */ lui $a0,%hi(var800acc14) -/* f18c48c: 8084cc14 */ lb $a0,%lo(var800acc14)($a0) +/* f18c488: 3c04800b */ lui $a0,%hi(g_MpSetupSaveFile+0x64) +/* f18c48c: 8084cc14 */ lb $a0,%lo(g_MpSetupSaveFile+0x64)($a0) /* f18c490: 27bdffe8 */ addiu $sp,$sp,-24 /* f18c494: afbf0014 */ sw $ra,0x14($sp) /* f18c498: 04810003 */ bgez $a0,.L0f18c4a8 diff --git a/src/gvars/gvars.c b/src/gvars/gvars.c index 13c925f73..8ec220657 100644 --- a/src/gvars/gvars.c +++ b/src/gvars/gvars.c @@ -25686,7 +25686,7 @@ u32 var800ac798[8] = {0}; struct mpplayer g_MpPlayers[6] = {0}; u8 g_ActiveMenuMpBotCommands[16] = {0}; struct mpsetup g_MpSetup = {0}; -u32 var800acc14 = 0; +struct savefile_setup g_MpSetupSaveFile = {0}; u32 var800acc18 = 0; u32 var800acc1c = 0; s8 g_MpLockPlayerNum = 0; diff --git a/src/include/game/gamefile.h b/src/include/game/gamefile.h index c423ecc90..b0bf3f1ef 100644 --- a/src/include/game/gamefile.h +++ b/src/include/game/gamefile.h @@ -15,8 +15,8 @@ u32 func0f1105fc(void); u32 func0f1106c8(void); u32 func0f110720(void); u32 func0f11080c(void); -u32 func0f1109c0(void); -u32 func0f110b68(void); +void func0f1109c0(void); +void func0f110b68(void); void func0f110bf0(void); u32 func0f110bf8(void); void func0f110c5c(s32 arg0, s32 arg1); diff --git a/src/include/game/mplayer.h b/src/include/game/mplayer.h index 8b33acadd..3e132956f 100644 --- a/src/include/game/mplayer.h +++ b/src/include/game/mplayer.h @@ -73,7 +73,7 @@ bool mpGetUsingMultipleTunes(void); u32 func0f18c2b0(void); u32 func0f18c304(void); u32 func0f18c38c(void); -u32 func0f18c3e4(void); +void func0f18c3e4(void); u32 func0f18c40c(void); u32 func0f18c430(void); u32 func0f18c478(void); diff --git a/src/include/gvars/gvars.h b/src/include/gvars/gvars.h index 955fe717e..7e2acde5d 100644 --- a/src/include/gvars/gvars.h +++ b/src/include/gvars/gvars.h @@ -157,7 +157,8 @@ struct g_vars { /*000474*/ s32 numaibuddies; /*000478*/ u32 unk000478; /*00047c*/ u32 unk00047c; - /*000480*/ u32 unk000480; + /*000480*/ u16 unk000480; + /*000482*/ u16 unk000482; /*000484*/ s32 mphilltime; /*000488*/ u32 unk000488; /*00048c*/ u32 unk00048c; @@ -814,6 +815,7 @@ extern u32 var800ac798[8]; extern struct mpplayer g_MpPlayers[6]; extern u8 g_ActiveMenuMpBotCommands[16]; extern struct mpsetup g_MpSetup; +extern struct savefile_setup g_MpSetupSaveFile; extern s8 g_MpLockPlayerNum; extern u32 var800acc28; extern u32 var800acc70; diff --git a/src/include/types.h b/src/include/types.h index 208d3c9f3..b89c8df8a 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -4130,13 +4130,13 @@ struct missionconfig { }; struct mpsetup { - /*0x8009cb88*/ char name[12]; - /*0x8009cb94*/ u32 options; - /*0x8009cb98*/ u8 scenario; - /*0x8009cb99*/ u8 stagenum; - /*0x8009cb9a*/ u8 timelimit; - /*0x8009cb9b*/ u8 scorelimit; - /*0x8009cb9c*/ u16 teamscorelimit; + /*0x800acb88*/ char name[12]; + /*0x800acb94*/ u32 options; + /*0x800acb98*/ u8 scenario; + /*0x800acb99*/ u8 stagenum; + /*0x800acb9a*/ u8 timelimit; + /*0x800acb9b*/ u8 scorelimit; + /*0x800acb9c*/ u16 teamscorelimit; /** * Each bit signifies that a player or sim is participating. @@ -4145,17 +4145,22 @@ struct mpsetup { * Bits 0x0ff0 are for sims * Bits 0xf000 are probably not used */ - /*0x8009cb9e*/ u16 chrslots; - /*0x8009cba0*/ u32 unk18; - /*0x8009cba4*/ u16 unk1c; - /*0x8009cba6*/ u8 paused; - /*0x8009cba8*/ bool saved; - /*0x8009cbac*/ u16 unk24; - /*0x8009cbae*/ u16 unk26; + /*0x800acb9e*/ u16 chrslots; + /*0x800acba0*/ u32 unk18; + /*0x800acba4*/ u16 unk1c; + /*0x800acba6*/ u8 paused; + /*0x800acba8*/ bool saved; + /*0x800acbac*/ u16 unk24; + /*0x800acbae*/ u16 unk26; +}; + +struct savefile_setup { /*0x800acbb0*/ char teamnames[8][12]; /*0x800acc10*/ u8 locktype; /*0x800acc11*/ u8 unk89; /*0x800acc12*/ u8 usingmultipletunes; + /*0x800acc13*/ u8 unk8b; + /*0x800acc14*/ s8 unk8c; }; struct mpscenario {