summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Lioncash2018-10-24 09:37:29 -0400
committerGravatar Lioncash2018-10-24 10:39:31 -0400
commitbed2d6c425c649ff587b80d617597f3eca359da1 (patch)
tree97d8b3f809d25a10bda5871f15ac4d2c233756de /src/core
parentMerge pull request #1551 from ogniK5377/improved-svcbreak (diff)
downloadyuzu-bed2d6c425c649ff587b80d617597f3eca359da1.tar.gz
yuzu-bed2d6c425c649ff587b80d617597f3eca359da1.tar.xz
yuzu-bed2d6c425c649ff587b80d617597f3eca359da1.zip
yuzu/main: Notify user of loading errors with Amiibo data
We shouldn't silently continue if loading failed, since the general assumption is that no messages showing up implicitly indicates success.
Diffstat (limited to 'src/core')
-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) {
328 rb.PushIpcInterface<IUser>(*this); 328 rb.PushIpcInterface<IUser>(*this);
329} 329}
330 330
331void Module::Interface::LoadAmiibo(const std::vector<u8>& buffer) { 331bool Module::Interface::LoadAmiibo(const std::vector<u8>& buffer) {
332 std::lock_guard<std::recursive_mutex> lock(HLE::g_hle_lock); 332 std::lock_guard<std::recursive_mutex> lock(HLE::g_hle_lock);
333 if (buffer.size() < sizeof(AmiiboFile)) { 333 if (buffer.size() < sizeof(AmiiboFile)) {
334 return; // Failed to load file 334 return false;
335 } 335 }
336
336 std::memcpy(&amiibo, buffer.data(), sizeof(amiibo)); 337 std::memcpy(&amiibo, buffer.data(), sizeof(amiibo));
337 nfc_tag_load->Signal(); 338 nfc_tag_load->Signal();
339 return true;
338} 340}
339const Kernel::SharedPtr<Kernel::Event>& Module::Interface::GetNFCEvent() const { 341const Kernel::SharedPtr<Kernel::Event>& Module::Interface::GetNFCEvent() const {
340 return nfc_tag_load; 342 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:
32 static_assert(sizeof(AmiiboFile) == 0x94, "AmiiboFile is an invalid size"); 32 static_assert(sizeof(AmiiboFile) == 0x94, "AmiiboFile is an invalid size");
33 33
34 void CreateUserInterface(Kernel::HLERequestContext& ctx); 34 void CreateUserInterface(Kernel::HLERequestContext& ctx);
35 void LoadAmiibo(const std::vector<u8>& buffer); 35 bool LoadAmiibo(const std::vector<u8>& buffer);
36 const Kernel::SharedPtr<Kernel::Event>& GetNFCEvent() const; 36 const Kernel::SharedPtr<Kernel::Event>& GetNFCEvent() const;
37 const AmiiboFile& GetAmiiboBuffer() const; 37 const AmiiboFile& GetAmiiboBuffer() const;
38 38