Applet Manager services: Difference between revisions

No edit summary
 
(52 intermediate revisions by 4 users not shown)
Line 10: Line 10:
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 100 || OpenSystemAppletProxy || Returns an [[#ISystemAppletProxy]].
| 100 || OpenSystemAppletProxyOld ([1.0.0-19.0.1] OpenSystemAppletProxy) || Returns an [[#ISystemAppletProxy]].
|-
|-
| 110 || [20.0.0+] ||
| 110 || [20.0.0+] OpenSystemAppletProxy || Same as OpenSystemAppletProxyOld except this now takes a type-0x15 buffer containing an [[#AppletAttribute|AppletAttribute]].
|-
|-
| 200 || OpenLibraryAppletProxyOld ([1.0.0-2.3.0] OpenLibraryAppletProxy) || Returns an [[#ILibraryAppletProxy]].
| 200 || OpenLibraryAppletProxyOld ([1.0.0-2.3.0] OpenLibraryAppletProxy) || Returns an [[#ILibraryAppletProxy]].
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 401: Line 410:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [[#GetAppletStateChangedEvent]]
|-
|-
| 0 || [[#GetAppletStateChangedEvent]] ||
| 1 || [[#IsCompleted]]
|-
|-
| 1 || [[#IsCompleted]] ||
| 10 || [[#Start]]
|-
|-
| 10 || [[#Start]] ||
| 20 || [[#RequestExit]]
|-
|-
| 20 || [[#RequestExit]] ||
| 25 || [[#Terminate]]
|-
|-
| 25 || [[#Terminate]] ||
| 30 || [[#GetResult]]
|-
|-
| 30 || [[#GetResult]] ||
| 101 || [[#RequestForApplicationToGetForeground]]  
|-
|-
| 101 || [[#RequestForApplicationToGetForeground]] ||
| 110 || [[#TerminateAllLibraryApplets]]
|-
|-
| 110 || [[#TerminateAllLibraryApplets]] ||
| 111 || [[#AreAnyLibraryAppletsLeft]]  
|-
|-
| 111 || [[#AreAnyLibraryAppletsLeft]] ||
| 112 || [[#GetCurrentLibraryApplet]]  
|-
|-
| 112 || [[#GetCurrentLibraryApplet]] ||
| 120 || [[#GetApplicationId]]
|-
|-
| 120 || [[#GetApplicationId]] ||
| 121 || [[#PushLaunchParameter]]  
|-
|-
| 121 || [[#PushLaunchParameter]] ||
| 122 || [[#GetApplicationControlProperty]]  
|-
|-
| 122 || [[#GetApplicationControlProperty]] ||
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]]  
|-
|-
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]] ||
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]]  
|-
|-
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]] ||
| 130 || [6.0.0+] [[#SetUsers]]
|-
|-
| 130 || [6.0.0+] [[#SetUsers]] ||
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]]
|-
|-
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]] ||
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]]  
|-
|-
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]] ||
| 140 || [6.0.0+] [[#GetDesirableUids]]
|-
|-
| 140 || [6.0.0+] [[#GetDesirableUids]] ||
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]]  
|-
|-
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]] ||
| 160 || [8.0.0+] [[#SetApplicationAttribute]]
|-
|-
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]]
|-
|-
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]]
|-
|-
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]]
|-
|-
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]]
|-
|-
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]] ||
| 201 || [10.0.0+] [[#RestartApplicationTimer]]
|-
|-
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||
| 300 || [20.0.0+]
|-
|-
| 300 || [20.0.0+] ||
| 301 || [20.0.0+]
|-
|-
| 301 || [20.0.0+] ||
| 310 || [21.0.0+]
|}
|}


Line 631: 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]
|-
|-
| 161 || [18.0.0+] GetNotificationSenderService
| 118 || [S2]
|-
|-
| 300 || [17.0.0+] GetCurrentApplicationId
| 119 || [S2]
|-
|-
| 310 || [19.0.0+] IsSystemAppletHomeMenu
| 120 || [S2]
|-
|-
| 311 || [20.0.0+]
| 121 || [S2]
|-
|-
| 320 || [19.0.0+] SetGpuTimeSliceBoost
| 122 || [S2]
|-
|-
| 321 || [19.0.0+] SetGpuTimeSliceBoostDueToApplication
| 123 || [S2]
|-
|-
| 322 || [20.0.0+]
| 124 || [S2]
|-
|-
| 330 || [19.0.0+]  
| 130 || [S2]
|-
|-
| 340 || [20.0.0+]
| 131 || [S2] [20.0.0+]
|-
|-
| 341 || [20.0.0+]
| 135 || [S2] [20.0.0+]
|-
|-
| 342 || [20.0.0+]
| 140 || [S2]
|-
|-
| 350 || [20.0.0+]
| 150 || [S2]
|-
|-
| 360 || [20.0.0+]
| 160 || [18.0.0+] [[#GetNotificationReceiverService|GetNotificationReceiverService]]
|}
|-
 
| 161 || [18.0.0+] [[#GetNotificationSenderService|GetNotificationSenderService]]
ReadThemeStorage/WriteThemeStorage: these commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes. The default content of the ThemeStorage prior to using the WriteThemeStorage cmd, is: <code>memset(statebuf, 0xAA, 0x400);</code>
|-
 
| 170 || [S2]
=== ReadThemeStorage ===
|-
Takes an input u64 '''offset''' and a type-0x22 output buffer, returns an output u64 '''actual_transfer_size'''.
| 171 || [S2]
 
|-
=== WriteThemeStorage ===
| 200 || [S2]
Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
|-
 
| 210 || [S2]
=== PushToAppletBoundChannel ===
|-
Takes an input [[#IStorage]], no output.
| 211 || [S2]
 
|-
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
| 220 || [S2]
 
|-
=== TryPopFromAppletBoundChannel ===
| 221 || [S2]
No input, returns an output [[#IStorage]].
|-
 
| 230 || [S2]
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
|-
 
| 231 || [S2]
=== GetDisplayLogicalResolution ===
|-
No input, returns an output s32 '''width''' and s32 '''height'''.
| 250 || [S2]
 
|-
=== SetDisplayMagnification ===
| 251 || [S2]
Takes an input float '''x''', float '''y''', float '''width''', and float '''height''', no output.
|-
 
| 252 || [S2]
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.
|-
 
| 253 || [S2]
'''x''' and '''width''' are multiplied with the same width value returned by [[#GetDisplayLogicalResolution]], so these should be in the range 0.0f-1.0f. Likewise for y and height, except these are multipled with the height value.
|-
 
| 260 || [S2]
=== SetHomeButtonDoubleClickEnabled ===
|-
Takes an input u8 bool, no output.
| 271 || [S2] [20.0.0+]
 
|-
=== GetHomeButtonDoubleClickEnabled ===
| 280 || [S2] [20.0.0+]
No input, returns an output u8 bool.
|-
 
| 290 || [S2] [20.0.0+] RequestChatProhibition
=== IsHomeButtonShortPressedBlocked ===
|-
No input, returns an output u8 bool.
| 291 || [S2] [20.0.0+] RequestChatExpirationCheckSkip
 
|-
=== IsVrModeCurtainRequired ===
| 300 || [17.0.0+] GetCurrentApplicationId
No input, returns an output bool.
 
=== SetCpuBoostRequestPriority ===
Takes an input s32, no output.
 
== ILibraryAppletProxy ==
This is "nn::am::service::ILibraryAppletProxy".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 310 || [19.0.0+] IsSystemAppletHomeMenu
|-
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
| 311 || [20.0.0+]
|-
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
| 320 || [19.0.0+] SetGpuTimeSliceBoost
|-
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
| 321 || [19.0.0+] SetGpuTimeSliceBoostDueToApplication
|-
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
| 322 || [20.0.0+]
|-
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
| 330 || [19.0.0+]  
|-
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
| 340 || [20.0.0+]
|-
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 341 || [20.0.0+]
|-
|-
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
| 342 || [20.0.0+]
|-
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
| 350 || [20.0.0+]
|-
|-
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
| 360 || [20.0.0+]
|-
| 370 || [22.0.0+] GetGpuErrorEventForApplet
|-
| 2000 || [S2]
|-
| 2010 || [S2]
|-
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
| 3000 || [S2] [20.0.0+]
|-
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 3010 || [S2] [20.0.0+]
|}
|}


=== ILibraryAppletSelfAccessor ===
ReadThemeStorage/WriteThemeStorage: these commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes. The default content of the ThemeStorage prior to using the WriteThemeStorage cmd, is: <code>memset(statebuf, 0xAA, 0x400);</code>
This is "nn::am::service::ILibraryAppletSelfAccessor".
 
=== ReadThemeStorage ===
Takes an input u64 '''offset''' and a type-0x22 output buffer, returns an output u64 '''actual_transfer_size'''.
 
=== WriteThemeStorage ===
Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
 
=== PushToAppletBoundChannel ===
Takes an input [[#IStorage]], no output.
 
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
 
=== TryPopFromAppletBoundChannel ===
No input, returns an output [[#IStorage]].


{| class="wikitable" border="1"
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
|-
 
! Cmd || Name || Notes
=== GetDisplayLogicalResolution ===
|-
No input, returns an output s32 '''width''' and s32 '''height'''.
| 0 || [[#PopInData]] ||
 
|-
=== SetDisplayMagnification ===
| 1 || [[#PushOutData]] ||
Takes an input float '''x''', float '''y''', float '''width''', and float '''height''', no output.
|-
 
| 2 || [[#PopInteractiveInData]] ||
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.
|-
 
| 3 || [[#PushInteractiveOutData]] ||
'''x''' and '''width''' are multiplied with the same width value returned by [[#GetDisplayLogicalResolution]], so these should be in the range 0.0f-1.0f. Likewise for y and height, except these are multipled with the height value.
|-
 
| 5 || [[#GetPopInDataEvent]] ||
=== SetHomeButtonDoubleClickEnabled ===
|-
Takes an input u8 bool, no output.
| 6 || [[#GetPopInteractiveInDataEvent]] ||
 
|-
=== GetHomeButtonDoubleClickEnabled ===
| 10 || [[#ExitProcessAndReturn]] ||
No input, returns an output u8 bool.
|-
 
| 11 || [[#GetLibraryAppletInfo]] ||
=== IsHomeButtonShortPressedBlocked ===
No input, returns an output u8 bool.
 
=== IsVrModeCurtainRequired ===
No input, returns an output bool.
 
=== SetCpuBoostRequestPriority ===
Takes an input s32, no output.
 
=== GetNotificationReceiverService ===
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"
|-
|-
| 12 || [[#GetMainAppletIdentityInfo]] ||
! Cmd || Name
|-
|-
| 13 || [[#CanUseApplicationCore]] ||
| 0 ||  
|-
|}
| 14 || [[#GetCallerAppletIdentityInfo]] ||
 
==== 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"
|-
|-
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
! Cmd || Name
|-
|-
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
| 0 || AddSource
|-
|-
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||
| 1 || RemoveSource
|-
|-
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||
| 2 || GetEvent
|-
|-
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||
| 3 || Receive
|-
|-
| 20 || [[#PopExtraStorage]] ||
| 4 || ReceiveWithTick
|}
 
===== GetEvent =====
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"
|-
|-
| 25 || [[#GetPopExtraStorageEvent]] ||
! Cmd || Name
|-
|-
| 30 || [[#UnpopInData]] ||
| 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"
|-
|-
| 31 || [[#UnpopExtraStorage]] ||  
! Cmd || Name
|-
|-
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||
| 0 || Send
|-
|-
| 50 || [3.0.0+] [[#ReportVisibleError]] ||
| 1 || GetUnreceivedMessageCount
|-
|}
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||
 
== ILibraryAppletProxy ==
This is "nn::am::service::ILibraryAppletProxy".
 
{| class="wikitable" border="1"
|-
|-
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||
! Cmd || Name || Notes
|-
|-
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
|-
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
|-
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
|-
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
|-
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
|-
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
|-
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
|-
|-
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
|-
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
|-
|-
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
|-
| 160 || [17.0.0+] [[#GetLibraryAppletInfoEx]] ||
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}
|}


==== PopInData ====
=== ILibraryAppletSelfAccessor ===
No input, returns an output [[#IStorage]].
This is "nn::am::service::ILibraryAppletSelfAccessor".


==== PushOutData ====
{| class="wikitable" border="1"
Takes an input [[#IStorage]], no output.
|-
 
! Cmd || Name || Notes
==== PopInteractiveInData ====
|-
No input, returns an output [[#IStorage]].
| 0 || [[#PopInData]] ||
 
|-
==== PushInteractiveOutData ====
| 1 || [[#PushOutData]] ||
Takes an input [[#IStorage]], no output.
|-
 
| 2 || [[#PopInteractiveInData]] ||
==== GetPopInDataEvent ====
|-
No input, returns an output Event handle with autoclear=false.
| 3 || [[#PushInteractiveOutData]] ||
 
|-
==== GetPopInteractiveInDataEvent ====
| 5 || [[#GetPopInDataEvent]] ||
No input, returns an output Event handle with autoclear=false.
|-
 
| 6 || [[#GetPopInteractiveInDataEvent]] ||
==== ExitProcessAndReturn ====
|-
No input/output.
| 10 || [[#ExitProcessAndReturn]] ||
 
|-
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).
| 11 || [[#GetLibraryAppletInfo]] ||
 
|-
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
| 12 || [[#GetMainAppletIdentityInfo]] ||
 
|-
==== GetLibraryAppletInfo ====
| 13 || [[#CanUseApplicationCore]] ||
No input, returns an output [[#LibraryAppletInfo]].
|-
 
| 14 || [[#GetCallerAppletIdentityInfo]] ||
==== GetMainAppletIdentityInfo ====
|-
No input, returns an output [[#AppletIdentityInfo]].
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
 
|-
==== CanUseApplicationCore ====
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
No input, returns an output u8 bool.
|-
 
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||
==== GetCallerAppletIdentityInfo ====
|-
No input, returns an output [[#AppletIdentityInfo]].
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||
 
|-
==== GetMainAppletApplicationControlProperty ====
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||
No input, takes a type-0x16 output buffer.
|-
 
| 20 || [[#PopExtraStorage]] ||
This gets the [[NACP_Format|control.nacp]].
|-
 
| 25 || [[#GetPopExtraStorageEvent]] ||
==== GetMainAppletStorageId ====
|-
No input, returns an output u8 storageId.
| 30 || [[#UnpopInData]] ||
 
|-
==== GetCallerAppletIdentityInfoStack ====
| 31 || [[#UnpopExtraStorage]] ||
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.
|-
 
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||
==== GetNextReturnDestinationAppletIdentityInfo ====
|-
No input, returns an output [[#AppletIdentityInfo]].
| 50 || [3.0.0+] [[#ReportVisibleError]] ||
|-
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||
|-
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||
|-
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||
|-
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||
|-
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||
|-
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||
|-
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||
|-
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||
|-
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
|-
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
|-
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
|-
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||
|-
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
|-
| 160 || [17.0.0+] [[#GetLibraryAppletInfoEx]] ||
|}


==== GetDesirableKeyboardLayout ====
==== PopInData ====
No input, returns an output u32.
No input, returns an output [[#IStorage]].


The output u32 is "nn::settings::KeyboardLayout".
==== PushOutData ====
Takes an input [[#IStorage]], no output.


This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it's not set.
==== PopInteractiveInData ====
 
==== PopExtraStorage ====
No input, returns an output [[#IStorage]].
No input, returns an output [[#IStorage]].


==== GetPopExtraStorageEvent ====
==== PushInteractiveOutData ====
No input, returns an output Event handle with autoclear=false.
 
==== UnpopInData ====
Takes an input [[#IStorage]], no output.
Takes an input [[#IStorage]], no output.


==== UnpopExtraStorage ====
==== GetPopInDataEvent ====
Takes an input [[#IStorage]], no output.
No input, returns an output Event handle with autoclear=false.


==== GetIndirectLayerProducerHandle ====
==== GetPopInteractiveInDataEvent ====
No input, returns an output u64.
No input, returns an output Event handle with autoclear=false.


==== ReportVisibleError ====
==== ExitProcessAndReturn ====
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.
No input/output.


==== ReportVisibleErrorWithErrorContext ====
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.


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


==== GetCurrentApplicationId ====
==== GetLibraryAppletInfo ====
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
No input, returns an output [[#LibraryAppletInfo]].


Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.
==== GetMainAppletIdentityInfo ====
No input, returns an output [[#AppletIdentityInfo]].


==== RequestExitToSelf ====
==== CanUseApplicationCore ====
No input/output.
No input, returns an output u8 bool.


Same as [[#RequestExit]] except this is for the current applet.
==== GetCallerAppletIdentityInfo ====
No input, returns an output [[#AppletIdentityInfo]].


==== CreateApplicationAndPushAndRequestToLaunch ====
==== GetMainAppletApplicationControlProperty ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.
No input, takes a type-0x16 output buffer.


This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
This gets the [[NACP_Format|control.nacp]].


==== CreateGameMovieTrimmer ====
==== GetMainAppletStorageId ====
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
No input, returns an output u8 storageId.


This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].
==== GetCallerAppletIdentityInfoStack ====
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.


Official sw uses an user-buffer for the tmem, with permissions=0.
==== GetNextReturnDestinationAppletIdentityInfo ====
No input, returns an output [[#AppletIdentityInfo]].


==== ReserveResourceForMovieOperation ====
==== GetDesirableKeyboardLayout ====
No input/output.
No input, returns an output u32.


Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].
The output u32 is "nn::settings::KeyboardLayout".


==== UnreserveResourceForMovieOperation ====
This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it's not set.
No input/output.


Updates state fields. This must be used once finished with [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
==== PopExtraStorage ====
No input, returns an output [[#IStorage]].


==== GetMainAppletAvailableUsers ====
==== GetPopExtraStorageEvent ====
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 '''total_entries'''.
No input, returns an output Event handle with autoclear=false.


This gets the userIDs previously set by [[#SetUsers]].
==== UnpopInData ====
Takes an input [[#IStorage]], no output.


The size of the output buffer in entries must be at least 8.
==== UnpopExtraStorage ====
Takes an input [[#IStorage]], no output.


Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
==== GetIndirectLayerProducerHandle ====
No input, returns an output u64.


==== SetApplicationMemoryReservation ====
==== ReportVisibleError ====
Takes an input u64, no output.
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.


An Application must be currently running. The input u64 must be 0x1000-byte aligned.
==== ReportVisibleErrorWithErrorContext ====
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.


==== ShouldSetGpuTimeSliceManually ====
==== GetMainAppletApplicationDesiredLanguage ====
No input, returns an output u8 bool.
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].


==== GetLibraryAppletInfoEx ====
==== GetCurrentApplicationId ====
No input, returns an output u64. Currently always returns 0.
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].


== IOverlayAppletProxy ==
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.
This is "nn::am::service::IOverlayAppletProxy".


{| class="wikitable" border="1"
==== RequestExitToSelf ====
|-
No input/output.
! 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]].
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}


=== IOverlayFunctions ===
Same as [[#RequestExit]] except this is for the current applet.
This is "nn::am::service::IOverlayFunctions".


{| class="wikitable" border="1"
==== CreateApplicationAndPushAndRequestToLaunch ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.
! Cmd || Name
 
|-
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
| 0 || [[#BeginToWatchShortHomeButtonMessage]]
 
|-
==== CreateGameMovieTrimmer ====
| 1 || [[#EndToWatchShortHomeButtonMessage]]
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
|-
 
| 2 || [[#GetApplicationIdForLogo]]
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].
|-
 
| 3 || [[#SetGpuTimeSliceBoost]]
Official sw uses an user-buffer for the tmem, with permissions=0.
|-
 
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]
==== ReserveResourceForMovieOperation ====
|-
No input/output.
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]
 
|-
Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]
 
|-
==== UnreserveResourceForMovieOperation ====
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]
No input/output.
|-
 
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]
Updates state fields. This must be used once finished with [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
 
==== GetMainAppletAvailableUsers ====
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 '''total_entries'''.
 
This gets the userIDs previously set by [[#SetUsers]].
 
The size of the output buffer in entries must be at least 8.
 
Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
 
==== SetApplicationMemoryReservation ====
Takes an input u64, no output.
 
An Application must be currently running. The input u64 must be 0x1000-byte aligned.
 
==== ShouldSetGpuTimeSliceManually ====
No input, returns an output u8 bool.
 
==== GetLibraryAppletInfoEx ====
No input, returns an output u64. Currently always returns 0.
 
== IOverlayAppletProxy ==
This is "nn::am::service::IOverlayAppletProxy".
 
{| class="wikitable" border="1"
|-
|-
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
! Cmd || Name || Notes
|-
|-
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
|-
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
|-
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
|-
| 40 || [18.0.0+] GetApplicationNintendoLogo
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
|-
| 41 || [18.0.0+] GetApplicationStartupMovie
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
|-
| 50 || [19.0.0+] SetGpuTimeSliceBoostForApplication
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
|-
| 60 || [19.0.0+]
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
|-
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}
|}


==== BeginToWatchShortHomeButtonMessage ====
=== IOverlayFunctions ===
No input/output.
This is "nn::am::service::IOverlayFunctions".


==== EndToWatchShortHomeButtonMessage ====
{| class="wikitable" border="1"
No input/output.
|-
 
! Cmd || Name
==== GetApplicationIdForLogo ====
|-
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
| 0 || [[#BeginToWatchShortHomeButtonMessage]]
 
|-
Gets the ApplicationId for displaying the logo screen during application launch.
| 1 || [[#EndToWatchShortHomeButtonMessage]]
 
|-
When no application is running, this returns success with ApplicationId=0.
| 2 || [[#GetApplicationIdForLogo]]
 
|-
==== SetGpuTimeSliceBoost ====
| 3 || [[#SetGpuTimeSliceBoost]]
Takes an input u64, no output.
|-
 
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]
==== SetAutoSleepTimeAndDimmingTimeEnabled ====
|-
Takes an input u8 bool, no output.
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]
|-
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]
|-
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]
|-
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]
|-
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled
|-
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
|-
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
|-
| 40 || [18.0.0+] GetApplicationNintendoLogo
|-
| 41 || [18.0.0+] GetApplicationStartupMovie
|-
| 50 || [19.0.0+] SetGpuTimeSliceBoostForApplication
|-
| 60 || [19.0.0+]
|-
| 61 || [S2]
|-
| 70 || [21.0.0+]
|-
| 71 || [21.0.0+]
|-
| 75 || [21.0.0+]
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
|-
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
|-
| 110 || [S2]
|-
| 1000 || [S2]
|}


==== TerminateApplicationAndSetReason ====
==== BeginToWatchShortHomeButtonMessage ====
Takes an input u32 Result, no output.
No input/output.


==== SetScreenShotPermissionGlobally ====
==== EndToWatchShortHomeButtonMessage ====
Takes an input u8 bool, no output.
No input/output.
 
 
==== StartShutdownSequenceForOverlay ====
==== GetApplicationIdForLogo ====
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
 
Gets the ApplicationId for displaying the logo screen during application launch.
 
When no application is running, this returns success with ApplicationId=0.
 
==== SetGpuTimeSliceBoost ====
Takes an input u64, no output.
 
==== SetAutoSleepTimeAndDimmingTimeEnabled ====
Takes an input u8 bool, no output.
 
==== TerminateApplicationAndSetReason ====
Takes an input u32 Result, no output.
 
==== SetScreenShotPermissionGlobally ====
Takes an input u8 bool, no output.
 
==== StartShutdownSequenceForOverlay ====
No input/output.
No input/output.


Line 1,083: 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,099: 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,104: 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,116: 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 ||
|-
| 10 ||
|-
| 11 ||  
|-
|-
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
| 20 ||  
|-
|-
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
| 21 ||  
|-
|-
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]
| 32 ||  
|-
|-
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
| 33 ||  
|-
|-
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
| 40 ||  
|-
|-
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
| 41 ||  
|-
|-
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]
| 42 ||  
|-
|-
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]
| 50 || [20.0.0+]
|-
|-
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]
| 51 || [20.0.0+]
|-
|-
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]
| 60 || [20.0.0+]
|-
|-
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
| 70 || [20.0.0+]
|-
|-
| 210 || [20.0.0+]
| 71 || [20.0.0+]
|}
 
== IApplicationProxy ==
This is "nn::am::service::IApplicationProxy".
 
{| class="wikitable" border="1"
|-
|-
| 220 || [20.0.0+]
! Cmd || Name || Notes
|-
|-
| 300 || [19.0.0+] [[#CreateMovieWriter]]
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
|-
| 310 || [20.0.0+]
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
|-
| 320 || [20.0.0+]
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
|-
| 330 || [20.2.0+]
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]]
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
|-
| 1001 || [5.0.0+] [[#PrepareForJit]]
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|}
|-
 
| 20 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].
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.
| 40 || [S2] || Returns an [[#IPerformanceFunctions|IPerformanceFunctions]].
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.
|-
* Closes the TransferMemory handle, + TransferMemory cleanup.
| 60 || [S2] || Returns an [[#IGraphicsScalingParametersFunctions|IGraphicsScalingParametersFunctions]].
* Uses [[#SetGamePlayRecordingState]] with value 0x1.
|-
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}


==== PopLaunchParameter ====
=== IApplicationFunctions ===
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].
This is "nn::am::service::IApplicationFunctions".


Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.
{| class="wikitable" border="1"
 
|-
==== CreateApplicationAndPushAndRequestToStart ====
! Cmd || Name
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.
|-
 
| 1 || [[#PopLaunchParameter]]
==== CreateApplicationAndPushAndRequestToStartForQuest ====
|-
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
 
|-
==== CreateApplicationAndRequestToStart ====
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
|-
 
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
|-
 
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
==== CreateApplicationAndRequestToStartForQuest ====
|-
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
 
|-
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
 
|-
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
| 20 || [[#EnsureSaveData]]
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
|-
 
| 21 || [[#GetDesiredLanguage]]
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]].
|-
 
| 22 || [[#SetTerminateResult]]
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
| 23 || [[#GetDisplayVersion]]
 
|-
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]].
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
 
|-
==== EnsureSaveData ====
| 25 || [3.0.0+] ExtendSaveData
Takes an input u128 userID, returns an output u64 size.
|-
 
| 26 || [3.0.0+] GetSaveDataSize
Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.
|-
 
| 27 || [5.0.0+] CreateCacheStorage
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
|-
 
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
|-
 
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
==== GetDesiredLanguage ====
|-
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
 
|-
==== SetTerminateResult ====
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
Takes an input u32 '''Result''', no output.
|-
 
| 32 || [[#BeginBlockingHomeButton]]
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.
|-
 
| 33 || [[#EndBlockingHomeButton]]
==== GetDisplayVersion ====
|-
No input, returns an output 0x10-byte struct.
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
 
|-
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
 
|-
==== GetLaunchStorageInfoForDebug ====
| 36 || [14.0.0+] GetLimitedApplicationLicense
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
|-
 
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
|-
 
| 40 || [[#NotifyRunning]]
==== GetSaveDataSizeMax ====
|-
No input, returns two ouput s64s.
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
 
|-
==== GetCacheStorageMax ====
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
No input, returns an output s32 and s64.
|-
 
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
==== BeginBlockingHomeButtonShortAndLongPressed ====
|-
Takes an input s64, no output.
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
 
|-
Official user-processes use hard-coded value 0 for the s64.
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
 
|-
Starts blocking the Home button.
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
 
|-
==== EndBlockingHomeButtonShortAndLongPressed ====
| 70 || [3.0.0+] [[#RequestToShutdown]]
No input/output.
|-
 
| 71 || [3.0.0+] [[#RequestToReboot]]
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].
|-
 
| 72 || [10.0.0+] [[#RequestToSleep]]
==== BeginBlockingHomeButton ====
|-
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
 
|-
==== EndBlockingHomeButton ====
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
No input/output.
|-
 
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]  
==== SelectApplicationLicense ====
|-
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
 
|-
==== GetDeviceSaveDataSizeMax ====
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
No input, returns two output s64s.
|-
 
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
==== NotifyRunning ====
|-
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
 
|-
==== GetPseudoDeviceId ====
| 112 || [20.0.0+]
No input, returns an output 0x10-byte "nn::util::Uuid" struct.
|-
 
| 113 || [20.0.0+]
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.
|-
 
| 120 || [5.0.0+] [[#ExecuteProgram]]
==== SetMediaPlaybackStateForApplication ====
|-
Takes an input u8 bool, no output.
| 121 || [5.0.0+] [[#ClearUserChannel]]
 
|-
==== IsGamePlayRecordingSupported ====
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
No input, returns an output u8 bool.
|-
 
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
==== InitializeGamePlayRecording ====
|-
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
 
|-
==== SetGamePlayRecordingState ====
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
Takes an input u32. 0 = disable/pause, 1 = enable/restart.
|-
 
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
==== RequestFlushGamePlayingMovieForDebug ====
|-
No input/output.
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
 
|-
Requests to save the video recording, as if the Capture-button was held.
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]
 
|-
==== RequestToShutdown ====
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
No input/output.
|-
 
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
|-
 
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
==== RequestToReboot ====
|-
No input/output.
| 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]]
|}


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
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]].


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


==== ExitAndRequestToShowThanksMessage ====
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.
No input/output.


Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.
==== CreateApplicationAndPushAndRequestToStart ====
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.


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


==== EnableApplicationCrashReport ====
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
Takes an input u8 bool, no output.


==== InitializeApplicationCopyrightFrameBuffer ====
==== CreateApplicationAndRequestToStartForQuest ====
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.


tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.


User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.


After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.
[21.0.0+] Now returns an output [[#IStorage]].


This is used as an overlay for screenshots.
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]].


==== SetApplicationCopyrightImage ====
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.


'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
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]].


Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.
==== EnsureSaveData ====
Takes an input u128 userID, returns an output u64 size.


==== SetApplicationCopyrightVisibility ====
Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.
Takes an input u8 bool, no output.


Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.


==== QueryApplicationPlayStatistics ====
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
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 number of entries in each array is the same.
==== GetDesiredLanguage ====
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].


See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
==== SetTerminateResult ====
Takes an input u32 '''Result''', no output.


This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.


==== QueryApplicationPlayStatisticsByUid ====
==== GetDisplayVersion ====
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 an output 0x10-byte struct.


Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.


==== ExecuteProgram ====
==== GetLaunchStorageInfoForDebug ====
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].


==== ClearUserChannel ====
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
No input/output.


Clears the UserChannel used by [[#UnpopToUserChannel]].
==== GetSaveDataSizeMax ====
No input, returns two ouput s64s.


==== UnpopToUserChannel ====
==== GetCacheStorageMax ====
Takes an input [[#IStorage]], no output.
No input, returns an output s32 and s64.


The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
==== BeginBlockingHomeButtonShortAndLongPressed ====
Takes an input s64, no output.


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.
Official user-processes use hard-coded value 0 for the s64.


==== GetPreviousProgramIndex ====
Starts blocking the Home button.
No input, returns an output s32.


Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.
==== EndBlockingHomeButtonShortAndLongPressed ====
No input/output.


==== EnableApplicationAllThreadDumpOnCrash ====
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].
Takes an input u8 bool, no output.


==== GetGpuErrorDetectedSystemEvent ====
==== BeginBlockingHomeButton ====
No input, returns an output Event handle with autoclear=false.
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.


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.
==== EndBlockingHomeButton ====
No input/output.


==== SetDelayTimeToAbortOnGpuError ====
==== SelectApplicationLicense ====
Takes an input s64 "nn::TimeSpan", no output.
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].


==== GetFriendInvitationStorageChannelEvent ====
==== GetDeviceSaveDataSizeMax ====
No input, returns an output Event handle with EventClearMode=0.
No input, returns two output s64s.


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.
==== NotifyRunning ====
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.


==== TryPopFromFriendInvitationStorageChannel ====
==== GetPseudoDeviceId ====
No input, returns an output [[#IStorage]].
No input, returns an output 0x10-byte "nn::util::Uuid" struct.


This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].
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.


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.
==== SetMediaPlaybackStateForApplication ====
Takes an input u8 bool, no output.


==== GetNotificationStorageChannelEvent ====
==== IsGamePlayRecordingSupported ====
No input, returns an output Event handle with EventClearMode=0.
No input, returns an output u8 bool.


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.
==== InitializeGamePlayRecording ====
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.


==== TryPopFromNotificationStorageChannel ====
==== SetGamePlayRecordingState ====
No input, returns an output [[#IStorage]].
Takes an input u32. 0 = disable/pause, 1 = enable/restart.


This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
==== RequestFlushGamePlayingMovieForDebug ====
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.
Requests to save the video recording, as if the Capture-button was held.


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


==== SetHdcpAuthenticationActivated ====
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
Takes an input u8 bool, no output.


==== GetLaunchRequiredVersion ====
==== RequestToReboot ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].
No input/output.


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


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


sdknso passes hard-coded value 0 for the u64.
==== ExitAndRequestToShowThanksMessage ====
No input/output.


==== SendServerMaintenanceOverlayNotification ====
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.


The second input value can optionally be 0.
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.


==== GetLastApplicationExitReason ====
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
No input, returns an output s32.


==== Cmd220 ====
==== EnableApplicationCrashReport ====
Takes an input u8, no output.
Takes an input u8 bool, no output.


The input must be <=1.
==== InitializeApplicationCopyrightFrameBuffer ====
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.


==== CreateMovieWriter ====
tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.
Takes 8-bytes of input and a handle. Returns an [[#IMovieWriter]].


This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.


==== Cmd330 ====
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.
No input, returns 1-byte of output.


On NX this just writes 0 to output and returns 0.
This is used as an overlay for screenshots.


==== StartContinuousRecordingFlushForDebug ====
==== SetApplicationCopyrightImage ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.


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.
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.


==== CreateMovieMaker ====
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.
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.
==== SetApplicationCopyrightVisibility ====
Takes an input u8 bool, no output.


Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.


==== PrepareForJit ====
==== QueryApplicationPlayStatistics ====
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.
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.


~IApplicationFunctions() includes:
The number of entries in each array is the same.


    if (this->jit_process) {
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
        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.
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.


AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
==== 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.


=== IMovieWriter ===
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
This is "nn::am::service::IMovieWriter".


This was added with [19.0.0+].
==== ExecuteProgram ====
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.


{| class="wikitable" border="1"
==== ClearUserChannel ====
|-
No input/output.
! Cmd || Name
|-
| 0 ||
|}


==== Cmd0 ====
Clears the UserChannel used by [[#UnpopToUserChannel]].
No input. Returns a GRC [[GRC_services|IMovieWriter]].
 
==== UnpopToUserChannel ====
Takes an input [[#IStorage]], no output.
 
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
 
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.


=== IMovieMaker ===
==== GetPreviousProgramIndex ====
This is "nn::am::service::IMovieMaker".
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 || [[#GetGrcMovieMaker]]
|-
| 1 || [[#GetLayerHandle]]
|}


==== GetGrcMovieMaker ====
==== EnableApplicationAllThreadDumpOnCrash ====
No input, returns a GRC [[GRC_services|IMovieMaker]].
Takes an input u8 bool, no output.


==== GetLayerHandle ====
==== GetGpuErrorDetectedSystemEvent ====
No input, returns an output u64.
No input, returns an output Event handle with autoclear=false.


== ILibraryAppletCreator ==
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.
This is "nn::am::service::ILibraryAppletCreator".


{| class="wikitable" border="1"
==== SetDelayTimeToAbortOnGpuError ====
|-
Takes an input s64 "nn::TimeSpan", no output.
! Cmd || Name || Notes
|-
| 0 || [[#CreateLibraryApplet]] ||
|-
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
| 3 || [20.0.0+] ||
|-
| 10 || [[#CreateStorage]] ||
|-
| 11 || [[#CreateTransferMemoryStorage]] ||
|-
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
|}


=== CreateLibraryApplet ===
==== GetFriendInvitationStorageChannelEvent ====
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
No input, returns an output Event handle with EventClearMode=0.


=== TerminateAllLibraryApplets ===
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.
No input/output.


Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
==== TryPopFromFriendInvitationStorageChannel ====
No input, returns an output [[#IStorage]].


Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].


=== AreAnyLibraryAppletsLeft ===
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.
No input, returns an output u8 bool.


Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
==== GetNotificationStorageChannelEvent ====
No input, returns an output Event handle with EventClearMode=0.


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).
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.


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


This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].


=== CreateTransferMemoryStorage ===
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.
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].


The user-process creates the TransferMemory with permissions=0.
==== GetHealthWarningDisappearedSystemEvent ====
No input, returns an output Event with EventClearMode=0.


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.
==== SetHdcpAuthenticationActivated ====
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.
 
==== SendServerMaintenanceOverlayNotification ====
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.
 
The second input value can optionally be 0.
 
==== GetLastApplicationExitReason ====
No input, returns an output s32.


=== CreateHandleStorage ===
==== Cmd210 ====
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.
No input, returns an output Event handle.


The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
==== SetAudioOutputPolicy ====
Takes an input u8, no output.


=== ILibraryAppletAccessor ===
The input must be <=1.
This is "nn::am::service::ILibraryAppletAccessor".


{| class="wikitable" border="1"
==== CreateMovieWriter ====
|-
Takes 8-bytes of input and a handle. Returns an [[#IMovieWriter]].
! Cmd || Name || Notes
|-
| 0 || [[#GetAppletStateChangedEvent]] ||
|-
| 1 || [[#IsCompleted]] ||
|-
| 10 || [[#Start]] ||
|-
| 20 || [[#RequestExit]] ||
|-
| 25 || [[#Terminate]] ||
|-
| 30 || [[#GetResult]] ||
|-
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
|-
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
|-
| 80 || [19.0.0+] RequestForLibraryAppletToGetForeground ||
|-
| 81 || [19.0.0+] GetCurrentChildLibraryApplet ||
|-
| 90 || [20.0.0+] ||
|-
| 100 || [[#PushInData]] ||
|-
| 101 || [[#PopOutData]] ||
|-
| 102 || [[#PushExtraStorage]] ||
|-
| 103 || [[#PushInteractiveInData]] ||
|-
| 104 || [[#PopInteractiveOutData]] ||
|-
| 105 || [[#GetPopOutDataEvent]] ||
|-
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
|-
| 110 || [[#NeedsToExitProcess]] ||
|-
| 120 || [[#GetLibraryAppletInfo]] ||
|-
| 150 || [[#RequestForAppletToGetForeground]] ||
|-
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
|}


Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.
This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.


==== SetOutOfFocusApplicationSuspendingEnabled ====
==== RequestExitApplicationAndTryPopMessage ====
Takes an input u8 bool, no output.
Takes an input [[#IStorage|IStorage]], no output.


Official sw will assert prior to using this if applet-service was not initialized as *Application.
[21.0.0+] Now additionally takes a total of 0x18-bytes of input.


==== PresetLibraryAppletGpuTimeSliceZero ====
==== IsLanguageSelectionLimited ====
No input/output.
No input, returns 1-byte of output.


sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.
On NX this just writes 0 to output and returns 0.


==== PushInData ====
==== StartContinuousRecordingFlushForDebug ====
Takes an input [[#IStorage]], no output.
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.


==== PopOutData ====
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.
No input, returns an output [[#IStorage]].


==== PushExtraStorage ====
==== CreateMovieMaker ====
Takes an input [[#IStorage]], no output.
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].


==== PushInteractiveInData ====
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
Takes an input [[#IStorage]], no output.


==== PopInteractiveOutData ====
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
No input, returns an output [[#IStorage]].


==== GetPopOutDataEvent ====
==== PrepareForJit ====
No input, returns an output handle with autoclear=false.
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.


==== GetPopInteractiveOutDataEvent ====
~IApplicationFunctions() includes:
No input, returns an output event handle with autoclear=false.


==== NeedsToExitProcess ====
    if (this->jit_process) {
No input, returns an output u8 bool.
        Terminate(this->jit_process);
        this->jit_process = nullptr;
    }


Stubbed, just returns an error.
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.


==== RequestForAppletToGetForeground ====
AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
No input/output.


Stubbed, just returns an error.
[S2] This is no longer usable since this returns Result 0x408 (sysmodule doesn't exist).


==== GetIndirectLayerConsumerHandle ====
=== IMovieWriter ===
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.
This is "nn::am::service::IMovieWriter".


Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
This was added with [19.0.0+].
 
== ICommonStateGetter ==
This is "nn::am::service::ICommonStateGetter".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,755: Line 1,990:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#GetEventHandle]]
| 0 ||  
|}
 
==== Cmd0 ====
No input. Returns a GRC [[GRC_services|IMovieWriter]].
 
=== IMovieMaker ===
This is "nn::am::service::IMovieMaker".
 
{| class="wikitable" border="1"
|-
|-
| 1 || [[#ReceiveMessage]]
! Cmd || Name
|-
|-
| 2 || [[#GetThisAppletKind]]
| 0 || [[#GetGrcMovieMaker]]
|-
|-
| 3 || [[#AllowToEnterSleep]]
| 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"
|-
|-
| 4 || [[#DisallowToEnterSleep]]
! Cmd || Name
|-
|-
| 5 || [[#GetOperationMode]]
| 0 || IsCpuOverclockEnabled
|-
|-
| 6 || [[#GetPerformanceMode]]
| 1 || SetCpuOverclockEnabled
|}
 
=== IGraphicsScalingParametersFunctions ===
This is "nn::am::service::IGraphicsScalingParametersFunctions".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 7 || [[#GetCradleStatus]]
! Cmd || Name
|-
|-
| 8 || [[#GetBootMode]]
| 10 || GetGraphicsScalingParameters
|-
|-
| 9 || [[#GetCurrentFocusState]]
| 1000 || SetSupportingGraphicsScalingParametersForDebug
|-
|-
| 10 || [[#RequestToAcquireSleepLock]]
| 1010 || SetGpuQuotaForDebug
|-
|-
| 11 || [[#ReleaseSleepLock]]
| 1020 || ClearGpuQuotaForDebug
|-
|-
| 12 || [[#ReleaseSleepLockTransiently]]
| 1030 || SetScreenRatioForDebug
|-
|-
| 13 || [[#GetAcquiredSleepLockEvent]]
| 1040 || ClearScreenRatioForDebug
|-
|-
| 14 || [11.0.0+] [[#GetWakeupCount]]
| 1050 || SetGraphicsScaleChangedNotificationEnabled
|}
 
== ILibraryAppletCreator ==
This is "nn::am::service::ILibraryAppletCreator".
 
{| class="wikitable" border="1"
|-
|-
| 15 || [19.0.0+]
! Cmd || Name || Notes
|-
|-
| 20 || [[#PushToGeneralChannel]]
| 0 || [[#CreateLibraryAppletOld|CreateLibraryAppletOld]] ([1.0.0-19.0.1] CreateLibraryApplet) ||
|-
|-
| 30 || [[#GetHomeButtonReaderLockAccessor]]
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
|-
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
|-
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
| 3 || [20.0.0+] [[#CreateLibraryApplet|CreateLibraryApplet]] ||
|-
|-
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
| 10 || [[#CreateStorage]] ||
|-
|-
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
| 11 || [[#CreateTransferMemoryStorage]] ||
|-
|-
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
|-
|}
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
 
|-
=== CreateLibraryAppletOld ===
| 53 || [7.0.0+] [[#BeginVrModeEx]]
Unofficial name.
|-
 
| 54 || [7.0.0+] [[#EndVrModeEx]]
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
 
=== TerminateAllLibraryApplets ===
No input/output.
 
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
 
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
 
=== AreAnyLibraryAppletsLeft ===
No input, returns an output u8 bool.
 
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
 
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).
 
=== CreateLibraryApplet ===
Unofficial name.
 
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], an u64 ThreadId, returns an [[#ILibraryAppletAccessor]].
 
The ThreadId is from the current-thread of the user-process which is using the cmd.
 
=== CreateStorage ===
Takes an input s64 for the storage size, returns an [[#IStorage]].
 
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
 
=== CreateTransferMemoryStorage ===
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].
 
The user-process creates the TransferMemory with permissions=0.
 
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.
 
=== CreateHandleStorage ===
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).
 
=== ILibraryAppletAccessor ===
This is "nn::am::service::ILibraryAppletAccessor".
 
{| class="wikitable" border="1"
|-
|-
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
! Cmd || Name || Notes
|-
|-
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
| 0 || [[#GetAppletStateChangedEvent]] ||
|-
|-
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
| 1 || [[#IsCompleted]] ||
|-
|-
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
| 10 || [[#Start]] ||
|-
|-
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
| 20 || [[#RequestExit]] ||
|-
|-
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
| 25 || [[#Terminate]] ||
|-
|-
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
| 30 || [[#GetResult]] ||
|-
|-
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
|-
|-
| 66 || [6.0.0+] [[#SetCpuBoostMode]]
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
|-
|-
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]
| 70 || [S2] ||
|-
|-
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]
| 80 || [19.0.0+] RequestForLibraryAppletToGetForeground ||
|-
|-
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]
| 81 || [19.0.0+] GetCurrentChildLibraryApplet ||
|-
|-
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]
| 90 || [20.0.0+] ||
|-
|-
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
| 100 || [[#PushInData]] ||
|-
|-
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
| 101 || [[#PopOutData]] ||
|-
|-
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]
| 102 || [[#PushExtraStorage]] ||
|-
|-
| 120 || [13.0.0+] GetAppletLaunchedHistory
| 103 || [[#PushInteractiveInData]] ||
|-
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
| 104 || [[#PopInteractiveOutData]] ||
|-
|-
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]
| 105 || [[#GetPopOutDataEvent]] ||
|-
|-
| 400 || [10.0.0+] [[#ActivateMigrationService]]
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
|-
|-
| 401 || [10.0.0+] [[#DeactivateMigrationService]]
| 110 || [[#NeedsToExitProcess]] ||
|-
|-
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]
| 120 || [[#GetLibraryAppletInfo]] ||
|-
|-
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]
| 150 || [[#RequestForAppletToGetForeground]] ||
|-
|-
| 502 || [12.0.0+] IsSleepEnabled
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
|-
|-
| 503 || [12.0.0+] IsDisablingSleepSuppressed
| 170 || [22.0.0+]
|-
| 600 || [20.0.0+] ([17.0.0-18.1.0] OpenNamedChannelAsChild)
|-
| 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
|}
|}


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]]).
Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.


[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.
==== SetOutOfFocusApplicationSuspendingEnabled ====
Takes an input u8 bool, no output.


=== GetEventHandle ===
Official sw will assert prior to using this if applet-service was not initialized as *Application.
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].


=== ReceiveMessage ===
==== PresetLibraryAppletGpuTimeSliceZero ====
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.
No input/output.


=== GetThisAppletKind ===
sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.
No input, returns an output [[#AppletKind]].


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


=== AllowToEnterSleep ===
==== PopOutData ====
No input/output.
No input, returns an output [[#IStorage]].


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


=== DisallowToEnterSleep ===
==== PushInteractiveInData ====
No input/output.
Takes an input [[#IStorage]], no output.


Stubbed, just returns an error.
==== PopInteractiveOutData ====
No input, returns an output [[#IStorage]].


=== GetOperationMode ===
==== GetPopOutDataEvent ====
No input. Returns an output u8 for the current [[#OperationMode]].
No input, returns an output handle with autoclear=false.


=== GetPerformanceMode ===
==== GetPopInteractiveOutDataEvent ====
No input. Returns an output u32 for the current [[#PerformanceMode]].
No input, returns an output event handle with autoclear=false.


=== GetCradleStatus ===
==== NeedsToExitProcess ====
No input, returns an output u8.
No input, returns an output u8 bool.


This uses [[#omm]] GetCradleStatus.
Stubbed, just returns an error.


=== GetBootMode ===
==== RequestForAppletToGetForeground ====
No input, returns an output u8.
No input/output.


Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
Stubbed, just returns an error.


=== GetCurrentFocusState ===
==== GetIndirectLayerConsumerHandle ====
No input. Returns an output u8 [[#FocusState]].
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.


=== RequestToAcquireSleepLock ===
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
No input/output.


=== ReleaseSleepLock ===
== ICommonStateGetter ==
No input/output.
This is "nn::am::service::ICommonStateGetter".


=== ReleaseSleepLockTransiently ===
{| class="wikitable" border="1"
No input/output.
|-
 
! Cmd || Name
=== GetAcquiredSleepLockEvent ===
|-
No input, returns an output Event handle with autoclear=false.
| 0 || [[#GetEventHandle]]
 
|-
=== GetWakeupCount ===
| 1 || [[#ReceiveMessage]]
No input, returns an output u64.
|-
 
| 2 || [[#GetThisAppletKind]]
=== PushToGeneralChannel ===
|-
Takes an input [[#IStorage]], no output.
| 3 || [[#AllowToEnterSleep]]
 
|-
This is not usable under an Application, however it is usable under a LibraryApplet.
| 4 || [[#DisallowToEnterSleep]]
 
|-
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:
| 5 || [[#GetOperationMode]]
* <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.
| 6 || [[#GetPerformanceMode]]
 
|-
=== GetHomeButtonReaderLockAccessor ===
| 7 || [[#GetCradleStatus]]
No input, returns an output [[#ILockAccessor]].
|-
 
| 8 || [[#GetBootMode]]
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
|-
 
| 9 || [[#GetCurrentFocusState]]
=== GetReaderLockAccessorEx ===
|-
Takes an input u32, returns an output [[#ILockAccessor]].
| 10 || [[#RequestToAcquireSleepLock]]
 
|-
The input value must be 0-3. 0 = HomeButton.
| 11 || [[#ReleaseSleepLock]]
 
|-
=== GetWriterLockAccessorEx ===
| 12 || [[#ReleaseSleepLockTransiently]]
Takes an input u32, returns an output [[#ILockAccessor]].
|-
 
| 13 || [[#GetAcquiredSleepLockEvent]]
The input value must be 0-3. 0 = HomeButton.
|-
 
| 14 || [11.0.0+] [[#GetWakeupCount]]
=== GetCradleFwVersion ===
|-
No input, returns 4 output u32s.
| 15 || [19.0.0+]
 
|-
This uses [[#omm]] GetCradleFwVersion.
| 20 || [[#PushToGeneralChannel]]
 
|-
=== IsVrModeEnabled ===
| 30 || [[#GetHomeButtonReaderLockAccessor]]
No input, returns an output u8 bool.
|-
 
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
=== SetVrModeEnabled ===
|-
Takes an input u8 bool flag. No output.
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
 
|-
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}.
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
 
|-
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.
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
 
|-
=== SetLcdBacklighOffEnabled ===
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
Takes an input u8 bool, no output.
|-
 
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
Sets whether the LCD screen blacklight is turned off.
|-
 
| 53 || [7.0.0+] [[#BeginVrModeEx]]
=== BeginVrModeEx ===
|-
No input/output.
| 54 || [7.0.0+] [[#EndVrModeEx]]
 
|-
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
 
|-
=== EndVrModeEx ===
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
No input/output.
|-
 
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
|-
 
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
=== IsInControllerFirmwareUpdateSection ===
|-
No input, returns an output u8 bool.
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
 
|-
=== SetVrPositionForDebug ===
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
Takes 4 input s32s, no output.
|-
 
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
The s32s are: x, y, width, height.
|-
 
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
|-
 
| 66 || [6.0.0+] [[#SetCpuBoostMode]]
width must be 1-1280, height must be 1-720.
|-
 
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]
x and y must not be negative. x+width must be <=1280. y+height must be <=720.
|-
 
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]
=== GetDefaultDisplayResolution ===
|-
No input, returns two output s32s '''width''' and '''height'''.
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]
 
|-
=== GetDefaultDisplayResolutionChangeEvent ===
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]
No input, returns an output Event handle with autoclear=true.
|-
 
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
=== GetHdcpAuthenticationState ===
|-
No input, returns an output s32.
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
 
|-
=== GetHdcpAuthenticationStateChangeEvent ===
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]
No input, returns an output Event handle with autoclear=true.
|-
| 120 || [13.0.0+] GetAppletLaunchedHistory
|-
| 130 || [21.0.0+] EnableStartupLogoDisappearedMessage
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
|-
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]
|-
| 400 || [10.0.0+] [[#ActivateMigrationService]]
|-
| 401 || [10.0.0+] [[#DeactivateMigrationService]]
|-
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]
|-
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]
|-
| 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
|}


=== SetTvPowerStateMatchingMode ===
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]]).
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.
 
[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.
 
=== GetEventHandle ===
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].


=== GetApplicationIdByContentActionName ===
=== ReceiveMessage ===
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.


Gets the ApplicationId for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (when the current applet isn't a SystemApplication).
=== GetThisAppletKind ===
No input, returns an output [[#AppletKind]].


=== SetCpuBoostMode ===
Stubbed, just returns an error.
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].


=== CancelCpuBoostMode ===
=== AllowToEnterSleep ===
No input/output.
No input/output.


=== GetBuiltInDisplayType ===
Stubbed, just returns an error.
No input, returns an output s32.


This is not exposed by sdknso.
=== DisallowToEnterSleep ===
No input/output.


This loads a s32 index from global state (originates from [[SPL_services#GetConfig|GetConfig]] [[SMC#HardwareType|HardwareType]]), Aborts if it's out-of-bounds, then the following is returned for the output s32: global_array[loaded_index].
Stubbed, just returns an error.


=== PerformSystemButtonPressingIfInFocus ===
=== GetOperationMode ===
Takes an input [[#SystemButtonType]], no output.
No input. Returns an output u8 for the current [[#OperationMode]].


Just returns 0 when a state field is not value 1. Verifies that the input button is allowed, then calls the same func as [[#PerformSystemButtonPressing]] internally.
=== GetPerformanceMode ===
No input. Returns an output u32 for the current [[#PerformanceMode]].


=== SetPerformanceConfigurationChangedNotification ===
=== GetCradleStatus ===
Takes an input u8 bool, no output.
No input, returns an output u8.


=== GetCurrentPerformanceConfiguration ===
This uses [[#omm]] GetCradleStatus.
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].


=== OpenMyGpuErrorHandler ===
=== GetBootMode ===
No input, returns an [[#IGpuErrorHandler]].
No input, returns an output u8.


The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.


=== GetOperationModeSystemInfo ===
=== GetCurrentFocusState ===
No input, returns an output u32.
No input. Returns an output u8 [[#FocusState]].


This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].
=== RequestToAcquireSleepLock ===
 
=== GetSettingsPlatformRegion ===
No input, returns an output u8.
 
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].
 
=== ActivateMigrationService ===
No input/output.
No input/output.


Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].
=== ReleaseSleepLock ===
 
=== DeactivateMigrationService ===
No input/output.
No input/output.


=== DisableSleepTillShutdown ===
=== ReleaseSleepLockTransiently ===
No input/output.
No input/output.


=== SuppressDisablingSleepTemporarily ===
=== GetAcquiredSleepLockEvent ===
Takes an input u64 "nn::TimeSpanType", no output.
No input, returns an output Event handle with autoclear=false.


=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===
=== GetWakeupCount ===
No input/output.
No input, returns an output u64.


=== IGpuErrorHandler ===
=== PushToGeneralChannel ===
This is "nn::am::service::IGpuErrorHandler".
Takes an input [[#IStorage]], no output.


This was added with [11.0.0+].
This is not usable under an Application, however it is usable under a LibraryApplet.


This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.
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:
 
* <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.
{| class="wikitable" border="1"
* <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.
|-
 
! Cmd || Name
=== GetHomeButtonReaderLockAccessor ===
|-
No input, returns an output [[#ILockAccessor]].
| 100 || [[#GetManualGpuErrorInfoSize]]
|-
| 101 || [[#GetManualGpuErrorInfo]]
|-
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]
|-
| 103 || [[#FinishManualGpuErrorHandling]]
|}


==== GetManualGpuErrorInfoSize ====
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
No input, returns an output u64.


==== GetManualGpuErrorInfo ====
=== GetReaderLockAccessorEx ===
Takes a type-0x6 output buffer, returns an output u64.
Takes an input u32, returns an output [[#ILockAccessor]].


The OutBuffer_size must be >= the output size from [[#GetManualGpuErrorInfoSize]].
The input value must be 0-3. 0 = HomeButton.


sdknso exposes the buffer as <code>void*</code>.
=== GetWriterLockAccessorEx ===
Takes an input u32, returns an output [[#ILockAccessor]].


==== GetManualGpuErrorDetectionSystemEvent ====
The input value must be 0-3. 0 = HomeButton.
No input, returns an output Event handle with EventClearMode=0.


==== FinishManualGpuErrorHandling ====
=== GetCradleFwVersion ===
No input/output.
No input, returns 4 output u32s.


== ISelfController ==
This uses [[#omm]] GetCradleFwVersion.
This is "nn::am::service::ISelfController".


{| class="wikitable" border="1"
=== IsVrModeEnabled ===
|-
No input, returns an output u8 bool.
! Cmd || Name
 
|-
=== SetVrModeEnabled ===
| 0 || [[#Exit]]
Takes an input u8 bool flag. No output.
|-
 
| 1 || [[#LockExit]]
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}.
|-
 
| 2 || [[#UnlockExit]]
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.
|-
 
| 3 || [2.0.0+] [[#EnterFatalSection]]
=== SetLcdBacklighOffEnabled ===
|-
Takes an input u8 bool, no output.
| 4 || [2.0.0+] [[#LeaveFatalSection]]
 
|-
Sets whether the LCD screen blacklight is turned off.
| 9 || [[#GetLibraryAppletLaunchableEvent]]
 
|-
=== BeginVrModeEx ===
| 10 || [[#SetScreenShotPermission]]
No input/output.
|-
 
| 11 || [[#SetOperationModeChangedNotification]]
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
|-
 
| 12 || [[#SetPerformanceModeChangedNotification]]
=== EndVrModeEx ===
|-
No input/output.
| 13 || [[#SetFocusHandlingMode]]
 
|-
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
| 14 || [[#SetRestartMessageEnabled]]
 
|-
=== IsInControllerFirmwareUpdateSection ===
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
No input, returns an output u8 bool.
|-
 
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
=== SetVrPositionForDebug ===
|-
Takes 4 input s32s, no output.
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
 
|-
The s32s are: x, y, width, height.
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
 
|-
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
 
|-
width must be 1-1280, height must be 1-720.
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
 
|-
x and y must not be negative. x+width must be <=1280. y+height must be <=720.
| 21 || [13.0.0+] GetScreenShotProgramId
 
|-
=== GetDefaultDisplayResolution ===
| 22 || [19.0.0+] GetScreenShotAcdIndex
No input, returns two output s32s '''width''' and '''height'''.
|-
 
| 23 || [19.0.0+] GetScreenShotApparentPlatform
=== GetDefaultDisplayResolutionChangeEvent ===
|-
No input, returns an output Event handle with autoclear=true.
| 24 || [19.0.0+] GetScreenShotApplicationProperty
 
|-
=== GetHdcpAuthenticationState ===
| 40 || [[#CreateManagedDisplayLayer]]
No input, returns an output s32.
|-
 
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
=== GetHdcpAuthenticationStateChangeEvent ===
|-
No input, returns an output Event handle with autoclear=true.
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
 
|-
=== SetTvPowerStateMatchingMode ===
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.
|-
 
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
=== GetApplicationIdByContentActionName ===
|-
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
 
|-
Gets the ApplicationId for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (when the current applet isn't a SystemApplication).
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]
 
|-
=== SetCpuBoostMode ===
| 50 || [[#SetHandlesRequestToDisplay]]
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
|-
 
| 51 || [[#ApproveToDisplay]]
=== CancelCpuBoostMode ===
|-
No input/output.
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
 
|-
=== GetBuiltInDisplayType ===
| 61 || [[#SetMediaPlaybackState]]
No input, returns an output s32.
|-
 
| 62 || [[#SetIdleTimeDetectionExtension]]
This is not exposed by sdknso.
|-
 
| 63 || [[#GetIdleTimeDetectionExtension]]
This loads a s32 index from global state (originates from [[SPL_services#GetConfig|GetConfig]] [[SMC#HardwareType|HardwareType]]), Aborts if it's out-of-bounds, then the following is returned for the output s32: global_array[loaded_index].
|-
 
| 64 || [[#SetInputDetectionSourceSet]]
=== PerformSystemButtonPressingIfInFocus ===
|-
Takes an input [[#SystemButtonType]], no output.
| 65 || [2.0.0+] [[#ReportUserIsActive]]
 
|-
Just returns 0 when a state field is not value 1. Verifies that the input button is allowed, then calls the same func as [[#PerformSystemButtonPressing]] internally.
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
 
|-
=== SetPerformanceConfigurationChangedNotification ===
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
Takes an input u8 bool, no output.
|-
 
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
=== GetCurrentPerformanceConfiguration ===
|-
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
 
|-
=== OpenMyGpuErrorHandler ===
| 70 || [4.0.0+] [[#ReportMultimediaError]]
No input, returns an [[#IGpuErrorHandler]].
|-
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
|-
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
|-
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
|-
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
|-
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
|-
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
|-
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
|-
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]
|-
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
|-
| 200 || [20.0.0+]
|-
| 210 || [20.0.0+]
|-
| 211 || [20.0.0+]
|-
| 220 || [20.0.0+]
|-
| 221 || [20.0.0+]
|-
| 230 || [20.0.0+]
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
| 2000 || [S2] [[#GetGraphicsInterface]]
|-
| 2100 || [S2]
|}


=== Exit ===
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
No input/output.


Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
=== GetOperationModeSystemInfo ===
No input, returns an output u32.


=== LockExit ===
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].
No input/output.
 
=== GetSettingsPlatformRegion ===
No input, returns an output u8.


Locks exit process of pressing X to close in HOME Menu for an application or HOME button for an applet. When locked, it will show the "waiting for software to be closed dialog" until UnlockExit is called or a 15 seconds timeout (when the latter occurs, the process is force-terminated).
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].


=== UnlockExit ===
=== ActivateMigrationService ===
No input/output.
No input/output.


Unlocks exit process, if LockExit was previously used.
Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].


=== EnterFatalSection ===
=== DeactivateMigrationService ===
No input/output.
No input/output.


=== LeaveFatalSection ===
=== DisableSleepTillShutdown ===
No input/output.
No input/output.


[[#EnterFatalSection]] must be executed at least once before executing this command, otherwise error code 0x40080 will be returned. EnterFatalSection and LeaveFatalSection work in pairs, that is, N calls to EnterFatalSection must be performed first in order to perform N executions of LeaveFatalSection. Essentially, these two functions operate like how one would lock and unlock a recursive mutex.
=== SuppressDisablingSleepTemporarily ===
Takes an input u64 "nn::TimeSpanType", no output.
 
=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===
No input/output.


=== GetLibraryAppletLaunchableEvent ===
=== IGpuErrorHandler ===
No input, returns an output event handle with autoclear=false.
This is "nn::am::service::IGpuErrorHandler".


=== SetScreenShotPermission ===
This was added with [11.0.0+].
Takes an input s32. No output.


Controls whether screenshot-capture is allowed.
This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value || Description
! Cmd || Name
|-
|-
| 0 || Inherit from parent applet
| 100 || [[#GetManualGpuErrorInfoSize]]
|-
|-
| 1 || Enable
| 101 || [[#GetManualGpuErrorInfo]]
|-
|-
| 2 || Disable
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]
|-
|-
| 103 || [[#FinishManualGpuErrorHandling]]
|}
|}


=== SetOperationModeChangedNotification ===
==== GetManualGpuErrorInfoSize ====
Takes an input u8 bool flag. No output.
No input, returns an output u64.


=== SetPerformanceModeChangedNotification ===
==== GetManualGpuErrorInfo ====
Takes an input u8 bool flag. No output.
Takes a type-0x6 output buffer, returns an output u64.


=== SetFocusHandlingMode ===
The OutBuffer_size must be >= the output size from [[#GetManualGpuErrorInfoSize]].
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.


=== SetRestartMessageEnabled ===
sdknso exposes the buffer as <code>void*</code>.
Takes an input u8 bool flag, no output.


See [[#AppletMessage]].
==== GetManualGpuErrorDetectionSystemEvent ====
No input, returns an output Event handle with EventClearMode=0.


=== SetScreenShotAppletIdentityInfo ===
==== FinishManualGpuErrorHandling ====
Takes an input [[#AppletIdentityInfo]], no output.
No input/output.


=== SetOutOfFocusSuspendingEnabled ===
== ISelfController ==
Takes an input u8 bool flag. No output.
This is "nn::am::service::ISelfController".


=== SetControllerFirmwareUpdateSection ===
{| class="wikitable" border="1"
Takes an input u8 bool flag, no output.
|-
 
! Cmd || Name
This throws error 0x40280 when the internal state flag already matches the input value.
|-
 
| 0 || [[#Exit]]
=== SetRequiresCaptureButtonShortPressedMessage ===
|-
Takes an input u8 bool flag, no output.
| 1 || [[#LockExit]]
 
|-
See [[#AppletMessage]].
| 2 || [[#UnlockExit]]
 
|-
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
| 3 || [2.0.0+] [[#EnterFatalSection]]
 
|-
=== SetAlbumImageOrientation ===
| 4 || [2.0.0+] [[#LeaveFatalSection]]
Takes an input u32 "nn::album::ImageOrientation". No output.
|-
 
| 9 || [[#GetLibraryAppletLaunchableEvent]]
The input value must not be >3.
|-
 
| 10 || [[#SetScreenShotPermission]]
=== SetDesirableKeyboardLayout ===
|-
Takes an input u32, no output.
| 11 || [[#SetOperationModeChangedNotification]]
 
|-
The input u32 is "nn::settings::KeyboardLayout".
| 12 || [[#SetPerformanceModeChangedNotification]]
 
|-
=== CreateManagedDisplayLayer ===
| 13 || [[#SetFocusHandlingMode]]
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].
|-
 
| 14 || [[#SetRestartMessageEnabled]]
=== IsSystemBufferSharingEnabled ===
|-
No input/output.
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
 
|-
Not available when the current applet is an Application ([[#AppletId]] == 0x01).
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
 
|-
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
 
|-
=== GetSystemSharedLayerHandle ===
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".
|-
 
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
|-
 
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
=== GetSystemSharedBufferHandle ===
|-
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".
| 21 || [13.0.0+] GetScreenShotProgramId
 
|-
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
| 22 || [19.0.0+] GetScreenShotAcdIndex
 
|-
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
| 23 || [19.0.0+] GetScreenShotApparentPlatform
 
|-
=== CreateManagedDisplaySeparableLayer ===
| 24 || [19.0.0+] GetScreenShotApplicationProperty
No input, returns two output u64 LayerIds.
|-
 
| 40 || [[#CreateManagedDisplayLayer]]
sdknso now uses this instead of [[#CreateManagedDisplayLayer]]. sdknso caches the output from the cmd so that it's only used once. The first u64 is used the same as the original LayerId from [[#CreateManagedDisplayLayer]]. <code>nn::vi::CreateRecordingLayer</code> uses the second LayerId, the layer creation is identical besides which LayerId is used.
|-
 
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
=== SetManagedDisplayLayerSeparationMode ===
|-
Takes an input u32, no output.
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
 
|-
sdknso exposes this as <code>nn::vi::SetRecordingLayerEnabled(bool)</code>.
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
 
|-
The input u32 must be 0-1.
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
 
|-
=== SetRecordingLayerCompositionEnabled ===
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
Takes an input bool, no output.
|-
 
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]
=== SetHandlesRequestToDisplay ===
|-
Takes an input u8 bool, no output.
| 50 || [[#SetHandlesRequestToDisplay]]
 
|-
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
| 51 || [[#ApproveToDisplay]]
 
|-
See [[#AppletMessage]].
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
 
|-
=== ApproveToDisplay ===
| 61 || [[#SetMediaPlaybackState]]
No input/output.
|-
 
| 62 || [[#SetIdleTimeDetectionExtension]]
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
|-
 
| 63 || [[#GetIdleTimeDetectionExtension]]
=== OverrideAutoSleepTimeAndDimmingTime ===
|-
Takes 4 input s32s, no output.
| 64 || [[#SetInputDetectionSourceSet]]
 
|-
=== SetMediaPlaybackState ===
| 65 || [2.0.0+] [[#ReportUserIsActive]]
Takes an input u8 bool, no output.
|-
 
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
=== SetIdleTimeDetectionExtension ===
|-
Takes an input u32, no output.
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
 
|-
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
 
|-
=== GetIdleTimeDetectionExtension ===
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
No input, returns an output u32.
|-
 
| 70 || [4.0.0+] [[#ReportMultimediaError]]
Returns the value set by [[#SetIdleTimeDetectionExtension]].
|-
 
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
=== SetInputDetectionSourceSet ===
|-
Takes an input u32, no output.
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
 
|-
=== ReportUserIsActive ===
| 73 || [21.0.0+]
No input/output.
|-
 
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
Uses idle:sys ReportUserIsActive.
|-
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
|-
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
|-
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
|-
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
|-
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]
|-
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
|-
| 200 || [20.0.0+]
|-
| 210 || [20.0.0+]
|-
| 211 || [20.0.0+]
|-
| 220 || [20.0.0+]
|-
| 221 || [20.0.0+]
|-
| 230 || [20.0.0+]
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
| 2000 || [S2] [[#GetGraphicsSupervisor]]
|-
| 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+]
|}


Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.
=== Exit ===
No input/output.


=== GetCurrentIlluminance ===
Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
No input, returns an output float.


Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
=== LockExit ===
No input/output.


=== IsIlluminanceAvailable ===
Locks exit process of pressing X to close in HOME Menu for an application or HOME button for an applet. When locked, it will show the "waiting for software to be closed dialog" until UnlockExit is called or a 15 seconds timeout (when the latter occurs, the process is force-terminated).
No input, returns an output u8 bool.


Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
=== UnlockExit ===
No input/output.


User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).
Unlocks exit process, if LockExit was previously used.


=== SetAutoSleepDisabled ===
=== EnterFatalSection ===
Takes an input u8 bool, no output.
No input/output.


=== IsAutoSleepDisabled ===
=== LeaveFatalSection ===
No input, returns an output u8 bool.
No input/output.


=== ReportMultimediaError ===
[[#EnterFatalSection]] must be executed at least once before executing this command, otherwise error code 0x40080 will be returned. EnterFatalSection and LeaveFatalSection work in pairs, that is, N calls to EnterFatalSection must be performed first in order to perform N executions of LeaveFatalSection. Essentially, these two functions operate like how one would lock and unlock a recursive mutex.
Takes an input Result and a type-0x5 input buffer, no output.


The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.
=== GetLibraryAppletLaunchableEvent ===
No input, returns an output event handle with autoclear=false.


=== GetCurrentIlluminanceEx ===
=== SetScreenShotPermission ===
No input, returns an output u8 bool and float.
Takes an input s32. No output.


Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
Controls whether screenshot-capture is allowed.


=== SetInputDetectionPolicy ===
{| class="wikitable" border="1"
Takes an input [[#InputDetectionPolicy]], no output.
|-
! Value || Description
|-
| 0 || Inherit from parent applet
|-
| 1 || Enable
|-
| 2 || Disable
|-
|}


=== SetWirelessPriorityMode ===
=== SetOperationModeChangedNotification ===
Takes an input s32 [[#WirelessPriorityMode]], no output.
Takes an input u8 bool flag. No output.


=== GetAccumulatedSuspendedTickValue ===
=== SetPerformanceModeChangedNotification ===
No input, returns an output u64 tick value.
Takes an input u8 bool flag. No output.


Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
=== SetFocusHandlingMode ===
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.


=== GetAccumulatedSuspendedTickChangedEvent ===
=== SetRestartMessageEnabled ===
No input, returns an output Event handle with autoclear=true.
Takes an input u8 bool flag, no output.


This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
See [[#AppletMessage]].


=== SetAlbumImageTakenNotificationEnabled ===
=== SetScreenShotAppletIdentityInfo ===
Takes an input u8 bool, no output.
Takes an input [[#AppletIdentityInfo]], no output.


See [[#AppletMessage]].
=== SetOutOfFocusSuspendingEnabled ===
Takes an input u8 bool flag. No output.


=== SetApplicationAlbumUserData ===
=== SetControllerFirmwareUpdateSection ===
Takes a type-0x21 input buffer, no output.
Takes an input u8 bool flag, no output.


The buffer contains arbitrary UserData.
This throws error 0x40280 when the internal state flag already matches the input value.


The size must be <=0x400. The input buffer is copied to a buffer loaded from a state ptr (throwing an error when the state ptr is not set), with the u32 size being written to statebuf+0x400 afterwards.
=== SetRequiresCaptureButtonShortPressedMessage ===
Takes an input u8 bool flag, no output.


=== SaveCurrentScreenshot ===
See [[#AppletMessage]].
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.


sdknso exposes this under "nn::album::".
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.


=== SetRecordVolumeMuted ===
=== SetAlbumImageOrientation ===
Takes an input bool, no output.
Takes an input u32 "nn::album::ImageOrientation". No output.


=== GetDebugStorageChannel ===
The input value must not be >3.
No input, returns an output [[#IStorageChannel]].


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.
=== SetDesirableKeyboardLayout ===
Takes an input u32, no output.
 
The input u32 is "nn::settings::KeyboardLayout".
 
=== CreateManagedDisplayLayer ===
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].


=== GetGraphicsInterface ===
=== IsSystemBufferSharingEnabled ===
Unofficial name. This is exclusive to S2.
No input/output.


No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]].
Not available when the current applet is an Application ([[#AppletId]] == 0x01).


== IStorageChannel ==
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
This is "nn::am::service::IStorageChannel".


This was added with [7.0.0+].
=== GetSystemSharedLayerHandle ===
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".


{| class="wikitable" border="1"
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
|-
! Cmd || Name || Notes
|-
| 0 || Push || No input, returns an output [[#IStorage]].
|-
| 1 || Unpop || No input, returns an output [[#IStorage]].
|-
| 2 || Pop || No input, returns an output [[#IStorage]].
|-
| 3 || GetPopEventHandle || No input, returns an output handle.
|-
| 4 || Clear || No input/output.
|}


== IWindowController ==
=== GetSystemSharedBufferHandle ===
This is "nn::am::service::IWindowController".
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".


{| class="wikitable" border="1"
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
|-
! Cmd || Name || Notes
|-
| 0 || [[#CreateWindow]] ||
|-
| 1 || [[#GetAppletResourceUserId]] ||
|-
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
|-
| 10 || [[#AcquireForegroundRights]] ||
|-
| 11 || [[#ReleaseForegroundRights]] ||
|-
| 12 || [[#RejectToChangeIntoBackground]] ||
|-
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||
|-
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||
|}


=== CreateWindow ===
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
Takes an input u32, returns an output [[#IWindow]].


Stubbed, just returns an error.
=== CreateManagedDisplaySeparableLayer ===
No input, returns two output u64 LayerIds.


=== GetAppletResourceUserId ===
sdknso now uses this instead of [[#CreateManagedDisplayLayer]]. sdknso caches the output from the cmd so that it's only used once. The first u64 is used the same as the original LayerId from [[#CreateManagedDisplayLayer]]. <code>nn::vi::CreateRecordingLayer</code> uses the second LayerId, the layer creation is identical besides which LayerId is used.
No input, returns an output u64 [[#AppletResourceUserId]].


=== GetAppletResourceUserIdOfCallerApplet ===
=== SetManagedDisplayLayerSeparationMode ===
No input, returns an output u64 [[#AppletResourceUserId]].
Takes an input u32, no output.


=== AcquireForegroundRights ===
sdknso exposes this as <code>nn::vi::SetRecordingLayerEnabled(bool)</code>.
No input/output.


Just returns 0.
The input u32 must be 0-1.


=== ReleaseForegroundRights ===
=== SetRecordingLayerCompositionEnabled ===
No input/output.
Takes an input bool, no output.


Just returns 0.
=== SetHandlesRequestToDisplay ===
Takes an input u8 bool, no output.


=== RejectToChangeIntoBackground ===
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
 
See [[#AppletMessage]].
 
=== ApproveToDisplay ===
No input/output.
No input/output.


Just returns 0.
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
 
=== OverrideAutoSleepTimeAndDimmingTime ===
Takes 4 input s32s, no output.


=== SetAppletWindowVisibility ===
=== SetMediaPlaybackState ===
Takes an input u8 bool, no output.
Takes an input u8 bool, no output.


=== SetAppletGpuTimeSlice ===
=== SetIdleTimeDetectionExtension ===
Takes an input s64, no output.
Takes an input u32, no output.


The input s64 must not be negative.
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.


== IAudioController ==
=== GetIdleTimeDetectionExtension ===
This is "nn::am::service::IAudioController".
No input, returns an output u32.


{| class="wikitable" border="1"
Returns the value set by [[#SetIdleTimeDetectionExtension]].
|-
! Cmd || Name
|-
| 0 || [[#SetExpectedMasterVolume]]
|-
| 1 || [[#GetMainAppletExpectedMasterVolume]]
|-
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
|-
| 3 || [[#ChangeMainAppletMasterVolume]]
|-
| 4 || [[#SetTransparentVolumeRate]]
|-
| 5 || [20.0.0+]
|}


GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.
=== SetInputDetectionSourceSet ===
Takes an input u32, no output.


=== SetExpectedMasterVolume ===
=== ReportUserIsActive ===
Takes two input floats, no output.
No input/output.
 
Uses idle:sys ReportUserIsActive.


Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.


=== GetMainAppletExpectedMasterVolume ===
=== GetCurrentIlluminance ===
No input, returns an output float.
No input, returns an output float.


=== GetLibraryAppletExpectedMasterVolume ===
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
No input, returns an output float.
 
=== IsIlluminanceAvailable ===
No input, returns an output u8 bool.
 
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
 
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).


=== ChangeMainAppletMasterVolume ===
=== SetAutoSleepDisabled ===
Takes an input float and an input u64, no output.
Takes an input u8 bool, no output.


=== SetTransparentVolumeRate ===
=== IsAutoSleepDisabled ===
Takes an input float, no output.
No input, returns an output u8 bool.


== IDisplayController ==
=== ReportMultimediaError ===
This is "nn::am::service::IDisplayController".
Takes an input Result and a type-0x5 input buffer, no output.


{| class="wikitable" border="1"
The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.
|-
 
! Cmd || Name
=== GetCurrentIlluminanceEx ===
|-
No input, returns an output u8 bool and float.
| 0 || [[#GetLastForegroundCaptureImage]]
 
|-
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
| 1 || [[#UpdateLastForegroundCaptureImage]]
 
|-
=== SetInputDetectionPolicy ===
| 2 || [[#GetLastApplicationCaptureImage]]
Takes an input [[#InputDetectionPolicy]], no output.
|-
 
| 3 || [[#GetCallerAppletCaptureImage]]
=== SetWirelessPriorityMode ===
|-
Takes an input s32 [[#WirelessPriorityMode]], no output.
| 4 || [[#UpdateCallerAppletCaptureImage]]
 
|-
=== GetAccumulatedSuspendedTickValue ===
| 5 || [[#GetLastForegroundCaptureImageEx]]
No input, returns an output u64 tick value.
|-
 
| 6 || [[#GetLastApplicationCaptureImageEx]]
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
|-
 
| 7 || [[#GetCallerAppletCaptureImageEx]]
=== GetAccumulatedSuspendedTickChangedEvent ===
|-
No input, returns an output Event handle with autoclear=true.
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
 
|-
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
|-
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
|-
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
|-
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
|-
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
|-
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
|-
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
|-
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
|-
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
|-
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
|-
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
|-
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
|-
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
|-
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
|-
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
|-
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
|-
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
|-
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
|-
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
|}


=== GetLastForegroundCaptureImage ===
=== SetAlbumImageTakenNotificationEnabled ===
Takes a type-0x6 output buffer.
Takes an input u8 bool, no output.


Stubbed, just returns an error.
See [[#AppletMessage]].


=== UpdateLastForegroundCaptureImage ===
=== SetApplicationAlbumUserData ===
No input/output.
Takes a type-0x21 input buffer, no output.


=== GetLastApplicationCaptureImage ===
The buffer contains arbitrary UserData.
Takes a type-0x6 output buffer.


Stubbed, just returns an error.
The size must be <=0x400. The input buffer is copied to a buffer loaded from a state ptr (throwing an error when the state ptr is not set), with the u32 size being written to statebuf+0x400 afterwards.


=== GetCallerAppletCaptureImage ===
=== SaveCurrentScreenshot ===
Takes a type-0x6 output buffer.
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.


Stubbed, just returns an error.
sdknso exposes this under "nn::album::".


=== UpdateCallerAppletCaptureImage ===
=== SetRecordVolumeMuted ===
No input/output.
Takes an input bool, no output.


Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.
=== GetDebugStorageChannel ===
No input, returns an output [[#IStorageChannel]].


=== GetLastForegroundCaptureImageEx ===
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.
Takes a type-0x6 output buffer, returns an output u8 bool.


The buffer size must match 0x384000.
=== GetGraphicsSupervisor ===
This is exclusive to S2.


=== GetLastApplicationCaptureImageEx ===
No input. Returns an output TIPC handle to [[Switch_2:_GSV_services|GraphicsSupervisor]].
Takes a type-0x6 output buffer, returns an output u8 bool.


The buffer size must match 0x384000.
== IStorageChannel ==
This is "nn::am::service::IStorageChannel".


Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.
This was added with [7.0.0+].


=== GetCallerAppletCaptureImageEx ===
{| class="wikitable" border="1"
Takes a type-0x6 output buffer, returns an output u8 bool.
|-
! Cmd || Name || Notes
|-
| 0 || Push || No input, returns an output [[#IStorage]].
|-
| 1 || Unpop || No input, returns an output [[#IStorage]].
|-
| 2 || Pop || No input, returns an output [[#IStorage]].
|-
| 3 || GetPopEventHandle || No input, returns an output handle.
|-
| 4 || Clear || No input/output.
|}


The buffer size must match 0x384000.
== IWindowController ==
This is "nn::am::service::IWindowController".


Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#CreateWindow]] ||
|-
| 1 || [[#GetAppletResourceUserId]] ||
|-
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
|-
| 10 || [[#AcquireForegroundRights]] ||
|-
| 11 || [[#ReleaseForegroundRights]] ||
|-
| 12 || [[#RejectToChangeIntoBackground]] ||
|-
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||
|-
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||
|}


=== TakeScreenShotOfOwnLayer ===
=== CreateWindow ===
Takes an input u8 bool and a s32, no output.
Takes an input u32, returns an output [[#IWindow]].


=== CopyBetweenCaptureBuffers ===
Stubbed, just returns an error.
Takes two input s32s, no output.


=== AcquireLastApplicationCaptureBuffer ===
=== GetAppletResourceUserId ===
No input, returns an output handle.
No input, returns an output u64 [[#AppletResourceUserId]].


Stubbed, just returns an error.
=== GetAppletResourceUserIdOfCallerApplet ===
No input, returns an output u64 [[#AppletResourceUserId]].


=== ReleaseLastApplicationCaptureBuffer ===
=== AcquireForegroundRights ===
No input/output.
No input/output.


Clears a state field if it's not already 0, returning an error otherwise. On newer sysvers: then a func is called which just returns 0, then this cmd returns 0.
Just returns 0.


=== AcquireLastForegroundCaptureBuffer ===
=== ReleaseForegroundRights ===
No input, returns an output handle.
 
Stubbed, just returns an error.
 
=== ReleaseLastForegroundCaptureBuffer ===
No input/output.
No input/output.


Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
Just returns 0.


=== AcquireCallerAppletCaptureBuffer ===
=== RejectToChangeIntoBackground ===
No input, returns an output handle.
 
Stubbed, just returns an error.
 
=== ReleaseCallerAppletCaptureBuffer ===
No input/output.
No input/output.


Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
Just returns 0.


=== AcquireLastApplicationCaptureBufferEx ===
=== SetAppletWindowVisibility ===
No input, returns an output TransferMemory handle and an output u8 bool.
Takes an input u8 bool, no output.


The state field used by [[#ReleaseLastApplicationCaptureBuffer]] must be 0. Calls a func which just returns an error (this is only the case on newer sysvers), hence this cmd will just return that error. If that func would have returned successfully, the state field would be set to 1 and the cmd would return 0.
=== SetAppletGpuTimeSlice ===
Takes an input s64, no output.


On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.
The input s64 must not be negative.


=== AcquireLastForegroundCaptureBufferEx ===
== IAudioController ==
No input, returns an output TransferMemory handle and an output u8 bool.
This is "nn::am::service::IAudioController".


Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.
{| class="wikitable" border="1"
 
|-
=== AcquireCallerAppletCaptureBufferEx ===
! Cmd || Name
No input, returns an output TransferMemory handle and an output u8 bool.
|-
| 0 || [[#SetExpectedMasterVolume]]
|-
| 1 || [[#GetMainAppletExpectedMasterVolume]]
|-
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
|-
| 3 || [[#ChangeMainAppletMasterVolume]]
|-
| 4 || [[#SetTransparentVolumeRate]]
|-
| 5 || [20.0.0+]
|}


Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.
GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.


=== ClearCaptureBuffer ===
=== SetExpectedMasterVolume ===
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.
Takes two input floats, no output.


Clear the input CaptureSharedBuffer with the specified RGBA8 color.
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].


=== ClearAppletTransitionBuffer ===
=== GetMainAppletExpectedMasterVolume ===
Takes an input u32, no output.
No input, returns an output float.


Clear the AppletTransitionBuffer with the specified RGBA8 color.
=== GetLibraryAppletExpectedMasterVolume ===
No input, returns an output float.


=== AcquireLastApplicationCaptureSharedBuffer ===
=== ChangeMainAppletMasterVolume ===
No input, returns an output u8 bool and an s32.
Takes an input float and an input u64, no output.


This loads data from state.
=== SetTransparentVolumeRate ===
Takes an input float, no output.


=== ReleaseLastApplicationCaptureSharedBuffer ===
== IDisplayController ==
No input/output.
This is "nn::am::service::IDisplayController".


Depending on whether a state field is 0, this just returns an error or returns 0.
{| class="wikitable" border="1"
 
|-
=== AcquireLastForegroundCaptureSharedBuffer ===
! Cmd || Name
No input, returns an output u8 bool and an s32.
|-
 
| 0 || [[#GetLastForegroundCaptureImage]]
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
|-
 
| 1 || [[#UpdateLastForegroundCaptureImage]]
=== ReleaseLastForegroundCaptureSharedBuffer ===
No input/output.
 
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
 
=== AcquireCallerAppletCaptureSharedBuffer ===
No input, returns an output u8 bool and an s32.
 
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
 
=== ReleaseCallerAppletCaptureSharedBuffer ===
No input/output.
 
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
 
=== TakeScreenShotOfOwnLayerEx ===
Takes two input u8 bools and a s32, no output.
 
Calls the same func internally as [[#TakeScreenShotOfOwnLayer]], except the last bool param is the last cmd param bool instead of hard-coded 0. This flag indicates whether the screenshot should be taken Immediately.
 
== ISystemAppletControllerForDebug ==
This is "nn::am::service::ISystemAppletControllerForDebug".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 2 || [[#GetLastApplicationCaptureImage]]
|-
|-
| 1 || RequestLaunchApplicationForDebug
| 3 || [[#GetCallerAppletCaptureImage]]
|-
|-
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]
| 4 || [[#UpdateCallerAppletCaptureImage]]
|-
|-
| 3 || [7.0.0+] [[#CreateStorageForDebug]]
| 5 || [[#GetLastForegroundCaptureImageEx]]
|-
|-
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]
| 6 || [[#GetLastApplicationCaptureImageEx]]
|}
|-
 
| 7 || [[#GetCallerAppletCaptureImageEx]]
=== GetDebugStorageChannel ===
|-
No input. Returns an output [[#IStorageChannel]].
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
 
|-
=== CreateStorageForDebug ===
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
Takes a total of 8-bytes of input. Returns an [[#IStorage]].
 
=== CreateCradleFirmwareUpdaterForDebug ===
No input. Returns an [[#ICradleFirmwareUpdater]].
 
== IProcessWindingController ==
This is "nn::am::service::IProcessWindingController".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
|-
|-
| 0 || [[#GetLaunchReason]] ||
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
|-
|-
| 11 || [[#OpenCallingLibraryApplet]] ||
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
|-
|-
| 21 || [[#PushContext]] ||
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
|-
|-
| 22 || [[#PopContext]] ||
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
|-
|-
| 23 || [[#CancelWindingReservation]] ||
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
|-
|-
| 30 || [[#WindAndDoReserved]] ||
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
|-
|-
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
|-
|-
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
|}
|-
 
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
=== GetLaunchReason ===
|-
No input, returns an output [[#AppletProcessLaunchReason]].
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
 
|-
Used by LibraryApplets.
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
|-
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
|-
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
|-
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
|-
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
|-
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
|-
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
|}


=== OpenCallingLibraryApplet ===
=== GetLastForegroundCaptureImage ===
No input, returns an output [[#ILibraryAppletAccessor]].
Takes a type-0x6 output buffer.


The objptr from state is cleared during this, an error is thrown if it's already 0.
Stubbed, just returns an error.


=== PushContext ===
=== UpdateLastForegroundCaptureImage ===
Takes an input [[#IStorage]], no output.
No input/output.


=== PopContext ===
=== GetLastApplicationCaptureImage ===
No input, returns an output [[#IStorage]].
Takes a type-0x6 output buffer.


=== CancelWindingReservation ===
Stubbed, just returns an error.
No input/output.


=== WindAndDoReserved ===
=== GetCallerAppletCaptureImage ===
No input/output.
Takes a type-0x6 output buffer.


=== ReserveToStartAndWaitAndUnwindThis ===
Stubbed, just returns an error.
Takes an input [[#ILibraryAppletAccessor]], no output.
 
=== UpdateCallerAppletCaptureImage ===
No input/output.
 
Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.
 
=== GetLastForegroundCaptureImageEx ===
Takes a type-0x6 output buffer, returns an output u8 bool.


=== ReserveToStartAndWait ===
The buffer size must match 0x384000.
Takes an input [[#ILibraryAppletAccessor]], no output.


== ISystemProcessCommonFunctions ==
=== GetLastApplicationCaptureImageEx ===
This is "nn::am::service::ISystemProcessCommonFunctions".
Takes a type-0x6 output buffer, returns an output u8 bool.


This was added with [19.0.0+].
The buffer size must match 0x384000.


{| class="wikitable" border="1"
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.
|-
! Cmd || Name
|-
| 0 ||
|}


=== Cmd0 ===
=== GetCallerAppletCaptureImageEx ===
No input. Returns an [[#IApplicationObserver]].
Takes a type-0x6 output buffer, returns an output u8 bool.


=== IApplicationObserver ===
The buffer size must match 0x384000.
This is "nn::am::service::IApplicationObserver".


This was added with [19.0.0+].
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.


{| class="wikitable" border="1"
=== TakeScreenShotOfOwnLayer ===
|-
Takes an input u8 bool and a s32, no output.
! Cmd || Name
 
|-
=== CopyBetweenCaptureBuffers ===
| 1 ||
Takes two input s32s, no output.
|-
 
| 2 ||
=== AcquireLastApplicationCaptureBuffer ===
|-
No input, returns an output handle.
| 10 ||
|-
| 20 ||
|-
| 30 ||
|}


== IAppletAlternativeFunctions ==
Stubbed, just returns an error.
This is "nn::am::service::IAppletAlternativeFunctions".


This was added with [20.0.0+].
=== ReleaseLastApplicationCaptureBuffer ===
No input/output.


{| class="wikitable" border="1"
Clears a state field if it's not already 0, returning an error otherwise. On newer sysvers: then a func is called which just returns 0, then this cmd returns 0.
|-
! Cmd || Name
|-
| 0 ||
|-
| 1 ||
|-
| 2 ||
|}


== IDebugFunctions ==
=== AcquireLastForegroundCaptureBuffer ===
This is "nn::am::service::IDebugFunctions".
No input, returns an output handle.


{| class="wikitable" border="1"
Stubbed, just returns an error.
|-
 
! Cmd || Name
=== ReleaseLastForegroundCaptureBuffer ===
|-
No input/output.
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
 
|-
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
 
|-
=== AcquireCallerAppletCaptureBuffer ===
| 10 || [[#PerformSystemButtonPressing]]
No input, returns an output handle.
|-
 
| 20 || [[#InvalidateTransitionLayer]]
Stubbed, just returns an error.
|-
 
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
=== ReleaseCallerAppletCaptureBuffer ===
|-
No input/output.
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
 
|-
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
 
|-
=== AcquireLastApplicationCaptureBufferEx ===
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
No input, returns an output TransferMemory handle and an output u8 bool.
|-
 
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
The state field used by [[#ReleaseLastApplicationCaptureBuffer]] must be 0. Calls a func which just returns an error (this is only the case on newer sysvers), hence this cmd will just return that error. If that func would have returned successfully, the state field would be set to 1 and the cmd would return 0.
|-
 
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.
|-
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
|-
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
|-
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
|-
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
|-
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
|-
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
|-
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
|-
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
|-
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]
|-
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
|-
| 140 || [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug
|-
| 200 || [15.0.0+] CreateFloatingLibraryAppletAccepterForDebug
|-
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
|-
| 410 || [18.0.0+] CreateGeneralStorageForDebug
|-
| 411 || [18.0.0+] ReadGeneralStorageForDebug
|-
| 412 || [18.0.0+] WriteGeneralStorageForDebug
|-
| 430 || [20.0.0+]
|-
| 431 || [20.0.0+]
|-
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
|-
| 910 || [20.0.0+]
|}


=== NotifyMessageToHomeMenuForDebug ===
=== AcquireLastForegroundCaptureBufferEx ===
Takes an input [[#AppletMessage]], no output.
No input, returns an output TransferMemory handle and an output u8 bool.


Stubbed, just returns an error.
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.


=== OpenMainApplication ===
=== AcquireCallerAppletCaptureBufferEx ===
No input, returns an output [[#IApplicationAccessor]].
No input, returns an output TransferMemory handle and an output u8 bool.
 
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.


Should not be used when no Application is running (svcBreak).
=== ClearCaptureBuffer ===
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.


=== PerformSystemButtonPressing ===
Clear the input CaptureSharedBuffer with the specified RGBA8 color.
Takes an input [[#SystemButtonType]], no output.


=== InvalidateTransitionLayer ===
=== ClearAppletTransitionBuffer ===
No input/output.
Takes an input u32, no output.


=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
Clear the AppletTransitionBuffer with the specified RGBA8 color.
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]]).
=== AcquireLastApplicationCaptureSharedBuffer ===
No input, returns an output u8 bool and an s32.


=== RequestLaunchApplicationByApplicationLaunchInfoForDebug ===
This loads data from state.
Takes a total of 0x58-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.


[19.0.0+] Takes a total of 0x88-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.
=== ReleaseLastApplicationCaptureSharedBuffer ===
No input/output.


=== GetAppletResourceUsageInfo ===
Depending on whether a state field is 0, this just returns an error or returns 0.
No input, returns an output [[#AppletResourceUsageInfo]].


=== SetCpuBoostModeForApplet ===
=== AcquireLastForegroundCaptureSharedBuffer ===
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
No input, returns an output u8 bool and an s32.


The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.


=== CancelCpuBoostModeForApplet ===
=== ReleaseLastForegroundCaptureSharedBuffer ===
No input/output.
No input/output.


=== PushToAppletBoundChannelForDebug ===
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
Takes an input [[#IStorage]] and a s32, no output.


The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
=== AcquireCallerAppletCaptureSharedBuffer ===
No input, returns an output u8 bool and an s32.


The s32 must match the value already stored in state when the state value is non-zero, otherwise an error is returned. When the state value is 0, the s32 is written into state. Then the input storage is pushed to the StorageChannel.
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.


=== TryPopFromAppletBoundChannelForDebug ===
=== ReleaseCallerAppletCaptureSharedBuffer ===
Takes an input s32, returns an output [[#IStorage]].
No input/output.


The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.


The s32 must not be 0 and must match the value previously saved by [[#PushToAppletBoundChannelForDebug]], otherwise errors are returned. Then the output storage is popped from the StorageChannel.
=== TakeScreenShotOfOwnLayerEx ===
Takes two input u8 bools and a s32, no output.


=== AlarmSettingNotificationEnableAppEventReserve ===
Calls the same func internally as [[#TakeScreenShotOfOwnLayer]], except the last bool param is the last cmd param bool instead of hard-coded 0. This flag indicates whether the screenshot should be taken Immediately.
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
== ISystemAppletControllerForDebug ==
This is "nn::am::service::ISystemAppletControllerForDebug".


=== AlarmSettingNotificationDisableAppEventReserve ===
{| class="wikitable" border="1"
No input/output.
|-
! Cmd || Name
|-
| 1 || RequestLaunchApplicationForDebug
|-
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
| 3 || [7.0.0+] [[#CreateStorageForDebug]]
|-
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]
|}


Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].
=== GetDebugStorageChannel ===
No input. Returns an output [[#IStorageChannel]].


=== AlarmSettingNotificationPushAppEventNotify ===
=== CreateStorageForDebug ===
Takes an input [[#IStorage]], no output.
Takes a total of 8-bytes of input. Returns an [[#IStorage]].


Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.
=== CreateCradleFirmwareUpdaterForDebug ===
No input. Returns an [[#ICradleFirmwareUpdater]].


=== FriendInvitationSetApplicationParameter ===
== IProcessWindingController ==
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
This is "nn::am::service::IProcessWindingController".


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
GetProcessWindingController throws an error when used from non-LibraryApplet (at least with Application).
 
=== FriendInvitationClearApplicationParameter ===
No input/output.
 
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].
 
=== FriendInvitationPushApplicationParameter ===
Takes an input [[#IStorage]], no output.
 
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
 
== IStorage ==
This is "nn::am::service::IStorage".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,076: Line 3,329:
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
| 0 || [[#GetLaunchReason]] ||
|-
| 11 || [[#OpenCallingLibraryApplet]] ||
|-
|-
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
| 21 || [[#PushContext]] ||  
|}
 
Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].
 
Only 1 *Accessor session can be open for each IStorage at a time.
 
== IStorageAccessor ==
This is "nn::am::service::IStorageAccessor".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 22 || [[#PopContext]] ||  
|-
|-
| 0 || GetSize || No input. Returns an s64.
| 23 || [[#CancelWindingReservation]] ||
|-
|-
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
| 30 || [[#WindAndDoReserved]] ||
|-
|-
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||  
|-
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
|}
|}


== ITransferStorageAccessor ==
=== GetLaunchReason ===
This is "nn::am::service::ITransferStorageAccessor".
No input, returns an output [[#AppletProcessLaunchReason]].


{| class="wikitable" border="1"
Used by LibraryApplets.
|-
! Cmd || Name || Notes
|-
| 0 || GetSize || No input. Returns an output s64.
|-
| 1 || GetHandle || No input. Returns an output s64 and handle.
|}


These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
=== OpenCallingLibraryApplet ===
No input, returns an output [[#ILibraryAppletAccessor]].


= appletOE =
The objptr from state is cleared during this, an error is thrown if it's already 0.
This is "nn::am::service::IApplicationProxyService".


{| class="wikitable" border="1"
=== PushContext ===
|-
Takes an input [[#IStorage]], no output.
! Cmd || Name
|-
| 0 || [[#OpenApplicationProxy]]
|}


This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time.
=== PopContext ===
No input, returns an output [[#IStorage]].


== OpenApplicationProxy ==
=== CancelWindingReservation ===
Takes a reserved input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias). Returns an [[#IApplicationProxy]].
No input/output.


On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
=== WindAndDoReserved ===
No input/output.


= idle:sys =
=== ReserveToStartAndWaitAndUnwindThis ===
This is "nn::idle::detail::IPolicyManagerSystem"
Takes an input [[#ILibraryAppletAccessor]], no output.
 
=== ReserveToStartAndWait ===
Takes an input [[#ILibraryAppletAccessor]], no output.
 
== ISystemProcessCommonFunctions ==
This is "nn::am::service::ISystemProcessCommonFunctions".


This was moved to [[OMM_services|omm]] with [14.0.0+].
This was added with [19.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,139: Line 3,383:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetAutoPowerDownEvent
| 1 ||  
|-
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
|-
| 2 || [1.0.0-3.0.2]
|-
| 3 || [[#SetHandlingContext]]
|-
| 4 || LoadAndApplySettings
|-
| 5 || ReportUserIsActive
|}
|}


== SetHandlingContext ==
=== Cmd1 ===
[3.0.0+] Now takes an additional 0x10-bytes of input.
No input. Returns an [[#IApplicationObserver]].


[13.0.0+] Total input size is now 0x30 instead of 0x38.
=== IApplicationObserver ===
This is "nn::am::service::IApplicationObserver".


= omm =
This was added with [19.0.0+].
This is "nn::omm::detail::IOperationModeManager"
 
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
 
This was moved to [[OMM_services|omm]] with [14.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,169: Line 3,398:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetOperationMode
| 1 ||  
|-
|-
| 1 || GetOperationModeChangeEvent
| 2 ||  
|-
|-
| 2 || EnableAudioVisual
| 10 ||  
|-
|-
| 3 || DisableAudioVisual
| 20 ||  
|-
|-
| 4 || EnterSleepAndWait
| 30 ||  
|-
|-
| 5 || GetCradleStatus
| 40 || [S2] [20.0.0+]
|}
 
== IAppletAlternativeFunctions ==
This is "nn::am::service::IAppletAlternativeFunctions".
 
This was added with [20.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 6 || FadeInDisplay
! Cmd || Name
|-
|-
| 7 || FadeOutDisplay
| 0 ||  
|-
|-
| 8 || [2.0.0+] GetCradleFwVersion
| 1 ||  
|-
|-
| 9 || [2.0.0+] NotifyCecSettingsChanged
| 2 ||  
|}
 
== IChatProxy ==
This is "nn::am::service::IChatProxy".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 10 || [3.0.0+] SetOperationModePolicy
! Cmd || Name || Notes
|-
|-
| 11 || [3.0.0+] GetDefaultDisplayResolution
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
|-
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
|-
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
|-
| 14 || [3.0.0+] ShouldSleepOnBoot
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
|-
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
|-
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|-
|-
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
|-
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
|-
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
|-
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
|-
| 22 || [4.0.0+] GetHdcpStateChangeEvent
|-
| 23 || [4.0.0+] GetHdcpState
|-
| 24 || [5.0.0+] ShowCardUpdateProcessing
|-
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
|-
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
|-
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
|-
|-
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]
| 20 || || Returns an [[#IChatFunctions]].
|}
|}


== GetOperationModeSystemInfo ==
=== IChatFunctions ===
No input, returns an output u32.
This is "nn::am::service::IChatFunctions".


This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
This is exclusive to Switch 2.
 
== CreateCradleFirmwareUpdater ==
No input. Returns an [[#ICradleFirmwareUpdater]].
 
== ICradleFirmwareUpdater ==
This is "nn::am::service::ICradleFirmwareUpdater".
 
This was added with [12.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,245: Line 3,464:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || Start
| 1 ||
|-
| 102 ||
|-
| 103 ||  
|-
|-
| 1 || Finish
| 104 ||  
|-
|-
| 2 || GetUpdateDeviceStatus
| 110 ||  
|-
|-
| 3 || GetUpdateProgress
| 120 ||  
|-
|-
| 4 || GetUpdateDeviceStatusChangeEvent
| 121 ||  
|-
|-
| 5 || GetUpdateProgress2
| 130 ||  
|-
| 140 || [20.0.0+]
|-
| 141 || [20.0.0+]
|-
| 200 ||
|-
| 201 ||
|-
| 210 || [20.0.0+]
|-
| 220 || [20.0.0+]
|}
|}


= spsm =
== IDebugFunctions ==
This is "nn::spsm::detail::IPowerStateInterface".
This is "nn::am::service::IDebugFunctions".
 
This was moved to [[OMM_services|omm]] with [14.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,267: Line 3,500:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetCurrentState
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
|-
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
|-
|-
| 1 || EnterSleep
| 10 || [[#PerformSystemButtonPressing]]
|-
|-
| 2 || GetLastWakeReason
| 20 || [[#InvalidateTransitionLayer]]
|-
|-
| 3 || Shutdown
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
|-
|-
| 4 || GetNotificationMessageEventHandle
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
|-
|-
| 5 || ReceiveNotificationMessage
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
|-
|-
| 6 || AnalyzeLogForLastSleepWakeSequence
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
|-
|-
| 7 || ResetEventLog
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
|-
|-
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
|-
|-
| 9 || ChangeHomeButtonLongPressingTime
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
|-
|-
| 10 || PutErrorState
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
|-
|-
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
|}
|-
 
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
|-
 
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
= tcap =
This is "nn::tcap::server::IManager".
 
This was removed with [11.0.0+].
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
|-
|-
| 0 || GetContinuousHighSkinTemperatureEvent
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
|-
|-
| 1 || SetOperationMode
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
|-
|-
| 2 || LoadAndApplySettings
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
|}
 
= caps:su =
This is "nn::capsrv::sf::IScreenShotApplicationService".
 
This was added with [6.0.0+].
 
This can be used by applications to save screenshots.
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]
|-
|-
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
|-
|-
| 201 || [[#SaveScreenShot]]
| 140 || [14.0.0+] [[#RestrictPowerOperationForSecureLaunchModeForDebug|RestrictPowerOperationForSecureLaunchModeForDebug]]
|-
|-
| 203 || [[#SaveScreenShotEx0]]
| 150 || [21.0.0+]
|-
|-
| 205 || [8.0.0+] [[#SaveScreenShotEx1]]
| 200 || [15.0.0+] [[#CreateFloatingLibraryAppletAccepterForDebug|CreateFloatingLibraryAppletAccepterForDebug]]
|-
|-
| 210 || [[#SaveScreenShotEx2]]
| 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]
|}


== SetShimLibraryVersion ==
=== NotifyMessageToHomeMenuForDebug ===
Takes a total of 0x10-bytes of input and a PID, no output.
Takes an input [[#AppletMessage]], no output.


This is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
Stubbed, just returns an error.


== SaveScreenShot ==
=== OpenMainApplication ===
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
No input, returns an output [[#IApplicationAccessor]].


Official user-processes doesn't use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero, except +4 is set to an input u32 and u32 +0xC = 0x1.
Should not be used when no Application is running (svcBreak).


This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
=== PerformSystemButtonPressing ===
Takes an input [[#SystemButtonType]], no output.


== SaveScreenShotEx0 ==
=== InvalidateTransitionLayer ===
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
No input/output.


== SaveScreenShotEx1 ==
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, a type-0x15 input buffer containing an [[Capture_services|ApplicationData]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
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.


== SaveScreenShotEx2 ==
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]]).
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a type-0x15 input buffer containing an [[Capture_services|UserIdList]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 
=== RequestLaunchApplicationByApplicationLaunchInfoForDebug ===
Takes a total of 0x58-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.
 
[19.0.0+] Takes a total of 0x88-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.


= apm =
=== GetAppletResourceUsageInfo ===
This is "nn::am::service::IApmManager".
No input, returns an output [[#AppletResourceUsageInfo]].


This was added with [8.0.0+].
=== SetCpuBoostModeForApplet ===
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].


{| class="wikitable" border="1"
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
|-
! Cmd || Name
|-
| 0 || [[#OpenSession]]
|-
| 1 || GetPerformanceMode
|-
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
|}


== OpenSession ==
=== CancelCpuBoostModeForApplet ===
Returns an [[#ISession]].
No input/output.


== IsCpuOverclockEnabled ==
=== PushToAppletBoundChannelForDebug ===
No input, returns an output u8 bool.
Takes an input [[#IStorage]] and a s32, no output.


== ISession ==
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
This is "nn::am::service::IApmSession".


{| class="wikitable" border="1"
The s32 must match the value already stored in state when the state value is non-zero, otherwise an error is returned. When the state value is 0, the s32 is written into state. Then the input storage is pushed to the StorageChannel.
|-
 
! Cmd || Name
=== TryPopFromAppletBoundChannelForDebug ===
|-
Takes an input s32, returns an output [[#IStorage]].
| 0 || SetPerformanceConfiguration
 
|-
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
| 1 || GetPerformanceConfiguration
|-
| 2 || [8.0.0+] SetCpuOverclockEnabled
|}


= (S2) adraw:a =
The s32 must not be 0 and must match the value previously saved by [[#PushToAppletBoundChannelForDebug]], otherwise errors are returned. Then the output storage is popped from the StorageChannel.
This is "nn::appletdraw::sfif::IAppletRoot".


{| class="wikitable" border="1"
=== AlarmSettingNotificationEnableAppEventReserve ===
|-
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
! Cmd || Name
|-
| 1 || [[#OpenResourceSession]]
|-
| 2 || [[#OpenAppletSession]]
|}


== OpenResourceSession ==
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
Unofficial name.  


Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IResourceSession]].
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToNotificationStorageChannel|NotificationStorageChannel]].


== OpenAppletSession ==
=== AlarmSettingNotificationDisableAppEventReserve ===
Unofficial name.
No input/output.


Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IAppletSession]].
Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].


== IResourceSession ==
=== AlarmSettingNotificationPushAppEventNotify ===
This is "nn::appletdraw::sfif::IResourceSession".
Takes an input [[#IStorage]], no output.


{| class="wikitable" border="1"
Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.
|-
 
! Cmd || Name
=== FriendInvitationSetApplicationParameter ===
|-
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
| 1 || [[#Ping|Ping]]
 
|-
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
| 10 || 
 
|-
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToFriendInvitationStorageChannel|FriendInvitationStorageChannel]].
| 11 || 
|}


=== Ping ===
=== FriendInvitationClearApplicationParameter ===
Unofficial name.
No input/output.


Takes an input u64. Returns an output u64.
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].


The output u64 should match the input u64. Official software sends the current system tick value.
=== FriendInvitationPushApplicationParameter ===
Takes an input [[#IStorage]], no output.


=== Cmd10 ===
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
Takes a handle, a u64 and an int. Returns a handle.


=== Cmd11 ===
=== RestrictPowerOperationForSecureLaunchModeForDebug ===
No input/output.
No input/output.


== IAppletSession ==
This runs the same functionality as [[#DisableSleepTillShutdown|DisableSleepTillShutdown]].
This is "nn::appletdraw::sfif::IAppletSession".
 
=== CreateFloatingLibraryAppletAccepterForDebug ===
Takes a PID, an input u64 reserved_pid, a type-0x5 input buffer containing an array of u32s, returns an [[#appletAE|IAllSystemAppletProxiesService]].
 
If a state field is already set it must match the PID, otherwise when state==0 the PID is written into state etc.
 
=== CreateGeneralStorageForDebug ===
Takes two input u64s Id and size, no output.
 
The high-byte of Id must be 0.
 
Goes through a linked-list to check whether there's already an entry with a matching Id. If there's a matching Id, return 0 if the size matches, otherwise return error.
 
When no entry is found, a new entry is added with a buffer allocated using the input size.
 
=== ReadGeneralStorageForDebug ===
Takes a type-0x22 output buffer, two input u64s Id and offset, returns an output u64 out_size.


{| class="wikitable" border="1"
The high-byte of Id must be 0.
|-
 
! Cmd || Name
Reads data from the buffer previously allocated by [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]] with the specified Id.
|-
 
| 1 || [[#Ping|Ping]]
The out_size is always the buffer-size (an error is thrown when bounds-check fails).
|-
 
| 2 || [[#GetEvent|GetEvent]]
=== WriteGeneralStorageForDebug ===
Takes a type-0x21 input buffer, two input u64s Id and offset.
 
Same as [[#ReadGeneralStorageForDebug|ReadGeneralStorageForDebug]] except this writes into the buffer, and no out_size.
 
== IStorage ==
This is "nn::am::service::IStorage".
 
{| class="wikitable" border="1"
|-
|-
| 3 || [20.1.1+]
! Cmd || Name || Notes
|-
|-
| 10 ||
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
|-
|-
| 11 ||
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
|}
 
Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].
 
Only 1 *Accessor session can be open for each IStorage at a time.
 
== IStorageAccessor ==
This is "nn::am::service::IStorageAccessor".
 
{| class="wikitable" border="1"
|-
|-
| 12 ||
! Cmd || Name || Notes
|-
|-
| 13 ||
| 0 || GetSize || No input. Returns an s64.
|-
|-
| 15 ||
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
|-
|-
| 16 || [20.1.1+]
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
|}
 
== ITransferStorageAccessor ==
This is "nn::am::service::ITransferStorageAccessor".
 
{| class="wikitable" border="1"
|-
|-
| 17 || [20.1.1+]
! Cmd || Name || Notes
|-
|-
| 18 || [20.1.1+]
| 0 || GetSize || No input. Returns an output s64.
|-
|-
| 19 || [20.1.1+]
| 1 || GetHandle || No input. Returns an output s64 and handle.
|}
 
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
 
= appletOE =
This is "nn::am::service::IApplicationProxyService".
 
{| class="wikitable" border="1"
|-
|-
| 21 |
! Cmd || Name
|-
|-
| 22 ||
| 2000 || [S2] [[#OpenCompatApplicationFunctions|OpenCompatApplicationFunctions]]
|-
|-
| 23 || [20.1.1+]
| 0 || [[#OpenApplicationProxy]]
|-
| 24 || [20.1.1+]
|-
| 31 || [[#GetFrameBufferInfo|GetFrameBufferInfo]]
|-
| 8001 || [[#GetFrameBufferInfoForDebug|GetFrameBufferInfoForDebug]]
|-
| 8003 || [19.0.0-19.1.0]
|-
|-
| 8004 ||
| 10 || [S2] [[#OpenApplicationProxy2|OpenApplicationProxy2]]
|}
|}


=== GetEvent ===
This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time.
Unofficial name.
 
== OpenApplicationProxy ==
Takes a reserved input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias). Returns an [[#IApplicationProxy]].


No input. Returns an output Event handle.
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.


=== Cmd3 ===
== OpenApplicationProxy2 ==
Takes a handle. No output.
Unofficial name.


=== Cmd10 ===
Takes an input u32, an u64 pid_reserved, a PID, and a process copy-handle (cur-proc handle alias). Returns an [[#IApplicationProxy]].
Takes an input u32. No output.


=== Cmd11 ===
= idle:sys =
Takes an input u32. No output.
This is "nn::idle::detail::IPolicyManagerSystem"


=== Cmd12 ===
This was moved to [[OMM_services|omm]] with [14.0.0+].
Takes an input u64. Returns an output u32.


=== Cmd13 ===
{| class="wikitable" border="1"
Takes an input u32. Returns an output u32.
|-
! Cmd || Name
|-
| 0 || GetAutoPowerDownEvent
|-
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
|-
| 2 || [1.0.0-3.0.2]
|-
| 3 || [[#SetHandlingContext]]
|-
| 4 || LoadAndApplySettings
|-
| 5 || ReportUserIsActive
|}


=== Cmd15 ===
== SetHandlingContext ==
Takes an input u32. Returns three output u32s.
[3.0.0+] Now takes an additional 0x10-bytes of input.


=== Cmd16 ===
[13.0.0+] Total input size is now 0x30 instead of 0x38.
No input. Returns an output u32.


=== Cmd17 ===
= omm =
Takes an input u32. Returns an output u32 and an output u16.
This is "nn::omm::detail::IOperationModeManager"


=== Cmd18 ===
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
Takes an input u32. Returns three output u32s and an output u16.
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].


=== Cmd19 ===
This was moved to [[OMM_services|omm]] with [14.0.0+].
Takes an input u32. Returns an output u32 and an output u16.


=== Cmd21 ===
{| class="wikitable" border="1"
Takes an input u32. Returns a struct of size 0x40.
|-
 
! Cmd || Name
=== Cmd22 ===
Takes a struct of size 0x20. Returns a struct of size 0x40.
 
=== Cmd23 ===
No input. Returns a struct of size 0xC8.
 
=== Cmd24 ===
Takes an ipc-buf with size 0xD8. No output.
 
=== GetFrameBufferInfo ===
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].
 
[[#(S2)_AdrawFrameBufferInfo|Id]] is "adrawfb".
 
=== GetFrameBufferInfoForDebug ===
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].
 
=== Cmd8003 ===
Takes an input u64. Returns a struct with size 0x18.
 
=== Cmd8004 ===
Takes an input u32. Returns an output u64.
 
= (S2) appletOE =
This is "nn::am::service::IApplicationProxyServiceForNxCompat".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 0 || GetOperationMode
|-
|-
| 0 || [[#OpenApplicationProxy]]
| 1 || GetOperationModeChangeEvent
|-
|-
| 2000 || [[#OpenCompatApplicationFunctions]]
| 2 || EnableAudioVisual
|}
|-
 
| 3 || DisableAudioVisual
== OpenCompatApplicationFunctions ==
|-
No input. Returns an [[#INxCompatApplicationFunctions]].
| 4 || EnterSleepAndWait
 
|-
== INxCompatApplicationFunctions ==
| 5 || GetCradleStatus
This is "nn::am::service::INxCompatApplicationFunctions".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 6 || FadeInDisplay
|-
|-
| 2000 || [[#GetGraphicsInterfaceForNxCompat]]
| 7 || FadeOutDisplay
|-
|-
| 2001 ||  
| 8 || [2.0.0+] GetCradleFwVersion
|-
|-
| 2002 ||
| 9 || [2.0.0+] NotifyCecSettingsChanged
|-
|-
| 2003 || [[#SetCopyright]]
| 10 || [3.0.0+] SetOperationModePolicy
|-
|-
| 2004 ||
| 11 || [3.0.0+] GetDefaultDisplayResolution
|-
|-
| 2010 ||
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
|-
|-
| 2020 || [[#Initialize]]
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
|-
|-
| 2030 || [[#GetVsyncEvent]]
| 14 || [3.0.0+] ShouldSleepOnBoot
|-
|-
| 2040 || [[#GetVsyncTimestamp]]
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
|-
|-
| 2050 ||  
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
|-
|-
| 2060 ||  
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
|-
|-
| 2070 || [[#CreateMovieMaker]]
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
|}
 
=== GetGraphicsInterfaceForNxCompat ===
Unofficial name.
 
No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]].
 
Same as [[#GetGraphicsInterface]] but for compat mode.
 
=== SetCopyright ===
Unofficial name.
 
Takes an input bool. No output.
 
Called directly after "nn::vi::WriteToCopyrightFramebuffer".
 
=== Initialize ===
Unofficial name.
 
No input/output.
 
Called during init.
 
=== GetVsyncEvent ===
Unofficial name.
 
No input. Returns an Event handle.
 
=== GetVsyncTimestamp ===
Unofficial name.
 
No input. Returns an output u64.
 
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp.
 
= (S2) GraphicsInterface =
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
|-
|-
| 1 || [[#InitializeGraphicsWithTransferMemory]]  
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
|-
|-
| 4 || [[#InitializeGraphics]]  
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
|-
|-
| 11 || [[#SetCurrentProcessHandle]]
| 22 || [4.0.0+] GetHdcpStateChangeEvent
|-
|-
| 12 ||  
| 23 || [4.0.0+] GetHdcpState
|-
|-
| 101 || [[#StartGraphics]]
| 24 || [5.0.0+] ShowCardUpdateProcessing
|-
|-
| 111 ||  
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
|-
|-
| 112 ||  
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
|-
|-
| 114 ||  
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
|-
|-
| 115 ||  
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]
|-
|}
| 187 ||  
 
== GetOperationModeSystemInfo ==
No input, returns an output u32.
 
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
 
== CreateCradleFirmwareUpdater ==
No input. Returns an [[#ICradleFirmwareUpdater]].
 
== ICradleFirmwareUpdater ==
This is "nn::am::service::ICradleFirmwareUpdater".
 
This was added with [12.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 201 ||  
! Cmd || Name
|-
|-
| 301 ||  
| 0 || Start
|-
|-
| 303 ||  
| 1 || Finish
|-
|-
| 311 ||  
| 2 || GetUpdateDeviceStatus
|-
|-
| 312 ||  
| 3 || GetUpdateProgress
|-
|-
| 314 ||  
| 4 || GetUpdateDeviceStatusChangeEvent
|-
|-
| 315 ||  
| 5 || GetUpdateProgress2
|}
 
= spsm =
This is "nn::spsm::detail::IPowerStateInterface".
 
This was moved to [[OMM_services|omm]] with [14.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 321 ||  
! Cmd || Name
|-
|-
| 327 ||  
| 0 || GetCurrentState
|-
|-
| 391 ||  
| 1 || EnterSleep
|-
|-
| 401 || [[#PrepareGpuManagerSession]]
| 2 || GetLastWakeReason
|-
|-
| 402 || [[#StartGpuManagerSession]]
| 3 || Shutdown
|-
|-
| 423 ||  
| 4 || GetNotificationMessageEventHandle
|-
|-
| 428 || [[#GetImageInfo]]
| 5 || ReceiveNotificationMessage
|-
|-
| 434 ||  
| 6 || AnalyzeLogForLastSleepWakeSequence
|-
|-
| 494 ||  
| 7 || ResetEventLog
|-
|-
| 496 || [[#CreateGpuManagerSessionWithTransferMemory]]
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
|-
|-
| 497 || [[#CreateGpuManagerSession]]
| 9 || ChangeHomeButtonLongPressingTime
|-
|-
| 901 ||  
| 10 || PutErrorState
|-
|-
| 902 ||  
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
|}
 
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
 
= tcap =
This is "nn::tcap::server::IManager".
 
This was removed with [11.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 903 ||  
! Cmd || Name
|-
|-
| 905 ||  
| 0 || GetContinuousHighSkinTemperatureEvent
|-
|-
| 911 ||  
| 1 || SetOperationMode
|-
|-
| 912 ||  
| 2 || LoadAndApplySettings
|}
 
= caps:su =
This is "nn::capsrv::sf::IScreenShotApplicationService".
 
This was added with [6.0.0+].
 
This can be used by applications to save screenshots.
 
{| class="wikitable" border="1"
|-
|-
| 922 ||  
! Cmd || Name
|-
|-
| 961 ||  
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
|-
|-
| 991 ||  
| 201 || [[#SaveScreenShot]]
|-
|-
| 1001 ||  
| 203 || [[#SaveScreenShotEx0]]
|-
|-
| 1002 ||  
| 205 || [8.0.0+] [[#SaveScreenShotEx1]]
|-
|-
| 1003 ||
| 210 || [[#SaveScreenShotEx2]]
|-
|}
| 1101 ||
 
|-
== SetShimLibraryVersion ==
| 1102 ||
Takes a total of 0x10-bytes of input and a PID, no output.
|-
| 1301 || [[#InitializeAdraw]]
|-
| 1302 || [[#StartAdraw]]
|-
| 1325 || [[#GetAdrawFrameBufferHandle]]
|-
| 1326 || [[#GetAdrawImageHandle]]
|-
| 1401 || [[#CreateNvDrv2UserSessionWithTransferMemory]]
|-
| 1402 || [[#CreateNvDrv2UserSession]]
|-
| 1411 || [[#GetNvDrv2UserTransferMemoryUsage]]
|-
| 1501 || 
|-
| 1502 ||
|-
| 1601 ||
|-
| 1602 ||
|-
| 1603 ||
|-
| 1611 ||
|-
| 1612 ||
|-
| 1691 ||
|}


== InitializeGraphicsWithTransferMemory ==
This is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
Unofficial name.


Takes a TransferMemory handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and an input u64 '''TransferMemorySize'''. No output.
== SaveScreenShot ==
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].


== InitializeGraphics ==
Official user-processes doesn't use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero, except +4 is set to an input u32 and u32 +0xC = 0x1.
Unofficial name.


Takes a Process handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and five input u64s. No output.
This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.


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.
== SaveScreenShotEx0 ==
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].


== SetCurrentProcessHandle ==
== SaveScreenShotEx1 ==
Unofficial name.
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, a type-0x15 input buffer containing an [[Capture_services|ApplicationData]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].


Takes a Process handle. No output.
== SaveScreenShotEx2 ==
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a type-0x15 input buffer containing an [[Capture_services|UserIdList]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].


Called directly after [[#InitializeGraphicsWithTransferMemory]] or [[#InitializeGraphics]].
= apm =
This is "nn::am::service::IApmManager".


== StartGraphics ==
This was added with [8.0.0+].
Unofficial name.


No input/output.
[S2] Official sw no longer uses this (stubbed out).


Called directly after [[#SetCurrentProcessHandle]].
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#OpenSession]]
|-
| 1 || GetPerformanceMode
|-
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
|}


== PrepareGpuManagerSession ==
== OpenSession ==
Unofficial name.
Returns an [[#ISession]].


No input/output.
== IsCpuOverclockEnabled ==
No input, returns an output u8 bool.


Called directly after [[#CreateGpuManagerSessionWithTransferMemory]] or [[#CreateGpuManagerSession]].
== ISession ==
This is "nn::am::service::IApmSession".


== StartGpuManagerSession ==
{| class="wikitable" border="1"
Unofficial name.
|-
! Cmd || Name
|-
| 0 || SetPerformanceConfiguration
|-
| 1 || GetPerformanceConfiguration
|-
| 2 || [8.0.0+] SetCpuOverclockEnabled
|}


No input/output.
= (S2) adraw:a =
This is "nn::appletdraw::sfif::IAppletRoot".


Called directly after [[#PrepareGpuManagerSession]].
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 1 || [[#OpenResourceSession]]
|-
| 2 || [[#OpenAppletSession]]
|}


== GetImageInfo ==
== OpenResourceSession ==
Unofficial name.
Unofficial name.  


Takes an input u32 '''ImageHandle'''. Returns an [[#(S2)_ImageInfo|ImageInfo]].
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IResourceSession]].


== CreateGpuManagerSessionWithTransferMemory ==
== OpenAppletSession ==
Unofficial name.
Unofficial name.


Takes a TransferMemory handle and two input u64s '''Version''' and '''TransferMemorySize'''. Returns a [[#GpuManagerSession]].
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IAppletSession]].


[19.0.0] '''Version''' must be 2.
== IResourceSession ==
This is "nn::appletdraw::sfif::IResourceSession".


== CreateGpuManagerSession ==
{| class="wikitable" border="1"
Unofficial name.
|-
 
! Cmd || Name
Takes an input u64 '''Version'''. Returns a [[#GpuManagerSession]].
|-
| 1 || [[#Ping|Ping]]
|-
| 10 || 
|-
| 11 || 
|}


[19.0.0] '''Version''' must be 2.
=== Ping ===
Unofficial name.


== InitializeAdraw ==
Takes an input u64. Returns an output u64.
Unofficial name.


No input/output.
The output u64 should match the input u64. Official software sends the current system tick value.


== StartAdraw ==
=== Cmd10 ===
Unofficial name.
Takes a handle, a u64 and an int. Returns a handle.


=== Cmd11 ===
No input/output.
No input/output.


Called directly after [[#InitializeAdraw]].
== IAppletSession ==
 
This is "nn::appletdraw::sfif::IAppletSession".
== 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]].
 
== 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"
{| class="wikitable" border="1"
Line 3,860: Line 4,082:
! Cmd || Name
! Cmd || Name
|-
|-
| 11 || [[#GetEventIdRange]]
| 1 || [[#Ping|Ping]]
|-
|-
| 12 || [[#CreateEvent]]
| 2 || [[#GetEvent|GetEvent]]
|-
|-
| 21 || [[#RequestGpuSession]]
| 3 || [20.1.1+]  
|-
|-
| 22 || [[#GetGpuSession]]
| 10 ||
|-
|-
| 33 ||  
| 11 ||
|-
|-
| 41 ||  
| 12 ||
|-
|-
| 42 ||  
| 13 ||
|-
|-
| 102 ||  
| 15 ||
|-
|-
| 200 ||  
| 16 || [20.1.1+]
|-
|-
| 201 ||  
| 17 || [20.1.1+]
|-
|-
| 202 ||  
| 18 || [20.1.1+]
|}
 
=== 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
| 19 || [20.1.1+]
|-
|-
| 101 || [[#CreateGpuMemory]]
| 21 ||
|-
|-
| 102 || [[#DestroyGpuMemory]]
| 22 ||
|-
|-
| 201 || [19.0.0-19.1.0] MapMemory
| 23 || [20.1.1+]
|-
|-
| 202 || [19.0.0-19.1.0] UnmapMemory
| 24 || [20.1.1+]
|-
|-
| 203 || [19.0.0-19.1.0] AllocateAddressSpace
| 31 || [[#GetFrameBufferInfo|GetFrameBufferInfo]]
|-
|-
| 204 || [19.0.0-19.1.0] FreeAddressSpace
| 8001 || [[#GetFrameBufferInfoForDebug|GetFrameBufferInfoForDebug]]
|-
|-
| 205 || [19.0.0-19.1.0] RemapMemory
| 8003 || [19.0.0-19.1.0]
|-
|-
| 207 || [19.0.0-19.1.0] ModifyMemoryMapping
| 8004 ||
|-
| 211 || [20.1.1+] MapMemoryV2
|-
| 212 || [20.1.1+] ModifyMemoryMappingV2
|-
| 213 || [20.1.1+] UnmapMemoryV2
|-
| 214 || [20.1.1+] AllocateAddressSpaceV2
|-
| 215 || [20.1.1+] FreeAddressSpaceV2
|-
| 216 || [20.1.1+] RemapMemoryV2
|}
|}


==== CreateGpuMemory ====
=== GetEvent ===
Unofficial name.
Unofficial name.


Takes two input u64s '''MemoryAddressStart''' and '''MemoryAddressEnd''' and two u8s. Returns an output u32 '''GpuMemoryHandle'''.
No input. Returns an output Event handle.


The memory region between '''MemoryAddressStart''' and '''MemoryAddressEnd''' must have been passed to [[#SVC|SVC]] 0x80 with attribute 0x20.
=== Cmd3 ===
Takes a handle. No output.


==== DestroyGpuMemory ====
=== Cmd10 ===
Unofficial name.
Takes an input u32. No output.
 
=== Cmd11 ===
Takes an input u32. No output.


Takes two input u32s '''GpuMemoryHandle''' and '''EventId'''. No output.
=== Cmd12 ===
Takes an input u64. Returns an output u32.


The Event handle associated with '''EventId''' will be signalled when the memory is released.
=== Cmd13 ===
Takes an input u32. Returns an output u32.


= Library Applets =
=== Cmd15 ===
This section documents library applet launching.
Takes an input u32. Returns three output u32s.


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.
=== Cmd16 ===
No input. Returns an output u32.


Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
=== Cmd17 ===
Takes an input u32. Returns an output u32 and an output u16.


== CommonArguments ==
=== Cmd18 ===
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.
Takes an input u32. Returns three output u32s and an output u16.


This struct is 0x20-bytes.
=== Cmd19 ===
Takes an input u32. Returns an output u32 and an output u16.


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.
=== Cmd21 ===
Takes an input u32. Returns a struct of size 0x40.


{| class="wikitable" border="1"
=== Cmd22 ===
|-
Takes a struct of size 0x20. Returns a struct of size 0x40.
! Offset || Size || Typical Value || Notes
 
=== Cmd23 ===
No input. Returns a struct of size 0xC8.
 
=== Cmd24 ===
Takes an ipc-buf with size 0xD8. No output.
 
=== GetFrameBufferInfo ===
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].
 
[[#(S2)_AdrawFrameBufferInfo|Id]] is "adrawfb".
 
=== GetFrameBufferInfoForDebug ===
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].
 
=== Cmd8003 ===
Takes an input u64. Returns a struct with size 0x18.
 
=== Cmd8004 ===
Takes an input u32. Returns an output u64.
 
= (S2) appletOE =
This is "nn::am::service::IApplicationProxyServiceForNxCompat".
 
{| class="wikitable" border="1"
|-
|-
| 0x0 || 4 || 1 || Common Arguments version
! Cmd || Name
|-
|-
| 0x4 || 4 || 0x20 || Common Arguments size
| 0 || [[#OpenApplicationProxy]]
|-
|-
| 0x8 || 4 || || Library applet version (API version)
| 2000 || [[#OpenCompatApplicationFunctions]]
|-
|}
| 0xC || 4 || 0 || Theme color
 
|-
== OpenCompatApplicationFunctions ==
| 0x10 || 1 || 0 || Play startup sound
No input. Returns an [[#INxCompatApplicationFunctions]].
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
|-
|}


= AppletId =
== INxCompatApplicationFunctions ==
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
This is "nn::am::service::INxCompatApplicationFunctions".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name
! ProgramId
! Description
|-
|-
| 0x00
| 2000 || [[#GetGraphicsSupervisorForNxCompat]]
|  
| None
|-
|-
| 0x01
| 2001 ||  
|  
| Application (not valid for use with LibraryApplets)
|-
|-
| 0x02
| 2002 ||
| 010000000000100C
| OverlayApplet (overlayDisp)
|-
|-
| 0x03
| 2003 || [[#SetCopyright]]
| 0100000000001000
| SystemAppletMenu (qlaunch)
|-
|-
| 0x04
| 2004 ||
| 0100000000001012
| SystemApplication (starter)
|-
|-
| 0x0A
| 2010 ||
| 0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
|-
| 0x0B
| 2020 || [[#Initialize]]
| 0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
|-
| 0x0C
| 2030 || [[#GetVsyncEvent]]
| 0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
|-
| 0x0D
| 2040 || [[#GetVsyncTimestamp]]
| 0100000000001004
| LibraryAppletDataErase (dataErase)
|-
|-
| 0x0E
| 2050 ||  
| 0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
|-
|-
| 0x0F
| 2060 ||  
| 0100000000001006
| LibraryAppletNetConnect (netConnect)
|-
|-
| 0x10
| 2070 || [[#CreateMovieMaker]]
| 0100000000001007
|}
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
 
|-
=== GetGraphicsSupervisorForNxCompat ===
| 0x11
Unofficial name.
| 0100000000001008
 
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
No input. Returns an output TIPC handle to [[Switch_2:_GSV_services|GraphicsSupervisor]].
|-
 
| 0x12
Same as [[#GetGraphicsSupervisor]] but for compat mode.
| 0100000000001009
 
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
=== SetCopyright ===
|-
Unofficial name.
| 0x13
 
| 010000000000100A
Takes an input bool. No output.
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
 
|-
Called directly after "nn::vi::WriteToCopyrightFramebuffer".
| 0x14
 
| 010000000000100B
=== Initialize ===
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
Unofficial name.
|-
 
| 0x15
No input/output.
| 010000000000100D
 
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
Called during init.
|-
 
| 0x16
=== GetVsyncEvent ===
| 010000000000100E
Unofficial name.
| LibraryAppletSet (set)
 
|-
No input. Returns an Event handle.
| 0x17
 
| 010000000000100F
=== GetVsyncTimestamp ===
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
Unofficial name.
|-
 
| 0x18
No input. Returns an output u64.
| 0100000000001010
 
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp.
|-
 
| 0x19
= Library Applets =
| 0100000000001011
This section documents library applet launching.
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
 
|-
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.
| 0x1A
 
| 0100000000001013
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
 
== 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"
|-
|-
| 0x1B
! Offset || Size || Typical Value || Notes
| 010000000000101A
| LibraryAppletGift (gift)
|-
|-
| 0x1C
| 0x0 || 4 || 1 || Common Arguments version
| 010000000000101C
| LibraryAppletUserMigration (userMigration)
|-
|-
| 0x1D
| 0x4 || 4 || 0x20 || Common Arguments size
| 010000000000101D
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
|-
|-
| 0x1E
| 0x8 || 4 || || Library applet version (API version)
| 0100000000001020
| [9.0.0+] LibraryAppletStory (story)
|-
|-
| 0x1F
| 0xC || 4 || 0 || Theme color
| 010070000E3C0000
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
|-
|-
| 0x20
| 0x10 || 1 || 0 || Play startup sound
| 010086000E49C000
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
|-
|-
| 0x21
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
| 0100000000001038
| [10.0.0+] LibraryAppletSample (sample)
|-
|-
| 0x22
|}
| 0100000000001007
 
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
= AppletId =
|-
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
| 0x32
 
| 010000000000100F
{| class="wikitable" border="1"
| [17.0.0+] LibraryAppletOfflineWebApp_3 ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
! Value
! ProgramId
! Description
|-
| 0x00000000
|
| None
|-
| 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)]]
|-
|-
| 0x33
| 0x00000013
| 010000000000100F
| [22.0.0+] 0x0100000000001043 ([1.0.0-21.2.0] 0x010000000000100A)
| [17.0.0+] LibraryAppletOfflineWebSystem ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
|-
| 0x35
| 0x00000014
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| 0x010000000000100B
| [17.0.0+] LibraryAppletLhub ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
|-
| 0x36
| 0x00000015
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| 0x010000000000100D
| [17.0.0+] LibraryAppletLogin ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
|-
| 0x37
| 0x00000016
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| 0x010000000000100E
| [17.0.0+] LibraryAppletShare ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
| LibraryAppletSet (set)
|-
| 0x00000017
| 0x010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
| 0x00000018
| [22.0.0+] 0x0100000000001042 ([1.0.0-21.2.0] 0x0100000000001010)
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
|-
| 0x00000019
| [22.0.0+] 0x0100000000001043 ([1.0.0-21.2.0] 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
| [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)
|-
| 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)
|-
| 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)
|-
| 0x00000038
| 0x0100000000001043
| [16.0.0-16.1.0]
|-
| 0x00000050
| 0x0100000000001007
| [18.0.0+]
|-
| 0x00000051
| 0x0100000000001007
| [18.0.0+]
|-
| 0x00000052
| 0x0100000000001001
| [22.0.0+]
|-
| 0x00000064
| 0x0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
|-
| 0x00000066
| 0x0100000000001054
| [21.0.0+]
|-
| 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
|-
| 0x0100000A
|
| [[Auth_Applet|LibraryAppletAuth]]
|-
| 0x0100000B
|
| [[Cabinet_Applet|LibraryAppletCabinet]]
|-
| 0x0100000C
|
| [[Controller_Applet|LibraryAppletController]]
|-
| 0x0100000D
|
| [S2]
|-
| 0x0100000E
|
| [S2] LibraryAppletError
|-
| 0x01000010
|
| [S2] LibraryAppletPlayerSelect
|-
| 0x01010011
|
| [S2] SwkbdModeless
|-
| 0x01020011
|
| [S2] Swkbd
|-
| 0x01010012
|
| [S2] [[MiiEdit_Applet|LibraryAppletMiiEdit]] (for ShowMiiEdit)
|-
| 0x01020012
|
| [S2] [[MiiEdit_Applet|LibraryAppletMiiEdit]] (for AppendMii)
|-
| 0x01070012
|
| [S2] [[MiiEdit_Applet|LibraryAppletMiiEdit]] (for CreateMii)
|-
| 0x01080012
|
| [S2] [[MiiEdit_Applet|LibraryAppletMiiEdit]] (for EditMii)
|-
| 0x01000013
|
| [S2] OpenWeb
|-
| 0x01000014
|
| [S2] LibraryAppletShop
|-
| 0x01000015
|
| [S2] [[Album_Applet|Album]]
|-
| 0x01000017
|
| [S2] LibraryAppletOffline (for Gen0)
|-
| 0x01000018
|
| [S2] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare]] (for Lobby)
|-
| 0x0100001A
|
| [S2] [[MyPage_Applet|MyPageApplet]]
|-
| 0x01000022
|
| [S2] LibraryAppletPromoteQualification
|-
| 0x01000024
|
| [S2] SplayApplet
|-
| 0x01030024
|
| [S2] SplayApplet
|-
| 0x01010025
|
| [S2] SaveDataBackup (System Settings menu for Save Data Cloud)
|-
| 0x01020025
|
| [S2] SaveDataBackup (Same as above except with ApplicationId specified)
|-
| 0x01000028
|
| [S2] Eula
|-
| 0x01000032
|
| [S2] LibraryAppletOfflineWebApp_3
|-
| 0x01000033
|
| [S2] LibraryAppletOfflineWebSystem
|-
| 0x01000035
|
| [S2] LibraryAppletLhub
|-
| 0x01000036
|
| [S2] LibraryAppletLogin
|-
| 0x01000037
|
| [S2] LibraryAppletShare
|-
| 0x01000050
|
| [S2] PlayerSelect
|-
| 0x01000051
|
| [S2] PlayerSelect
|-
| 0x01000052
|
| [S2] PlayerSelect
|-
| 0x01000065
|
| [S2] Chat (ForChatStart)
|-
| 0x01010065
|
| [S2] Chat (ForCameraConfiguration)
|-
| 0x01020065
|
| [S2] Chat (ForFullScreen)
|-
|-
| 0x38
| 0x01030065
| 0100000000001043
| [16.0.0-16.1.0]
|-
| 0x50
| 0100000000001007
| [18.0.0+]
|-
| 0x51
| 0100000000001007
| [18.0.0+]
|-
| 0x64
| 0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
|-
| 0x3E8
|  
|  
| [10.0.0-16.1.0] DevlopmentTool
| [S2] Chat (ForCameraSharingGuide)
|-
| 0x3F1
| 010000000000D619
| [10.0.0-16.1.0] CombinationLA
|-
| 0x3F2
| 010000000000D610
| [10.0.0-16.1.0] AeSystemApplet
|-
| 0x3F3
| 010000000000D611
| [10.0.0-16.1.0] AeOverlayApplet
|-
| 0x3F4
| 010000000000D612
| [10.0.0-16.1.0] AeStarter
|-
| 0x3F5
| 010000000000D613
| [10.0.0-16.1.0] AeLibraryAppletAlone
|-
| 0x3F6
| 010000000000D614
| [10.0.0-16.1.0] AeLibraryApplet1
|-
| 0x3F7
| 010000000000D615
| [10.0.0-16.1.0] AeLibraryApplet2
|-
| 0x3F8
| 010000000000D616
| [10.0.0-16.1.0] AeLibraryApplet3
|-
| 0x3F9
| 010000000000D617
| [10.0.0-16.1.0] AeLibraryApplet4
|-
| 0x3FA
| 010000000000D60A
| [10.0.0-16.1.0] AppletISA
|-
| 0x3FB
| 010000000000D60B
| [10.0.0-16.1.0] AppletIOA
|-
| 0x3FC
| 010000000000D60C
| [10.0.0-16.1.0] AppletISTA
|-
| 0x3FD
| 010000000000D60D
| [10.0.0-16.1.0] AppletILA1
|-
| 0x3FE
| 010000000000D60E
| [10.0.0-16.1.0] AppletILA2
|-
|-
| 0x700000C8
| 0x700000C8
| 010000000000D65B
| 0x010000000000D65B
| [18.0.0+]  
| [18.0.0+]  
|-
|-
| 0x700000C9
| 0x700000C9
| 010000000000D65C
| 0x010000000000D65C
| [18.0.0+]  
| [18.0.0+]  
|-
|-
| 0x700000DC
| 0x700000DC
| 010000000000D619
| 0x010000000000D619
| [17.0.0+] CombinationLA
| [17.0.0+] CombinationLA
|-
|-
| 0x700000E6
| 0x700000E6
| 010000000000D610
| 0x010000000000D610
| [17.0.0+] AeSystemApplet
| [17.0.0+] AeSystemApplet
|-
|-
| 0x700000E7
| 0x700000E7
| 010000000000D611
| 0x010000000000D611
| [17.0.0+] AeOverlayApplet
| [17.0.0+] AeOverlayApplet
|-
|-
| 0x700000E8
| 0x700000E8
| 010000000000D612
| 0x010000000000D612
| [17.0.0+] AeStarter
| [17.0.0+] AeStarter
|-
|-
| 0x700000E9
| 0x700000E9
| 010000000000D613
| 0x010000000000D613
| [17.0.0+] AeLibraryAppletAlone
| [17.0.0+] AeLibraryAppletAlone
|-
|-
| 0x700000EA
| 0x700000EA
| 010000000000D614
| 0x010000000000D614
| [17.0.0+] AeLibraryApplet1
| [17.0.0+] AeLibraryApplet1
|-
|-
| 0x700000EB
| 0x700000EB
| 010000000000D615
| 0x010000000000D615
| [17.0.0+] AeLibraryApplet2
| [17.0.0+] AeLibraryApplet2
|-
|-
| 0x700000EC
| 0x700000EC
| 010000000000D616
| 0x010000000000D616
| [17.0.0+] AeLibraryApplet3
| [17.0.0+] AeLibraryApplet3
|-
|-
| 0x700000ED
| 0x700000ED
| 010000000000D617
| 0x010000000000D617
| [17.0.0+] AeLibraryApplet4
| [17.0.0+] AeLibraryApplet4
|-
|-
| 0x700000F0
| 0x700000F0
| 010000000000D60A
| 0x010000000000D60A
| [17.0.0+] AppletISA
| [17.0.0+] AppletISA
|-
|-
| 0x700000F1
| 0x700000F1
| 010000000000D60B
| 0x010000000000D60B
| [17.0.0+] AppletIOA
| [17.0.0+] AppletIOA
|-
|-
| 0x700000F2
| 0x700000F2
| 010000000000D60C
| 0x010000000000D60C
| [17.0.0+] AppletISTA
| [17.0.0+] AppletISTA
|-
|-
| 0x700000F3
| 0x700000F3
| 010000000000D60D
| 0x010000000000D60D
| [17.0.0+] AppletILA1
| [17.0.0+] AppletILA1
|-
|-
| 0x700000F4
| 0x700000F4
| 010000000000D60E
| 0x010000000000D60E
| [17.0.0+] AppletILA2
| [17.0.0+] AppletILA2
|-
|-
| 0x700000FA
| 0x700000FA
| 010000000000D677
| 0x010000000000D677
| [20.1.0+]  
| [20.1.0+]  
|}
|}