mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-23 15:07:11 +02:00
Move solution and projects to src
This commit is contained in:
parent
cd124bda58
commit
cee7121058
3466 changed files with 55 additions and 55 deletions
|
@ -0,0 +1,8 @@
|
|||
namespace Ryujinx.HLE.HOS.Services.Nim
|
||||
{
|
||||
[Service("nim")]
|
||||
class INetworkInstallManager : IpcService
|
||||
{
|
||||
public INetworkInstallManager(ServiceCtx context) { }
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServer.cs
Normal file
21
src/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServer.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface.ShopServiceAccessServer;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface
|
||||
{
|
||||
class IShopServiceAccessServer : IpcService
|
||||
{
|
||||
public IShopServiceAccessServer() { }
|
||||
|
||||
[CommandCmif(0)]
|
||||
// CreateAccessorInterface(u8) -> object<nn::ec::IShopServiceAccessor>
|
||||
public ResultCode CreateAccessorInterface(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IShopServiceAccessor(context.Device.System));
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceNim);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
using LibHac.Ncm;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Services.Arp;
|
||||
using Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Nim
|
||||
{
|
||||
[Service("nim:eca")] // 5.0.0+
|
||||
class IShopServiceAccessServerInterface : IpcService
|
||||
{
|
||||
public IShopServiceAccessServerInterface(ServiceCtx context) { }
|
||||
|
||||
[CommandCmif(0)]
|
||||
// CreateServerInterface(pid, handle<unknown>, u64) -> object<nn::ec::IShopServiceAccessServer>
|
||||
public ResultCode CreateServerInterface(ServiceCtx context)
|
||||
{
|
||||
// Close transfer memory immediately as we don't use it.
|
||||
context.Device.System.KernelContext.Syscall.CloseHandle(context.Request.HandleDesc.ToCopy[0]);
|
||||
|
||||
MakeObject(context, new IShopServiceAccessServer());
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceNim);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(4)] // 10.0.0+
|
||||
// IsLargeResourceAvailable(pid) -> b8
|
||||
public ResultCode IsLargeResourceAvailable(ServiceCtx context)
|
||||
{
|
||||
// TODO: Service calls arp:r GetApplicationInstanceId (10.0.0+) then if it fails it calls arp:r GetMicroApplicationInstanceId (10.0.0+)
|
||||
// then if it fails it returns the arp:r result code.
|
||||
|
||||
// NOTE: Firmare 10.0.0+ don't use the Pid here anymore, but the returned InstanceId. We don't support that for now so we can just use the Pid instead.
|
||||
StorageId baseStorageId = (StorageId)ApplicationLaunchProperty.GetByPid(context).BaseGameStorageId;
|
||||
|
||||
// NOTE: Service returns ResultCode.InvalidArgument if baseStorageId is null, doesn't occur in our case.
|
||||
|
||||
context.ResponseData.Write(baseStorageId == StorageId.Host);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
namespace Ryujinx.HLE.HOS.Services.Nim
|
||||
{
|
||||
[Service("nim:ecas")] // 7.0.0+
|
||||
class IShopServiceAccessSystemInterface : IpcService
|
||||
{
|
||||
public IShopServiceAccessSystemInterface(ServiceCtx context) { }
|
||||
}
|
||||
}
|
42
src/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessor.cs
Normal file
42
src/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessor.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Ipc;
|
||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||
using Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface.ShopServiceAccessServer.ShopServiceAccessor;
|
||||
using Ryujinx.Horizon.Common;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface.ShopServiceAccessServer
|
||||
{
|
||||
class IShopServiceAccessor : IpcService
|
||||
{
|
||||
private readonly KEvent _event;
|
||||
|
||||
private int _eventHandle;
|
||||
|
||||
public IShopServiceAccessor(Horizon system)
|
||||
{
|
||||
_event = new KEvent(system.KernelContext);
|
||||
}
|
||||
|
||||
[CommandCmif(0)]
|
||||
// CreateAsyncInterface(u64) -> (handle<copy>, object<nn::ec::IShopServiceAsync>)
|
||||
public ResultCode CreateAsyncInterface(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IShopServiceAsync());
|
||||
|
||||
if (_eventHandle == 0)
|
||||
{
|
||||
if (context.Process.HandleTable.GenerateHandle(_event.ReadableEvent, out _eventHandle) != Result.Success)
|
||||
{
|
||||
throw new InvalidOperationException("Out of handles!");
|
||||
}
|
||||
}
|
||||
|
||||
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_eventHandle);
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceNim);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
7
src/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAsync.cs
Normal file
7
src/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAsync.cs
Normal file
|
@ -0,0 +1,7 @@
|
|||
namespace Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface.ShopServiceAccessServer.ShopServiceAccessor
|
||||
{
|
||||
class IShopServiceAsync : IpcService
|
||||
{
|
||||
public IShopServiceAsync() { }
|
||||
}
|
||||
}
|
8
src/Ryujinx.HLE/HOS/Services/Nim/IShopServiceManager.cs
Normal file
8
src/Ryujinx.HLE/HOS/Services/Nim/IShopServiceManager.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
namespace Ryujinx.HLE.HOS.Services.Nim
|
||||
{
|
||||
[Service("nim:shp")]
|
||||
class IShopServiceManager : IpcService
|
||||
{
|
||||
public IShopServiceManager(ServiceCtx context) { }
|
||||
}
|
||||
}
|
24
src/Ryujinx.HLE/HOS/Services/Nim/Ntc/IStaticService.cs
Normal file
24
src/Ryujinx.HLE/HOS/Services/Nim/Ntc/IStaticService.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Services.Nim.Ntc.StaticService;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Nim.Ntc
|
||||
{
|
||||
[Service("ntc")]
|
||||
class IStaticService : IpcService
|
||||
{
|
||||
public IStaticService(ServiceCtx context) { }
|
||||
|
||||
[CommandCmif(0)]
|
||||
// OpenEnsureNetworkClockAvailabilityService(u64) -> object<nn::ntc::detail::service::IEnsureNetworkClockAvailabilityService>
|
||||
public ResultCode CreateAsyncInterface(ServiceCtx context)
|
||||
{
|
||||
ulong unknown = context.RequestData.ReadUInt64();
|
||||
|
||||
MakeObject(context, new IEnsureNetworkClockAvailabilityService(context));
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceNtc, new { unknown });
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Ipc;
|
||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||
using Ryujinx.Horizon.Common;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Nim.Ntc.StaticService
|
||||
{
|
||||
class IEnsureNetworkClockAvailabilityService : IpcService
|
||||
{
|
||||
private KEvent _finishNotificationEvent;
|
||||
private ResultCode _taskResultCode;
|
||||
|
||||
public IEnsureNetworkClockAvailabilityService(ServiceCtx context)
|
||||
{
|
||||
_finishNotificationEvent = new KEvent(context.Device.System.KernelContext);
|
||||
_taskResultCode = ResultCode.Success;
|
||||
|
||||
// NOTE: The service starts a thread that polls Nintendo NTP server and syncs the time with it.
|
||||
// Additionnally it gets and uses some settings too:
|
||||
// autonomic_correction_interval_seconds, autonomic_correction_failed_retry_interval_seconds,
|
||||
// autonomic_correction_immediate_try_count_max, autonomic_correction_immediate_try_interval_milliseconds
|
||||
}
|
||||
|
||||
[CommandCmif(0)]
|
||||
// StartTask()
|
||||
public ResultCode StartTask(ServiceCtx context)
|
||||
{
|
||||
if (!context.Device.Configuration.EnableInternetAccess)
|
||||
{
|
||||
return (ResultCode)Time.ResultCode.NetworkTimeNotAvailable;
|
||||
}
|
||||
|
||||
// NOTE: Since we don't support the Nintendo NTP server, we can signal the event now to confirm the update task is done.
|
||||
_finishNotificationEvent.ReadableEvent.Signal();
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceNtc);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(1)]
|
||||
// GetFinishNotificationEvent() -> handle<copy>
|
||||
public ResultCode GetFinishNotificationEvent(ServiceCtx context)
|
||||
{
|
||||
if (context.Process.HandleTable.GenerateHandle(_finishNotificationEvent.ReadableEvent, out int finishNotificationEventHandle) != Result.Success)
|
||||
{
|
||||
throw new InvalidOperationException("Out of handles!");
|
||||
}
|
||||
|
||||
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(finishNotificationEventHandle);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(2)]
|
||||
// GetResult()
|
||||
public ResultCode GetResult(ServiceCtx context)
|
||||
{
|
||||
return _taskResultCode;
|
||||
}
|
||||
|
||||
[CommandCmif(3)]
|
||||
// Cancel()
|
||||
public ResultCode Cancel(ServiceCtx context)
|
||||
{
|
||||
// NOTE: The update task should be canceled here.
|
||||
_finishNotificationEvent.ReadableEvent.Signal();
|
||||
|
||||
_taskResultCode = (ResultCode)Time.ResultCode.NetworkTimeTaskCanceled;
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceNtc);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
12
src/Ryujinx.HLE/HOS/Services/Nim/ResultCode.cs
Normal file
12
src/Ryujinx.HLE/HOS/Services/Nim/ResultCode.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
namespace Ryujinx.HLE.HOS.Services.Nim
|
||||
{
|
||||
enum ResultCode
|
||||
{
|
||||
ModuleId = 137,
|
||||
ErrorCodeShift = 9,
|
||||
|
||||
Success = 0,
|
||||
|
||||
NullArgument = (90 << ErrorCodeShift) | ModuleId
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue