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 m_Commands; + + public override IReadOnlyDictionary Commands => m_Commands; + + public IAllSystemAppletProxiesService() + { + m_Commands = new Dictionary() + { + { 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 m_Commands; + + public override IReadOnlyDictionary Commands => m_Commands; + + public IApplicationCreator() + { + m_Commands = new Dictionary() + { + //... + }; + } + } +} \ 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 m_Commands; + + public override IReadOnlyDictionary Commands => m_Commands; + + public IGlobalStateController() + { + m_Commands = new Dictionary() + { + //... + }; + } + } +} \ 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 m_Commands; + + public override IReadOnlyDictionary Commands => m_Commands; + + private KEvent ChannelEvent; + + public IHomeMenuFunctions() + { + m_Commands = new Dictionary() + { + { 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 m_Commands; + + public override IReadOnlyDictionary Commands => m_Commands; + + public ISystemAppletProxy() + { + m_Commands = new Dictionary() + { + { 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 +}