From 7f62e8a86d2964eb55af25d273dda0af6d1f0546 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Tue, 2 Jun 2015 22:12:00 -0700 Subject: [PATCH] Fixing notification dequeing. --- src/xenia/kernel/apps/xmp_app.cc | 1 + src/xenia/kernel/objects/xnotify_listener.cc | 2 +- src/xenia/kernel/xam_notify.cc | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/apps/xmp_app.cc b/src/xenia/kernel/apps/xmp_app.cc index d0d13c0f0..9c9d309b8 100644 --- a/src/xenia/kernel/apps/xmp_app.cc +++ b/src/xenia/kernel/apps/xmp_app.cc @@ -130,6 +130,7 @@ X_RESULT XXMPApp::XMPPlayTitlePlaylist(uint32_t playlist_handle, active_song_index_ = 0; state_ = State::kPlaying; OnStateChanged(); + kernel_state_->BroadcastNotification(kMsgPlaybackBehaviorChanged, 1); return X_ERROR_SUCCESS; } diff --git a/src/xenia/kernel/objects/xnotify_listener.cc b/src/xenia/kernel/objects/xnotify_listener.cc index b9f1e8da8..70e8367c9 100644 --- a/src/xenia/kernel/objects/xnotify_listener.cc +++ b/src/xenia/kernel/objects/xnotify_listener.cc @@ -77,9 +77,9 @@ bool XNotifyListener::DequeueNotification(XNotificationID id, std::lock_guard lock(lock_); bool dequeued = false; if (notification_count_) { - dequeued = true; auto it = notifications_.find(id); if (it != notifications_.end()) { + dequeued = true; *out_data = it->second; notifications_.erase(it); notification_count_--; diff --git a/src/xenia/kernel/xam_notify.cc b/src/xenia/kernel/xam_notify.cc index 7e6b0d3f4..71b975bcd 100644 --- a/src/xenia/kernel/xam_notify.cc +++ b/src/xenia/kernel/xam_notify.cc @@ -75,6 +75,9 @@ SHIM_CALL XNotifyGetNext_shim(PPCContext* ppc_context, if (dequeued) { SHIM_SET_MEM_32(id_ptr, id); SHIM_SET_MEM_32(param_ptr, param); + } else { + SHIM_SET_MEM_32(id_ptr, 0); + SHIM_SET_MEM_32(param_ptr, 0); } SHIM_SET_RETURN_32(dequeued ? 1 : 0);