Attempt to decompile func0f19b540

This commit is contained in:
Ryan Dwyer
2020-01-05 12:53:49 +10:00
parent 7ecbfac128
commit 17cb46d612
6 changed files with 56 additions and 14 deletions
+1 -1
View File
@@ -7099,7 +7099,7 @@ s32 menuhandlerMpSimulantSlot(u32 operation, struct menu_item *item, s32 *value)
case MENUOP_SET:
g_MenuStack[g_MpPlayerNum].slotindex = item->param;
if ((g_MpSetup.simslots & (1 << (item->param + 4))) == 0) {
if ((g_MpSetup.chrslots & (1 << (item->param + 4))) == 0) {
menuPushDialog(&g_MpAddSimulantMenuDialog);
} else if (var80090af0 == 1) {
menuPushDialog(&menudialog_1b414);
+40
View File
@@ -2155,6 +2155,46 @@ glabel func0f19b540
/* f19b660: 00000000 */ sll $zero,$zero,0x0
);
// Mismatch because it's doing something weird with the chrslots, and also
// writing to negative mpsim offsets. This code below might not be functionally
// identical.
//void func0f19b540(void)
//{
// if (var800acc10 == 5) {
// s32 slot = 0;
// s32 i;
// u32 *ptr;
//
// for (i = 0; i < 4; i++) {
// if (g_MpSetup.chrslots & (1 << i)) {
// g_MpChrs[i].unk9d = 0x80;
// slot++;
// }
// }
//
// g_MpSetup.chrslots &= 0x000f;
// ptr = &var800ac798[slot];
//
// for (i = 0; i != 8; i++) {
// g_MpSimulants[i].unk48 = *(ptr - 1);
//
// if (*(ptr - 1) != 6) {
// g_MpSetup.chrslots |= 1 << (i + 4);
// }
//
// ptr++;
// }
//
// if (g_MpSetup.scenario == MPSCENARIO_KINGOFTHEHILL) {
// g_Vars.mphilltime = 10;
// }
// } else {
// if (!mpIsChallengeComplete(CHALLENGE_UNK64)) {
// g_MpSetup.chrslots &= 0x00ff;
// }
// }
//}
s32 mpGetNumAvailableChallenges(void)
{
s32 challengeindex;