From 3d24eb54ec8303c093dbd34b766c5e420fafcf83 Mon Sep 17 00:00:00 2001 From: german77 Date: Tue, 15 Jun 2021 23:58:08 -0500 Subject: nfp: Sort functions by command number --- src/core/hle/service/nfp/nfp.cpp | 158 +++++++++++++++++++-------------------- 1 file changed, 79 insertions(+), 79 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index 761d0d3c6..e8d3a6b53 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -120,12 +120,13 @@ private: state = State::Initialized; } - void GetState(Kernel::HLERequestContext& ctx) { - LOG_DEBUG(Service_NFC, "called"); + void Finalize(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_NFP, "called"); - IPC::ResponseBuilder rb{ctx, 3, 0}; + device_state = DeviceState::Finalized; + + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); - rb.PushRaw(static_cast(state)); } void ListDevices(Kernel::HLERequestContext& ctx) { @@ -140,35 +141,14 @@ private: rb.Push(1); } - void GetNpadId(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const u64 dev_handle = rp.Pop(); - LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); - - IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(ResultSuccess); - rb.Push(npad_id); - } - - void AttachActivateEvent(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const u64 dev_handle = rp.Pop(); - LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); - - IPC::ResponseBuilder rb{ctx, 2, 1}; - rb.Push(ResultSuccess); - rb.PushCopyObjects(nfp_interface.GetNFCEvent()); - has_attached_handle = true; - } - - void AttachDeactivateEvent(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const u64 dev_handle = rp.Pop(); - LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); + void StartDetection(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_NFP, "called"); - IPC::ResponseBuilder rb{ctx, 2, 1}; + if (device_state == DeviceState::Initialized || device_state == DeviceState::TagRemoved) { + device_state = DeviceState::SearchingForTag; + } + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); - rb.PushCopyObjects(deactivate_event->GetReadableEvent()); } void StopDetection(Kernel::HLERequestContext& ctx) { @@ -191,22 +171,37 @@ private: rb.Push(ResultSuccess); } - void GetDeviceState(Kernel::HLERequestContext& ctx) { + void Mount(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_NFP, "called"); - IPC::ResponseBuilder rb{ctx, 3}; + device_state = DeviceState::TagNearby; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); - rb.Push(static_cast(device_state)); } - void StartDetection(Kernel::HLERequestContext& ctx) { + void Unmount(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_NFP, "called"); - if (device_state == DeviceState::Initialized || device_state == DeviceState::TagRemoved) { - device_state = DeviceState::SearchingForTag; - } + device_state = DeviceState::TagFound; + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } + + void OpenApplicationArea(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_NFP, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ErrCodes::ERR_NO_APPLICATION_AREA); + } + + void GetApplicationArea(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_NFP, "(STUBBED) called"); + + // TODO(ogniK): Pull application area from amiibo + + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(ResultSuccess); + rb.PushRaw(0); // This is from the GetCommonInfo stub } void GetTagInfo(Kernel::HLERequestContext& ctx) { @@ -226,75 +221,82 @@ private: rb.Push(ResultSuccess); } - void Mount(Kernel::HLERequestContext& ctx) { - LOG_DEBUG(Service_NFP, "called"); - - device_state = DeviceState::TagNearby; - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } + void GetRegisterInfo(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_NFP, "(STUBBED) called"); - void GetModelInfo(Kernel::HLERequestContext& ctx) { - LOG_DEBUG(Service_NFP, "called"); + // TODO(ogniK): Pull Mii and owner data from amiibo IPC::ResponseBuilder rb{ctx, 2}; - const auto& amiibo = nfp_interface.GetAmiiboBuffer(); - ctx.WriteBuffer(amiibo.model_info); rb.Push(ResultSuccess); } - void Unmount(Kernel::HLERequestContext& ctx) { - LOG_DEBUG(Service_NFP, "called"); + void GetCommonInfo(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_NFP, "(STUBBED) called"); - device_state = DeviceState::TagFound; + // TODO(ogniK): Pull common information from amiibo + + CommonInfo common_info{}; + common_info.application_area_size = 0; + ctx.WriteBuffer(common_info); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } - void Finalize(Kernel::HLERequestContext& ctx) { + void GetModelInfo(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_NFP, "called"); - device_state = DeviceState::Finalized; - IPC::ResponseBuilder rb{ctx, 2}; + const auto& amiibo = nfp_interface.GetAmiiboBuffer(); + ctx.WriteBuffer(amiibo.model_info); rb.Push(ResultSuccess); } - void AttachAvailabilityChangeEvent(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_NFP, "(STUBBED) called"); + void AttachActivateEvent(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const u64 dev_handle = rp.Pop(); + LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(ResultSuccess); - rb.PushCopyObjects(availability_change_event->GetReadableEvent()); + rb.PushCopyObjects(nfp_interface.GetNFCEvent()); + has_attached_handle = true; } - void GetRegisterInfo(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_NFP, "(STUBBED) called"); - - // TODO(ogniK): Pull Mii and owner data from amiibo + void AttachDeactivateEvent(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const u64 dev_handle = rp.Pop(); + LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); - IPC::ResponseBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(ResultSuccess); + rb.PushCopyObjects(deactivate_event.GetReadableEvent()); } - void GetCommonInfo(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_NFP, "(STUBBED) called"); + void GetState(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_NFC, "called"); - // TODO(ogniK): Pull common information from amiibo + IPC::ResponseBuilder rb{ctx, 3, 0}; + rb.Push(ResultSuccess); + rb.PushRaw(static_cast(state)); + } - CommonInfo common_info{}; - common_info.application_area_size = 0; - ctx.WriteBuffer(common_info); + void GetDeviceState(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_NFP, "called"); - IPC::ResponseBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(ResultSuccess); + rb.Push(static_cast(device_state)); } - void OpenApplicationArea(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_NFP, "(STUBBED) called"); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ErrCodes::ERR_NO_APPLICATION_AREA); + void GetNpadId(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const u64 dev_handle = rp.Pop(); + LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(npad_id); } void GetApplicationAreaSize(Kernel::HLERequestContext& ctx) { @@ -305,14 +307,12 @@ private: rb.PushRaw(0); // This is from the GetCommonInfo stub } - void GetApplicationArea(Kernel::HLERequestContext& ctx) { + void AttachAvailabilityChangeEvent(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_NFP, "(STUBBED) called"); - // TODO(ogniK): Pull application area from amiibo - - IPC::ResponseBuilder rb{ctx, 3}; + IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(ResultSuccess); - rb.PushRaw(0); // This is from the GetCommonInfo stub + rb.PushCopyObjects(availability_change_event.GetReadableEvent()); } Module::Interface& nfp_interface; -- cgit v1.2.3