diff --git a/src/xenia/kernel/xam/xam_ui.cc b/src/xenia/kernel/xam/xam_ui.cc index a3871577b..e2e01d015 100644 --- a/src/xenia/kernel/xam/xam_ui.cc +++ b/src/xenia/kernel/xam/xam_ui.cc @@ -111,6 +111,9 @@ dword_result_t XamShowMessageBoxUI(dword_t user_index, lpwstring_t title_ptr, buttons.push_back(button); } + // Broadcast XN_SYS_UI = true + kernel_state()->BroadcastNotification(0x9, true); + uint32_t chosen_button; if (cvars::headless) { // Auto-pick the focused button. @@ -144,6 +147,9 @@ dword_result_t XamShowMessageBoxUI(dword_t user_index, lpwstring_t title_ptr, } *result_ptr = chosen_button; + // Broadcast XN_SYS_UI = false + kernel_state()->BroadcastNotification(0x9, false); + if (overlapped) { kernel_state()->CompleteOverlappedImmediate(overlapped, X_ERROR_SUCCESS); return X_ERROR_IO_PENDING; @@ -232,6 +238,9 @@ dword_result_t XamShowKeyboardUI(dword_t user_index, dword_t flags, return X_ERROR_INVALID_PARAMETER; } + // Broadcast XN_SYS_UI = true + kernel_state()->BroadcastNotification(0x9, true); + if (cvars::headless) { // Redirect default_text back into the buffer. std::memset(buffer, 0, buffer_length * 2); @@ -239,6 +248,9 @@ dword_result_t XamShowKeyboardUI(dword_t user_index, dword_t flags, xe::store_and_swap(buffer, default_text.value()); } + // Broadcast XN_SYS_UI = false + kernel_state()->BroadcastNotification(0x9, false); + if (overlapped) { kernel_state()->CompleteOverlappedImmediate(overlapped, X_ERROR_SUCCESS); return X_ERROR_IO_PENDING; @@ -269,6 +281,9 @@ dword_result_t XamShowKeyboardUI(dword_t user_index, dword_t flags, out_text = out_text.substr(0, buffer_length - 1); xe::store_and_swap(buffer, out_text); + // Broadcast XN_SYS_UI = false + kernel_state()->BroadcastNotification(0x9, false); + if (overlapped) { kernel_state()->CompleteOverlappedImmediate(overlapped, X_ERROR_SUCCESS); return X_ERROR_IO_PENDING; @@ -300,6 +315,10 @@ dword_result_t XamShowDeviceSelectorUI(dword_t user_index, dword_t content_type, break; } + // Broadcast XN_SYS_UI = true followed by XN_SYS_UI = false + kernel_state()->BroadcastNotification(0x9, true); + kernel_state()->BroadcastNotification(0x9, false); + if (overlapped) { kernel_state()->CompleteOverlappedImmediate(overlapped, X_ERROR_SUCCESS); return X_ERROR_IO_PENDING;