summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-26 04:10:08 +0200
committerGitHub <noreply@github.com>2018-10-26 04:10:08 +0200
commitdebabf1fa68b61cc08addfe0b6c5380cb9eb11da (patch)
tree1ae4bf5901a5bda00720f131916f3c2de6f87cfb /src/core/hle/service
parentMerge pull request #1587 from lioncash/private (diff)
parentyuzu/main: Notify user of loading errors with Amiibo data (diff)
downloadyuzu-debabf1fa68b61cc08addfe0b6c5380cb9eb11da.tar
yuzu-debabf1fa68b61cc08addfe0b6c5380cb9eb11da.tar.gz
yuzu-debabf1fa68b61cc08addfe0b6c5380cb9eb11da.tar.bz2
yuzu-debabf1fa68b61cc08addfe0b6c5380cb9eb11da.tar.lz
yuzu-debabf1fa68b61cc08addfe0b6c5380cb9eb11da.tar.xz
yuzu-debabf1fa68b61cc08addfe0b6c5380cb9eb11da.tar.zst
yuzu-debabf1fa68b61cc08addfe0b6c5380cb9eb11da.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/nfp/nfp.cpp6
-rw-r--r--src/core/hle/service/nfp/nfp.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp
index 9a4eb9301..c1af878fe 100644
--- a/src/core/hle/service/nfp/nfp.cpp
+++ b/src/core/hle/service/nfp/nfp.cpp
@@ -328,13 +328,15 @@ void Module::Interface::CreateUserInterface(Kernel::HLERequestContext& ctx) {
rb.PushIpcInterface<IUser>(*this);
}
-void Module::Interface::LoadAmiibo(const std::vector<u8>& buffer) {
+bool Module::Interface::LoadAmiibo(const std::vector<u8>& buffer) {
std::lock_guard<std::recursive_mutex> lock(HLE::g_hle_lock);
if (buffer.size() < sizeof(AmiiboFile)) {
- return; // Failed to load file
+ return false;
}
+
std::memcpy(&amiibo, buffer.data(), sizeof(amiibo));
nfc_tag_load->Signal();
+ return true;
}
const Kernel::SharedPtr<Kernel::Event>& Module::Interface::GetNFCEvent() const {
return nfc_tag_load;
diff --git a/src/core/hle/service/nfp/nfp.h b/src/core/hle/service/nfp/nfp.h
index 46370dedd..5c0ae8a54 100644
--- a/src/core/hle/service/nfp/nfp.h
+++ b/src/core/hle/service/nfp/nfp.h
@@ -32,7 +32,7 @@ public:
static_assert(sizeof(AmiiboFile) == 0x94, "AmiiboFile is an invalid size");
void CreateUserInterface(Kernel::HLERequestContext& ctx);
- void LoadAmiibo(const std::vector<u8>& buffer);
+ bool LoadAmiibo(const std::vector<u8>& buffer);
const Kernel::SharedPtr<Kernel::Event>& GetNFCEvent() const;
const AmiiboFile& GetAmiiboBuffer() const;