[Kernel] Notification ID Changes

Based off of pull request  xenia-project#2047. Convert magic numbers numbers to enum to improve readability. Includes currently unused one for future use.
This commit is contained in:
The-Little-Wolf
2024-08-28 13:13:08 -07:00
committed by Radosław Gliński
parent 5f5be06680
commit 0deafaf9f9
6 changed files with 90 additions and 34 deletions

View File

@@ -79,7 +79,7 @@ X_RESULT xeXamDispatchDialog(T* dialog,
uint32_t overlapped) {
auto pre = []() {
// Broadcast XN_SYS_UI = true
kernel_state()->BroadcastNotification(0x9, true);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
};
auto run = [dialog, close_callback]() -> X_RESULT {
X_RESULT result;
@@ -103,7 +103,7 @@ X_RESULT xeXamDispatchDialog(T* dialog,
auto post = []() {
xe::threading::Sleep(std::chrono::milliseconds(100));
// Broadcast XN_SYS_UI = false
kernel_state()->BroadcastNotification(0x9, false);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
};
if (!overlapped) {
pre();
@@ -122,7 +122,7 @@ X_RESULT xeXamDispatchDialogEx(
uint32_t overlapped) {
auto pre = []() {
// Broadcast XN_SYS_UI = true
kernel_state()->BroadcastNotification(0x9, true);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
};
auto run = [dialog, close_callback](uint32_t& extended_error,
uint32_t& length) -> X_RESULT {
@@ -147,7 +147,7 @@ X_RESULT xeXamDispatchDialogEx(
auto post = []() {
xe::threading::Sleep(std::chrono::milliseconds(100));
// Broadcast XN_SYS_UI = false
kernel_state()->BroadcastNotification(0x9, false);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
};
if (!overlapped) {
pre();
@@ -166,12 +166,12 @@ X_RESULT xeXamDispatchHeadless(std::function<X_RESULT()> run_callback,
uint32_t overlapped) {
auto pre = []() {
// Broadcast XN_SYS_UI = true
kernel_state()->BroadcastNotification(0x9, true);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
};
auto post = []() {
xe::threading::Sleep(std::chrono::milliseconds(100));
// Broadcast XN_SYS_UI = false
kernel_state()->BroadcastNotification(0x9, false);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
};
if (!overlapped) {
pre();
@@ -190,12 +190,12 @@ X_RESULT xeXamDispatchHeadlessEx(
uint32_t overlapped) {
auto pre = []() {
// Broadcast XN_SYS_UI = true
kernel_state()->BroadcastNotification(0x9, true);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
};
auto post = []() {
xe::threading::Sleep(std::chrono::milliseconds(100));
// Broadcast XN_SYS_UI = false
kernel_state()->BroadcastNotification(0x9, false);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
};
if (!overlapped) {
pre();
@@ -215,7 +215,7 @@ template <typename T>
X_RESULT xeXamDispatchDialogAsync(T* dialog,
std::function<void(T*)> close_callback) {
// Broadcast XN_SYS_UI = true
kernel_state()->BroadcastNotification(0x9, true);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
++xam_dialogs_shown_;
// Important to pass captured vars by value here since we return from this
@@ -229,7 +229,7 @@ X_RESULT xeXamDispatchDialogAsync(T* dialog,
xe::threading::Sleep(std::chrono::milliseconds(100));
// Broadcast XN_SYS_UI = false
kernel_state()->BroadcastNotification(0x9, false);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
});
return X_ERROR_SUCCESS;
@@ -237,7 +237,7 @@ X_RESULT xeXamDispatchDialogAsync(T* dialog,
X_RESULT xeXamDispatchHeadlessAsync(std::function<void()> run_callback) {
// Broadcast XN_SYS_UI = true
kernel_state()->BroadcastNotification(0x9, true);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
++xam_dialogs_shown_;
auto display_window = kernel_state()->emulator()->display_window();
@@ -248,7 +248,7 @@ X_RESULT xeXamDispatchHeadlessAsync(std::function<void()> run_callback) {
xe::threading::Sleep(std::chrono::milliseconds(100));
// Broadcast XN_SYS_UI = false
kernel_state()->BroadcastNotification(0x9, false);
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
});
return X_ERROR_SUCCESS;
@@ -696,8 +696,8 @@ dword_result_t XamShowMarketplaceUI_entry(dword_t user_index, dword_t ui_type,
if (button == 0) {
cvars::license_mask = 1;
// XN_LIVE_CONTENT_INSTALLED
kernel_state()->BroadcastNotification(0x2000007, 0);
kernel_state()->BroadcastNotification(
kXNotificationIDLiveContentInstalled, 0);
}
}
};