From e5c8f00e265ccd8874642739385cb5a971b03c1b Mon Sep 17 00:00:00 2001 From: NicknineTheEagle Date: Mon, 17 Jun 2024 09:39:52 +0300 Subject: [PATCH] [Kernel] Fixed XamShowSigninUI --- src/xenia/kernel/xam/xam_user.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index 8b3f0724a..047fbe33a 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -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;