diff options
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/nfp/nfp.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index 1e038645f..2a9f84037 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp | |||
| @@ -41,7 +41,7 @@ public: | |||
| 41 | {20, &IUser::GetDeviceState, "GetDeviceState"}, | 41 | {20, &IUser::GetDeviceState, "GetDeviceState"}, |
| 42 | {21, &IUser::GetNpadId, "GetNpadId"}, | 42 | {21, &IUser::GetNpadId, "GetNpadId"}, |
| 43 | {22, nullptr, "GetApplicationArea2"}, | 43 | {22, nullptr, "GetApplicationArea2"}, |
| 44 | {23, nullptr, "AttachAvailabilityChangeEvent"}, | 44 | {23, &IUser::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, |
| 45 | {24, nullptr, "RecreateApplicationArea"}, | 45 | {24, nullptr, "RecreateApplicationArea"}, |
| 46 | }; | 46 | }; |
| 47 | RegisterHandlers(functions); | 47 | RegisterHandlers(functions); |
| @@ -49,6 +49,8 @@ public: | |||
| 49 | activate_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "IUser:ActivateEvent"); | 49 | activate_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "IUser:ActivateEvent"); |
| 50 | deactivate_event = | 50 | deactivate_event = |
| 51 | Kernel::Event::Create(Kernel::ResetType::OneShot, "IUser:DeactivateEvent"); | 51 | Kernel::Event::Create(Kernel::ResetType::OneShot, "IUser:DeactivateEvent"); |
| 52 | availability_change_event = | ||
| 53 | Kernel::Event::Create(Kernel::ResetType::OneShot, "IUser:AvailabilityChangeEvent"); | ||
| 52 | } | 54 | } |
| 53 | 55 | ||
| 54 | private: | 56 | private: |
| @@ -80,18 +82,24 @@ private: | |||
| 80 | 82 | ||
| 81 | IPC::ResponseBuilder rb{ctx, 3}; | 83 | IPC::ResponseBuilder rb{ctx, 3}; |
| 82 | rb.Push(RESULT_SUCCESS); | 84 | rb.Push(RESULT_SUCCESS); |
| 83 | rb.Push<u32>(1); | 85 | rb.Push<u32>(0); |
| 84 | } | 86 | } |
| 85 | 87 | ||
| 86 | void AttachActivateEvent(Kernel::HLERequestContext& ctx) { | 88 | void AttachActivateEvent(Kernel::HLERequestContext& ctx) { |
| 87 | NGLOG_WARNING(Service_NFP, "(STUBBED) called"); | 89 | IPC::RequestParser rp{ctx}; |
| 90 | const u64 dev_handle = rp.Pop<u64>(); | ||
| 91 | NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); | ||
| 92 | |||
| 88 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 93 | IPC::ResponseBuilder rb{ctx, 2, 1}; |
| 89 | rb.Push(RESULT_SUCCESS); | 94 | rb.Push(RESULT_SUCCESS); |
| 90 | rb.PushCopyObjects(activate_event); | 95 | rb.PushCopyObjects(activate_event); |
| 91 | } | 96 | } |
| 92 | 97 | ||
| 93 | void AttachDeactivateEvent(Kernel::HLERequestContext& ctx) { | 98 | void AttachDeactivateEvent(Kernel::HLERequestContext& ctx) { |
| 94 | NGLOG_WARNING(Service_NFP, "(STUBBED) called"); | 99 | IPC::RequestParser rp{ctx}; |
| 100 | const u64 dev_handle = rp.Pop<u64>(); | ||
| 101 | NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); | ||
| 102 | |||
| 95 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 103 | IPC::ResponseBuilder rb{ctx, 2, 1}; |
| 96 | rb.Push(RESULT_SUCCESS); | 104 | rb.Push(RESULT_SUCCESS); |
| 97 | rb.PushCopyObjects(deactivate_event); | 105 | rb.PushCopyObjects(deactivate_event); |
| @@ -114,19 +122,29 @@ private: | |||
| 114 | void GetNpadId(Kernel::HLERequestContext& ctx) { | 122 | void GetNpadId(Kernel::HLERequestContext& ctx) { |
| 115 | IPC::RequestParser rp{ctx}; | 123 | IPC::RequestParser rp{ctx}; |
| 116 | const u64 dev_handle = rp.Pop<u64>(); | 124 | const u64 dev_handle = rp.Pop<u64>(); |
| 117 | |||
| 118 | NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); | 125 | NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); |
| 119 | IPC::ResponseBuilder rb{ctx, 3}; | 126 | IPC::ResponseBuilder rb{ctx, 3}; |
| 120 | rb.Push(RESULT_SUCCESS); | 127 | rb.Push(RESULT_SUCCESS); |
| 121 | rb.Push<u32>(npad_id); | 128 | rb.Push<u32>(npad_id); |
| 122 | } | 129 | } |
| 123 | 130 | ||
| 131 | void AttachAvailabilityChangeEvent(Kernel::HLERequestContext& ctx) { | ||
| 132 | IPC::RequestParser rp{ctx}; | ||
| 133 | const u64 dev_handle = rp.Pop<u64>(); | ||
| 134 | NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); | ||
| 135 | |||
| 136 | IPC::ResponseBuilder rb{ctx, 2, 1}; | ||
| 137 | rb.Push(RESULT_SUCCESS); | ||
| 138 | rb.PushCopyObjects(availability_change_event); | ||
| 139 | } | ||
| 140 | |||
| 124 | const u64 device_handle{0xDEAD}; | 141 | const u64 device_handle{0xDEAD}; |
| 125 | const HID::ControllerID npad_id{HID::Controller_Player1}; | 142 | const HID::ControllerID npad_id{HID::Controller_Player1}; |
| 126 | State state{State::NonInitialized}; | 143 | State state{State::NonInitialized}; |
| 127 | DeviceState device_state{DeviceState::Initialized}; | 144 | DeviceState device_state{DeviceState::Initialized}; |
| 128 | Kernel::SharedPtr<Kernel::Event> activate_event; | 145 | Kernel::SharedPtr<Kernel::Event> activate_event; |
| 129 | Kernel::SharedPtr<Kernel::Event> deactivate_event; | 146 | Kernel::SharedPtr<Kernel::Event> deactivate_event; |
| 147 | Kernel::SharedPtr<Kernel::Event> availability_change_event; | ||
| 130 | }; | 148 | }; |
| 131 | 149 | ||
| 132 | void Module::Interface::CreateUserInterface(Kernel::HLERequestContext& ctx) { | 150 | void Module::Interface::CreateUserInterface(Kernel::HLERequestContext& ctx) { |