diff options
author | german77 <juangerman-13@hotmail.com> | 2022-11-13 17:56:01 +0100 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2022-11-13 17:56:54 +0100 |
commit | b193d40d2275fc59600268e2622ae25aab2bba64 (patch) | |
tree | 8c075b5a5806dbf3650bf96b9a53c2a6f8057544 /src/input_common/drivers/virtual_amiibo.cpp | |
parent | service: nfc: fix tagprotocol and implement GetApplicationAreaId (diff) | |
download | yuzu-b193d40d2275fc59600268e2622ae25aab2bba64.tar yuzu-b193d40d2275fc59600268e2622ae25aab2bba64.tar.gz yuzu-b193d40d2275fc59600268e2622ae25aab2bba64.tar.bz2 yuzu-b193d40d2275fc59600268e2622ae25aab2bba64.tar.lz yuzu-b193d40d2275fc59600268e2622ae25aab2bba64.tar.xz yuzu-b193d40d2275fc59600268e2622ae25aab2bba64.tar.zst yuzu-b193d40d2275fc59600268e2622ae25aab2bba64.zip |
Diffstat (limited to 'src/input_common/drivers/virtual_amiibo.cpp')
-rw-r--r-- | src/input_common/drivers/virtual_amiibo.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/input_common/drivers/virtual_amiibo.cpp b/src/input_common/drivers/virtual_amiibo.cpp index 0cd5129da..252c660d8 100644 --- a/src/input_common/drivers/virtual_amiibo.cpp +++ b/src/input_common/drivers/virtual_amiibo.cpp @@ -60,6 +60,8 @@ Common::Input::NfcState VirtualAmiibo::WriteNfcData( return Common::Input::NfcState::WriteFailed; } + amiibo_data = data; + return Common::Input::NfcState::Success; } @@ -91,6 +93,15 @@ VirtualAmiibo::Info VirtualAmiibo::LoadAmiibo(const std::string& filename) { return Info::Success; } +VirtualAmiibo::Info VirtualAmiibo::ReloadAmiibo() { + if (state == State::AmiiboIsOpen) { + SetNfc(identifier, {Common::Input::NfcState::NewAmiibo, amiibo_data}); + return Info::Success; + } + + return LoadAmiibo(file_path); +} + VirtualAmiibo::Info VirtualAmiibo::CloseAmiibo() { state = polling_mode == Common::Input::PollingMode::NFC ? State::WaitingForAmiibo : State::Initialized; @@ -98,4 +109,8 @@ VirtualAmiibo::Info VirtualAmiibo::CloseAmiibo() { return Info::Success; } +std::string VirtualAmiibo::GetLastFilePath() { + return file_path; +} + } // namespace InputCommon |