Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
38275f9056 | |||
67cbdc3a6a | |||
131b43170e | |||
730d2f4b9b | |||
f6a7309b14 |
@ -57,5 +57,19 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
|
||||
{
|
||||
return _managerServer.StoreOpenContext(context);
|
||||
}
|
||||
|
||||
[CommandHipc(170)] // 6.0.0+
|
||||
// LoadNetworkServiceLicenseKindAsync() -> object<nn::account::detail::IAsyncNetworkServiceLicenseKindContext>
|
||||
public ResultCode LoadNetworkServiceLicenseKindAsync(ServiceCtx context)
|
||||
{
|
||||
ResultCode resultCode = _managerServer.LoadNetworkServiceLicenseKindAsync(context, out IAsyncNetworkServiceLicenseKindContext asyncContext);
|
||||
|
||||
if (resultCode == ResultCode.Success)
|
||||
{
|
||||
MakeObject(context, asyncContext);
|
||||
}
|
||||
|
||||
return resultCode;
|
||||
}
|
||||
}
|
||||
}
|
@ -166,5 +166,22 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
public ResultCode LoadNetworkServiceLicenseKindAsync(ServiceCtx context, out IAsyncNetworkServiceLicenseKindContext asyncContext)
|
||||
{
|
||||
KEvent asyncEvent = new KEvent(context.Device.System.KernelContext);
|
||||
AsyncExecution asyncExecution = new AsyncExecution(asyncEvent);
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAcc);
|
||||
|
||||
// NOTE: This is an extension of the data retrieved from the id token cache.
|
||||
asyncExecution.Initialize(1000, EnsureIdTokenCacheAsyncImpl);
|
||||
|
||||
asyncContext = new IAsyncNetworkServiceLicenseKindContext(asyncExecution, NetworkServiceLicenseKind.Subscribed);
|
||||
|
||||
// return ResultCode.NullObject if the IAsyncNetworkServiceLicenseKindContext pointer is null. Doesn't occur in our case.
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
@ -7,18 +7,18 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
||||
{
|
||||
class IAsyncContext : IpcService
|
||||
{
|
||||
AsyncExecution _asyncExecution;
|
||||
protected AsyncExecution AsyncExecution;
|
||||
|
||||
public IAsyncContext(AsyncExecution asyncExecution)
|
||||
{
|
||||
_asyncExecution = asyncExecution;
|
||||
AsyncExecution = asyncExecution;
|
||||
}
|
||||
|
||||
[CommandHipc(0)]
|
||||
// GetSystemEvent() -> handle<copy>
|
||||
public ResultCode GetSystemEvent(ServiceCtx context)
|
||||
{
|
||||
if (context.Process.HandleTable.GenerateHandle(_asyncExecution.SystemEvent.ReadableEvent, out int _systemEventHandle) != KernelResult.Success)
|
||||
if (context.Process.HandleTable.GenerateHandle(AsyncExecution.SystemEvent.ReadableEvent, out int _systemEventHandle) != KernelResult.Success)
|
||||
{
|
||||
throw new InvalidOperationException("Out of handles!");
|
||||
}
|
||||
@ -32,14 +32,14 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
||||
// Cancel()
|
||||
public ResultCode Cancel(ServiceCtx context)
|
||||
{
|
||||
if (!_asyncExecution.IsInitialized)
|
||||
if (!AsyncExecution.IsInitialized)
|
||||
{
|
||||
return ResultCode.AsyncExecutionNotInitialized;
|
||||
}
|
||||
|
||||
if (_asyncExecution.IsRunning)
|
||||
if (AsyncExecution.IsRunning)
|
||||
{
|
||||
_asyncExecution.Cancel();
|
||||
AsyncExecution.Cancel();
|
||||
}
|
||||
|
||||
return ResultCode.Success;
|
||||
@ -49,12 +49,12 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
||||
// HasDone() -> b8
|
||||
public ResultCode HasDone(ServiceCtx context)
|
||||
{
|
||||
if (!_asyncExecution.IsInitialized)
|
||||
if (!AsyncExecution.IsInitialized)
|
||||
{
|
||||
return ResultCode.AsyncExecutionNotInitialized;
|
||||
}
|
||||
|
||||
context.ResponseData.Write(_asyncExecution.SystemEvent.ReadableEvent.IsSignaled());
|
||||
context.ResponseData.Write(AsyncExecution.SystemEvent.ReadableEvent.IsSignaled());
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
@ -63,12 +63,12 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
||||
// GetResult()
|
||||
public ResultCode GetResult(ServiceCtx context)
|
||||
{
|
||||
if (!_asyncExecution.IsInitialized)
|
||||
if (!AsyncExecution.IsInitialized)
|
||||
{
|
||||
return ResultCode.AsyncExecutionNotInitialized;
|
||||
}
|
||||
|
||||
if (!_asyncExecution.SystemEvent.ReadableEvent.IsSignaled())
|
||||
if (!AsyncExecution.SystemEvent.ReadableEvent.IsSignaled())
|
||||
{
|
||||
return ResultCode.Unknown41;
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc.AsyncContext;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
||||
{
|
||||
class IAsyncNetworkServiceLicenseKindContext : IAsyncContext
|
||||
{
|
||||
private NetworkServiceLicenseKind? _serviceLicenseKind;
|
||||
|
||||
public IAsyncNetworkServiceLicenseKindContext(AsyncExecution asyncExecution, NetworkServiceLicenseKind? serviceLicenseKind) : base(asyncExecution)
|
||||
{
|
||||
_serviceLicenseKind = serviceLicenseKind;
|
||||
}
|
||||
|
||||
[CommandHipc(100)]
|
||||
// GetNetworkServiceLicenseKind() -> nn::account::NetworkServiceLicenseKind
|
||||
public ResultCode GetNetworkServiceLicenseKind(ServiceCtx context)
|
||||
{
|
||||
if (!AsyncExecution.IsInitialized)
|
||||
{
|
||||
return ResultCode.AsyncExecutionNotInitialized;
|
||||
}
|
||||
|
||||
if (!AsyncExecution.SystemEvent.ReadableEvent.IsSignaled())
|
||||
{
|
||||
return ResultCode.Unknown41;
|
||||
}
|
||||
|
||||
if (!_serviceLicenseKind.HasValue)
|
||||
{
|
||||
return ResultCode.MissingNetworkServiceLicenseKind;
|
||||
}
|
||||
|
||||
context.ResponseData.Write((uint)_serviceLicenseKind.Value);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
||||
{
|
||||
enum NetworkServiceLicenseKind : uint
|
||||
{
|
||||
NoSubscription,
|
||||
Subscribed
|
||||
}
|
||||
}
|
@ -7,17 +7,18 @@ namespace Ryujinx.HLE.HOS.Services.Account
|
||||
|
||||
Success = 0,
|
||||
|
||||
NullArgument = (20 << ErrorCodeShift) | ModuleId,
|
||||
InvalidArgument = (22 << ErrorCodeShift) | ModuleId,
|
||||
NullInputBuffer = (30 << ErrorCodeShift) | ModuleId,
|
||||
InvalidBufferSize = (31 << ErrorCodeShift) | ModuleId,
|
||||
InvalidBuffer = (32 << ErrorCodeShift) | ModuleId,
|
||||
AsyncExecutionNotInitialized = (40 << ErrorCodeShift) | ModuleId,
|
||||
Unknown41 = (41 << ErrorCodeShift) | ModuleId,
|
||||
InternetRequestDenied = (59 << ErrorCodeShift) | ModuleId,
|
||||
UserNotFound = (100 << ErrorCodeShift) | ModuleId,
|
||||
NullObject = (302 << ErrorCodeShift) | ModuleId,
|
||||
Unknown341 = (341 << ErrorCodeShift) | ModuleId,
|
||||
InvalidIdTokenCacheBufferSize = (451 << ErrorCodeShift) | ModuleId
|
||||
NullArgument = (20 << ErrorCodeShift) | ModuleId,
|
||||
InvalidArgument = (22 << ErrorCodeShift) | ModuleId,
|
||||
NullInputBuffer = (30 << ErrorCodeShift) | ModuleId,
|
||||
InvalidBufferSize = (31 << ErrorCodeShift) | ModuleId,
|
||||
InvalidBuffer = (32 << ErrorCodeShift) | ModuleId,
|
||||
AsyncExecutionNotInitialized = (40 << ErrorCodeShift) | ModuleId,
|
||||
Unknown41 = (41 << ErrorCodeShift) | ModuleId,
|
||||
InternetRequestDenied = (59 << ErrorCodeShift) | ModuleId,
|
||||
UserNotFound = (100 << ErrorCodeShift) | ModuleId,
|
||||
NullObject = (302 << ErrorCodeShift) | ModuleId,
|
||||
Unknown341 = (341 << ErrorCodeShift) | ModuleId,
|
||||
MissingNetworkServiceLicenseKind = (400 << ErrorCodeShift) | ModuleId,
|
||||
InvalidIdTokenCacheBufferSize = (451 << ErrorCodeShift) | ModuleId
|
||||
}
|
||||
}
|
||||
|
@ -336,6 +336,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
||||
context.Memory.Write(outputBufferPosition + (ulong)(i * Unsafe.SizeOf<PollEventData>()), events[i].Data);
|
||||
}
|
||||
|
||||
// In case of non blocking call timeout should not be returned.
|
||||
if (timeout == 0 && errno == LinuxError.ETIMEDOUT)
|
||||
{
|
||||
errno = LinuxError.SUCCESS;
|
||||
}
|
||||
|
||||
return WriteBsdResult(context, updateCount, errno);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Types
|
||||
{
|
||||
Length = (byte)Unsafe.SizeOf<Array4<byte>>();
|
||||
Family = (byte)AddressFamily.InterNetwork;
|
||||
Port = port;
|
||||
Port = IPAddress.HostToNetworkOrder(port);
|
||||
Address = new Array4<byte>();
|
||||
|
||||
address.TryWriteBytes(Address.AsSpan(), out _);
|
||||
|
@ -35,6 +35,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
||||
private long _1msTicks;
|
||||
|
||||
private int _swapInterval;
|
||||
private int _swapIntervalDelay;
|
||||
|
||||
private readonly object Lock = new object();
|
||||
|
||||
@ -91,7 +92,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
||||
}
|
||||
else
|
||||
{
|
||||
_ticksPerFrame = Stopwatch.Frequency / (TargetFps / _swapInterval);
|
||||
_ticksPerFrame = Stopwatch.Frequency / TargetFps;
|
||||
}
|
||||
}
|
||||
|
||||
@ -322,7 +323,13 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
||||
|
||||
if (_ticks >= _ticksPerFrame)
|
||||
{
|
||||
Compose();
|
||||
if (_swapIntervalDelay-- == 0)
|
||||
{
|
||||
Compose();
|
||||
|
||||
// When a frame is presented, delay the next one by its swap interval value.
|
||||
_swapIntervalDelay = Math.Max(0, _swapInterval - 1);
|
||||
}
|
||||
|
||||
_device.System?.SignalVsync();
|
||||
|
||||
|
Reference in New Issue
Block a user