From f4a2e7c925f631d6b9d4cda054e71be37269c73e Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 10 Nov 2023 11:28:37 -0500 Subject: [PATCH] IDebugFunctions, IOverlayFunctions, IAppletCommonFunctions --- .../Ipc/Controllers/AppletCommonFunctions.cs | 163 ++++++++++++++ .../Am/Ipc/Controllers/DebugFunctions.cs | 202 ++++++++++++++++++ .../Am/Ipc/Controllers/OverlayFunctions.cs | 130 +++++++++++ .../Am/Controllers/IAppletCommonFunctions.cs | 28 +++ .../Sdk/Am/Controllers/IDebugFunctions.cs | 32 +++ .../Sdk/Am/Controllers/IOverlayFunctions.cs | 23 ++ 6 files changed, 578 insertions(+) create mode 100644 src/Ryujinx.Horizon/Am/Ipc/Controllers/AppletCommonFunctions.cs create mode 100644 src/Ryujinx.Horizon/Am/Ipc/Controllers/DebugFunctions.cs create mode 100644 src/Ryujinx.Horizon/Am/Ipc/Controllers/OverlayFunctions.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Am/Controllers/IAppletCommonFunctions.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Am/Controllers/IDebugFunctions.cs create mode 100644 src/Ryujinx.Horizon/Sdk/Am/Controllers/IOverlayFunctions.cs diff --git a/src/Ryujinx.Horizon/Am/Ipc/Controllers/AppletCommonFunctions.cs b/src/Ryujinx.Horizon/Am/Ipc/Controllers/AppletCommonFunctions.cs new file mode 100644 index 000000000..020c7b300 --- /dev/null +++ b/src/Ryujinx.Horizon/Am/Ipc/Controllers/AppletCommonFunctions.cs @@ -0,0 +1,163 @@ +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 AppletCommonFunctions : IAppletCommonFunctions + + { + [CmifCommand(0)] + public Result SetTerminateResult() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(10)] + public Result ReadThemeStorage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(11)] + public Result WriteThemeStorage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(20)] + public Result PushToAppletBoundChannel() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(21)] + public Result TryPopFromAppletBoundChannel() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(40)] + public Result GetDisplayLogicalResolution() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(42)] + public Result SetDisplayMagnification() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(50)] + public Result SetHomeButtonDoubleClickEnabled() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(51)] + public Result GetHomeButtonDoubleClickEnabled() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(52)] + public Result IsHomeButtonShortPressedBlocked() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(60)] + public Result IsVrModeCurtainRequired() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(61)] + public Result IsSleepRequiredByHighTemperature() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(62)] + public Result IsSleepRequiredByLowBattery() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(70)] + public Result SetCpuBoostRequestPriority() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(80)] + public Result SetHandlingCaptureButtonShortPressedMessageEnabledForApplet() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(81)] + public Result SetHandlingCaptureButtonLongPressedMessageEnabledForApplet() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(90)] + public Result OpenNamedChannelAsParent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(91)] + public Result OpenNamedChannelAsChild() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(100)] + public Result SetApplicationCoreUsageMode() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + } +} diff --git a/src/Ryujinx.Horizon/Am/Ipc/Controllers/DebugFunctions.cs b/src/Ryujinx.Horizon/Am/Ipc/Controllers/DebugFunctions.cs new file mode 100644 index 000000000..2015351cd --- /dev/null +++ b/src/Ryujinx.Horizon/Am/Ipc/Controllers/DebugFunctions.cs @@ -0,0 +1,202 @@ +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 DebugFunctions : IDebugFunctions + { + [CmifCommand(0)] + public Result NotifyMessageToHomeMenuForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(1)] + public Result OpenMainApplication() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(10)] + public Result PerformSystemButtonPressing() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(20)] + public Result InvalidateTransitionLayer() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(30)] + public Result RequestLaunchApplicationWithUserAndArgumentForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(31)] + public Result RequestLaunchApplicationByApplicationLaunchInfoForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(40)] + public Result GetAppletResourceUsageInfo() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(50)] + public Result AddSystemProgramIdAndAppletIdForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(51)] + public Result AddOperationConfirmedLibraryAppletIdForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(52)] + public Result GetProgramIdFromAppletIdForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(100)] + public Result SetCpuBoostModeForApplet() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(101)] + public Result CancelCpuBoostModeForApplet() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(110)] + public Result PushToAppletBoundChannelForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(111)] + public Result TryPopFromAppletBoundChannelForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(120)] + public Result AlarmSettingNotificationEnableAppEventReserve() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(121)] + public Result AlarmSettingNotificationDisableAppEventReserve() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(122)] + public Result AlarmSettingNotificationPushAppEventNotify() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(130)] + public Result FriendInvitationSetApplicationParameter() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(131)] + public Result FriendInvitationClearApplicationParameter() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(132)] + public Result FriendInvitationPushApplicationParameter() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(140)] + public Result RestrictPowerOperationForSecureLaunchModeForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(200)] + public Result CreateFloatingLibraryAppletAccepterForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(300)] + public Result TerminateAllRunningApplicationsForDebug() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(900)] + public Result GetGrcProcessLaunchedSystemEvent() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + } +} diff --git a/src/Ryujinx.Horizon/Am/Ipc/Controllers/OverlayFunctions.cs b/src/Ryujinx.Horizon/Am/Ipc/Controllers/OverlayFunctions.cs new file mode 100644 index 000000000..c56c982b0 --- /dev/null +++ b/src/Ryujinx.Horizon/Am/Ipc/Controllers/OverlayFunctions.cs @@ -0,0 +1,130 @@ +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 OverlayFunctions : IOverlayFunctions + { + [CmifCommand(0)] + public Result BeginToWatchShortHomeButtonMessage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(1)] + public Result EndToWatchShortHomeButtonMessage() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(2)] + public Result GetApplicationIdForLogo() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(3)] + public Result SetGpuTimeSliceBoost() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(4)] + public Result SetAutoSleepTimeAndDimmingTimeEnabled() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(5)] + public Result TerminateApplicationAndSetReason() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(6)] + public Result SetScreenShotPermissionGlobally() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(10)] + public Result StartShutdownSequenceForOverlay() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(11)] + public Result StartRebootSequenceForOverlay() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(20)] + public Result SetHandlingHomeButtonShortPressedEnabled() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(21)] + public Result SetHandlingTouchScreenInputEnabled() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(30)] + public Result SetHealthWarningShowingState() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(31)] + public Result IsHealthWarningRequired() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(90)] + public Result SetRequiresGpuResourceUse() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + + [CmifCommand(101)] + public Result BeginToObserveHidInputForDevelop() + { + Logger.Stub?.PrintStub(LogClass.ServiceAm); + + return Result.Success; + } + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Am/Controllers/IAppletCommonFunctions.cs b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IAppletCommonFunctions.cs new file mode 100644 index 000000000..582bcb381 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IAppletCommonFunctions.cs @@ -0,0 +1,28 @@ +using Ryujinx.Horizon.Common; + +namespace Ryujinx.Horizon.Sdk.Am.Controllers +{ + public interface IAppletCommonFunctions + { + Result SetTerminateResult(); + Result ReadThemeStorage(); + Result WriteThemeStorage(); + Result PushToAppletBoundChannel(); + Result TryPopFromAppletBoundChannel(); + Result GetDisplayLogicalResolution(); + Result SetDisplayMagnification(); + Result SetHomeButtonDoubleClickEnabled(); + Result GetHomeButtonDoubleClickEnabled(); + Result IsHomeButtonShortPressedBlocked(); + Result IsVrModeCurtainRequired(); + Result IsSleepRequiredByHighTemperature(); + Result IsSleepRequiredByLowBattery(); + Result SetCpuBoostRequestPriority(); + Result SetHandlingCaptureButtonShortPressedMessageEnabledForApplet(); + Result SetHandlingCaptureButtonLongPressedMessageEnabledForApplet(); + Result OpenNamedChannelAsParent(); + Result OpenNamedChannelAsChild(); + Result SetApplicationCoreUsageMode(); + // 300 (17.0.0+) Unknown Function + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Am/Controllers/IDebugFunctions.cs b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IDebugFunctions.cs new file mode 100644 index 000000000..cf46a4357 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IDebugFunctions.cs @@ -0,0 +1,32 @@ +using Ryujinx.Horizon.Common; + +namespace Ryujinx.Horizon.Sdk.Am.Controllers +{ + public interface IDebugFunctions + { + Result NotifyMessageToHomeMenuForDebug(); + Result OpenMainApplication(); + Result PerformSystemButtonPressing(); + Result InvalidateTransitionLayer(); + Result RequestLaunchApplicationWithUserAndArgumentForDebug(); + Result RequestLaunchApplicationByApplicationLaunchInfoForDebug(); + Result GetAppletResourceUsageInfo(); + Result AddSystemProgramIdAndAppletIdForDebug(); + Result AddOperationConfirmedLibraryAppletIdForDebug(); + Result GetProgramIdFromAppletIdForDebug(); + Result SetCpuBoostModeForApplet(); + Result CancelCpuBoostModeForApplet(); + Result PushToAppletBoundChannelForDebug(); + Result TryPopFromAppletBoundChannelForDebug(); + Result AlarmSettingNotificationEnableAppEventReserve(); + Result AlarmSettingNotificationDisableAppEventReserve(); + Result AlarmSettingNotificationPushAppEventNotify(); + Result FriendInvitationSetApplicationParameter(); + Result FriendInvitationClearApplicationParameter(); + Result FriendInvitationPushApplicationParameter(); + Result RestrictPowerOperationForSecureLaunchModeForDebug(); + Result CreateFloatingLibraryAppletAccepterForDebug(); + Result TerminateAllRunningApplicationsForDebug(); + Result GetGrcProcessLaunchedSystemEvent(); + } +} diff --git a/src/Ryujinx.Horizon/Sdk/Am/Controllers/IOverlayFunctions.cs b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IOverlayFunctions.cs new file mode 100644 index 000000000..021ae8dc0 --- /dev/null +++ b/src/Ryujinx.Horizon/Sdk/Am/Controllers/IOverlayFunctions.cs @@ -0,0 +1,23 @@ +using Ryujinx.Horizon.Common; + +namespace Ryujinx.Horizon.Sdk.Am.Controllers +{ + public interface IOverlayFunctions + { + Result BeginToWatchShortHomeButtonMessage(); + Result EndToWatchShortHomeButtonMessage(); + Result GetApplicationIdForLogo(); + Result SetGpuTimeSliceBoost(); + Result SetAutoSleepTimeAndDimmingTimeEnabled(); + Result TerminateApplicationAndSetReason(); + Result SetScreenShotPermissionGlobally(); + Result StartShutdownSequenceForOverlay(); + Result StartRebootSequenceForOverlay(); + Result SetHandlingHomeButtonShortPressedEnabled(); + Result SetHandlingTouchScreenInputEnabled(); + Result SetHealthWarningShowingState(); + Result IsHealthWarningRequired(); + Result SetRequiresGpuResourceUse(); + Result BeginToObserveHidInputForDevelop(); + } +}