summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nfp/nfp.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp
index ebb98144f..1e038645f 100644
--- a/src/core/hle/service/nfp/nfp.cpp
+++ b/src/core/hle/service/nfp/nfp.cpp
@@ -5,6 +5,7 @@
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h" 6#include "core/hle/ipc_helpers.h"
7#include "core/hle/kernel/event.h" 7#include "core/hle/kernel/event.h"
8#include "core/hle/service/hid/hid.h"
8#include "core/hle/service/nfp/nfp.h" 9#include "core/hle/service/nfp/nfp.h"
9#include "core/hle/service/nfp/nfp_user.h" 10#include "core/hle/service/nfp/nfp_user.h"
10 11
@@ -70,10 +71,16 @@ private:
70 } 71 }
71 72
72 void ListDevices(Kernel::HLERequestContext& ctx) { 73 void ListDevices(Kernel::HLERequestContext& ctx) {
73 NGLOG_WARNING(Service_NFP, "(STUBBED) called"); 74 IPC::RequestParser rp{ctx};
75 const u32 array_size = rp.Pop<u32>();
76
77 ctx.WriteBuffer(&device_handle, sizeof(device_handle));
78
79 NGLOG_WARNING(Service_NFP, "(STUBBED) called, array_size={}", array_size);
80
74 IPC::ResponseBuilder rb{ctx, 3}; 81 IPC::ResponseBuilder rb{ctx, 3};
75 rb.Push(RESULT_SUCCESS); 82 rb.Push(RESULT_SUCCESS);
76 rb.Push<u32>(0); 83 rb.Push<u32>(1);
77 } 84 }
78 85
79 void AttachActivateEvent(Kernel::HLERequestContext& ctx) { 86 void AttachActivateEvent(Kernel::HLERequestContext& ctx) {
@@ -105,12 +112,17 @@ private:
105 } 112 }
106 113
107 void GetNpadId(Kernel::HLERequestContext& ctx) { 114 void GetNpadId(Kernel::HLERequestContext& ctx) {
108 NGLOG_WARNING(Service_NFP, "(STUBBED) called"); 115 IPC::RequestParser rp{ctx};
116 const u64 dev_handle = rp.Pop<u64>();
117
118 NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle);
109 IPC::ResponseBuilder rb{ctx, 3}; 119 IPC::ResponseBuilder rb{ctx, 3};
110 rb.Push(RESULT_SUCCESS); 120 rb.Push(RESULT_SUCCESS);
111 rb.Push<u32>(0); 121 rb.Push<u32>(npad_id);
112 } 122 }
113 123
124 const u64 device_handle{0xDEAD};
125 const HID::ControllerID npad_id{HID::Controller_Player1};
114 State state{State::NonInitialized}; 126 State state{State::NonInitialized};
115 DeviceState device_state{DeviceState::Initialized}; 127 DeviceState device_state{DeviceState::Initialized};
116 Kernel::SharedPtr<Kernel::Event> activate_event; 128 Kernel::SharedPtr<Kernel::Event> activate_event;