diff --git a/src/Ryujinx.Horizon/Am/Ipc/Controllers/ApplicationFunctions.cs b/src/Ryujinx.Horizon/Am/Ipc/Controllers/ApplicationFunctions.cs new file mode 100644 index 000000000..07b6aced1 --- /dev/null +++ b/src/Ryujinx.Horizon/Am/Ipc/Controllers/ApplicationFunctions.cs @@ -0,0 +1,506 @@ +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 ApplicationFunctions : IApplicationFunctions + { + [CmifCommand(1)] + public Result PopLaunchParameter() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(10)] + public Result CreateApplicationAndPushAndRequestToStart() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(11)] + public Result CreateApplicationAndPushAndRequestToStartForQuest() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(12)] + public Result CreateApplicationAndRequestToStart() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(13)] + public Result CreateApplicationAndRequestToStartForQuest() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(14)] + public Result CreateApplicationWithAttributeAndPushAndRequestToStartForQuest() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(15)] + public Result CreateApplicationWithAttributeAndRequestToStartForQuest() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(20)] + public Result EnsureSaveData() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(21)] + public Result GetDesiredLanguage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(22)] + public Result SetTerminateResult() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(23)] + public Result GetDisplayVersion() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(24)] + public Result GetLaunchStorageInfoForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(25)] + public Result ExtendSaveData() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(26)] + public Result GetSaveDataSize() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(27)] + public Result CreateCacheStorage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(28)] + public Result GetSaveDataSizeMax() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(29)] + public Result GetCacheStorageMax() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(30)] + public Result BeginBlockingHomeButtonShortAndLongPressed() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(31)] + public Result EndBlockingHomeButtonShortAndLongPressed() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(32)] + public Result BeginBlockingHomeButton() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(33)] + public Result EndBlockingHomeButton() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(34)] + public Result SelectApplicationLicense() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(35)] + public Result GetDeviceSaveDataSizeMax() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(36)] + public Result GetLimitedApplicationLicense() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(37)] + public Result GetLimitedApplicationLicenseUpgradableEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(40)] + public Result NotifyRunning() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(50)] + public Result GetPseudoDeviceId() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(60)] + public Result SetMediaPlaybackStateForApplication() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(65)] + public Result IsGamePlayRecordingSupported() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(66)] + public Result InitializeGamePlayRecording() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(67)] + public Result SetGamePlayRecordingState() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(68)] + public Result RequestFlushGamePlayingMovieForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(70)] + public Result RequestToShutdown() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(71)] + public Result RequestToReboot() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(72)] + public Result RequestToSleep() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(80)] + public Result ExitAndRequestToShowThanksMessage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(90)] + public Result EnableApplicationCrashReport() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(100)] + public Result InitializeApplicationCopyrightFrameBuffer() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(101)] + public Result SetApplicationCopyrightImage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(102)] + public Result SetApplicationCopyrightVisibility() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(110)] + public Result QueryApplicationPlayStatistics() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(111)] + public Result QueryApplicationPlayStatisticsByUid() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(120)] + public Result ExecuteProgram() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(121)] + public Result ClearUserChannel() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(122)] + public Result UnpopToUserChannel() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(123)] + public Result GetPreviousProgramIndex() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(124)] + public Result EnableApplicationAllThreadDumpOnCrash() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(130)] + public Result GetGpuErrorDetectedSystemEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(131)] + public Result SetDelayTimeToAbortOnGpuError() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(140)] + public Result GetFriendInvitationStorageChannelEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(141)] + public Result TryPopFromFriendInvitationStorageChannel() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(150)] + public Result GetNotificationStorageChannelEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(151)] + public Result TryPopFromNotificationStorageChannel() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(160)] + public Result GetHealthWarningDisappearedSystemEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(170)] + public Result SetHdcpAuthenticationActivated() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(180)] + public Result GetLaunchRequiredVersion() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(181)] + public Result UpgradeLaunchRequiredVersion() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(190)] + public Result SendServerMaintenanceOverlayNotification() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(200)] + public Result GetLastApplicationExitReason() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(500)] + public Result StartContinuousRecordingFlushForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(1000)] + public Result CreateMovieMaker() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(1001)] + public Result PrepareForJit() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + } +} diff --git a/src/Ryujinx.Horizon/Am/Ipc/Controllers/LibraryAppletCreator.cs b/src/Ryujinx.Horizon/Am/Ipc/Controllers/LibraryAppletCreator.cs new file mode 100644 index 000000000..80e49daf3 --- /dev/null +++ b/src/Ryujinx.Horizon/Am/Ipc/Controllers/LibraryAppletCreator.cs @@ -0,0 +1,58 @@ +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 LibraryAppletCreator : ILibraryAppletCreator + { + [CmifCommand(0)] + public Result CreateLibraryApplet() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(1)] + public Result TerminateAllLibraryApplets() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(2)] + public Result AreAnyLibraryAppletsLeft() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(10)] + public Result CreateStorage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(11)] + public Result CreateTransferMemoryStorage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(12)] + public Result CreateHandleStorage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Am/Controllers/IApplicationFunctions.cs b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IApplicationFunctions.cs new file mode 100644 index 000000000..889a9e794 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IApplicationFunctions.cs @@ -0,0 +1,70 @@ +using Ryujinx.Horizon.Common; + +namespace Ryujinx.Horizon.Sdk.Am.Controllers +{ + public interface IApplicationFunctions + { + Result PopLaunchParameter(); + Result CreateApplicationAndPushAndRequestToStart(); + Result CreateApplicationAndPushAndRequestToStartForQuest(); + Result CreateApplicationAndRequestToStart(); + Result CreateApplicationAndRequestToStartForQuest(); + Result CreateApplicationWithAttributeAndPushAndRequestToStartForQuest(); + Result CreateApplicationWithAttributeAndRequestToStartForQuest(); + Result EnsureSaveData(); + Result GetDesiredLanguage(); + Result SetTerminateResult(); + Result GetDisplayVersion(); + Result GetLaunchStorageInfoForDebug(); + Result ExtendSaveData(); + Result GetSaveDataSize(); + Result CreateCacheStorage(); + Result GetSaveDataSizeMax(); + Result GetCacheStorageMax(); + Result BeginBlockingHomeButtonShortAndLongPressed(); + Result EndBlockingHomeButtonShortAndLongPressed(); + Result BeginBlockingHomeButton(); + Result EndBlockingHomeButton(); + Result SelectApplicationLicense(); + Result GetDeviceSaveDataSizeMax(); + Result GetLimitedApplicationLicense(); + Result GetLimitedApplicationLicenseUpgradableEvent(); + Result NotifyRunning(); + Result GetPseudoDeviceId(); + Result SetMediaPlaybackStateForApplication(); + Result IsGamePlayRecordingSupported(); + Result InitializeGamePlayRecording(); + Result SetGamePlayRecordingState(); + Result RequestFlushGamePlayingMovieForDebug(); + Result RequestToShutdown(); + Result RequestToReboot(); + Result RequestToSleep(); + Result ExitAndRequestToShowThanksMessage(); + Result EnableApplicationCrashReport(); + Result InitializeApplicationCopyrightFrameBuffer(); + Result SetApplicationCopyrightImage(); + Result SetApplicationCopyrightVisibility(); + Result QueryApplicationPlayStatistics(); + Result QueryApplicationPlayStatisticsByUid(); + Result ExecuteProgram(); + Result ClearUserChannel(); + Result UnpopToUserChannel(); + Result GetPreviousProgramIndex(); + Result EnableApplicationAllThreadDumpOnCrash(); + Result GetGpuErrorDetectedSystemEvent(); + Result SetDelayTimeToAbortOnGpuError(); + Result GetFriendInvitationStorageChannelEvent(); + Result TryPopFromFriendInvitationStorageChannel(); + Result GetNotificationStorageChannelEvent(); + Result TryPopFromNotificationStorageChannel(); + Result GetHealthWarningDisappearedSystemEvent(); + Result SetHdcpAuthenticationActivated(); + Result GetLaunchRequiredVersion(); + Result UpgradeLaunchRequiredVersion(); + Result SendServerMaintenanceOverlayNotification(); + Result GetLastApplicationExitReason(); + Result StartContinuousRecordingFlushForDebug(); + Result CreateMovieMaker(); + Result PrepareForJit(); + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Am/Controllers/ILibraryAppletCreator.cs b/src/Ryujinx.Horizon/Sdk/Am/Controllers/ILibraryAppletCreator.cs new file mode 100644 index 000000000..f25b6b4e6 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Am/Controllers/ILibraryAppletCreator.cs @@ -0,0 +1,14 @@ +using Ryujinx.Horizon.Common; + +namespace Ryujinx.Horizon.Sdk.Am.Controllers +{ + public interface ILibraryAppletCreator + { + Result CreateLibraryApplet(); + Result TerminateAllLibraryApplets(); + Result AreAnyLibraryAppletsLeft(); + Result CreateStorage(); + Result CreateTransferMemoryStorage(); + Result CreateHandleStorage(); + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Am/Controllers/IProcessWindingController.cs b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IProcessWindingController.cs new file mode 100644 index 000000000..7e31e516f --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IProcessWindingController.cs @@ -0,0 +1,16 @@ +using Ryujinx.Horizon.Common; + +namespace Ryujinx.Horizon.Sdk.Am.Controllers +{ + public interface IProcessWindingController + { + Result GetLaunchReason(); + Result OpenCallingLibraryApplet(); + Result PushContext(); + Result PopContext(); + Result CancelWindingReservation(); + Result WindAndDoReserved(); + Result ReserveToStartAndWaitAndUnwindThis(); + Result ReserveToStartAndWait(); + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Am/Controllers/ProcessWindingController.cs b/src/Ryujinx.Horizon/Sdk/Am/Controllers/ProcessWindingController.cs new file mode 100644 index 000000000..19969b319 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Am/Controllers/ProcessWindingController.cs @@ -0,0 +1,73 @@ +using Ryujinx.Common.Logging; +using Ryujinx.Horizon.Common; +using Ryujinx.Horizon.Sdk.Sf; + +namespace Ryujinx.Horizon.Sdk.Am.Controllers +{ + partial class ProcessWindingController : IProcessWindingController + { + [CmifCommand(0)] + public Result GetLaunchReason() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(11)] + public Result OpenCallingLibraryApplet() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(21)] + public Result PushContext() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(22)] + public Result PopContext() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(23)] + public Result CancelWindingReservation() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(30)] + public Result WindAndDoReserved() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(40)] + public Result ReserveToStartAndWaitAndUnwindThis() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(41)] + public Result ReserveToStartAndWait() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + } +}