Merge branch 'fix-TotK/BotW-launch' into 'master'

TotK/BotW launch issues

See merge request [ryubing/ryujinx!50](https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/50)
This commit is contained in:
LotP 2025-06-23 15:02:10 -05:00
commit 1706cf68c7
4 changed files with 27 additions and 6 deletions

View file

@ -31,11 +31,13 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
private readonly KEvent _friendInvitationStorageChannelEvent; private readonly KEvent _friendInvitationStorageChannelEvent;
private readonly KEvent _notificationStorageChannelEvent; private readonly KEvent _notificationStorageChannelEvent;
private readonly KEvent _healthWarningDisappearedSystemEvent; private readonly KEvent _healthWarningDisappearedSystemEvent;
private readonly KEvent _unknownEvent;
private int _gpuErrorDetectedSystemEventHandle; private int _gpuErrorDetectedSystemEventHandle;
private int _friendInvitationStorageChannelEventHandle; private int _friendInvitationStorageChannelEventHandle;
private int _notificationStorageChannelEventHandle; private int _notificationStorageChannelEventHandle;
private int _healthWarningDisappearedSystemEventHandle; private int _healthWarningDisappearedSystemEventHandle;
private int _unknownEventHandle;
private bool _gamePlayRecordingState; private bool _gamePlayRecordingState;
@ -50,6 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
_friendInvitationStorageChannelEvent = new KEvent(system.KernelContext); _friendInvitationStorageChannelEvent = new KEvent(system.KernelContext);
_notificationStorageChannelEvent = new KEvent(system.KernelContext); _notificationStorageChannelEvent = new KEvent(system.KernelContext);
_healthWarningDisappearedSystemEvent = new KEvent(system.KernelContext); _healthWarningDisappearedSystemEvent = new KEvent(system.KernelContext);
_unknownEvent = new KEvent(system.KernelContext);
_horizon = system.LibHacHorizonManager.AmClient; _horizon = system.LibHacHorizonManager.AmClient;
} }
@ -647,6 +650,23 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
return ResultCode.Success; return ResultCode.Success;
} }
[CommandCmif(210)] // 20.0.0+
// GetUnknownEvent() -> handle<copy>
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+ [CommandCmif(1001)] // 10.0.0+
// PrepareForJit() // PrepareForJit()

View file

@ -50,7 +50,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common
ulong value = BinaryPrimitives.ReadUInt64LittleEndian(byteSpan); ulong value = BinaryPrimitives.ReadUInt64LittleEndian(byteSpan);
return value; return value << 1;
} }
private static int GetSamplingNumberFieldOffset<T>(ref T sampledDataStruct) where T : unmanaged, ISampledDataStruct private static int GetSamplingNumberFieldOffset<T>(ref T sampledDataStruct) where T : unmanaged, ISampledDataStruct

View file

@ -39,9 +39,9 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common
public ref AtomicStorage<T> GetCurrentAtomicEntryRef() public ref AtomicStorage<T> 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; _storage[0] = default;
@ -52,7 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common
while (true) while (true)
{ {
int inputEntryIndex = (int)((index + MaxEntries + 1 - countAvailaible) % MaxEntries); int inputEntryIndex = (int)((index + MaxEntries + 1 - countAvailable) % MaxEntries);
ref AtomicStorage<T> result = ref _storage[inputEntryIndex]; ref AtomicStorage<T> 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) 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(); index = ReadCurrentIndex();
continue; continue;

View file

@ -41,6 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Npad
public NpadLarkType LarkTypeRight; public NpadLarkType LarkTypeRight;
public NpadLuciaType LuciaType; public NpadLuciaType LuciaType;
public uint Unknown43EC; public uint Unknown43EC;
public ulong SixAxisSensorPropertiesArray;
[StructLayout(LayoutKind.Sequential, Size = 123, Pack = 1)] [StructLayout(LayoutKind.Sequential, Size = 123, Pack = 1)]
private struct Reserved2Struct { } private struct Reserved2Struct { }