mirror of
https://github.com/yuzu-emu/yuzu-mainline.git
synced 2024-12-12 13:24:26 +01:00
Merge pull request #12255 from german77/amiibo
service: nfc: Don't tag amiibos as corrupted if they are loaded as read only
This commit is contained in:
commit
e9a43bae6f
@ -438,16 +438,16 @@ Result NfcDevice::Mount(NFP::ModelType model_type, NFP::MountTarget mount_target
|
|||||||
is_corrupted = true;
|
is_corrupted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_corrupted) {
|
device_state = DeviceState::TagMounted;
|
||||||
|
mount_target = mount_target_;
|
||||||
|
|
||||||
|
if (!is_corrupted && mount_target != NFP::MountTarget::Rom) {
|
||||||
std::vector<u8> data(sizeof(NFP::EncryptedNTAG215File));
|
std::vector<u8> data(sizeof(NFP::EncryptedNTAG215File));
|
||||||
memcpy(data.data(), &encrypted_tag_data, sizeof(encrypted_tag_data));
|
memcpy(data.data(), &encrypted_tag_data, sizeof(encrypted_tag_data));
|
||||||
WriteBackupData(encrypted_tag_data.uuid, data);
|
WriteBackupData(encrypted_tag_data.uuid, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
device_state = DeviceState::TagMounted;
|
if (is_corrupted && mount_target != NFP::MountTarget::Rom) {
|
||||||
mount_target = mount_target_;
|
|
||||||
|
|
||||||
if (is_corrupted) {
|
|
||||||
bool has_backup = HasBackup(encrypted_tag_data.uuid).IsSuccess();
|
bool has_backup = HasBackup(encrypted_tag_data.uuid).IsSuccess();
|
||||||
return has_backup ? ResultCorruptedDataWithBackup : ResultCorruptedData;
|
return has_backup ? ResultCorruptedDataWithBackup : ResultCorruptedData;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user