diff options
author | mailwl <mailwl@gmail.com> | 2018-06-04 16:51:52 +0200 |
---|---|---|
committer | mailwl <mailwl@gmail.com> | 2018-06-06 18:05:11 +0200 |
commit | 61fbf5c8e61cb62e91a7a50f04cf1df45d7517d5 (patch) | |
tree | 08d8dcc4f7c6ad7b1ed9757fa7e76a75dbb73552 /src/core/hle | |
parent | Correct function results (diff) | |
download | yuzu-61fbf5c8e61cb62e91a7a50f04cf1df45d7517d5.tar yuzu-61fbf5c8e61cb62e91a7a50f04cf1df45d7517d5.tar.gz yuzu-61fbf5c8e61cb62e91a7a50f04cf1df45d7517d5.tar.bz2 yuzu-61fbf5c8e61cb62e91a7a50f04cf1df45d7517d5.tar.lz yuzu-61fbf5c8e61cb62e91a7a50f04cf1df45d7517d5.tar.xz yuzu-61fbf5c8e61cb62e91a7a50f04cf1df45d7517d5.tar.zst yuzu-61fbf5c8e61cb62e91a7a50f04cf1df45d7517d5.zip |
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: {20, &IUser::GetDeviceState, "GetDeviceState"}, {21, &IUser::GetNpadId, "GetNpadId"}, {22, nullptr, "GetApplicationArea2"}, - {23, nullptr, "AttachAvailabilityChangeEvent"}, + {23, &IUser::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"}, {24, nullptr, "RecreateApplicationArea"}, }; RegisterHandlers(functions); @@ -49,6 +49,8 @@ public: activate_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "IUser:ActivateEvent"); deactivate_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "IUser:DeactivateEvent"); + availability_change_event = + Kernel::Event::Create(Kernel::ResetType::OneShot, "IUser:AvailabilityChangeEvent"); } private: @@ -80,18 +82,24 @@ private: IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push<u32>(1); + rb.Push<u32>(0); } void AttachActivateEvent(Kernel::HLERequestContext& ctx) { - NGLOG_WARNING(Service_NFP, "(STUBBED) called"); + IPC::RequestParser rp{ctx}; + const u64 dev_handle = rp.Pop<u64>(); + NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); + IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(activate_event); } void AttachDeactivateEvent(Kernel::HLERequestContext& ctx) { - NGLOG_WARNING(Service_NFP, "(STUBBED) called"); + IPC::RequestParser rp{ctx}; + const u64 dev_handle = rp.Pop<u64>(); + NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); + IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(deactivate_event); @@ -114,19 +122,29 @@ private: void GetNpadId(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const u64 dev_handle = rp.Pop<u64>(); - NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); rb.Push<u32>(npad_id); } + void AttachAvailabilityChangeEvent(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const u64 dev_handle = rp.Pop<u64>(); + NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); + + IPC::ResponseBuilder rb{ctx, 2, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushCopyObjects(availability_change_event); + } + const u64 device_handle{0xDEAD}; const HID::ControllerID npad_id{HID::Controller_Player1}; State state{State::NonInitialized}; DeviceState device_state{DeviceState::Initialized}; Kernel::SharedPtr<Kernel::Event> activate_event; Kernel::SharedPtr<Kernel::Event> deactivate_event; + Kernel::SharedPtr<Kernel::Event> availability_change_event; }; void Module::Interface::CreateUserInterface(Kernel::HLERequestContext& ctx) { |