diff options
author | bunnei <bunneidev@gmail.com> | 2023-05-25 23:07:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-25 23:07:16 +0200 |
commit | ffa1fba7d632d69e564cce302b5e5cf4bf131071 (patch) | |
tree | a601ac622b62f4931202e13a7cf733b6f580390a /src/core | |
parent | Merge pull request #10454 from 521337/fix-u-option (diff) | |
parent | input_common: Implement amiibo writting (diff) | |
download | yuzu-ffa1fba7d632d69e564cce302b5e5cf4bf131071.tar yuzu-ffa1fba7d632d69e564cce302b5e5cf4bf131071.tar.gz yuzu-ffa1fba7d632d69e564cce302b5e5cf4bf131071.tar.bz2 yuzu-ffa1fba7d632d69e564cce302b5e5cf4bf131071.tar.lz yuzu-ffa1fba7d632d69e564cce302b5e5cf4bf131071.tar.xz yuzu-ffa1fba7d632d69e564cce302b5e5cf4bf131071.tar.zst yuzu-ffa1fba7d632d69e564cce302b5e5cf4bf131071.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hid/emulated_controller.cpp | 9 | ||||
-rw-r--r-- | src/core/hle/service/nfc/common/device.cpp | 8 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 366880711..bbfea7117 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -1283,9 +1283,14 @@ bool EmulatedController::HasNfc() const { } bool EmulatedController::WriteNfc(const std::vector<u8>& data) { - auto& nfc_output_device = output_devices[3]; + auto& nfc_output_device = output_devices[static_cast<std::size_t>(DeviceIndex::Right)]; + auto& nfc_virtual_output_device = output_devices[3]; + + if (nfc_output_device->SupportsNfc() != Common::Input::NfcState::NotSupported) { + return nfc_output_device->WriteNfcData(data) == Common::Input::NfcState::Success; + } - return nfc_output_device->WriteNfcData(data) == Common::Input::NfcState::Success; + return nfc_virtual_output_device->WriteNfcData(data) == Common::Input::NfcState::Success; } void EmulatedController::SetLedPattern() { diff --git a/src/core/hle/service/nfc/common/device.cpp b/src/core/hle/service/nfc/common/device.cpp index e5d4545a8..0bd7900e1 100644 --- a/src/core/hle/service/nfc/common/device.cpp +++ b/src/core/hle/service/nfc/common/device.cpp @@ -426,11 +426,11 @@ Result NfcDevice::Flush() { tag_data.write_counter++; - FlushWithBreak(NFP::BreakType::Normal); + const auto result = FlushWithBreak(NFP::BreakType::Normal); is_data_moddified = false; - return ResultSuccess; + return result; } Result NfcDevice::FlushDebug() { @@ -449,11 +449,11 @@ Result NfcDevice::FlushDebug() { tag_data.write_counter++; - FlushWithBreak(NFP::BreakType::Normal); + const auto result = FlushWithBreak(NFP::BreakType::Normal); is_data_moddified = false; - return ResultSuccess; + return result; } Result NfcDevice::FlushWithBreak(NFP::BreakType break_type) { |