fix some things i guess.

This commit is contained in:
Starlet 2019-05-01 17:29:08 -04:00
commit 825f659e07
2 changed files with 11 additions and 3 deletions

View file

@ -1,6 +1,7 @@
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Ipc; using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel.Common; using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Kernel.Threading;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -42,7 +43,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
{ 91, GetAccumulatedSuspendedTickChangedEvent } { 91, GetAccumulatedSuspendedTickChangedEvent }
}; };
_launchableEvent = new KEvent(system); _launchableEvent = new KEvent(system);
_accumulatedSuspendedTickChangedEvent = new KEvent(system); _accumulatedSuspendedTickChangedEvent = new KEvent(system);
} }
@ -190,9 +192,11 @@ namespace Ryujinx.HLE.HOS.Services.Am
// GetAccumulatedSuspendedTickChangedEvent() -> handle<copy> // GetAccumulatedSuspendedTickChangedEvent() -> handle<copy>
public long GetAccumulatedSuspendedTickChangedEvent(ServiceCtx context) public long GetAccumulatedSuspendedTickChangedEvent(ServiceCtx context)
{ {
KHandleTable handleTable = context.Process.HandleTable;
_accumulatedSuspendedTickChangedEvent.ReadableEvent.Signal(); _accumulatedSuspendedTickChangedEvent.ReadableEvent.Signal();
if (context.Process.HandleTable.GenerateHandle(_accumulatedSuspendedTickChangedEvent.ReadableEvent, out int handle) != KernelResult.Success) if (handleTable.GenerateHandle(_accumulatedSuspendedTickChangedEvent.ReadableEvent, out int handle) != KernelResult.Success)
{ {
throw new InvalidOperationException("Out of handles!"); throw new InvalidOperationException("Out of handles!");
} }

View file

@ -1,5 +1,6 @@
using Ryujinx.HLE.HOS.Ipc; using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel.Common; using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Process;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -65,7 +66,10 @@ namespace Ryujinx.HLE.HOS.Services.Time
// GetSharedMemoryNativeHandle() -> handle<copy> // GetSharedMemoryNativeHandle() -> handle<copy>
public long GetSharedMemoryNativeHandle(ServiceCtx context) public long GetSharedMemoryNativeHandle(ServiceCtx context)
{ {
if (context.Process.HandleTable.GenerateHandle(context.Device.System.TimeSharedMem, out int handle) != KernelResult.Success) Horizon system = context.Device.System;
KHandleTable handleTable = context.Process.HandleTable;
if (handleTable.GenerateHandle(system.TimeSharedMem, out int handle) != KernelResult.Success)
{ {
throw new InvalidOperationException("Out of handles!"); throw new InvalidOperationException("Out of handles!");
} }