mirror of
https://github.com/xenia-project/xenia.git
synced 2025-12-06 07:12:03 +01:00
[Code style] Changed hard-written system and app notification ID's to enum
This commit is contained in:
parent
f6b5424a9f
commit
1fb5333dbe
|
|
@ -657,17 +657,19 @@ void KernelState::RegisterNotifyListener(XNotifyListener* listener) {
|
|||
if (!has_notified_startup_ && listener->mask() & 0x00000001) {
|
||||
has_notified_startup_ = true;
|
||||
// XN_SYS_UI (on, off)
|
||||
listener->EnqueueNotification(0x00000009, 1);
|
||||
listener->EnqueueNotification(0x00000009, 0);
|
||||
listener->EnqueueNotification(kXNotificationIDSystemUI, 1);
|
||||
listener->EnqueueNotification(kXNotificationIDSystemUI, 0);
|
||||
// XN_SYS_SIGNINCHANGED x2
|
||||
listener->EnqueueNotification(0x0000000A, 1);
|
||||
listener->EnqueueNotification(0x0000000A, 1);
|
||||
listener->EnqueueNotification(kXNotificationIDSystemSignInChanged, 1);
|
||||
listener->EnqueueNotification(kXNotificationIDSystemSignInChanged, 1);
|
||||
// XN_SYS_INPUTDEVICESCHANGED x2
|
||||
listener->EnqueueNotification(0x00000012, 0);
|
||||
listener->EnqueueNotification(0x00000012, 0);
|
||||
listener->EnqueueNotification(kXNotificationIDSystemSignInChanged, 0);
|
||||
listener->EnqueueNotification(kXNotificationIDSystemSignInChanged, 0);
|
||||
// XN_SYS_INPUTDEVICECONFIGCHANGED x2
|
||||
listener->EnqueueNotification(0x00000013, 0);
|
||||
listener->EnqueueNotification(0x00000013, 0);
|
||||
listener->EnqueueNotification(
|
||||
kXNotificationIDSystemInputDeviceConfigChanged, 0);
|
||||
listener->EnqueueNotification(
|
||||
kXNotificationIDSystemInputDeviceConfigChanged, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -239,6 +239,13 @@ class KernelState {
|
|||
friend class XObject;
|
||||
};
|
||||
|
||||
enum : XNotificationID {
|
||||
kXNotificationIDSystemUI = 0x00000009,
|
||||
kXNotificationIDSystemSignInChanged = 0x0000000A,
|
||||
kXNotificationIDSystemInputDevicesChanged = 0x00000012,
|
||||
kXNotificationIDSystemInputDeviceConfigChanged = 0x00000013,
|
||||
};
|
||||
|
||||
} // namespace kernel
|
||||
} // namespace xe
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,8 @@ X_HRESULT XmpApp::XMPPlayTitlePlaylist(uint32_t playlist_handle,
|
|||
active_song_index_ = 0;
|
||||
state_ = State::kPlaying;
|
||||
OnStateChanged();
|
||||
kernel_state_->BroadcastNotification(kMsgPlaybackBehaviorChanged, 1);
|
||||
kernel_state_->
|
||||
BroadcastNotification(kNotificationPlaybackBehaviorChanged, 1);
|
||||
return X_E_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +203,7 @@ X_HRESULT XmpApp::XMPPrevious() {
|
|||
}
|
||||
|
||||
void XmpApp::OnStateChanged() {
|
||||
kernel_state_->BroadcastNotification(kMsgStateChanged,
|
||||
kernel_state_->BroadcastNotification(kNotificationStateChanged,
|
||||
static_cast<uint32_t>(state_));
|
||||
}
|
||||
|
||||
|
|
@ -270,7 +271,8 @@ X_HRESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
|
|||
playback_mode_ = static_cast<PlaybackMode>(uint32_t(args->playback_mode));
|
||||
repeat_mode_ = static_cast<RepeatMode>(uint32_t(args->repeat_mode));
|
||||
unknown_flags_ = args->flags;
|
||||
kernel_state_->BroadcastNotification(kMsgPlaybackBehaviorChanged, 0);
|
||||
kernel_state_->
|
||||
BroadcastNotification(kNotificationPlaybackBehaviorChanged, 0);
|
||||
return X_E_SUCCESS;
|
||||
}
|
||||
case 0x00070009: {
|
||||
|
|
@ -405,7 +407,8 @@ X_HRESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
|
|||
uint32_t(args->controller), uint32_t(args->playback_client));
|
||||
|
||||
playback_client_ = PlaybackClient(uint32_t(args->playback_client));
|
||||
kernel_state_->BroadcastNotification(kMsgPlaybackControllerChanged,
|
||||
kernel_state_->BroadcastNotification(
|
||||
kNotificationPlaybackControllerChanged,
|
||||
!args->playback_client);
|
||||
return X_E_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,11 @@ class XmpApp : public App {
|
|||
// kNoRepeat = ?,
|
||||
kUnknown = 0,
|
||||
};
|
||||
enum : XNotificationID {
|
||||
kNotificationStateChanged = 0x0A000001,
|
||||
kNotificationPlaybackBehaviorChanged = 0x0A000002,
|
||||
kNotificationPlaybackControllerChanged = 0x0A000003,
|
||||
};
|
||||
struct Song {
|
||||
enum class Format : uint32_t {
|
||||
kWma = 0,
|
||||
|
|
@ -92,10 +97,6 @@ class XmpApp : public App {
|
|||
uint32_t buffer_length) override;
|
||||
|
||||
private:
|
||||
static const uint32_t kMsgStateChanged = 0x0A000001;
|
||||
static const uint32_t kMsgPlaybackBehaviorChanged = 0x0A000002;
|
||||
static const uint32_t kMsgPlaybackControllerChanged = 0x0A000003;
|
||||
|
||||
void OnStateChanged();
|
||||
|
||||
State state_;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,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;
|
||||
|
|
@ -95,7 +95,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();
|
||||
|
|
@ -114,7 +114,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 {
|
||||
|
|
@ -139,7 +139,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();
|
||||
|
|
@ -158,12 +158,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();
|
||||
|
|
@ -182,12 +182,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();
|
||||
|
|
|
|||
|
|
@ -521,10 +521,10 @@ dword_result_t XamShowSigninUI_entry(dword_t unk, dword_t unk_mask) {
|
|||
// To fix game modes that display a 4 profile signin UI (even if playing
|
||||
// alone):
|
||||
// XN_SYS_SIGNINCHANGED
|
||||
kernel_state()->BroadcastNotification(0x0000000A, 1);
|
||||
kernel_state()->BroadcastNotification(kXNotificationIDSystemSignInChanged, 1);
|
||||
// Games seem to sit and loop until we trigger this notification:
|
||||
// XN_SYS_UI (off)
|
||||
kernel_state()->BroadcastNotification(0x00000009, 0);
|
||||
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, 0);
|
||||
return X_ERROR_SUCCESS;
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamShowSigninUI, kUserProfiles, kStub);
|
||||
|
|
|
|||
Loading…
Reference in a new issue