diff --git a/src/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs b/src/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs index 8648b0642..9986bf824 100644 --- a/src/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs +++ b/src/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs @@ -31,11 +31,13 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati private readonly KEvent _friendInvitationStorageChannelEvent; private readonly KEvent _notificationStorageChannelEvent; private readonly KEvent _healthWarningDisappearedSystemEvent; + private readonly KEvent _unknownEvent; private int _gpuErrorDetectedSystemEventHandle; private int _friendInvitationStorageChannelEventHandle; private int _notificationStorageChannelEventHandle; private int _healthWarningDisappearedSystemEventHandle; + private int _unknownEventHandle; private bool _gamePlayRecordingState; @@ -50,6 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati _friendInvitationStorageChannelEvent = new KEvent(system.KernelContext); _notificationStorageChannelEvent = new KEvent(system.KernelContext); _healthWarningDisappearedSystemEvent = new KEvent(system.KernelContext); + _unknownEvent = new KEvent(system.KernelContext); _horizon = system.LibHacHorizonManager.AmClient; } @@ -647,6 +650,23 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati return ResultCode.Success; } + + [CommandCmif(210)] // 20.0.0+ + // GetUnknownEvent() -> handle + public ResultCode GetUnknownEvent(ServiceCtx context) + { + if (_unknownEventHandle == 0) + { + if (context.Process.HandleTable.GenerateHandle(_unknownEvent.ReadableEvent, out _unknownEventHandle) != Result.Success) + { + throw new InvalidOperationException("Out of handles!"); + } + } + + context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_unknownEventHandle); + + return ResultCode.Success; + } [CommandCmif(1001)] // 10.0.0+ // PrepareForJit() diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Common/ISampledDataStruct.cs b/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Common/ISampledDataStruct.cs index 312075bc4..5a6aab495 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Common/ISampledDataStruct.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Common/ISampledDataStruct.cs @@ -50,7 +50,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common ulong value = BinaryPrimitives.ReadUInt64LittleEndian(byteSpan); - return value; + return value << 1; } private static int GetSamplingNumberFieldOffset(ref T sampledDataStruct) where T : unmanaged, ISampledDataStruct diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Common/RingLifo.cs b/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Common/RingLifo.cs index 99f2f59e4..50e5e3bc3 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Common/RingLifo.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Common/RingLifo.cs @@ -39,9 +39,9 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common public ref AtomicStorage GetCurrentAtomicEntryRef() { - ulong countAvailaible = Math.Min(Math.Max(0, ReadCurrentCount()), 1); + ulong countAvailable = Math.Min(Math.Max(0, ReadCurrentCount()), 1); - if (countAvailaible == 0) + if (countAvailable == 0) { _storage[0] = default; @@ -52,7 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common while (true) { - int inputEntryIndex = (int)((index + MaxEntries + 1 - countAvailaible) % MaxEntries); + int inputEntryIndex = (int)((index + MaxEntries + 1 - countAvailable) % MaxEntries); ref AtomicStorage result = ref _storage[inputEntryIndex]; @@ -61,9 +61,9 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common if (samplingNumber0 != samplingNumber1 && (result.SamplingNumber - result.SamplingNumber) != 1) { - ulong tempCount = Math.Min(ReadCurrentCount(), countAvailaible); + ulong tempCount = Math.Min(ReadCurrentCount(), countAvailable); - countAvailaible = Math.Min(tempCount, 1); + countAvailable = Math.Min(tempCount, 1); index = ReadCurrentIndex(); continue; diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Npad/NpadInternalState.cs b/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Npad/NpadInternalState.cs index f79a2657e..c518cf95d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Npad/NpadInternalState.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/Types/SharedMemory/Npad/NpadInternalState.cs @@ -41,6 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Npad public NpadLarkType LarkTypeRight; public NpadLuciaType LuciaType; public uint Unknown43EC; + public ulong SixAxisSensorPropertiesArray; [StructLayout(LayoutKind.Sequential, Size = 123, Pack = 1)] private struct Reserved2Struct { }