aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Horizon.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Horizon.cs')
-rw-r--r--Ryujinx.HLE/HOS/Horizon.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs
index 16b4c376..4da147bf 100644
--- a/Ryujinx.HLE/HOS/Horizon.cs
+++ b/Ryujinx.HLE/HOS/Horizon.cs
@@ -22,6 +22,7 @@ using Ryujinx.HLE.HOS.Services.Apm;
using Ryujinx.HLE.HOS.Services.Arp;
using Ryujinx.HLE.HOS.Services.Audio.AudioRenderer;
using Ryujinx.HLE.HOS.Services.Mii;
+using Ryujinx.HLE.HOS.Services.Nfc.Nfp.UserManager;
using Ryujinx.HLE.HOS.Services.Nv;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl;
using Ryujinx.HLE.HOS.Services.Pcv.Bpc;
@@ -33,6 +34,7 @@ using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.Loaders.Executables;
using Ryujinx.HLE.Utilities;
using System;
+using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
@@ -65,6 +67,8 @@ namespace Ryujinx.HLE.HOS
internal AppletStateMgr AppletState { get; private set; }
+ internal List<NfpDevice> NfpDevices { get; private set; }
+
internal ServerBase BsdServer { get; private set; }
internal ServerBase AudRenServer { get; private set; }
internal ServerBase AudOutServer { get; private set; }
@@ -113,6 +117,8 @@ namespace Ryujinx.HLE.HOS
PerformanceState = new PerformanceState();
+ NfpDevices = new List<NfpDevice>();
+
// Note: This is not really correct, but with HLE of services, the only memory
// region used that is used is Application, so we can use the other ones for anything.
KMemoryRegionManager region = KernelContext.MemoryRegions[(int)MemoryRegion.NvServices];
@@ -320,6 +326,33 @@ namespace Ryujinx.HLE.HOS
AppletState.MessageEvent.ReadableEvent.Signal();
}
+ public void ScanAmiibo(int nfpDeviceId, string amiiboId, bool useRandomUuid)
+ {
+ if (NfpDevices[nfpDeviceId].State == NfpDeviceState.SearchingForTag)
+ {
+ NfpDevices[nfpDeviceId].State = NfpDeviceState.TagFound;
+ NfpDevices[nfpDeviceId].AmiiboId = amiiboId;
+ NfpDevices[nfpDeviceId].UseRandomUuid = useRandomUuid;
+ }
+ }
+
+ public bool SearchingForAmiibo(out int nfpDeviceId)
+ {
+ nfpDeviceId = default;
+
+ for (int i = 0; i < NfpDevices.Count; i++)
+ {
+ if (NfpDevices[i].State == NfpDeviceState.SearchingForTag)
+ {
+ nfpDeviceId = i;
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
public void SignalDisplayResolutionChange()
{
DisplayResolutionChangeEvent.ReadableEvent.Signal();