diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-01-19 03:18:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-19 03:18:27 +0100 |
commit | 4f04bd369787b351deb8b24dacae77e7dd5e3fb7 (patch) | |
tree | dadaec000147dd263e16c5a7e047dbc7072376c8 | |
parent | Merge pull request #12644 from liamwhite/vkspec-image-offset (diff) | |
parent | service: nfc: Create backup when none exist (diff) | |
download | yuzu-4f04bd369787b351deb8b24dacae77e7dd5e3fb7.tar yuzu-4f04bd369787b351deb8b24dacae77e7dd5e3fb7.tar.gz yuzu-4f04bd369787b351deb8b24dacae77e7dd5e3fb7.tar.bz2 yuzu-4f04bd369787b351deb8b24dacae77e7dd5e3fb7.tar.lz yuzu-4f04bd369787b351deb8b24dacae77e7dd5e3fb7.tar.xz yuzu-4f04bd369787b351deb8b24dacae77e7dd5e3fb7.tar.zst yuzu-4f04bd369787b351deb8b24dacae77e7dd5e3fb7.zip |
-rw-r--r-- | src/core/hle/service/nfc/common/device.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/hle/service/nfc/common/device.cpp b/src/core/hle/service/nfc/common/device.cpp index 31cc87acc..cc7776efc 100644 --- a/src/core/hle/service/nfc/common/device.cpp +++ b/src/core/hle/service/nfc/common/device.cpp @@ -441,7 +441,10 @@ Result NfcDevice::Mount(NFP::ModelType model_type, NFP::MountTarget mount_target device_state = DeviceState::TagMounted; mount_target = mount_target_; - if (!is_corrupted && mount_target != NFP::MountTarget::Rom) { + const bool create_backup = + mount_target == NFP::MountTarget::All || mount_target == NFP::MountTarget::Ram || + (mount_target == NFP::MountTarget::Rom && HasBackup(encrypted_tag_data.uuid).IsError()); + if (!is_corrupted && create_backup) { std::vector<u8> data(sizeof(NFP::EncryptedNTAG215File)); memcpy(data.data(), &encrypted_tag_data, sizeof(encrypted_tag_data)); WriteBackupData(encrypted_tag_data.uuid, data); |