[Kernel] Fixed XamShowSigninUI

This commit is contained in:
NicknineTheEagle 2024-06-17 09:39:52 +03:00 committed by Radosław Gliński
parent c004d669c2
commit e5c8f00e26
1 changed files with 10 additions and 3 deletions

View File

@ -542,19 +542,26 @@ dword_result_t XamUserAreUsersFriends_entry(dword_t user_index, dword_t unk1,
}
DECLARE_XAM_EXPORT1(XamUserAreUsersFriends, kUserProfiles, kStub);
dword_result_t XamShowSigninUI_entry(dword_t unk, dword_t unk_mask) {
dword_result_t XamShowSigninUI_entry(dword_t users_needed, dword_t unk_mask) {
// XN_SYS_UI (on)
kernel_state()->BroadcastNotification(0x00000009, 1);
kernel_state()->UpdateUsedUserProfiles();
// Mask values vary. Probably matching user types? Local/remote?
// Games seem to sit and loop until we trigger this notification:
uint32_t user_mask = 0;
uint32_t active_users = 0;
for (uint32_t i = 0; i < 4; i++) {
if (kernel_state()->IsUserSignedIn(i)) {
// XN_SYS_SIGNINCHANGED
kernel_state()->BroadcastNotification(0xA, i);
user_mask |= (1 << i);
active_users++;
if (active_users >= users_needed) break;
}
}
// XN_SYS_SIGNINCHANGED (players)
kernel_state()->BroadcastNotification(0xA, user_mask);
// XN_SYS_UI (off)
kernel_state()->BroadcastNotification(0x00000009, 0);
return X_ERROR_SUCCESS;