summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfp/nfp_device.cpp
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2022-09-25 05:52:33 +0200
committergerman77 <juangerman-13@hotmail.com>2022-10-02 19:32:26 +0200
commit3ce0ef04ddcb2420b61f8c6d22f8039fb7359856 (patch)
treef2e843da46429df8ae6c1f8f415bc507d3458f28 /src/core/hle/service/nfp/nfp_device.cpp
parentservice: nfp: Rewrite and implement applet calls (diff)
downloadyuzu-3ce0ef04ddcb2420b61f8c6d22f8039fb7359856.tar
yuzu-3ce0ef04ddcb2420b61f8c6d22f8039fb7359856.tar.gz
yuzu-3ce0ef04ddcb2420b61f8c6d22f8039fb7359856.tar.bz2
yuzu-3ce0ef04ddcb2420b61f8c6d22f8039fb7359856.tar.lz
yuzu-3ce0ef04ddcb2420b61f8c6d22f8039fb7359856.tar.xz
yuzu-3ce0ef04ddcb2420b61f8c6d22f8039fb7359856.tar.zst
yuzu-3ce0ef04ddcb2420b61f8c6d22f8039fb7359856.zip
Diffstat (limited to 'src/core/hle/service/nfp/nfp_device.cpp')
-rw-r--r--src/core/hle/service/nfp/nfp_device.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/hle/service/nfp/nfp_device.cpp b/src/core/hle/service/nfp/nfp_device.cpp
index da7daae88..ce3bcccf4 100644
--- a/src/core/hle/service/nfp/nfp_device.cpp
+++ b/src/core/hle/service/nfp/nfp_device.cpp
@@ -42,10 +42,11 @@ NfpDevice::NfpDevice(Core::HID::NpadIdType npad_id_, Core::System& system_,
}
NfpDevice::~NfpDevice() {
- if (is_controller_set) {
- npad_device->DeleteCallback(callback_key);
- is_controller_set = false;
+ if (!is_controller_set) {
+ return;
}
+ npad_device->DeleteCallback(callback_key);
+ is_controller_set = false;
};
void NfpDevice::NpadUpdate(Core::HID::ControllerTriggerType type) {
@@ -453,7 +454,7 @@ Result NfpDevice::SetApplicationArea(const std::vector<u8>& data) {
return ResultSuccess;
}
-Result NfpDevice::CreateApplicationArea(u32 access_id, const std::vector<u8>& data) {
+Result NfpDevice::CreateApplicationArea(u32 access_id, std::span<const u8> data) {
if (device_state != DeviceState::TagMounted) {
LOG_ERROR(Service_NFP, "Wrong device state {}", device_state);
if (device_state == DeviceState::TagRemoved) {
@@ -470,7 +471,7 @@ Result NfpDevice::CreateApplicationArea(u32 access_id, const std::vector<u8>& da
return RecreateApplicationArea(access_id, data);
}
-Result NfpDevice::RecreateApplicationArea(u32 access_id, const std::vector<u8>& data) {
+Result NfpDevice::RecreateApplicationArea(u32 access_id, std::span<const u8> data) {
if (device_state != DeviceState::TagMounted) {
LOG_ERROR(Service_NFP, "Wrong device state {}", device_state);
if (device_state == DeviceState::TagRemoved) {