[Xbox] kXNotification Additions

- Discovered new unknown kXNotificationID use by XNotifyBroadcast together and wanted to record them before I forget them.
- Changed kXNotificationID  to kXNotification
- Added kXNotificationSystemPXLiveSystemUpdate
This commit is contained in:
The-Little-Wolf
2024-12-30 19:12:42 -08:00
committed by Radosław Gliński
parent b757601f01
commit 95df198d8a
9 changed files with 88 additions and 70 deletions

View File

@@ -867,11 +867,11 @@ void KernelState::RegisterNotifyListener(XNotifyListener* listener) {
if (!has_notified_startup_ && listener->mask() & kXNotifySystem) {
has_notified_startup_ = true;
// XN_SYS_UI (on, off)
listener->EnqueueNotification(kXNotificationIDSystemUI, 1);
listener->EnqueueNotification(kXNotificationIDSystemUI, 0);
listener->EnqueueNotification(kXNotificationSystemUI, 1);
listener->EnqueueNotification(kXNotificationSystemUI, 0);
// XN_SYS_SIGNINCHANGED x2
listener->EnqueueNotification(kXNotificationIDSystemSignInChanged, 1);
listener->EnqueueNotification(kXNotificationIDSystemSignInChanged, 1);
listener->EnqueueNotification(kXNotificationSystemSignInChanged, 1);
listener->EnqueueNotification(kXNotificationSystemSignInChanged, 1);
}
}

View File

@@ -108,7 +108,7 @@ X_HRESULT XmpApp::XMPPlayTitlePlaylist(uint32_t playlist_handle,
XELOGD("XMPPlayTitlePlaylist({:08X}, {:08X})", playlist_handle, song_handle);
kernel_state_->emulator()->audio_media_player()->Play(playlist_handle,
song_handle, false);
kernel_state_->BroadcastNotification(kNotificationXmpPlaybackBehaviorChanged,
kernel_state_->BroadcastNotification(kXNotificationXmpPlaybackBehaviorChanged,
1);
return X_E_SUCCESS;
}
@@ -214,7 +214,7 @@ X_HRESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
static_cast<PlaybackFlags>(uint32_t(args->flags)));
kernel_state_->BroadcastNotification(
kNotificationXmpPlaybackBehaviorChanged, 0);
kXNotificationXmpPlaybackBehaviorChanged, 0);
return X_E_SUCCESS;
}
case 0x00070009: {
@@ -359,7 +359,7 @@ X_HRESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
PlaybackClient(uint32_t(args->playback_client)));
kernel_state_->BroadcastNotification(
kNotificationXmpPlaybackControllerChanged,
kXNotificationXmpPlaybackControllerChanged,
kernel_state_->emulator()
->audio_media_player()
->IsTitleInPlaybackControl());

View File

@@ -324,7 +324,7 @@ void ProfileManager::Login(const uint64_t xuid, const uint8_t user_index,
}
if (notify) {
kernel_state_->BroadcastNotification(kXNotificationIDSystemSignInChanged,
kernel_state_->BroadcastNotification(kXNotificationSystemSignInChanged,
GetUsedUserSlots().to_ulong());
}
UpdateConfig(xuid, assigned_user_slot);
@@ -338,7 +338,7 @@ void ProfileManager::Logout(const uint8_t user_index, bool notify) {
DismountProfile(profile->second->xuid());
logged_profiles_.erase(profile);
if (notify) {
kernel_state_->BroadcastNotification(kXNotificationIDSystemSignInChanged,
kernel_state_->BroadcastNotification(kXNotificationSystemSignInChanged,
GetUsedUserSlots().to_ulong());
}
UpdateConfig(0, user_index);
@@ -352,7 +352,7 @@ void ProfileManager::LoginMultiple(
slots_mask |= (1 << slot);
}
kernel_state_->BroadcastNotification(kXNotificationIDSystemSignInChanged,
kernel_state_->BroadcastNotification(kXNotificationSystemSignInChanged,
slots_mask);
}

View File

@@ -85,7 +85,7 @@ X_RESULT xeXamDispatchDialog(T* dialog,
std::function<X_RESULT(T*)> close_callback,
uint32_t overlapped) {
auto pre = []() {
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, true);
};
auto run = [dialog, close_callback]() -> X_RESULT {
X_RESULT result;
@@ -108,7 +108,7 @@ X_RESULT xeXamDispatchDialog(T* dialog,
};
auto post = []() {
xe::threading::Sleep(std::chrono::milliseconds(100));
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, false);
};
if (!overlapped) {
pre();
@@ -126,7 +126,7 @@ X_RESULT xeXamDispatchDialogEx(
T* dialog, std::function<X_RESULT(T*, uint32_t&, uint32_t&)> close_callback,
uint32_t overlapped) {
auto pre = []() {
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, true);
};
auto run = [dialog, close_callback](uint32_t& extended_error,
uint32_t& length) -> X_RESULT {
@@ -150,7 +150,7 @@ X_RESULT xeXamDispatchDialogEx(
};
auto post = []() {
xe::threading::Sleep(std::chrono::milliseconds(100));
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, false);
};
if (!overlapped) {
pre();
@@ -168,11 +168,11 @@ X_RESULT xeXamDispatchDialogEx(
X_RESULT xeXamDispatchHeadless(std::function<X_RESULT()> run_callback,
uint32_t overlapped) {
auto pre = []() {
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, true);
};
auto post = []() {
xe::threading::Sleep(std::chrono::milliseconds(100));
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, false);
};
if (!overlapped) {
pre();
@@ -190,11 +190,11 @@ X_RESULT xeXamDispatchHeadlessEx(
std::function<X_RESULT(uint32_t&, uint32_t&)> run_callback,
uint32_t overlapped) {
auto pre = []() {
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, true);
};
auto post = []() {
xe::threading::Sleep(std::chrono::milliseconds(100));
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, false);
};
if (!overlapped) {
pre();
@@ -213,7 +213,7 @@ X_RESULT xeXamDispatchHeadlessEx(
template <typename T>
X_RESULT xeXamDispatchDialogAsync(T* dialog,
std::function<void(T*)> close_callback) {
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, true);
++xam_dialogs_shown_;
// Important to pass captured vars by value here since we return from this
@@ -226,7 +226,7 @@ X_RESULT xeXamDispatchDialogAsync(T* dialog,
auto run = []() -> void {
xe::threading::Sleep(std::chrono::milliseconds(100));
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, false);
};
std::thread thread(run);
@@ -237,7 +237,7 @@ X_RESULT xeXamDispatchDialogAsync(T* dialog,
}
X_RESULT xeXamDispatchHeadlessAsync(std::function<void()> run_callback) {
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, true);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, true);
++xam_dialogs_shown_;
auto display_window = kernel_state()->emulator()->display_window();
@@ -248,7 +248,7 @@ X_RESULT xeXamDispatchHeadlessAsync(std::function<void()> run_callback) {
auto run = []() -> void {
xe::threading::Sleep(std::chrono::milliseconds(100));
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, false);
kernel_state()->BroadcastNotification(kXNotificationSystemUI, false);
};
std::thread thread(run);
@@ -1295,7 +1295,7 @@ X_HRESULT xeXShowMarketplaceUIEx(dword_t user_index, dword_t ui_type,
cvars::license_mask = 1;
kernel_state()->BroadcastNotification(
kXNotificationIDLiveContentInstalled, 0);
kXNotificationLiveContentInstalled, 0);
}
}
};