summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-03-15 17:45:55 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2023-03-16 00:01:06 +0100
commit7187732454e7382009e35b4b62d0da16861ec3f8 (patch)
tree2e4650a8e68e6dc82191cc610bd1b53408b7a05e /src
parentservice: nfp: Convert mii colors to v3 (diff)
downloadyuzu-7187732454e7382009e35b4b62d0da16861ec3f8.tar
yuzu-7187732454e7382009e35b4b62d0da16861ec3f8.tar.gz
yuzu-7187732454e7382009e35b4b62d0da16861ec3f8.tar.bz2
yuzu-7187732454e7382009e35b4b62d0da16861ec3f8.tar.lz
yuzu-7187732454e7382009e35b4b62d0da16861ec3f8.tar.xz
yuzu-7187732454e7382009e35b4b62d0da16861ec3f8.tar.zst
yuzu-7187732454e7382009e35b4b62d0da16861ec3f8.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/nfp/nfp_device.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/hle/service/nfp/nfp_device.cpp b/src/core/hle/service/nfp/nfp_device.cpp
index c5d8ceeff..61a7ea7ac 100644
--- a/src/core/hle/service/nfp/nfp_device.cpp
+++ b/src/core/hle/service/nfp/nfp_device.cpp
@@ -685,6 +685,11 @@ Result NfpDevice::RecreateApplicationArea(u32 access_id, std::span<const u8> dat
return WrongDeviceState;
}
+ if (is_app_area_open) {
+ LOG_ERROR(Service_NFP, "Application area is open");
+ return WrongDeviceState;
+ }
+
if (mount_target == MountTarget::None || mount_target == MountTarget::Rom) {
LOG_ERROR(Service_NFP, "Amiibo is read only", device_state);
return WrongDeviceState;
@@ -715,6 +720,7 @@ Result NfpDevice::RecreateApplicationArea(u32 access_id, std::span<const u8> dat
tag_data.settings.settings.appdata_initialized.Assign(1);
tag_data.application_area_id = access_id;
tag_data.unknown = {};
+ tag_data.unknown2 = {};
UpdateRegisterInfoCrc();
@@ -750,6 +756,10 @@ Result NfpDevice::DeleteApplicationArea() {
rng.GenerateRandomBytes(&tag_data.application_id_byte, sizeof(u8));
tag_data.settings.settings.appdata_initialized.Assign(0);
tag_data.unknown = {};
+ tag_data.unknown2 = {};
+ is_app_area_open = false;
+
+ UpdateRegisterInfoCrc();
return Flush();
}