diff options
author | german77 <juangerman-13@hotmail.com> | 2022-11-13 22:14:08 +0100 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2022-11-14 00:13:43 +0100 |
commit | 75e6ec85e107d6e5422d882b97faaa813970d42e (patch) | |
tree | fede32c546409e0f876c9ba7142da39eb4caf9c1 /src/core/hle/service/am/applets/applet_cabinet.cpp | |
parent | service: am: Fix cabinet applet result (diff) | |
download | yuzu-75e6ec85e107d6e5422d882b97faaa813970d42e.tar yuzu-75e6ec85e107d6e5422d882b97faaa813970d42e.tar.gz yuzu-75e6ec85e107d6e5422d882b97faaa813970d42e.tar.bz2 yuzu-75e6ec85e107d6e5422d882b97faaa813970d42e.tar.lz yuzu-75e6ec85e107d6e5422d882b97faaa813970d42e.tar.xz yuzu-75e6ec85e107d6e5422d882b97faaa813970d42e.tar.zst yuzu-75e6ec85e107d6e5422d882b97faaa813970d42e.zip |
Diffstat (limited to 'src/core/hle/service/am/applets/applet_cabinet.cpp')
-rw-r--r-- | src/core/hle/service/am/applets/applet_cabinet.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/service/am/applets/applet_cabinet.cpp b/src/core/hle/service/am/applets/applet_cabinet.cpp index 01f577ab9..d0969b0f1 100644 --- a/src/core/hle/service/am/applets/applet_cabinet.cpp +++ b/src/core/hle/service/am/applets/applet_cabinet.cpp @@ -98,7 +98,7 @@ void Cabinet::Execute() { } } -void Cabinet::DisplayCompleted(bool apply_changes, const std::string& amiibo_name) { +void Cabinet::DisplayCompleted(bool apply_changes, std::string_view amiibo_name) { Service::Mii::MiiManager manager; ReturnValueForAmiiboSettings applet_output{}; @@ -118,7 +118,7 @@ void Cabinet::DisplayCompleted(bool apply_changes, const std::string& amiibo_nam switch (applet_input_common.applet_mode) { case Service::NFP::CabinetMode::StartNicknameAndOwnerSettings: { Service::NFP::AmiiboName name{}; - memcpy(name.data(), amiibo_name.data(), std::min(amiibo_name.size(), name.size() - 1)); + std::memcpy(name.data(), amiibo_name.data(), std::min(amiibo_name.size(), name.size() - 1)); nfp_device->SetNicknameAndOwner(name); break; } @@ -142,12 +142,12 @@ void Cabinet::DisplayCompleted(bool apply_changes, const std::string& amiibo_nam const auto tag_result = nfp_device->GetTagInfo(applet_output.tag_info); nfp_device->Finalize(); - if (reg_result.IsSuccess() && tag_result.IsSuccess()) { - applet_output.result = CabinetResult::All; - } else if (reg_result.IsSuccess()) { - applet_output.result = CabinetResult::RegisterInfo; - } else if (tag_result.IsSuccess()) { - applet_output.result = CabinetResult::TagInfo; + if (reg_result.IsSuccess()) { + applet_output.result |= CabinetResult::RegisterInfo; + } + + if (tag_result.IsSuccess()) { + applet_output.result |= CabinetResult::TagInfo; } std::vector<u8> out_data(sizeof(ReturnValueForAmiiboSettings)); |