summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-04-20 03:01:23 +0200
committergerman77 <juangerman-13@hotmail.com>2023-05-06 06:02:59 +0200
commit94151097b9abadf35c55ea06a31925c9848f4c62 (patch)
tree28a00c878f90492ffd2bb95521c2cc3990cc4323 /src/core/hle/service/am
parentcore: service: Add FunctionInfoTyped to allow expanding existing interfaces (diff)
downloadyuzu-94151097b9abadf35c55ea06a31925c9848f4c62.tar
yuzu-94151097b9abadf35c55ea06a31925c9848f4c62.tar.gz
yuzu-94151097b9abadf35c55ea06a31925c9848f4c62.tar.bz2
yuzu-94151097b9abadf35c55ea06a31925c9848f4c62.tar.lz
yuzu-94151097b9abadf35c55ea06a31925c9848f4c62.tar.xz
yuzu-94151097b9abadf35c55ea06a31925c9848f4c62.tar.zst
yuzu-94151097b9abadf35c55ea06a31925c9848f4c62.zip
Diffstat (limited to 'src/core/hle/service/am')
-rw-r--r--src/core/hle/service/am/applets/applet_cabinet.cpp24
-rw-r--r--src/core/hle/service/am/applets/applet_cabinet.h6
2 files changed, 16 insertions, 14 deletions
diff --git a/src/core/hle/service/am/applets/applet_cabinet.cpp b/src/core/hle/service/am/applets/applet_cabinet.cpp
index 93c9f2a55..8b754e9d4 100644
--- a/src/core/hle/service/am/applets/applet_cabinet.cpp
+++ b/src/core/hle/service/am/applets/applet_cabinet.cpp
@@ -11,7 +11,7 @@
#include "core/hle/service/am/am.h"
#include "core/hle/service/am/applets/applet_cabinet.h"
#include "core/hle/service/mii/mii_manager.h"
-#include "core/hle/service/nfp/nfp_device.h"
+#include "core/hle/service/nfc/common/device.h"
namespace Service::AM::Applets {
@@ -72,10 +72,10 @@ void Cabinet::Execute() {
// TODO: listen on all controllers
if (nfp_device == nullptr) {
- nfp_device = std::make_shared<Service::NFP::NfpDevice>(
+ nfp_device = std::make_shared<Service::NFC::NfcDevice>(
system.HIDCore().GetFirstNpadId(), system, service_context, availability_change_event);
nfp_device->Initialize();
- nfp_device->StartDetection(Service::NFP::TagProtocol::All);
+ nfp_device->StartDetection(Service::NFC::NfcProtocol::All);
}
const Core::Frontend::CabinetParameters parameters{
@@ -106,20 +106,22 @@ void Cabinet::DisplayCompleted(bool apply_changes, std::string_view amiibo_name)
Cancel();
}
- if (nfp_device->GetCurrentState() != Service::NFP::DeviceState::TagFound &&
- nfp_device->GetCurrentState() != Service::NFP::DeviceState::TagMounted) {
+ if (nfp_device->GetCurrentState() != Service::NFC::DeviceState::TagFound &&
+ nfp_device->GetCurrentState() != Service::NFC::DeviceState::TagMounted) {
Cancel();
}
- if (nfp_device->GetCurrentState() == Service::NFP::DeviceState::TagFound) {
- nfp_device->Mount(Service::NFP::MountTarget::All);
+ if (nfp_device->GetCurrentState() == Service::NFC::DeviceState::TagFound) {
+ nfp_device->Mount(Service::NFP::ModelType::Amiibo, Service::NFP::MountTarget::All);
}
switch (applet_input_common.applet_mode) {
case Service::NFP::CabinetMode::StartNicknameAndOwnerSettings: {
- Service::NFP::AmiiboName name{};
- std::memcpy(name.data(), amiibo_name.data(), std::min(amiibo_name.size(), name.size() - 1));
- nfp_device->SetRegisterInfoPrivate(name);
+ Service::NFP::RegisterInfoPrivate register_info{};
+ std::memcpy(register_info.amiibo_name.data(), amiibo_name.data(),
+ std::min(amiibo_name.size(), register_info.amiibo_name.size() - 1));
+
+ nfp_device->SetRegisterInfoPrivate(register_info);
break;
}
case Service::NFP::CabinetMode::StartGameDataEraser:
@@ -139,7 +141,7 @@ void Cabinet::DisplayCompleted(bool apply_changes, std::string_view amiibo_name)
applet_output.device_handle = applet_input_common.device_handle;
applet_output.result = CabinetResult::Cancel;
const auto reg_result = nfp_device->GetRegisterInfo(applet_output.register_info);
- const auto tag_result = nfp_device->GetTagInfo(applet_output.tag_info);
+ const auto tag_result = nfp_device->GetTagInfo(applet_output.tag_info, false);
nfp_device->Finalize();
if (reg_result.IsSuccess()) {
diff --git a/src/core/hle/service/am/applets/applet_cabinet.h b/src/core/hle/service/am/applets/applet_cabinet.h
index edd295a27..b56427021 100644
--- a/src/core/hle/service/am/applets/applet_cabinet.h
+++ b/src/core/hle/service/am/applets/applet_cabinet.h
@@ -19,8 +19,8 @@ namespace Core {
class System;
} // namespace Core
-namespace Service::NFP {
-class NfpDevice;
+namespace Service::NFC {
+class NfcDevice;
}
namespace Service::AM::Applets {
@@ -96,7 +96,7 @@ private:
Core::System& system;
bool is_complete{false};
- std::shared_ptr<Service::NFP::NfpDevice> nfp_device;
+ std::shared_ptr<Service::NFC::NfcDevice> nfp_device;
Kernel::KEvent* availability_change_event;
KernelHelpers::ServiceContext service_context;
StartParamForAmiiboSettings applet_input_common{};