Applet Manager services: Difference between revisions

PrepareForJit: jit details
 
(147 intermediate revisions by 5 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 23: Line 27:
|-
|-
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
|-
| 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 58: 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 65: Line 78:


== ISystemAppletProxy ==
== ISystemAppletProxy ==
This is "nn::am::service::ISystemAppletProxy".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 95: Line 110:


=== IHomeMenuFunctions ===
=== IHomeMenuFunctions ===
This is "nn::am::service::IHomeMenuFunctions".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 10 || [[#RequestToGetForeground]]
|-
| 11 || [[#LockForeground]]
|-
| 12 || [[#UnlockForeground]]
|-
| 20 || [[#PopFromGeneralChannel]]
|-
| 21 || [[#GetPopFromGeneralChannelEvent]]
|-
| 30 || [[#GetHomeButtonWriterLockAccessor]]
|-
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]]
|-
|-
| 10 || [[#RequestToGetForeground]] ||
| 40 || [11.0.0+] [[#IsSleepEnabled]]
|-
|-
| 11 || [[#LockForeground]] ||
| 41 || [12.0.0+] [[#IsRebootEnabled]]
|-
|-
| 12 || [[#UnlockForeground]] ||
| 50 || [16.0.0+] [[#LaunchSystemApplet]]
|-
|-
| 20 || [[#PopFromGeneralChannel]] ||
| 51 || [16.0.0+] [[#LaunchStarter]]
|-
|-
| 21 || [[#GetPopFromGeneralChannelEvent]] ||
| 60 || [19.0.0+]  
|-
|-
| 30 || [[#GetHomeButtonWriterLockAccessor]] ||
| 61 || [19.0.0+]  
|-
|-
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]] ||
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]]
|-
|-
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]] ||
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]]
|-
|-
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]] ||
| 200 || [8.0.0+] [[#LaunchDevMenu]]
|-
|-
| 200 || [8.0.0+] [[#LaunchDevMenu]] ||
| 1000 || [11.0.0+] [[#SetLastApplicationExitReason]]
|}
|}


Line 144: Line 175:


The input value must be 0-3. 0 = HomeButton.
The input value must be 0-3. 0 = HomeButton.
==== IsSleepEnabled ====
No input, returns an output bool.
==== IsRebootEnabled ====
No input, returns an output bool.
==== LaunchSystemApplet ====
No input/output.
This wraps [[NS_Services|ns]] LaunchSystemApplet, ignoring the u64 returned by that cmd (and other functionality).
==== LaunchStarter ====
No input/output.
This is similar to [[#LaunchSystemApplet]], except this uses [[NS_Services|ns]] LaunchLibraryApplet with a ProgramId from global state.
The global state field is initialized elsewhere with the value of [[System_Settings|system-setting]] <code>am.debug!starter_id</code>, defaulting to ProgramId 0100000000001012 ([[Title_list|starter]]) if not available.


==== PopRequestLaunchApplicationForDebug ====
==== PopRequestLaunchApplicationForDebug ====
Line 160: Line 209:
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.


Uses [[NS_Services#IApplicationManagerInterface]] cmd99.
Uses [[NS_Services|ns]] LaunchDevMenu.


This is used by [[qlaunch]]. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
This is used by [[qlaunch]]. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
==== SetLastApplicationExitReason ====
Takes an input s32, no output.


==== ILockAccessor ====
==== ILockAccessor ====
This is "nn::am::service::ILockAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 195: Line 249:


=== IGlobalStateController ===
=== IGlobalStateController ===
This is "nn::am::service::IGlobalStateController".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [[#RequestToEnterSleep]]
|-
| 1 || [[#EnterSleep]]
|-
|-
| 0 || [[#RequestToEnterSleep]] ||
| 2 || [[#StartSleepSequence]]
|-
|-
| 1 || [[#EnterSleep]] ||
| 3 || [[#StartShutdownSequence]]
|-
|-
| 2 || [[#StartSleepSequence]] ||
| 4 || [[#StartRebootSequence]]
|-
|-
| 3 || [[#StartShutdownSequence]] ||
| 9 || [7.0.0+] [[#IsAutoPowerDownRequested]]
|-
|-
| 4 || [[#StartRebootSequence]] ||
| 10 || [[#LoadAndApplyIdlePolicySettings]]
|-
|-
| 9 || [7.0.0+] [[#IsAutoPowerDownRequested]] ||
| 11 || [2.0.0+] [[#NotifyCecSettingsChanged]]
|-
|-
| 10 || [[#LoadAndApplyIdlePolicySettings]] ||
| 12 || [3.0.0+] [[#SetDefaultHomeButtonLongPressTime]]
|-
|-
| 11 || [2.0.0+] [[#NotifyCecSettingsChanged]] ||
| 13 || [3.0.0+] [[#UpdateDefaultDisplayResolution]]
|-
|-
| 12 || [3.0.0+] [[#SetDefaultHomeButtonLongPressTime]] ||
| 14 || [3.0.0+] [[#ShouldSleepOnBoot]]
|-
|-
| 13 || [3.0.0+] [[#UpdateDefaultDisplayResolution]] ||
| 15 || [4.0.0+] [[#GetHdcpAuthenticationFailedEvent]]
|-
|-
| 14 || [3.0.0+] [[#ShouldSleepOnBoot]] ||
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]
|-
|-
| 15 || [4.0.0+] [[#GetHdcpAuthenticationFailedEvent]] ||
| 100 || [S2]
|}
|}


Line 278: Line 338:
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.


=== IApplicationCreator ===
==== OpenCradleFirmwareUpdater ====
{| class="wikitable" border="1"
No input, returns an [[#ICradleFirmwareUpdater]].
 
==== Cmd100 ====
No input, returns an output handle.
 
=== ICradleFirmwareUpdater ===
This is "nn::am::service::ICradleFirmwareUpdater".
 
This was added with [12.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || StartUpdate
|-
|-
! Cmd || Name || Notes
| 1 || FinishUpdate
|-
| 2 || [[#GetCradleDeviceInfo]]
|-
| 3 || GetCradleDeviceInfoChangeEvent
|-
| 4 || GetUpdateProgressInfo
|-
| 5 || GetLastInternalResult
|}
 
==== GetCradleDeviceInfo ====
No input, returns a 8-byte CradleDeviceInfo.
 
[13.0.0+] Now returns a total of 0xC-bytes.
 
=== IApplicationCreator ===
This is "nn::am::service::IApplicationCreator".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
|-
| 0 || [[#CreateApplication]] ||
| 0 || [[#CreateApplication]]
|-
|-
| 1 || [[#PopLaunchRequestedApplication]] ||
| 1 || [[#PopLaunchRequestedApplication]]
|-
|-
| 10 || [[#CreateSystemApplication]] ||
| 10 || [[#CreateSystemApplication]]
|-
|-
| 100 || [[#PopFloatingApplicationForDevelopment]] ||
| 100 || [[#PopFloatingApplicationForDevelopment]]
|}
|}


Line 311: Line 406:


==== IApplicationAccessor ====
==== IApplicationAccessor ====
This is "nn::am::service::IApplicationAccessor".
{| 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 453: Line 556:


===== IAppletAccessor =====
===== IAppletAccessor =====
This is "nn::am::service::IAppletAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 489: Line 594:


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


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [9.0.0+] [[#SetTerminateResult]]
|-
| 10 || [[#ReadThemeStorage]]
|-
| 11 || [[#WriteThemeStorage]]
|-
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]]
|-
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]]
|-
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]]
|-
| 42 || [8.0.0+] [[#SetDisplayMagnification]]
|-
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]]
|-
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]]
|-
| 52 || [10.0.0+] [[#IsHomeButtonShortPressedBlocked]]
|-
| 60 || [11.0.0+] [[#IsVrModeCurtainRequired]]
|-
| 61 || [12.0.0+] IsSleepRequiredByHighTemperature
|-
| 62 || [12.0.0+] IsSleepRequiredByLowBattery
|-
| 70 || [11.0.0+] [[#SetCpuBoostRequestPriority]]
|-
| 80 || [14.0.0+] SetHandlingCaptureButtonShortPressedMessageEnabledForApplet
|-
| 81 || [14.0.0+] SetHandlingCaptureButtonLongPressedMessageEnabledForApplet
|-
| 82 || [18.0.0+] SetBlockingCaptureButtonInEntireSystem
|-
| 90 || [15.0.0+] OpenNamedChannelAsParent
|-
| 91 || [15.0.0+] OpenNamedChannelAsChild
|-
|-
| 0 || [9.0.0+] [[#SetTerminateResult]] ||
| 100 || [15.0.0+] SetApplicationCoreUsageMode
|-
|-
| 10 || [[#ReadThemeStorage]] ||
| 110 || [S2]
|-
|-
| 11 || [[#WriteThemeStorage]] ||
| 111 || [S2]
|-
|-
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]] ||
| 112 || [S2]
|-
|-
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]] ||
| 113 || [S2]
|-
|-
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]] ||
| 114 || [S2]
|-
|-
| 42 || [8.0.0+] [[#SetDisplayMagnification]] ||
| 115 || [S2]
|-
|-
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]] ||
| 116 || [S2]
|-
|-
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]] ||
| 117 || [S2]
|-
|-
| 52 || [10.0.0+] [[#IsHomeButtonShortPressedBlocked]] ||
| 118 || [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.
 
== ILibraryAppletProxy ==
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 119 || [S2]
|-
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
| 120 || [S2]
|-
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
| 121 || [S2]
|-
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
| 122 || [S2]
|-
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
| 123 || [S2]
|-
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
| 124 || [S2]
|-
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
| 130 || [S2]
|-
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 131 || [S2] [20.0.0+]
|-
|-
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
| 135 || [S2] [20.0.0+]
|-
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
| 140 || [S2]
|-
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 150 || [S2]
|}
 
=== ILibraryAppletSelfAccessor ===
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 160 || [18.0.0+] [[#GetNotificationReceiverService|GetNotificationReceiverService]]
|-
| 161 || [18.0.0+] [[#GetNotificationSenderService|GetNotificationSenderService]]
|-
|-
| 0 || [[#PopInData]] ||
| 170 || [S2]
|-
|-
| 1 || [[#PushOutData]] ||
| 171 || [S2]
|-
|-
| 2 || [[#PopInteractiveInData]] ||
| 200 || [S2]
|-
|-
| 3 || [[#PushInteractiveOutData]] ||
| 210 || [S2]
|-
|-
| 5 || [[#GetPopInDataEvent]] ||
| 211 || [S2]
|-
|-
| 6 || [[#GetPopInteractiveInDataEvent]] ||
| 220 || [S2]
|-
|-
| 10 || [[#ExitProcessAndReturn]] ||
| 221 || [S2]
|-
|-
| 11 || [[#GetLibraryAppletInfo]] ||
| 230 || [S2]
|-
|-
| 12 || [[#GetMainAppletIdentityInfo]] ||
| 231 || [S2]
|-
|-
| 13 || [[#CanUseApplicationCore]] ||
| 250 || [S2]
|-
|-
| 14 || [[#GetCallerAppletIdentityInfo]] ||
| 251 || [S2]
|-
|-
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
| 252 || [S2]
|-
|-
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
| 253 || [S2]
|-
|-
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||
| 260 || [S2]
|-
|-
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||
| 271 || [S2] [20.0.0+]
|-
|-
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||
| 280 || [S2] [20.0.0+]
|-
|-
| 20 || [[#PopExtraStorage]] ||
| 290 || [S2] [20.0.0+] RequestChatProhibition
|-
|-
| 25 || [[#GetPopExtraStorageEvent]] ||
| 291 || [S2] [20.0.0+] RequestChatExpirationCheckSkip
|-
|-
| 30 || [[#UnpopInData]] ||
| 300 || [17.0.0+] GetCurrentApplicationId
|-
|-
| 31 || [[#UnpopExtraStorage]] ||
| 310 || [19.0.0+] IsSystemAppletHomeMenu
|-
|-
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||
| 311 || [20.0.0+]
|-
|-
| 50 || [3.0.0+] [[#ReportVisibleError]] ||
| 320 || [19.0.0+] SetGpuTimeSliceBoost
|-
|-
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||
| 321 || [19.0.0+] SetGpuTimeSliceBoostDueToApplication
|-
|-
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||
| 322 || [20.0.0+]
|-
|-
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||
| 330 || [19.0.0+]  
|-
|-
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||
| 340 || [20.0.0+]
|-
|-
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||
| 341 || [20.0.0+]
|-
|-
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||
| 342 || [20.0.0+]
|-
|-
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||
| 350 || [20.0.0+]
|-
|-
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||
| 360 || [20.0.0+]
|-
|-
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
| 370 || [22.0.0+] GetGpuErrorEventForApplet
|-
|-
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
| 2000 || [S2]
|-
|-
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
| 2010 || [S2]
|-
|-
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||
| 3000 || [S2] [20.0.0+]
|-
|-
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
| 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.


==== GetPopInteractiveInDataEvent ====
=== TryPopFromAppletBoundChannel ===
No input, returns an output Event handle with autoclear=false.
No input, returns an output [[#IStorage]].


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


Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).
=== GetDisplayLogicalResolution ===
No input, returns an output s32 '''width''' and s32 '''height'''.


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
=== SetDisplayMagnification ===
Takes an input float '''x''', float '''y''', float '''width''', and float '''height''', no output.


==== GetLibraryAppletInfo ====
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.
No input, returns an output [[#LibraryAppletInfo]].


==== GetMainAppletIdentityInfo ====
'''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 [[#AppletIdentityInfo]].


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


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


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


This gets the [[NACP_Format|control.nacp]].
=== IsVrModeCurtainRequired ===
No input, returns an output bool.


==== GetMainAppletStorageId ====
=== SetCpuBoostRequestPriority ===
No input, returns an output u8 storageId.
Takes an input s32, no output.


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


==== GetNextReturnDestinationAppletIdentityInfo ====
=== GetNotificationSenderService ===
No input, returns an output [[#AppletIdentityInfo]].
No input, returns an [[#ISenderService|ISenderService]].


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


The output u32 is "nn::settings::KeyboardLayout".
This was added with [18.0.0+].


This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it's not set.
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|}


==== PopExtraStorage ====
==== Cmd0 ====
No input, returns an output [[#IStorage]].
No input, returns an [[#INotificationReceiver|INotificationReceiver]].


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


==== UnpopInData ====
This was added with [18.0.0+].
Takes an input [[#IStorage]], no output.


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


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


==== ReportVisibleErrorWithErrorContext ====
No input, returns an Event handle.
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.


==== GetMainAppletApplicationDesiredLanguage ====
===== ReceiveWithTick =====
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
Unofficial name.


==== GetCurrentApplicationId ====
=== ISenderService ===
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
This is "nn::am::service::ISenderService".


Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.
This was added with [18.0.0+].


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


Same as [[#RequestExit]] except this is for the current applet.
==== Cmd0 ====
Takes a total of 0x18-bytes of input, returns an [[#INotificationSender|INotificationSender]].


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


This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
This was added with [18.0.0+].


==== CreateGameMovieTrimmer ====
{| class="wikitable" border="1"
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
|-
! Cmd || Name
|-
| 0 || Send
|-
| 1 || GetUnreceivedMessageCount
|}


This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].
== ILibraryAppletProxy ==
This is "nn::am::service::ILibraryAppletProxy".


Official sw uses an user-buffer for the tmem, with permissions=0.
{| class="wikitable" border="1"
 
==== ReserveResourceForMovieOperation ====
No input/output.
 
Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].
 
==== UnreserveResourceForMovieOperation ====
No input/output.
 
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.
 
== IOverlayAppletProxy ==
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name || Notes
Line 805: Line 899:
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
|-
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}
|}


=== IOverlayFunctions ===
=== ILibraryAppletSelfAccessor ===
This is "nn::am::service::ILibraryAppletSelfAccessor".
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name || Notes
|-
| 0 || [[#PopInData]] ||
|-
| 1 || [[#PushOutData]] ||
|-
|-
| 0 || [[#BeginToWatchShortHomeButtonMessage]]
| 2 || [[#PopInteractiveInData]] ||
|-
|-
| 1 || [[#EndToWatchShortHomeButtonMessage]]
| 3 || [[#PushInteractiveOutData]] ||
|-
|-
| 2 || [[#GetApplicationIdForLogo]]
| 5 || [[#GetPopInDataEvent]] ||
|-
|-
| 3 || [[#SetGpuTimeSliceBoost]]
| 6 || [[#GetPopInteractiveInDataEvent]] ||
|-
|-
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]
| 10 || [[#ExitProcessAndReturn]] ||
|-
|-
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]
| 11 || [[#GetLibraryAppletInfo]] ||
|-
|-
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]
| 12 || [[#GetMainAppletIdentityInfo]] ||
|-
|-
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]
| 13 || [[#CanUseApplicationCore]] ||
|-
|-
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]
| 14 || [[#GetCallerAppletIdentityInfo]] ||
|-
|-
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
|-
|-
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
|-
|-
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||
|-
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||
|-
|-
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||
|}
|-
 
| 20 || [[#PopExtraStorage]] ||
==== BeginToWatchShortHomeButtonMessage ====
|-
No input/output.
| 25 || [[#GetPopExtraStorageEvent]] ||
 
|-
==== EndToWatchShortHomeButtonMessage ====
| 30 || [[#UnpopInData]] ||
No input/output.
|-
 
| 31 || [[#UnpopExtraStorage]] ||
==== GetApplicationIdForLogo ====
|-
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||
 
|-
Gets the ApplicationId for displaying the logo screen during application launch.
| 50 || [3.0.0+] [[#ReportVisibleError]] ||
 
|-
When no application is running, this returns success with ApplicationId=0.
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||
 
|-
==== SetGpuTimeSliceBoost ====
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||
Takes an input u64, no output.
|-
 
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||
==== SetAutoSleepTimeAndDimmingTimeEnabled ====
|-
Takes an input u8 bool, no output.
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||
 
|-
==== TerminateApplicationAndSetReason ====
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||
Takes an input u32 Result, no output.
|-
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||
|-
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||
|-
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||
|-
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
|-
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
|-
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
|-
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||
|-
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
|-
| 160 || [17.0.0+] [[#GetLibraryAppletInfoEx]] ||
|}


==== SetScreenShotPermissionGlobally ====
==== PopInData ====
Takes an input u8 bool, no output.
No input, returns an output [[#IStorage]].


==== StartShutdownSequenceForOverlay ====
==== PushOutData ====
No input/output.
Takes an input [[#IStorage]], no output.


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


==== StartRebootSequenceForOverlay ====
==== PushInteractiveOutData ====
No input/output.
Takes an input [[#IStorage]], no output.


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
==== GetPopInDataEvent ====
No input, returns an output Event handle with autoclear=false.
 
==== GetPopInteractiveInDataEvent ====
No input, returns an output Event handle with autoclear=false.
 
==== ExitProcessAndReturn ====
No input/output.


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


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


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


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


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


Just returns 0.
==== GetMainAppletApplicationControlProperty ====
No input, takes a type-0x16 output buffer.


==== BeginToObserveHidInputForDevelop ====
This gets the [[NACP_Format|control.nacp]].
No input/output.


Sets various state fields and signals an userspace-event.
==== GetMainAppletStorageId ====
No input, returns an output u8 storageId.


Enables HID input for the OverlayApplet, without disabling input for the foreground applet.
==== GetCallerAppletIdentityInfoStack ====
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.


== IApplicationProxy ==
==== GetNextReturnDestinationAppletIdentityInfo ====
{| class="wikitable" border="1"
No input, returns an output [[#AppletIdentityInfo]].
|-
 
! Cmd || Name || Notes
==== GetDesirableKeyboardLayout ====
|-
No input, returns an output u32.
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
 
|-
The output u32 is "nn::settings::KeyboardLayout".
| 1 || GetSelfController || Returns an [[#ISelfController]].
 
|-
This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it's not set.
| 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]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}


=== IApplicationFunctions ===
==== PopExtraStorage ====
{| class="wikitable" border="1"
No input, returns an output [[#IStorage]].
|-
 
! Cmd || Name || Notes
==== GetPopExtraStorageEvent ====
|-
No input, returns an output Event handle with autoclear=false.
| 1 || [[#PopLaunchParameter]] ||
 
|-
==== UnpopInData ====
| 10 || [[#CreateApplicationAndPushAndRequestToStart]] ||
Takes an input [[#IStorage]], no output.
|-
 
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]] ||
==== UnpopExtraStorage ====
|-
Takes an input [[#IStorage]], no output.
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]] ||
 
|-
==== GetIndirectLayerProducerHandle ====
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]] ||
No input, returns an output u64.
|-
 
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]] ||
==== ReportVisibleError ====
|-
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]] ||
 
|-
==== ReportVisibleErrorWithErrorContext ====
| 20 || [[#EnsureSaveData]] ||
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.
|-
| 21 || [[#GetDesiredLanguage]] ||
|-
| 22 || [[#SetTerminateResult]] ||
|-
| 23 || [[#GetDisplayVersion]] ||
|-
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
|-
| 25 || [3.0.0+] ExtendSaveData ||
|-
| 26 || [3.0.0+] GetSaveDataSize ||
|-
| 27 || [5.0.0+] CreateCacheStorage ||
|-
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]] ||
|-
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]] ||
|-
| 32 || [[#BeginBlockingHomeButton]] ||
|-
| 33 || [[#EndBlockingHomeButton]] ||
|-
| 34 || [10.0.0+] [[#SelectApplicationLicense]] ||
|-
| 40 || [[#NotifyRunning]] ||
|-
| 50 || [2.0.0+] [[#GetPseudoDeviceId]] ||
|-
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]] ||
|-
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]] ||
|-
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]] ||
|-
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]] ||
|-
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]] ||
|-
| 70 || [3.0.0+] [[#RequestToShutdown]] ||
|-
| 71 || [3.0.0+] [[#RequestToReboot]] ||
|-
| 72 || [10.0.0+] [[#RequestToSleep]] ||
|-
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]] ||
|-
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]] ||
|-
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]] ||
|-
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]] ||
|-
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]] ||
|-
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]] ||
|-
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]] ||
|-
| 120 || [5.0.0+] [[#ExecuteProgram]] ||
|-
| 121 || [5.0.0+] [[#ClearUserChannel]] ||
|-
| 122 || [5.0.0+] [[#UnpopToUserChannel]] ||
|-
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]] ||
|-
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]] ||
|-
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
|-
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]] ||
|-
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] ||
|-
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]] ||
|-
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]] ||
|-
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]] ||
|-
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]] ||
|-
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]] ||
|-
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]] ||
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]] ||
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]] ||
|-
| 1001 || [5.0.0+] [[#PrepareForJit]] ||
|}


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):
==== GetMainAppletApplicationDesiredLanguage ====
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
* 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 ====
==== GetCurrentApplicationId ====
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].


Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.


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


==== CreateApplicationAndPushAndRequestToStartForQuest ====
Same as [[#RequestExit]] except this is for the current applet.
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.


==== CreateApplicationAndRequestToStart ====
==== CreateApplicationAndPushAndRequestToLaunch ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.


Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].


==== CreateApplicationAndRequestToStartForQuest ====
==== CreateGameMovieTrimmer ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].


Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].


==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Official sw uses an user-buffer for the tmem, with permissions=0.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no 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]].
==== ReserveResourceForMovieOperation ====
No input/output.


==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no 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]].
==== UnreserveResourceForMovieOperation ====
No input/output.


==== EnsureSaveData ====
Updates state fields. This must be used once finished with [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
Takes an input u128 userID, returns an output u64 size.


Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.
==== GetMainAppletAvailableUsers ====
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 '''total_entries'''.


Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
This gets the userIDs previously set by [[#SetUsers]].


Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
The size of the output buffer in entries must be at least 8.


==== GetDesiredLanguage ====
Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].


==== SetTerminateResult ====
==== SetApplicationMemoryReservation ====
Takes an input u32 '''Result''', no output.
Takes an input u64, no output.


For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.
An Application must be currently running. The input u64 must be 0x1000-byte aligned.


==== GetDisplayVersion ====
==== ShouldSetGpuTimeSliceManually ====
No input, returns an output 0x10-byte struct.
No input, returns an output u8 bool.


The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.
==== GetLibraryAppletInfoEx ====
No input, returns an output u64. Currently always returns 0.


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


This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
{| class="wikitable" border="1"
 
|-
==== BeginBlockingHomeButtonShortAndLongPressed ====
! Cmd || Name || Notes
Takes an input s64, no output.
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}


Official user-processes use hard-coded value 0 for the s64.
=== IOverlayFunctions ===
This is "nn::am::service::IOverlayFunctions".


Starts blocking the Home button.
{| class="wikitable" border="1"
 
|-
==== EndBlockingHomeButtonShortAndLongPressed ====
! Cmd || Name
No input/output.
|-
 
| 0 || [[#BeginToWatchShortHomeButtonMessage]]
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].
|-
 
| 1 || [[#EndToWatchShortHomeButtonMessage]]
==== BeginBlockingHomeButton ====
|-
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.
| 2 || [[#GetApplicationIdForLogo]]
|-
| 3 || [[#SetGpuTimeSliceBoost]]
|-
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]
|-
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]
|-
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]
|-
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]
|-
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]
|-
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled
|-
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
|-
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
|-
| 40 || [18.0.0+] GetApplicationNintendoLogo
|-
| 41 || [18.0.0+] GetApplicationStartupMovie
|-
| 50 || [19.0.0+] SetGpuTimeSliceBoostForApplication
|-
| 60 || [19.0.0+]
|-
| 61 || [S2]
|-
| 70 || [21.0.0+]  
|-
| 71 || [21.0.0+]
|-
| 75 || [21.0.0+]
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
|-
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
|-
| 110 || [S2]
|-
| 1000 || [S2]
|}


==== EndBlockingHomeButton ====
==== BeginToWatchShortHomeButtonMessage ====
No input/output.
 
==== EndToWatchShortHomeButtonMessage ====
No input/output.
No input/output.


==== SelectApplicationLicense ====
==== GetApplicationIdForLogo ====
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].


==== NotifyRunning ====
Gets the ApplicationId for displaying the logo screen during application launch.
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.


==== GetPseudoDeviceId ====
When no application is running, this returns success with ApplicationId=0.
No input, returns an output 0x10-byte "nn::util::Uuid" struct.


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


==== SetMediaPlaybackStateForApplication ====
==== SetAutoSleepTimeAndDimmingTimeEnabled ====
Takes an input u8 bool, no output.
Takes an input u8 bool, no output.


==== IsGamePlayRecordingSupported ====
==== TerminateApplicationAndSetReason ====
No input, returns an output u8 bool.
Takes an input u32 Result, no output.


==== InitializeGamePlayRecording ====
==== SetScreenShotPermissionGlobally ====
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 input u8 bool, no output.


==== SetGamePlayRecordingState ====
==== StartShutdownSequenceForOverlay ====
Takes an input u32. 0 = disable/pause, 1 = enable/restart.
 
==== RequestFlushGamePlayingMovieForDebug ====
No input/output.
No input/output.


Requests to save the video recording, as if the Capture-button was held.
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.


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


==== RequestToReboot ====
==== SetHandlingHomeButtonShortPressedEnabled ====
No input/output.
Takes an input u8 bool, no output.


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


==== RequestToSleep ====
This writes the input bool into state, signals an Event, and returns 0.
No input/output.


==== ExitAndRequestToShowThanksMessage ====
==== IsHealthWarningRequired ====
No input/output.
No input, returns an output u8 bool.


Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.
==== SetRequiresGpuResourceUse ====
 
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
 
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
 
==== EnableApplicationCrashReport ====
Takes an input u8 bool, no output.
Takes an input u8 bool, no output.


==== InitializeApplicationCopyrightFrameBuffer ====
Just returns 0.
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.
==== BeginToObserveHidInputForDevelop ====
No input/output.


User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
Sets various state fields and signals an userspace-event.


This is used as an overlay for screenshots.
Enables HID input for the OverlayApplet, without disabling input for the foreground applet.


==== SetApplicationCopyrightImage ====
== ICMenuProxy ==
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 '''WindowOriginMode''', and no output.
This is "nn::am::service::ICMenuProxy".


The last s32 is "nn::oe::WindowOriginMode". This should be at least 1.
This is exclusive to Switch 2.


'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
{| class="wikitable" border="1"
 
|-
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.
! 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]].
|}


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


Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.
This is exclusive to Switch 2.


==== QueryApplicationPlayStatistics ====
{| class="wikitable" border="1"
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.
|-
 
! Cmd || Name
The number of entries in each array is the same.
|-
 
| 0 ||
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
|-
 
| 1 ||
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.
|-
| 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+]
|}


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


Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
==== Cmd202 ====
Takes {...}, returns an [[#IFocusableLayer|IFocusableLayer]].


==== ExecuteProgram ====
==== ILibraryAppletAgent ====
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.
This is "nn::am::service::ILibraryAppletAgent".


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


Clears the UserChannel used by [[#UnpopToUserChannel]].
{| class="wikitable" border="1"
 
|-
==== UnpopToUserChannel ====
! Cmd || Name
Takes an input [[#IStorage]], no output.
|-
 
| 0 ||
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
|-
| 1 ||
|-
| 2 ||
|-
| 3 ||
|-
| 4 ||
|-
| 5 ||
|-
| 10 ||
|-
| 20 ||
|-
| 21 ||
|-
| 31 ||
|-
| 32 ||
|-
| 33 ||
|-
| 34 ||
|-
| 35 ||
|-
| 40 ||
|-
| 41 ||
|-
| 42 ||
|}


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


==== GetPreviousProgramIndex ====
===== Cmd1 =====
No input, returns an output s32.
Takes an unknown input interface, no output.


Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.
===== Cmd2 =====
No input, returns an [[#IStorage|IStorage]].


==== EnableApplicationAllThreadDumpOnCrash ====
===== Cmd3 =====
Takes an input u8 bool, no output.
Takes an unknown input interface, no output.


==== GetGpuErrorDetectedSystemEvent ====
===== Cmd10 =====
No input, returns an output Event handle with autoclear=false.
No input, returns an [[#IStorage|IStorage]].


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


==== GetFriendInvitationStorageChannelEvent ====
===== Cmd21 =====
No input, returns an output Event handle with EventClearMode=0.
Takes an unknown input interface, no output.


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


==== TryPopFromFriendInvitationStorageChannel ====
This is exclusive to Switch 2.
No input, returns an output [[#IStorage]].


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


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


==== GetNotificationStorageChannelEvent ====
{| class="wikitable" border="1"
No input, returns an output Event handle with EventClearMode=0.
|-
 
! Cmd || Name || Notes
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.
|-
 
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
==== TryPopFromNotificationStorageChannel ====
|-
No input, returns an output [[#IStorage]].
| 1 || GetSelfController || Returns an [[#ISelfController]].
 
|-
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
| 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]].
|}


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


==== GetHealthWarningDisappearedSystemEvent ====
{| class="wikitable" border="1"
No input, returns an output Event with EventClearMode=0.
|-
 
! Cmd || Name
==== SetHdcpAuthenticationActivated ====
|-
Takes an input u8 bool, no output.
| 1 || [[#PopLaunchParameter]]
 
|-
==== GetLaunchRequiredVersion ====
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].
|-
 
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
sdknso passes hard-coded value 0 for the u64.
|-
 
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
==== UpgradeLaunchRequiredVersion ====
|-
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
 
|-
sdknso passes hard-coded value 0 for the u64.
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
 
|-
==== StartContinuousRecordingFlushForDebug ====
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
|-
 
| 20 || [[#EnsureSaveData]]
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.
|-
 
| 21 || [[#GetDesiredLanguage]]
==== CreateMovieMaker ====
|-
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].
| 22 || [[#SetTerminateResult]]
 
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
 
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
 
==== PrepareForJit ====
Takes no input. Launches the [[JIT_services|jit-sysmodule]] if it has not already been launched for the current application, storing a std::shared_ptr<> for jit-sysmodule process tracking object as an IApplicationFunctions member.
 
~IApplicationFunctions() includes:
 
    if (this->jit_process) {
        Terminate(this->jit_process);
        this->jit_process = nullptr;
    }
 
Thus the lifetime of the jit sysmodule is tied to the application which uses it, and each application gets its own fresh copy of the jit sysmodule.
 
=== IMovieMaker ===
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 23 || [[#GetDisplayVersion]]
|-
|-
| 0 || [[#GetGrcMovieMaker]]
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
|-
|-
| 1 || [[#GetLayerHandle]]
| 25 || [3.0.0+] ExtendSaveData
|}
|-
 
| 26 || [3.0.0+] GetSaveDataSize
==== GetGrcMovieMaker ====
|-
No input, returns a GRC [[GRC_services|IMovieMaker]].
| 27 || [5.0.0+] CreateCacheStorage
 
|-
==== GetLayerHandle ====
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
No input, returns an output u64.
|-
 
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
== ILibraryAppletCreator ==
|-
{| class="wikitable" border="1"
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
|-
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
|-
| 32 || [[#BeginBlockingHomeButton]]
|-
| 33 || [[#EndBlockingHomeButton]]
|-
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
|-
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
|-
| 36 || [14.0.0+] GetLimitedApplicationLicense
|-
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
|-
|-
! Cmd || Name || Notes
| 40 || [[#NotifyRunning]]
|-
|-
| 0 || [[#CreateLibraryApplet]] ||
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
|-
|-
| 1 || [[#TerminateAllLibraryApplets]] ||
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
|-
|-
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
|-
|-
| 10 || [[#CreateStorage]] ||
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
|-
|-
| 11 || [[#CreateTransferMemoryStorage]] ||
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
|-
|-
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
|}
 
=== CreateLibraryApplet ===
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
 
=== TerminateAllLibraryApplets ===
No input/output.
 
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
 
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
 
=== AreAnyLibraryAppletsLeft ===
No input, returns an output u8 bool.
 
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
 
Gets whether any LibraryApplets ([[#ILibraryAppletAccessor]]) which were created by the current applet are still open (or by the Application when used from the [[#IApplicationAccessor]] cmd).
 
=== CreateStorage ===
Takes an input s64 for the storage size, returns an [[#IStorage]].
 
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
 
=== CreateTransferMemoryStorage ===
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].
 
The user-process creates the TransferMemory with permissions=0.
 
The TransferMemory is mapped, which can then be accessed via [[#IStorageAccessor]]. The input bool controls whether writing to the storage is allowed: [[#Write]] will throw an error if this flag is not set.
 
=== CreateHandleStorage ===
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.
 
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
 
=== ILibraryAppletAccessor ===
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 70 || [3.0.0+] [[#RequestToShutdown]]
|-
|-
| 0 || [[#GetAppletStateChangedEvent]] ||
| 71 || [3.0.0+] [[#RequestToReboot]]
|-
|-
| 1 || [[#IsCompleted]] ||
| 72 || [10.0.0+] [[#RequestToSleep]]
|-
|-
| 10 || [[#Start]] ||
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
|-
|-
| 20 || [[#RequestExit]] ||
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
|-
|-
| 25 || [[#Terminate]] ||
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]  
|-
|-
| 30 || [[#GetResult]] ||
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
|-
|-
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
|-
|-
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
|-
|-
| 100 || [[#PushInData]] ||
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
|-
|-
| 101 || [[#PopOutData]] ||
| 112 || [20.0.0+]
|-
|-
| 102 || [[#PushExtraStorage]] ||  
| 113 || [20.0.0+]
|-
| 120 || [5.0.0+] [[#ExecuteProgram]]
|-
| 121 || [5.0.0+] [[#ClearUserChannel]]
|-
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
|-
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
|-
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
|-
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
|-
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
|-
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
|-
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]
|-
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
|-
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
|-
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
|-
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]
|-
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]
|-
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]
|-
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]
|-
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
|-
| 210 || [20.0.0+]
|-
| 220 || [20.0.0+] [[#SetAudioOutputPolicy|SetAudioOutputPolicy]]
|-
| 230 || [S2] [20.0.0+] IsTensorRtSupported
|-
|-
| 103 || [[#PushInteractiveInData]] ||
| 300 || [19.0.0+] [[#CreateMovieWriter]]
|-
|-
| 104 || [[#PopInteractiveOutData]] ||
| 310 || [20.0.0+] [[#RequestExitApplicationAndTryPopMessage|RequestExitApplicationAndTryPopMessage]]
|-
|-
| 105 || [[#GetPopOutDataEvent]] ||
| 320 || [20.0.0+]
|-
|-
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
| 321 || [S2] [20.0.0+]
|-
|-
| 110 || [[#NeedsToExitProcess]] ||
| 330 || [20.2.0+] IsLanguageSelectionLimited
|-
|-
| 120 || [[#GetLibraryAppletInfo]] ||
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
|-
|-
| 150 || [[#RequestForAppletToGetForeground]] ||
| 1000 || [5.0.0+] [[#CreateMovieMaker]]
|-
|-
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
| 1001 || [5.0.0+] [[#PrepareForJit]]
|}
|}


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


==== SetOutOfFocusApplicationSuspendingEnabled ====
==== PopLaunchParameter ====
Takes an input u8 bool, no output.
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].


Official sw will assert prior to using this if applet-service was not initialized as *Application.
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.


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


sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.
==== CreateApplicationAndPushAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.


==== PushInData ====
==== CreateApplicationAndRequestToStart ====
Takes an input [[#IStorage]], no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


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


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


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


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


==== GetPopOutDataEvent ====
[21.0.0+] Now returns an output [[#IStorage]].
No input, returns an output handle with autoclear=false.


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


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


Stubbed, just returns an error.
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]].
 
==== EnsureSaveData ====
Takes an input u128 userID, returns an output u64 size.
 
Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.
 
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
 
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
 
==== GetDesiredLanguage ====
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].


==== RequestForAppletToGetForeground ====
==== SetTerminateResult ====
No input/output.
Takes an input u32 '''Result''', no output.


Stubbed, just returns an error.
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.


==== GetIndirectLayerConsumerHandle ====
==== GetDisplayVersion ====
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.
No input, returns an output 0x10-byte struct.


Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.


== ICommonStateGetter ==
==== GetLaunchStorageInfoForDebug ====
{| class="wikitable" border="1"
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
|-
! Cmd || Name || Notes
|-
| 0 || [[#GetEventHandle]] ||
|-
| 1 || [[#ReceiveMessage]] ||
|-
| 2 || [[#GetThisAppletKind]] ||
|-
| 3 || [[#AllowToEnterSleep]] ||
|-
| 4 || [[#DisallowToEnterSleep]] ||
|-
| 5 || [[#GetOperationMode]] ||
|-
| 6 || [[#GetPerformanceMode]] ||
|-
| 7 || [[#GetCradleStatus]] ||
|-
| 8 || [[#GetBootMode]] ||
|-
| 9 || [[#GetCurrentFocusState]] ||
|-
| 10 || [[#RequestToAcquireSleepLock]] ||
|-
| 11 || [[#ReleaseSleepLock]] ||
|-
| 12 || [[#ReleaseSleepLockTransiently]] ||
|-
| 13 || [[#GetAcquiredSleepLockEvent]] ||
|-
| 20 || [[#PushToGeneralChannel]] ||
|-
| 30 || [[#GetHomeButtonReaderLockAccessor]] ||
|-
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]] ||
|-
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]] ||
|-
| 40 || [2.0.0+] [[#GetCradleFwVersion]] ||
|-
| 50 || [3.0.0+] [[#IsVrModeEnabled]] ||
|-
| 51 || [3.0.0+] [[#SetVrModeEnabled]] ||
|-
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]] ||
|-
| 53 || [7.0.0+] [[#BeginVrModeEx]] ||
|-
| 54 || [7.0.0+] [[#EndVrModeEx]] ||
|-
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]] ||
|-
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]] ||
|-
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]] ||
|-
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]] ||
|-
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]] ||
|-
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]] ||
|-
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]] ||
|-
| 66 || [6.0.0+] [[#SetCpuBoostMode]] ||
|-
| 67 || [10.0.0+] [[#CancelCpuBoostMode]] ||
|-
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]] ||
|-
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]] ||
|-
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
|-
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]] ||
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
|-
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]] ||
|-
| 400 || [10.0.0+] [[#ActivateMigrationService]] ||
|-
| 401 || [10.0.0+] [[#DeactivateMigrationService]] ||
|}


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]]).
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].


[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.
==== GetSaveDataSizeMax ====
No input, returns two ouput s64s.


=== GetEventHandle ===
==== GetCacheStorageMax ====
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].
No input, returns an output s32 and s64.


=== ReceiveMessage ===
==== BeginBlockingHomeButtonShortAndLongPressed ====
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.
Takes an input s64, no output.


=== GetThisAppletKind ===
Official user-processes use hard-coded value 0 for the s64.
No input, returns an output [[#AppletKind]].


Stubbed, just returns an error.
Starts blocking the Home button.


=== AllowToEnterSleep ===
==== EndBlockingHomeButtonShortAndLongPressed ====
No input/output.
No input/output.


Stubbed, just returns an error.
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].
 
==== BeginBlockingHomeButton ====
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.


=== DisallowToEnterSleep ===
==== EndBlockingHomeButton ====
No input/output.
No input/output.


Stubbed, just returns an error.
==== SelectApplicationLicense ====
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].


=== GetOperationMode ===
==== GetDeviceSaveDataSizeMax ====
No input. Returns an output u8 for the current [[#OperationMode]].
No input, returns two output s64s.


=== GetPerformanceMode ===
==== NotifyRunning ====
No input. Returns an output u32 for the current PerformanceMode.
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.


=== GetCradleStatus ===
==== GetPseudoDeviceId ====
No input, returns an output u8.
No input, returns an output 0x10-byte "nn::util::Uuid" struct.


This uses [[#omm]] GetCradleStatus.
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.


=== GetBootMode ===
==== SetMediaPlaybackStateForApplication ====
No input, returns an output u8.
Takes an input u8 bool, no output.


Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
==== IsGamePlayRecordingSupported ====
No input, returns an output u8 bool.


=== GetCurrentFocusState ===
==== InitializeGamePlayRecording ====
No input. Returns an output u8:
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.


* 1: In focus.
==== SetGamePlayRecordingState ====
* 2/3: Out of focus(running in "background").
Takes an input u32. 0 = disable/pause, 1 = enable/restart.


=== RequestToAcquireSleepLock ===
==== RequestFlushGamePlayingMovieForDebug ====
No input/output.
No input/output.


=== ReleaseSleepLock ===
Requests to save the video recording, as if the Capture-button was held.
 
==== RequestToShutdown ====
No input/output.
No input/output.


=== ReleaseSleepLockTransiently ===
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
 
==== RequestToReboot ====
No input/output.
No input/output.


=== GetAcquiredSleepLockEvent ===
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
No input, returns an output Event handle with autoclear=false.


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


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


Used for sending requests to [[qlaunch]]. sdk-nso creates a 0x10-byte storage which is sent to this. The following are the functions which use this, with the data written to the storage:
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.
* <code>RequestHomeMenu</code> <code>5341 4d53 0100 0000 0200 0000 0100 0000</code> Returns to the main Home Menu, equivalent to pressing the HOME button.
* <code>RequestJumpToSystemUpdate</code> <code>5341 4d53 0100 0000 0b00 0000 0100 0000</code> Equivalent to entering "System Update" under System Settings. When leaving this, it returns to the main Home Menu.


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


Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.


=== GetReaderLockAccessorEx ===
==== EnableApplicationCrashReport ====
Takes an input u32, returns an output [[#ILockAccessor]].
Takes an input u8 bool, no output.


The input value must be 0-3. 0 = HomeButton.
==== InitializeApplicationCopyrightFrameBuffer ====
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.


=== GetWriterLockAccessorEx ===
tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.
Takes an input u32, returns an output [[#ILockAccessor]].


The input value must be 0-3. 0 = HomeButton.
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.


=== GetCradleFwVersion ===
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.
No input, returns 4 output u32s.


This uses [[#omm]] GetCradleFwVersion.
This is used as an overlay for screenshots.


=== IsVrModeEnabled ===
==== SetApplicationCopyrightImage ====
No input, returns an output u8 bool.
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.


=== SetVrModeEnabled ===
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
Takes an input u8 bool flag. No output.


Updates internal AM state fields. If the new state doesn't match the previous state, this uses the [[Backlight_services]] {Disable/Enable}VrMode command depending on whether flag={disable/enable}.
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.


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


Sets whether the LCD screen blacklight is turned off.
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.


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


Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
The number of entries in each array is the same.


=== EndVrModeEx ===
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
No input/output.


Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.


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


=== GetDefaultDisplayResolution ===
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
No input, returns two output s32s '''width''' and '''height'''.


=== GetDefaultDisplayResolutionChangeEvent ===
==== ExecuteProgram ====
No input, returns an output Event handle with autoclear=true.
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.


=== GetHdcpAuthenticationState ===
==== ClearUserChannel ====
No input, returns an output s32.
No input/output.


=== GetHdcpAuthenticationStateChangeEvent ===
Clears the UserChannel used by [[#UnpopToUserChannel]].
No input, returns an output Event handle with autoclear=true.


=== SetTvPowerStateMatchingMode ===
==== UnpopToUserChannel ====
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.
Takes an input [[#IStorage]], no output.


=== GetApplicationIdByContentActionName ===
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].


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


=== SetCpuBoostMode ===
==== GetPreviousProgramIndex ====
Takes an input u32 '''CpuBoostMode''' (only modes 0 and 1 are valid) and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
No input, returns an output s32.


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


=== PerformSystemButtonPressingIfInFocus ===
==== EnableApplicationAllThreadDumpOnCrash ====
Takes an input [[#SystemButtonType]], no output.
Takes an input u8 bool, no output.
 
==== GetGpuErrorDetectedSystemEvent ====
No input, returns an output Event handle with autoclear=false.
 
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.


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.
==== SetDelayTimeToAbortOnGpuError ====
Takes an input s64 "nn::TimeSpan", no output.


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


=== GetCurrentPerformanceConfiguration ===
This is exposed by sdknso under <code>nn::friends::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].


=== GetOperationModeSystemInfo ===
==== TryPopFromFriendInvitationStorageChannel ====
No input, returns an output u32.
No input, returns an output [[#IStorage]].


This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].


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


This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].
==== GetNotificationStorageChannelEvent ====
No input, returns an output Event handle with EventClearMode=0.


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


=== DeactivateMigrationService ===
==== TryPopFromNotificationStorageChannel ====
No input/output.
No input, returns an output [[#IStorage]].


== ISelfController ==
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
{| class="wikitable" border="1"
 
|-
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.
! Cmd || Name
 
|-
==== GetHealthWarningDisappearedSystemEvent ====
| 0 || [[#Exit]]
No input, returns an output Event with EventClearMode=0.
|-
 
| 1 || [[#LockExit]]
==== SetHdcpAuthenticationActivated ====
|-
Takes an input u8 bool, no output.
| 2 || [[#UnlockExit]]
 
|-
==== GetLaunchRequiredVersion ====
| 3 || [2.0.0+] [[#EnterFatalSection]]
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].
|-
 
| 4 || [2.0.0+] [[#LeaveFatalSection]]
sdknso passes hard-coded value 0 for the u64.
|-
 
| 9 || [[#GetLibraryAppletLaunchableEvent]]
==== UpgradeLaunchRequiredVersion ====
|-
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.
| 10 || [[#SetScreenShotPermission]]
 
|-
sdknso passes hard-coded value 0 for the u64.
| 11 || [[#SetOperationModeChangedNotification]]
 
|-
==== SendServerMaintenanceOverlayNotification ====
| 12 || [[#SetPerformanceModeChangedNotification]]
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.
|-
 
| 13 || [[#SetFocusHandlingMode]]
The second input value can optionally be 0.
|-
 
| 14 || [[#SetRestartMessageEnabled]]
==== GetLastApplicationExitReason ====
|-
No input, returns an output s32.
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
 
|-
==== Cmd210 ====
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
No input, returns an output Event handle.
|-
 
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
==== SetAudioOutputPolicy ====
|-
Takes an input u8, no output.
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
 
|-
The input must be <=1.
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
 
|-
==== CreateMovieWriter ====
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
Takes 8-bytes of input and a handle. Returns an [[#IMovieWriter]].
|-
 
| 40 || [[#CreateManagedDisplayLayer]]
This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.
|-
 
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
==== RequestExitApplicationAndTryPopMessage ====
|-
Takes an input [[#IStorage|IStorage]], no output.
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
 
[21.0.0+] Now additionally takes a total of 0x18-bytes of input.
 
==== IsLanguageSelectionLimited ====
No input, returns 1-byte of output.
 
On NX this just writes 0 to output and returns 0.
 
==== StartContinuousRecordingFlushForDebug ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
 
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
 
==== CreateMovieMaker ====
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].
 
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
 
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
 
==== PrepareForJit ====
Takes no input. Launches the [[JIT_services|jit-sysmodule]] via [[NS_Services|ns]] LaunchLibraryApplet if it has not already been launched for the current application, storing a std::shared_ptr<> for jit-sysmodule process tracking object as an IApplicationFunctions member.
 
~IApplicationFunctions() includes:
 
    if (this->jit_process) {
        Terminate(this->jit_process);
        this->jit_process = nullptr;
    }
 
Thus the lifetime of the jit sysmodule is tied to the application which uses it, and each application gets its own fresh copy of the jit sysmodule.
 
AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
 
[S2] This is no longer usable since this returns Result 0x408 (sysmodule doesn't exist).
 
=== IMovieWriter ===
This is "nn::am::service::IMovieWriter".
 
This was added with [19.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
! Cmd || Name
|-
|-
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
| 0 ||  
|}
 
==== Cmd0 ====
No input. Returns a GRC [[GRC_services|IMovieWriter]].
 
=== IMovieMaker ===
This is "nn::am::service::IMovieMaker".
 
{| class="wikitable" border="1"
|-
|-
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
! Cmd || Name
|-
|-
| 50 || [[#SetHandlesRequestToDisplay]]
| 0 || [[#GetGrcMovieMaker]]
|-
|-
| 51 || [[#ApproveToDisplay]]
| 1 || [[#GetLayerHandle]]
|}
 
==== GetGrcMovieMaker ====
No input, returns a GRC [[GRC_services|IMovieMaker]].
 
==== GetLayerHandle ====
No input, returns an output u64.
 
=== IPerformanceFunctions ===
This is "nn::am::service::IPerformanceFunctions".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
! Cmd || Name
|-
|-
| 61 || [[#SetMediaPlaybackState]]
| 0 || IsCpuOverclockEnabled
|-
|-
| 62 || [[#SetIdleTimeDetectionExtension]]
| 1 || SetCpuOverclockEnabled
|}
 
=== IGraphicsScalingParametersFunctions ===
This is "nn::am::service::IGraphicsScalingParametersFunctions".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
|-
| 63 || [[#GetIdleTimeDetectionExtension]]
! Cmd || Name
|-
|-
| 64 || [[#SetInputDetectionSourceSet]]
| 10 || GetGraphicsScalingParameters
|-
|-
| 65 || [2.0.0+] [[#ReportUserIsActive]]
| 1000 || SetSupportingGraphicsScalingParametersForDebug
|-
|-
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
| 1010 || SetGpuQuotaForDebug
|-
|-
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
| 1020 || ClearGpuQuotaForDebug
|-
|-
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
| 1030 || SetScreenRatioForDebug
|-
|-
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
| 1040 || ClearScreenRatioForDebug
|-
|-
| 70 || [4.0.0+] [[#ReportMultimediaError]]
| 1050 || SetGraphicsScaleChangedNotificationEnabled
|}
 
== ILibraryAppletCreator ==
This is "nn::am::service::ILibraryAppletCreator".
 
{| class="wikitable" border="1"
|-
|-
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
! Cmd || Name || Notes
|-
|-
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
| 0 || [[#CreateLibraryAppletOld|CreateLibraryAppletOld]] ([1.0.0-19.0.1] CreateLibraryApplet) ||
|-
|-
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
|-
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
|-
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
| 3 || [20.0.0+] [[#CreateLibraryApplet|CreateLibraryApplet]] ||
|-
|-
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
| 10 || [[#CreateStorage]] ||
|-
|-
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
| 11 || [[#CreateTransferMemoryStorage]] ||
|-
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
|}
|}


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


Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].


=== LockExit ===
=== TerminateAllLibraryApplets ===
No input/output.
No input/output.


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).
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.


=== UnlockExit ===
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
No input/output.


Unlocks exit process, if LockExit was previously used.
=== AreAnyLibraryAppletsLeft ===
No input, returns an output u8 bool.


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


=== LeaveFatalSection ===
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).
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.
=== CreateLibraryApplet ===
Unofficial name.


=== GetLibraryAppletLaunchableEvent ===
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], an u64 ThreadId, returns an [[#ILibraryAppletAccessor]].
No input, returns an output event handle with autoclear=false.


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


Controls whether screenshot-capture is allowed.
=== CreateStorage ===
Takes an input s64 for the storage size, returns an [[#IStorage]].


{| class="wikitable" border="1"
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
|-
! Value || Description
|-
| 0 || Inherit from parent applet
|-
| 1 || Enable
|-
| 2 || Disable
|-
|}


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


=== SetPerformanceModeChangedNotification ===
The user-process creates the TransferMemory with permissions=0.
Takes an input u8 bool flag. No output.


=== SetFocusHandlingMode ===
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 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.


=== SetRestartMessageEnabled ===
=== CreateHandleStorage ===
Takes an input u8 bool flag, no 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.


See [[#AppletMessage]].
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).


=== SetScreenShotAppletIdentityInfo ===
=== ILibraryAppletAccessor ===
Takes an input [[#AppletIdentityInfo]], no output.
This is "nn::am::service::ILibraryAppletAccessor".


=== SetOutOfFocusSuspendingEnabled ===
{| class="wikitable" border="1"
Takes an input u8 bool flag. No output.
|-
 
! Cmd || Name || Notes
=== SetControllerFirmwareUpdateSection ===
|-
Takes an input u8 bool flag, no output.
| 0 || [[#GetAppletStateChangedEvent]] ||
 
|-
This throws error 0x40280 when the internal state flag already matches the input value.
| 1 || [[#IsCompleted]] ||
 
|-
=== SetRequiresCaptureButtonShortPressedMessage ===
| 10 || [[#Start]] ||
Takes an input u8 bool flag, no output.
|-
 
| 20 || [[#RequestExit]] ||
See [[#AppletMessage]].
|-
 
| 25 || [[#Terminate]] ||
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
|-
 
| 30 || [[#GetResult]] ||
=== SetAlbumImageOrientation ===
|-
Takes an input u32 "nn::album::ImageOrientation". No output.
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
 
|-
The input value must not be >3.
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
 
|-
=== SetDesirableKeyboardLayout ===
| 70 || [S2] ||
Takes an input u32, no output.
|-
| 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+]
|}
 
Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.


The input u32 is "nn::settings::KeyboardLayout".
==== SetOutOfFocusApplicationSuspendingEnabled ====
Takes an input u8 bool, no output.


=== CreateManagedDisplayLayer ===
Official sw will assert prior to using this if applet-service was not initialized as *Application.
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].


=== IsSystemBufferSharingEnabled ===
==== PresetLibraryAppletGpuTimeSliceZero ====
No input/output.
No input/output.


Not available when the current applet is an Application ([[#AppletId]] == 0x01).
sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.


Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
==== PushInData ====
Takes an input [[#IStorage]], no output.


=== GetSystemSharedLayerHandle ===
==== PopOutData ====
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".
No input, returns an output [[#IStorage]].


Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
==== PushExtraStorage ====
Takes an input [[#IStorage]], no output.


=== GetSystemSharedBufferHandle ===
==== PushInteractiveInData ====
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".
Takes an input [[#IStorage]], no output.


Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
==== PopInteractiveOutData ====
No input, returns an output [[#IStorage]].


Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
==== GetPopOutDataEvent ====
No input, returns an output handle with autoclear=false.


=== CreateManagedDisplaySeparableLayer ===
==== GetPopInteractiveOutDataEvent ====
No input, returns two output u64 LayerIds.
No input, returns an output event handle with autoclear=false.


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


=== SetManagedDisplayLayerSeparationMode ===
Stubbed, just returns an error.
Takes an input u32, no output.


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


The input u32 must be 0-1.
Stubbed, just returns an error.


=== SetHandlesRequestToDisplay ===
==== GetIndirectLayerConsumerHandle ====
Takes an input u8 bool, no output.
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.


Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.


See [[#AppletMessage]].
== ICommonStateGetter ==
This is "nn::am::service::ICommonStateGetter".


=== ApproveToDisplay ===
{| class="wikitable" border="1"
No input/output.
|-
 
! Cmd || Name
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
|-
 
| 0 || [[#GetEventHandle]]
=== OverrideAutoSleepTimeAndDimmingTime ===
|-
Takes 4 input s32s, no output.
| 1 || [[#ReceiveMessage]]
 
|-
=== SetMediaPlaybackState ===
| 2 || [[#GetThisAppletKind]]
Takes an input u8 bool, no output.
|-
 
| 3 || [[#AllowToEnterSleep]]
=== SetIdleTimeDetectionExtension ===
|-
Takes an input u32, no output.
| 4 || [[#DisallowToEnterSleep]]
 
|-
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.
| 5 || [[#GetOperationMode]]
 
|-
=== GetIdleTimeDetectionExtension ===
| 6 || [[#GetPerformanceMode]]
No input, returns an output u32.
|-
 
| 7 || [[#GetCradleStatus]]
Returns the value set by [[#SetIdleTimeDetectionExtension]].
|-
 
| 8 || [[#GetBootMode]]
=== SetInputDetectionSourceSet ===
|-
Takes an input u32, no output.
| 9 || [[#GetCurrentFocusState]]
 
|-
=== ReportUserIsActive ===
| 10 || [[#RequestToAcquireSleepLock]]
No input/output.
|-
 
| 11 || [[#ReleaseSleepLock]]
Uses idle:sys ReportUserIsActive.
|-
 
| 12 || [[#ReleaseSleepLockTransiently]]
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.
|-
 
| 13 || [[#GetAcquiredSleepLockEvent]]
=== GetCurrentIlluminance ===
|-
No input, returns an output float.
| 14 || [11.0.0+] [[#GetWakeupCount]]
 
|-
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
| 15 || [19.0.0+]
|-
| 20 || [[#PushToGeneralChannel]]
|-
| 30 || [[#GetHomeButtonReaderLockAccessor]]
|-
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
|-
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
|-
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
|-
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
|-
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
|-
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
|-
| 53 || [7.0.0+] [[#BeginVrModeEx]]
|-
| 54 || [7.0.0+] [[#EndVrModeEx]]
|-
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
|-
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
|-
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
|-
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
|-
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
|-
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
|-
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
|-
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
|-
| 66 || [6.0.0+] [[#SetCpuBoostMode]]
|-
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]
|-
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]
|-
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]
|-
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]
|-
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
|-
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]
|-
| 120 || [13.0.0+] GetAppletLaunchedHistory
|-
| 130 || [21.0.0+] EnableStartupLogoDisappearedMessage
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
|-
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]
|-
| 400 || [10.0.0+] [[#ActivateMigrationService]]
|-
| 401 || [10.0.0+] [[#DeactivateMigrationService]]
|-
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]
|-
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]
|-
| 502 || [12.0.0+] IsSleepEnabled
|-
| 503 || [12.0.0+] IsDisablingSleepSuppressed
|-
| 600 || [20.0.0+] SetHidInputMagnificationForApplication ([17.0.0-18.1.0] OpenNamedChannelAsChild)
|-
| 610 || [21.0.0+]
|-
| 611 || [22.0.0+]
|-
| 650 || [S2] BeginUsingCameraResource
|-
| 651 || [S2] EndUsingCameraResource
|-
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
|-
| 910 || [17.0.0+] GetLaunchRequiredTick
|-
| 1000 || [19.0.0+] BeginVrMode3d
|-
| 1001 || [19.0.0+] EndVrMode3d
|-
| 1002 || [19.0.0+] IsVrModeEnabled3d
|-
| 1003 || [21.0.0+] GetVrLaboGoggleViewport
|-
| 1004 || [21.0.0+] GetPanelPhysicalSizeForSpecificTitle
|-
| 1005 || [21.0.0+] GetPanelResolutionForSpecificTitle
|-
| 2000 || [S2] SetRtcModeChangedMessageEnabled
|-
| 2010 || [S2] GetCurrentDisplayLayoutRatio
|}


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


Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
[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.


User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).
=== GetEventHandle ===
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].


=== SetAutoSleepDisabled ===
=== ReceiveMessage ===
Takes an input u8 bool, no output.
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.


=== IsAutoSleepDisabled ===
=== GetThisAppletKind ===
No input, returns an output u8 bool.
No input, returns an output [[#AppletKind]].


=== ReportMultimediaError ===
Stubbed, just returns an error.
Takes an input Result and a type-0x5 input buffer, no output.


The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.
=== AllowToEnterSleep ===
No input/output.


=== GetCurrentIlluminanceEx ===
Stubbed, just returns an error.
No input, returns an output u8 bool and float.


Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
=== DisallowToEnterSleep ===
No input/output.


=== SetInputDetectionPolicy ===
Stubbed, just returns an error.
Takes an input [[#InputDetectionPolicy]], no output.


=== SetWirelessPriorityMode ===
=== GetOperationMode ===
Takes an input s32 enum '''WirelessPriorityMode''', no output.
No input. Returns an output u8 for the current [[#OperationMode]].


The input value must be 1 or 2.
=== GetPerformanceMode ===
No input. Returns an output u32 for the current [[#PerformanceMode]].


=== GetAccumulatedSuspendedTickValue ===
=== GetCradleStatus ===
No input, returns an output u64 tick value.
No input, returns an output u8.


Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
This uses [[#omm]] GetCradleStatus.


=== GetAccumulatedSuspendedTickChangedEvent ===
=== GetBootMode ===
No input, returns an output Event handle with autoclear=true.
No input, returns an output u8.
 
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.


This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
=== GetCurrentFocusState ===
No input. Returns an output u8 [[#FocusState]].


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


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


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


The buffer contains arbitrary UserData.
=== GetAcquiredSleepLockEvent ===
No input, returns an output Event handle with autoclear=false.


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


=== GetDebugStorageChannel ===
=== PushToGeneralChannel ===
No input, returns an output [[#IStorageChannel]].
Takes an input [[#IStorage]], no output.


The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
This is not usable under an Application, however it is usable under a LibraryApplet.


== IStorageChannel ==
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:
Added with [[7.0.0]].
* <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.


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


== IWindowController ==
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#CreateWindow]] ||
|-
| 1 || [[#GetAppletResourceUserId]] ||
|-
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
|-
| 10 || [[#AcquireForegroundRights]] ||
|-
| 11 || [[#ReleaseForegroundRights]] ||
|-
| 12 || [[#RejectToChangeIntoBackground]] ||
|-
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||
|-
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||
|}


=== CreateWindow ===
=== GetReaderLockAccessorEx ===
Takes an input u32, returns an output [[#IWindow]].
Takes an input u32, returns an output [[#ILockAccessor]].


Stubbed, just returns an error.
The input value must be 0-3. 0 = HomeButton.


=== GetAppletResourceUserId ===
=== GetWriterLockAccessorEx ===
No input, returns an output u64 [[#AppletResourceUserId]].
Takes an input u32, returns an output [[#ILockAccessor]].


=== GetAppletResourceUserIdOfCallerApplet ===
The input value must be 0-3. 0 = HomeButton.
No input, returns an output u64 [[#AppletResourceUserId]].


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


Just returns 0.
This uses [[#omm]] GetCradleFwVersion.


=== ReleaseForegroundRights ===
=== IsVrModeEnabled ===
No input/output.
No input, returns an output u8 bool.


Just returns 0.
=== SetVrModeEnabled ===
Takes an input u8 bool flag. No output.


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


Just returns 0.
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.


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


=== SetAppletGpuTimeSlice ===
Sets whether the LCD screen blacklight is turned off.
Takes an input s64, no output.
 
=== BeginVrModeEx ===
No input/output.


The input s64 must not be negative.
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.


== IAudioController ==
=== EndVrModeEx ===
{| class="wikitable" border="1"
No input/output.
|-
 
! Cmd || Name
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
|-
| 0 || [[#SetExpectedMasterVolume]]
|-
| 1 || [[#GetMainAppletExpectedMasterVolume]]
|-
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
|-
| 3 || [[#ChangeMainAppletMasterVolume]]
|-
| 4 || [[#SetTransparentVolumeRate]]
|}


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


=== SetExpectedMasterVolume ===
=== SetVrPositionForDebug ===
Takes two input floats, no output.
Takes 4 input s32s, no output.


Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
The s32s are: x, y, width, height.


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


=== GetLibraryAppletExpectedMasterVolume ===
width must be 1-1280, height must be 1-720.
No input, returns an output float.


=== ChangeMainAppletMasterVolume ===
x and y must not be negative. x+width must be <=1280. y+height must be <=720.
Takes an input float and an input u64, no output.


=== SetTransparentVolumeRate ===
=== GetDefaultDisplayResolution ===
Takes an input float, no output.
No input, returns two output s32s '''width''' and '''height'''.


== IDisplayController ==
=== GetDefaultDisplayResolutionChangeEvent ===
{| class="wikitable" border="1"
No input, returns an output Event handle with autoclear=true.
|-
 
! Cmd || Name
=== GetHdcpAuthenticationState ===
|-
No input, returns an output s32.
| 0 || [[#GetLastForegroundCaptureImage]]
 
|-
=== GetHdcpAuthenticationStateChangeEvent ===
| 1 || [[#UpdateLastForegroundCaptureImage]]
No input, returns an output Event handle with autoclear=true.
|-
 
| 2 || [[#GetLastApplicationCaptureImage]]
=== SetTvPowerStateMatchingMode ===
|-
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.
| 3 || [[#GetCallerAppletCaptureImage]]
 
|-
=== GetApplicationIdByContentActionName ===
| 4 || [[#UpdateCallerAppletCaptureImage]]
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].
|-
 
| 5 || [[#GetLastForegroundCaptureImageEx]]
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).
|-
 
| 6 || [[#GetLastApplicationCaptureImageEx]]
=== SetCpuBoostMode ===
|-
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
| 7 || [[#GetCallerAppletCaptureImageEx]]
 
|-
=== CancelCpuBoostMode ===
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
No input/output.
|-
 
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
=== GetBuiltInDisplayType ===
|-
No input, returns an output s32.
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
 
|-
This is not exposed by sdknso.
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
 
|-
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].
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
 
|-
=== PerformSystemButtonPressingIfInFocus ===
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
Takes an input [[#SystemButtonType]], no output.
|-
 
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
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.
|-
 
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
=== SetPerformanceConfigurationChangedNotification ===
|-
Takes an input u8 bool, no output.
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
 
|-
=== GetCurrentPerformanceConfiguration ===
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
|-
 
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
=== OpenMyGpuErrorHandler ===
|-
No input, returns an [[#IGpuErrorHandler]].
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
 
|-
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
 
|-
=== GetOperationModeSystemInfo ===
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
No input, returns an output u32.
|-
 
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].
|-
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
|-
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
|-
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
|-
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
|-
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
|}


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


Stubbed, just returns an error.
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].


=== UpdateLastForegroundCaptureImage ===
=== ActivateMigrationService ===
No input/output.
No input/output.


=== GetLastApplicationCaptureImage ===
Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].
Takes a type-0x6 output buffer.


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


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


Stubbed, just returns an error.
=== SuppressDisablingSleepTemporarily ===
Takes an input u64 "nn::TimeSpanType", no output.


=== UpdateCallerAppletCaptureImage ===
=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===
No input/output.
No input/output.


Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.
=== IGpuErrorHandler ===
This is "nn::am::service::IGpuErrorHandler".


=== GetLastForegroundCaptureImageEx ===
This was added with [11.0.0+].
Takes a type-0x6 output buffer, returns an output u8 bool.


The buffer size must match 0x384000.
This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.


=== GetLastApplicationCaptureImageEx ===
{| class="wikitable" border="1"
Takes a type-0x6 output buffer, returns an output u8 bool.
|-
! Cmd || Name
|-
| 100 || [[#GetManualGpuErrorInfoSize]]
|-
| 101 || [[#GetManualGpuErrorInfo]]
|-
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]
|-
| 103 || [[#FinishManualGpuErrorHandling]]
|}


The buffer size must match 0x384000.
==== GetManualGpuErrorInfoSize ====
No input, returns an output u64.


Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.
==== GetManualGpuErrorInfo ====
Takes a type-0x6 output buffer, returns an output u64.


=== GetCallerAppletCaptureImageEx ===
The OutBuffer_size must be >= the output size from [[#GetManualGpuErrorInfoSize]].
Takes a type-0x6 output buffer, returns an output u8 bool.


The buffer size must match 0x384000.
sdknso exposes the buffer as <code>void*</code>.


Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.
==== GetManualGpuErrorDetectionSystemEvent ====
No input, returns an output Event handle with EventClearMode=0.


=== TakeScreenShotOfOwnLayer ===
==== FinishManualGpuErrorHandling ====
Takes an input u8 bool and a s32, no output.
No input/output.


=== CopyBetweenCaptureBuffers ===
== ISelfController ==
Takes two input s32s, no output.
This is "nn::am::service::ISelfController".


=== AcquireLastApplicationCaptureBuffer ===
{| class="wikitable" border="1"
No input, returns an output handle.
|-
 
! Cmd || Name
Stubbed, just returns an error.
|-
 
| 0 || [[#Exit]]
=== ReleaseLastApplicationCaptureBuffer ===
|-
No input/output.
| 1 || [[#LockExit]]
 
|-
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.
| 2 || [[#UnlockExit]]
 
|-
=== AcquireLastForegroundCaptureBuffer ===
| 3 || [2.0.0+] [[#EnterFatalSection]]
No input, returns an output handle.
|-
 
| 4 || [2.0.0+] [[#LeaveFatalSection]]
Stubbed, just returns an error.
|-
 
| 9 || [[#GetLibraryAppletLaunchableEvent]]
=== ReleaseLastForegroundCaptureBuffer ===
|-
No input/output.
| 10 || [[#SetScreenShotPermission]]
 
|-
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
| 11 || [[#SetOperationModeChangedNotification]]
 
|-
=== AcquireCallerAppletCaptureBuffer ===
| 12 || [[#SetPerformanceModeChangedNotification]]
No input, returns an output handle.
|-
 
| 13 || [[#SetFocusHandlingMode]]
Stubbed, just returns an error.
|-
 
| 14 || [[#SetRestartMessageEnabled]]
=== ReleaseCallerAppletCaptureBuffer ===
|-
No input/output.
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
 
|-
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
 
|-
=== AcquireLastApplicationCaptureBufferEx ===
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
No input, returns an output TransferMemory handle and an output u8 bool.
|-
 
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
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.
|-
 
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.
|-
 
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
=== AcquireLastForegroundCaptureBufferEx ===
|-
No input, returns an output TransferMemory handle and an output u8 bool.
| 21 || [13.0.0+] GetScreenShotProgramId
 
|-
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.
| 22 || [19.0.0+] GetScreenShotAcdIndex
 
|-
=== AcquireCallerAppletCaptureBufferEx ===
| 23 || [19.0.0+] GetScreenShotApparentPlatform
No input, returns an output TransferMemory handle and an output u8 bool.
|-
 
| 24 || [19.0.0+] GetScreenShotApplicationProperty
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.
|-
 
| 40 || [[#CreateManagedDisplayLayer]]
=== ClearCaptureBuffer ===
|-
Takes an input u8 bool, an s32, and an u32, returns no output.
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
 
|-
=== ClearAppletTransitionBuffer ===
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
Takes an input u32, no output.
|-
 
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
=== AcquireLastApplicationCaptureSharedBuffer ===
|-
No input, returns an output u8 bool and an s32.
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
 
|-
This loads data from state.
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
 
|-
=== ReleaseLastApplicationCaptureSharedBuffer ===
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]
No input/output.
|-
 
| 50 || [[#SetHandlesRequestToDisplay]]
Depending on whether a state field is 0, this just returns an error or returns 0.
|-
 
| 51 || [[#ApproveToDisplay]]
=== AcquireLastForegroundCaptureSharedBuffer ===
|-
No input, returns an output u8 bool and an s32.
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
 
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 ==
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 61 || [[#SetMediaPlaybackState]]
|-
|-
| 1 || RequestLaunchApplicationForDebug ||  
| 62 || [[#SetIdleTimeDetectionExtension]]
|-
|-
| 2 || [7.0.0+] GetDebugStorageChannel || No input, returns an output [[#IStorageChannel]].
| 63 || [[#GetIdleTimeDetectionExtension]]
|-
|-
| 3 || [7.0.0+] CreateStorageForDebug || Takes a total of 8-bytes of input, returns an [[#IStorage]].
| 64 || [[#SetInputDetectionSourceSet]]
|}
|-
 
| 65 || [2.0.0+] [[#ReportUserIsActive]]
== IProcessWindingController ==
|-
{| class="wikitable" border="1"
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
|-
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
|-
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
|-
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
|-
|-
! Cmd || Name || Notes
| 70 || [4.0.0+] [[#ReportMultimediaError]]
|-
|-
| 0 || [[#GetLaunchReason]] ||
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
|-
|-
| 11 || [[#OpenCallingLibraryApplet]] ||
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
|-
|-
| 21 || [[#PushContext]] ||
| 73 || [21.0.0+]  
|-
|-
| 22 || [[#PopContext]] ||
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
|-
|-
| 23 || [[#CancelWindingReservation]] ||
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
|-
|-
| 30 || [[#WindAndDoReserved]] ||
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
|-
|-
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
|-
|-
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
|}
 
=== GetLaunchReason ===
No input, returns an output [[#AppletProcessLaunchReason]].
 
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.
 
== IDebugFunctions ==
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]
|-
|-
| 0 || [[#NotifyMessageToHomeMenuForDebug]] ||
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
|-
|-
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]] ||
| 200 || [20.0.0+]  
|-
|-
| 10 || [[#PerformSystemButtonPressing]] ||
| 210 || [20.0.0+]  
|-
|-
| 20 || [[#InvalidateTransitionLayer]] ||
| 211 || [20.0.0+]  
|-
|-
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]] ||
| 220 || [20.0.0+]  
|-
|-
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]] ||
| 221 || [20.0.0+]  
|-
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
| 230 || [20.0.0+]  
|-
|-
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]] ||
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
|-
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]] ||
| 2000 || [S2] [[#GetGraphicsSupervisor]]
|-
|-
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]] ||
| 2100 || [S2] SetRecordingLayerEnabled
|-
|-
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]] ||
| 2200 || [S2] SetSharingLayerEnabled
|-
|-
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]] ||
| 2300 || [S2] [20.0.0+] SetCopyrightLayerEnabled
|-
|-
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]] ||
| 2400 || [S2] SetRtcScreenSharingAudioEnabled
|-
|-
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]] ||
| 2401 || [S2] [20.0.0+] SetStreamPlayMirroringAudioEnabled
|-
|-
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]] ||
| 2402 || [S2] [20.0.0+]
|-
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]] ||
|}
|}


=== NotifyMessageToHomeMenuForDebug ===
=== Exit ===
Takes an input [[#AppletMessage]], no output.
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.


=== OpenMainApplication ===
=== LockExit ===
No input, returns an output [[#IApplicationAccessor]].
No input/output.


Should not be used when no Application is running (svcBreak).
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).


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


=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
Unlocks exit process, if LockExit was previously used.
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]]).
=== EnterFatalSection ===
No input/output.


=== GetAppletResourceUsageInfo ===
=== LeaveFatalSection ===
No input, returns an output [[#AppletResourceUsageInfo]].
 
=== SetCpuBoostModeForApplet ===
Takes an input u32 '''CpuBoostMode''' (only modes 0 and 1 are valid) 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 ===
[[#EnterFatalSection]] must be executed at least once before executing this command, otherwise error code 0x40080 will be returned. EnterFatalSection and LeaveFatalSection work in pairs, that is, N calls to EnterFatalSection must be performed first in order to perform N executions of LeaveFatalSection. Essentially, these two functions operate like how one would lock and unlock a recursive mutex.
Takes an input [[#IStorage]] and a s32, no output.


The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
=== GetLibraryAppletLaunchableEvent ===
No input, returns an output event handle with autoclear=false.


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.
=== SetScreenShotPermission ===
Takes an input s32. No output.


=== TryPopFromAppletBoundChannelForDebug ===
Controls whether screenshot-capture is allowed.
Takes an input s32, returns an output [[#IStorage]].


The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
{| class="wikitable" border="1"
 
|-
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.
! Value || Description
|-
| 0 || Inherit from parent applet
|-
| 1 || Enable
|-
| 2 || Disable
|-
|}


=== AlarmSettingNotificationEnableAppEventReserve ===
=== SetOperationModeChangedNotification ===
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes an input u8 bool flag. No output.


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
=== SetPerformanceModeChangedNotification ===
Takes an input u8 bool flag. No output.


=== AlarmSettingNotificationDisableAppEventReserve ===
=== SetFocusHandlingMode ===
No input/output.
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.


Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].
=== SetRestartMessageEnabled ===
Takes an input u8 bool flag, no output.


=== AlarmSettingNotificationPushAppEventNotify ===
See [[#AppletMessage]].
Takes an input [[#IStorage]], no output.


Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.
=== SetScreenShotAppletIdentityInfo ===
Takes an input [[#AppletIdentityInfo]], no output.


=== FriendInvitationSetApplicationParameter ===
=== SetOutOfFocusSuspendingEnabled ===
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes an input u8 bool flag. No output.


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
=== SetControllerFirmwareUpdateSection ===
Takes an input u8 bool flag, no output.


=== FriendInvitationClearApplicationParameter ===
This throws error 0x40280 when the internal state flag already matches the input value.
No input/output.


Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].
=== SetRequiresCaptureButtonShortPressedMessage ===
Takes an input u8 bool flag, no output.


=== FriendInvitationPushApplicationParameter ===
See [[#AppletMessage]].
Takes an input [[#IStorage]], no output.


Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.


== IStorage ==
=== SetAlbumImageOrientation ===
{| class="wikitable" border="1"
Takes an input u32 "nn::album::ImageOrientation". No output.
|-
! Cmd || Name || Notes
|-
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
|-
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
|}


Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].
The input value must not be >3.


Only 1 *Accessor session can be open for each IStorage at a time.
=== SetDesirableKeyboardLayout ===
Takes an input u32, no output.


== IStorageAccessor ==
The input u32 is "nn::settings::KeyboardLayout".
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || GetSize || No input. Returns an s64.
|-
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
|-
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
|}


== ITransferStorageAccessor ==
=== CreateManagedDisplayLayer ===
{| class="wikitable" border="1"
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].
|-
! Cmd || Name || Notes
|-
| 0 || GetSize || No input. Returns an output s64.
|-
| 1 || GetHandle || No input. Returns an output s64 and handle.
|}


These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
=== IsSystemBufferSharingEnabled ===
No input/output.


= appletOE =
Not available when the current applet is an Application ([[#AppletId]] == 0x01).
This is "nn::am::service::IApplicationProxyService".


{| class="wikitable" border="1"
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
|-
! Cmd || Name || Notes
|-
| 0 || [[#OpenApplicationProxy]] ||
|}


This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time.
=== GetSystemSharedLayerHandle ===
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".


== OpenApplicationProxy ==
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
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).
=== GetSystemSharedBufferHandle ===
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".


On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.


= idle:sys =
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
This is "nn::idle::detail::IPolicyManagerSystem"


{| class="wikitable" border="1"
=== CreateManagedDisplaySeparableLayer ===
|-
No input, returns two output u64 LayerIds.
! Cmd || Name
 
|-
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.
| 0 || GetAutoPowerDownEvent
 
|-
=== SetManagedDisplayLayerSeparationMode ===
|rowspan="2"| 1 || [1.0.0-3.0.2]
Takes an input u32, no output.
|-
 
| [7.0.0+] IsAutoPowerDownRequested
sdknso exposes this as <code>nn::vi::SetRecordingLayerEnabled(bool)</code>.
|-
| 2 || [1.0.0-3.0.2]
|-
| 3 || [[#SetHandlingContext]]
|-
| 4 || LoadAndApplySettings
|-
| 5 || ReportUserIsActive
|}


== SetHandlingContext ==
The input u32 must be 0-1.
[3.0.0+] Now takes an additional 0x10-bytes of input.


= omm =
=== SetRecordingLayerCompositionEnabled ===
This is "nn::omm::detail::IOperationModeManager"
Takes an input bool, no output.


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


{| class="wikitable" border="1"
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
|-
 
! Cmd || Name
See [[#AppletMessage]].
|-
 
| 0 || GetOperationMode
=== ApproveToDisplay ===
|-
No input/output.
| 1 || GetOperationModeChangeEvent
 
|-
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
| 2 || EnableAudioVisual
 
|-
=== OverrideAutoSleepTimeAndDimmingTime ===
| 3 || DisableAudioVisual
Takes 4 input s32s, no output.
|-
 
| 4 || EnterSleepAndWait
=== SetMediaPlaybackState ===
|-
Takes an input u8 bool, no output.
| 5 || GetCradleStatus
 
|-
=== SetIdleTimeDetectionExtension ===
| 6 || FadeInDisplay
Takes an input u32, no output.
|-
 
| 7 || FadeOutDisplay
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.
|-
 
| 8 || [2.0.0+] GetCradleFwVersion
=== GetIdleTimeDetectionExtension ===
|-
| 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
|}
 
== GetOperationModeSystemInfo ==
No input, returns an output u32.
No input, returns an output u32.


This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
Returns the value set by [[#SetIdleTimeDetectionExtension]].


= spsm =
=== SetInputDetectionSourceSet ===
This is "nn::spsm::detail::IPowerStateInterface".
Takes an input u32, no output.


{| class="wikitable" border="1"
=== ReportUserIsActive ===
|-
No input/output.
! 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.
Uses idle:sys ReportUserIsActive.


= tcap =
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 "nn::tcap::server::IManager".


{| class="wikitable" border="1"
=== GetCurrentIlluminance ===
|-
No input, returns an output float.
! Cmd || Name
|-
| 0 || GetContinuousHighSkinTemperatureEvent
|-
| 1 || SetOperationMode
|-
| 2 || LoadAndApplySettings
|}


= caps:su =
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
This is "nn::capsrv::sf::IScreenShotApplicationService".


This was added with [[6.0.0]].
=== IsIlluminanceAvailable ===
No input, returns an output u8 bool.


This can be used by applications to save screenshots.
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.


{| class="wikitable" border="1"
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).
|-
! 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.
=== SetAutoSleepDisabled ===
Takes an input u8 bool, no output.


== SaveScreenShot ==
=== IsAutoSleepDisabled ===
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 u8 bool.


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.
=== ReportMultimediaError ===
Takes an input Result and a type-0x5 input buffer, no output.
 
The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.


This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
=== GetCurrentIlluminanceEx ===
No input, returns an output u8 bool and float.


== SaveScreenShotEx0 ==
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
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 ==
=== SetInputDetectionPolicy ===
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, a type-0x15 input buffer containing an [[Capture_services|ApplicationData]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
Takes an input [[#InputDetectionPolicy]], no output.


== SaveScreenShotEx2 ==
=== SetWirelessPriorityMode ===
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]].
Takes an input s32 [[#WirelessPriorityMode]], no output.


= Library Applets =
=== GetAccumulatedSuspendedTickValue ===
This section documents library applet launching.
No input, returns an output u64 tick value.


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.
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.


Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
=== GetAccumulatedSuspendedTickChangedEvent ===
No input, returns an output Event handle with autoclear=true.


== CommonArguments ==
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
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.
=== SetAlbumImageTakenNotificationEnabled ===
Takes an input u8 bool, no output.


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


{| class="wikitable" border="1"
=== SetApplicationAlbumUserData ===
|-
Takes a type-0x21 input buffer, no output.
! Offset || Size || Typical Value || Notes
 
The buffer contains arbitrary UserData.
 
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.
 
=== SaveCurrentScreenshot ===
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"
|-
|-
| 0x0 || 4 || 1 || Common Arguments version
! Cmd || Name || Notes
|-
|-
| 0x4 || 4 || 0x20 || Common Arguments size
| 0 || Push || No input, returns an output [[#IStorage]].
|-
|-
| 0x8 || 4 || || Library applet version (API version)
| 1 || Unpop || No input, returns an output [[#IStorage]].
|-
|-
| 0xC || 4 || 0 || Theme color
| 2 || Pop || No input, returns an output [[#IStorage]].
|-
|-
| 0x10 || 1 || 0 || Play startup sound
| 3 || GetPopEventHandle || No input, returns an output handle.
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
|-
|-
| 4 || Clear || No input/output.
|}
|}


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


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Id
! Cmd || Name || Notes
! ProgramId
! Description
|-
|-
| 0x01
| 0 || [[#CreateWindow]] ||  
|  
| Application (not valid for use with LibraryApplets)
|-
|-
| 0x02
| 1 || [[#GetAppletResourceUserId]] ||
| 010000000000100C
| overlayDisp (OverlayApplet)
|-
|-
| 0x03
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
| 0100000000001000
| qlaunch (SystemAppletMenu)
|-
|-
| 0x04
| 10 || [[#AcquireForegroundRights]] ||
| 0100000000001012
| starter (DummyStarter)
|-
|-
| 0x0A
| 11 || [[#ReleaseForegroundRights]] ||
| 0100000000001001
| [[Auth_Applet|auth (LibraryAppletAuth)]]
|-
|-
| 0x0B
| 12 || [[#RejectToChangeIntoBackground]] ||
| 0100000000001002
| [[Cabinet_Applet|cabinet (LibraryAppletCabinet)]]
|-
|-
| 0x0C
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||
| 0100000000001003
| [[Controller_Applet|controller (LibraryAppletController)]]
|-
|-
| 0x0D
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||  
| 0100000000001004
|}
| dataErase (LibraryAppletDataErase)
 
|-
=== CreateWindow ===
| 0x0E
Takes an input u32, returns an output [[#IWindow]].
| 0100000000001005
 
| [[Error_Applet|error (LibraryAppletError)]]
Stubbed, just returns an error.
|-
 
| 0x0F
=== GetAppletResourceUserId ===
| 0100000000001006
No input, returns an output u64 [[#AppletResourceUserId]].
| netConnect (LibraryAppletNetConnect)
 
|-
=== GetAppletResourceUserIdOfCallerApplet ===
| 0x10
No input, returns an output u64 [[#AppletResourceUserId]].
| 0100000000001007
 
| [[Profile_Selector|playerSelect (LibraryAppletPlayerSelect)]]
=== AcquireForegroundRights ===
|-
No input/output.
| 0x11
 
| 0100000000001008
Just returns 0.
| [[Software_Keyboard|swkbd (LibraryAppletSwkbd)]]
 
|-
=== ReleaseForegroundRights ===
| 0x12
No input/output.
| 0100000000001009
 
| [[MiiEdit_Applet|miiEdit (LibraryAppletMiiEdit)]]
Just returns 0.
|-
 
| 0x13
=== RejectToChangeIntoBackground ===
| 010000000000100A
No input/output.
| [[Internet_Browser#010000000000100A|web (LibraryAppletWeb)]]
 
|-
Just returns 0.
| 0x14
 
| 010000000000100B
=== SetAppletWindowVisibility ===
| [[Internet_Browser#ShopN|shop (LibraryAppletShop)]]
Takes an input u8 bool, no output.
|-
 
| 0x15
=== SetAppletGpuTimeSlice ===
| 010000000000100D
Takes an input s64, no output.
| [[Album_Applet|photoViewer (LibraryAppletPhotoViewer)]]
 
|-
The input s64 must not be negative.
| 0x16
 
| 010000000000100E
== IAudioController ==
| set (LibraryAppletSet)
This is "nn::am::service::IAudioController".
|-
 
| 0x17
{| class="wikitable" border="1"
| 010000000000100F
| [[Internet_Browser#Offline_Applet|offlineWeb (LibraryAppletOfflineWeb)]]
|-
| 0x18
| 0100000000001010
| [[Internet_Browser#Whitelisted_Applets|loginShare (LibraryAppletLoginShare)]]
|-
| 0x19
| 0100000000001011
| [[Internet_Browser#WifiWebAuthApplet|wifiWebAuth (LibraryAppletWifiWebAuth)]]
|-
| 0x1A
| 0100000000001013
| [[MyPage_Applet|myPage (LibraryAppletMyPage)]]
|-
| 0x1B
| 010000000000101A
| gift (LibraryAppletGift)
|-
| 0x1C
| 010000000000101C
| userMigration (LibraryAppletUserMigration)
|-
|-
| 0x1D
! Cmd || Name
| 010000000000101D
| [9.0.0+] EncounterSys (LibraryAppletPreomiaSys)
|-
|-
| 0x1E
| 0 || [[#SetExpectedMasterVolume]]
| 0100000000001020
| [9.0.0+] story (LibraryAppletStory)
|-
|-
| 0x1F
| 1 || [[#GetMainAppletExpectedMasterVolume]]
| 010070000E3C0000
| [9.0.0+] EncounterUsr (LibraryAppletPreomiaUsr)
|-
|-
| 0x20
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
| 010086000E49C000
| [9.0.0+] EncounterUsrDummy (LibraryAppletPreomiaUsrDummy)
|-
|-
| 0x21
| 3 || [[#ChangeMainAppletMasterVolume]]
| 0100000000001038
| [10.0.0+] sample (LibraryAppletSample)
|-
|-
| 0x3F1
| 4 || [[#SetTransparentVolumeRate]]
| 010000000000D619
| [10.0.0+]
|-
|-
| 0x3F2
| 5 || [20.0.0+]
| 010000000000D610
|}
| [10.0.0+]
 
|-
GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.
| 0x3F3
 
| 010000000000D611
=== SetExpectedMasterVolume ===
| [10.0.0+]
Takes two input floats, no output.
|-
 
| 0x3F4
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
| 010000000000D612
 
| [10.0.0+]
=== GetMainAppletExpectedMasterVolume ===
|-
No input, returns an output float.
| 0x3F5
 
| 010000000000D613
=== GetLibraryAppletExpectedMasterVolume ===
| [10.0.0+]
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"
|-
|-
| 0x3F6
! Cmd || Name
| 010000000000D614
| [10.0.0+]
|-
|-
| 0x3F7
| 0 || [[#GetLastForegroundCaptureImage]]
| 010000000000D615
| [10.0.0+]
|-
|-
| 0x3F8
| 1 || [[#UpdateLastForegroundCaptureImage]]
| 010000000000D616
| [10.0.0+]
|-
|-
| 0x3F9
| 2 || [[#GetLastApplicationCaptureImage]]
| 010000000000D617
| [10.0.0+]
|-
|-
| 0x3FA
| 3 || [[#GetCallerAppletCaptureImage]]
| 010000000000D60A
| [10.0.0+]
|-
|-
| 0x3FB
| 4 || [[#UpdateCallerAppletCaptureImage]]
| 010000000000D60B
| [10.0.0+]
|-
|-
| 0x3FC
| 5 || [[#GetLastForegroundCaptureImageEx]]
| 010000000000D60C
| [10.0.0+]
|-
|-
| 0x3FD
| 6 || [[#GetLastApplicationCaptureImageEx]]
| 010000000000D60D
| [10.0.0+]
|-
|-
| 0x3FE
| 7 || [[#GetCallerAppletCaptureImageEx]]
| 010000000000D60E
| [10.0.0+]
|}
 
=== LibraryAppletMode ===
{| class="wikitable" border="1"
|-
|-
!  ID
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
!  Description
|-
|-
| 0x0
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
| AllForeground
|-
|-
| 0x1
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
| Background
|-
|-
| 0x2
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
| No UI
|-
|-
| 0x3
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
| Background with indirect display, see also [[#GetIndirectLayerConsumerHandle]]. Only used by swkbd InlineKeyboard.
|-
|-
| 0x4
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
| AllForegroundInitiallyHidden. Can be used by [7.0.0+] [[Internet_Browser|WebSession]].
|-
|-
|}
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
 
=== AppletMessage ===
{| class="wikitable" border="1"
|-
|-
!  ID
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
!  Description
|-
|-
| 0x4 || Exit requested
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
|-
|-
| 0xF || [[#GetCurrentFocusState|FocusState]] changed
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
|-
|-
| 0x10 || Current applet execution was [[#SetRestartMessageEnabled|resumed]].
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
|-
|-
| 0x1E || OperationMode changed
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
|-
|-
| 0x1F || PerformanceMode changed
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
|-
|-
| 0x33 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]. Indicates that [[#ApproveToDisplay]] should be used.
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
|-
|-
| 0x5A || Capture button was [[#SetRequiresCaptureButtonShortPressedMessage|short-pressed]].
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
|-
|-
| 0x5C || Screenshot was [[#SetAlbumImageTakenNotificationEnabled|taken]].
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
|}
 
This is "nn::am::AppletMessage".
 
=== OperationMode ===
{| class="wikitable" border="1"
|-
|-
!  Value
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
!  Description
|-
|-
| 0 || Handheld
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
|-
|-
| 1 || Docked
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
|}
 
=== TvPowerStateMatchingMode ===
{| class="wikitable" border="1"
|-
|-
!  Value
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
!  Description
|-
| 0 || Unknown
|-
| 1 || Unknown
|}
|}


This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
=== GetLastForegroundCaptureImage ===
Takes a type-0x6 output buffer.


=== SystemButtonType ===
Stubbed, just returns an error.
{| class="wikitable" border="1"
 
|-
=== UpdateLastForegroundCaptureImage ===
!  Value
No input/output.
!  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
|}


This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
=== GetLastApplicationCaptureImage ===
Takes a type-0x6 output buffer.


=== LaunchParameterKind ===
Stubbed, just returns an error.
{| class="wikitable" border="1"
|-
!  Value
!  Description
|-
| 1 || UserChannel. Application-specific LaunchParameter.
|-
| 2 || account PreselectedUser
|-
| 3 || Unknown if used by anything?
|}


=== LibraryAppletExitReason ===
=== GetCallerAppletCaptureImage ===
{| class="wikitable" border="1"
Takes a type-0x6 output buffer.
|-
!  Value
!  Description
|-
| 0 || Normal
|-
| 1 || Canceled
|-
| 2 || Abnormal
|-
| 10 || Unexpected
|}


=== ProgramSpecifyKind ===
Stubbed, just returns an error.
{| 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"
|-
|}


This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
=== UpdateCallerAppletCaptureImage ===
No input/output.


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


= InputDetectionPolicy =
=== GetLastForegroundCaptureImageEx ===
{| class="wikitable" border="1"
Takes a type-0x6 output buffer, returns an output u8 bool.
|-
!  Value
!  Description
|-
| 0 || Unknown.
|-
| 1 || Unknown.
|}


This is u32 enum "nn::applet::InputDetectionPolicy".
The buffer size must match 0x384000.


= AppletResourceUserId =
=== GetLastApplicationCaptureImageEx ===
This u64 is officially called "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
Takes a type-0x6 output buffer, returns an output u8 bool.


= AppletAttribute =
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.
! Offset || Size || Description
|-
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
|-
| 0x1 || 0x7F || Unused
|}


This is "nn::am::AppletAttribute". This struct is 0x8-bytes.
=== GetCallerAppletCaptureImageEx ===
Takes a type-0x6 output buffer, returns an output u8 bool.


This is used by [[#OpenLibraryAppletProxy]].
The buffer size must match 0x384000.


= AppletProcessLaunchReason =
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.
{| 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.
|}


This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
=== TakeScreenShotOfOwnLayer ===
Takes an input u8 bool and a s32, no output.


= LibraryAppletInfo =
=== CopyBetweenCaptureBuffers ===
{| class="wikitable" border="1"
Takes two input s32s, no output.
|-
 
! Offset || Size || Description
=== AcquireLastApplicationCaptureBuffer ===
|-
No input, returns an output handle.
| 0x0 || 0x4 || [[#AppletId]]
 
|-
Stubbed, just returns an error.
| 0x4 || 0x4 || [[#LibraryAppletMode]]
|}


This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
=== ReleaseLastApplicationCaptureBuffer ===
No input/output.


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


= AppletIdentityInfo =
=== AcquireLastForegroundCaptureBuffer ===
{| class="wikitable" border="1"
No input, returns an output handle.
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#AppletId]]
|-
| 0x4 || 0x4 || Padding
|-
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|}


This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
Stubbed, just returns an error.


= ApplicationAttributeForQuest =
=== ReleaseLastForegroundCaptureBuffer ===
{| class="wikitable" border="1"
No input/output.
|-
 
! Offset || Size || Description
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
|}


This struct is "nn::applet::ApplicationAttributeForQuest".
=== AcquireCallerAppletCaptureBuffer ===
No input, returns an output handle.


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


= ApplicationAttribute =
=== ReleaseCallerAppletCaptureBuffer ===
{| class="wikitable" border="1"
No input/output.
|-
! 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.
|}


This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.


Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
=== AcquireLastApplicationCaptureBufferEx ===
No input, returns an output TransferMemory handle and an output u8 bool.


= ApplicationLaunchProperty =
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.
{| class="wikitable" border="1"
 
|-
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.
! Offset || Size || Description
 
|-
=== AcquireLastForegroundCaptureBufferEx ===
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
No input, returns an output TransferMemory handle and an output u8 bool.
|-
 
| 0x8 || 0x4 || Application title-version.
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.
|-
 
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
=== AcquireCallerAppletCaptureBufferEx ===
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.
 
=== ClearCaptureBuffer ===
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.
 
Clear the input CaptureSharedBuffer with the specified RGBA8 color.
 
=== ClearAppletTransitionBuffer ===
Takes an input u32, no output.
 
Clear the AppletTransitionBuffer with the specified RGBA8 color.
 
=== AcquireLastApplicationCaptureSharedBuffer ===
No input, returns an output u8 bool and an s32.
 
This loads data from state.
 
=== ReleaseLastApplicationCaptureSharedBuffer ===
No input/output.
 
Depending on whether a state field is 0, this just returns an error or returns 0.
 
=== AcquireLastForegroundCaptureSharedBuffer ===
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"
|-
|-
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
! Cmd || Name
|-
| 1 || RequestLaunchApplicationForDebug
|-
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
|-
| 0xE || 0x1 || Unknown.
| 3 || [7.0.0+] [[#CreateStorageForDebug]]
|-
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]
|}
 
=== GetDebugStorageChannel ===
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"
|-
! Cmd || Name || Notes
|-
| 0 || [[#GetLaunchReason]] ||
|-
| 11 || [[#OpenCallingLibraryApplet]] ||
|-
| 21 || [[#PushContext]] ||
|-
| 22 || [[#PopContext]] ||
|-
| 23 || [[#CancelWindingReservation]] ||
|-
| 30 || [[#WindAndDoReserved]] ||
|-
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||
|-
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
|}
 
=== GetLaunchReason ===
No input, returns an output [[#AppletProcessLaunchReason]].
 
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"
|-
! Cmd || Name
|-
| 1 ||
|}
 
=== Cmd1 ===
No input. Returns an [[#IApplicationObserver]].
 
=== IApplicationObserver ===
This is "nn::am::service::IApplicationObserver".
 
This was added with [19.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 1 ||
|-
| 2 ||
|-
| 10 ||
|-
| 20 ||
|-
| 30 ||
|-
| 40 || [S2] [20.0.0+]
|}
 
== IAppletAlternativeFunctions ==
This is "nn::am::service::IAppletAlternativeFunctions".
 
This was added with [20.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|-
| 1 ||
|-
| 2 ||
|}
 
== IChatProxy ==
This is "nn::am::service::IChatProxy".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
| 20 || || Returns an [[#IChatFunctions]].
|}
 
=== IChatFunctions ===
This is "nn::am::service::IChatFunctions".
 
This is exclusive to Switch 2.
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 1 ||
|-
| 102 ||
|-
| 103 ||
|-
| 104 ||
|-
| 110 ||
|-
| 120 ||
|-
| 121 ||
|-
| 130 ||
|-
| 140 || [20.0.0+]
|-
| 141 || [20.0.0+]
|-
| 200 ||
|-
| 201 ||
|-
| 210 || [20.0.0+]
|-
| 220 || [20.0.0+]
|}
 
== IDebugFunctions ==
This is "nn::am::service::IDebugFunctions".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
|-
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
|-
| 10 || [[#PerformSystemButtonPressing]]
|-
| 20 || [[#InvalidateTransitionLayer]]
|-
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
|-
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
|-
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
|-
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
|-
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
|-
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
|-
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
|-
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
|-
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
|-
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
|-
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
|-
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
|-
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
|-
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
|-
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]
|-
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
|-
| 140 || [14.0.0+] [[#RestrictPowerOperationForSecureLaunchModeForDebug|RestrictPowerOperationForSecureLaunchModeForDebug]]
|-
| 150 || [21.0.0+]
|-
| 200 || [15.0.0+] [[#CreateFloatingLibraryAppletAccepterForDebug|CreateFloatingLibraryAppletAccepterForDebug]]
|-
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
|-
| 400 || [S2] LaunchDebugAppletForDebug
|-
| 401 || [S2] TerminateDebugAppletForDebug
|-
| 402 || [S2] IsDebugAppletLaunchedForDebug
|-
| 403 || [S2]
|-
| 410 || [18.0.0+] [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]]
|-
| 411 || [18.0.0+] [[#ReadGeneralStorageForDebug|ReadGeneralStorageForDebug]]
|-
| 412 || [18.0.0+] [[#WriteGeneralStorageForDebug|WriteGeneralStorageForDebug]]
|-
| 430 || [20.0.0+]
|-
| 431 || [20.0.0+]
|-
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
|-
| 910 || [20.0.0+]
|-
| 2000 || [S2] [20.0.0+]
|-
| 10000 || [S2]
|}
 
=== NotifyMessageToHomeMenuForDebug ===
Takes an input [[#AppletMessage]], no output.
 
Stubbed, just returns an error.
 
=== OpenMainApplication ===
No input, returns an output [[#IApplicationAccessor]].
 
Should not be used when no Application is running (svcBreak).
 
=== PerformSystemButtonPressing ===
Takes an input [[#SystemButtonType]], no output.
 
=== InvalidateTransitionLayer ===
No input/output.
 
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
Takes an input u8 bool flag, an [[NCM_services#ApplicationId|ApplicationId]], a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.
 
Requests to launch the specified Application, with the specified users. When the bool flag is true, the content of the second input buffer is used to create a storage which is pushed to the UserChannel for this Application (see [[#LaunchParameterKind]]).
 
=== RequestLaunchApplicationByApplicationLaunchInfoForDebug ===
Takes a total of 0x58-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.
 
[19.0.0+] Takes a total of 0x88-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.
 
=== GetAppletResourceUsageInfo ===
No input, returns an output [[#AppletResourceUsageInfo]].
 
=== SetCpuBoostModeForApplet ===
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.
 
=== PushToAppletBoundChannelForDebug ===
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.
 
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.
 
=== TryPopFromAppletBoundChannelForDebug ===
Takes an input s32, returns an output [[#IStorage]].
 
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 
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.
 
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
 
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToNotificationStorageChannel|NotificationStorageChannel]].
 
=== AlarmSettingNotificationDisableAppEventReserve ===
No input/output.
 
Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].
 
=== AlarmSettingNotificationPushAppEventNotify ===
Takes an input [[#IStorage]], no output.
 
Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.
 
=== FriendInvitationSetApplicationParameter ===
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.
 
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToFriendInvitationStorageChannel|FriendInvitationStorageChannel]].
 
=== FriendInvitationClearApplicationParameter ===
No input/output.
 
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].
 
=== FriendInvitationPushApplicationParameter ===
Takes an input [[#IStorage]], no output.
 
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
 
=== RestrictPowerOperationForSecureLaunchModeForDebug ===
No input/output.
 
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.
 
== IStorage ==
This is "nn::am::service::IStorage".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
|-
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
|}
 
Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].
 
Only 1 *Accessor session can be open for each IStorage at a time.
 
== IStorageAccessor ==
This is "nn::am::service::IStorageAccessor".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || GetSize || No input. Returns an s64.
|-
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
|-
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
|}
 
== ITransferStorageAccessor ==
This is "nn::am::service::ITransferStorageAccessor".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || GetSize || No input. Returns an output s64.
|-
| 1 || GetHandle || No input. Returns an output s64 and handle.
|}
 
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
 
= appletOE =
This is "nn::am::service::IApplicationProxyService".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 2000 || [S2] [[#OpenCompatApplicationFunctions|OpenCompatApplicationFunctions]]
|-
| 0 || [[#OpenApplicationProxy]]
|-
| 10 || [S2] [[#OpenApplicationProxy2|OpenApplicationProxy2]]
|}
 
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 ==
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
|-
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
|-
| 2 || [1.0.0-3.0.2]
|-
| 3 || [[#SetHandlingContext]]
|-
| 4 || LoadAndApplySettings
|-
| 5 || ReportUserIsActive
|}
 
== SetHandlingContext ==
[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
|-
| 0 || GetOperationMode
|-
| 1 || GetOperationModeChangeEvent
|-
| 2 || EnableAudioVisual
|-
| 3 || DisableAudioVisual
|-
| 4 || EnterSleepAndWait
|-
| 5 || GetCradleStatus
|-
| 6 || FadeInDisplay
|-
| 7 || FadeOutDisplay
|-
| 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 ==
No input, returns an output u32.
 
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
 
== CreateCradleFirmwareUpdater ==
No input. Returns an [[#ICradleFirmwareUpdater]].
 
== ICradleFirmwareUpdater ==
This is "nn::am::service::ICradleFirmwareUpdater".
 
This was added with [12.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || Start
|-
| 1 || Finish
|-
| 2 || GetUpdateDeviceStatus
|-
| 3 || GetUpdateProgress
|-
| 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.
| 0xF || 0x1 || Padding.
|}
|}
 
 
This struct is 0x10-bytes.
= ApplicationLaunchRequestInfo =
 
This is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
= ApplicationLaunchRequestInfo =
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
|-
|-
| 0x4 || 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.
| 0x8 || 0x8 || Unknown. The default is 0x0.
|}
|}
 
 
This struct is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
= AppletResourceUsageInfo =
 
This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
= AppletResourceUsageInfo =
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x4 || Unknown counter.
| 0x0 || 0x4 || Unknown counter.
|-
|-
| 0x4 || 0x4 || Unknown counter.
| 0x4 || 0x4 || Unknown counter.
|-
|-
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
|-
|-
| 0xC || 0x14 || Always zero.
| 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
|}
 
= (S2) AdrawFrameBufferInfo =
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 || Id
|-
| 0x8 || 0x2 || Width
|-
| 0xA || 0x2 || Height
|-
| 0xC || 0x4 || BlockCount
|-
| 0x10 || 0x8 ||
|-
| 0x18 || 0x8 ||
|-
| 0x20 || 0x8 ||
|}
 
= (S2) ImageInfo =
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 ||
|-
| 0x8 || 0x8 || Address
|-
| 0x10 || 0x8 ||
|-
| 0x18 || 0x8 ||
|-
| 0x20 || 0x8 ||
|-
| 0x28 || 0x8 ||
|-
| 0x30 || 0x8 ||
|-
| 0x38 || 0x4 || Offset
|-
| 0x3C || 0x4 || Size
|-
| 0x40 || 0x8 ||
|-
| 0x48 || 0x8 ||
|-
| 0x50 || 0x8 ||
|-
| 0x58 || 0x8 ||
|-
| 0x60 || 0x8 ||
|-
| 0x68 || 0x8 ||
|-
| 0x70 || 0x8 ||
|-
| 0x78 || 0x8 ||
|-
| 0x80 || 0x8 ||
|-
| 0x88 || 0x8 ||
|-
| 0x90 || 0x4 || Flags
|}
 
= Notes =
AM-sysmodule will only initialize [[Shared_Database_services|pdm:ntfy]] / use pdm:ntfy service commands when the value from [[Process_Manager_services|pm:bm]] GetBootMode is not 0x1 (Maintenance).


This struct is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
An object constructor also writes the output from [[Process_Manager_services|pm:bm]] GetBootMode into the created object. A vfunc for this object checks whether this field is Maintenance: if so, it calls a vfunc then a func and returns. Otherwise after calling various (v)funcs, if required this eventually uses [[OMM_services|ommdisp]] cmd600.
 
= 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.
 
= Notes =
AM-sysmodule will only initialize [[Shared_Database_services|pdm:ntfy]] / use pdm:ntfy service commands when the value from [[Process_Manager_services|pm:bm]] GetBootMode is not 0x1.


[[Category:Services]]
[[Category:Services]]