Applet Manager services: Difference between revisions

No edit summary
 
(90 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+] 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 17: 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 24: Line 28:
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
|-
|-
| 450 || [19.0.0+] GetSystemProcessCommonFunctions ||  
| 450 || [19.0.0+] [[#GetSystemProcessCommonFunctions]] ||  
|-
| 460 || [20.0.0+] || Returns an [[#IAppletAlternativeFunctions]].
|-
| 500 || [S2] || Returns an [[#IChatProxy|IChatProxy]].
|-
|-
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
Line 60: Line 68:


The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, and various state checks must pass, otherwise 0 is returned with no output interface.
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, and various state checks must pass, otherwise 0 is returned with no output interface.
== GetSystemProcessCommonFunctions ==
No input. Returns an [[#ISystemProcessCommonFunctions]].


== GetDebugFunctions ==
== GetDebugFunctions ==
Line 269: Line 280:
|-
|-
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]
|-
| 100 || [S2]
|}
|}


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


=== ICradleFirmwareUpdater ===
=== ICradleFirmwareUpdater ===
Line 394: Line 410:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [[#GetAppletStateChangedEvent]]
|-
| 1 || [[#IsCompleted]]
|-
| 10 || [[#Start]]
|-
|-
| 0 || [[#GetAppletStateChangedEvent]] ||
| 20 || [[#RequestExit]]
|-
|-
| 1 || [[#IsCompleted]] ||
| 25 || [[#Terminate]]
|-
|-
| 10 || [[#Start]] ||
| 30 || [[#GetResult]]
|-
|-
| 20 || [[#RequestExit]] ||
| 101 || [[#RequestForApplicationToGetForeground]]  
|-
|-
| 25 || [[#Terminate]] ||
| 110 || [[#TerminateAllLibraryApplets]]
|-
|-
| 30 || [[#GetResult]] ||
| 111 || [[#AreAnyLibraryAppletsLeft]]  
|-
|-
| 101 || [[#RequestForApplicationToGetForeground]] ||
| 112 || [[#GetCurrentLibraryApplet]]  
|-
|-
| 110 || [[#TerminateAllLibraryApplets]] ||
| 120 || [[#GetApplicationId]]
|-
|-
| 111 || [[#AreAnyLibraryAppletsLeft]] ||
| 121 || [[#PushLaunchParameter]]  
|-
|-
| 112 || [[#GetCurrentLibraryApplet]] ||
| 122 || [[#GetApplicationControlProperty]]  
|-
|-
| 120 || [[#GetApplicationId]] ||
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]]  
|-
|-
| 121 || [[#PushLaunchParameter]] ||
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]]  
|-
|-
| 122 || [[#GetApplicationControlProperty]] ||
| 130 || [6.0.0+] [[#SetUsers]]
|-
|-
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]] ||
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]]
|-
|-
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]] ||
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]]  
|-
|-
| 130 || [6.0.0+] [[#SetUsers]] ||
| 140 || [6.0.0+] [[#GetDesirableUids]]
|-
|-
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]] ||
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]]  
|-
|-
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]] ||
| 160 || [8.0.0+] [[#SetApplicationAttribute]]
|-
|-
| 140 || [6.0.0+] [[#GetDesirableUids]] ||
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]]
|-
|-
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]] ||
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]]
|-
|-
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]]
|-
|-
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]]
|-
|-
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||
| 201 || [10.0.0+] [[#RestartApplicationTimer]]
|-
|-
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||
| 300 || [20.0.0+]
|-
|-
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]] ||
| 301 || [20.0.0+]
|-
|-
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||
| 310 || [21.0.0+]
|}
|}


Line 620: 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]
|-
|-
| 161 || [18.0.0+] GetNotificationSenderService
| 114 || [S2]
|-
|-
| 300 || [17.0.0+] GetCurrentApplicationId
| 115 || [S2]
|-
| 116 || [S2]
|-
| 117 || [S2]
|-
| 118 || [S2]
|-
| 119 || [S2]
|-
| 120 || [S2]
|-
|-
| 310 || [19.0.0+] IsSystemAppletHomeMenu
| 121 || [S2]
|-
|-
| 320 || [19.0.0+] SetGpuTimeSliceBoost
| 122 || [S2]
|-
|-
| 321 || [19.0.0+] SetGpuTimeSliceBoostDueToApplication
| 123 || [S2]
|-
|-
| 330 || [19.0.0+]  
| 124 || [S2]
|}
 
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>
 
=== 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]].
 
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
 
=== GetDisplayLogicalResolution ===
No input, returns an output s32 '''width''' and s32 '''height'''.
 
=== SetDisplayMagnification ===
Takes an input float '''x''', float '''y''', float '''width''', and float '''height''', no output.
 
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.
 
'''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.
 
=== SetHomeButtonDoubleClickEnabled ===
Takes an input u8 bool, no output.
 
=== GetHomeButtonDoubleClickEnabled ===
No input, returns an output u8 bool.
 
=== IsHomeButtonShortPressedBlocked ===
No input, returns an output u8 bool.
 
=== IsVrModeCurtainRequired ===
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
| 130 || [S2]
|-
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
| 131 || [S2] [20.0.0+]
|-
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
| 135 || [S2] [20.0.0+]
|-
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
| 140 || [S2]
|-
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
| 150 || [S2]
|-
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
| 160 || [18.0.0+] [[#GetNotificationReceiverService|GetNotificationReceiverService]]
|-
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
| 161 || [18.0.0+] [[#GetNotificationSenderService|GetNotificationSenderService]]
|-
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 170 || [S2]
|-
|-
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
| 171 || [S2]
|-
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
| 200 || [S2]
|-
|-
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
| 210 || [S2]
|-
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
| 211 || [S2]
|-
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 220 || [S2]
|}
 
=== ILibraryAppletSelfAccessor ===
This is "nn::am::service::ILibraryAppletSelfAccessor".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 221 || [S2]
|-
|-
| 0 || [[#PopInData]] ||
| 230 || [S2]
|-
|-
| 1 || [[#PushOutData]] ||
| 231 || [S2]
|-
|-
| 2 || [[#PopInteractiveInData]] ||
| 250 || [S2]
|-
|-
| 3 || [[#PushInteractiveOutData]] ||
| 251 || [S2]
|-
|-
| 5 || [[#GetPopInDataEvent]] ||
| 252 || [S2]
|-
|-
| 6 || [[#GetPopInteractiveInDataEvent]] ||
| 253 || [S2]
|-
|-
| 10 || [[#ExitProcessAndReturn]] ||
| 260 || [S2]
|-
|-
| 11 || [[#GetLibraryAppletInfo]] ||
| 271 || [S2] [20.0.0+]
|-
|-
| 12 || [[#GetMainAppletIdentityInfo]] ||
| 280 || [S2] [20.0.0+]
|-
|-
| 13 || [[#CanUseApplicationCore]] ||
| 290 || [S2] [20.0.0+] RequestChatProhibition
|-
|-
| 14 || [[#GetCallerAppletIdentityInfo]] ||
| 291 || [S2] [20.0.0+] RequestChatExpirationCheckSkip
|-
|-
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
| 300 || [17.0.0+] GetCurrentApplicationId
|-
|-
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
| 310 || [19.0.0+] IsSystemAppletHomeMenu
|-
|-
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||
| 311 || [20.0.0+]
|-
|-
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||
| 320 || [19.0.0+] SetGpuTimeSliceBoost
|-
|-
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||
| 321 || [19.0.0+] SetGpuTimeSliceBoostDueToApplication
|-
|-
| 20 || [[#PopExtraStorage]] ||
| 322 || [20.0.0+]
|-
|-
| 25 || [[#GetPopExtraStorageEvent]] ||
| 330 || [19.0.0+]  
|-
| 30 || [[#UnpopInData]] ||
|-
|-
| 31 || [[#UnpopExtraStorage]] ||
| 340 || [20.0.0+]
|-
|-
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||
| 341 || [20.0.0+]
|-
|-
| 50 || [3.0.0+] [[#ReportVisibleError]] ||
| 342 || [20.0.0+]
|-
|-
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||
| 350 || [20.0.0+]
|-
| 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]] ||
| 360 || [20.0.0+]
|-
|-
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
| 370 || [22.0.0+] GetGpuErrorEventForApplet
|-
|-
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
| 2000 || [S2]
|-
|-
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||
| 2010 || [S2]
|-
|-
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
| 3000 || [S2] [20.0.0+]
|-
|-
| 160 || [17.0.0+] [[#GetLibraryAppletInfoEx]] ||
| 3010 || [S2] [20.0.0+]
|}
|}


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


==== PushOutData ====
=== ReadThemeStorage ===
Takes an input [[#IStorage]], no output.
Takes an input u64 '''offset''' and a type-0x22 output buffer, returns an output u64 '''actual_transfer_size'''.


==== PopInteractiveInData ====
=== WriteThemeStorage ===
No input, returns an output [[#IStorage]].
Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.


==== PushInteractiveOutData ====
=== PushToAppletBoundChannel ===
Takes an input [[#IStorage]], no output.
Takes an input [[#IStorage]], no output.


==== GetPopInDataEvent ====
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
No input, returns an output Event handle with autoclear=false.
 
=== TryPopFromAppletBoundChannel ===
No input, returns an output [[#IStorage]].


==== GetPopInteractiveInDataEvent ====
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
No input, returns an output Event handle with autoclear=false.


==== ExitProcessAndReturn ====
=== GetDisplayLogicalResolution ===
No input/output.
No input, returns an output s32 '''width''' and s32 '''height'''.


Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).
=== SetDisplayMagnification ===
Takes an input float '''x''', float '''y''', float '''width''', and float '''height''', no output.


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.


==== GetLibraryAppletInfo ====
'''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.
No input, returns an output [[#LibraryAppletInfo]].


==== GetMainAppletIdentityInfo ====
=== SetHomeButtonDoubleClickEnabled ===
No input, returns an output [[#AppletIdentityInfo]].
Takes an input u8 bool, no output.


==== CanUseApplicationCore ====
=== GetHomeButtonDoubleClickEnabled ===
No input, returns an output u8 bool.
No input, returns an output u8 bool.


==== GetCallerAppletIdentityInfo ====
=== IsHomeButtonShortPressedBlocked ===
No input, returns an output [[#AppletIdentityInfo]].
No input, returns an output u8 bool.


==== GetMainAppletApplicationControlProperty ====
=== IsVrModeCurtainRequired ===
No input, takes a type-0x16 output buffer.
No input, returns an output bool.


This gets the [[NACP_Format|control.nacp]].
=== SetCpuBoostRequestPriority ===
Takes an input s32, no output.


==== GetMainAppletStorageId ====
=== GetNotificationReceiverService ===
No input, returns an output u8 storageId.
No input, returns an [[#IReceiverService|IReceiverService]].


==== GetCallerAppletIdentityInfoStack ====
=== GetNotificationSenderService ===
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.
No input, returns an [[#ISenderService|ISenderService]].


==== GetNextReturnDestinationAppletIdentityInfo ====
=== IReceiverService ===
No input, returns an output [[#AppletIdentityInfo]].
This is "nn::am::service::IReceiverService".


==== GetDesirableKeyboardLayout ====
This was added with [18.0.0+].
No input, returns an output u32.


The output u32 is "nn::settings::KeyboardLayout".
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|}


This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it's not set.
==== Cmd0 ====
No input, returns an [[#INotificationReceiver|INotificationReceiver]].


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


==== GetPopExtraStorageEvent ====
This was added with [18.0.0+].
No input, returns an output Event handle with autoclear=false.


==== UnpopInData ====
{| class="wikitable" border="1"
Takes an input [[#IStorage]], no output.
|-
! Cmd || Name
|-
| 0 || AddSource
|-
| 1 || RemoveSource
|-
| 2 || GetEvent
|-
| 3 || Receive
|-
| 4 || ReceiveWithTick
|}


==== UnpopExtraStorage ====
===== GetEvent =====
Takes an input [[#IStorage]], no output.
Unofficial name.


==== GetIndirectLayerProducerHandle ====
No input, returns an Event handle.
No input, returns an output u64.


==== ReportVisibleError ====
===== ReceiveWithTick =====
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.
Unofficial name.


==== ReportVisibleErrorWithErrorContext ====
=== ISenderService ===
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.
This is "nn::am::service::ISenderService".


==== GetMainAppletApplicationDesiredLanguage ====
This was added with [18.0.0+].
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].


==== GetCurrentApplicationId ====
{| class="wikitable" border="1"
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
|-
! Cmd || Name
|-
| 0 ||
|}


Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.
==== Cmd0 ====
Takes a total of 0x18-bytes of input, returns an [[#INotificationSender|INotificationSender]].


==== RequestExitToSelf ====
=== INotificationSender ===
No input/output.
This is "nn::am::service::INotificationSender".


Same as [[#RequestExit]] except this is for the current applet.
This was added with [18.0.0+].


==== CreateApplicationAndPushAndRequestToLaunch ====
{| class="wikitable" border="1"
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.
|-
! Cmd || Name
|-
| 0 || Send
|-
| 1 || GetUnreceivedMessageCount
|}


This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
== ILibraryAppletProxy ==
This is "nn::am::service::ILibraryAppletProxy".


==== CreateGameMovieTrimmer ====
{| class="wikitable" border="1"
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
|-
 
! Cmd || Name || Notes
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].
|-
 
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
Official sw uses an user-buffer for the tmem, with permissions=0.
|-
 
| 1 || GetSelfController || Returns an [[#ISelfController]].
==== ReserveResourceForMovieOperation ====
|-
No input/output.
| 2 || GetWindowController || Returns an [[#IWindowController]].
 
|-
Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].
| 3 || GetAudioController || Returns an [[#IAudioController]].
 
|-
==== UnreserveResourceForMovieOperation ====
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
No input/output.
|-
 
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
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"
|-
|-
! Cmd || Name || Notes
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
|-
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
|-
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}
 
=== ILibraryAppletSelfAccessor ===
This is "nn::am::service::ILibraryAppletSelfAccessor".
 
{| class="wikitable" border="1"
|-
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
! Cmd || Name || Notes
|-
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 0 || [[#PopInData]] ||
|-
|-
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
| 1 || [[#PushOutData]] ||
|-
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
| 2 || [[#PopInteractiveInData]] ||
|-
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
| 3 || [[#PushInteractiveOutData]] ||
|-
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 5 || [[#GetPopInDataEvent]] ||
|}
 
=== IOverlayFunctions ===
This is "nn::am::service::IOverlayFunctions".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 6 || [[#GetPopInteractiveInDataEvent]] ||
|-
|-
| 0 || [[#BeginToWatchShortHomeButtonMessage]]
| 10 || [[#ExitProcessAndReturn]] ||
|-
|-
| 1 || [[#EndToWatchShortHomeButtonMessage]]
| 11 || [[#GetLibraryAppletInfo]] ||
|-
|-
| 2 || [[#GetApplicationIdForLogo]]
| 12 || [[#GetMainAppletIdentityInfo]] ||
|-
|-
| 3 || [[#SetGpuTimeSliceBoost]]
| 13 || [[#CanUseApplicationCore]] ||
|-
|-
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]
| 14 || [[#GetCallerAppletIdentityInfo]] ||
|-
|-
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
|-
|-
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
|-
|-
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||
|-
|-
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||
|-
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||
|-
| 20 || [[#PopExtraStorage]] ||
|-
| 25 || [[#GetPopExtraStorageEvent]] ||
|-
| 30 || [[#UnpopInData]] ||
|-
| 31 || [[#UnpopExtraStorage]] ||
|-
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||
|-
|-
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
| 50 || [3.0.0+] [[#ReportVisibleError]] ||
|-
|-
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||
|-
|-
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||
|-
|-
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||
|-
|-
| 40 || [18.0.0+] GetApplicationNintendoLogo
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||
|-
|-
| 41 || [18.0.0+] GetApplicationStartupMovie
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||
|-
|-
| 50 || [19.0.0+] SetGpuTimeSliceBoostForApplication
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||
|-
|-
| 60 || [19.0.0+]  
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||
|-
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||
|-
|-
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
|}
|-
 
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
==== BeginToWatchShortHomeButtonMessage ====
|-
No input/output.
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
 
|-
==== EndToWatchShortHomeButtonMessage ====
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||
No input/output.
|-
 
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
==== GetApplicationIdForLogo ====
|-
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
| 160 || [17.0.0+] [[#GetLibraryAppletInfoEx]] ||
|}


Gets the ApplicationId for displaying the logo screen during application launch.
==== PopInData ====
No input, returns an output [[#IStorage]].


When no application is running, this returns success with ApplicationId=0.
==== PushOutData ====
Takes an input [[#IStorage]], no output.


==== SetGpuTimeSliceBoost ====
==== PopInteractiveInData ====
Takes an input u64, no output.
No input, returns an output [[#IStorage]].


==== SetAutoSleepTimeAndDimmingTimeEnabled ====
==== PushInteractiveOutData ====
Takes an input u8 bool, no output.
Takes an input [[#IStorage]], no output.


==== TerminateApplicationAndSetReason ====
==== GetPopInDataEvent ====
Takes an input u32 Result, no output.
No input, returns an output Event handle with autoclear=false.


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


==== StartShutdownSequenceForOverlay ====
==== ExitProcessAndReturn ====
No input/output.
No input/output.


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).
 
==== StartRebootSequenceForOverlay ====
No input/output.


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.


==== SetHandlingHomeButtonShortPressedEnabled ====
==== GetLibraryAppletInfo ====
Takes an input u8 bool, no output.
No input, returns an output [[#LibraryAppletInfo]].
 
==== GetMainAppletIdentityInfo ====
No input, returns an output [[#AppletIdentityInfo]].


==== SetHealthWarningShowingState ====
==== CanUseApplicationCore ====
Takes an input u8 bool, no output.
No input, returns an output u8 bool.


This writes the input bool into state, signals an Event, and returns 0.
==== GetCallerAppletIdentityInfo ====
No input, returns an output [[#AppletIdentityInfo]].


==== IsHealthWarningRequired ====
==== GetMainAppletApplicationControlProperty ====
No input, returns an output u8 bool.
No input, takes a type-0x16 output buffer.


==== SetRequiresGpuResourceUse ====
This gets the [[NACP_Format|control.nacp]].
Takes an input u8 bool, no output.


Just returns 0.
==== GetMainAppletStorageId ====
No input, returns an output u8 storageId.


==== BeginToObserveHidInputForDevelop ====
==== GetCallerAppletIdentityInfoStack ====
No input/output.
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.


Sets various state fields and signals an userspace-event.
==== GetNextReturnDestinationAppletIdentityInfo ====
No input, returns an output [[#AppletIdentityInfo]].


Enables HID input for the OverlayApplet, without disabling input for the foreground applet.
==== GetDesirableKeyboardLayout ====
No input, returns an output u32.


== IApplicationProxy ==
The output u32 is "nn::settings::KeyboardLayout".
This is "nn::am::service::IApplicationProxy".


{| class="wikitable" border="1"
This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it's not set.
|-
 
! Cmd || Name || Notes
==== PopExtraStorage ====
|-
No input, returns an output [[#IStorage]].
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
 
|-
==== GetPopExtraStorageEvent ====
| 1 || GetSelfController || Returns an [[#ISelfController]].
No input, returns an output Event handle with autoclear=false.
|-
 
| 2 || GetWindowController || Returns an [[#IWindowController]].
==== UnpopInData ====
|-
Takes an input [[#IStorage]], no output.
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
| 20 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}


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


{| class="wikitable" border="1"
==== GetIndirectLayerProducerHandle ====
|-
No input, returns an output u64.
! Cmd || Name
 
|-
==== ReportVisibleError ====
| 1 || [[#PopLaunchParameter]]
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.
|-
 
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
==== ReportVisibleErrorWithErrorContext ====
|-
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
 
|-
==== GetMainAppletApplicationDesiredLanguage ====
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
|-
 
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
==== GetCurrentApplicationId ====
|-
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
 
|-
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
 
|-
==== RequestExitToSelf ====
| 20 || [[#EnsureSaveData]]
No input/output.
|-
 
| 21 || [[#GetDesiredLanguage]]
Same as [[#RequestExit]] except this is for the current applet.
|-
 
| 22 || [[#SetTerminateResult]]
==== CreateApplicationAndPushAndRequestToLaunch ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.
| 23 || [[#GetDisplayVersion]]
 
|-
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
 
|-
==== CreateGameMovieTrimmer ====
| 25 || [3.0.0+] ExtendSaveData
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
|-
 
| 26 || [3.0.0+] GetSaveDataSize
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].
|-
 
| 27 || [5.0.0+] CreateCacheStorage
Official sw uses an user-buffer for the tmem, with permissions=0.
|-
 
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
==== ReserveResourceForMovieOperation ====
|-
No input/output.
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
 
|-
Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
 
|-
==== UnreserveResourceForMovieOperation ====
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
No input/output.
|-
 
| 32 || [[#BeginBlockingHomeButton]]
Updates state fields. This must be used once finished with [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
|-
 
| 33 || [[#EndBlockingHomeButton]]
==== GetMainAppletAvailableUsers ====
|-
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 '''total_entries'''.
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
 
|-
This gets the userIDs previously set by [[#SetUsers]].
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
 
|-
The size of the output buffer in entries must be at least 8.
| 36 || [14.0.0+] GetLimitedApplicationLicense
 
|-
Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
 
==== 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"
|-
|-
| 40 || [[#NotifyRunning]]
! Cmd || Name || Notes
|-
|-
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
|-
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
|-
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
|-
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
|-
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
|-
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
|-
| 70 || [3.0.0+] [[#RequestToShutdown]]
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 71 || [3.0.0+] [[#RequestToReboot]]
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
|-
|-
| 72 || [10.0.0+] [[#RequestToSleep]]
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
|-
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
|-
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}
 
=== IOverlayFunctions ===
This is "nn::am::service::IOverlayFunctions".
 
{| class="wikitable" border="1"
|-
|-
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]
! Cmd || Name
|-
|-
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
| 0 || [[#BeginToWatchShortHomeButtonMessage]]
|-
|-
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
| 1 || [[#EndToWatchShortHomeButtonMessage]]
|-
|-
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
| 2 || [[#GetApplicationIdForLogo]]
|-
|-
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
| 3 || [[#SetGpuTimeSliceBoost]]
|-
|-
| 120 || [5.0.0+] [[#ExecuteProgram]]
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]
|-
|-
| 121 || [5.0.0+] [[#ClearUserChannel]]
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]
|-
|-
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]
|-
|-
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]
|-
|-
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]
|-
|-
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
|-
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled
|-
|-
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
|-
|-
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]  
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
|-
|-
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
| 40 || [18.0.0+] GetApplicationNintendoLogo
|-
|-
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
| 41 || [18.0.0+] GetApplicationStartupMovie
|-
|-
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
| 50 || [19.0.0+] SetGpuTimeSliceBoostForApplication
|-
|-
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]
| 60 || [19.0.0+]  
|-
|-
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]
| 61 || [S2]
|-
|-
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]
| 70 || [21.0.0+]  
|-
|-
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]
| 71 || [21.0.0+]  
|-
|-
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
| 75 || [21.0.0+]  
|-
|-
| 300 || [19.0.0+] CreateMovieWriter
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
|-
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
|-
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]]
| 110 || [S2]
|-
|-
| 1001 || [5.0.0+] [[#PrepareForJit]]
| 1000 || [S2]
|}
|}


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):
==== BeginToWatchShortHomeButtonMessage ====
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
No input/output.
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.
* Closes the TransferMemory handle, + TransferMemory cleanup.
* Uses [[#SetGamePlayRecordingState]] with value 0x1.
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].


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


Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.
==== GetApplicationIdForLogo ====
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].


==== CreateApplicationAndPushAndRequestToStart ====
Gets the ApplicationId for displaying the logo screen during application launch.
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.


==== CreateApplicationAndPushAndRequestToStartForQuest ====
When no application is running, this returns success with ApplicationId=0.
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.


==== CreateApplicationAndRequestToStart ====
==== SetGpuTimeSliceBoost ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes an input u64, no output.


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


==== CreateApplicationAndRequestToStartForQuest ====
==== TerminateApplicationAndSetReason ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes an input u32 Result, no output.


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


==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
==== StartShutdownSequenceForOverlay ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
No input/output.


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


==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
==== StartRebootSequenceForOverlay ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
No input/output.


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


==== EnsureSaveData ====
==== SetHandlingHomeButtonShortPressedEnabled ====
Takes an input u128 userID, returns an output u64 size.
Takes an input u8 bool, no output.


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


Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
This writes the input bool into state, signals an Event, and returns 0.


Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
==== IsHealthWarningRequired ====
No input, returns an output u8 bool.


==== GetDesiredLanguage ====
==== SetRequiresGpuResourceUse ====
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
Takes an input u8 bool, no output.


==== SetTerminateResult ====
Just returns 0.
Takes an input u32 '''Result''', no output.


For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.
==== BeginToObserveHidInputForDevelop ====
No input/output.


==== GetDisplayVersion ====
Sets various state fields and signals an userspace-event.
No input, returns an output 0x10-byte struct.


The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.
Enables HID input for the OverlayApplet, without disabling input for the foreground applet.


==== GetLaunchStorageInfoForDebug ====
== ICMenuProxy ==
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
This is "nn::am::service::ICMenuProxy".


This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
This is exclusive to Switch 2.


==== GetSaveDataSizeMax ====
{| class="wikitable" border="1"
No input, returns two ouput s64s.
|-
! 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]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
|-
| 21 || GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 23 || GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
| 24 || || No input, returns an [[#ICMenuFunctions|ICMenuFunctions]].
|}


==== GetCacheStorageMax ====
=== ICMenuFunctions ===
No input, returns an output s32 and s64.
This is "nn::am::service::ICMenuFunctions".


==== BeginBlockingHomeButtonShortAndLongPressed ====
This is exclusive to Switch 2.
Takes an input s64, no output.


Official user-processes use hard-coded value 0 for the s64.
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|-
| 1 ||
|-
| 2 ||
|-
| 3 ||
|-
| 4 ||
|-
| 5 ||
|-
| 6 ||
|-
| 10 ||
|-
| 11 ||
|-
| 20 ||
|-
| 21 ||
|-
| 30 ||
|-
| 31 ||
|-
| 40 ||
|-
| 41 ||
|-
| 50 ||
|-
| 60 ||
|-
| 61 ||
|-
| 90 ||
|-
| 101 ||
|-
| 110 ||
|-
| 1000 ||
|-
| 200 ||
|-
| 202 ||
|-
| 210 || [20.0.0+]
|-
| 220 || [20.0.0+]
|}


Starts blocking the Home button.
==== Cmd200 ====
No input, returns an [[#ILibraryAppletAgent|ILibraryAppletAgent]].


==== EndBlockingHomeButtonShortAndLongPressed ====
==== Cmd202 ====
No input/output.
Takes {...}, returns an [[#IFocusableLayer|IFocusableLayer]].


Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].
==== ILibraryAppletAgent ====
This is "nn::am::service::ILibraryAppletAgent".


==== BeginBlockingHomeButton ====
This is exclusive to Switch 2.
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.


==== EndBlockingHomeButton ====
{| class="wikitable" border="1"
No input/output.
|-
 
! Cmd || Name
==== SelectApplicationLicense ====
|-
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].
| 0 ||
|-
| 1 ||
|-
| 2 ||
|-
| 3 ||
|-
| 4 ||
|-
| 5 ||
|-
| 10 ||
|-
| 20 ||
|-
| 21 ||
|-
| 31 ||
|-
| 32 ||
|-
| 33 ||
|-
| 34 ||
|-
| 35 ||
|-
| 40 ||
|-
| 41 ||
|-
| 42 ||
|}


==== GetDeviceSaveDataSizeMax ====
===== Cmd0 =====
No input, returns two output s64s.
No input, returns an [[#IStorage|IStorage]].


==== NotifyRunning ====
===== Cmd1 =====
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.
Takes an unknown input interface, no output.


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


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.
===== Cmd3 =====
Takes an unknown input interface, no output.


==== SetMediaPlaybackStateForApplication ====
===== Cmd10 =====
Takes an input u8 bool, no output.
No input, returns an [[#IStorage|IStorage]].


==== IsGamePlayRecordingSupported ====
===== Cmd20 =====
No input, returns an output u8 bool.
Takes an unknown input interface, no output.


==== InitializeGamePlayRecording ====
===== Cmd21 =====
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.
Takes an unknown input interface, no output.


==== SetGamePlayRecordingState ====
==== IFocusableLayer ====
Takes an input u32. 0 = disable/pause, 1 = enable/restart.
This is "nn::am::service::IFocusableLayer".


==== RequestFlushGamePlayingMovieForDebug ====
This is exclusive to Switch 2.
No input/output.


Requests to save the video recording, as if the Capture-button was held.
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|-
| 1 ||
|-
| 2 ||
|-
| 3 ||
|-
| 4 ||
|-
| 10 ||
|-
| 11 ||
|-
| 20 ||
|-
| 21 ||
|-
| 32 ||
|-
| 33 ||
|-
| 40 ||
|-
| 41 ||
|-
| 42 ||
|-
| 50 || [20.0.0+]
|-
| 51 || [20.0.0+]
|-
| 60 || [20.0.0+]
|-
| 70 || [20.0.0+]
|-
| 71 || [20.0.0+]
|}


==== RequestToShutdown ====
== IApplicationProxy ==
No input/output.
This is "nn::am::service::IApplicationProxy".


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
{| class="wikitable" border="1"
 
|-
==== RequestToReboot ====
! Cmd || Name || Notes
No input/output.
|-
 
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
|-
 
| 1 || GetSelfController || Returns an [[#ISelfController]].
==== RequestToSleep ====
|-
No input/output.
| 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 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].
|-
| 40 || [S2] || Returns an [[#IPerformanceFunctions|IPerformanceFunctions]].
|-
| 60 || [S2] || Returns an [[#IGraphicsScalingParametersFunctions|IGraphicsScalingParametersFunctions]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}


==== ExitAndRequestToShowThanksMessage ====
=== IApplicationFunctions ===
No input/output.
This is "nn::am::service::IApplicationFunctions".


Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.
{| class="wikitable" border="1"
 
|-
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
! Cmd || Name
 
|-
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
| 1 || [[#PopLaunchParameter]]
 
|-
==== EnableApplicationCrashReport ====
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
Takes an input u8 bool, no output.
|-
 
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
==== InitializeApplicationCopyrightFrameBuffer ====
|-
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
 
|-
tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
 
|-
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
 
|-
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
 
|-
This is used as an overlay for screenshots.
| 20 || [[#EnsureSaveData]]
 
|-
==== SetApplicationCopyrightImage ====
| 21 || [[#GetDesiredLanguage]]
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.
|-
 
| 22 || [[#SetTerminateResult]]
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
|-
 
| 23 || [[#GetDisplayVersion]]
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.
|-
 
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
==== SetApplicationCopyrightVisibility ====
|-
Takes an input u8 bool, no output.
| 25 || [3.0.0+] ExtendSaveData
 
|-
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.
| 26 || [3.0.0+] GetSaveDataSize
 
|-
==== QueryApplicationPlayStatistics ====
| 27 || [5.0.0+] CreateCacheStorage
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.
|-
 
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
The number of entries in each array is the same.
|-
 
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
|-
 
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.
|-
 
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
==== 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.
| 32 || [[#BeginBlockingHomeButton]]
 
|-
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.
| 33 || [[#EndBlockingHomeButton]]
 
|-
==== ExecuteProgram ====
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.
|-
 
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
==== ClearUserChannel ====
|-
No input/output.
| 36 || [14.0.0+] GetLimitedApplicationLicense
 
|-
Clears the UserChannel used by [[#UnpopToUserChannel]].
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
 
|-
==== UnpopToUserChannel ====
| 40 || [[#NotifyRunning]]
Takes an input [[#IStorage]], no output.
|-
 
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
|-
 
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
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.
|-
 
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
==== GetPreviousProgramIndex ====
|-
No input, returns an output s32.
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
 
|-
Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
 
|-
==== EnableApplicationAllThreadDumpOnCrash ====
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
Takes an input u8 bool, no output.
|-
 
| 70 || [3.0.0+] [[#RequestToShutdown]]
==== GetGpuErrorDetectedSystemEvent ====
|-
No input, returns an output Event handle with autoclear=false.
| 71 || [3.0.0+] [[#RequestToReboot]]
 
|-
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.
| 72 || [10.0.0+] [[#RequestToSleep]]
 
|-
==== SetDelayTimeToAbortOnGpuError ====
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
Takes an input s64 "nn::TimeSpan", no output.
|-
 
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
==== GetFriendInvitationStorageChannelEvent ====
|-
No input, returns an output Event handle with EventClearMode=0.
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]  
 
|-
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.
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
 
|-
==== TryPopFromFriendInvitationStorageChannel ====
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
No input, returns an output [[#IStorage]].
|-
 
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].
|-
 
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
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.
|-
 
| 112 || [20.0.0+]
==== GetNotificationStorageChannelEvent ====
|-
No input, returns an output Event handle with EventClearMode=0.
| 113 || [20.0.0+]
 
|-
This is exposed by sdknso under <code>nn::notification::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.
| 120 || [5.0.0+] [[#ExecuteProgram]]
 
|-
==== TryPopFromNotificationStorageChannel ====
| 121 || [5.0.0+] [[#ClearUserChannel]]
No input, returns an output [[#IStorage]].
|-
 
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
|-
 
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
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.
|-
 
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
==== GetHealthWarningDisappearedSystemEvent ====
|-
No input, returns an output Event with EventClearMode=0.
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
 
|-
==== SetHdcpAuthenticationActivated ====
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
Takes an input u8 bool, no output.
|-
 
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
==== GetLaunchRequiredVersion ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]
 
|-
sdknso passes hard-coded value 0 for the u64.
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
 
|-
==== UpgradeLaunchRequiredVersion ====
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.
|-
 
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
sdknso passes hard-coded value 0 for the u64.
|-
| 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]]
|}


==== SendServerMaintenanceOverlayNotification ====
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):
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.
* [[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]].


The second input value can optionally be 0.
==== PopLaunchParameter ====
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].


==== GetLastApplicationExitReason ====
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.
No input, returns an output s32.


==== StartContinuousRecordingFlushForDebug ====
==== CreateApplicationAndPushAndRequestToStart ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.


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.
==== CreateApplicationAndPushAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.


==== CreateMovieMaker ====
==== CreateApplicationAndRequestToStart ====
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.


Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
==== CreateApplicationAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== PrepareForJit ====
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
Takes no input. Launches the [[JIT_services|jit-sysmodule]] via [[NS_Services|ns]] LaunchLibraryApplet if it has not already been launched for the current application, storing a std::shared_ptr<> for jit-sysmodule process tracking object as an IApplicationFunctions member.


~IApplicationFunctions() includes:
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.


    if (this->jit_process) {
[21.0.0+] Now returns an output [[#IStorage]].
        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.
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]].


AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.


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


{| class="wikitable" border="1"
==== EnsureSaveData ====
|-
Takes an input u128 userID, returns an output u64 size.
! Cmd || Name
|-
| 0 || [[#GetGrcMovieMaker]]
|-
| 1 || [[#GetLayerHandle]]
|}


==== GetGrcMovieMaker ====
Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.
No input, returns a GRC [[GRC_services|IMovieMaker]].


==== GetLayerHandle ====
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
No input, returns an output u64.


== ILibraryAppletCreator ==
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
This is "nn::am::service::ILibraryAppletCreator".


{| class="wikitable" border="1"
==== GetDesiredLanguage ====
|-
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
! Cmd || Name || Notes
|-
| 0 || [[#CreateLibraryApplet]] ||
|-
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
| 10 || [[#CreateStorage]] ||  
|-
| 11 || [[#CreateTransferMemoryStorage]] ||
|-
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
|}


=== CreateLibraryApplet ===
==== SetTerminateResult ====
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
Takes an input u32 '''Result''', no output.


=== TerminateAllLibraryApplets ===
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.
No input/output.


Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
==== GetDisplayVersion ====
No input, returns an output 0x10-byte struct.


Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.


=== AreAnyLibraryAppletsLeft ===
==== GetLaunchStorageInfoForDebug ====
No input, returns an output u8 bool.
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].


Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].


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).
==== GetSaveDataSizeMax ====
No input, returns two ouput s64s.
 
==== GetCacheStorageMax ====
No input, returns an output s32 and s64.


=== CreateStorage ===
==== BeginBlockingHomeButtonShortAndLongPressed ====
Takes an input s64 for the storage size, returns an [[#IStorage]].
Takes an input s64, no output.
 
Official user-processes use hard-coded value 0 for the s64.


This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
Starts blocking the Home button.


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


The user-process creates the TransferMemory with permissions=0.
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].


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.
==== BeginBlockingHomeButton ====
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.


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


The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
==== SelectApplicationLicense ====
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].


=== ILibraryAppletAccessor ===
==== GetDeviceSaveDataSizeMax ====
This is "nn::am::service::ILibraryAppletAccessor".
No input, returns two output s64s.


{| class="wikitable" border="1"
==== NotifyRunning ====
|-
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.
! 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 ||
|-
| 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.
==== GetPseudoDeviceId ====
No input, returns an output 0x10-byte "nn::util::Uuid" struct.


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


Official sw will assert prior to using this if applet-service was not initialized as *Application.
==== IsGamePlayRecordingSupported ====
No input, returns an output u8 bool.
 
==== InitializeGamePlayRecording ====
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.
 
==== SetGamePlayRecordingState ====
Takes an input u32. 0 = disable/pause, 1 = enable/restart.


==== PresetLibraryAppletGpuTimeSliceZero ====
==== RequestFlushGamePlayingMovieForDebug ====
No input/output.
No input/output.


sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.
Requests to save the video recording, as if the Capture-button was held.


==== PushInData ====
==== RequestToShutdown ====
Takes an input [[#IStorage]], no output.
No input/output.


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


==== PushExtraStorage ====
==== RequestToReboot ====
Takes an input [[#IStorage]], no output.
No input/output.


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


==== PopInteractiveOutData ====
==== RequestToSleep ====
No input, returns an output [[#IStorage]].
No input/output.


==== GetPopOutDataEvent ====
==== ExitAndRequestToShowThanksMessage ====
No input, returns an output handle with autoclear=false.
No input/output.


==== GetPopInteractiveOutDataEvent ====
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.
No input, returns an output event handle with autoclear=false.


==== NeedsToExitProcess ====
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
No input, returns an output u8 bool.
 
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
 
==== EnableApplicationCrashReport ====
Takes an input u8 bool, no output.
 
==== InitializeApplicationCopyrightFrameBuffer ====
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.
 
tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.
 
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.


Stubbed, just returns an error.
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.


==== RequestForAppletToGetForeground ====
This is used as an overlay for screenshots.
No input/output.


Stubbed, just returns an error.
==== SetApplicationCopyrightImage ====
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.


==== GetIndirectLayerConsumerHandle ====
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.


Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.


== ICommonStateGetter ==
==== SetApplicationCopyrightVisibility ====
This is "nn::am::service::ICommonStateGetter".
Takes an input u8 bool, no output.


{| class="wikitable" border="1"
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.
|-
 
! Cmd || Name
==== QueryApplicationPlayStatistics ====
|-
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.
| 0 || [[#GetEventHandle]]
 
|-
The number of entries in each array is the same.
| 1 || [[#ReceiveMessage]]
 
|-
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
| 2 || [[#GetThisAppletKind]]
 
|-
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.
| 3 || [[#AllowToEnterSleep]]
 
|-
==== QueryApplicationPlayStatisticsByUid ====
| 4 || [[#DisallowToEnterSleep]]
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.
|-
 
| 5 || [[#GetOperationMode]]
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.
|-
 
| 6 || [[#GetPerformanceMode]]
==== ExecuteProgram ====
|-
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.
| 7 || [[#GetCradleStatus]]
 
|-
==== ClearUserChannel ====
| 8 || [[#GetBootMode]]
No input/output.
|-
 
| 9 || [[#GetCurrentFocusState]]
Clears the UserChannel used by [[#UnpopToUserChannel]].
|-
 
| 10 || [[#RequestToAcquireSleepLock]]
==== UnpopToUserChannel ====
|-
Takes an input [[#IStorage]], no output.
| 11 || [[#ReleaseSleepLock]]
 
|-
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
| 12 || [[#ReleaseSleepLockTransiently]]
 
|-
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.
| 13 || [[#GetAcquiredSleepLockEvent]]
 
|-
==== GetPreviousProgramIndex ====
| 14 || [11.0.0+] [[#GetWakeupCount]]
No input, returns an output s32.
|-
 
| 15 || [19.0.0+]
Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.
|-
 
| 20 || [[#PushToGeneralChannel]]
==== EnableApplicationAllThreadDumpOnCrash ====
|-
Takes an input u8 bool, no output.
| 30 || [[#GetHomeButtonReaderLockAccessor]]
 
|-
==== GetGpuErrorDetectedSystemEvent ====
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
No input, returns an output Event handle with autoclear=false.
|-
 
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
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.
|-
 
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
==== SetDelayTimeToAbortOnGpuError ====
|-
Takes an input s64 "nn::TimeSpan", no output.
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
 
|-
==== GetFriendInvitationStorageChannelEvent ====
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
No input, returns an output Event handle with EventClearMode=0.
|-
 
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
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.
|-
 
| 53 || [7.0.0+] [[#BeginVrModeEx]]
==== TryPopFromFriendInvitationStorageChannel ====
|-
No input, returns an output [[#IStorage]].
| 54 || [7.0.0+] [[#EndVrModeEx]]
 
|-
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
 
|-
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.
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
 
|-
==== GetNotificationStorageChannelEvent ====
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
No input, returns an output Event handle with EventClearMode=0.
|-
 
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
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.
|-
 
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
==== TryPopFromNotificationStorageChannel ====
|-
No input, returns an output [[#IStorage]].
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
 
|-
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
 
|-
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.
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
 
|-
==== GetHealthWarningDisappearedSystemEvent ====
| 66 || [6.0.0+] [[#SetCpuBoostMode]]
No input, returns an output Event with EventClearMode=0.
|-
 
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]
==== SetHdcpAuthenticationActivated ====
|-
Takes an input u8 bool, no output.
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]
 
|-
==== GetLaunchRequiredVersion ====
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].
|-
 
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]
sdknso passes hard-coded value 0 for the u64.
|-
 
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
==== UpgradeLaunchRequiredVersion ====
|-
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]
|-
| 120 || [13.0.0+] GetAppletLaunchedHistory
|-
| 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 || [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]]).
sdknso passes hard-coded value 0 for the u64.


[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.
==== SendServerMaintenanceOverlayNotification ====
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.


=== GetEventHandle ===
The second input value can optionally be 0.
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].


=== ReceiveMessage ===
==== GetLastApplicationExitReason ====
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.
No input, returns an output s32.


=== GetThisAppletKind ===
==== Cmd210 ====
No input, returns an output [[#AppletKind]].
No input, returns an output Event handle.


Stubbed, just returns an error.
==== SetAudioOutputPolicy ====
Takes an input u8, no output.


=== AllowToEnterSleep ===
The input must be <=1.
No input/output.


Stubbed, just returns an error.
==== CreateMovieWriter ====
Takes 8-bytes of input and a handle. Returns an [[#IMovieWriter]].


=== DisallowToEnterSleep ===
This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.
No input/output.


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


=== GetOperationMode ===
[21.0.0+] Now additionally takes a total of 0x18-bytes of input.
No input. Returns an output u8 for the current [[#OperationMode]].


=== GetPerformanceMode ===
==== IsLanguageSelectionLimited ====
No input. Returns an output u32 for the current [[#PerformanceMode]].
No input, returns 1-byte of output.


=== GetCradleStatus ===
On NX this just writes 0 to output and returns 0.
No input, returns an output u8.


This uses [[#omm]] GetCradleStatus.
==== StartContinuousRecordingFlushForDebug ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.


=== GetBootMode ===
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 u8.


Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
==== CreateMovieMaker ====
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].


=== GetCurrentFocusState ===
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
No input. Returns an output u8 [[#FocusState]].


=== RequestToAcquireSleepLock ===
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/output.


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


=== ReleaseSleepLockTransiently ===
~IApplicationFunctions() includes:
No input/output.


=== GetAcquiredSleepLockEvent ===
    if (this->jit_process) {
No input, returns an output Event handle with autoclear=false.
        Terminate(this->jit_process);
        this->jit_process = nullptr;
    }


=== GetWakeupCount ===
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.
No input, returns an output u64.


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


This is not usable under an Application, however it is usable under a LibraryApplet.
[S2] This is no longer usable since this returns Result 0x408 (sysmodule doesn't exist).


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:
=== IMovieWriter ===
* <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.
This is "nn::am::service::IMovieWriter".
* <code>RequestJumpToSystemUpdate</code> <code>5341 4d53 0100 0000 0b00 0000 0100 0000</code> Equivalent to entering "System Update" under System Settings. When leaving this, it returns to the main Home Menu.


=== GetHomeButtonReaderLockAccessor ===
This was added with [19.0.0+].
No input, returns an output [[#ILockAccessor]].


Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|}


=== GetReaderLockAccessorEx ===
==== Cmd0 ====
Takes an input u32, returns an output [[#ILockAccessor]].
No input. Returns a GRC [[GRC_services|IMovieWriter]].


The input value must be 0-3. 0 = HomeButton.
=== IMovieMaker ===
This is "nn::am::service::IMovieMaker".


=== GetWriterLockAccessorEx ===
{| class="wikitable" border="1"
Takes an input u32, returns an output [[#ILockAccessor]].
|-
! Cmd || Name
|-
| 0 || [[#GetGrcMovieMaker]]
|-
| 1 || [[#GetLayerHandle]]
|}


The input value must be 0-3. 0 = HomeButton.
==== GetGrcMovieMaker ====
No input, returns a GRC [[GRC_services|IMovieMaker]].


=== GetCradleFwVersion ===
==== GetLayerHandle ====
No input, returns 4 output u32s.
No input, returns an output u64.


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


=== IsVrModeEnabled ===
This is exclusive to Switch 2.
No input, returns an output u8 bool.


=== SetVrModeEnabled ===
{| class="wikitable" border="1"
Takes an input u8 bool flag. No output.
|-
 
! Cmd || Name
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}.
|-
| 0 || IsCpuOverclockEnabled
|-
| 1 || SetCpuOverclockEnabled
|}


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


=== SetLcdBacklighOffEnabled ===
This is exclusive to Switch 2.
Takes an input u8 bool, no output.


Sets whether the LCD screen blacklight is turned off.
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 10 || GetGraphicsScalingParameters
|-
| 1000 || SetSupportingGraphicsScalingParametersForDebug
|-
| 1010 || SetGpuQuotaForDebug
|-
| 1020 || ClearGpuQuotaForDebug
|-
| 1030 || SetScreenRatioForDebug
|-
| 1040 || ClearScreenRatioForDebug
|-
| 1050 || SetGraphicsScaleChangedNotificationEnabled
|}


=== BeginVrModeEx ===
== ILibraryAppletCreator ==
No input/output.
This is "nn::am::service::ILibraryAppletCreator".


Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#CreateLibraryAppletOld|CreateLibraryAppletOld]] ([1.0.0-19.0.1] CreateLibraryApplet) ||
|-
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
| 3 || [20.0.0+] [[#CreateLibraryApplet|CreateLibraryApplet]] ||
|-
| 10 || [[#CreateStorage]] ||
|-
| 11 || [[#CreateTransferMemoryStorage]] ||
|-
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
|}


=== EndVrModeEx ===
=== CreateLibraryAppletOld ===
No input/output.
Unofficial name.


Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].


=== IsInControllerFirmwareUpdateSection ===
=== TerminateAllLibraryApplets ===
No input, returns an output u8 bool.
No input/output.


=== SetVrPositionForDebug ===
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
Takes 4 input s32s, no output.


The s32s are: x, y, width, height.
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).


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


width must be 1-1280, height must be 1-720.
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.


x and y must not be negative. x+width must be <=1280. y+height must be <=720.
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).


=== GetDefaultDisplayResolution ===
=== CreateLibraryApplet ===
No input, returns two output s32s '''width''' and '''height'''.
Unofficial name.


=== GetDefaultDisplayResolutionChangeEvent ===
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], an u64 ThreadId, returns an [[#ILibraryAppletAccessor]].
No input, returns an output Event handle with autoclear=true.


=== GetHdcpAuthenticationState ===
The ThreadId is from the current-thread of the user-process which is using the cmd.
No input, returns an output s32.


=== GetHdcpAuthenticationStateChangeEvent ===
=== CreateStorage ===
No input, returns an output Event handle with autoclear=true.
Takes an input s64 for the storage size, returns an [[#IStorage]].


=== SetTvPowerStateMatchingMode ===
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.


=== GetApplicationIdByContentActionName ===
=== CreateTransferMemoryStorage ===
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].


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).
The user-process creates the TransferMemory with permissions=0.


=== SetCpuBoostMode ===
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.
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].


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


=== GetBuiltInDisplayType ===
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
No input, returns an output s32.


This is not exposed by sdknso.
=== ILibraryAppletAccessor ===
This is "nn::am::service::ILibraryAppletAccessor".


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].
{| class="wikitable" border="1"
 
|-
=== PerformSystemButtonPressingIfInFocus ===
! Cmd || Name || Notes
Takes an input [[#SystemButtonType]], no output.
|-
 
| 0 || [[#GetAppletStateChangedEvent]] ||
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.
|-
 
| 1 || [[#IsCompleted]] ||
=== SetPerformanceConfigurationChangedNotification ===
|-
Takes an input u8 bool, no output.
| 10 || [[#Start]] ||
 
|-
=== GetCurrentPerformanceConfiguration ===
| 20 || [[#RequestExit]] ||
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
|-
 
| 25 || [[#Terminate]] ||
=== OpenMyGpuErrorHandler ===
|-
No input, returns an [[#IGpuErrorHandler]].
| 30 || [[#GetResult]] ||
 
|-
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
|-
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
|-
| 70 || [S2] ||
|-
| 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]] ||
|-
| 170 || [22.0.0+]
|}


=== GetOperationModeSystemInfo ===
Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.
No input, returns an output u32.


This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].
==== SetOutOfFocusApplicationSuspendingEnabled ====
Takes an input u8 bool, no output.


=== GetSettingsPlatformRegion ===
Official sw will assert prior to using this if applet-service was not initialized as *Application.
No input, returns an output u8.


This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].
==== PresetLibraryAppletGpuTimeSliceZero ====
No input/output.
 
sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.


=== ActivateMigrationService ===
==== PushInData ====
No input/output.
Takes an input [[#IStorage]], no output.


Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].
==== PopOutData ====
No input, returns an output [[#IStorage]].


=== DeactivateMigrationService ===
==== PushExtraStorage ====
No input/output.
Takes an input [[#IStorage]], no output.


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


=== SuppressDisablingSleepTemporarily ===
==== PopInteractiveOutData ====
Takes an input u64 "nn::TimeSpanType", no output.
No input, returns an output [[#IStorage]].


=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===
==== GetPopOutDataEvent ====
No input/output.
No input, returns an output handle with autoclear=false.


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


This was added with [11.0.0+].
==== NeedsToExitProcess ====
No input, returns an output u8 bool.


This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.
Stubbed, just returns an error.


{| class="wikitable" border="1"
==== RequestForAppletToGetForeground ====
|-
No input/output.
! Cmd || Name
|-
| 100 || [[#GetManualGpuErrorInfoSize]]
|-
| 101 || [[#GetManualGpuErrorInfo]]
|-
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]
|-
| 103 || [[#FinishManualGpuErrorHandling]]
|}


==== GetManualGpuErrorInfoSize ====
Stubbed, just returns an error.
No input, returns an output u64.


==== GetManualGpuErrorInfo ====
==== GetIndirectLayerConsumerHandle ====
Takes a type-0x6 output buffer, returns an output u64.
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.


The OutBuffer_size must be >= the output size from [[#GetManualGpuErrorInfoSize]].
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.


sdknso exposes the buffer as <code>void*</code>.
== ICommonStateGetter ==
 
This is "nn::am::service::ICommonStateGetter".
==== GetManualGpuErrorDetectionSystemEvent ====
No input, returns an output Event handle with EventClearMode=0.
 
==== FinishManualGpuErrorHandling ====
No input/output.
 
== ISelfController ==
This is "nn::am::service::ISelfController".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,043: Line 2,228:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#Exit]]
| 0 || [[#GetEventHandle]]
|-
|-
| 1 || [[#LockExit]]
| 1 || [[#ReceiveMessage]]
|-
|-
| 2 || [[#UnlockExit]]
| 2 || [[#GetThisAppletKind]]
|-
|-
| 3 || [2.0.0+] [[#EnterFatalSection]]
| 3 || [[#AllowToEnterSleep]]
|-
|-
| 4 || [2.0.0+] [[#LeaveFatalSection]]
| 4 || [[#DisallowToEnterSleep]]
|-
|-
| 9 || [[#GetLibraryAppletLaunchableEvent]]
| 5 || [[#GetOperationMode]]
|-
|-
| 10 || [[#SetScreenShotPermission]]
| 6 || [[#GetPerformanceMode]]
|-
|-
| 11 || [[#SetOperationModeChangedNotification]]
| 7 || [[#GetCradleStatus]]
|-
|-
| 12 || [[#SetPerformanceModeChangedNotification]]
| 8 || [[#GetBootMode]]
|-
|-
| 13 || [[#SetFocusHandlingMode]]
| 9 || [[#GetCurrentFocusState]]
|-
|-
| 14 || [[#SetRestartMessageEnabled]]
| 10 || [[#RequestToAcquireSleepLock]]
|-
|-
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
| 11 || [[#ReleaseSleepLock]]
|-
|-
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
| 12 || [[#ReleaseSleepLockTransiently]]
|-
|-
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
| 13 || [[#GetAcquiredSleepLockEvent]]
|-
|-
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
| 14 || [11.0.0+] [[#GetWakeupCount]]
|-
|-
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
| 15 || [19.0.0+]  
|-
|-
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
| 20 || [[#PushToGeneralChannel]]
|-
|-
| 21 || [13.0.0+] GetScreenShotProgramId
| 30 || [[#GetHomeButtonReaderLockAccessor]]
|-
|-
| 22 || [19.0.0+] GetScreenShotAcdIndex
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
|-
|-
| 23 || [19.0.0+] GetScreenShotApparentPlatform
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
|-
|-
| 24 || [19.0.0+] GetScreenShotApplicationProperty
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
|-
|-
| 40 || [[#CreateManagedDisplayLayer]]
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
|-
|-
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
|-
|-
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
|-
|-
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
| 53 || [7.0.0+] [[#BeginVrModeEx]]
|-
|-
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
| 54 || [7.0.0+] [[#EndVrModeEx]]
|-
|-
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
|-
|-
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
|-
|-
| 50 || [[#SetHandlesRequestToDisplay]]
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
|-
|-
| 51 || [[#ApproveToDisplay]]
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
|-
|-
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
|-
|-
| 61 || [[#SetMediaPlaybackState]]
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
|-
|-
| 62 || [[#SetIdleTimeDetectionExtension]]
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
|-
|-
| 63 || [[#GetIdleTimeDetectionExtension]]
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
|-
|-
| 64 || [[#SetInputDetectionSourceSet]]
| 66 || [6.0.0+] [[#SetCpuBoostMode]]
|-
|-
| 65 || [2.0.0+] [[#ReportUserIsActive]]
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]
|-
|-
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]
|-
|-
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]
|-
|-
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]
|-
|-
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
|-
|-
| 70 || [4.0.0+] [[#ReportMultimediaError]]
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
|-
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]
|-
|-
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
| 120 || [13.0.0+] GetAppletLaunchedHistory
|-
|-
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
| 130 || [21.0.0+] EnableStartupLogoDisappearedMessage
|-
|-
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
|-
|-
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]
|-
|-
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
| 400 || [10.0.0+] [[#ActivateMigrationService]]
|-
|-
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
| 401 || [10.0.0+] [[#DeactivateMigrationService]]
|-
|-
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]
| 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
|-
|-
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
| 2000 || [S2] SetRtcModeChangedMessageEnabled
|-
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
| 2010 || [S2] GetCurrentDisplayLayoutRatio
|}
|}


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


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


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


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).
=== ReceiveMessage ===
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.


=== UnlockExit ===
=== GetThisAppletKind ===
No input/output.
No input, returns an output [[#AppletKind]].


Unlocks exit process, if LockExit was previously used.
Stubbed, just returns an error.


=== EnterFatalSection ===
=== AllowToEnterSleep ===
No input/output.
No input/output.


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


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


=== SetScreenShotPermission ===
=== GetPerformanceMode ===
Takes an input s32. No output.
No input. Returns an output u32 for the current [[#PerformanceMode]].


Controls whether screenshot-capture is allowed.
=== GetCradleStatus ===
No input, returns an output u8.


{| class="wikitable" border="1"
This uses [[#omm]] GetCradleStatus.
|-
! Value || Description
|-
| 0 || Inherit from parent applet
|-
| 1 || Enable
|-
| 2 || Disable
|-
|}


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


=== SetPerformanceModeChangedNotification ===
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
Takes an input u8 bool flag. No output.


=== SetFocusHandlingMode ===
=== GetCurrentFocusState ===
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.
No input. Returns an output u8 [[#FocusState]].


=== SetRestartMessageEnabled ===
=== RequestToAcquireSleepLock ===
Takes an input u8 bool flag, no output.
No input/output.


See [[#AppletMessage]].
=== ReleaseSleepLock ===
No input/output.


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


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


=== SetControllerFirmwareUpdateSection ===
=== GetWakeupCount ===
Takes an input u8 bool flag, no output.
No input, returns an output u64.


This throws error 0x40280 when the internal state flag already matches the input value.
=== PushToGeneralChannel ===
Takes an input [[#IStorage]], no output.


=== SetRequiresCaptureButtonShortPressedMessage ===
This is not usable under an Application, however it is usable under a LibraryApplet.
Takes an input u8 bool flag, no output.


See [[#AppletMessage]].
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.
* <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.


When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
=== GetHomeButtonReaderLockAccessor ===
No input, returns an output [[#ILockAccessor]].


=== SetAlbumImageOrientation ===
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
Takes an input u32 "nn::album::ImageOrientation". No output.


The input value must not be >3.
=== GetReaderLockAccessorEx ===
Takes an input u32, returns an output [[#ILockAccessor]].


=== SetDesirableKeyboardLayout ===
The input value must be 0-3. 0 = HomeButton.
Takes an input u32, no output.


The input u32 is "nn::settings::KeyboardLayout".
=== GetWriterLockAccessorEx ===
Takes an input u32, returns an output [[#ILockAccessor]].


=== CreateManagedDisplayLayer ===
The input value must be 0-3. 0 = HomeButton.
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].


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


Not available when the current applet is an Application ([[#AppletId]] == 0x01).
This uses [[#omm]] GetCradleFwVersion.


Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
=== IsVrModeEnabled ===
No input, returns an output u8 bool.


=== GetSystemSharedLayerHandle ===
=== SetVrModeEnabled ===
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".
Takes an input u8 bool flag. No output.


Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
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}.


=== GetSystemSharedBufferHandle ===
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.
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".


Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
=== SetLcdBacklighOffEnabled ===
Takes an input u8 bool, no output.


Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
Sets whether the LCD screen blacklight is turned off.


=== CreateManagedDisplaySeparableLayer ===
=== BeginVrModeEx ===
No input, returns two output u64 LayerIds.
No input/output.


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.
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.


=== SetManagedDisplayLayerSeparationMode ===
=== EndVrModeEx ===
Takes an input u32, no output.
No input/output.


sdknso exposes this as <code>nn::vi::SetRecordingLayerEnabled(bool)</code>.
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.


The input u32 must be 0-1.
=== IsInControllerFirmwareUpdateSection ===
No input, returns an output u8 bool.


=== SetRecordingLayerCompositionEnabled ===
=== SetVrPositionForDebug ===
Takes an input bool, no output.
Takes 4 input s32s, no output.


=== SetHandlesRequestToDisplay ===
The s32s are: x, y, width, height.
Takes an input u8 bool, no output.


Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.


See [[#AppletMessage]].
width must be 1-1280, height must be 1-720.


=== ApproveToDisplay ===
x and y must not be negative. x+width must be <=1280. y+height must be <=720.
No input/output.


Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
=== GetDefaultDisplayResolution ===
No input, returns two output s32s '''width''' and '''height'''.


=== OverrideAutoSleepTimeAndDimmingTime ===
=== GetDefaultDisplayResolutionChangeEvent ===
Takes 4 input s32s, no output.
No input, returns an output Event handle with autoclear=true.


=== SetMediaPlaybackState ===
=== GetHdcpAuthenticationState ===
Takes an input u8 bool, no output.
No input, returns an output s32.


=== SetIdleTimeDetectionExtension ===
=== GetHdcpAuthenticationStateChangeEvent ===
Takes an input u32, no output.
No input, returns an output Event handle with autoclear=true.


The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.
=== SetTvPowerStateMatchingMode ===
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.


=== GetIdleTimeDetectionExtension ===
=== GetApplicationIdByContentActionName ===
No input, returns an output u32.
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].


Returns the value set by [[#SetIdleTimeDetectionExtension]].
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).


=== SetInputDetectionSourceSet ===
=== SetCpuBoostMode ===
Takes an input u32, no output.
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].


=== ReportUserIsActive ===
=== CancelCpuBoostMode ===
No input/output.
No input/output.


Uses idle:sys ReportUserIsActive.
=== GetBuiltInDisplayType ===
No input, returns an output s32.


Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.
This is not exposed by sdknso.


=== GetCurrentIlluminance ===
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].
No input, returns an output float.


Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
=== PerformSystemButtonPressingIfInFocus ===
Takes an input [[#SystemButtonType]], no output.


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


Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
=== SetPerformanceConfigurationChangedNotification ===
 
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).
 
=== SetAutoSleepDisabled ===
Takes an input u8 bool, no output.
Takes an input u8 bool, no output.


=== IsAutoSleepDisabled ===
=== GetCurrentPerformanceConfiguration ===
No input, returns an output u8 bool.
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].


=== ReportMultimediaError ===
=== OpenMyGpuErrorHandler ===
Takes an input Result and a type-0x5 input buffer, no output.
No input, returns an [[#IGpuErrorHandler]].


The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.


=== GetCurrentIlluminanceEx ===
=== GetOperationModeSystemInfo ===
No input, returns an output u8 bool and float.
No input, returns an output u32.


Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].


=== SetInputDetectionPolicy ===
=== GetSettingsPlatformRegion ===
Takes an input [[#InputDetectionPolicy]], no output.
No input, returns an output u8.


=== SetWirelessPriorityMode ===
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].
Takes an input s32 [[#WirelessPriorityMode]], no output.


=== GetAccumulatedSuspendedTickValue ===
=== ActivateMigrationService ===
No input, returns an output u64 tick value.
No input/output.


Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].


=== GetAccumulatedSuspendedTickChangedEvent ===
=== DeactivateMigrationService ===
No input, returns an output Event handle with autoclear=true.
No input/output.


This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
=== DisableSleepTillShutdown ===
No input/output.


=== SetAlbumImageTakenNotificationEnabled ===
=== SuppressDisablingSleepTemporarily ===
Takes an input u8 bool, no output.
Takes an input u64 "nn::TimeSpanType", no output.


See [[#AppletMessage]].
=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===
No input/output.


=== SetApplicationAlbumUserData ===
=== IGpuErrorHandler ===
Takes a type-0x21 input buffer, no output.
This is "nn::am::service::IGpuErrorHandler".


The buffer contains arbitrary UserData.
This was added with [11.0.0+].


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.
This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.


=== SaveCurrentScreenshot ===
{| class="wikitable" border="1"
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.
|-
 
! Cmd || Name
sdknso exposes this under "nn::album::".
|-
| 100 || [[#GetManualGpuErrorInfoSize]]
|-
| 101 || [[#GetManualGpuErrorInfo]]
|-
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]
|-
| 103 || [[#FinishManualGpuErrorHandling]]
|}
 
==== GetManualGpuErrorInfoSize ====
No input, returns an output u64.
 
==== GetManualGpuErrorInfo ====
Takes a type-0x6 output buffer, returns an output u64.


=== SetRecordVolumeMuted ===
The OutBuffer_size must be >= the output size from [[#GetManualGpuErrorInfoSize]].
Takes an input bool, no output.


=== GetDebugStorageChannel ===
sdknso exposes the buffer as <code>void*</code>.
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.
==== GetManualGpuErrorDetectionSystemEvent ====
No input, returns an output Event handle with EventClearMode=0.


== IStorageChannel ==
==== FinishManualGpuErrorHandling ====
This is "nn::am::service::IStorageChannel".
No input/output.


This was added with [7.0.0+].
== ISelfController ==
This is "nn::am::service::ISelfController".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || Push || No input, returns an output [[#IStorage]].
| 0 || [[#Exit]]
|-
|-
| 1 || Unpop || No input, returns an output [[#IStorage]].
| 1 || [[#LockExit]]
|-
|-
| 2 || Pop || No input, returns an output [[#IStorage]].
| 2 || [[#UnlockExit]]
|-
|-
| 3 || GetPopEventHandle || No input, returns an output handle.
| 3 || [2.0.0+] [[#EnterFatalSection]]
|-
|-
| 4 || Clear || No input/output.
| 4 || [2.0.0+] [[#LeaveFatalSection]]
|}
|-
 
| 9 || [[#GetLibraryAppletLaunchableEvent]]
== IWindowController ==
|-
This is "nn::am::service::IWindowController".
| 10 || [[#SetScreenShotPermission]]
 
|-
{| class="wikitable" border="1"
| 11 || [[#SetOperationModeChangedNotification]]
|-
| 12 || [[#SetPerformanceModeChangedNotification]]
|-
| 13 || [[#SetFocusHandlingMode]]
|-
|-
! Cmd || Name || Notes
| 14 || [[#SetRestartMessageEnabled]]
|-
|-
| 0 || [[#CreateWindow]] ||
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
|-
|-
| 1 || [[#GetAppletResourceUserId]] ||
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
|-
|-
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
|-
|-
| 10 || [[#AcquireForegroundRights]] ||
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
|-
|-
| 11 || [[#ReleaseForegroundRights]] ||
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
|-
|-
| 12 || [[#RejectToChangeIntoBackground]] ||
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
|-
|-
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||
| 21 || [13.0.0+] GetScreenShotProgramId
|-
|-
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||
| 22 || [19.0.0+] GetScreenShotAcdIndex
|}
 
=== CreateWindow ===
Takes an input u32, returns an output [[#IWindow]].
 
Stubbed, just returns an error.
 
=== GetAppletResourceUserId ===
No input, returns an output u64 [[#AppletResourceUserId]].
 
=== GetAppletResourceUserIdOfCallerApplet ===
No input, returns an output u64 [[#AppletResourceUserId]].
 
=== AcquireForegroundRights ===
No input/output.
 
Just returns 0.
 
=== ReleaseForegroundRights ===
No input/output.
 
Just returns 0.
 
=== RejectToChangeIntoBackground ===
No input/output.
 
Just returns 0.
 
=== SetAppletWindowVisibility ===
Takes an input u8 bool, no output.
 
=== SetAppletGpuTimeSlice ===
Takes an input s64, no output.
 
The input s64 must not be negative.
 
== IAudioController ==
This is "nn::am::service::IAudioController".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 23 || [19.0.0+] GetScreenShotApparentPlatform
|-
|-
| 0 || [[#SetExpectedMasterVolume]]
| 24 || [19.0.0+] GetScreenShotApplicationProperty
|-
|-
| 1 || [[#GetMainAppletExpectedMasterVolume]]
| 40 || [[#CreateManagedDisplayLayer]]
|-
|-
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
|-
|-
| 3 || [[#ChangeMainAppletMasterVolume]]
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
|-
|-
| 4 || [[#SetTransparentVolumeRate]]
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
|}
 
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.
 
=== SetExpectedMasterVolume ===
Takes two input floats, no output.
 
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
 
=== GetMainAppletExpectedMasterVolume ===
No input, returns an output float.
 
=== GetLibraryAppletExpectedMasterVolume ===
No input, returns an output float.
 
=== ChangeMainAppletMasterVolume ===
Takes an input float and an input u64, no output.
 
=== SetTransparentVolumeRate ===
Takes an input float, no output.
 
== IDisplayController ==
This is "nn::am::service::IDisplayController".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
|-
|-
| 0 || [[#GetLastForegroundCaptureImage]]
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
|-
|-
| 1 || [[#UpdateLastForegroundCaptureImage]]
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]
|-
|-
| 2 || [[#GetLastApplicationCaptureImage]]
| 50 || [[#SetHandlesRequestToDisplay]]
|-
|-
| 3 || [[#GetCallerAppletCaptureImage]]
| 51 || [[#ApproveToDisplay]]
|-
|-
| 4 || [[#UpdateCallerAppletCaptureImage]]
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
|-
|-
| 5 || [[#GetLastForegroundCaptureImageEx]]
| 61 || [[#SetMediaPlaybackState]]
|-
|-
| 6 || [[#GetLastApplicationCaptureImageEx]]
| 62 || [[#SetIdleTimeDetectionExtension]]
|-
| 63 || [[#GetIdleTimeDetectionExtension]]
|-
| 64 || [[#SetInputDetectionSourceSet]]
|-
|-
| 7 || [[#GetCallerAppletCaptureImageEx]]
| 65 || [2.0.0+] [[#ReportUserIsActive]]
|-
|-
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
|-
|-
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
|-
|-
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
|-
|-
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
|-
|-
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
| 70 || [4.0.0+] [[#ReportMultimediaError]]
|-
|-
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
|-
|-
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
|-
|-
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
| 73 || [21.0.0+]  
|-
|-
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
|-
|-
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
|-
|-
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
|-
|-
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
|-
|-
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
|-
|-
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]
|-
|-
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
|-
|-
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
| 200 || [20.0.0+]  
|-
|-
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
| 210 || [20.0.0+]  
|-
|-
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
| 211 || [20.0.0+]  
|-
|-
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
| 220 || [20.0.0+]  
|-
|-
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
| 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+]
|}
|}


=== GetLastForegroundCaptureImage ===
=== Exit ===
Takes a type-0x6 output buffer.
No input/output.


Stubbed, just returns an error.
Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.


=== UpdateLastForegroundCaptureImage ===
=== LockExit ===
No input/output.
No input/output.


=== GetLastApplicationCaptureImage ===
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).
Takes a type-0x6 output buffer.


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


=== GetCallerAppletCaptureImage ===
Unlocks exit process, if LockExit was previously used.
Takes a type-0x6 output buffer.


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


=== UpdateCallerAppletCaptureImage ===
=== LeaveFatalSection ===
No input/output.
No input/output.


Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.
[[#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.


=== GetLastForegroundCaptureImageEx ===
=== GetLibraryAppletLaunchableEvent ===
Takes a type-0x6 output buffer, returns an output u8 bool.
No input, returns an output event handle with autoclear=false.


The buffer size must match 0x384000.
=== SetScreenShotPermission ===
Takes an input s32. No output.


=== GetLastApplicationCaptureImageEx ===
Controls whether screenshot-capture is allowed.
Takes a type-0x6 output buffer, returns an output u8 bool.


The buffer size must match 0x384000.
{| class="wikitable" border="1"
|-
! Value || Description
|-
| 0 || Inherit from parent applet
|-
| 1 || Enable
|-
| 2 || Disable
|-
|}


Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.
=== SetOperationModeChangedNotification ===
Takes an input u8 bool flag. No output.


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


The buffer size must match 0x384000.
=== SetFocusHandlingMode ===
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.


Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.
=== SetRestartMessageEnabled ===
Takes an input u8 bool flag, no output.


=== TakeScreenShotOfOwnLayer ===
See [[#AppletMessage]].
Takes an input u8 bool and a s32, no output.


=== CopyBetweenCaptureBuffers ===
=== SetScreenShotAppletIdentityInfo ===
Takes two input s32s, no output.
Takes an input [[#AppletIdentityInfo]], no output.


=== AcquireLastApplicationCaptureBuffer ===
=== SetOutOfFocusSuspendingEnabled ===
No input, returns an output handle.
Takes an input u8 bool flag. No output.


Stubbed, just returns an error.
=== SetControllerFirmwareUpdateSection ===
Takes an input u8 bool flag, no output.


=== ReleaseLastApplicationCaptureBuffer ===
This throws error 0x40280 when the internal state flag already matches the input value.
No input/output.
 
=== SetRequiresCaptureButtonShortPressedMessage ===
Takes an input u8 bool flag, no 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.
See [[#AppletMessage]].


=== AcquireLastForegroundCaptureBuffer ===
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
No input, returns an output handle.


Stubbed, just returns an error.
=== SetAlbumImageOrientation ===
Takes an input u32 "nn::album::ImageOrientation". No output.


=== ReleaseLastForegroundCaptureBuffer ===
The input value must not be >3.
No input/output.


Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
=== SetDesirableKeyboardLayout ===
Takes an input u32, no output.


=== AcquireCallerAppletCaptureBuffer ===
The input u32 is "nn::settings::KeyboardLayout".
No input, returns an output handle.


Stubbed, just returns an error.
=== CreateManagedDisplayLayer ===
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].


=== ReleaseCallerAppletCaptureBuffer ===
=== IsSystemBufferSharingEnabled ===
No input/output.
No input/output.


Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
Not available when the current applet is an Application ([[#AppletId]] == 0x01).


=== AcquireLastApplicationCaptureBufferEx ===
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
No input, returns an output TransferMemory handle and an output u8 bool.


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.
=== GetSystemSharedLayerHandle ===
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".


On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.


=== AcquireLastForegroundCaptureBufferEx ===
=== GetSystemSharedBufferHandle ===
No input, returns an output TransferMemory handle and an output u8 bool.
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".


Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.


=== AcquireCallerAppletCaptureBufferEx ===
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
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.
=== CreateManagedDisplaySeparableLayer ===
No input, returns two output u64 LayerIds.


=== ClearCaptureBuffer ===
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.
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.


Clear the input CaptureSharedBuffer with the specified RGBA8 color.
=== SetManagedDisplayLayerSeparationMode ===
 
=== ClearAppletTransitionBuffer ===
Takes an input u32, no output.
Takes an input u32, no output.


Clear the AppletTransitionBuffer with the specified RGBA8 color.
sdknso exposes this as <code>nn::vi::SetRecordingLayerEnabled(bool)</code>.


=== AcquireLastApplicationCaptureSharedBuffer ===
The input u32 must be 0-1.
No input, returns an output u8 bool and an s32.


This loads data from state.
=== SetRecordingLayerCompositionEnabled ===
Takes an input bool, no output.


=== ReleaseLastApplicationCaptureSharedBuffer ===
=== SetHandlesRequestToDisplay ===
No input/output.
Takes an input u8 bool, no output.


Depending on whether a state field is 0, this just returns an error or returns 0.
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].


=== AcquireLastForegroundCaptureSharedBuffer ===
See [[#AppletMessage]].
No input, returns an output u8 bool and an s32.


Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
=== ApproveToDisplay ===
 
=== ReleaseLastForegroundCaptureSharedBuffer ===
No input/output.
No input/output.


Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].


=== AcquireCallerAppletCaptureSharedBuffer ===
=== OverrideAutoSleepTimeAndDimmingTime ===
No input, returns an output u8 bool and an s32.
Takes 4 input s32s, no output.


Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
=== SetMediaPlaybackState ===
Takes an input u8 bool, no output.


=== ReleaseCallerAppletCaptureSharedBuffer ===
=== SetIdleTimeDetectionExtension ===
No input/output.
Takes an input u32, no output.


Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.


=== TakeScreenShotOfOwnLayerEx ===
=== GetIdleTimeDetectionExtension ===
Takes two input u8 bools and a s32, no output.
No input, returns an output u32.


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.
Returns the value set by [[#SetIdleTimeDetectionExtension]].


== ISystemAppletControllerForDebug ==
=== SetInputDetectionSourceSet ===
This is "nn::am::service::ISystemAppletControllerForDebug".
Takes an input u32, no output.


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


=== GetDebugStorageChannel ===
Uses idle:sys ReportUserIsActive.
No input. Returns an output [[#IStorageChannel]].


=== CreateStorageForDebug ===
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.
Takes a total of 8-bytes of input. Returns an [[#IStorage]].


=== CreateCradleFirmwareUpdaterForDebug ===
=== GetCurrentIlluminance ===
No input. Returns an [[#ICradleFirmwareUpdater]].
No input, returns an output float.


== IProcessWindingController ==
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
This is "nn::am::service::IProcessWindingController".


{| class="wikitable" border="1"
=== IsIlluminanceAvailable ===
|-
No input, returns an output u8 bool.
! Cmd || Name || Notes
|-
| 0 || [[#GetLaunchReason]] ||
|-
| 11 || [[#OpenCallingLibraryApplet]] ||
|-
| 21 || [[#PushContext]] ||
|-
| 22 || [[#PopContext]] ||
|-
| 23 || [[#CancelWindingReservation]] ||
|-
| 30 || [[#WindAndDoReserved]] ||
|-
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||
|-
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
|}


=== GetLaunchReason ===
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
No input, returns an output [[#AppletProcessLaunchReason]].


Used by LibraryApplets.
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).


=== OpenCallingLibraryApplet ===
=== SetAutoSleepDisabled ===
No input, returns an output [[#ILibraryAppletAccessor]].
Takes an input u8 bool, no output.


The objptr from state is cleared during this, an error is thrown if it's already 0.
=== IsAutoSleepDisabled ===
No input, returns an output u8 bool.


=== PushContext ===
=== ReportMultimediaError ===
Takes an input [[#IStorage]], no output.
Takes an input Result and a type-0x5 input buffer, no output.


=== PopContext ===
The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.
No input, returns an output [[#IStorage]].
 
=== GetCurrentIlluminanceEx ===
No input, returns an output u8 bool and float.
 
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
 
=== SetInputDetectionPolicy ===
Takes an input [[#InputDetectionPolicy]], no output.
 
=== SetWirelessPriorityMode ===
Takes an input s32 [[#WirelessPriorityMode]], no output.


=== CancelWindingReservation ===
=== GetAccumulatedSuspendedTickValue ===
No input/output.
No input, returns an output u64 tick value.


=== WindAndDoReserved ===
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
No input/output.


=== ReserveToStartAndWaitAndUnwindThis ===
=== GetAccumulatedSuspendedTickChangedEvent ===
Takes an input [[#ILibraryAppletAccessor]], no output.
No input, returns an output Event handle with autoclear=true.


=== ReserveToStartAndWait ===
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
Takes an input [[#ILibraryAppletAccessor]], no output.


== IDebugFunctions ==
=== SetAlbumImageTakenNotificationEnabled ===
This is "nn::am::service::IDebugFunctions".
Takes an input u8 bool, no output.


{| class="wikitable" border="1"
See [[#AppletMessage]].
|-
 
! Cmd || Name
=== SetApplicationAlbumUserData ===
|-
Takes a type-0x21 input buffer, no output.
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
 
|-
The buffer contains arbitrary UserData.
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
 
|-
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.
| 10 || [[#PerformSystemButtonPressing]]
 
|-
=== SaveCurrentScreenshot ===
| 20 || [[#InvalidateTransitionLayer]]
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.
 
sdknso exposes this under "nn::album::".
 
=== SetRecordVolumeMuted ===
Takes an input bool, no output.
 
=== GetDebugStorageChannel ===
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.
 
=== GetGraphicsSupervisor ===
This is exclusive to S2.
 
No input. Returns an output TIPC handle to [[Switch_2:_GSV_services|GraphicsSupervisor]].
 
== IStorageChannel ==
This is "nn::am::service::IStorageChannel".
 
This was added with [7.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
! Cmd || Name || Notes
|-
|-
| 31 || [12.0.0+] RequestLaunchApplicationByApplicationLaunchInfoForDebug
| 0 || Push || No input, returns an output [[#IStorage]].
|-
|-
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
| 1 || Unpop || No input, returns an output [[#IStorage]].
|-
|-
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
| 2 || Pop || No input, returns an output [[#IStorage]].
|-
|-
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
| 3 || GetPopEventHandle || No input, returns an output handle.
|-
|-
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
| 4 || Clear || No input/output.
|}
 
== IWindowController ==
This is "nn::am::service::IWindowController".
 
{| class="wikitable" border="1"
|-
|-
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
! Cmd || Name || Notes
|-
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
| 0 || [[#CreateWindow]] ||
|-
|-
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
| 1 || [[#GetAppletResourceUserId]] ||
|-
|-
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
|-
|-
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
| 10 || [[#AcquireForegroundRights]] ||
|-
|-
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
| 11 || [[#ReleaseForegroundRights]] ||
|-
|-
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
| 12 || [[#RejectToChangeIntoBackground]] ||
|-
|-
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||
|-
|-
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||  
|-
| 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
|-
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
|}
|}


=== NotifyMessageToHomeMenuForDebug ===
=== CreateWindow ===
Takes an input [[#AppletMessage]], no output.
Takes an input u32, returns an output [[#IWindow]].


Stubbed, just returns an error.
Stubbed, just returns an error.


=== OpenMainApplication ===
=== GetAppletResourceUserId ===
No input, returns an output [[#IApplicationAccessor]].
No input, returns an output u64 [[#AppletResourceUserId]].


Should not be used when no Application is running (svcBreak).
=== GetAppletResourceUserIdOfCallerApplet ===
No input, returns an output u64 [[#AppletResourceUserId]].


=== PerformSystemButtonPressing ===
=== AcquireForegroundRights ===
Takes an input [[#SystemButtonType]], no output.
 
=== InvalidateTransitionLayer ===
No input/output.
No input/output.


=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
Just returns 0.
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]]).
=== ReleaseForegroundRights ===
No input/output.


=== GetAppletResourceUsageInfo ===
Just returns 0.
No input, returns an output [[#AppletResourceUsageInfo]].


=== SetCpuBoostModeForApplet ===
=== RejectToChangeIntoBackground ===
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
 
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 
=== CancelCpuBoostModeForApplet ===
No input/output.
No input/output.


=== PushToAppletBoundChannelForDebug ===
Just returns 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.
=== SetAppletWindowVisibility ===
Takes an input u8 bool, no output.


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.
=== SetAppletGpuTimeSlice ===
Takes an input s64, no output.


=== TryPopFromAppletBoundChannelForDebug ===
The input s64 must not be negative.
Takes an input s32, returns an output [[#IStorage]].


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


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.
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#SetExpectedMasterVolume]]
|-
| 1 || [[#GetMainAppletExpectedMasterVolume]]
|-
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
|-
| 3 || [[#ChangeMainAppletMasterVolume]]
|-
| 4 || [[#SetTransparentVolumeRate]]
|-
| 5 || [20.0.0+]
|}


=== AlarmSettingNotificationEnableAppEventReserve ===
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.
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.
=== SetExpectedMasterVolume ===
Takes two input floats, no output.


=== AlarmSettingNotificationDisableAppEventReserve ===
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
No input/output.


Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].
=== GetMainAppletExpectedMasterVolume ===
No input, returns an output float.


=== AlarmSettingNotificationPushAppEventNotify ===
=== GetLibraryAppletExpectedMasterVolume ===
Takes an input [[#IStorage]], no output.
No input, returns an output float.


Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.
=== ChangeMainAppletMasterVolume ===
Takes an input float and an input u64, no output.


=== FriendInvitationSetApplicationParameter ===
=== SetTransparentVolumeRate ===
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes an input float, no output.


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


=== FriendInvitationClearApplicationParameter ===
{| class="wikitable" border="1"
No input/output.
|-
 
! Cmd || Name
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"
|-
|-
! Cmd || Name || Notes
| 0 || [[#GetLastForegroundCaptureImage]]
|-
|-
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
| 1 || [[#UpdateLastForegroundCaptureImage]]
|-
|-
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
| 2 || [[#GetLastApplicationCaptureImage]]
|}
 
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
| 3 || [[#GetCallerAppletCaptureImage]]
|-
|-
| 0 || GetSize || No input. Returns an s64.
| 4 || [[#UpdateCallerAppletCaptureImage]]
|-
|-
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
| 5 || [[#GetLastForegroundCaptureImageEx]]
|-
|-
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
| 6 || [[#GetLastApplicationCaptureImageEx]]
|}
 
== ITransferStorageAccessor ==
This is "nn::am::service::ITransferStorageAccessor".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 7 || [[#GetCallerAppletCaptureImageEx]]
|-
|-
| 0 || GetSize || No input. Returns an output s64.
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
|-
|-
| 1 || GetHandle || No input. Returns an output s64 and handle.
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
|}
 
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"
|-
|-
! Cmd || Name || Notes
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
|-
|-
| 0 || [[#OpenApplicationProxy]] ||
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
|}
 
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.
 
== OpenApplicationProxy ==
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
 
Takes a [[IPC_Marshalling|reserved]] input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias).
 
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
 
= idle:sys =
This is "nn::idle::detail::IPolicyManagerSystem"
 
This was moved to [[OMM_services|omm]] with [14.0.0+].
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
|-
|-
| 0 || GetAutoPowerDownEvent
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
|-
|-
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
|-
|-
| 2 || [1.0.0-3.0.2]
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
|-
|-
| 3 || [[#SetHandlingContext]]
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
|-
|-
| 4 || LoadAndApplySettings
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
|-
|-
| 5 || ReportUserIsActive
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
|}
 
== SetHandlingContext ==
[3.0.0+] Now takes an additional 0x10-bytes of input.
 
[13.0.0+] Total input size is now 0x30 instead of 0x38.
 
= omm =
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"
|-
|-
! Cmd || Name
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
|-
|-
| 0 || GetOperationMode
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
|-
|-
| 1 || GetOperationModeChangeEvent
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
|-
|-
| 2 || EnableAudioVisual
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
|-
|-
| 3 || DisableAudioVisual
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
|-
|-
| 4 || EnterSleepAndWait
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
|-
|-
| 5 || GetCradleStatus
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
|-
|-
| 6 || FadeInDisplay
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
|-
|-
| 7 || FadeOutDisplay
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
|-
| 8 || [2.0.0+] GetCradleFwVersion
|-
| 9 || [2.0.0+] NotifyCecSettingsChanged
|-
| 10 || [3.0.0+] SetOperationModePolicy
|-
| 11 || [3.0.0+] GetDefaultDisplayResolution
|-
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
|-
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
|-
| 14 || [3.0.0+] ShouldSleepOnBoot
|-
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
|-
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
|-
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
|-
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
|-
| 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]]
|}
|}


== GetOperationModeSystemInfo ==
=== GetLastForegroundCaptureImage ===
No input, returns an output u32.
Takes a type-0x6 output buffer.


This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
Stubbed, just returns an error.


== CreateCradleFirmwareUpdater ==
=== UpdateLastForegroundCaptureImage ===
No input. Returns an [[#ICradleFirmwareUpdater]].
No input/output.


== ICradleFirmwareUpdater ==
=== GetLastApplicationCaptureImage ===
This is "nn::am::service::ICradleFirmwareUpdater".
Takes a type-0x6 output buffer.


This was added with [12.0.0+].
Stubbed, just returns an error.


{| class="wikitable" border="1"
=== GetCallerAppletCaptureImage ===
|-
Takes a type-0x6 output buffer.
! Cmd || Name
|-
| 0 || Start
|-
| 1 || Finish
|-
| 2 || GetUpdateDeviceStatus
|-
| 3 || GetUpdateProgress
|-
| 4 || GetUpdateDeviceStatusChangeEvent
|-
| 5 || GetUpdateProgress2
|}


= spsm =
Stubbed, just returns an error.
This is "nn::spsm::detail::IPowerStateInterface".


This was moved to [[OMM_services|omm]] with [14.0.0+].
=== UpdateCallerAppletCaptureImage ===
No input/output.


{| class="wikitable" border="1"
Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.
|-
 
! Cmd || Name
=== GetLastForegroundCaptureImageEx ===
|-
Takes a type-0x6 output buffer, returns an output u8 bool.
| 0 || GetCurrentState
|-
| 1 || EnterSleep
|-
| 2 || GetLastWakeReason
|-
| 3 || Shutdown
|-
| 4 || GetNotificationMessageEventHandle
|-
| 5 || ReceiveNotificationMessage
|-
| 6 || AnalyzeLogForLastSleepWakeSequence
|-
| 7 || ResetEventLog
|-
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
|-
| 9 || ChangeHomeButtonLongPressingTime
|-
| 10 || PutErrorState
|-
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
|}


[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
The buffer size must match 0x384000.


= tcap =
=== GetLastApplicationCaptureImageEx ===
This is "nn::tcap::server::IManager".
Takes a type-0x6 output buffer, returns an output u8 bool.


This was removed with [11.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 || GetContinuousHighSkinTemperatureEvent
|-
| 1 || SetOperationMode
|-
| 2 || LoadAndApplySettings
|}


= caps:su =
=== GetCallerAppletCaptureImageEx ===
This is "nn::capsrv::sf::IScreenShotApplicationService".
Takes a type-0x6 output buffer, returns an output u8 bool.


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


This can be used by applications to save screenshots.
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 || Notes
|-
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.
|-
| 201 || SaveScreenShot ||
|-
| 203 || SaveScreenShotEx0 ||
|-
| 205 || [8.0.0+] SaveScreenShotEx1 ||
|-
| 210 || SaveScreenShotEx2 || Takes a total of 0x50-bytes of input, a type-0x15 input buffer, and a type-0x45 input buffer.  Returns a total of 0x20-bytes of output.
|}


'''SetShimLibraryVersion''' is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
=== CopyBetweenCaptureBuffers ===
Takes two input s32s, no output.


== SaveScreenShot ==
=== AcquireLastApplicationCaptureBuffer ===
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 handle.


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


This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
=== ReleaseLastApplicationCaptureBuffer ===
No input/output.


== SaveScreenShotEx0 ==
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.
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]].


== SaveScreenShotEx1 ==
=== AcquireLastForegroundCaptureBuffer ===
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]].
No input, returns an output handle.
 
Stubbed, just returns an error.
 
=== ReleaseLastForegroundCaptureBuffer ===
No input/output.


== SaveScreenShotEx2 ==
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
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]].


= apm =
=== AcquireCallerAppletCaptureBuffer ===
This is "nn::am::service::IApmManager".
No input, returns an output handle.


This was added with [8.0.0+].
Stubbed, just returns an error.


{| class="wikitable" border="1"
=== ReleaseCallerAppletCaptureBuffer ===
|-
No input/output.
! Cmd || Name
|-
| 0 || [[#OpenSession]]
|-
| 1 || GetPerformanceMode
|-
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
|}


== OpenSession ==
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
Returns an [[#ISession]].


== IsCpuOverclockEnabled ==
=== AcquireLastApplicationCaptureBufferEx ===
No input, returns an output u8 bool.
No input, returns an output TransferMemory handle and an output u8 bool.


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


{| class="wikitable" border="1"
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.
|-
 
! Cmd || Name
=== AcquireLastForegroundCaptureBufferEx ===
|-
No input, returns an output TransferMemory handle and an output u8 bool.
| 0 || SetPerformanceConfiguration
 
|-
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.
| 1 || GetPerformanceConfiguration
 
|-
=== AcquireCallerAppletCaptureBufferEx ===
| 2 || [8.0.0+] SetCpuOverclockEnabled
No input, returns an output TransferMemory handle and an output u8 bool.
|}


= Library Applets =
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.
This section documents library applet launching.


Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
=== ClearCaptureBuffer ===
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.


Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
Clear the input CaptureSharedBuffer with the specified RGBA8 color.


== CommonArguments ==
=== ClearAppletTransitionBuffer ===
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, no output.


This struct is 0x20-bytes.
Clear the AppletTransitionBuffer with the specified RGBA8 color.


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


{| class="wikitable" border="1"
This loads data from state.
|-
 
! Offset || Size || Typical Value || Notes
=== ReleaseLastApplicationCaptureSharedBuffer ===
|-
No input/output.
| 0x0 || 4 || 1 || Common Arguments version
 
|-
Depending on whether a state field is 0, this just returns an error or returns 0.
| 0x4 || 4 || 0x20 || Common Arguments size
 
|-
=== AcquireLastForegroundCaptureSharedBuffer ===
| 0x8 || 4 || || Library applet version (API version)
No input, returns an output u8 bool and an s32.
 
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
 
=== 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"
|-
|-
| 0xC || 4 || 0 || Theme color
! Cmd || Name
|-
|-
| 0x10 || 1 || 0 || Play startup sound
| 1 || RequestLaunchApplicationForDebug
|-
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
|-
|}
| 3 || [7.0.0+] [[#CreateStorageForDebug]]
|-
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]
|}


= AppletId =
=== GetDebugStorageChannel ===
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
No input. Returns an output [[#IStorageChannel]].
 
=== CreateStorageForDebug ===
Takes a total of 8-bytes of input. Returns an [[#IStorage]].
 
=== CreateCradleFirmwareUpdaterForDebug ===
No input. Returns an [[#ICradleFirmwareUpdater]].
 
== IProcessWindingController ==
This is "nn::am::service::IProcessWindingController".
 
GetProcessWindingController throws an error when used from non-LibraryApplet (at least with Application).


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name || Notes
! ProgramId
! Description
|-
|-
| 0x00
| 0 || [[#GetLaunchReason]] ||
|  
| None
|-
|-
| 0x01
| 11 || [[#OpenCallingLibraryApplet]] ||  
|  
| Application (not valid for use with LibraryApplets)
|-
|-
| 0x02
| 21 || [[#PushContext]] ||  
| 010000000000100C
| OverlayApplet (overlayDisp)
|-
|-
| 0x03
| 22 || [[#PopContext]] ||  
| 0100000000001000
| SystemAppletMenu (qlaunch)
|-
|-
| 0x04
| 23 || [[#CancelWindingReservation]] ||
| 0100000000001012
| SystemApplication (starter)
|-
|-
| 0x0A
| 30 || [[#WindAndDoReserved]] ||
| 0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
|-
| 0x0B
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||
| 0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
|-
| 0x0C
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
| 0100000000001003
|}
| [[Controller_Applet|LibraryAppletController (controller)]]
 
|-
=== GetLaunchReason ===
| 0x0D
No input, returns an output [[#AppletProcessLaunchReason]].
| 0100000000001004
 
| LibraryAppletDataErase (dataErase)
Used by LibraryApplets.
 
=== OpenCallingLibraryApplet ===
No input, returns an output [[#ILibraryAppletAccessor]].
 
The objptr from state is cleared during this, an error is thrown if it's already 0.
 
=== PushContext ===
Takes an input [[#IStorage]], no output.
 
=== PopContext ===
No input, returns an output [[#IStorage]].
 
=== CancelWindingReservation ===
No input/output.
 
=== WindAndDoReserved ===
No input/output.
 
=== ReserveToStartAndWaitAndUnwindThis ===
Takes an input [[#ILibraryAppletAccessor]], no output.
 
=== ReserveToStartAndWait ===
Takes an input [[#ILibraryAppletAccessor]], no output.
 
== ISystemProcessCommonFunctions ==
This is "nn::am::service::ISystemProcessCommonFunctions".
 
This was added with [19.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 0x0E
! Cmd || Name
| 0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
|-
|-
| 0x0F
| 1 ||
| 0100000000001006
|}
| LibraryAppletNetConnect (netConnect)
 
=== Cmd1 ===
No input. Returns an [[#IApplicationObserver]].
 
=== IApplicationObserver ===
This is "nn::am::service::IApplicationObserver".
 
This was added with [19.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 0x10
! Cmd || Name
| 0100000000001007
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
|-
|-
| 0x11
| 1 ||  
| 0100000000001008
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
|-
|-
| 0x12
| 2 ||  
| 0100000000001009
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
|-
|-
| 0x13
| 10 ||  
| 010000000000100A
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
|-
| 0x14
| 20 ||  
| 010000000000100B
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
|-
| 0x15
| 30 ||  
| 010000000000100D
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
|-
| 0x16
| 40 || [S2] [20.0.0+]
| 010000000000100E
|}
| LibraryAppletSet (set)
 
== IAppletAlternativeFunctions ==
This is "nn::am::service::IAppletAlternativeFunctions".
 
This was added with [20.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 0x17
! Cmd || Name
| 010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
|-
|-
| 0x18
| 0 ||  
| 0100000000001010
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
|-
|-
| 0x19
| 1 ||  
| 0100000000001011
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
|-
|-
| 0x1A
| 2 ||
| 0100000000001013
|}
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
 
== IChatProxy ==
This is "nn::am::service::IChatProxy".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 0x1B
! Cmd || Name || Notes
| 010000000000101A
| LibraryAppletGift (gift)
|-
|-
| 0x1C
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
| 010000000000101C
| LibraryAppletUserMigration (userMigration)
|-
|-
| 0x1D
| 1 || GetSelfController || Returns an [[#ISelfController]].
| 010000000000101D
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
|-
|-
| 0x1E
| 2 || GetWindowController || Returns an [[#IWindowController]].
| 0100000000001020
| [9.0.0+] LibraryAppletStory (story)
|-
|-
| 0x1F
| 3 || GetAudioController || Returns an [[#IAudioController]].
| 010070000E3C0000
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
|-
|-
| 0x20
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
| 010086000E49C000
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
|-
|-
| 0x21
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 0100000000001038
| [10.0.0+] LibraryAppletSample (sample)
|-
|-
| 0x22
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
| 0100000000001007
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
|-
|-
| 0x32
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 010000000000100F
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
|-
|-
| 0x33
| 20 || || Returns an [[#IChatFunctions]].
| 010000000000100F
|}
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
 
|-
=== IChatFunctions ===
| 0x35
This is "nn::am::service::IChatFunctions".
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
 
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 0x36
! Cmd || Name
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )
|-
|-
| 0x37
| 1 ||  
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )
|-
|-
| 0x38
| 102 ||  
| 0100000000001043
| [16.0.0-16.1.0]
|-
|-
| 0x50
| 103 ||  
| 0100000000001007
| [18.0.0+]
|-
|-
| 0x51
| 104 ||  
| 0100000000001007
| [18.0.0+]
|-
|-
| 0x3E8
| 110 ||  
|  
| [10.0.0-16.1.0] DevlopmentTool
|-
|-
| 0x3F1
| 120 ||  
| 010000000000D619
| [10.0.0-16.1.0] CombinationLA
|-
|-
| 0x3F2
| 121 ||  
| 010000000000D610
| [10.0.0-16.1.0] AeSystemApplet
|-
|-
| 0x3F3
| 130 ||  
| 010000000000D611
| [10.0.0-16.1.0] AeOverlayApplet
|-
|-
| 0x3F4
| 140 || [20.0.0+]
| 010000000000D612
| [10.0.0-16.1.0] AeStarter
|-
|-
| 0x3F5
| 141 || [20.0.0+]
| 010000000000D613
| [10.0.0-16.1.0] AeLibraryAppletAlone
|-
|-
| 0x3F6
| 200 ||  
| 010000000000D614
| [10.0.0-16.1.0] AeLibraryApplet1
|-
|-
| 0x3F7
| 201 ||  
| 010000000000D615
| [10.0.0-16.1.0] AeLibraryApplet2
|-
|-
| 0x3F8
| 210 || [20.0.0+]
| 010000000000D616
| [10.0.0-16.1.0] AeLibraryApplet3
|-
|-
| 0x3F9
| 220 || [20.0.0+]
| 010000000000D617
|}
| [10.0.0-16.1.0] AeLibraryApplet4
 
== IDebugFunctions ==
This is "nn::am::service::IDebugFunctions".
 
{| class="wikitable" border="1"
|-
|-
| 0x3FA
! Cmd || Name
| 010000000000D60A
| [10.0.0-16.1.0] AppletISA
|-
|-
| 0x3FB
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
| 010000000000D60B
| [10.0.0-16.1.0] AppletIOA
|-
|-
| 0x3FC
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
| 010000000000D60C
| [10.0.0-16.1.0] AppletISTA
|-
|-
| 0x3FD
| 10 || [[#PerformSystemButtonPressing]]
| 010000000000D60D
| [10.0.0-16.1.0] AppletILA1
|-
|-
| 0x3FE
| 20 || [[#InvalidateTransitionLayer]]
| 010000000000D60E
| [10.0.0-16.1.0] AppletILA2
|-
|-
| 0x700000C8
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
| 010000000000D65B
| [18.0.0+]  
|-
|-
| 0x700000C9
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
| 010000000000D65C
| [18.0.0+]  
|-
|-
| 0x700000DC
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
| 010000000000D619
| [17.0.0+] CombinationLA
|-
|-
| 0x700000E6
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
| 010000000000D610
|-
| [17.0.0+] AeSystemApplet
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
|-
|-
| 0x700000E7
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
| 010000000000D611
| [17.0.0+] AeOverlayApplet
|-
|-
| 0x700000E8
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
| 010000000000D612
| [17.0.0+] AeStarter
|-
|-
| 0x700000E9
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
| 010000000000D613
| [17.0.0+] AeLibraryAppletAlone
|-
|-
| 0x700000EA
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
| 010000000000D614
| [17.0.0+] AeLibraryApplet1
|-
|-
| 0x700000EB
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
| 010000000000D615
| [17.0.0+] AeLibraryApplet2
|-
|-
| 0x700000EC
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
| 010000000000D616
| [17.0.0+] AeLibraryApplet3
|-
|-
| 0x700000ED
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
| 010000000000D617
| [17.0.0+] AeLibraryApplet4
|-
|-
| 0x700000F0
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
| 010000000000D60A
| [17.0.0+] AppletISA
|-
|-
| 0x700000F1
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
| 010000000000D60B
| [17.0.0+] AppletIOA
|-
|-
| 0x700000F2
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
| 010000000000D60C
| [17.0.0+] AppletISTA
|-
|-
| 0x700000F3
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]
| 010000000000D60D
| [17.0.0+] AppletILA1
|-
|-
| 0x700000F4
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
| 010000000000D60E
| [17.0.0+] AppletILA2
|}
 
= LibraryAppletMode =
This is "nn::applet::LibraryAppletMode".
 
{| class="wikitable" border="1"
|-
|-
! Value
| 140 || [14.0.0+] [[#RestrictPowerOperationForSecureLaunchModeForDebug|RestrictPowerOperationForSecureLaunchModeForDebug]]
! Description
|-
|-
| 0x0
| 150 || [21.0.0+]
| AllForeground
|-
|-
| 0x1
| 200 || [15.0.0+] [[#CreateFloatingLibraryAppletAccepterForDebug|CreateFloatingLibraryAppletAccepterForDebug]]
| PartialForeground
|-
|-
| 0x2
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
| NoUi
|-
| 0x3
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])
|-
|-
| 0x4
| 400 || [S2] LaunchDebugAppletForDebug
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])
|}
 
= AppletMessage =
This is "nn::am::AppletMessage".
 
{| class="wikitable" border="1"
|-
|-
! Value
| 401 || [S2] TerminateDebugAppletForDebug
! Description
|-
|-
| 0 || None
| 402 || [S2] IsDebugAppletLaunchedForDebug
|-
|-
| 1 || ChangeIntoForeground
| 403 || [S2]
|-
|-
| 2 || ChangeIntoBackground
| 410 || [18.0.0+] [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]]
|-
|-
| 4 || Exit
| 411 || [18.0.0+] [[#ReadGeneralStorageForDebug|ReadGeneralStorageForDebug]]
|-
|-
| 6 || ApplicationExited
| 412 || [18.0.0+] [[#WriteGeneralStorageForDebug|WriteGeneralStorageForDebug]]
|-
|-
| 7 ||  
| 430 || [20.0.0+]
|-
|-
| 15 || [[#FocusState|FocusStateChanged]]
| 431 || [20.0.0+]
|-
|-
| 16 || [[#SetRestartMessageEnabled|Resume]]
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
|-
|-
| 20 || DetectShortPressingHomeButton
| 910 || [20.0.0+]
|-
|-
| 21 || DetectLongPressingHomeButton
| 2000 || [S2] [20.0.0+]
|-
|-
| 22 || DetectShortPressingPowerButton
| 10000 || [S2]
|-
|}
| 23 || DetectMiddlePressingPowerButton
 
|-
=== NotifyMessageToHomeMenuForDebug ===
| 24 || DetectLongPressingPowerButton
Takes an input [[#AppletMessage]], no output.
|-
 
| 25 || RequestToPrepareSleep
Stubbed, just returns an error.
|-
 
| 26 || FinishedSleepSequence
=== OpenMainApplication ===
|-
No input, returns an output [[#IApplicationAccessor]].
| 27 || SleepRequiredByHighTemperature
 
|-
Should not be used when no Application is running (svcBreak).
| 28 || SleepRequiredByLowBattery
 
|-
=== PerformSystemButtonPressing ===
| 29 || AutoPowerDown
Takes an input [[#SystemButtonType]], no output.
|-
 
| 30 || [[#OperationMode|OperationModeChanged]]
=== InvalidateTransitionLayer ===
|-
No input/output.
| 31 || [[#PerformanceMode|PerformanceModeChanged]]
 
|-
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
| 32 || DetectReceivingCecSystemStandby
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.
|-
 
| 33 || SdCardRemoved
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]]).
|-
 
| 34 ||
=== 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.
| 50 || LaunchApplicationRequested
 
|-
[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.
| 51 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]
 
|-
=== GetAppletResourceUsageInfo ===
| 55 || ShowApplicationLogo
No input, returns an output [[#AppletResourceUsageInfo]].
|-
 
| 56 || HideApplicationLogo
=== SetCpuBoostModeForApplet ===
|-
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
| 57 || ForceHideApplicationLogo
 
|-
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
| 58 ||
 
|-
=== CancelCpuBoostModeForApplet ===
| 59 ||
No input/output.
|-
 
| 60 || FloatingApplicationDetected
=== PushToAppletBoundChannelForDebug ===
|-
Takes an input [[#IStorage]] and a s32, no output.
| 61 || [7.0.0+] PerformanceConfigurationChanged
 
|-
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
| 70 ||
 
|-
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.
| 71 ||
 
|-
=== TryPopFromAppletBoundChannelForDebug ===
| 72 ||
Takes an input s32, returns an output [[#IStorage]].
|-
| 73 ||
|-
| 75 ||
|-
| 80 ||
|-
| 81 ||
|-
| 82 ||
|-
| 83 ||
|-
| 85 ||
|-
| 86 ||
|-
| 90 || [[#SetRequiresCaptureButtonShortPressedMessage|DetectShortPressingCaptureButton]]
|-
| 92 || [[#SetAlbumImageTakenNotificationEnabled|AlbumScreenShotTaken]]
|-
| 93 || AlbumRecordingSaved
|-
| 94 ||
|-
| 100 ||
|-
| 101 ||
|-
| 110 || [14.0.0+] DetectShortPressingCaptureButtonForApplet
|-
| 111 || [14.0.0+] DetectLongPressingCaptureButtonForApplet
|-
| 1000 ||
|}


= OperationMode =
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
This is "nn::oe::OperationMode".
 
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.
 
=== AlarmSettingNotificationEnableAppEventReserve ===
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.


{| class="wikitable" border="1"
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
|-
! Value
! Description
|-
| 0 || Handheld
|-
| 1 || Console
|}


= PerformanceMode =
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToNotificationStorageChannel|NotificationStorageChannel]].
This is "nn::oe::PerformanceMode".


{| class="wikitable" border="1"
=== AlarmSettingNotificationDisableAppEventReserve ===
|-
No input/output.
! Value
! Description
|-
| -1 || Invalid
|-
| 0 || Normal
|-
| 1 || Boost
|}


= FocusState =
Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].
This is "nn::oe::FocusState".


{| class="wikitable" border="1"
=== AlarmSettingNotificationPushAppEventNotify ===
|-
Takes an input [[#IStorage]], no output.
! Value
 
! Description
Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.
|-
| 1 || InFocus
|-
| 2 || OutOfFocus
|-
| 3 || Background
|}


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


{| class="wikitable" border="1"
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
|-
! Value
! Description
|-
| 0 || Normal
|-
| 1 || FastLoad
|}


= WindowOriginMode =
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToFriendInvitationStorageChannel|FriendInvitationStorageChannel]].
This is "nn::oe::WindowOriginMode".


{| class="wikitable" border="1"
=== FriendInvitationClearApplicationParameter ===
|-
No input/output.
! Value
! Description
|-
| 0 || LowerLeft
|-
| 1 || UpperLeft
|}


= WirelessPriorityMode =
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].
This is "nn::oe::WirelessPriorityMode".


{| class="wikitable" border="1"
=== FriendInvitationPushApplicationParameter ===
|-
Takes an input [[#IStorage]], no output.
! Value
 
! Description
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
|-
 
| 0 || Default
=== RestrictPowerOperationForSecureLaunchModeForDebug ===
|-
No input/output.
| 1 || OptimizedForWlan
 
|}
This runs the same functionality as [[#DisableSleepTillShutdown|DisableSleepTillShutdown]].
 
=== 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.
 
The high-byte of Id must be 0.
 
Reads data from the buffer previously allocated by [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]] with the specified Id.
 
The out_size is always the buffer-size (an error is thrown when bounds-check fails).
 
=== 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.


= TvPowerStateMatchingMode =
== IStorage ==
This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
This is "nn::am::service::IStorage".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name || Notes
! Description
|-
|-
| 0 || Unknown
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
|-
|-
| 1 || Unknown
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
|}
|}


= SystemButtonType =
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]].
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
 
Only 1 *Accessor session can be open for each IStorage at a time.


{| class="wikitable" border="1"
== IStorageAccessor ==
|-
This is "nn::am::service::IStorageAccessor".
! Value
 
! Description
{| class="wikitable" border="1"
|-
|-
| 1 || PerformHomeButtonShortPressing
! Cmd || Name || Notes
|-
|-
| 2 || PerformHomeButtonLongPressing
| 0 || GetSize || No input. Returns an s64.
|-
|-
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
|-
|-
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
|}
 
== ITransferStorageAccessor ==
This is "nn::am::service::ITransferStorageAccessor".
 
{| class="wikitable" border="1"
|-
|-
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].
! Cmd || Name || Notes
|-
|-
| 6 || PerformCaptureButtonShortPressing
| 0 || GetSize || No input. Returns an output s64.
|-
|-
| 7 || PerformCaptureButtonLongPressing
| 1 || GetHandle || No input. Returns an output s64 and handle.
|}
|}


= LaunchParameterKind =
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"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name
! Description
|-
|-
| 1 || UserChannel. Application-specific LaunchParameter.
| 2000 || [S2] [[#OpenCompatApplicationFunctions|OpenCompatApplicationFunctions]]
|-
|-
| 2 || account PreselectedUser
| 0 || [[#OpenApplicationProxy]]
|-
|-
| 3 || Unknown if used by anything?
| 10 || [S2] [[#OpenApplicationProxy2|OpenApplicationProxy2]]
|}
|}


= LibraryAppletExitReason =
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.
{| class="wikitable" border="1"
 
== 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]].
 
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
 
== OpenApplicationProxy2 ==
Unofficial name.
 
Takes an input u32, an u64 pid_reserved, a PID, and a process copy-handle (cur-proc handle alias). Returns an [[#IApplicationProxy]].
 
= idle:sys =
This is "nn::idle::detail::IPolicyManagerSystem"
 
This was moved to [[OMM_services|omm]] with [14.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || GetAutoPowerDownEvent
|-
|-
! Value
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
! Description
|-
|-
| 0 || Normal
| 2 || [1.0.0-3.0.2]
|-
|-
| 1 || Canceled
| 3 || [[#SetHandlingContext]]
|-
|-
| 2 || Abnormal
| 4 || LoadAndApplySettings
|-
|-
| 10 || Unexpected
| 5 || ReportUserIsActive
|}
|}


= ProgramSpecifyKind =
== SetHandlingContext ==
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
[3.0.0+] Now takes an additional 0x10-bytes of input.
 
[13.0.0+] Total input size is now 0x30 instead of 0x38.
 
= omm =
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"
|-
|-
! Value
! Cmd || Name
! Description
|-
| 0 || GetOperationMode
|-
|-
| 0 || u8 ProgramIndex. "ExecuteProgram". [[NS_Services|NS]] handles ProgramIndex by launching ApplicationId+ProgramIndex. After using [[#ExecuteProgram]] with this successfully, official user-processes will enter an infinite loop with sleep-thread value 86400000000000.
| 1 || GetOperationModeChangeEvent
|-
|-
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
| 2 || EnableAudioVisual
|-
|-
| 2 || u64 = value 0. "RestartProgram"
| 3 || DisableAudioVisual
|}
 
ProgramIndex values where the title is not installed should not be used: [[qlaunch]] will display an error message and the current title will become "corrupted", however Home Menu will have an option to repair it.
 
= InputDetectionPolicy =
This is u32 enum "nn::applet::InputDetectionPolicy".
 
{| class="wikitable" border="1"
|-
|-
! Value
| 4 || EnterSleepAndWait
! Description
|-
|-
| 0 || Unknown
| 5 || GetCradleStatus
|-
|-
| 1 || Unknown
| 6 || FadeInDisplay
|}
 
= AppletResourceUserId =
This is "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
 
= AppletAttribute =
This is "nn::am::AppletAttribute". This struct is 0x80 bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 7 || FadeOutDisplay
|-
|-
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
| 8 || [2.0.0+] GetCradleFwVersion
|-
|-
| 0x1 || 0x7F || Unused
| 9 || [2.0.0+] NotifyCecSettingsChanged
|}
|-
 
| 10 || [3.0.0+] SetOperationModePolicy
This is used by [[#OpenLibraryAppletProxy]].
|-
 
| 11 || [3.0.0+] GetDefaultDisplayResolution
= AppletProcessLaunchReason =
|-
This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
 
|-
{| class="wikitable" border="1"
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
|-
| 14 || [3.0.0+] ShouldSleepOnBoot
|-
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
|-
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
|-
|-
! Offset || Size || Description
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
|-
|-
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
|-
|-
| 0x1 || 0x2 || Always 0.
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
|-
|-
| 0x3 || 0x1 || Always 0.
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
|}
 
= LibraryAppletInfo =
This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
|-
|-
| 0x0 || 0x4 || [[#AppletId]]
| 22 || [4.0.0+] GetHdcpStateChangeEvent
|-
|-
| 0x4 || 0x4 || [[#LibraryAppletMode]]
| 23 || [4.0.0+] GetHdcpState
|}
|-
 
| 24 || [5.0.0+] ShowCardUpdateProcessing
= AppletKind =
|-
This is "nn::am::service::AppletKind". This is 8-bytes.
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
|-
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
|-
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
|-
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]
|}
 
== 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+].


= AppletIdentityInfo =
{| class="wikitable" border="1"
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
|-
 
! Cmd || Name
{| class="wikitable" border="1"
|-
|-
| 0 || Start
! Offset || Size || Description
|-
|-
| 1 || Finish
| 0x0 || 0x4 || [[#AppletId]]
|-
|-
| 2 || GetUpdateDeviceStatus
| 0x4 || 0x4 || Padding
|-
|-
| 3 || GetUpdateProgress
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 4 || GetUpdateDeviceStatusChangeEvent
|-
| 5 || GetUpdateProgress2
|}
 
= spsm =
This is "nn::spsm::detail::IPowerStateInterface".
 
This was moved to [[OMM_services|omm]] with [14.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || GetCurrentState
|-
| 1 || EnterSleep
|-
| 2 || GetLastWakeReason
|-
| 3 || Shutdown
|-
| 4 || GetNotificationMessageEventHandle
|-
| 5 || ReceiveNotificationMessage
|-
| 6 || AnalyzeLogForLastSleepWakeSequence
|-
| 7 || ResetEventLog
|-
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
|-
| 9 || ChangeHomeButtonLongPressingTime
|-
| 10 || PutErrorState
|-
| 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"
|-
! Cmd || Name
|-
| 0 || GetContinuousHighSkinTemperatureEvent
|-
| 1 || SetOperationMode
|-
| 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"
|-
! Cmd || Name
|-
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
|-
| 201 || [[#SaveScreenShot]]
|-
| 203 || [[#SaveScreenShotEx0]]
|-
| 205 || [8.0.0+] [[#SaveScreenShotEx1]]
|-
| 210 || [[#SaveScreenShotEx2]]
|}
 
== SetShimLibraryVersion ==
Takes a total of 0x10-bytes of input and a PID, 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.
 
== SaveScreenShot ==
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 
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.
 
This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
 
== 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]].
 
== SaveScreenShotEx1 ==
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]].
 
== 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]].
 
= apm =
This is "nn::am::service::IApmManager".
 
This was added with [8.0.0+].
 
[S2] Official sw no longer uses this (stubbed out).
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#OpenSession]]
|-
| 1 || GetPerformanceMode
|-
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
|}
 
== OpenSession ==
Returns an [[#ISession]].
 
== IsCpuOverclockEnabled ==
No input, returns an output u8 bool.
 
== ISession ==
This is "nn::am::service::IApmSession".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || SetPerformanceConfiguration
|-
| 1 || GetPerformanceConfiguration
|-
| 2 || [8.0.0+] SetCpuOverclockEnabled
|}
 
= (S2) adraw:a =
This is "nn::appletdraw::sfif::IAppletRoot".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 1 || [[#OpenResourceSession]]
|-
| 2 || [[#OpenAppletSession]]
|}
 
== OpenResourceSession ==
Unofficial name.
 
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IResourceSession]].
 
== OpenAppletSession ==
Unofficial name.
 
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IAppletSession]].
 
== IResourceSession ==
This is "nn::appletdraw::sfif::IResourceSession".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 1 || [[#Ping|Ping]]
|-
| 10 || 
|-
| 11 || 
|}
 
=== Ping ===
Unofficial name.
 
Takes an input u64. Returns an output u64.
 
The output u64 should match the input u64. Official software sends the current system tick value.
 
=== Cmd10 ===
Takes a handle, a u64 and an int. Returns a handle.
 
=== Cmd11 ===
No input/output.
 
== IAppletSession ==
This is "nn::appletdraw::sfif::IAppletSession".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 1 || [[#Ping|Ping]]
|-
| 2 || [[#GetEvent|GetEvent]]
|-
| 3 || [20.1.1+]
|-
| 10 || 
|-
| 11 || 
|-
| 12 || 
|-
| 13 || 
|-
| 15 || 
|-
| 16 || [20.1.1+]
|-
| 17 || [20.1.1+]
|-
| 18 || [20.1.1+]
|-
| 19 || [20.1.1+]
|-
| 21 || 
|-
| 22 || 
|-
| 23 || [20.1.1+]
|-
| 24 || [20.1.1+]
|-
| 31 || [[#GetFrameBufferInfo|GetFrameBufferInfo]]
|-
| 8001 || [[#GetFrameBufferInfoForDebug|GetFrameBufferInfoForDebug]]
|-
| 8003 || [19.0.0-19.1.0]
|-
| 8004 || 
|}
 
=== GetEvent ===
Unofficial name.
 
No input. Returns an output Event handle.
 
=== Cmd3 ===
Takes a handle. No output.
 
=== Cmd10 ===
Takes an input u32. No output.
 
=== Cmd11 ===
Takes an input u32. No output.
 
=== Cmd12 ===
Takes an input u64. Returns an output u32.
 
=== Cmd13 ===
Takes an input u32. Returns an output u32.
 
=== Cmd15 ===
Takes an input u32. Returns three output u32s.
 
=== Cmd16 ===
No input. Returns an output u32.
 
=== Cmd17 ===
Takes an input u32. Returns an output u32 and an output u16.
 
=== Cmd18 ===
Takes an input u32. Returns three output u32s and an output u16.
 
=== Cmd19 ===
Takes an input u32. Returns an output u32 and an output u16.
 
=== Cmd21 ===
Takes an input u32. Returns a struct of size 0x40.
 
=== 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 || [[#OpenApplicationProxy]]
|-
| 2000 || [[#OpenCompatApplicationFunctions]]
|}
 
== OpenCompatApplicationFunctions ==
No input. Returns an [[#INxCompatApplicationFunctions]].
 
== INxCompatApplicationFunctions ==
This is "nn::am::service::INxCompatApplicationFunctions".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 2000 || [[#GetGraphicsSupervisorForNxCompat]]
|-
| 2001 ||
|-
| 2002 || 
|-
| 2003 || [[#SetCopyright]]
|-
| 2004 || 
|-
| 2010 || 
|-
| 2020 || [[#Initialize]]
|-
| 2030 || [[#GetVsyncEvent]]
|-
| 2040 || [[#GetVsyncTimestamp]]
|-
| 2050 ||
|-
| 2060 ||
|-
| 2070 || [[#CreateMovieMaker]]
|}
 
=== GetGraphicsSupervisorForNxCompat ===
Unofficial name.
 
No input. Returns an output TIPC handle to [[Switch_2:_GSV_services|GraphicsSupervisor]].
 
Same as [[#GetGraphicsSupervisor]] 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.
 
= Library Applets =
This section documents library applet launching.
 
Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
 
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
 
== CommonArguments ==
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by <code>nn::la::CommonArgumentsWriter</code> and has the following format.
 
This struct is 0x20-bytes.
 
Official sw handles the first 8-bytes separately, which is a header. With CommonArguments version 0x0, the header is 4-bytes, while starting with version 0x1 it's 8-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Typical Value || Notes
|-
| 0x0 || 4 || 1 || Common Arguments version
|-
| 0x4 || 4 || 0x20 || Common Arguments size
|-
| 0x8 || 4 || || Library applet version (API version)
|-
| 0xC || 4 || 0 || Theme color
|-
| 0x10 || 1 || 0 || Play startup sound
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
|-
|}
 
= AppletId =
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
 
{| class="wikitable" border="1"
|-
! Value
! ProgramId
! Description
|-
| 0x00000000
|
| None
|-
| 0x00000001
|
| Application (not valid for use with LibraryApplets)
|-
| 0x00000002
| 0x010000000000100C
| OverlayApplet (overlayDisp)
|-
| 0x00000003
| 0x0100000000001000
| SystemAppletMenu (qlaunch)
|-
| 0x00000004
| 0x0100000000001012
| SystemApplication (starter)
|-
| 0x0000000A
| 0x0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
| 0x0000000B
| 0x0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
| 0x0000000C
| 0x0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
| 0x0000000D
| 0x0100000000001004
| LibraryAppletDataErase (dataErase)
|-
| 0x0000000E
| 0x0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
|-
| 0x0000000F
| 0x0100000000001006
| LibraryAppletNetConnect (netConnect)
|-
| 0x00000010
| 0x0100000000001007
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
|-
| 0x00000011
| 0x0100000000001008
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
|-
| 0x00000012
| 0x0100000000001009
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
|-
| 0x00000013
| [22.0.0+] 0x0100000000001043 ([1.0.0-21.2.0] 0x010000000000100A)
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
| 0x00000014
| 0x010000000000100B
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
| 0x00000015
| 0x010000000000100D
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
| 0x00000016
| 0x010000000000100E
| LibraryAppletSet (set)
|-
| 0x00000017
| 0x010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
| 0x00000018
| [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)
|-
| 0x01030065
|
| [S2] Chat (ForCameraSharingGuide)
|-
| 0x700000C8
| 0x010000000000D65B
| [18.0.0+]
|-
| 0x700000C9
| 0x010000000000D65C
| [18.0.0+]
|-
| 0x700000DC
| 0x010000000000D619
| [17.0.0+] CombinationLA
|-
| 0x700000E6
| 0x010000000000D610
| [17.0.0+] AeSystemApplet
|-
| 0x700000E7
| 0x010000000000D611
| [17.0.0+] AeOverlayApplet
|-
| 0x700000E8
| 0x010000000000D612
| [17.0.0+] AeStarter
|-
| 0x700000E9
| 0x010000000000D613
| [17.0.0+] AeLibraryAppletAlone
|-
| 0x700000EA
| 0x010000000000D614
| [17.0.0+] AeLibraryApplet1
|-
| 0x700000EB
| 0x010000000000D615
| [17.0.0+] AeLibraryApplet2
|-
| 0x700000EC
| 0x010000000000D616
| [17.0.0+] AeLibraryApplet3
|-
| 0x700000ED
| 0x010000000000D617
| [17.0.0+] AeLibraryApplet4
|-
| 0x700000F0
| 0x010000000000D60A
| [17.0.0+] AppletISA
|-
| 0x700000F1
| 0x010000000000D60B
| [17.0.0+] AppletIOA
|-
| 0x700000F2
| 0x010000000000D60C
| [17.0.0+] AppletISTA
|-
| 0x700000F3
| 0x010000000000D60D
| [17.0.0+] AppletILA1
|-
| 0x700000F4
| 0x010000000000D60E
| [17.0.0+] AppletILA2
|-
| 0x700000FA
| 0x010000000000D677
| [20.1.0+]
|}
 
= LibraryAppletMode =
This is "nn::applet::LibraryAppletMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0x0
| AllForeground
|-
| 0x1
| PartialForeground
|-
| 0x2
| NoUi
|-
| 0x3
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])
|-
| 0x4
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])
|}
 
= AppletMessage =
This is "nn::am::AppletMessage".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || None
|-
| 1 || ChangeIntoForeground
|-
| 2 || ChangeIntoBackground
|-
| 4 || Exit
|-
| 6 || ApplicationExited
|-
| 7 ||
|-
| 15 || [[#FocusState|FocusStateChanged]]
|-
| 16 || [[#SetRestartMessageEnabled|Resume]]
|-
| 20 || DetectShortPressingHomeButton
|-
| 21 || DetectLongPressingHomeButton
|-
| 22 || DetectShortPressingPowerButton
|-
| 23 || DetectMiddlePressingPowerButton
|-
| 24 || DetectLongPressingPowerButton
|-
| 25 || RequestToPrepareSleep
|-
| 26 || FinishedSleepSequence
|-
| 27 || SleepRequiredByHighTemperature
|-
| 28 || SleepRequiredByLowBattery
|-
| 29 || AutoPowerDown
|-
| 30 || [[#OperationMode|OperationModeChanged]]
|-
| 31 || [[#PerformanceMode|PerformanceModeChanged]]
|-
| 32 || DetectReceivingCecSystemStandby
|-
| 33 || SdCardRemoved
|-
| 34 ||
|-
| 50 || LaunchApplicationRequested
|-
| 51 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]
|-
| 55 || ShowApplicationLogo
|-
| 56 || HideApplicationLogo
|-
| 57 || ForceHideApplicationLogo
|-
| 58 ||
|-
| 59 ||
|-
| 60 || FloatingApplicationDetected
|-
| 61 || [7.0.0+] PerformanceConfigurationChanged
|-
| 70 ||
|-
| 71 ||
|-
| 72 ||
|-
| 73 ||
|-
| 75 ||
|-
| 80 ||
|-
| 81 ||
|-
| 82 ||
|-
| 83 ||
|-
| 85 ||
|-
| 86 ||
|-
| 90 || [[#SetRequiresCaptureButtonShortPressedMessage|DetectShortPressingCaptureButton]]
|-
| 92 || [[#SetAlbumImageTakenNotificationEnabled|AlbumScreenShotTaken]]
|-
| 93 || AlbumRecordingSaved
|-
| 94 ||
|-
| 100 ||
|-
| 101 ||
|-
| 110 || [14.0.0+] DetectShortPressingCaptureButtonForApplet
|-
| 111 || [14.0.0+] DetectLongPressingCaptureButtonForApplet
|-
| 1000 ||
|}
 
= OperationMode =
This is "nn::oe::OperationMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Handheld
|-
| 1 || Console
|}
 
= PerformanceMode =
This is "nn::oe::PerformanceMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| -1 || Invalid
|-
| 0 || Normal
|-
| 1 || Boost
|}
 
= FocusState =
This is "nn::oe::FocusState".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 1 || InFocus
|-
| 2 || OutOfFocus
|-
| 3 || Background
|}
 
= CpuBoostMode =
This is "nn::oe::CpuBoostMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Normal
|-
| 1 || FastLoad
|}
 
= WindowOriginMode =
This is "nn::oe::WindowOriginMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || LowerLeft
|-
| 1 || UpperLeft
|}
 
= WirelessPriorityMode =
This is "nn::oe::WirelessPriorityMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Default
|-
| 1 || OptimizedForWlan
|}
 
= TvPowerStateMatchingMode =
This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Unknown
|-
| 1 || Unknown
|}
 
= SystemButtonType =
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 1 || PerformHomeButtonShortPressing
|-
| 2 || PerformHomeButtonLongPressing
|-
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
|-
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
|-
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].
|-
| 6 || PerformCaptureButtonShortPressing
|-
| 7 || PerformCaptureButtonLongPressing
|}
 
= LaunchParameterKind =
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 1 || UserChannel. Application-specific LaunchParameter.
|-
| 2 || account PreselectedUser
|-
| 3 || Unknown if used by anything?
|}
 
= LibraryAppletExitReason =
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Normal
|-
| 1 || Canceled
|-
| 2 || Abnormal
|-
| 10 || Unexpected
|}
 
= ProgramSpecifyKind =
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || u8 ProgramIndex. "ExecuteProgram". [[NS_Services|NS]] handles ProgramIndex by launching ApplicationId+ProgramIndex. After using [[#ExecuteProgram]] with this successfully, official user-processes will enter an infinite loop with sleep-thread value 86400000000000.
|-
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
|-
| 2 || u64 = value 0. "RestartProgram"
|}
 
ProgramIndex values where the title is not installed should not be used: [[qlaunch]] will display an error message and the current title will become "corrupted", however Home Menu will have an option to repair it.
 
= InputDetectionPolicy =
This is u32 enum "nn::applet::InputDetectionPolicy".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Unknown
|-
| 1 || Unknown
|}
 
= AppletResourceUserId =
This is "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
 
= AppletAttribute =
This is "nn::am::AppletAttribute". This struct is 0x80 bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
|-
| 0x1 || 0x7F || Unused
|}
 
This is used by [[#OpenLibraryAppletProxy]].
 
= AppletProcessLaunchReason =
This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].
|-
| 0x1 || 0x2 || Always 0.
|-
| 0x3 || 0x1 || Always 0.
|}
 
= LibraryAppletInfo =
This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#AppletId]]
|-
| 0x4 || 0x4 || [[#LibraryAppletMode]]
|}
 
= AppletKind =
This is "nn::am::service::AppletKind". This is 8-bytes.
 
= AppletIdentityInfo =
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#AppletId]]
|-
| 0x4 || 0x4 || Padding
|-
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|}
 
= ApplicationAttributeForQuest =
This struct is "nn::applet::ApplicationAttributeForQuest".
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
|}
 
User-processes copy the first 0x8-bytes (0xC-bytes with [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]/[[#CreateApplicationWithAttributeAndRequestToStartForQuest]]) to a [[#ApplicationAttribute]] with the rest of the struct being cleared, which is then passed to the actual cmd (CreateApplication*ToStartForQuest).
 
= ApplicationAttribute =
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
|-
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
|-
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
|-
| 0xC || 0x14 || Unused. Default is 0.
|}
 
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
 
= ApplicationLaunchProperty =
This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x8 || 0x4 || Application title-version.
|-
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
|-
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
|-
| 0xE || 0x1 || Unknown.
|-
| 0xF || 0x1 || Padding.
|}
 
= ApplicationLaunchRequestInfo =
This is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
|-
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
|-
| 0x8 || 0x8 || Unknown. The default is 0x0.
|}
 
= AppletResourceUsageInfo =
This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Unknown counter.
|-
| 0x4 || 0x4 || Unknown counter.
|-
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
|-
| 0xC || 0x14 || Always zero.
|}
 
= ApplicationLicenseType =
This is "nn::oe::ApplicationLicenseType". This is 1-byte.
 
= LaunchRequiredVersion =
This is "nn::oe::LaunchRequiredVersion". This is a 0x40-byte struct with 1-byte alignment.
 
= ServerEnvironmentType =
This is "nn::oe::ServerEnvironmentType".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || dd
|-
| 1 || lp
|-
| 2 || sd
|-
| 3 || sp
|-
| 4 || dp
|}
|}


= ApplicationAttributeForQuest =
= (S2) AdrawFrameBufferInfo =
This struct is "nn::applet::ApplicationAttributeForQuest".
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
| 0x0 || 0x8 || Id
|-
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
|-
|-
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
| 0x8 || 0x2 || Width
|}
 
User-processes copy the first 0x8-bytes (0xC-bytes with [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]/[[#CreateApplicationWithAttributeAndRequestToStartForQuest]]) to a [[#ApplicationAttribute]] with the rest of the struct being cleared, which is then passed to the actual cmd (CreateApplication*ToStartForQuest).
 
= ApplicationAttribute =
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 0xA || 0x2 || Height
|-
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
| 0xC || 0x4 || BlockCount
|-
|-
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
| 0x10 || 0x8 ||  
|-
|-
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
| 0x18 || 0x8 ||  
|-
|-
| 0xC || 0x14 || Unused. Default is 0.
| 0x20 || 0x8 ||  
|}
|}


Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
= (S2) ImageInfo =
 
= ApplicationLaunchProperty =
This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
| 0x0 || 0x8 ||  
|-
|-
| 0x8 || 0x4 || Application title-version.
| 0x8 || 0x8 || Address
|-
|-
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
| 0x10 || 0x8 ||  
|-
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
|-
|-
| 0xE || 0x1 || Unknown.
| 0x18 || 0x8 ||  
|-
|-
| 0xF || 0x1 || Padding.
| 0x20 || 0x8 ||  
|}
 
= ApplicationLaunchRequestInfo =
This is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 0x28 || 0x8 ||  
|-
|-
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
| 0x30 || 0x8 ||  
|-
|-
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
| 0x38 || 0x4 || Offset
|-
|-
| 0x8 || 0x8 || Unknown. The default is 0x0.
| 0x3C || 0x4 || Size
|}
 
= AppletResourceUsageInfo =
This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 0x40 || 0x8 ||  
|-
|-
| 0x0 || 0x4 || Unknown counter.
| 0x48 || 0x8 ||  
|-
|-
| 0x4 || 0x4 || Unknown counter.
| 0x50 || 0x8 ||  
|-
|-
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
| 0x58 || 0x8 ||  
|-
|-
| 0xC || 0x14 || Always zero.
| 0x60 || 0x8 ||  
|}
 
= ApplicationLicenseType =
This is "nn::oe::ApplicationLicenseType". This is 1-byte.
 
= LaunchRequiredVersion =
This is "nn::oe::LaunchRequiredVersion". This is a 0x40-byte struct with 1-byte alignment.
 
= ServerEnvironmentType =
This is "nn::oe::ServerEnvironmentType".
 
{| class="wikitable" border="1"
|-
|-
! Value
| 0x68 || 0x8 ||
! Description
|-
|-
| 0 || dd
| 0x70 || 0x8 ||  
|-
|-
| 1 || lp
| 0x78 || 0x8 ||  
|-
|-
| 2 || sd
| 0x80 || 0x8 ||  
|-
|-
| 3 || sp
| 0x88 || 0x8 ||  
|-
|-
| 4 || dp
| 0x90 || 0x4 || Flags
|}
|}