Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sceNpUtilCmpNpId #7726

Merged
merged 1 commit into from Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 13 additions & 13 deletions rpcs3/Emu/Cell/Modules/sceNp.cpp
Expand Up @@ -4596,24 +4596,24 @@ error_code sceNpUtilCmpNpId(vm::ptr<SceNpId> id1, vm::ptr<SceNpId> id2)
}

// Unknown what this constant means
// if (id1->reserved[0] != 1 || id2->reserved[0] != 1)
// {
// return SCE_NP_UTIL_ERROR_INVALID_NP_ID;
// }
if (id1->reserved[0] != 1 || id2->reserved[0] != 1)
{
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;
}

// if (id1->unk1[1] != id2->unk1[1])
// {
// // If either is zero they match
// if (id1->opt[4] && id2->opt[4])
// {
// return SCE_NP_UTIL_ERROR_NOT_MATCH;
// }
// }
if (id1->unk1[1] != id2->unk1[1])
{
// If either is zero they match
if (id1->opt[4] && id2->opt[4])
{
return SCE_NP_UTIL_ERROR_NOT_MATCH;
}
}

return CELL_OK;
}
Expand Down
1 change: 1 addition & 0 deletions rpcs3/Emu/NP/np_handler.cpp
Expand Up @@ -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

strcpy_trunc(npid.handle.data, s_npid);
npid.reserved[0] = 1;
}

switch (g_cfg.net.psn_status)
Expand Down