diff --git a/src/game/game_176d70.c b/src/game/game_176d70.c index f69ff5a13..afd8c3024 100644 --- a/src/game/game_176d70.c +++ b/src/game/game_176d70.c @@ -8377,7 +8377,7 @@ glabel menuhandler0017e4d4 /* f17e534: 00001025 */ or $v0,$zero,$zero /* f17e538: 1000011c */ beqz $zero,.L0f17e9ac /* f17e53c: 24020001 */ addiu $v0,$zero,0x1 -/* f17e540: 0fc66d99 */ jal func0f19b664 +/* f17e540: 0fc66d99 */ jal mpGetNumAvailableChallenges /* f17e544: 00000000 */ sll $zero,$zero,0x0 /* f17e548: 10000117 */ beqz $zero,.L0f17e9a8 /* f17e54c: aec20000 */ sw $v0,0x0($s6) diff --git a/src/game/game_1999b0.c b/src/game/game_1999b0.c index c280f4f20..b1845f2d8 100644 --- a/src/game/game_1999b0.c +++ b/src/game/game_1999b0.c @@ -2155,33 +2155,19 @@ glabel func0f19b540 /* f19b660: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel func0f19b664 -/* f19b664: 27bdffd8 */ addiu $sp,$sp,-40 -/* f19b668: afb20020 */ sw $s2,0x20($sp) -/* f19b66c: afb1001c */ sw $s1,0x1c($sp) -/* f19b670: afb00018 */ sw $s0,0x18($sp) -/* f19b674: afbf0024 */ sw $ra,0x24($sp) -/* f19b678: 00008825 */ or $s1,$zero,$zero -/* f19b67c: 00008025 */ or $s0,$zero,$zero -/* f19b680: 2412001e */ addiu $s2,$zero,0x1e -.L0f19b684: -/* f19b684: 0fc66be6 */ jal mpIsChallengeAvailable -/* f19b688: 02002025 */ or $a0,$s0,$zero -/* f19b68c: 10400002 */ beqz $v0,.L0f19b698 -/* f19b690: 26100001 */ addiu $s0,$s0,0x1 -/* f19b694: 26310001 */ addiu $s1,$s1,0x1 -.L0f19b698: -/* f19b698: 1612fffa */ bne $s0,$s2,.L0f19b684 -/* f19b69c: 00000000 */ sll $zero,$zero,0x0 -/* f19b6a0: 8fbf0024 */ lw $ra,0x24($sp) -/* f19b6a4: 02201025 */ or $v0,$s1,$zero -/* f19b6a8: 8fb1001c */ lw $s1,0x1c($sp) -/* f19b6ac: 8fb00018 */ lw $s0,0x18($sp) -/* f19b6b0: 8fb20020 */ lw $s2,0x20($sp) -/* f19b6b4: 03e00008 */ jr $ra -/* f19b6b8: 27bd0028 */ addiu $sp,$sp,0x28 -); +s32 mpGetNumAvailableChallenges(void) +{ + s32 challengeindex; + s32 count = 0; + + for (challengeindex = 0; challengeindex != 30; challengeindex++) { + if (mpIsChallengeAvailable(challengeindex)) { + count++; + } + } + + return count; +} char *mpChallengeGetName(s32 challengeindex) { diff --git a/src/include/game/game_1999b0.h b/src/include/game/game_1999b0.h index d5ddb6987..aa52142b6 100644 --- a/src/include/game/game_1999b0.h +++ b/src/include/game/game_1999b0.h @@ -28,7 +28,7 @@ u32 func0f19af3c(void); bool mpIsChallengeAvailable(s32 challengeindex); void func0f19afdc(void); u32 func0f19b540(void); -u32 func0f19b664(void); +s32 mpGetNumAvailableChallenges(void); char *mpChallengeGetName(s32 challengeindex); u32 func0f19b6f8(void); void mpSetCurrentChallenge(s32 slotnum);