diff options
| author | Ac_K <Acoustik666@gmail.com> | 2018-04-21 19:30:06 +0000 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-04-21 16:30:06 -0300 |
| commit | 434e40b8a07a2a350d72581e41e313213ee25663 (patch) | |
| tree | b1b4c4f21917ceabca13be1143e62ec6cd375606 | |
| parent | 302c1d2861a6c730a0c8c19622ea58ac16e1d4f1 (diff) | |
Update am service (#98)
* am services implementations
Implement:
- IAllSystemAppletProxiesService
- IApplicationCreator
- IGlobalStateController
- IHomeMenuFunctions
* RequestToGetForeground stub.
* GetPopFromGeneralChannelEvent stub event.
- ISystemAppletProxy
* GetCommonStateGetter
* GetSelfController
* GetWindowController
* GetAudioController
* GetDisplayController
* GetLibraryAppletCreator
* GetHomeMenuFunctions
* GetGlobalStateController
* GetApplicationCreator
* GetDebugFunctions
* Update ServiceFactory.cs
* Update IHomeMenuFunctions.cs
* Update IHomeMenuFunctions.cs
* Update ServiceFactory.cs
6 files changed, 215 insertions, 1 deletions
diff --git a/Ryujinx.Core/OsHle/Services/Am/IAllSystemAppletProxiesService.cs b/Ryujinx.Core/OsHle/Services/Am/IAllSystemAppletProxiesService.cs new file mode 100644 index 00000000..0d20f94c --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Am/IAllSystemAppletProxiesService.cs @@ -0,0 +1,27 @@ +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; + +namespace Ryujinx.Core.OsHle.Services.Am +{ + class IAllSystemAppletProxiesService : IpcService + { + private Dictionary<int, ServiceProcessRequest> m_Commands; + + public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + + public IAllSystemAppletProxiesService() + { + m_Commands = new Dictionary<int, ServiceProcessRequest>() + { + { 100, OpenSystemAppletProxy } + }; + } + + public long OpenSystemAppletProxy(ServiceCtx Context) + { + MakeObject(Context, new ISystemAppletProxy()); + + return 0; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Am/IApplicationCreator.cs b/Ryujinx.Core/OsHle/Services/Am/IApplicationCreator.cs new file mode 100644 index 00000000..1114897b --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Am/IApplicationCreator.cs @@ -0,0 +1,20 @@ +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; + +namespace Ryujinx.Core.OsHle.Services.Am +{ + class IApplicationCreator : IpcService + { + private Dictionary<int, ServiceProcessRequest> m_Commands; + + public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + + public IApplicationCreator() + { + m_Commands = new Dictionary<int, ServiceProcessRequest>() + { + //... + }; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Am/IGlobalStateController.cs b/Ryujinx.Core/OsHle/Services/Am/IGlobalStateController.cs new file mode 100644 index 00000000..d5810154 --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Am/IGlobalStateController.cs @@ -0,0 +1,20 @@ +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; + +namespace Ryujinx.Core.OsHle.Services.Am +{ + class IGlobalStateController : IpcService + { + private Dictionary<int, ServiceProcessRequest> m_Commands; + + public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + + public IGlobalStateController() + { + m_Commands = new Dictionary<int, ServiceProcessRequest>() + { + //... + }; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Am/IHomeMenuFunctions.cs b/Ryujinx.Core/OsHle/Services/Am/IHomeMenuFunctions.cs new file mode 100644 index 00000000..2b81eede --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Am/IHomeMenuFunctions.cs @@ -0,0 +1,45 @@ +using Ryujinx.Core.OsHle.Handles;
+using Ryujinx.Core.OsHle.Ipc;
+using System.Collections.Generic;
+
+namespace Ryujinx.Core.OsHle.Services.Am
+{
+ class IHomeMenuFunctions : IpcService
+ {
+ private Dictionary<int, ServiceProcessRequest> m_Commands;
+
+ public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
+
+ private KEvent ChannelEvent;
+
+ public IHomeMenuFunctions()
+ {
+ m_Commands = new Dictionary<int, ServiceProcessRequest>()
+ {
+ { 10, RequestToGetForeground },
+ { 21, GetPopFromGeneralChannelEvent }
+ };
+
+ //ToDo: Signal this Event somewhere in future.
+ ChannelEvent = new KEvent();
+ }
+
+ public long RequestToGetForeground(ServiceCtx Context)
+ {
+ Logging.Stub(LogClass.ServiceAm, "Stubbed");
+
+ return 0;
+ }
+
+ public long GetPopFromGeneralChannelEvent(ServiceCtx Context)
+ {
+ int Handle = Context.Process.HandleTable.OpenHandle(ChannelEvent);
+
+ Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
+
+ Logging.Stub(LogClass.ServiceAm, "Stubbed");
+
+ return 0;
+ }
+ }
+}
diff --git a/Ryujinx.Core/OsHle/Services/Am/ISystemAppletProxy.cs b/Ryujinx.Core/OsHle/Services/Am/ISystemAppletProxy.cs new file mode 100644 index 00000000..2d477b34 --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Am/ISystemAppletProxy.cs @@ -0,0 +1,99 @@ +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; + +namespace Ryujinx.Core.OsHle.Services.Am +{ + class ISystemAppletProxy : IpcService + { + private Dictionary<int, ServiceProcessRequest> m_Commands; + + public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + + public ISystemAppletProxy() + { + m_Commands = new Dictionary<int, ServiceProcessRequest>() + { + { 0, GetCommonStateGetter }, + { 1, GetSelfController }, + { 2, GetWindowController }, + { 3, GetAudioController }, + { 4, GetDisplayController }, + { 11, GetLibraryAppletCreator }, + { 20, GetHomeMenuFunctions }, + { 21, GetGlobalStateController }, + { 22, GetApplicationCreator }, + { 1000, GetDebugFunctions } + }; + } + + public long GetCommonStateGetter(ServiceCtx Context) + { + MakeObject(Context, new ICommonStateGetter()); + + return 0; + } + + public long GetSelfController(ServiceCtx Context) + { + MakeObject(Context, new ISelfController()); + + return 0; + } + + public long GetWindowController(ServiceCtx Context) + { + MakeObject(Context, new IWindowController()); + + return 0; + }
+
+ public long GetAudioController(ServiceCtx Context) + { + MakeObject(Context, new IAudioController()); + + return 0; + } + + public long GetDisplayController(ServiceCtx Context) + { + MakeObject(Context, new IDisplayController()); + + return 0; + } + + public long GetLibraryAppletCreator(ServiceCtx Context) + { + MakeObject(Context, new ILibraryAppletCreator()); + + return 0; + } + + public long GetHomeMenuFunctions(ServiceCtx Context) + { + MakeObject(Context, new IHomeMenuFunctions()); + + return 0; + } + + public long GetGlobalStateController(ServiceCtx Context) + { + MakeObject(Context, new IGlobalStateController()); + + return 0; + } + + public long GetApplicationCreator(ServiceCtx Context) + { + MakeObject(Context, new IApplicationCreator()); + + return 0; + } + + public long GetDebugFunctions(ServiceCtx Context) + { + MakeObject(Context, new IDebugFunctions()); + + return 0; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/ServiceFactory.cs b/Ryujinx.Core/OsHle/Services/ServiceFactory.cs index 76adcfa5..0a9760ba 100644 --- a/Ryujinx.Core/OsHle/Services/ServiceFactory.cs +++ b/Ryujinx.Core/OsHle/Services/ServiceFactory.cs @@ -38,6 +38,9 @@ namespace Ryujinx.Core.OsHle.Services case "apm:p": return new IManager(); + case "appletAE": + return new IAllSystemAppletProxiesService(); + case "appletOE": return new IApplicationProxyService(); @@ -114,4 +117,4 @@ namespace Ryujinx.Core.OsHle.Services throw new NotImplementedException(Name); } } -}
\ No newline at end of file +} |
