diff --git a/src/game/game_015470.c b/src/game/game_015470.c index 304c94471..7ef253a88 100644 --- a/src/game/game_015470.c +++ b/src/game/game_015470.c @@ -9041,7 +9041,7 @@ glabel func0f01bf28 /* f01d2b0: 10000039 */ beqz $zero,.L0f01d398 /* f01d2b4: 00000000 */ sll $zero,$zero,0x0 .L0f01d2b8: -/* f01d2b8: 0fc625cb */ jal func0f18972c +/* f01d2b8: 0fc625cb */ jal mpSetPaused /* f01d2bc: 00002025 */ or $a0,$zero,$zero /* f01d2c0: 3c02800b */ lui $v0,%hi(var800acbb0) /* f01d2c4: 2442cbb0 */ addiu $v0,$v0,%lo(var800acbb0) @@ -9082,7 +9082,7 @@ glabel func0f01bf28 .L0f01d348: /* f01d348: 05a00013 */ bltz $t5,.L0f01d398 /* f01d34c: 00000000 */ sll $zero,$zero,0x0 -/* f01d350: 0fc625cb */ jal func0f18972c +/* f01d350: 0fc625cb */ jal mpSetPaused /* f01d354: 00002025 */ or $a0,$zero,$zero /* f01d358: ae600314 */ sw $zero,0x314($s3) /* f01d35c: ae600318 */ sw $zero,0x318($s3) diff --git a/src/game/game_066310.c b/src/game/game_066310.c index c3a964e01..10ddadccd 100644 --- a/src/game/game_066310.c +++ b/src/game/game_066310.c @@ -51961,7 +51961,7 @@ glabel func0f092c04 /* f093050: 14400031 */ bnez $v0,.L0f093118 /* f093054: c7b2003c */ lwc1 $f18,0x3c($sp) /* f093058: afa80040 */ sw $t0,0x40($sp) -/* f09305c: 0fc62590 */ jal func0f189640 +/* f09305c: 0fc62590 */ jal mpIsPaused /* f093060: e7b2003c */ swc1 $f18,0x3c($sp) /* f093064: 3c09800a */ lui $t1,%hi(g_Vars) /* f093068: 25299fc0 */ addiu $t1,$t1,%lo(g_Vars) @@ -51974,7 +51974,7 @@ glabel func0f092c04 /* f093084: 240cffff */ addiu $t4,$zero,-1 .L0f093088: /* f093088: afa80040 */ sw $t0,0x40($sp) -/* f09308c: 0fc62590 */ jal func0f189640 +/* f09308c: 0fc62590 */ jal mpIsPaused /* f093090: e7b2003c */ swc1 $f18,0x3c($sp) /* f093094: 3c09800a */ lui $t1,%hi(g_Vars) /* f093098: 25299fc0 */ addiu $t1,$t1,%lo(g_Vars) diff --git a/src/game/game_0b28d0.c b/src/game/game_0b28d0.c index 4ff634264..f5f91ffa0 100644 --- a/src/game/game_0b28d0.c +++ b/src/game/game_0b28d0.c @@ -16316,7 +16316,7 @@ glabel func0f0c07c8 /* f0c0d9c: 3405b000 */ dli $a1,0xb000 /* f0c0da0: 504000ee */ beqzl $v0,.L0f0c115c /* f0c0da4: 8e0e0284 */ lw $t6,0x284($s0) -/* f0c0da8: 0fc62590 */ jal func0f189640 +/* f0c0da8: 0fc62590 */ jal mpIsPaused /* f0c0dac: 00000000 */ sll $zero,$zero,0x0 /* f0c0db0: 544000ea */ bnezl $v0,.L0f0c115c /* f0c0db4: 8e0e0284 */ lw $t6,0x284($s0) @@ -16350,7 +16350,7 @@ glabel func0f0c07c8 /* f0c0e1c: 0002302b */ sltu $a2,$zero,$v0 /* f0c0e20: 50c00005 */ beqzl $a2,.L0f0c0e38 /* f0c0e24: 8e0e02a4 */ lw $t6,0x2a4($s0) -/* f0c0e28: 0fc62590 */ jal func0f189640 +/* f0c0e28: 0fc62590 */ jal mpIsPaused /* f0c0e2c: 00000000 */ sll $zero,$zero,0x0 /* f0c0e30: 2c460001 */ sltiu $a2,$v0,0x1 /* f0c0e34: 8e0e02a4 */ lw $t6,0x2a4($s0) @@ -16558,7 +16558,7 @@ glabel func0f0c07c8 /* f0c1114: 3405b000 */ dli $a1,0xb000 /* f0c1118: 1040000a */ beqz $v0,.L0f0c1144 /* f0c111c: 8faa0088 */ lw $t2,0x88($sp) -/* f0c1120: 0fc62590 */ jal func0f189640 +/* f0c1120: 0fc62590 */ jal mpIsPaused /* f0c1124: afaa0088 */ sw $t2,0x88($sp) /* f0c1128: 14400006 */ bnez $v0,.L0f0c1144 /* f0c112c: 8faa0088 */ lw $t2,0x88($sp) diff --git a/src/game/game_0c79f0.c b/src/game/game_0c79f0.c index 3b429b2de..911c5a2b8 100644 --- a/src/game/game_0c79f0.c +++ b/src/game/game_0c79f0.c @@ -1642,7 +1642,7 @@ glabel func0f0c8b90 /* f0c8e88: 01c57821 */ addu $t7,$t6,$a1 /* f0c8e8c: 15e10010 */ bne $t7,$at,.L0f0c8ed0 /* f0c8e90: 00000000 */ sll $zero,$zero,0x0 -/* f0c8e94: 0fc62590 */ jal func0f189640 +/* f0c8e94: 0fc62590 */ jal mpIsPaused /* f0c8e98: 00000000 */ sll $zero,$zero,0x0 /* f0c8e9c: 10400015 */ beqz $v0,.L0f0c8ef4 /* f0c8ea0: 97b801a0 */ lhu $t8,0x1a0($sp) @@ -1653,12 +1653,12 @@ glabel func0f0c8b90 /* f0c8eb4: 24010002 */ addiu $at,$zero,0x2 /* f0c8eb8: 5101000f */ beql $t0,$at,.L0f0c8ef8 /* f0c8ebc: 8e450284 */ lw $a1,0x284($s2) -/* f0c8ec0: 0fc625cb */ jal func0f18972c +/* f0c8ec0: 0fc625cb */ jal mpSetPaused /* f0c8ec4: 00002025 */ or $a0,$zero,$zero /* f0c8ec8: 1000000b */ beqz $zero,.L0f0c8ef8 /* f0c8ecc: 8e450284 */ lw $a1,0x284($s2) .L0f0c8ed0: -/* f0c8ed0: 0fc62590 */ jal func0f189640 +/* f0c8ed0: 0fc62590 */ jal mpIsPaused /* f0c8ed4: 00000000 */ sll $zero,$zero,0x0 /* f0c8ed8: 10400006 */ beqz $v0,.L0f0c8ef4 /* f0c8edc: 97a901a0 */ lhu $t1,0x1a0($sp) diff --git a/src/game/game_0dcdb0.c b/src/game/game_0dcdb0.c index 2d1cead6f..0e15ed158 100644 --- a/src/game/game_0dcdb0.c +++ b/src/game/game_0dcdb0.c @@ -7274,7 +7274,7 @@ glabel func0f0df364 /* f0df768: 00000000 */ sll $zero,$zero,0x0 /* f0df76c: 54400034 */ bnezl $v0,.L0f0df840 /* f0df770: 9602001c */ lhu $v0,0x1c($s0) -/* f0df774: 0fc62590 */ jal func0f189640 +/* f0df774: 0fc62590 */ jal mpIsPaused /* f0df778: 00000000 */ sll $zero,$zero,0x0 /* f0df77c: 54400030 */ bnezl $v0,.L0f0df840 /* f0df780: 9602001c */ lhu $v0,0x1c($s0) diff --git a/src/game/game_0f09f0.c b/src/game/game_0f09f0.c index 895b07d02..e0cb84225 100644 --- a/src/game/game_0f09f0.c +++ b/src/game/game_0f09f0.c @@ -14883,7 +14883,7 @@ glabel func0f0fd660 /* f0fd664: 8dce1448 */ lw $t6,0x1448($t6) /* f0fd668: 27bdffe0 */ addiu $sp,$sp,-32 /* f0fd66c: afbf0014 */ sw $ra,0x14($sp) -/* f0fd670: 0fc62590 */ jal func0f189640 +/* f0fd670: 0fc62590 */ jal mpIsPaused /* f0fd674: afae001c */ sw $t6,0x1c($sp) /* f0fd678: 14400019 */ bnez $v0,.L0f0fd6e0 /* f0fd67c: 3c03800a */ lui $v1,%hi(g_Vars) diff --git a/src/game/game_1668e0.c b/src/game/game_1668e0.c index 90be27724..974ddf6ae 100644 --- a/src/game/game_1668e0.c +++ b/src/game/game_1668e0.c @@ -6037,7 +6037,7 @@ glabel func0f16b96c /* f16bb4c: 1000011a */ beqz $zero,.L0f16bfb8 /* f16bb50: ae800034 */ sw $zero,0x34($s4) .L0f16bb54: -/* f16bb54: 0fc62590 */ jal func0f189640 +/* f16bb54: 0fc62590 */ jal mpIsPaused /* f16bb58: 00000000 */ sll $zero,$zero,0x0 /* f16bb5c: 10400044 */ beqz $v0,.L0f16bc70 /* f16bb60: 00000000 */ sll $zero,$zero,0x0 @@ -7243,7 +7243,7 @@ GLOBAL_ASM( glabel func0f16cce4 /* f16cce4: 27bdffe0 */ addiu $sp,$sp,-32 /* f16cce8: afbf0014 */ sw $ra,0x14($sp) -/* f16ccec: 0fc62590 */ jal func0f189640 +/* f16ccec: 0fc62590 */ jal mpIsPaused /* f16ccf0: 00000000 */ sll $zero,$zero,0x0 /* f16ccf4: 3c0e8008 */ lui $t6,0x8008 /* f16ccf8: 8dce4010 */ lw $t6,0x4010($t6) diff --git a/src/game/game_176d70.c b/src/game/game_176d70.c index 069326f10..9236f3fcb 100644 --- a/src/game/game_176d70.c +++ b/src/game/game_176d70.c @@ -1887,92 +1887,36 @@ s32 menuhandlerMpInGameLimitLabel(u32 operation, struct menu_item *item, s32 *va return 0; } -GLOBAL_ASM( -glabel menuhandler001781ac -/* f1781ac: 27bdffe8 */ addiu $sp,$sp,-24 -/* f1781b0: 24010006 */ addiu $at,$zero,0x6 -/* f1781b4: afbf0014 */ sw $ra,0x14($sp) -/* f1781b8: afa40018 */ sw $a0,0x18($sp) -/* f1781bc: afa5001c */ sw $a1,0x1c($sp) -/* f1781c0: 1481000b */ bne $a0,$at,.L0f1781f0 -/* f1781c4: afa60020 */ sw $a2,0x20($sp) -/* f1781c8: 0fc62590 */ jal func0f189640 -/* f1781cc: 00000000 */ sll $zero,$zero,0x0 -/* f1781d0: 10400005 */ beqz $v0,.L0f1781e8 -/* f1781d4: 00000000 */ sll $zero,$zero,0x0 -/* f1781d8: 0fc625cb */ jal func0f18972c -/* f1781dc: 00002025 */ or $a0,$zero,$zero -/* f1781e0: 10000004 */ beqz $zero,.L0f1781f4 -/* f1781e4: 8faf0018 */ lw $t7,0x18($sp) -.L0f1781e8: -/* f1781e8: 0fc625cb */ jal func0f18972c -/* f1781ec: 24040001 */ addiu $a0,$zero,0x1 -.L0f1781f0: -/* f1781f0: 8faf0018 */ lw $t7,0x18($sp) -.L0f1781f4: -/* f1781f4: 24010018 */ addiu $at,$zero,0x18 -/* f1781f8: 3c02800a */ lui $v0,%hi(g_Vars) -/* f1781fc: 15e10021 */ bne $t7,$at,.L0f178284 -/* f178200: 8fbf0014 */ lw $ra,0x14($sp) -/* f178204: 24429fc0 */ addiu $v0,$v0,%lo(g_Vars) -/* f178208: 8c58006c */ lw $t8,0x6c($v0) -/* f17820c: 24010001 */ addiu $at,$zero,0x1 -/* f178210: 00002825 */ or $a1,$zero,$zero -/* f178214: 13000003 */ beqz $t8,.L0f178224 -/* f178218: 00001825 */ or $v1,$zero,$zero -/* f17821c: 10000001 */ beqz $zero,.L0f178224 -/* f178220: 24050001 */ addiu $a1,$zero,0x1 -.L0f178224: -/* f178224: 8c590068 */ lw $t9,0x68($v0) -/* f178228: 00002025 */ or $a0,$zero,$zero -/* f17822c: 13200003 */ beqz $t9,.L0f17823c -/* f178230: 00000000 */ sll $zero,$zero,0x0 -/* f178234: 10000001 */ beqz $zero,.L0f17823c -/* f178238: 24030001 */ addiu $v1,$zero,0x1 -.L0f17823c: -/* f17823c: 8c480064 */ lw $t0,0x64($v0) -/* f178240: 11000003 */ beqz $t0,.L0f178250 -/* f178244: 00000000 */ sll $zero,$zero,0x0 -/* f178248: 10000001 */ beqz $zero,.L0f178250 -/* f17824c: 24040001 */ addiu $a0,$zero,0x1 -.L0f178250: -/* f178250: 8c490070 */ lw $t1,0x70($v0) -/* f178254: 00001025 */ or $v0,$zero,$zero -/* f178258: 11200003 */ beqz $t1,.L0f178268 -/* f17825c: 00000000 */ sll $zero,$zero,0x0 -/* f178260: 10000001 */ beqz $zero,.L0f178268 -/* f178264: 24020001 */ addiu $v0,$zero,0x1 -.L0f178268: -/* f178268: 00445021 */ addu $t2,$v0,$a0 -/* f17826c: 01435821 */ addu $t3,$t2,$v1 -/* f178270: 01656021 */ addu $t4,$t3,$a1 -/* f178274: 55810004 */ bnel $t4,$at,.L0f178288 -/* f178278: 8fad0018 */ lw $t5,0x18($sp) -/* f17827c: 1000000c */ beqz $zero,.L0f1782b0 -/* f178280: 24020001 */ addiu $v0,$zero,0x1 -.L0f178284: -/* f178284: 8fad0018 */ lw $t5,0x18($sp) -.L0f178288: -/* f178288: 2401000f */ addiu $at,$zero,0xf -/* f17828c: 8fae001c */ lw $t6,0x1c($sp) -/* f178290: 15a10007 */ bne $t5,$at,.L0f1782b0 -/* f178294: 00001025 */ or $v0,$zero,$zero -/* f178298: 91cf0001 */ lbu $t7,0x1($t6) -/* f17829c: 24010001 */ addiu $at,$zero,0x1 -/* f1782a0: 15e10003 */ bne $t7,$at,.L0f1782b0 -/* f1782a4: 00000000 */ sll $zero,$zero,0x0 -/* f1782a8: 10000001 */ beqz $zero,.L0f1782b0 -/* f1782ac: 24020001 */ addiu $v0,$zero,0x1 -.L0f1782b0: -/* f1782b0: 03e00008 */ jr $ra -/* f1782b4: 27bd0018 */ addiu $sp,$sp,0x18 -); +s32 menuhandlerMpPause(u32 operation, struct menu_item *item, s32 *value) +{ + if (operation == MENUOP_SET) { + if (mpIsPaused()) { + mpSetPaused(false); + } else { + mpSetPaused(true); + } + } + + if (operation == MENUOP_CHECKHIDDEN) { + if (PLAYERCOUNT() == 1) { + return true; + } + } + + if (operation == MENUOP_CHECKPREFOCUSED) { + if (item->param == 1) { + return true; + } + } + + return 0; +} GLOBAL_ASM( glabel func0f1782b8 /* f1782b8: 27bdffe8 */ addiu $sp,$sp,-24 /* f1782bc: afbf0014 */ sw $ra,0x14($sp) -/* f1782c0: 0fc62590 */ jal func0f189640 +/* f1782c0: 0fc62590 */ jal mpIsPaused /* f1782c4: afa40018 */ sw $a0,0x18($sp) /* f1782c8: 10400005 */ beqz $v0,.L0f1782e0 /* f1782cc: 00000000 */ sll $zero,$zero,0x0 diff --git a/src/game/game_187770.c b/src/game/game_187770.c index 00f088095..255096c11 100644 --- a/src/game/game_187770.c +++ b/src/game/game_187770.c @@ -2510,7 +2510,7 @@ glabel func0f18961c ); GLOBAL_ASM( -glabel func0f189640 +glabel mpIsPaused /* f189640: 3c06800a */ lui $a2,%hi(g_Vars) /* f189644: 24c69fc0 */ addiu $a2,$a2,%lo(g_Vars) /* f189648: 8cce006c */ lw $t6,0x6c($a2) @@ -2579,7 +2579,7 @@ glabel func0f189640 ); GLOBAL_ASM( -glabel func0f18972c +glabel mpSetPaused /* f18972c: 3c01800b */ lui $at,0x800b /* f189730: afa40000 */ sw $a0,0x0($sp) /* f189734: 03e00008 */ jr $ra @@ -5102,7 +5102,7 @@ glabel func0f18b9e4 /* f18ba68: 01259021 */ addu $s2,$t1,$a1 /* f18ba6c: 0fc5b6c5 */ jal func0f16db14 /* f18ba70: 02409825 */ or $s3,$s2,$zero -/* f18ba74: 0fc625cb */ jal func0f18972c +/* f18ba74: 0fc625cb */ jal mpSetPaused /* f18ba78: 24040002 */ addiu $a0,$zero,0x2 /* f18ba7c: 8e2a028c */ lw $t2,0x28c($s1) /* f18ba80: 00008025 */ or $s0,$zero,$zero diff --git a/src/include/game/game_176d70.h b/src/include/game/game_176d70.h index 946887a5e..2374b6abf 100644 --- a/src/include/game/game_176d70.h +++ b/src/include/game/game_176d70.h @@ -183,7 +183,7 @@ s32 menudialog00184ec0(u32, u32, u32 *); s32 menuhandler00177e00(u32, u32, u32 *); s32 menuhandler00178018(u32 operation, struct menu_item *item, s32 *value); s32 menuhandlerMpInGameLimitLabel(u32 operation, struct menu_item *item, s32 *value); -s32 menuhandler001781ac(u32, u32, u32 *); +s32 menuhandlerMpPause(u32 operation, struct menu_item *item, s32 *value); s32 menuhandler001785c4(u32, u32, u32 *); s32 menuhandler001786d8(u32, u32, u32 *); s32 menuhandler00178a94(u32, u32, u32 *); diff --git a/src/include/game/game_187770.h b/src/include/game/game_187770.h index d61e3294e..0a5f095f6 100644 --- a/src/include/game/game_187770.h +++ b/src/include/game/game_187770.h @@ -35,8 +35,8 @@ u32 func0f1892dc(void); void func0f1895bc(s32 arg0); u32 func0f1895e8(void); s32 func0f18961c(void); -u32 func0f189640(void); -u32 func0f18972c(void); +u32 mpIsPaused(void); +void mpSetPaused(bool pause); u32 func0f18973c(void); u32 func0f189cc0(void); u32 func0f189dc8(void); diff --git a/src/setup/setup_0160b0.c b/src/setup/setup_0160b0.c index 3feeb0d26..2503426fa 100644 --- a/src/setup/setup_0160b0.c +++ b/src/setup/setup_0160b0.c @@ -2186,7 +2186,7 @@ struct menu_item menuitems_18b8c[] = { { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, 0x000056b7, 0x00000000, &menudialog_controloptions }, // "Control" { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, 0x000056b8, 0x00000000, &menudialog_displayoptions }, // "Display" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000064, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, (u32)&func0f1782b8, 0x00000000, menuhandler001781ac }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, (u32)&func0f1782b8, 0x00000000, menuhandlerMpPause }, { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -2197,7 +2197,7 @@ struct menu_item menuitems_18c18[] = { { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, 0x000056b7, 0x00000000, &menudialog_controloptions }, // "Control" { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, 0x000056b8, 0x00000000, &menudialog_displayoptionsshort }, // "Display" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000064, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, (u32)&func0f1782b8, 0x00000000, menuhandler001781ac }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, (u32)&func0f1782b8, 0x00000000, menuhandlerMpPause }, { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; diff --git a/src/setup/setup_020df0.c b/src/setup/setup_020df0.c index 4f4138bca..f8e66a83b 100644 --- a/src/setup/setup_020df0.c +++ b/src/setup/setup_020df0.c @@ -10025,7 +10025,7 @@ struct menu_item menuitems_2a6cc[] = { { MENUITEMTYPE_LABEL, 2, 0x00000200, 0x000054a4, (u32)&func0f178050, menuhandlerMpInGameLimitLabel }, // "Team Score Limit:" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000082, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, 0x00000000, 0x0000511e, (u32)&func0f1782f8, NULL }, // "Game Time:" - { MENUITEMTYPE_SELECTABLE, 1, 0x00000020, (u32)&func0f1782b8, 0x00000000, menuhandler001781ac }, + { MENUITEMTYPE_SELECTABLE, 1, 0x00000020, (u32)&func0f1782b8, 0x00000000, menuhandlerMpPause }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000024, 0x0000511f, 0x00000000, &menudialog_mpendgame }, // "End Game" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, };