From f2ff0fd89d856eee2ff92bfee36d61d01669905c Mon Sep 17 00:00:00 2001 From: greggameplayer <33609333+greggameplayer@users.noreply.github.com> Date: Sun, 10 Jun 2018 03:24:01 +0200 Subject: [PATCH] Implement IApplicationCreator & IApplicationAccessor & IAppletAccessor --- .../OsHle/Services/Am/IAppletAccessor.cs | 68 +++++++++++++++++++ .../OsHle/Services/Am/IApplicationAccessor.cs | 36 ++++++++++ .../OsHle/Services/Am/IApplicationCreator.cs | 35 +++++++++- .../Services/Am/IApplicationFunctions.cs | 3 + 4 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 Ryujinx.Core/OsHle/Services/Am/IAppletAccessor.cs create mode 100644 Ryujinx.Core/OsHle/Services/Am/IApplicationAccessor.cs diff --git a/Ryujinx.Core/OsHle/Services/Am/IAppletAccessor.cs b/Ryujinx.Core/OsHle/Services/Am/IAppletAccessor.cs new file mode 100644 index 0000000000..fdfa1bc98b --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Am/IAppletAccessor.cs @@ -0,0 +1,68 @@ +using Ryujinx.Core.Logging; +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; + +namespace Ryujinx.Core.OsHle.Services.Am +{ + class IAppletAccessor : IpcService + { + private Dictionary m_Commands; + + public override IReadOnlyDictionary Commands => m_Commands; + + public IAppletAccessor() + { + m_Commands = new Dictionary() + { + { 0, GetAppletStateChangedEvent }, + { 1, IsCompleted }, + { 10, Start }, + { 20, RequestExit }, + { 25, Terminate }, + { 30, GetResult } + }; + } + + public long GetAppletStateChangedEvent(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + return 0; + } + + public long IsCompleted(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + return 0; + } + + public long Start(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + return 0; + } + + public long RequestExit(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + return 0; + } + + public long Terminate(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + return 0; + } + + public long GetResult(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + return 0; + } + } +} diff --git a/Ryujinx.Core/OsHle/Services/Am/IApplicationAccessor.cs b/Ryujinx.Core/OsHle/Services/Am/IApplicationAccessor.cs new file mode 100644 index 0000000000..85c081d109 --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Am/IApplicationAccessor.cs @@ -0,0 +1,36 @@ +using Ryujinx.Core.Logging; +using Ryujinx.Core.OsHle.Ipc; +using System.Collections.Generic; + +namespace Ryujinx.Core.OsHle.Services.Am +{ + class IApplicationAccessor : IpcService + { + private Dictionary m_Commands; + + public override IReadOnlyDictionary Commands => m_Commands; + + public IApplicationAccessor() + { + m_Commands = new Dictionary() + { + { 112, GetCurrentLibraryApplet }, + { 121, PushLaunchParameter } + }; + } + + public long GetCurrentLibraryApplet(ServiceCtx Context) + { + MakeObject(Context, new IAppletAccessor()); + + return 0; + } + + public long PushLaunchParameter(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + return 0; + } + } +} diff --git a/Ryujinx.HLE/OsHle/Services/Am/IApplicationCreator.cs b/Ryujinx.HLE/OsHle/Services/Am/IApplicationCreator.cs index 6ee5b5c2e5..e0aec6b2c6 100644 --- a/Ryujinx.HLE/OsHle/Services/Am/IApplicationCreator.cs +++ b/Ryujinx.HLE/OsHle/Services/Am/IApplicationCreator.cs @@ -13,8 +13,39 @@ namespace Ryujinx.HLE.OsHle.Services.Am { m_Commands = new Dictionary() { - //... + { 0, CreateApplication }, + { 1, PopLaunchRequestedApplication }, + { 10, CreateSystemApplication }, + { 100, PopFloatingApplicationForDevelopment } }; } + + public long CreateApplication(ServiceCtx Context) + { + MakeObject(Context, new IApplicationAccessor()); + + return 0; + } + + public long PopLaunchRequestedApplication(ServiceCtx Context) + { + MakeObject(Context, new IApplicationAccessor()); + + return 0; + } + + public long CreateSystemApplication(ServiceCtx Context) + { + MakeObject(Context, new IApplicationAccessor()); + + return 0; + } + + public long PopFloatingApplicationForDevelopment(ServiceCtx Context) + { + MakeObject(Context, new IApplicationAccessor()); + + return 0; + } } -} \ No newline at end of file +} diff --git a/Ryujinx.HLE/OsHle/Services/Am/IApplicationFunctions.cs b/Ryujinx.HLE/OsHle/Services/Am/IApplicationFunctions.cs index e25b524abb..ba700a8ae3 100644 --- a/Ryujinx.HLE/OsHle/Services/Am/IApplicationFunctions.cs +++ b/Ryujinx.HLE/OsHle/Services/Am/IApplicationFunctions.cs @@ -100,6 +100,9 @@ namespace Ryujinx.HLE.OsHle.Services.Am public long InitializeGamePlayRecording(ServiceCtx Context) { + //TODO: add a TransferMemory Handle + long Size = Context.RequestData.ReadInt64(); + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0;