From bb081dd1d2eae765ac429a29d9260d69c184d647 Mon Sep 17 00:00:00 2001 From: mailwl Date: Mon, 4 Jun 2018 14:43:02 +0300 Subject: Correct function results --- src/core/hle/service/nfp/nfp.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/core') 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 @@ #include "common/logging/log.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/event.h" +#include "core/hle/service/hid/hid.h" #include "core/hle/service/nfp/nfp.h" #include "core/hle/service/nfp/nfp_user.h" @@ -70,10 +71,16 @@ private: } void ListDevices(Kernel::HLERequestContext& ctx) { - NGLOG_WARNING(Service_NFP, "(STUBBED) called"); + IPC::RequestParser rp{ctx}; + const u32 array_size = rp.Pop(); + + ctx.WriteBuffer(&device_handle, sizeof(device_handle)); + + NGLOG_WARNING(Service_NFP, "(STUBBED) called, array_size={}", array_size); + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(0); + rb.Push(1); } void AttachActivateEvent(Kernel::HLERequestContext& ctx) { @@ -105,12 +112,17 @@ private: } void GetNpadId(Kernel::HLERequestContext& ctx) { - NGLOG_WARNING(Service_NFP, "(STUBBED) called"); + IPC::RequestParser rp{ctx}; + const u64 dev_handle = rp.Pop(); + + NGLOG_WARNING(Service_NFP, "(STUBBED) called, dev_handle=0x{:X}", dev_handle); IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(0); + rb.Push(npad_id); } + const u64 device_handle{0xDEAD}; + const HID::ControllerID npad_id{HID::Controller_Player1}; State state{State::NonInitialized}; DeviceState device_state{DeviceState::Initialized}; Kernel::SharedPtr activate_event; -- cgit v1.2.3