Applet Manager services: Difference between revisions

 
(41 intermediate revisions by 4 users not shown)
Line 19: Line 19:
|-
|-
| 300 || OpenOverlayAppletProxy || Returns an [[#IOverlayAppletProxy]].
| 300 || OpenOverlayAppletProxy || Returns an [[#IOverlayAppletProxy]].
|-
| 310 || [S2] || Returns an [[#ICMenuProxy|ICMenuProxy]].
|-
|-
| 350 || OpenSystemApplicationProxy || Returns an [[#IApplicationProxy]].
| 350 || OpenSystemApplicationProxy || Returns an [[#IApplicationProxy]].
Line 29: Line 31:
|-
|-
| 460 || [20.0.0+] || Returns an [[#IAppletAlternativeFunctions]].
| 460 || [20.0.0+] || Returns an [[#IAppletAlternativeFunctions]].
|-
| 500 || [S2] || Returns an [[#IChatProxy|IChatProxy]].
|-
|-
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
Line 276: Line 280:
|-
|-
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]
|-
| 100 || [S2]
|}
|}


Line 334: Line 340:
==== OpenCradleFirmwareUpdater ====
==== OpenCradleFirmwareUpdater ====
No input, returns an [[#ICradleFirmwareUpdater]].
No input, returns an [[#ICradleFirmwareUpdater]].
==== Cmd100 ====
No input, returns an output handle.


=== ICradleFirmwareUpdater ===
=== ICradleFirmwareUpdater ===
Line 633: Line 642:
| 100 || [15.0.0+] SetApplicationCoreUsageMode
| 100 || [15.0.0+] SetApplicationCoreUsageMode
|-
|-
| 160 || [18.0.0+] GetNotificationReceiverService
| 110 || [S2]
|-
| 111 || [S2]
|-
| 112 || [S2]
|-
| 113 || [S2]
|-
| 114 || [S2]
|-
| 115 || [S2]
|-
| 116 || [S2]
|-
| 117 || [S2]
|-
| 118 || [S2]
|-
| 119 || [S2]
|-
| 120 || [S2]
|-
|-
| 161 || [18.0.0+] GetNotificationSenderService
| 121 || [S2]
|-
| 122 || [S2]
|-
| 123 || [S2]
|-
| 124 || [S2]
|-
| 130 || [S2]
|-
| 131 || [S2] [20.0.0+]
|-
| 135 || [S2] [20.0.0+]
|-
| 140 || [S2]
|-
| 150 || [S2]
|-
| 160 || [18.0.0+] [[#GetNotificationReceiverService|GetNotificationReceiverService]]
|-
| 161 || [18.0.0+] [[#GetNotificationSenderService|GetNotificationSenderService]]
|-
| 170 || [S2]
|-
| 171 || [S2]
|-
| 200 || [S2]
|-
| 210 || [S2]
|-
| 211 || [S2]
|-
| 220 || [S2]
|-
| 221 || [S2]
|-
| 230 || [S2]
|-
| 231 || [S2]
|-
| 250 || [S2]
|-
| 251 || [S2]
|-
| 252 || [S2]
|-
| 253 || [S2]
|-
| 260 || [S2]
|-
| 271 || [S2] [20.0.0+]
|-
| 280 || [S2] [20.0.0+]
|-
| 290 || [S2] [20.0.0+] RequestChatProhibition
|-
| 291 || [S2] [20.0.0+] RequestChatExpirationCheckSkip
|-
|-
| 300 || [17.0.0+] GetCurrentApplicationId
| 300 || [17.0.0+] GetCurrentApplicationId
Line 660: Line 745:
|-
|-
| 360 || [20.0.0+]
| 360 || [20.0.0+]
|-
| 370 || [22.0.0+] GetGpuErrorEventForApplet
|-
| 2000 || [S2]
|-
| 2010 || [S2]
|-
| 3000 || [S2] [20.0.0+]
|-
| 3010 || [S2] [20.0.0+]
|}
|}


Line 705: Line 800:
Takes an input s32, no output.
Takes an input s32, no output.


== ILibraryAppletProxy ==
=== GetNotificationReceiverService ===
This is "nn::am::service::ILibraryAppletProxy".
No input, returns an [[#IReceiverService|IReceiverService]].
 
=== GetNotificationSenderService ===
No input, returns an [[#ISenderService|ISenderService]].
 
=== IReceiverService ===
This is "nn::am::service::IReceiverService".
 
This was added with [18.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
| 0 ||  
|}
 
==== Cmd0 ====
No input, returns an [[#INotificationReceiver|INotificationReceiver]].
 
==== INotificationReceiver ====
This is "nn::am::service::INotificationReceiver".
 
This was added with [18.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
! Cmd || Name
|-
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
| 0 || AddSource
|-
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
| 1 || RemoveSource
|-
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
| 2 || GetEvent
|-
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
| 3 || Receive
|-
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 4 || ReceiveWithTick
|-
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}
|}


=== ILibraryAppletSelfAccessor ===
===== GetEvent =====
This is "nn::am::service::ILibraryAppletSelfAccessor".
Unofficial name.
 
No input, returns an Event handle.
 
===== ReceiveWithTick =====
Unofficial name.
 
=== ISenderService ===
This is "nn::am::service::ISenderService".
 
This was added with [18.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || [[#PopInData]] ||
| 0 ||  
|}
 
==== Cmd0 ====
Takes a total of 0x18-bytes of input, returns an [[#INotificationSender|INotificationSender]].
 
=== INotificationSender ===
This is "nn::am::service::INotificationSender".
 
This was added with [18.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 1 || [[#PushOutData]] ||  
! Cmd || Name
|-
|-
| 2 || [[#PopInteractiveInData]] ||  
| 0 || Send
|-
|-
| 3 || [[#PushInteractiveOutData]] ||  
| 1 || GetUnreceivedMessageCount
|}
 
== ILibraryAppletProxy ==
This is "nn::am::service::ILibraryAppletProxy".
 
{| class="wikitable" border="1"
|-
|-
| 5 || [[#GetPopInDataEvent]] ||
! Cmd || Name || Notes
|-
|-
| 6 || [[#GetPopInteractiveInDataEvent]] ||
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
|-
| 10 || [[#ExitProcessAndReturn]] ||
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
|-
| 11 || [[#GetLibraryAppletInfo]] ||
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
|-
| 12 || [[#GetMainAppletIdentityInfo]] ||
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
|-
| 13 || [[#CanUseApplicationCore]] ||
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
|-
| 14 || [[#GetCallerAppletIdentityInfo]] ||
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
|-
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}
 
=== ILibraryAppletSelfAccessor ===
This is "nn::am::service::ILibraryAppletSelfAccessor".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#PopInData]] ||
|-
| 1 || [[#PushOutData]] ||
|-
| 2 || [[#PopInteractiveInData]] ||
|-
| 3 || [[#PushInteractiveOutData]] ||
|-
| 5 || [[#GetPopInDataEvent]] ||
|-
| 6 || [[#GetPopInteractiveInDataEvent]] ||
|-
| 10 || [[#ExitProcessAndReturn]] ||
|-
| 11 || [[#GetLibraryAppletInfo]] ||
|-
| 12 || [[#GetMainAppletIdentityInfo]] ||
|-
| 13 || [[#CanUseApplicationCore]] ||
|-
| 14 || [[#GetCallerAppletIdentityInfo]] ||
|-
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
|-
|-
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
Line 1,021: Line 1,194:
|-
|-
| 60 || [19.0.0+]  
| 60 || [19.0.0+]  
|-
| 61 || [S2]
|-
|-
| 70 || [21.0.0+]  
| 70 || [21.0.0+]  
Line 1,031: Line 1,206:
|-
|-
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
|-
| 110 || [S2]
|-
| 1000 || [S2]
|}
|}


Line 1,091: Line 1,270:
Enables HID input for the OverlayApplet, without disabling input for the foreground applet.
Enables HID input for the OverlayApplet, without disabling input for the foreground applet.


== IApplicationProxy ==
== ICMenuProxy ==
This is "nn::am::service::IApplicationProxy".
This is "nn::am::service::ICMenuProxy".
 
This is exclusive to Switch 2.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,107: Line 1,288:
|-
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|-
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
Line 1,112: Line 1,295:
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 20 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
|-
| 21 || GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 23 || GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 24 || || No input, returns an [[#ICMenuFunctions|ICMenuFunctions]].
|}
|}


=== IApplicationFunctions ===
=== ICMenuFunctions ===
This is "nn::am::service::IApplicationFunctions".
This is "nn::am::service::ICMenuFunctions".
 
This is exclusive to Switch 2.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,124: Line 1,313:
! Cmd || Name
! Cmd || Name
|-
|-
| 1 || [[#PopLaunchParameter]]
| 0 ||  
|-
|-
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
| 1 ||  
|-
|-
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
| 2 ||  
|-
|-
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
| 3 ||  
|-
|-
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
| 4 ||  
|-
|-
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
| 5 ||  
|-
|-
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
| 6 ||  
|-
|-
| 20 || [[#EnsureSaveData]]
| 10 ||  
|-
|-
| 21 || [[#GetDesiredLanguage]]
| 11 ||  
|-
|-
| 22 || [[#SetTerminateResult]]
| 20 ||  
|-
|-
| 23 || [[#GetDisplayVersion]]
| 21 ||  
|-
|-
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
| 30 ||  
|-
|-
| 25 || [3.0.0+] ExtendSaveData
| 31 ||  
|-
|-
| 26 || [3.0.0+] GetSaveDataSize
| 40 ||  
|-
|-
| 27 || [5.0.0+] CreateCacheStorage
| 41 ||  
|-
|-
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
| 50 ||  
|-
|-
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
| 60 ||  
|-
|-
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
| 61 ||  
|-
|-
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
| 90 ||  
|-
|-
| 32 || [[#BeginBlockingHomeButton]]
| 101 ||  
|-
|-
| 33 || [[#EndBlockingHomeButton]]
| 110 ||  
|-
|-
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
| 1000 ||  
|-
|-
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
| 200 ||  
|-
|-
| 36 || [14.0.0+] GetLimitedApplicationLicense
| 202 ||  
|-
|-
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
| 210 || [20.0.0+]
|-
|-
| 40 || [[#NotifyRunning]]
| 220 || [20.0.0+]
|}
 
==== Cmd200 ====
No input, returns an [[#ILibraryAppletAgent|ILibraryAppletAgent]].
 
==== Cmd202 ====
Takes {...}, returns an [[#IFocusableLayer|IFocusableLayer]].
 
==== ILibraryAppletAgent ====
This is "nn::am::service::ILibraryAppletAgent".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
! Cmd || Name
|-
|-
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
| 0 ||  
|-
|-
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
| 1 ||  
|-
|-
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
| 2 ||  
|-
|-
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
| 3 ||  
|-
|-
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
| 4 ||  
|-
|-
| 70 || [3.0.0+] [[#RequestToShutdown]]
| 5 ||  
|-
|-
| 71 || [3.0.0+] [[#RequestToReboot]]
| 10 ||  
|-
|-
| 72 || [10.0.0+] [[#RequestToSleep]]
| 20 ||  
|-
|-
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
| 21 ||  
|-
|-
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
| 31 ||  
|-
|-
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]
| 32 ||  
|-
|-
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
| 33 ||  
|-
|-
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
| 34 ||  
|-
|-
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
| 35 ||  
|-
|-
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
| 40 ||  
|-
|-
| 112 || [20.0.0+]
| 41 ||  
|-
|-
| 113 || [20.0.0+]
| 42 ||  
|}
 
===== Cmd0 =====
No input, returns an [[#IStorage|IStorage]].
 
===== Cmd1 =====
Takes an unknown input interface, no output.
 
===== Cmd2 =====
No input, returns an [[#IStorage|IStorage]].
 
===== Cmd3 =====
Takes an unknown input interface, no output.
 
===== Cmd10 =====
No input, returns an [[#IStorage|IStorage]].
 
===== Cmd20 =====
Takes an unknown input interface, no output.
 
===== Cmd21 =====
Takes an unknown input interface, no output.
 
==== IFocusableLayer ====
This is "nn::am::service::IFocusableLayer".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 120 || [5.0.0+] [[#ExecuteProgram]]
! Cmd || Name
|-
|-
| 121 || [5.0.0+] [[#ClearUserChannel]]
| 0 ||  
|-
|-
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
| 1 ||  
|-
|-
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
| 2 ||  
|-
|-
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
| 3 ||  
|-
|-
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
| 4 ||  
|-
|-
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
| 10 ||  
|-
|-
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
| 11 ||  
|-
|-
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]
| 20 ||  
|-
|-
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
| 21 ||  
|-
|-
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
| 32 ||  
|-
|-
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
| 33 ||  
|-
|-
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]
| 40 ||  
|-
|-
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]
| 41 ||  
|-
|-
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]
| 42 ||  
|-
|-
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]
| 50 || [20.0.0+]
|-
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
|-
|-
| 210 || [20.0.0+]
| 51 || [20.0.0+]
|-
|-
| 220 || [20.0.0+]
| 60 || [20.0.0+]
|-
|-
| 300 || [19.0.0+] [[#CreateMovieWriter]]
| 70 || [20.0.0+]
|-
|-
| 310 || [20.0.0+]
| 71 || [20.0.0+]
|}
 
== IApplicationProxy ==
This is "nn::am::service::IApplicationProxy".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
|-
| 320 || [20.0.0+]
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
|-
| 330 || [20.2.0+]
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
| 20 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].
|-
| 40 || [S2] || Returns an [[#IPerformanceFunctions|IPerformanceFunctions]].
|-
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]]
| 60 || [S2] || Returns an [[#IGraphicsScalingParametersFunctions|IGraphicsScalingParametersFunctions]].
|-
|-
| 1001 || [5.0.0+] [[#PrepareForJit]]
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}
|}


The BOTW game uses this GamePlayRecording functionality from the main-nso "nninitStartup" function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):
=== IApplicationFunctions ===
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
This is "nn::am::service::IApplicationFunctions".
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.
* Closes the TransferMemory handle, + TransferMemory cleanup.
* Uses [[#SetGamePlayRecordingState]] with value 0x1.
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].


==== PopLaunchParameter ====
{| class="wikitable" border="1"
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].
|-
 
! Cmd || Name
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.
|-
 
| 1 || [[#PopLaunchParameter]]
==== CreateApplicationAndPushAndRequestToStart ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
 
|-
==== CreateApplicationAndPushAndRequestToStartForQuest ====
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.
|-
 
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
==== CreateApplicationAndRequestToStart ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
 
|-
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
 
|-
==== CreateApplicationAndRequestToStartForQuest ====
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.
|-
 
| 20 || [[#EnsureSaveData]]
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
|-
 
| 21 || [[#GetDesiredLanguage]]
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
| 22 || [[#SetTerminateResult]]
 
|-
[21.0.0+] Now returns an output [[#IStorage]].
| 23 || [[#GetDisplayVersion]]
 
|-
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndPushAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
 
|-
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
| 25 || [3.0.0+] ExtendSaveData
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
|-
 
| 26 || [3.0.0+] GetSaveDataSize
Same as [[#CreateApplicationAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
|-
 
| 27 || [5.0.0+] CreateCacheStorage
==== EnsureSaveData ====
|-
Takes an input u128 userID, returns an output u64 size.
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
 
|-
Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
 
|-
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
 
|-
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
 
|-
==== GetDesiredLanguage ====
| 32 || [[#BeginBlockingHomeButton]]
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
|-
 
| 33 || [[#EndBlockingHomeButton]]
==== SetTerminateResult ====
|-
Takes an input u32 '''Result''', no output.
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
 
|-
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
 
|-
==== GetDisplayVersion ====
| 36 || [14.0.0+] GetLimitedApplicationLicense
No input, returns an output 0x10-byte struct.
|-
 
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.
|-
 
| 40 || [[#NotifyRunning]]
==== GetLaunchStorageInfoForDebug ====
|-
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
 
|-
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
 
|-
==== GetSaveDataSizeMax ====
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
No input, returns two ouput s64s.
|-
 
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
==== GetCacheStorageMax ====
|-
No input, returns an output s32 and s64.
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
 
|-
==== BeginBlockingHomeButtonShortAndLongPressed ====
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
Takes an input s64, no output.
|-
 
| 70 || [3.0.0+] [[#RequestToShutdown]]
Official user-processes use hard-coded value 0 for the s64.
|-
 
| 71 || [3.0.0+] [[#RequestToReboot]]
Starts blocking the Home button.
|-
 
| 72 || [10.0.0+] [[#RequestToSleep]]
==== EndBlockingHomeButtonShortAndLongPressed ====
|-
No input/output.
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
 
|-
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
 
|-
==== BeginBlockingHomeButton ====
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]  
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.
|-
 
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
==== EndBlockingHomeButton ====
|-
No input/output.
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
 
|-
==== SelectApplicationLicense ====
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].
|-
 
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
==== GetDeviceSaveDataSizeMax ====
|-
No input, returns two output s64s.
| 112 || [20.0.0+]
 
|-
==== NotifyRunning ====
| 113 || [20.0.0+]
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.
|-
 
| 120 || [5.0.0+] [[#ExecuteProgram]]
==== GetPseudoDeviceId ====
|-
No input, returns an output 0x10-byte "nn::util::Uuid" struct.
| 121 || [5.0.0+] [[#ClearUserChannel]]
 
|-
The 0x20-byte output data from [[NS_Services|GetSystemSeedForPseudoDeviceId]] followed by the 8-byte [[NACP_Format|SeedForPseudoDeviceId]] from the current control.nacp, is hashed with SHA1. Then "nn::util::GenerateUuidVersion5" is called with the final hash, the output from this is then returned for the Uuid.
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
 
|-
==== SetMediaPlaybackStateForApplication ====
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
Takes an input u8 bool, no output.
|-
 
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
==== IsGamePlayRecordingSupported ====
|-
No input, returns an output u8 bool.
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
 
|-
==== InitializeGamePlayRecording ====
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.
|-
 
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
==== SetGamePlayRecordingState ====
|-
Takes an input u32. 0 = disable/pause, 1 = enable/restart.
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]
 
|-
==== RequestFlushGamePlayingMovieForDebug ====
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
No input/output.
|-
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
|-
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
|-
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]
|-
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]
|-
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]
|-
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]
|-
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
|-
| 210 || [20.0.0+]
|-
| 220 || [20.0.0+] [[#SetAudioOutputPolicy|SetAudioOutputPolicy]]
|-
| 230 || [S2] [20.0.0+] IsTensorRtSupported
|-
| 300 || [19.0.0+] [[#CreateMovieWriter]]
|-
| 310 || [20.0.0+] [[#RequestExitApplicationAndTryPopMessage|RequestExitApplicationAndTryPopMessage]]
|-
| 320 || [20.0.0+]
|-
| 321 || [S2] [20.0.0+]
|-
| 330 || [20.2.0+] IsLanguageSelectionLimited
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]]
|-
| 1001 || [5.0.0+] [[#PrepareForJit]]
|}


Requests to save the video recording, as if the Capture-button was held.
The BOTW game uses this GamePlayRecording functionality from the main-nso "nninitStartup" function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.
* Closes the TransferMemory handle, + TransferMemory cleanup.
* Uses [[#SetGamePlayRecordingState]] with value 0x1.
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].


==== RequestToShutdown ====
==== PopLaunchParameter ====
No input/output.
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.


==== RequestToReboot ====
==== CreateApplicationAndPushAndRequestToStart ====
No input/output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
==== CreateApplicationAndPushAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.


==== RequestToSleep ====
==== CreateApplicationAndRequestToStart ====
No input/output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== ExitAndRequestToShowThanksMessage ====
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
No input/output.


Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.
==== CreateApplicationAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.


This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.


==== EnableApplicationCrashReport ====
[21.0.0+] Now returns an output [[#IStorage]].
Takes an input u8 bool, no output.


==== InitializeApplicationCopyrightFrameBuffer ====
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndPushAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.


tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.


User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
Same as [[#CreateApplicationAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].


After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.
==== EnsureSaveData ====
Takes an input u128 userID, returns an output u64 size.


This is used as an overlay for screenshots.
Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.


==== SetApplicationCopyrightImage ====
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.


'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.


Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.
==== GetDesiredLanguage ====
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].


==== SetApplicationCopyrightVisibility ====
==== SetTerminateResult ====
Takes an input u8 bool, no output.
Takes an input u32 '''Result''', no output.


Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.


==== QueryApplicationPlayStatistics ====
==== GetDisplayVersion ====
Takes a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of [[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.
No input, returns an output 0x10-byte struct.


The number of entries in each array is the same.
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.


See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
==== GetLaunchStorageInfoForDebug ====
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].


This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].


==== QueryApplicationPlayStatisticsByUid ====
==== GetSaveDataSizeMax ====
Takes a u128 userID, a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of [[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.
No input, returns two ouput s64s.


Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
==== GetCacheStorageMax ====
No input, returns an output s32 and s64.


==== ExecuteProgram ====
==== BeginBlockingHomeButtonShortAndLongPressed ====
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.
Takes an input s64, no output.


==== ClearUserChannel ====
Official user-processes use hard-coded value 0 for the s64.
No input/output.


Clears the UserChannel used by [[#UnpopToUserChannel]].
Starts blocking the Home button.


==== UnpopToUserChannel ====
==== EndBlockingHomeButtonShortAndLongPressed ====
Takes an input [[#IStorage]], no output.
No input/output.


The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].


User-processes create a storage using data specified by the user (written to offset=0 size=inputsize), with max size 0x1000. This storage is then used with this cmd.
==== BeginBlockingHomeButton ====
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.


==== GetPreviousProgramIndex ====
==== EndBlockingHomeButton ====
No input, returns an output s32.
No input/output.


Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.
==== SelectApplicationLicense ====
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].


==== EnableApplicationAllThreadDumpOnCrash ====
==== GetDeviceSaveDataSizeMax ====
Takes an input u8 bool, no output.
No input, returns two output s64s.


==== GetGpuErrorDetectedSystemEvent ====
==== NotifyRunning ====
No input, returns an output Event handle with autoclear=false.
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.


This is used by sdknso during applet-application initialization. A separate thread is setup where event-waiting is handled. When the Event is signaled, official sw will Abort.
==== GetPseudoDeviceId ====
No input, returns an output 0x10-byte "nn::util::Uuid" struct.


==== SetDelayTimeToAbortOnGpuError ====
The 0x20-byte output data from [[NS_Services|GetSystemSeedForPseudoDeviceId]] followed by the 8-byte [[NACP_Format|SeedForPseudoDeviceId]] from the current control.nacp, is hashed with SHA1. Then "nn::util::GenerateUuidVersion5" is called with the final hash, the output from this is then returned for the Uuid.
Takes an input s64 "nn::TimeSpan", no output.


==== GetFriendInvitationStorageChannelEvent ====
==== SetMediaPlaybackStateForApplication ====
No input, returns an output Event handle with EventClearMode=0.
Takes an input u8 bool, no output.


This is exposed by sdknso under <code>nn::friends::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.
==== IsGamePlayRecordingSupported ====
No input, returns an output u8 bool.


==== TryPopFromFriendInvitationStorageChannel ====
==== InitializeGamePlayRecording ====
No input, returns an output [[#IStorage]].
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.


This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].
==== SetGamePlayRecordingState ====
Takes an input u32. 0 = disable/pause, 1 = enable/restart.


This is exposed by sdknso under <code>nn::friends::</code>. When the storage_size is <0x10, this returns false. <code>data_size = storage_size-0x10;</code> Then the first 0x10-bytes from storage are read to stack, which is later copied to the output Uid on success prior to returning. Then the storage is read into the specified output buffer with storage-offset 0x10, where the size is <code>size = data_size > buf_size ? buf_size : data_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned.
==== RequestFlushGamePlayingMovieForDebug ====
No input/output.


==== GetNotificationStorageChannelEvent ====
Requests to save the video recording, as if the Capture-button was held.
No input, returns an output Event handle with EventClearMode=0.


This is exposed by sdknso under <code>nn::notification::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.
==== RequestToShutdown ====
No input/output.


==== TryPopFromNotificationStorageChannel ====
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
No input, returns an output [[#IStorage]].


This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
==== RequestToReboot ====
No input/output.


This is exposed by sdknso under <code>nn::notification::</code>. The storage is read into the specified output buffer, where the size is <code>size = storage_size > buf_size ? buf_size : storage_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param.
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.


==== GetHealthWarningDisappearedSystemEvent ====
==== RequestToSleep ====
No input, returns an output Event with EventClearMode=0.
No input/output.


==== SetHdcpAuthenticationActivated ====
==== ExitAndRequestToShowThanksMessage ====
Takes an input u8 bool, no output.
No input/output.


==== GetLaunchRequiredVersion ====
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].


sdknso passes hard-coded value 0 for the u64.
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.


==== UpgradeLaunchRequiredVersion ====
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.


sdknso passes hard-coded value 0 for the u64.
==== EnableApplicationCrashReport ====
Takes an input u8 bool, no output.


==== SendServerMaintenanceOverlayNotification ====
==== InitializeApplicationCopyrightFrameBuffer ====
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.


The second input value can optionally be 0.
tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.


==== GetLastApplicationExitReason ====
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
No input, returns an output s32.


==== Cmd220 ====
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.
Takes an input u8, no output.


The input must be <=1.
This is used as an overlay for screenshots.


==== CreateMovieWriter ====
==== SetApplicationCopyrightImage ====
Takes 8-bytes of input and a handle. Returns an [[#IMovieWriter]].
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.


This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.


==== Cmd310 ====
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.
[21.0.0+] Now takes a total of 0x18-bytes of input.


==== Cmd330 ====
==== SetApplicationCopyrightVisibility ====
No input, returns 1-byte of output.
Takes an input u8 bool, no output.


On NX this just writes 0 to output and returns 0.
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.


==== StartContinuousRecordingFlushForDebug ====
==== QueryApplicationPlayStatistics ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
Takes a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of [[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.


The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
The number of entries in each array is the same.


==== CreateMovieMaker ====
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].


Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.


Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
==== QueryApplicationPlayStatisticsByUid ====
Takes a u128 userID, a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of [[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.


==== PrepareForJit ====
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
Takes no input. Launches the [[JIT_services|jit-sysmodule]] via [[NS_Services|ns]] LaunchLibraryApplet if it has not already been launched for the current application, storing a std::shared_ptr<> for jit-sysmodule process tracking object as an IApplicationFunctions member.


~IApplicationFunctions() includes:
==== ExecuteProgram ====
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.


    if (this->jit_process) {
==== ClearUserChannel ====
        Terminate(this->jit_process);
No input/output.
        this->jit_process = nullptr;
    }


Thus the lifetime of the jit sysmodule is tied to the application which uses it, and each application gets its own fresh copy of the jit sysmodule.
Clears the UserChannel used by [[#UnpopToUserChannel]].


AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
==== UnpopToUserChannel ====
Takes an input [[#IStorage]], no output.


[S2] This is no longer usable since this returns Result 0x408 (sysmodule doesn't exist).
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.


=== IMovieWriter ===
User-processes create a storage using data specified by the user (written to offset=0 size=inputsize), with max size 0x1000. This storage is then used with this cmd.
This is "nn::am::service::IMovieWriter".


This was added with [19.0.0+].
==== GetPreviousProgramIndex ====
No input, returns an output s32.


{| class="wikitable" border="1"
Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.
|-
! Cmd || Name
|-
| 0 ||
|}


==== Cmd0 ====
==== EnableApplicationAllThreadDumpOnCrash ====
No input. Returns a GRC [[GRC_services|IMovieWriter]].
Takes an input u8 bool, no output.


=== IMovieMaker ===
==== GetGpuErrorDetectedSystemEvent ====
This is "nn::am::service::IMovieMaker".
No input, returns an output Event handle with autoclear=false.


{| class="wikitable" border="1"
This is used by sdknso during applet-application initialization. A separate thread is setup where event-waiting is handled. When the Event is signaled, official sw will Abort.
|-
! Cmd || Name
|-
| 0 || [[#GetGrcMovieMaker]]
|-
| 1 || [[#GetLayerHandle]]
|}


==== GetGrcMovieMaker ====
==== SetDelayTimeToAbortOnGpuError ====
No input, returns a GRC [[GRC_services|IMovieMaker]].
Takes an input s64 "nn::TimeSpan", no output.


==== GetLayerHandle ====
==== GetFriendInvitationStorageChannelEvent ====
No input, returns an output u64.
No input, returns an output Event handle with EventClearMode=0.


== ILibraryAppletCreator ==
This is exposed by sdknso under <code>nn::friends::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.
This is "nn::am::service::ILibraryAppletCreator".


{| class="wikitable" border="1"
==== TryPopFromFriendInvitationStorageChannel ====
|-
No input, returns an output [[#IStorage]].
! Cmd || Name || Notes
|-
| 0 || [[#CreateLibraryAppletOld|CreateLibraryAppletOld]] ([1.0.0-19.0.1] CreateLibraryApplet) ||
|-
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
| 3 || [20.0.0+] [[#CreateLibraryApplet|CreateLibraryApplet]] ||
|-
| 10 || [[#CreateStorage]] ||
|-
| 11 || [[#CreateTransferMemoryStorage]] ||
|-
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
|}


=== CreateLibraryAppletOld ===
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].
Unofficial name.


Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
This is exposed by sdknso under <code>nn::friends::</code>. When the storage_size is <0x10, this returns false. <code>data_size = storage_size-0x10;</code> Then the first 0x10-bytes from storage are read to stack, which is later copied to the output Uid on success prior to returning. Then the storage is read into the specified output buffer with storage-offset 0x10, where the size is <code>size = data_size > buf_size ? buf_size : data_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned.


=== TerminateAllLibraryApplets ===
==== GetNotificationStorageChannelEvent ====
No input/output.
No input, returns an output Event handle with EventClearMode=0.


Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
This is exposed by sdknso under <code>nn::notification::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.


Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
==== TryPopFromNotificationStorageChannel ====
No input, returns an output [[#IStorage]].


=== AreAnyLibraryAppletsLeft ===
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
No input, returns an output u8 bool.


Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
This is exposed by sdknso under <code>nn::notification::</code>. The storage is read into the specified output buffer, where the size is <code>size = storage_size > buf_size ? buf_size : storage_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param.


Gets whether any LibraryApplets ([[#ILibraryAppletAccessor]]) which were created by the current applet are still open (or by the Application when used from the [[#IApplicationAccessor]] cmd).
==== GetHealthWarningDisappearedSystemEvent ====
No input, returns an output Event with EventClearMode=0.


=== CreateLibraryApplet ===
==== SetHdcpAuthenticationActivated ====
Unofficial name.
Takes an input u8 bool, no output.
 
==== GetLaunchRequiredVersion ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].
 
sdknso passes hard-coded value 0 for the u64.
 
==== UpgradeLaunchRequiredVersion ====
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.
 
sdknso passes hard-coded value 0 for the u64.


Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], an u64 ThreadId, returns an [[#ILibraryAppletAccessor]].
==== SendServerMaintenanceOverlayNotification ====
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.


The ThreadId is from the current-thread of the user-process which is using the cmd.
The second input value can optionally be 0.


=== CreateStorage ===
==== GetLastApplicationExitReason ====
Takes an input s64 for the storage size, returns an [[#IStorage]].
No input, returns an output s32.


This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
==== Cmd210 ====
No input, returns an output Event handle.


=== CreateTransferMemoryStorage ===
==== SetAudioOutputPolicy ====
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].
Takes an input u8, no output.


The user-process creates the TransferMemory with permissions=0.
The input must be <=1.


The TransferMemory is mapped, which can then be accessed via [[#IStorageAccessor]]. The input bool controls whether writing to the storage is allowed: [[#Write]] will throw an error if this flag is not set.
==== CreateMovieWriter ====
Takes 8-bytes of input and a handle. Returns an [[#IMovieWriter]].


=== CreateHandleStorage ===
This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.


The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
==== RequestExitApplicationAndTryPopMessage ====
Takes an input [[#IStorage|IStorage]], no output.


=== ILibraryAppletAccessor ===
[21.0.0+] Now additionally takes a total of 0x18-bytes of input.
This is "nn::am::service::ILibraryAppletAccessor".


{| class="wikitable" border="1"
==== IsLanguageSelectionLimited ====
|-
No input, returns 1-byte of output.
! Cmd || Name || Notes
 
|-
On NX this just writes 0 to output and returns 0.
| 0 || [[#GetAppletStateChangedEvent]] ||
 
|-
==== StartContinuousRecordingFlushForDebug ====
| 1 || [[#IsCompleted]] ||
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
 
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
 
==== CreateMovieMaker ====
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].
 
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
 
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
 
==== PrepareForJit ====
Takes no input. Launches the [[JIT_services|jit-sysmodule]] via [[NS_Services|ns]] LaunchLibraryApplet if it has not already been launched for the current application, storing a std::shared_ptr<> for jit-sysmodule process tracking object as an IApplicationFunctions member.
 
~IApplicationFunctions() includes:
 
    if (this->jit_process) {
        Terminate(this->jit_process);
        this->jit_process = nullptr;
    }
 
Thus the lifetime of the jit sysmodule is tied to the application which uses it, and each application gets its own fresh copy of the jit sysmodule.
 
AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
 
[S2] This is no longer usable since this returns Result 0x408 (sysmodule doesn't exist).
 
=== IMovieWriter ===
This is "nn::am::service::IMovieWriter".
 
This was added with [19.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 10 || [[#Start]] ||
! Cmd || Name
|-
|-
| 20 || [[#RequestExit]] ||
| 0 ||  
|}
 
==== Cmd0 ====
No input. Returns a GRC [[GRC_services|IMovieWriter]].
 
=== IMovieMaker ===
This is "nn::am::service::IMovieMaker".
 
{| class="wikitable" border="1"
|-
|-
| 25 || [[#Terminate]] ||
! Cmd || Name
|-
|-
| 30 || [[#GetResult]] ||
| 0 || [[#GetGrcMovieMaker]]
|-
|-
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
| 1 || [[#GetLayerHandle]]
|}
 
==== GetGrcMovieMaker ====
No input, returns a GRC [[GRC_services|IMovieMaker]].
 
==== GetLayerHandle ====
No input, returns an output u64.
 
=== IPerformanceFunctions ===
This is "nn::am::service::IPerformanceFunctions".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
! Cmd || Name
|-
|-
| 80 || [19.0.0+] RequestForLibraryAppletToGetForeground ||
| 0 || IsCpuOverclockEnabled
|-
|-
| 81 || [19.0.0+] GetCurrentChildLibraryApplet ||
| 1 || SetCpuOverclockEnabled
|}
 
=== IGraphicsScalingParametersFunctions ===
This is "nn::am::service::IGraphicsScalingParametersFunctions".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 90 || [20.0.0+] ||
! Cmd || Name
|-
|-
| 100 || [[#PushInData]] ||  
| 10 || GetGraphicsScalingParameters
|-
|-
| 101 || [[#PopOutData]] ||  
| 1000 || SetSupportingGraphicsScalingParametersForDebug
|-
|-
| 102 || [[#PushExtraStorage]] ||  
| 1010 || SetGpuQuotaForDebug
|-
|-
| 103 || [[#PushInteractiveInData]] ||  
| 1020 || ClearGpuQuotaForDebug
|-
|-
| 104 || [[#PopInteractiveOutData]] ||  
| 1030 || SetScreenRatioForDebug
|-
|-
| 105 || [[#GetPopOutDataEvent]] ||
| 1040 || ClearScreenRatioForDebug
|-
|-
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
| 1050 || SetGraphicsScaleChangedNotificationEnabled
|}
 
== ILibraryAppletCreator ==
This is "nn::am::service::ILibraryAppletCreator".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#CreateLibraryAppletOld|CreateLibraryAppletOld]] ([1.0.0-19.0.1] CreateLibraryApplet) ||
|-
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
|-
| 110 || [[#NeedsToExitProcess]] ||
| 3 || [20.0.0+] [[#CreateLibraryApplet|CreateLibraryApplet]] ||
|-
|-
| 120 || [[#GetLibraryAppletInfo]] ||  
| 10 || [[#CreateStorage]] ||  
|-
|-
| 150 || [[#RequestForAppletToGetForeground]] ||
| 11 || [[#CreateTransferMemoryStorage]] ||  
|-
|-
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||  
|}
|}


Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.
=== CreateLibraryAppletOld ===
Unofficial name.


==== SetOutOfFocusApplicationSuspendingEnabled ====
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
Takes an input u8 bool, no output.


Official sw will assert prior to using this if applet-service was not initialized as *Application.
=== TerminateAllLibraryApplets ===
 
==== PresetLibraryAppletGpuTimeSliceZero ====
No input/output.
No input/output.


sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.


==== PushInData ====
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
Takes an input [[#IStorage]], no output.


==== PopOutData ====
=== AreAnyLibraryAppletsLeft ===
No input, returns an output [[#IStorage]].
No input, returns an output u8 bool.


==== PushExtraStorage ====
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
Takes an input [[#IStorage]], no output.
 
Gets whether any LibraryApplets ([[#ILibraryAppletAccessor]]) which were created by the current applet are still open (or by the Application when used from the [[#IApplicationAccessor]] cmd).


==== PushInteractiveInData ====
=== CreateLibraryApplet ===
Takes an input [[#IStorage]], no output.
Unofficial name.


==== PopInteractiveOutData ====
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], an u64 ThreadId, returns an [[#ILibraryAppletAccessor]].
No input, returns an output [[#IStorage]].


==== GetPopOutDataEvent ====
The ThreadId is from the current-thread of the user-process which is using the cmd.
No input, returns an output handle with autoclear=false.


==== GetPopInteractiveOutDataEvent ====
=== CreateStorage ===
No input, returns an output event handle with autoclear=false.
Takes an input s64 for the storage size, returns an [[#IStorage]].


==== NeedsToExitProcess ====
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
No input, returns an output u8 bool.


Stubbed, just returns an error.
=== CreateTransferMemoryStorage ===
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].


==== RequestForAppletToGetForeground ====
The user-process creates the TransferMemory with permissions=0.
No input/output.


Stubbed, just returns an error.
The TransferMemory is mapped, which can then be accessed via [[#IStorageAccessor]]. The input bool controls whether writing to the storage is allowed: [[#Write]] will throw an error if this flag is not set.


==== GetIndirectLayerConsumerHandle ====
=== CreateHandleStorage ===
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.


Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).


== ICommonStateGetter ==
=== ILibraryAppletAccessor ===
This is "nn::am::service::ICommonStateGetter".
This is "nn::am::service::ILibraryAppletAccessor".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name || Notes
|-
|-
| 0 || [[#GetEventHandle]]
| 0 || [[#GetAppletStateChangedEvent]] ||
|-
|-
| 1 || [[#ReceiveMessage]]
| 1 || [[#IsCompleted]] ||
|-
|-
| 2 || [[#GetThisAppletKind]]
| 10 || [[#Start]] ||
|-
|-
| 3 || [[#AllowToEnterSleep]]
| 20 || [[#RequestExit]] ||
|-
|-
| 4 || [[#DisallowToEnterSleep]]
| 25 || [[#Terminate]] ||
|-
|-
| 5 || [[#GetOperationMode]]
| 30 || [[#GetResult]] ||
|-
|-
| 6 || [[#GetPerformanceMode]]
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
|-
|-
| 7 || [[#GetCradleStatus]]
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
|-
|-
| 8 || [[#GetBootMode]]
| 70 || [S2] ||
|-
|-
| 9 || [[#GetCurrentFocusState]]
| 80 || [19.0.0+] RequestForLibraryAppletToGetForeground ||
|-
|-
| 10 || [[#RequestToAcquireSleepLock]]
| 81 || [19.0.0+] GetCurrentChildLibraryApplet ||
|-
|-
| 11 || [[#ReleaseSleepLock]]
| 90 || [20.0.0+] ||
|-
|-
| 12 || [[#ReleaseSleepLockTransiently]]
| 100 || [[#PushInData]] ||
|-
|-
| 13 || [[#GetAcquiredSleepLockEvent]]
| 101 || [[#PopOutData]] ||
|-
|-
| 14 || [11.0.0+] [[#GetWakeupCount]]
| 102 || [[#PushExtraStorage]] ||
|-
|-
| 15 || [19.0.0+]  
| 103 || [[#PushInteractiveInData]] ||
|-
|-
| 20 || [[#PushToGeneralChannel]]
| 104 || [[#PopInteractiveOutData]] ||
|-
|-
| 30 || [[#GetHomeButtonReaderLockAccessor]]
| 105 || [[#GetPopOutDataEvent]] ||
|-
|-
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
|-
|-
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
| 110 || [[#NeedsToExitProcess]] ||
|-
|-
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
| 120 || [[#GetLibraryAppletInfo]] ||
|-
|-
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
| 150 || [[#RequestForAppletToGetForeground]] ||
|-
|-
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
|-
|-
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
| 170 || [22.0.0+]
|-
|}
| 53 || [7.0.0+] [[#BeginVrModeEx]]
 
|-
Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.
| 54 || [7.0.0+] [[#EndVrModeEx]]
 
|-
==== SetOutOfFocusApplicationSuspendingEnabled ====
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
Takes an input u8 bool, no output.
|-
 
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
Official sw will assert prior to using this if applet-service was not initialized as *Application.
|-
 
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
==== PresetLibraryAppletGpuTimeSliceZero ====
|-
No input/output.
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
 
|-
sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
 
|-
==== PushInData ====
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
Takes an input [[#IStorage]], no output.
|-
 
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
==== PopOutData ====
|-
No input, returns an output [[#IStorage]].
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
 
==== PushExtraStorage ====
Takes an input [[#IStorage]], no output.
 
==== PushInteractiveInData ====
Takes an input [[#IStorage]], no output.
 
==== PopInteractiveOutData ====
No input, returns an output [[#IStorage]].
 
==== GetPopOutDataEvent ====
No input, returns an output handle with autoclear=false.
 
==== GetPopInteractiveOutDataEvent ====
No input, returns an output event handle with autoclear=false.
 
==== NeedsToExitProcess ====
No input, returns an output u8 bool.
 
Stubbed, just returns an error.
 
==== RequestForAppletToGetForeground ====
No input/output.
 
Stubbed, just returns an error.
 
==== GetIndirectLayerConsumerHandle ====
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.
 
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
 
== ICommonStateGetter ==
This is "nn::am::service::ICommonStateGetter".
 
{| class="wikitable" border="1"
|-
|-
| 66 || [6.0.0+] [[#SetCpuBoostMode]]
! Cmd || Name
|-
|-
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]
| 0 || [[#GetEventHandle]]
|-
|-
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]
| 1 || [[#ReceiveMessage]]
|-
|-
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]
| 2 || [[#GetThisAppletKind]]
|-
|-
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]
| 3 || [[#AllowToEnterSleep]]
|-
|-
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
| 4 || [[#DisallowToEnterSleep]]
|-
| 5 || [[#GetOperationMode]]
|-
|-
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
| 6 || [[#GetPerformanceMode]]
|-
|-
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]
| 7 || [[#GetCradleStatus]]
|-
|-
| 120 || [13.0.0+] GetAppletLaunchedHistory
| 8 || [[#GetBootMode]]
|-
|-
| 130 || [21.0.0+]
| 9 || [[#GetCurrentFocusState]]
|-
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
| 10 || [[#RequestToAcquireSleepLock]]
|-
|-
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]
| 11 || [[#ReleaseSleepLock]]
|-
|-
| 400 || [10.0.0+] [[#ActivateMigrationService]]
| 12 || [[#ReleaseSleepLockTransiently]]
|-
|-
| 401 || [10.0.0+] [[#DeactivateMigrationService]]
| 13 || [[#GetAcquiredSleepLockEvent]]
|-
|-
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]
| 14 || [11.0.0+] [[#GetWakeupCount]]
|-
|-
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]
| 15 || [19.0.0+]  
|-
|-
| 502 || [12.0.0+] IsSleepEnabled
| 20 || [[#PushToGeneralChannel]]
|-
|-
| 503 || [12.0.0+] IsDisablingSleepSuppressed
| 30 || [[#GetHomeButtonReaderLockAccessor]]
|-
|-
| 600 || [20.0.0+] ([17.0.0-18.1.0] OpenNamedChannelAsChild)
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
|-
|-
| 610 || [21.0.0+]
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
|-
|-
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
|-
|-
| 910 || [17.0.0+] GetLaunchRequiredTick
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
|-
|-
| 1000 || [19.0.0+] BeginVrMode3d
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
|-
|-
| 1001 || [19.0.0+] EndVrMode3d
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
|-
|-
| 1002 || [19.0.0+] IsVrModeEnabled3d
| 53 || [7.0.0+] [[#BeginVrModeEx]]
|-
|-
| 1003 || [21.0.0+]
| 54 || [7.0.0+] [[#EndVrModeEx]]
|-
|-
| 1004 || [21.0.0+]
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
|-
|-
| 1005 || [21.0.0+]
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
|}
|-
 
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
Officially notification messages are handled by the application itself, not sdk-nso in ExeFS. Official apps call code in sdk-nso which basically uses svcWaitSynchronization with the event from [[#GetEventHandle]] to check whether a message is available, then if so it uses [[#ReceiveMessage]]. The actual handling for message IDs is done in the app itself(see [[#AppletMessage]]).
|-
 
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
[7.0.0+] User-processes now use BeginVrModeEx/EndVrModeEx instead of [[#SetVrModeEnabled]]. Prior to using using BeginVrModeEx, [[Parental_Control_services|pctl]] IsStereoVisionPermitted is used and error 0xD08E is thrown if not allowed by pctl.
|-
 
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
=== GetEventHandle ===
|-
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
 
|-
=== ReceiveMessage ===
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.
|-
 
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
=== GetThisAppletKind ===
|-
No input, returns an output [[#AppletKind]].
| 66 || [6.0.0+] [[#SetCpuBoostMode]]
 
|-
Stubbed, just returns an error.
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]
 
|-
=== AllowToEnterSleep ===
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]
No input/output.
|-
 
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]
Stubbed, just returns an error.
|-
 
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]
=== DisallowToEnterSleep ===
|-
No input/output.
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
 
|-
Stubbed, just returns an error.
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
 
|-
=== GetOperationMode ===
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]
No input. Returns an output u8 for the current [[#OperationMode]].
|-
 
| 120 || [13.0.0+] GetAppletLaunchedHistory
=== GetPerformanceMode ===
|-
No input. Returns an output u32 for the current [[#PerformanceMode]].
| 130 || [21.0.0+] EnableStartupLogoDisappearedMessage
 
|-
=== GetCradleStatus ===
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
No input, returns an output u8.
|-
 
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]
This uses [[#omm]] GetCradleStatus.
|-
 
| 400 || [10.0.0+] [[#ActivateMigrationService]]
=== GetBootMode ===
|-
No input, returns an output u8.
| 401 || [10.0.0+] [[#DeactivateMigrationService]]
 
|-
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]
 
|-
=== GetCurrentFocusState ===
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]
No input. Returns an output u8 [[#FocusState]].
|-
| 502 || [12.0.0+] IsSleepEnabled
|-
| 503 || [12.0.0+] IsDisablingSleepSuppressed
|-
| 600 || [20.0.0+] SetHidInputMagnificationForApplication ([17.0.0-18.1.0] OpenNamedChannelAsChild)
|-
| 610 || [21.0.0+]
|-
| 611 || [22.0.0+]
|-
| 650 || [S2] BeginUsingCameraResource
|-
| 651 || [S2] EndUsingCameraResource
|-
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
|-
| 910 || [17.0.0+] GetLaunchRequiredTick
|-
| 1000 || [19.0.0+] BeginVrMode3d
|-
| 1001 || [19.0.0+] EndVrMode3d
|-
| 1002 || [19.0.0+] IsVrModeEnabled3d
|-
| 1003 || [21.0.0+] GetVrLaboGoggleViewport
|-
| 1004 || [21.0.0+] GetPanelPhysicalSizeForSpecificTitle
|-
| 1005 || [21.0.0+] GetPanelResolutionForSpecificTitle
|-
| 2000 || [S2] SetRtcModeChangedMessageEnabled
|-
| 2010 || [S2] GetCurrentDisplayLayoutRatio
|}


=== RequestToAcquireSleepLock ===
Officially notification messages are handled by the application itself, not sdk-nso in ExeFS. Official apps call code in sdk-nso which basically uses svcWaitSynchronization with the event from [[#GetEventHandle]] to check whether a message is available, then if so it uses [[#ReceiveMessage]]. The actual handling for message IDs is done in the app itself(see [[#AppletMessage]]).
No input/output.


=== ReleaseSleepLock ===
[7.0.0+] User-processes now use BeginVrModeEx/EndVrModeEx instead of [[#SetVrModeEnabled]]. Prior to using using BeginVrModeEx, [[Parental_Control_services|pctl]] IsStereoVisionPermitted is used and error 0xD08E is thrown if not allowed by pctl.
No input/output.


=== ReleaseSleepLockTransiently ===
=== GetEventHandle ===
No input/output.
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].


=== GetAcquiredSleepLockEvent ===
=== ReceiveMessage ===
No input, returns an output Event handle with autoclear=false.
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.


=== GetWakeupCount ===
=== GetThisAppletKind ===
No input, returns an output u64.
No input, returns an output [[#AppletKind]].


=== PushToGeneralChannel ===
Stubbed, just returns an error.
Takes an input [[#IStorage]], no output.


This is not usable under an Application, however it is usable under a LibraryApplet.
=== AllowToEnterSleep ===
No input/output.


Used for sending requests to [[qlaunch]]. sdk-nso creates a 0x10-byte storage which is sent to this. The following are the functions which use this, with the data written to the storage:
Stubbed, just returns an error.
* <code>RequestHomeMenu</code> <code>5341 4d53 0100 0000 0200 0000 0100 0000</code> Returns to the main Home Menu, equivalent to pressing the HOME button.
* <code>RequestJumpToSystemUpdate</code> <code>5341 4d53 0100 0000 0b00 0000 0100 0000</code> Equivalent to entering "System Update" under System Settings. When leaving this, it returns to the main Home Menu.


=== GetHomeButtonReaderLockAccessor ===
=== DisallowToEnterSleep ===
No input, returns an output [[#ILockAccessor]].
No input/output.


Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
Stubbed, just returns an error.


=== GetReaderLockAccessorEx ===
=== GetOperationMode ===
Takes an input u32, returns an output [[#ILockAccessor]].
No input. Returns an output u8 for the current [[#OperationMode]].


The input value must be 0-3. 0 = HomeButton.
=== GetPerformanceMode ===
No input. Returns an output u32 for the current [[#PerformanceMode]].


=== GetWriterLockAccessorEx ===
=== GetCradleStatus ===
Takes an input u32, returns an output [[#ILockAccessor]].
No input, returns an output u8.


The input value must be 0-3. 0 = HomeButton.
This uses [[#omm]] GetCradleStatus.


=== GetCradleFwVersion ===
=== GetBootMode ===
No input, returns 4 output u32s.
No input, returns an output u8.


This uses [[#omm]] GetCradleFwVersion.
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.


=== IsVrModeEnabled ===
=== GetCurrentFocusState ===
No input, returns an output u8 bool.
No input. Returns an output u8 [[#FocusState]].


=== SetVrModeEnabled ===
=== RequestToAcquireSleepLock ===
Takes an input u8 bool flag. No output.
No input/output.


Updates internal AM state fields. If the new state doesn't match the previous state, this uses the [[Backlight_services]] {Disable/Enable}VrMode command depending on whether flag={disable/enable}.
=== ReleaseSleepLock ===
No input/output.


When the VrMode is set to true, the console shows a screen rendered like vr asking the user to move his face away and hit the 'close' button. When this button is pressed, the console resets the vrMode to false.
=== ReleaseSleepLockTransiently ===
No input/output.


=== SetLcdBacklighOffEnabled ===
=== GetAcquiredSleepLockEvent ===
Takes an input u8 bool, no output.
No input, returns an output Event handle with autoclear=false.


Sets whether the LCD screen blacklight is turned off.
=== GetWakeupCount ===
No input, returns an output u64.


=== BeginVrModeEx ===
=== PushToGeneralChannel ===
No input/output.
Takes an input [[#IStorage]], no output.


Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
This is not usable under an Application, however it is usable under a LibraryApplet.


=== EndVrModeEx ===
Used for sending requests to [[qlaunch]]. sdk-nso creates a 0x10-byte storage which is sent to this. The following are the functions which use this, with the data written to the storage:
No input/output.
* <code>RequestHomeMenu</code> <code>5341 4d53 0100 0000 0200 0000 0100 0000</code> Returns to the main Home Menu, equivalent to pressing the HOME button.
* <code>RequestJumpToSystemUpdate</code> <code>5341 4d53 0100 0000 0b00 0000 0100 0000</code> Equivalent to entering "System Update" under System Settings. When leaving this, it returns to the main Home Menu.


Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
=== GetHomeButtonReaderLockAccessor ===
No input, returns an output [[#ILockAccessor]].


=== IsInControllerFirmwareUpdateSection ===
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
No input, returns an output u8 bool.


=== SetVrPositionForDebug ===
=== GetReaderLockAccessorEx ===
Takes 4 input s32s, no output.
Takes an input u32, returns an output [[#ILockAccessor]].


The s32s are: x, y, width, height.
The input value must be 0-3. 0 = HomeButton.


The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
=== GetWriterLockAccessorEx ===
Takes an input u32, returns an output [[#ILockAccessor]].


width must be 1-1280, height must be 1-720.
The input value must be 0-3. 0 = HomeButton.
 
=== GetCradleFwVersion ===
No input, returns 4 output u32s.
 
This uses [[#omm]] GetCradleFwVersion.
 
=== IsVrModeEnabled ===
No input, returns an output u8 bool.
 
=== SetVrModeEnabled ===
Takes an input u8 bool flag. No output.
 
Updates internal AM state fields. If the new state doesn't match the previous state, this uses the [[Backlight_services]] {Disable/Enable}VrMode command depending on whether flag={disable/enable}.
 
When the VrMode is set to true, the console shows a screen rendered like vr asking the user to move his face away and hit the 'close' button. When this button is pressed, the console resets the vrMode to false.
 
=== SetLcdBacklighOffEnabled ===
Takes an input u8 bool, no output.
 
Sets whether the LCD screen blacklight is turned off.
 
=== BeginVrModeEx ===
No input/output.
 
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
 
=== EndVrModeEx ===
No input/output.
 
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
 
=== IsInControllerFirmwareUpdateSection ===
No input, returns an output u8 bool.
 
=== SetVrPositionForDebug ===
Takes 4 input s32s, no output.
 
The s32s are: x, y, width, height.
 
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 
width must be 1-1280, height must be 1-720.


x and y must not be negative. x+width must be <=1280. y+height must be <=720.
x and y must not be negative. x+width must be <=1280. y+height must be <=720.
Line 2,266: Line 2,725:
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
|-
| 2000 || [S2] [[#GetGraphicsInterface]]
| 2000 || [S2] [[#GetGraphicsSupervisor]]
|-
|-
| 2100 || [S2]
| 2100 || [S2] SetRecordingLayerEnabled
|-
| 2200 || [S2] SetSharingLayerEnabled
|-
| 2300 || [S2] [20.0.0+] SetCopyrightLayerEnabled
|-
| 2400 || [S2] SetRtcScreenSharingAudioEnabled
|-
| 2401 || [S2] [20.0.0+] SetStreamPlayMirroringAudioEnabled
|-
| 2402 || [S2] [20.0.0+]
|}
|}


Line 2,500: Line 2,969:
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.


=== GetGraphicsInterface ===
=== GetGraphicsSupervisor ===
Unofficial name. This is exclusive to S2.
This is exclusive to S2.


No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]].
No input. Returns an output TIPC handle to [[Switch_2:_GSV_services|GraphicsSupervisor]].


== IStorageChannel ==
== IStorageChannel ==
Line 2,853: Line 3,322:
== IProcessWindingController ==
== IProcessWindingController ==
This is "nn::am::service::IProcessWindingController".
This is "nn::am::service::IProcessWindingController".
GetProcessWindingController throws an error when used from non-LibraryApplet (at least with Application).


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,912: Line 3,383:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 ||  
| 1 ||  
|}
|}


=== Cmd0 ===
=== Cmd1 ===
No input. Returns an [[#IApplicationObserver]].
No input. Returns an [[#IApplicationObserver]].


Line 2,936: Line 3,407:
|-
|-
| 30 ||  
| 30 ||  
|-
| 40 || [S2] [20.0.0+]
|}
|}


Line 2,954: Line 3,427:
|}
|}


== IDebugFunctions ==
== IChatProxy ==
This is "nn::am::service::IDebugFunctions".
This is "nn::am::service::IChatProxy".
 
This is exclusive to Switch 2.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name || Notes
|-
|-
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
|-
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
|-
| 10 || [[#PerformSystemButtonPressing]]
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
|-
| 20 || [[#InvalidateTransitionLayer]]
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
|-
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
|-
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|-
|-
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
|-
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
| 20 || || Returns an [[#IChatFunctions]].
|}
 
=== IChatFunctions ===
This is "nn::am::service::IChatFunctions".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
! Cmd || Name
|-
|-
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
| 1 ||  
|-
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
| 102 ||  
|-
|-
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
| 103 ||  
|-
|-
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
| 104 ||  
|-
|-
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
| 110 ||  
|-
|-
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
| 120 ||  
|-
|-
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
| 121 ||  
|-
|-
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
| 130 ||  
|-
|-
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
| 140 || [20.0.0+]
|-
|-
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]
| 141 || [20.0.0+]
|-
|-
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
| 200 ||  
|-
|-
| 140 || [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug
| 201 ||  
|-
|-
| 150 || [21.0.0+]
| 210 || [20.0.0+]
|-
|-
| 200 || [15.0.0+] [[#CreateFloatingLibraryAppletAccepterForDebug|CreateFloatingLibraryAppletAccepterForDebug]]
| 220 || [20.0.0+]
|}
 
== IDebugFunctions ==
This is "nn::am::service::IDebugFunctions".
 
{| class="wikitable" border="1"
|-
|-
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
! Cmd || Name
|-
|-
| 400 || [S2]
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
|-
|-
| 401 || [S2]
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
|-
|-
| 402 || [S2]
| 10 || [[#PerformSystemButtonPressing]]
|-
|-
| 403 || [S2]
| 20 || [[#InvalidateTransitionLayer]]
|-
|-
| 410 || [18.0.0+] [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]]
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
|-
|-
| 411 || [18.0.0+] [[#ReadGeneralStorageForDebug|ReadGeneralStorageForDebug]]
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
|-
|-
| 412 || [18.0.0+] [[#WriteGeneralStorageForDebug|WriteGeneralStorageForDebug]]
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
|-
|-
| 430 || [20.0.0+]
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
|-
|-
| 431 || [20.0.0+]
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
|-
|-
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
|-
|-
| 910 || [20.0.0+]
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
|-
|-
| 2000 || [S2]
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
|-
|-
| 10000 || [S2]
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
|}
|-
 
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
=== NotifyMessageToHomeMenuForDebug ===
|-
Takes an input [[#AppletMessage]], no output.
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
 
|-
Stubbed, just returns an error.
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
 
|-
=== OpenMainApplication ===
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
No input, returns an output [[#IApplicationAccessor]].
|-
 
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
Should not be used when no Application is running (svcBreak).
|-
 
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
=== PerformSystemButtonPressing ===
|-
Takes an input [[#SystemButtonType]], no output.
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]
 
|-
=== InvalidateTransitionLayer ===
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
No input/output.
|-
 
| 140 || [14.0.0+] [[#RestrictPowerOperationForSecureLaunchModeForDebug|RestrictPowerOperationForSecureLaunchModeForDebug]]
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
|-
Takes an input u8 bool flag, an [[NCM_services#ApplicationId|ApplicationId]], a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.
| 150 || [21.0.0+]
|-
| 200 || [15.0.0+] [[#CreateFloatingLibraryAppletAccepterForDebug|CreateFloatingLibraryAppletAccepterForDebug]]
|-
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
|-
| 400 || [S2] LaunchDebugAppletForDebug
|-
| 401 || [S2] TerminateDebugAppletForDebug
|-
| 402 || [S2] IsDebugAppletLaunchedForDebug
|-
| 403 || [S2]
|-
| 410 || [18.0.0+] [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]]
|-
| 411 || [18.0.0+] [[#ReadGeneralStorageForDebug|ReadGeneralStorageForDebug]]
|-
| 412 || [18.0.0+] [[#WriteGeneralStorageForDebug|WriteGeneralStorageForDebug]]
|-
| 430 || [20.0.0+]
|-
| 431 || [20.0.0+]
|-
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
|-
| 910 || [20.0.0+]
|-
| 2000 || [S2] [20.0.0+]
|-
| 10000 || [S2]
|}
 
=== NotifyMessageToHomeMenuForDebug ===
Takes an input [[#AppletMessage]], no output.
 
Stubbed, just returns an error.
 
=== OpenMainApplication ===
No input, returns an output [[#IApplicationAccessor]].
 
Should not be used when no Application is running (svcBreak).
 
=== PerformSystemButtonPressing ===
Takes an input [[#SystemButtonType]], no output.
 
=== InvalidateTransitionLayer ===
No input/output.
 
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
Takes an input u8 bool flag, an [[NCM_services#ApplicationId|ApplicationId]], a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.


Requests to launch the specified Application, with the specified users. When the bool flag is true, the content of the second input buffer is used to create a storage which is pushed to the UserChannel for this Application (see [[#LaunchParameterKind]]).
Requests to launch the specified Application, with the specified users. When the bool flag is true, the content of the second input buffer is used to create a storage which is pushed to the UserChannel for this Application (see [[#LaunchParameterKind]]).
Line 3,093: Line 3,632:


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToNotificationStorageChannel|NotificationStorageChannel]].


=== AlarmSettingNotificationDisableAppEventReserve ===
=== AlarmSettingNotificationDisableAppEventReserve ===
Line 3,108: Line 3,649:


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToFriendInvitationStorageChannel|FriendInvitationStorageChannel]].


=== FriendInvitationClearApplicationParameter ===
=== FriendInvitationClearApplicationParameter ===
Line 3,118: Line 3,661:


Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
=== RestrictPowerOperationForSecureLaunchModeForDebug ===
No input/output.
This runs the same functionality as [[#DisableSleepTillShutdown|DisableSleepTillShutdown]].


=== CreateFloatingLibraryAppletAccepterForDebug ===
=== CreateFloatingLibraryAppletAccepterForDebug ===
Line 3,197: Line 3,745:
|-
|-
! Cmd || Name
! Cmd || Name
|-
| 2000 || [S2] [[#OpenCompatApplicationFunctions|OpenCompatApplicationFunctions]]
|-
|-
| 0 || [[#OpenApplicationProxy]]
| 0 || [[#OpenApplicationProxy]]
|-
| 10 || [S2] [[#OpenApplicationProxy2|OpenApplicationProxy2]]
|}
|}


Line 3,207: Line 3,759:


On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
== OpenApplicationProxy2 ==
Unofficial name.
Takes an input u32, an u64 pid_reserved, a PID, and a process copy-handle (cur-proc handle alias). Returns an [[#IApplicationProxy]].


= idle:sys =
= idle:sys =
Line 3,435: Line 3,992:


This was added with [8.0.0+].
This was added with [8.0.0+].
[S2] Official sw no longer uses this (stubbed out).


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,651: Line 4,210:
! Cmd || Name
! Cmd || Name
|-
|-
| 2000 || [[#GetGraphicsInterfaceForNxCompat]]
| 2000 || [[#GetGraphicsSupervisorForNxCompat]]
|-
|-
| 2001 ||  
| 2001 ||  
Line 3,676: Line 4,235:
|}
|}


=== GetGraphicsInterfaceForNxCompat ===
=== GetGraphicsSupervisorForNxCompat ===
Unofficial name.
Unofficial name.


No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]].
No input. Returns an output TIPC handle to [[Switch_2:_GSV_services|GraphicsSupervisor]].


Same as [[#GetGraphicsInterface]] but for compat mode.
Same as [[#GetGraphicsSupervisor]] but for compat mode.


=== SetCopyright ===
=== SetCopyright ===
Line 3,709: Line 4,268:
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp.
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp.


= (S2) GraphicsInterface =
= Library Applets =
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.
This section documents library applet launching.
 
Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
 
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
 
== CommonArguments ==
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by <code>nn::la::CommonArgumentsWriter</code> and has the following format.
 
This struct is 0x20-bytes.
 
Official sw handles the first 8-bytes separately, which is a header. With CommonArguments version 0x0, the header is 4-bytes, while starting with version 0x1 it's 8-bytes.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Offset || Size || Typical Value || Notes
|-
|-
| 1 || [[#InitializeGraphicsWithTransferMemory]]
| 0x0 || 4 || 1 || Common Arguments version
|-
|-
| 4 || [[#InitializeGraphics]]
| 0x4 || 4 || 0x20 || Common Arguments size
|-
|-
| 11 || [[#SetCurrentProcessHandle]]
| 0x8 || 4 || || Library applet version (API version)
|-
|-
| 12 ||  
| 0xC || 4 || 0 || Theme color
|-
|-
| 101 || [[#StartGraphics]]
| 0x10 || 1 || 0 || Play startup sound
|-
|-
| 111 ||  
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
|-
|-
| 112 ||  
|}
 
= AppletId =
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
 
{| class="wikitable" border="1"
|-
|-
| 114 ||
! Value
! ProgramId
! Description
|-
|-
| 115 ||
| 0x00000000
|-
|  
| 187 ||
| None
|-
|-
| 201 ||  
| 0x00000001
|  
| Application (not valid for use with LibraryApplets)
|-
|-
| 301 ||  
| 0x00000002
| 0x010000000000100C
| OverlayApplet (overlayDisp)
|-
|-
| 303 ||  
| 0x00000003
| 0x0100000000001000
| SystemAppletMenu (qlaunch)
|-
|-
| 311 ||  
| 0x00000004
| 0x0100000000001012
| SystemApplication (starter)
|-
|-
| 312 ||  
| 0x0000000A
| 0x0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
|-
| 314 ||  
| 0x0000000B
| 0x0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
|-
| 315 ||  
| 0x0000000C
| 0x0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
|-
| 321 ||  
| 0x0000000D
| 0x0100000000001004
| LibraryAppletDataErase (dataErase)
|-
|-
| 327 ||  
| 0x0000000E
| 0x0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
|-
|-
| 391 ||  
| 0x0000000F
| 0x0100000000001006
| LibraryAppletNetConnect (netConnect)
|-
|-
| 401 || [[#PrepareGpuManagerSession]]
| 0x00000010
| 0x0100000000001007
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
|-
|-
| 402 || [[#StartGpuManagerSession]]
| 0x00000011
| 0x0100000000001008
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
|-
|-
| 423 ||  
| 0x00000012
| 0x0100000000001009
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
|-
|-
| 428 || [[#GetImageInfo]]
| 0x00000013
| [22.0.0+] 0x0100000000001043 ([1.0.0-21.2.0] 0x010000000000100A)
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
|-
| 434 ||  
| 0x00000014
| 0x010000000000100B
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
|-
| 494 ||  
| 0x00000015
| 0x010000000000100D
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
|-
| 496 || [[#CreateGpuManagerSessionWithTransferMemory]]
| 0x00000016
| 0x010000000000100E
| LibraryAppletSet (set)
|-
|-
| 497 || [[#CreateGpuManagerSession]]
| 0x00000017
| 0x010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
|-
| 901 ||  
| 0x00000018
| [22.0.0+] 0x0100000000001042 ([1.0.0-21.2.0] 0x0100000000001010)
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
|-
|-
| 902 ||  
| 0x00000019
| [22.0.0+] 0x0100000000001043 ([1.0.0-21.2.0] 0x0100000000001011)
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
|-
|-
| 903 ||  
| 0x0000001A
| 0x0100000000001013
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
|-
|-
| 905 ||  
| 0x0000001B
| 0x010000000000101A
| LibraryAppletGift (gift)
|-
|-
| 911 ||  
| 0x0000001C
| 0x010000000000101C
| LibraryAppletUserMigration (userMigration)
|-
|-
| 912 ||  
| 0x0000001D
| 0x010000000000101D
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
|-
|-
| 922 ||  
| 0x0000001E
| 0x0100000000001020
| [9.0.0+] LibraryAppletStory (story)
|-
|-
| 961 ||  
| 0x0000001F
| 0x010070000E3C0000
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
|-
|-
| 991 ||  
| 0x00000020
| 0x010086000E49C000
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
|-
|-
| 1001 ||  
| 0x00000021
| 0x0100000000001038
| [10.0.0+] LibraryAppletSample (sample)
|-
|-
| 1002 ||
| 0x00000022
|-
| 0x0100000000001007
| 1003 ||
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
|-
|-
| 1101 ||  
| 0x00000032
| 0x010000000000100F
| [17.0.0+] LibraryAppletOfflineWebApp_3 ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 1102 ||  
| 0x00000033
| 0x010000000000100F
| [17.0.0+] LibraryAppletOfflineWebSystem ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 1301 || [[#InitializeAdraw]]
| 0x00000035
| [22.0.0+] 0x0100000000001042 ([17.0.0-21.2.0] 0x0100000000001010, [16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] LibraryAppletLhub ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 1302 || [[#StartAdraw]]
| 0x00000036
| [22.0.0+] 0x0100000000001042 ([17.0.0-21.2.0] 0x0100000000001010, [16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] LibraryAppletLogin ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 1325 || [[#GetAdrawFrameBufferHandle]]
| 0x00000037
| [22.0.0+] 0x0100000000001042 ([17.0.0-21.2.0] 0x0100000000001010, [16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] LibraryAppletShare ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 1326 || [[#GetAdrawImageHandle]]
| 0x00000038
| 0x0100000000001043
| [16.0.0-16.1.0]
|-
|-
| 1401 || [[#CreateNvDrv2UserSessionWithTransferMemory]]  
| 0x00000050
| 0x0100000000001007
| [18.0.0+]
|-
|-
| 1402 || [[#CreateNvDrv2UserSession]]  
| 0x00000051
| 0x0100000000001007
| [18.0.0+]
|-
|-
| 1411 || [[#GetNvDrv2UserTransferMemoryUsage]]
| 0x00000052
| 0x0100000000001001
| [22.0.0+]
|-
|-
| 1501 ||
| 0x00000064
| 0x0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
|-
|-
| 1502 ||  
| 0x00000066
| 0x0100000000001054
| [21.0.0+]
|-
|-
| 1601 ||  
| 0x000003E8
|  
| [10.0.0-16.1.0] DevlopmentTool
|-
|-
| 1602 ||  
| 0x000003F1
| 0x010000000000D619
| [10.0.0-16.1.0] CombinationLA
|-
|-
| 1603 ||  
| 0x000003F2
| 0x010000000000D610
| [10.0.0-16.1.0] AeSystemApplet
|-
|-
| 1611 ||  
| 0x000003F3
| 0x010000000000D611
| [10.0.0-16.1.0] AeOverlayApplet
|-
|-
| 1612 ||  
| 0x000003F4
| 0x010000000000D612
| [10.0.0-16.1.0] AeStarter
|-
|-
| 1691 ||  
| 0x000003F5
|}
| 0x010000000000D613
 
| [10.0.0-16.1.0] AeLibraryAppletAlone
== InitializeGraphicsWithTransferMemory ==
|-
Unofficial name.
| 0x000003F6
 
| 0x010000000000D614
Takes a TransferMemory handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and an input u64 '''TransferMemorySize'''. No output.
| [10.0.0-16.1.0] AeLibraryApplet1
 
|-
== InitializeGraphics ==
| 0x000003F7
Unofficial name.
| 0x010000000000D615
 
| [10.0.0-16.1.0] AeLibraryApplet2
Takes a Process handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and five input u64s. No output.
|-
 
| 0x000003F8
The first u64 appears to be a version ([19.0.0] 0x8000000000000001, [20.1.1] 0x8000000000000005), the last u64 is the output from new [[SVC#InfoType|InfoType]] 31 or 32 and the remaining u64s are all 0.
| 0x010000000000D616
 
| [10.0.0-16.1.0] AeLibraryApplet3
== SetCurrentProcessHandle ==
|-
Unofficial name.
| 0x000003F9
 
| 0x010000000000D617
Takes a Process handle. No output.
| [10.0.0-16.1.0] AeLibraryApplet4
 
|-
Called directly after [[#InitializeGraphicsWithTransferMemory]] or [[#InitializeGraphics]].
| 0x000003FA
 
| 0x010000000000D60A
== StartGraphics ==
| [10.0.0-16.1.0] AppletISA
Unofficial name.
|-
 
| 0x000003FB
No input/output.
| 0x010000000000D60B
 
| [10.0.0-16.1.0] AppletIOA
Called directly after [[#SetCurrentProcessHandle]].
|-
 
| 0x000003FC
== PrepareGpuManagerSession ==
| 0x010000000000D60C
Unofficial name.
| [10.0.0-16.1.0] AppletISTA
 
|-
No input/output.
| 0x000003FD
 
| 0x010000000000D60D
Called directly after [[#CreateGpuManagerSessionWithTransferMemory]] or [[#CreateGpuManagerSession]].
| [10.0.0-16.1.0] AppletILA1
 
|-
== StartGpuManagerSession ==
| 0x000003FE
Unofficial name.
| 0x010000000000D60E
 
| [10.0.0-16.1.0] AppletILA2
No input/output.
|-
 
| 0x0100000A
Called directly after [[#PrepareGpuManagerSession]].
|  
 
| [[Auth_Applet|LibraryAppletAuth]]
== GetImageInfo ==
|-
Unofficial name.
| 0x0100000B
 
|
Takes an input u32 '''ImageHandle'''. Returns an [[#(S2)_ImageInfo|ImageInfo]].
| [[Cabinet_Applet|LibraryAppletCabinet]]
 
|-
== CreateGpuManagerSessionWithTransferMemory ==
| 0x0100000C
Unofficial name.
|
 
| [[Controller_Applet|LibraryAppletController]]
Takes a TransferMemory handle and two input u64s '''Version''' and '''TransferMemorySize'''. Returns a [[#GpuManagerSession]].
 
[19.0.0] '''Version''' must be 2.
 
== CreateGpuManagerSession ==
Unofficial name.
 
Takes an input u64 '''Version'''. Returns a [[#GpuManagerSession]].
 
[19.0.0] '''Version''' must be 2.
 
== InitializeAdraw ==
Unofficial name.
 
No input/output.
 
== StartAdraw ==
Unofficial name.
 
No input/output.
 
Called directly after [[#InitializeAdraw]].
 
== GetAdrawFrameBufferHandle ==
Unofficial name.
 
Takes an input u64. Returns an output u32 '''FrameBufferHandle'''.
 
Official software sends the [[#(S2)_AdrawFrameBufferInfo|Id]] obtained with [[#GetFrameBufferInfo|GetFrameBufferInfo]] from [[#(S2)_adraw:a|adraw]].
 
== GetAdrawImageHandle ==
Unofficial name.
 
Takes seven input u64s, two input u16s and two input u32s. Returns an output u32 '''ImageHandle'''.
 
Official software sends 0x100000000 in the first u64, 0 in all remaining u64s, [[#(S2)_AdrawFrameBufferInfo|Width]] and [[#(S2)_AdrawFrameBufferInfo|Height]] in the two u16s, [[#(S2)_AdrawFrameBufferInfo|BlockCount]] int the first u32 and the '''FrameBufferHandle''' from [[#GetAdrawFrameBufferHandle|GetAdrawFrameBufferHandle]] in the last u32.
 
== CreateNvDrv2UserSessionWithTransferMemory ==
Unofficial name.
 
Takes a TransferMemory handle, an input u64 '''TransferMemorySize''' and an input u8. Returns an [[NV_services#(S2)_INvDrv2User|INvDrv2User]].
 
== CreateNvDrv2UserSession ==
Unofficial name.
 
No input. Returns an [[NV_services#(S2)_INvDrv2User|INvDrv2User]].
 
Only one session can be open at a time, otherwise returns error 0x200f3.
 
== GetNvDrv2UserTransferMemoryUsage ==
Unofficial name.
 
No input. Returns three u64s '''TotalTransferMemorySize''', '''UsedTransferMemorySize''' and '''MaxTransferMemorySize'''.
 
== GpuManagerSession ==
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 0x0100000D
|  
| [S2]
|-
|-
| 11 || [[#GetEventIdRange]]
| 0x0100000E
|  
| [S2] LibraryAppletError
|-
|-
| 12 || [[#CreateEvent]]
| 0x01000010
|  
| [S2] LibraryAppletPlayerSelect
|-
|-
| 21 || [[#RequestGpuSession]]
| 0x01010011
|  
| [S2] SwkbdModeless
|-
|-
| 22 || [[#GetGpuSession]]
| 0x01020011
|  
| [S2] Swkbd
|-
|-
| 33 ||  
| 0x01010012
|  
| [S2] [[MiiEdit_Applet|LibraryAppletMiiEdit]] (for ShowMiiEdit)
|-
|-
| 41 ||  
| 0x01020012
|  
| [S2] [[MiiEdit_Applet|LibraryAppletMiiEdit]] (for AppendMii)
|-
|-
| 42 ||  
| 0x01070012
|  
| [S2] [[MiiEdit_Applet|LibraryAppletMiiEdit]] (for CreateMii)
|-
|-
| 102 ||  
| 0x01080012
|  
| [S2] [[MiiEdit_Applet|LibraryAppletMiiEdit]] (for EditMii)
|-
|-
| 200 ||  
| 0x01000013
|  
| [S2] OpenWeb
|-
|-
| 201 ||  
| 0x01000014
|  
| [S2] LibraryAppletShop
|-
|-
| 202 ||  
| 0x01000015
|}
|  
 
| [S2] [[Album_Applet|Album]]
=== GetEventIdRange ===
Unofficial name.
 
No input. Returns two u32s '''EventIdMin''' and '''EventIdMax'''.
 
=== CreateEvent ===
Unofficial name.
 
Takes an input u32 '''EventId'''. Returns an output Event handle.
 
=== RequestGpuSession ===
Unofficial name.
 
Takes an input u32 '''EventId'''. No output.
 
'''EventId''' must have been previously passed to [[#CreateEvent]] and the returned Event handle will be signalled when the session is ready.
 
=== GetGpuSession ===
Unofficial name.
 
No input. Returns a [[#GpuSession]].
 
Called after [[#RequestGpuSession]] and the Event handle has been signalled.
 
=== GpuSession ===
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 0x01000017
|  
| [S2] LibraryAppletOffline (for Gen0)
|-
|-
| 101 || [[#CreateGpuMemory]]
| 0x01000018
|  
| [S2] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare]] (for Lobby)
|-
|-
| 102 || [[#DestroyGpuMemory]]
| 0x0100001A
|  
| [S2] [[MyPage_Applet|MyPageApplet]]
|-
|-
| 201 || [19.0.0-19.1.0] MapMemory
| 0x01000022
|  
| [S2] LibraryAppletPromoteQualification
|-
|-
| 202 || [19.0.0-19.1.0] UnmapMemory
| 0x01000024
|  
| [S2] SplayApplet
|-
|-
| 203 || [19.0.0-19.1.0] AllocateAddressSpace
| 0x01030024
|  
| [S2] SplayApplet
|-
|-
| 204 || [19.0.0-19.1.0] FreeAddressSpace
| 0x01010025
|  
| [S2] SaveDataBackup (System Settings menu for Save Data Cloud)
|-
|-
| 205 || [19.0.0-19.1.0] RemapMemory
| 0x01020025
|  
| [S2] SaveDataBackup (Same as above except with ApplicationId specified)
|-
|-
| 207 || [19.0.0-19.1.0] ModifyMemoryMapping
| 0x01000028
|  
| [S2] Eula
|-
|-
| 211 || [20.1.1+] MapMemoryV2
| 0x01000032
|  
| [S2] LibraryAppletOfflineWebApp_3
|-
|-
| 212 || [20.1.1+] ModifyMemoryMappingV2
| 0x01000033
|  
| [S2] LibraryAppletOfflineWebSystem
|-
|-
| 213 || [20.1.1+] UnmapMemoryV2
| 0x01000035
|  
| [S2] LibraryAppletLhub
|-
|-
| 214 || [20.1.1+] AllocateAddressSpaceV2
| 0x01000036
|  
| [S2] LibraryAppletLogin
|-
|-
| 215 || [20.1.1+] FreeAddressSpaceV2
| 0x01000037
|  
| [S2] LibraryAppletShare
|-
|-
| 216 || [20.1.1+] RemapMemoryV2
| 0x01000050
|}
|  
 
| [S2] PlayerSelect
==== CreateGpuMemory ====
|-
Unofficial name.
| 0x01000051
 
|  
Takes two input u64s '''MemoryAddressStart''' and '''MemoryAddressEnd''' and two u8s. Returns an output u32 '''GpuMemoryHandle'''.
| [S2] PlayerSelect
 
The memory region between '''MemoryAddressStart''' and '''MemoryAddressEnd''' must have been passed to [[#SVC|SVC]] 0x80 with attribute 0x20.
 
==== DestroyGpuMemory ====
Unofficial name.
 
Takes two input u32s '''GpuMemoryHandle''' and '''EventId'''. No output.
 
The Event handle associated with '''EventId''' will be signalled when the memory is released.
 
= Library Applets =
This section documents library applet launching.
 
Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
 
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
 
== CommonArguments ==
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by <code>nn::la::CommonArgumentsWriter</code> and has the following format.
 
This struct is 0x20-bytes.
 
Official sw handles the first 8-bytes separately, which is a header. With CommonArguments version 0x0, the header is 4-bytes, while starting with version 0x1 it's 8-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Typical Value || Notes
| 0x01000052
|-
| 0x0 || 4 || 1 || Common Arguments version
|-
| 0x4 || 4 || 0x20 || Common Arguments size
|-
| 0x8 || 4 || || Library applet version (API version)
|-
| 0xC || 4 || 0 || Theme color
|-
| 0x10 || 1 || 0 || Play startup sound
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
|-
|}
 
= AppletId =
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
 
{| class="wikitable" border="1"
|-
! Value
! ProgramId
! Description
|-
| 0x00000000
|  
|  
| None
| [S2] PlayerSelect
|-
| 0x00000001
|
| Application (not valid for use with LibraryApplets)
|-
| 0x00000002
| 0x010000000000100C
| OverlayApplet (overlayDisp)
|-
| 0x00000003
| 0x0100000000001000
| SystemAppletMenu (qlaunch)
|-
| 0x00000004
| 0x0100000000001012
| SystemApplication (starter)
|-
| 0x0000000A
| 0x0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
| 0x0000000B
| 0x0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
| 0x0000000C
| 0x0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
| 0x0000000D
| 0x0100000000001004
| LibraryAppletDataErase (dataErase)
|-
| 0x0000000E
| 0x0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
|-
| 0x0000000F
| 0x0100000000001006
| LibraryAppletNetConnect (netConnect)
|-
| 0x00000010
| 0x0100000000001007
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
|-
| 0x00000011
| 0x0100000000001008
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
|-
| 0x00000012
| 0x0100000000001009
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
|-
| 0x00000013
| 0x010000000000100A
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
| 0x00000014
| 0x010000000000100B
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
| 0x00000015
| 0x010000000000100D
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
| 0x00000016
| 0x010000000000100E
| LibraryAppletSet (set)
|-
| 0x00000017
| 0x010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
| 0x00000018
| 0x0100000000001010
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
|-
| 0x00000019
| 0x0100000000001011
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
|-
| 0x0000001A
| 0x0100000000001013
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
|-
| 0x0000001B
| 0x010000000000101A
| LibraryAppletGift (gift)
|-
| 0x0000001C
| 0x010000000000101C
| LibraryAppletUserMigration (userMigration)
|-
| 0x0000001D
| 0x010000000000101D
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
|-
| 0x0000001E
| 0x0100000000001020
| [9.0.0+] LibraryAppletStory (story)
|-
| 0x0000001F
| 0x010070000E3C0000
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
|-
| 0x00000020
| 0x010086000E49C000
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
|-
| 0x00000021
| 0x0100000000001038
| [10.0.0+] LibraryAppletSample (sample)
|-
| 0x00000022
| 0x0100000000001007
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
|-
| 0x00000032
| 0x010000000000100F
| [17.0.0+] LibraryAppletOfflineWebApp_3 ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
| 0x00000033
| 0x010000000000100F
| [17.0.0+] LibraryAppletOfflineWebSystem ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
| 0x00000035
| [17.0.0+] 0x0100000000001010 ([16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] LibraryAppletLhub ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
| 0x00000036
| [17.0.0+] 0x0100000000001010 ([16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] LibraryAppletLogin ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
| 0x00000037
| [17.0.0+] 0x0100000000001010 ([16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] LibraryAppletShare ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
| 0x00000038
| 0x0100000000001043
| [16.0.0-16.1.0]
|-
| 0x00000050
| 0x0100000000001007
| [18.0.0+]
|-
| 0x00000051
| 0x0100000000001007
| [18.0.0+]
|-
| 0x00000064
| 0x0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
|-
| 0x000003E8
|
| [10.0.0-16.1.0] DevlopmentTool
|-
| 0x000003F1
| 0x010000000000D619
| [10.0.0-16.1.0] CombinationLA
|-
| 0x000003F2
| 0x010000000000D610
| [10.0.0-16.1.0] AeSystemApplet
|-
| 0x000003F3
| 0x010000000000D611
| [10.0.0-16.1.0] AeOverlayApplet
|-
| 0x000003F4
| 0x010000000000D612
| [10.0.0-16.1.0] AeStarter
|-
| 0x000003F5
| 0x010000000000D613
| [10.0.0-16.1.0] AeLibraryAppletAlone
|-
| 0x000003F6
| 0x010000000000D614
| [10.0.0-16.1.0] AeLibraryApplet1
|-
| 0x000003F7
| 0x010000000000D615
| [10.0.0-16.1.0] AeLibraryApplet2
|-
| 0x000003F8
| 0x010000000000D616
| [10.0.0-16.1.0] AeLibraryApplet3
|-
| 0x000003F9
| 0x010000000000D617
| [10.0.0-16.1.0] AeLibraryApplet4
|-
| 0x000003FA
| 0x010000000000D60A
| [10.0.0-16.1.0] AppletISA
|-
| 0x000003FB
| 0x010000000000D60B
| [10.0.0-16.1.0] AppletIOA
|-
| 0x000003FC
| 0x010000000000D60C
| [10.0.0-16.1.0] AppletISTA
|-
| 0x000003FD
| 0x010000000000D60D
| [10.0.0-16.1.0] AppletILA1
|-
| 0x000003FE
| 0x010000000000D60E
| [10.0.0-16.1.0] AppletILA2
|-
| 0x0100000E
|
| [S2] LibraryAppletError
|-
| 0x01000010
|
| [S2] LibraryAppletPlayerSelect
|-
| 0x01010011
|
| [S2] SwkbdModeless
|-
| 0x01020011
|
| [S2] Swkbd
|-
| 0x01000013
|
| [S2] OpenWeb
|-
| 0x01000014
|
| [S2] LibraryAppletShop
|-
| 0x01000022
|
| [S2] LibraryAppletPromoteQualification
|-
|-
| 0x01010025
| 0x01000065
|  
|  
| [S2] SaveDataBackup
| [S2] Chat (ForChatStart)
|-
|-
| 0x01020025
| 0x01010065
|  
|  
| [S2] SaveDataBackup
| [S2] Chat (ForCameraConfiguration)
|-
|-
| 0x01000032
| 0x01020065
|  
|  
| [S2] LibraryAppletOfflineWebApp_3
| [S2] Chat (ForFullScreen)
|-
|-
| 0x01000033
| 0x01030065
|  
|  
| [S2] LibraryAppletOfflineWebSystem
| [S2] Chat (ForCameraSharingGuide)
|-
| 0x01000035
|
| [S2] LibraryAppletLhub
|-
| 0x01000036
|
| [S2] LibraryAppletLogin
|-
| 0x01000037
|
| [S2] LibraryAppletShare
|-
| 0x01000050
|
| [S2] PlayerSelect
|-
| 0x01000051
|
| [S2] PlayerSelect
|-
| 0x01000052
|
| [S2] PlayerSelect
|-
|-
| 0x700000C8
| 0x700000C8