Fix sceNpUtilCmpNpId

This commit is contained in:
Eladash 2020-03-06 19:56:33 +02:00 committed by Ivan
parent 8214425a3c
commit 5692c3de04
2 changed files with 14 additions and 13 deletions

View File

@ -4596,24 +4596,24 @@ error_code sceNpUtilCmpNpId(vm::ptr<SceNpId> id1, vm::ptr<SceNpId> id2)
} }
// Unknown what this constant means // Unknown what this constant means
// if (id1->reserved[0] != 1 || id2->reserved[0] != 1) if (id1->reserved[0] != 1 || id2->reserved[0] != 1)
// { {
// return SCE_NP_UTIL_ERROR_INVALID_NP_ID; return SCE_NP_UTIL_ERROR_INVALID_NP_ID;
// } }
if (strcmp(id1->handle.data, id2->handle.data))// || id1->unk1[0] != id2->unk1[0]) if (strncmp(id1->handle.data, id2->handle.data, 16) || id1->unk1[0] != id2->unk1[0])
{ {
return SCE_NP_UTIL_ERROR_NOT_MATCH; return SCE_NP_UTIL_ERROR_NOT_MATCH;
} }
// if (id1->unk1[1] != id2->unk1[1]) if (id1->unk1[1] != id2->unk1[1])
// { {
// // If either is zero they match // If either is zero they match
// if (id1->opt[4] && id2->opt[4]) if (id1->opt[4] && id2->opt[4])
// { {
// return SCE_NP_UTIL_ERROR_NOT_MATCH; return SCE_NP_UTIL_ERROR_NOT_MATCH;
// } }
// } }
return CELL_OK; return CELL_OK;
} }

View File

@ -137,6 +137,7 @@ void np_handler::init_NP(u32 poolsize, vm::ptr<void> poolptr)
ASSERT(s_npid != ""); // It should be generated in settings window if empty ASSERT(s_npid != ""); // It should be generated in settings window if empty
strcpy_trunc(npid.handle.data, s_npid); strcpy_trunc(npid.handle.data, s_npid);
npid.reserved[0] = 1;
} }
switch (g_cfg.net.psn_status) switch (g_cfg.net.psn_status)