From 105e4b448c13d45f8e5296df0cce284b89f7d112 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 10 Nov 2023 11:52:19 -0500 Subject: [PATCH] ILibraryAppletSelfAccessor --- .../Controllers/LibraryAppletSelfAccessor.cs | 290 ++++++++++++++++++ .../Am/Ipc/Proxies/LibraryAppletProxy.cs | 6 +- .../Am/Ipc/Proxies/OverlayAppletProxy.cs | 1 - .../Controllers/ILibraryAppletSelfAccessor.cs | 44 +++ .../Sdk/Am/Proxies/ILibraryAppletProxy.cs | 2 +- 5 files changed, 339 insertions(+), 4 deletions(-) create mode 100644 src/Ryujinx.Horizon/Am/Ipc/Controllers/LibraryAppletSelfAccessor.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Am/Controllers/ILibraryAppletSelfAccessor.cs diff --git a/src/Ryujinx.Horizon/Am/Ipc/Controllers/LibraryAppletSelfAccessor.cs b/src/Ryujinx.Horizon/Am/Ipc/Controllers/LibraryAppletSelfAccessor.cs new file mode 100644 index 000000000..51075f668 --- /dev/null +++ b/src/Ryujinx.Horizon/Am/Ipc/Controllers/LibraryAppletSelfAccessor.cs @@ -0,0 +1,290 @@ +using Ryujinx.Common.Logging; +using Ryujinx.Horizon.Common; +using Ryujinx.Horizon.Sdk.Am.Controllers; +using Ryujinx.Horizon.Sdk.Sf; + +namespace Ryujinx.Horizon.Am.Ipc.Controllers +{ + partial class LibraryAppletSelfAccessor : ILibraryAppletSelfAccessor + { + [CmifCommand(0)] + public Result PopInData() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(1)] + public Result PushOutData() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(2)] + public Result PopInteractiveInData() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(3)] + public Result PushInteractiveOutData() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(5)] + public Result GetPopInDataEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(6)] + public Result GetPopInteractiveInDataEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(10)] + public Result ExitProcessAndReturn() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(11)] + public Result GetLibraryAppletInfo() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(12)] + public Result GetMainAppletIdentityInfo() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(13)] + public Result CanUseApplicationCore() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(14)] + public Result GetCallerAppletIdentityInfo() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(15)] + public Result GetMainAppletApplicationControlProperty() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(16)] + public Result GetMainAppletStorageId() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(17)] + public Result GetCallerAppletIdentityInfoStack() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(18)] + public Result GetNextReturnDestinationAppletIdentityInfo() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(19)] + public Result GetDesirableKeyboardLayout() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(20)] + public Result PopExtraStorage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(25)] + public Result GetPopExtraStorageEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(30)] + public Result UnpopInData() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(31)] + public Result UnpopExtraStorage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(40)] + public Result GetIndirectLayerProducerHandle() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(50)] + public Result ReportVisibleError() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(51)] + public Result ReportVisibleErrorWithErrorContext() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(60)] + public Result GetMainAppletApplicationDesiredLanguage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(70)] + public Result GetCurrentApplicationId() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(80)] + public Result RequestExitToSelf() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(90)] + public Result CreateApplicationAndPushAndRequestToLaunch() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(100)] + public Result CreateGameMovieTrimmer() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(101)] + public Result ReserveResourceForMovieOperation() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(102)] + public Result UnreserveResourceForMovieOperation() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(110)] + public Result GetMainAppletAvailableUsers() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(120)] + public Result GetLaunchStorageInfoForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(130)] + public Result GetGpuErrorDetectedSystemEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(140)] + public Result SetApplicationMemoryReservation() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(150)] + public Result ShouldSetGpuTimeSliceManually() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + } +} diff --git a/src/Ryujinx.Horizon/Am/Ipc/Proxies/LibraryAppletProxy.cs b/src/Ryujinx.Horizon/Am/Ipc/Proxies/LibraryAppletProxy.cs index b0188e3d8..1dfe5a700 100644 --- a/src/Ryujinx.Horizon/Am/Ipc/Proxies/LibraryAppletProxy.cs +++ b/src/Ryujinx.Horizon/Am/Ipc/Proxies/LibraryAppletProxy.cs @@ -65,9 +65,11 @@ namespace Ryujinx.Horizon.Am.Ipc.Proxies } [CmifCommand(20)] - public Result OpenLibraryAppletSelfAccessor() + public Result OpenLibraryAppletSelfAccessor(out ILibraryAppletSelfAccessor libraryAppletSelfAccessor) { - throw new System.NotImplementedException(); + libraryAppletSelfAccessor = new LibraryAppletSelfAccessor(); + + return Result.Success; } [CmifCommand(21)] diff --git a/src/Ryujinx.Horizon/Am/Ipc/Proxies/OverlayAppletProxy.cs b/src/Ryujinx.Horizon/Am/Ipc/Proxies/OverlayAppletProxy.cs index d47d42a82..2ee496d2d 100644 --- a/src/Ryujinx.Horizon/Am/Ipc/Proxies/OverlayAppletProxy.cs +++ b/src/Ryujinx.Horizon/Am/Ipc/Proxies/OverlayAppletProxy.cs @@ -54,7 +54,6 @@ namespace Ryujinx.Horizon.Am.Ipc.Proxies processWindingController = new ProcessWindingController(); return Result.Success; - throw new System.NotImplementedException(); } [CmifCommand(11)] diff --git a/src/Ryujinx.Horizon/Sdk/Am/Controllers/ILibraryAppletSelfAccessor.cs b/src/Ryujinx.Horizon/Sdk/Am/Controllers/ILibraryAppletSelfAccessor.cs new file mode 100644 index 000000000..844fee360 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Am/Controllers/ILibraryAppletSelfAccessor.cs @@ -0,0 +1,44 @@ +using Ryujinx.Horizon.Common; + +namespace Ryujinx.Horizon.Sdk.Am.Controllers +{ + public interface ILibraryAppletSelfAccessor + { + Result PopInData(); + Result PushOutData(); + Result PopInteractiveInData(); + Result PushInteractiveOutData(); + Result GetPopInDataEvent(); + Result GetPopInteractiveInDataEvent(); + Result ExitProcessAndReturn(); + Result GetLibraryAppletInfo(); + Result GetMainAppletIdentityInfo(); + Result CanUseApplicationCore(); + Result GetCallerAppletIdentityInfo(); + Result GetMainAppletApplicationControlProperty(); + Result GetMainAppletStorageId(); + Result GetCallerAppletIdentityInfoStack(); + Result GetNextReturnDestinationAppletIdentityInfo(); + Result GetDesirableKeyboardLayout(); + Result PopExtraStorage(); + Result GetPopExtraStorageEvent(); + Result UnpopInData(); + Result UnpopExtraStorage(); + Result GetIndirectLayerProducerHandle(); + Result ReportVisibleError(); + Result ReportVisibleErrorWithErrorContext(); + Result GetMainAppletApplicationDesiredLanguage(); + Result GetCurrentApplicationId(); + Result RequestExitToSelf(); + Result CreateApplicationAndPushAndRequestToLaunch(); + Result CreateGameMovieTrimmer(); + Result ReserveResourceForMovieOperation(); + Result UnreserveResourceForMovieOperation(); + Result GetMainAppletAvailableUsers(); + Result GetLaunchStorageInfoForDebug(); + Result GetGpuErrorDetectedSystemEvent(); + Result SetApplicationMemoryReservation(); + Result ShouldSetGpuTimeSliceManually(); + // 160 (17.0.0+) Unknown Function + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Am/Proxies/ILibraryAppletProxy.cs b/src/Ryujinx.Horizon/Sdk/Am/Proxies/ILibraryAppletProxy.cs index 7c6204926..c1f056a31 100644 --- a/src/Ryujinx.Horizon/Sdk/Am/Proxies/ILibraryAppletProxy.cs +++ b/src/Ryujinx.Horizon/Sdk/Am/Proxies/ILibraryAppletProxy.cs @@ -12,7 +12,7 @@ namespace Ryujinx.Horizon.Sdk.Am.Proxies Result GetDisplayController(out IDisplayController displayController); Result GetProcessWindingController(out IProcessWindingController processWindingController); Result GetLibraryAppletCreator(out ILibraryAppletCreator libraryAppletCreator); - Result OpenLibraryAppletSelfAccessor(); + Result OpenLibraryAppletSelfAccessor(out ILibraryAppletSelfAccessor libraryAppletSelfAccessor); Result GetAppletCommonFunctions(out IAppletCommonFunctions appletCommonFunctions); Result GetHomeMenuFunctions(); Result GetGlobalStateController();