diff options
Diffstat (limited to 'Ryujinx.Core/OsHle/Services/Nifm')
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Nifm/IGeneralService.cs | 34 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs | 49 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Nifm/ServiceNifm.cs | 29 |
3 files changed, 112 insertions, 0 deletions
diff --git a/Ryujinx.Core/OsHle/Services/Nifm/IGeneralService.cs b/Ryujinx.Core/OsHle/Services/Nifm/IGeneralService.cs new file mode 100644 index 00000000..c31ee36b --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Nifm/IGeneralService.cs @@ -0,0 +1,34 @@ +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; + +using static Ryujinx.Core.OsHle.IpcServices.ObjHelper; + +namespace Ryujinx.Core.OsHle.IpcServices.Nifm +{ + class IGeneralService : IIpcService + { + private Dictionary<int, ServiceProcessRequest> m_Commands; + + public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + + public IGeneralService() + { + m_Commands = new Dictionary<int, ServiceProcessRequest>() + { + { 4, CreateRequest } + }; + } + + //CreateRequest(i32) + public long CreateRequest(ServiceCtx Context) + { + int Unknown = Context.RequestData.ReadInt32(); + + MakeObject(Context, new IRequest()); + + //Todo: Stub + + return 0; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs b/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs new file mode 100644 index 00000000..6110e5fb --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs @@ -0,0 +1,49 @@ +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; + +namespace Ryujinx.Core.OsHle.IpcServices.Nifm +{ + class IRequest : IIpcService + { + private Dictionary<int, ServiceProcessRequest> m_Commands; + + public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + + public IRequest() + { + m_Commands = new Dictionary<int, ServiceProcessRequest>() + { + { 0, GetRequestState }, + { 1, GetResult }, + { 2, GetSystemEventReadableHandles } + }; + } + + // -> i32 + public long GetRequestState(ServiceCtx Context) + { + Context.ResponseData.Write(0); + + //Todo: Stub + + return 0; + } + + public long GetResult(ServiceCtx Context) + { + //Todo: Stub + + return 0; + } + + //GetSystemEventReadableHandles() -> (KObject, KObject) + public long GetSystemEventReadableHandles(ServiceCtx Context) + { + Context.Response.HandleDesc = IpcHandleDesc.MakeMove(0xbadcafe); + + //Todo: Stub + + return 0; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Nifm/ServiceNifm.cs b/Ryujinx.Core/OsHle/Services/Nifm/ServiceNifm.cs new file mode 100644 index 00000000..7e183389 --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Nifm/ServiceNifm.cs @@ -0,0 +1,29 @@ +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; + +using static Ryujinx.Core.OsHle.IpcServices.ObjHelper; + +namespace Ryujinx.Core.OsHle.IpcServices.Nifm +{ + class ServiceNifm : IIpcService + { + private Dictionary<int, ServiceProcessRequest> m_Commands; + + public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + + public ServiceNifm() + { + m_Commands = new Dictionary<int, ServiceProcessRequest>() + { + { 4, CreateGeneralServiceOld } + }; + } + + public long CreateGeneralServiceOld(ServiceCtx Context) + { + MakeObject(Context, new IGeneralService()); + + return 0; + } + } +}
\ No newline at end of file |
