diff options
| author | 2023-09-17 10:43:39 -0600 | |
|---|---|---|
| committer | 2023-09-17 16:06:25 -0600 | |
| commit | 2f22b53732a91750e61697a02de3d99cc30c17a4 (patch) | |
| tree | 2f0e6a6935d2f4547aab7443debbf7d66a2f3b70 /src/core/hle/service/nfc | |
| parent | service: mii: Complete structs and fix mistakes (diff) | |
| download | yuzu-2f22b53732a91750e61697a02de3d99cc30c17a4.tar.gz yuzu-2f22b53732a91750e61697a02de3d99cc30c17a4.tar.xz yuzu-2f22b53732a91750e61697a02de3d99cc30c17a4.zip | |
service: nfc: Fully Implement GetRegisterInfoPrivate
Diffstat (limited to 'src/core/hle/service/nfc')
| -rw-r--r-- | src/core/hle/service/nfc/common/device.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hle/service/nfc/common/device.cpp b/src/core/hle/service/nfc/common/device.cpp index 674d2e4b2..05951d8cb 100644 --- a/src/core/hle/service/nfc/common/device.cpp +++ b/src/core/hle/service/nfc/common/device.cpp | |||
| @@ -439,6 +439,7 @@ Result NfcDevice::Mount(NFP::ModelType model_type, NFP::MountTarget mount_target | |||
| 439 | 439 | ||
| 440 | device_state = DeviceState::TagMounted; | 440 | device_state = DeviceState::TagMounted; |
| 441 | mount_target = mount_target_; | 441 | mount_target = mount_target_; |
| 442 | |||
| 442 | return ResultSuccess; | 443 | return ResultSuccess; |
| 443 | } | 444 | } |
| 444 | 445 | ||
| @@ -716,12 +717,13 @@ Result NfcDevice::GetRegisterInfoPrivate(NFP::RegisterInfoPrivate& register_info | |||
| 716 | return ResultRegistrationIsNotInitialized; | 717 | return ResultRegistrationIsNotInitialized; |
| 717 | } | 718 | } |
| 718 | 719 | ||
| 719 | Service::Mii::MiiManager manager; | 720 | Mii::StoreData store_data{}; |
| 720 | const auto& settings = tag_data.settings; | 721 | const auto& settings = tag_data.settings; |
| 722 | tag_data.owner_mii.BuildToStoreData(store_data); | ||
| 721 | 723 | ||
| 722 | // TODO: Validate and complete this data | 724 | // TODO: Validate and complete this data |
| 723 | register_info = { | 725 | register_info = { |
| 724 | .mii_store_data = {}, | 726 | .mii_store_data = store_data, |
| 725 | .creation_date = settings.init_date.GetWriteDate(), | 727 | .creation_date = settings.init_date.GetWriteDate(), |
| 726 | .amiibo_name = GetAmiiboName(settings), | 728 | .amiibo_name = GetAmiiboName(settings), |
| 727 | .font_region = settings.settings.font_region, | 729 | .font_region = settings.settings.font_region, |
| @@ -1372,7 +1374,7 @@ NFP::AmiiboName NfcDevice::GetAmiiboName(const NFP::AmiiboSettings& settings) co | |||
| 1372 | 1374 | ||
| 1373 | // Convert from utf16 to utf8 | 1375 | // Convert from utf16 to utf8 |
| 1374 | const auto amiibo_name_utf8 = Common::UTF16ToUTF8(settings_amiibo_name.data()); | 1376 | const auto amiibo_name_utf8 = Common::UTF16ToUTF8(settings_amiibo_name.data()); |
| 1375 | memcpy(amiibo_name.data(), amiibo_name_utf8.data(), amiibo_name_utf8.size()); | 1377 | memcpy(amiibo_name.data(), amiibo_name_utf8.data(), amiibo_name_utf8.size() - 1); |
| 1376 | 1378 | ||
| 1377 | return amiibo_name; | 1379 | return amiibo_name; |
| 1378 | } | 1380 | } |