Applet Manager services: Difference between revisions

 
(122 intermediate revisions by 5 users not shown)
Line 11: Line 11:
|-
|-
| 100 || OpenSystemAppletProxy || Returns an [[#ISystemAppletProxy]].
| 100 || OpenSystemAppletProxy || Returns an [[#ISystemAppletProxy]].
|-
| 110 || [20.0.0+] ||
|-
|-
| 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 23: Line 25:
|-
|-
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
|-
| 450 || [19.0.0+] [[#GetSystemProcessCommonFunctions]] ||
|-
| 460 || [20.0.0+] ||
|-
|-
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
Line 58: Line 64:


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 74:


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


=== 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 171:


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 ====
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u64 titleID (<code>nn::ncm::ApplicationId</code>) and an output s32 '''total_userIDs'''.
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output [[NCM_services#ApplicationId|ApplicationId]] and an output s32 '''total_userIDs'''.


The total entries in the userID buffer must be >= {total userIDs in state}.
The total entries in the userID buffer must be >= {total userIDs in state}.


==== IsForceTerminateApplicationDisabledForDebug ====
==== IsForceTerminateApplicationDisabledForDebug ====
No input, returns a total of 1-byte of output.
No input, returns an output u8 bool.
 
When the cached value loaded from [[Settings_services#GetDebugModeFlag]] is 0 this will just set the bool to 0. Otherwise, the bool is loaded using data from [[System_Settings|system-setting]] <code>am.debug!disable_force_terminate_application</code>.


==== LaunchDevMenu ====
==== LaunchDevMenu ====
Line 158: Line 205:
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 172: Line 224:
|-
|-
| 3 || [[#GetEvent]]
| 3 || [[#GetEvent]]
|-
| 4 || [10.0.0+] [[#IsLocked]]
|}
|}


Line 186: Line 240:
===== GetEvent =====
===== GetEvent =====
No input, returns an output Event handle with autoclear=false.
No input, returns an output Event handle with autoclear=false.
==== IsLocked ====
No input, returns an output u8 bool.


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


Line 270: Line 331:


Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.
==== OpenCradleFirmwareUpdater ====
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 || StartUpdate
|-
| 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 ===
=== IApplicationCreator ===
This is "nn::am::service::IApplicationCreator".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || [[#CreateApplication]] ||
| 0 || [[#CreateApplication]]
|-
|-
| 1 || [[#PopLaunchRequestedApplication]] ||
| 1 || [[#PopLaunchRequestedApplication]]
|-
|-
| 10 || [[#CreateSystemApplication]] ||
| 10 || [[#CreateSystemApplication]]
|-
|-
| 100 || [[#PopFloatingApplicationForDevelopment]] ||
| 100 || [[#PopFloatingApplicationForDevelopment]]
|}
|}


Line 288: Line 381:


==== CreateApplication ====
==== CreateApplication ====
Takes an input u64 titleID (<code>nn::ncm::ApplicationId</code>), returns an [[#IApplicationAccessor]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IApplicationAccessor]].


==== PopLaunchRequestedApplication ====
==== PopLaunchRequestedApplication ====
Line 294: Line 387:


==== CreateSystemApplication ====
==== CreateSystemApplication ====
Takes an input u64 titleID (<code>nn::ncm::SystemApplicationId</code>), returns an [[#IApplicationAccessor]].
Takes an input [[NCM_services#ApplicationId|SystemApplicationId]], returns an [[#IApplicationAccessor]].


[[qlaunch]] only uses this with a hard-coded titleID for the "starter" title.
[[qlaunch]] only uses this with a hard-coded id for the "starter" title.


==== PopFloatingApplicationForDevelopment ====
==== PopFloatingApplicationForDevelopment ====
Line 304: Line 397:


==== IApplicationAccessor ====
==== IApplicationAccessor ====
This is "nn::am::service::IApplicationAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 352: Line 447:
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||
|-
|-
| 180 || [9.0.0+] PushToFriendInvitationStorageChannel ||
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||
|-
|-
| 190 || [9.0.0+] PushToNotificationStorageChannel ||
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||
|-
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]] ||
|-
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||
|-
| 300 || [20.0.0+] ||
|-
| 301 || [20.0.0+] ||
|}
|}


Line 366: Line 469:


===== GetApplicationId =====
===== GetApplicationId =====
No input, returns an output u64 titleID.
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
 
Gets the Application titleID.


===== PushLaunchParameter =====
===== PushLaunchParameter =====
Line 419: Line 520:


===== HasSaveDataAccessPermission =====
===== HasSaveDataAccessPermission =====
Takes an input u64 titleID, returns an output u8 bool flag.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool flag.
 
Gets whether the savedata specified by the input ApplicationId is accessible. The output flag indicates whether it's accessible.
 
If the ApplicationId matches the current application, this immediately returns success with flag=1.
 
===== PushToFriendInvitationStorageChannel =====
Takes an input [[#IStorage]], no output.


Gets whether the savedata specified by the input titleID is accessible. The output flag indicates whether it's accessible.
Clears the FriendInvitation StorageChannel, then pushes the input storage there.


If the titleID matches the current application titleID, this immediately returns success with flag=1.
===== PushToNotificationStorageChannel =====
Takes an input [[#IStorage]], no output.
 
Clears the Notification StorageChannel, then pushes the input storage there.
 
[[qlaunch]] will only push data for this when launching the Application when the Alarm was triggered, where the system was previously in sleep-mode. This data is the [[Glue_services|Notification]] ApplicationParameter.
 
===== RequestApplicationSoftReset =====
No input/output.
 
===== RestartApplicationTimer =====
No input/output.


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


== 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
|-
| 100 || [15.0.0+] SetApplicationCoreUsageMode
|-
| 160 || [18.0.0+] GetNotificationReceiverService
|-
| 161 || [18.0.0+] GetNotificationSenderService
|-
| 300 || [17.0.0+] GetCurrentApplicationId
|-
| 310 || [19.0.0+] IsSystemAppletHomeMenu
|-
| 311 || [20.0.0+]
|-
|-
| 0 || [9.0.0+] SetTerminateResult ||
| 320 || [19.0.0+] SetGpuTimeSliceBoost
|-
|-
| 10 || [[#ReadThemeStorage]] ||
| 321 || [19.0.0+] SetGpuTimeSliceBoostDueToApplication
|-
|-
| 11 || [[#WriteThemeStorage]] ||
| 322 || [20.0.0+]
|-
|-
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]] ||
| 330 || [19.0.0+]  
|-
|-
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]] ||
| 340 || [20.0.0+]
|-
|-
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]] ||
| 341 || [20.0.0+]
|-
|-
| 42 || [8.0.0+] [[#SetDisplayMagnification]] ||
| 342 || [20.0.0+]
|-
|-
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]] ||
| 350 || [20.0.0+]
|-
|-
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]] ||
| 360 || [20.0.0+]
|}
|}


Line 497: Line 670:
=== PushToAppletBoundChannel ===
=== PushToAppletBoundChannel ===
Takes an input [[#IStorage]], no output.
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 ===
=== TryPopFromAppletBoundChannel ===
No input, returns an output [[#IStorage]].
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 ===
=== GetDisplayLogicalResolution ===
Line 516: Line 693:
=== GetHomeButtonDoubleClickEnabled ===
=== GetHomeButtonDoubleClickEnabled ===
No input, returns an output u8 bool.
No input, returns an output u8 bool.
=== IsHomeButtonShortPressedBlocked ===
No input, returns an output u8 bool.
=== IsVrModeCurtainRequired ===
No input, returns an output bool.
=== SetCpuBoostRequestPriority ===
Takes an input s32, no output.


== ILibraryAppletProxy ==
== ILibraryAppletProxy ==
This is "nn::am::service::ILibraryAppletProxy".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 539: Line 727:
|-
|-
| 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]].
Line 544: Line 736:


=== ILibraryAppletSelfAccessor ===
=== ILibraryAppletSelfAccessor ===
This is "nn::am::service::ILibraryAppletSelfAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 610: Line 804:
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
|-
|-
| 120 || [9.0.0+] GetLaunchStorageInfoForDebug ||
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
|-
|-
| 130 || [9.0.0+] GetGpuErrorDetectedSystemEvent ||
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
|-
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||
|-
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
|-
| 160 || [17.0.0+] [[#GetLibraryAppletInfoEx]] ||  
|}
|}


Line 698: Line 898:


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


Gets the titleID for the currently running Application. titleID=0 when no Application is running.
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.


==== RequestExitToSelf ====
==== RequestExitToSelf ====
Line 708: Line 908:


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


This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
Line 737: Line 937:


Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
==== SetApplicationMemoryReservation ====
Takes an input u64, no output.
An Application must be currently running. The input u64 must be 0x1000-byte aligned.
==== ShouldSetGpuTimeSliceManually ====
No input, returns an output u8 bool.
==== GetLibraryAppletInfoEx ====
No input, returns an output u64. Currently always returns 0.


== IOverlayAppletProxy ==
== IOverlayAppletProxy ==
This is "nn::am::service::IOverlayAppletProxy".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 760: Line 973:
|-
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
| 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]].
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
Line 765: Line 980:


=== IOverlayFunctions ===
=== IOverlayFunctions ===
This is "nn::am::service::IOverlayFunctions".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 789: Line 1,006:
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
|-
| 30 || [9.0.0+] SetHealthWarningShowingState
| 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+]
|-
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
Line 803: Line 1,032:


==== GetApplicationIdForLogo ====
==== GetApplicationIdForLogo ====
No input, returns an output u64 titleID.
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].


Gets the application titleID for displaying the logo screen during application launch.
Gets the ApplicationId for displaying the logo screen during application launch.


When no application is running, this returns success with titleID=0.
When no application is running, this returns success with ApplicationId=0.


==== SetGpuTimeSliceBoost ====
==== SetGpuTimeSliceBoost ====
Line 833: Line 1,062:
==== SetHandlingHomeButtonShortPressedEnabled ====
==== SetHandlingHomeButtonShortPressedEnabled ====
Takes an input u8 bool, no output.
Takes an input u8 bool, no output.
==== SetHealthWarningShowingState ====
Takes an input u8 bool, no output.
This writes the input bool into state, signals an Event, and returns 0.
==== IsHealthWarningRequired ====
No input, returns an output u8 bool.


==== SetRequiresGpuResourceUse ====
==== SetRequiresGpuResourceUse ====
Line 847: Line 1,084:


== IApplicationProxy ==
== IApplicationProxy ==
This is "nn::am::service::IApplicationProxy".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 871: Line 1,110:


=== IApplicationFunctions ===
=== IApplicationFunctions ===
This is "nn::am::service::IApplicationFunctions".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 1 || [[#PopLaunchParameter]]
|-
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
|-
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
|-
|-
| 1 || [[#PopLaunchParameter]] ||
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
|-
|-
| 10 || [[#CreateApplicationAndPushAndRequestToStart]] ||
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
|-
|-
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]] ||
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
|-
|-
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]] ||
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
|-
|-
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]] ||
| 20 || [[#EnsureSaveData]]
|-
|-
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]] ||
| 21 || [[#GetDesiredLanguage]]
|-
|-
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]] ||
| 22 || [[#SetTerminateResult]]
|-
|-
| 20 || [[#EnsureSaveData]] ||
| 23 || [[#GetDisplayVersion]]
|-
|-
| 21 || [[#GetDesiredLanguage]] ||
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
|-
|-
| 22 || [[#SetTerminateResult]] ||
| 25 || [3.0.0+] ExtendSaveData
|-
|-
| 23 || [[#GetDisplayVersion]] ||
| 26 || [3.0.0+] GetSaveDataSize
|-
|-
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
| 27 || [5.0.0+] CreateCacheStorage
|-
|-
| 25 || [3.0.0+] ExtendSaveData ||
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
|-
|-
| 26 || [3.0.0+] GetSaveDataSize ||
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
|-
|-
| 27 || [5.0.0+] CreateCacheStorage ||
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
|-
|-
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]] ||
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
|-
|-
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]] ||
| 32 || [[#BeginBlockingHomeButton]]
|-
|-
| 32 || [[#BeginBlockingHomeButton]] ||
| 33 || [[#EndBlockingHomeButton]]
|-
|-
| 33 || [[#EndBlockingHomeButton]] ||
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
|-
|-
| 40 || [[#NotifyRunning]] ||
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
|-
|-
| 50 || [2.0.0+] [[#GetPseudoDeviceId]] ||
| 36 || [14.0.0+] GetLimitedApplicationLicense
|-
|-
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]] ||
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
|-
|-
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]] ||
| 40 || [[#NotifyRunning]]
|-
|-
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]] ||
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
|-
|-
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]] ||
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
|-
|-
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]] ||
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
|-
|-
| 70 || [3.0.0+] [[#RequestToShutdown]] ||
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
|-
|-
| 71 || [3.0.0+] [[#RequestToReboot]] ||
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
|-
|-
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]] ||
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
|-
|-
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]] ||
| 70 || [3.0.0+] [[#RequestToShutdown]]
|-
|-
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]] ||
| 71 || [3.0.0+] [[#RequestToReboot]]
|-
|-
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]] ||
| 72 || [10.0.0+] [[#RequestToSleep]]
|-
|-
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]] ||
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
|-
|-
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]] ||
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
|-
|-
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]] ||
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]  
|-
|-
| 120 || [5.0.0+] [[#ExecuteProgram]] ||
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
|-
|-
| 121 || [5.0.0+] [[#ClearUserChannel]] ||
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
|-
|-
| 122 || [5.0.0+] [[#UnpopToUserChannel]] ||
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
|-
|-
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]] ||
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
|-
|-
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]] ||
| 112 || [20.0.0+]
|-
|-
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
| 113 || [20.0.0+]
|-
|-
| 140 || [9.0.0+] GetFriendInvitationStorageChannelEvent ||
| 120 || [5.0.0+] [[#ExecuteProgram]]
|-
|-
| 141 || [9.0.0+] TryPopFromFriendInvitationStorageChannel ||
| 121 || [5.0.0+] [[#ClearUserChannel]]
|-
|-
| 150 || [9.0.0+] GetNotificationStorageChannelEvent ||
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
|-
|-
| 151 || [9.0.0+] TryPopFromNotificationStorageChannel ||
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
|-
|-
| 160 || [9.0.0+] GetHealthWarningDisappearedSystemEvent ||
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
|-
|-
| 170 || [9.0.0+] ||
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
|-
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]] ||
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
|-
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]] ||
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
|-
|-
| 1001 || [5.0.0+] [[#PrepareForJit]] ||
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]
|}
|-
 
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
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):
|-
| 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+]
|-
| 300 || [19.0.0+] [[#CreateMovieWriter]]
|-
| 310 || [20.0.0+]
|-
| 320 || [20.0.0+]
|-
| 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):
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.
Line 989: Line 1,268:


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


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


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


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


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


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


==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Takes an input u64 titleID, a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
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]].
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]].


==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
Takes an input u64 titleID and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
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]].
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]].
Line 1,040: Line 1,319:


This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
==== GetSaveDataSizeMax ====
No input, returns two ouput s64s.
==== GetCacheStorageMax ====
No input, returns an output s32 and s64.


==== BeginBlockingHomeButtonShortAndLongPressed ====
==== BeginBlockingHomeButtonShortAndLongPressed ====
Line 1,058: Line 1,343:
==== EndBlockingHomeButton ====
==== EndBlockingHomeButton ====
No input/output.
No input/output.
==== SelectApplicationLicense ====
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].
==== GetDeviceSaveDataSizeMax ====
No input, returns two output s64s.


==== NotifyRunning ====
==== NotifyRunning ====
Line 1,093: Line 1,384:


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


==== ExitAndRequestToShowThanksMessage ====
==== ExitAndRequestToShowThanksMessage ====
Line 1,112: Line 1,406:


User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.


This is used as an overlay for screenshots.
This is used as an overlay for screenshots.


==== SetApplicationCopyrightImage ====
==== SetApplicationCopyrightImage ====
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 '''WindowOriginMode''', and no output.
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.
 
The last s32 is "nn::oe::WindowOriginMode". This should be at least 1.


'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
Line 1,130: Line 1,424:


==== QueryApplicationPlayStatistics ====
==== QueryApplicationPlayStatistics ====
Takes a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of u64 titleIDs. Returns an output s32 for actual total output entries.
Takes a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of [[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.


The number of entries in each array is the same.
The number of entries in each array is the same.
Line 1,139: Line 1,433:


==== QueryApplicationPlayStatisticsByUid ====
==== QueryApplicationPlayStatisticsByUid ====
Takes a u128 userID, a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of u64 titleIDs. Returns an output s32 for actual total output entries.
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.


Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
Line 1,169: Line 1,463:
No input, returns an output Event handle with autoclear=false.
No input, returns an output Event handle with autoclear=false.


This is used by sdknso during applet-application initialization. A seperate thread is setup where event-waiting is handled. When the Event is signaled, official sw will assert.
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.


==== StartContinuousRecordingFlushForDebug ====
==== SetDelayTimeToAbortOnGpuError ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
Takes an input s64 "nn::TimeSpan", 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.
==== GetFriendInvitationStorageChannelEvent ====
No input, returns an output Event handle with EventClearMode=0.


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


Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].


==== PrepareForJit ====
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.
Takes no input. Launches title 010000000000003B (currently not present on retail systems) if some context variable is not set, with that context variable being initialized afterwards.


=== IMovieMaker ===
==== GetNotificationStorageChannelEvent ====
{| class="wikitable" border="1"
No input, returns an output Event handle with EventClearMode=0.
|-
! Cmd || Name
|-
| 0 || [[#GetGrcMovieMaker]]
|-
| 1 || [[#GetLayerHandle]]
|}


==== GetGrcMovieMaker ====
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, returns a GRC [[GRC_services|IMovieMaker]].


==== GetLayerHandle ====
==== TryPopFromNotificationStorageChannel ====
No input, returns an output u64.
No input, returns an output [[#IStorage]].


== ILibraryAppletCreator ==
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#CreateLibraryApplet]] ||
|-
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
| 10 || [[#CreateStorage]] ||
|-
| 11 || [[#CreateTransferMemoryStorage]] ||
|-
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
|}


=== CreateLibraryApplet ===
This is exposed by sdknso under <code>nn::notification::</code>. The storage is read into the specified output buffer, where the size is <code>size = storage_size > buf_size ? buf_size : storage_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param.
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].


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


Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
==== SetHdcpAuthenticationActivated ====
Takes an input u8 bool, no output.
 
==== GetLaunchRequiredVersion ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].
 
sdknso passes hard-coded value 0 for the u64.
 
==== UpgradeLaunchRequiredVersion ====
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.
 
sdknso passes hard-coded value 0 for the u64.
 
==== SendServerMaintenanceOverlayNotification ====
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.
 
The second input value can optionally be 0.
 
==== GetLastApplicationExitReason ====
No input, returns an output s32.
 
==== CreateMovieWriter ====
Takes 8-bytes of input and a handle. Returns an [[#IMovieWriter]].
 
This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.
 
==== StartContinuousRecordingFlushForDebug ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.


Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.


=== AreAnyLibraryAppletsLeft ===
==== CreateMovieMaker ====
No input, returns an output u8 bool.
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].


Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.


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).
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.


=== CreateStorage ===
==== PrepareForJit ====
Takes an input s64 for the storage size, returns an [[#IStorage]].
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.


This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
~IApplicationFunctions() includes:


=== CreateTransferMemoryStorage ===
    if (this->jit_process) {
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].
        Terminate(this->jit_process);
        this->jit_process = nullptr;
    }


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


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


=== CreateHandleStorage ===
=== IMovieWriter ===
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.
This is "nn::am::service::IMovieWriter".


The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
This was added with [19.0.0+].


=== ILibraryAppletAccessor ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || [[#GetAppletStateChangedEvent]] ||
| 0 ||  
|}
 
==== Cmd0 ====
No input. Returns a GRC [[GRC_services|IMovieWriter]].
 
=== IMovieMaker ===
This is "nn::am::service::IMovieMaker".
 
{| class="wikitable" border="1"
|-
|-
| 1 || [[#IsCompleted]] ||
! Cmd || Name
|-
|-
| 10 || [[#Start]] ||
| 0 || [[#GetGrcMovieMaker]]
|-
|-
| 20 || [[#RequestExit]] ||
| 1 || [[#GetLayerHandle]]
|}
 
==== GetGrcMovieMaker ====
No input, returns a GRC [[GRC_services|IMovieMaker]].
 
==== GetLayerHandle ====
No input, returns an output u64.
 
== ILibraryAppletCreator ==
This is "nn::am::service::ILibraryAppletCreator".
 
{| class="wikitable" border="1"
|-
|-
| 25 || [[#Terminate]] ||
! Cmd || Name || Notes
|-
|-
| 30 || [[#GetResult]] ||
| 0 || [[#CreateLibraryApplet]] ||  
|-
|-
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
|-
| 100 || [[#PushInData]] ||  
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
|-
| 101 || [[#PopOutData]] ||  
| 3 || [20.0.0+] ||
|-
|-
| 102 || [[#PushExtraStorage]] ||  
| 10 || [[#CreateStorage]] ||  
|-
|-
| 103 || [[#PushInteractiveInData]] ||  
| 11 || [[#CreateTransferMemoryStorage]] ||  
|-
|-
| 104 || [[#PopInteractiveOutData]] ||
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||  
|-
| 105 || [[#GetPopOutDataEvent]] ||
|-
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
|-
| 110 || [[#NeedsToExitProcess]] ||
|-
| 120 || [[#GetLibraryAppletInfo]] ||
|-
| 150 || [[#RequestForAppletToGetForeground]] ||
|-
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
|}
|}


Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.
=== CreateLibraryApplet ===
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].


==== SetOutOfFocusApplicationSuspendingEnabled ====
=== TerminateAllLibraryApplets ===
Takes an input u8 bool, no output.
No input/output.


Official sw will assert prior to using this if applet-service was not initialized as *Application.
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.


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


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


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


==== PushInteractiveInData ====
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).
Takes an input [[#IStorage]], no output.


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


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


==== GetPopInteractiveOutDataEvent ====
=== CreateTransferMemoryStorage ===
No input, returns an output event handle with autoclear=false.
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].


==== NeedsToExitProcess ====
The user-process creates the TransferMemory with permissions=0.
No input, returns an output u8 bool.


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


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


Stubbed, just returns an error.
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).


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


Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
== ICommonStateGetter ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 0 || [[#GetEventHandle]] ||
| 0 || [[#GetAppletStateChangedEvent]] ||
|-
|-
| 1 || [[#ReceiveMessage]] ||
| 1 || [[#IsCompleted]] ||
|-
|-
| 2 || [[#GetThisAppletKind]] ||
| 10 || [[#Start]] ||
|-
|-
| 3 || [[#AllowToEnterSleep]] ||
| 20 || [[#RequestExit]] ||
|-
|-
| 4 || [[#DisallowToEnterSleep]] ||
| 25 || [[#Terminate]] ||
|-
|-
| 5 || [[#GetOperationMode]] ||
| 30 || [[#GetResult]] ||
|-
|-
| 6 || [[#GetPerformanceMode]] ||
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
|-
|-
| 7 || [[#GetCradleStatus]] ||
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
|-
|-
| 8 || [[#GetBootMode]] ||
| 80 || [19.0.0+] RequestForLibraryAppletToGetForeground ||
|-
|-
| 9 || [[#GetCurrentFocusState]] ||
| 81 || [19.0.0+] GetCurrentChildLibraryApplet ||
|-
|-
| 10 || [[#RequestToAcquireSleepLock]] ||
| 90 || [20.0.0+] ||
|-
|-
| 11 || [[#ReleaseSleepLock]] ||
| 100 || [[#PushInData]] ||  
|-
|-
| 12 || [[#ReleaseSleepLockTransiently]] ||
| 101 || [[#PopOutData]] ||  
|-
|-
| 13 || [[#GetAcquiredSleepLockEvent]] ||
| 102 || [[#PushExtraStorage]] ||  
|-
|-
| 20 || [[#PushToGeneralChannel]] ||  
| 103 || [[#PushInteractiveInData]] ||  
|-
|-
| 30 || [[#GetHomeButtonReaderLockAccessor]] ||  
| 104 || [[#PopInteractiveOutData]] ||  
|-
|-
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]] ||  
| 105 || [[#GetPopOutDataEvent]] ||
|-
|-
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]] ||
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
|-
|-
| 40 || [2.0.0+] [[#GetCradleFwVersion]] ||
| 110 || [[#NeedsToExitProcess]] ||
|-
|-
| 50 || [3.0.0+] [[#IsVrModeEnabled]] ||
| 120 || [[#GetLibraryAppletInfo]] ||  
|-
|-
| 51 || [3.0.0+] [[#SetVrModeEnabled]] ||
| 150 || [[#RequestForAppletToGetForeground]] ||
|-
|-
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]] ||
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
|-
| 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]] ||
|-
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]] ||
|-
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]] ||
|-
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
|-
| 300 || [9.0.0+] GetSettingsPlatformRegion ||
|}
|}


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


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


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


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


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


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


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


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


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


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


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


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


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


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


=== GetBootMode ===
==== RequestForAppletToGetForeground ====
No input, returns an output u8.
 
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
 
=== GetCurrentFocusState ===
No input. Returns an output u8:
 
* 1: In focus.
* 2/3: Out of focus(running in "background").
 
=== RequestToAcquireSleepLock ===
No input/output.
No input/output.


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


=== ReleaseSleepLockTransiently ===
==== GetIndirectLayerConsumerHandle ====
No input/output.
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.


=== GetAcquiredSleepLockEvent ===
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
No input, returns an output Event handle with autoclear=false.


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


This is not usable under an Application, however it is usable under a LibraryApplet.
{| class="wikitable" border="1"
 
|-
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:
! Cmd || Name
* <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.
| 0 || [[#GetEventHandle]]
 
|-
=== GetHomeButtonReaderLockAccessor ===
| 1 || [[#ReceiveMessage]]
No input, returns an output [[#ILockAccessor]].
|-
 
| 2 || [[#GetThisAppletKind]]
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
|-
 
| 3 || [[#AllowToEnterSleep]]
=== GetReaderLockAccessorEx ===
|-
Takes an input u32, returns an output [[#ILockAccessor]].
| 4 || [[#DisallowToEnterSleep]]
 
|-
The input value must be 0-3. 0 = HomeButton.
| 5 || [[#GetOperationMode]]
 
|-
=== GetWriterLockAccessorEx ===
| 6 || [[#GetPerformanceMode]]
Takes an input u32, returns an output [[#ILockAccessor]].
|-
 
| 7 || [[#GetCradleStatus]]
The input value must be 0-3. 0 = HomeButton.
|-
 
| 8 || [[#GetBootMode]]
=== GetCradleFwVersion ===
|-
No input, returns 4 output u32s.
| 9 || [[#GetCurrentFocusState]]
 
|-
This uses [[#omm]] GetCradleFwVersion.
| 10 || [[#RequestToAcquireSleepLock]]
|-
| 11 || [[#ReleaseSleepLock]]
|-
| 12 || [[#ReleaseSleepLockTransiently]]
|-
| 13 || [[#GetAcquiredSleepLockEvent]]
|-
| 14 || [11.0.0+] [[#GetWakeupCount]]
|-
| 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
|-
| 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+] ([17.0.0-18.1.0] OpenNamedChannelAsChild)
|-
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
|-
| 910 || [17.0.0+] GetLaunchRequiredTick
|-
| 1000 || [19.0.0+] BeginVrMode3d
|-
| 1001 || [19.0.0+] EndVrMode3d
|-
| 1002 || [19.0.0+] IsVrModeEnabled3d
|}


=== IsVrModeEnabled ===
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.


=== SetVrModeEnabled ===
[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.
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}.
=== GetEventHandle ===
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].


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


=== SetLcdBacklighOffEnabled ===
=== GetThisAppletKind ===
Takes an input u8 bool, no output.
No input, returns an output [[#AppletKind]].


Sets whether the LCD screen blacklight is turned off.
Stubbed, just returns an error.


=== BeginVrModeEx ===
=== AllowToEnterSleep ===
No input/output.
No input/output.


Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
Stubbed, just returns an error.


=== EndVrModeEx ===
=== DisallowToEnterSleep ===
No input/output.
No input/output.


Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
Stubbed, just returns an error.


=== IsInControllerFirmwareUpdateSection ===
=== GetOperationMode ===
No input, returns an output u8 bool.
No input. Returns an output u8 for the current [[#OperationMode]].


=== GetDefaultDisplayResolution ===
=== GetPerformanceMode ===
No input, returns two output s32s '''width''' and '''height'''.
No input. Returns an output u32 for the current [[#PerformanceMode]].


=== GetDefaultDisplayResolutionChangeEvent ===
=== GetCradleStatus ===
No input, returns an output Event handle with autoclear=true.
No input, returns an output u8.


=== GetHdcpAuthenticationState ===
This uses [[#omm]] GetCradleStatus.
No input, returns an output s32.


=== GetHdcpAuthenticationStateChangeEvent ===
=== GetBootMode ===
No input, returns an output Event handle with autoclear=true.
No input, returns an output u8.


=== SetTvPowerStateMatchingMode ===
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.


=== GetApplicationIdByContentActionName ===
=== GetCurrentFocusState ===
Takes a type-0x5 input buffer containing a string, returns an output u64 titleID.
No input. Returns an output u8 [[#FocusState]].


Gets the application titleID for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (when the current applet isn't a SystemApplication).
=== RequestToAcquireSleepLock ===
No input/output.


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


=== PerformSystemButtonPressingIfInFocus ===
=== ReleaseSleepLockTransiently ===
Takes an input [[#SystemButtonType]], no output.
No input/output.


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


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


=== GetCurrentPerformanceConfiguration ===
=== PushToGeneralChannel ===
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
Takes an input [[#IStorage]], no output.


=== GetOperationModeSystemInfo ===
This is not usable under an Application, however it is usable under a LibraryApplet.
No input, returns an output u32.


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


== ISelfController ==
The input value must be 0-3. 0 = HomeButton.
{| class="wikitable" border="1"
 
|-
=== GetWriterLockAccessorEx ===
! Cmd || Name
Takes an input u32, returns an output [[#ILockAccessor]].
|-
 
| 0 || [[#Exit]]
The input value must be 0-3. 0 = HomeButton.
|-
 
| 1 || [[#LockExit]]
=== GetCradleFwVersion ===
|-
No input, returns 4 output u32s.
| 2 || [[#UnlockExit]]
 
|-
This uses [[#omm]] GetCradleFwVersion.
| 3 || [2.0.0+] [[#EnterFatalSection]]
 
|-
=== IsVrModeEnabled ===
| 4 || [2.0.0+] [[#LeaveFatalSection]]
No input, returns an output u8 bool.
|-
 
| 9 || [[#GetLibraryAppletLaunchableEvent]]
=== SetVrModeEnabled ===
|-
Takes an input u8 bool flag. No output.
| 10 || [[#SetScreenShotPermission]]
 
|-
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}.
| 11 || [[#SetOperationModeChangedNotification]]
 
|-
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.
| 12 || [[#SetPerformanceModeChangedNotification]]
 
|-
=== SetLcdBacklighOffEnabled ===
| 13 || [[#SetFocusHandlingMode]]
Takes an input u8 bool, no output.
|-
 
| 14 || [[#SetRestartMessageEnabled]]
Sets whether the LCD screen blacklight is turned off.
|-
 
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
=== BeginVrModeEx ===
|-
No input/output.
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
 
|-
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
 
|-
=== EndVrModeEx ===
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
No input/output.
|-
 
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
|-
 
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
=== IsInControllerFirmwareUpdateSection ===
|-
No input, returns an output u8 bool.
| 40 || [[#CreateManagedDisplayLayer]]
 
|-
=== SetVrPositionForDebug ===
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
Takes 4 input s32s, no output.
|-
 
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
The s32s are: x, y, width, height.
|-
 
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
|-
 
| 50 || [[#SetHandlesRequestToDisplay]]
width must be 1-1280, height must be 1-720.
|-
 
| 51 || [[#ApproveToDisplay]]
x and y must not be negative. x+width must be <=1280. y+height must be <=720.
|-
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
|-
| 61 || [[#SetMediaPlaybackState]]
|-
| 62 || [[#SetIdleTimeDetectionExtension]]
|-
| 63 || [[#GetIdleTimeDetectionExtension]]
|-
| 64 || [[#SetInputDetectionSourceSet]]
|-
| 65 || [2.0.0+] [[#ReportUserIsActive]]
|-
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
|-
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
|-
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
|-
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
|-
| 70 || [4.0.0+] [[#ReportMultimediaError]]
|-
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
|-
| 72 || [9.0.0+] SetInputDetectionPolicy
|-
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
|-
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
|-
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
|-
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
|-
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|}


=== Exit ===
=== GetDefaultDisplayResolution ===
No input/output.
No input, returns two output s32s '''width''' and '''height'''.
 
=== GetDefaultDisplayResolutionChangeEvent ===
No input, returns an output Event handle with autoclear=true.


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


=== LockExit ===
=== GetHdcpAuthenticationStateChangeEvent ===
No input/output.
No input, returns an output Event handle with autoclear=true.


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).
=== SetTvPowerStateMatchingMode ===
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.


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


Unlocks exit process, if LockExit was previously used.
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).


=== EnterFatalSection ===
=== SetCpuBoostMode ===
No input/output.
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].


=== LeaveFatalSection ===
=== CancelCpuBoostMode ===
No input/output.
No input/output.


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


=== GetLibraryAppletLaunchableEvent ===
This is not exposed by sdknso.
No input, returns an output event handle with autoclear=false.


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


Controls whether screenshot-capture is allowed.
=== PerformSystemButtonPressingIfInFocus ===
Takes an input [[#SystemButtonType]], no output.


{| class="wikitable" border="1"
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.
|-
 
! Value || Description
=== SetPerformanceConfigurationChangedNotification ===
|-
Takes an input u8 bool, no output.
| 0 || Inherit from parent applet
|-
| 1 || Enable
|-
| 2 || Disable
|-
|}


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


=== SetPerformanceModeChangedNotification ===
=== OpenMyGpuErrorHandler ===
Takes an input u8 bool flag. No output.
No input, returns an [[#IGpuErrorHandler]].


=== SetFocusHandlingMode ===
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.


=== SetRestartMessageEnabled ===
=== GetOperationModeSystemInfo ===
Takes an input u8 bool flag, no output.
No input, returns an output u32.


See [[#AppletMessage]].
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].


=== SetScreenShotAppletIdentityInfo ===
=== GetSettingsPlatformRegion ===
Takes an input [[#AppletIdentityInfo]], no output.
No input, returns an output u8.


=== SetOutOfFocusSuspendingEnabled ===
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].
Takes an input u8 bool flag. No output.


=== SetControllerFirmwareUpdateSection ===
=== ActivateMigrationService ===
Takes an input u8 bool flag, no output.
No input/output.


This throws error 0x40280 when the internal state flag already matches the input value.
Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].


=== SetRequiresCaptureButtonShortPressedMessage ===
=== DeactivateMigrationService ===
Takes an input u8 bool flag, no output.
No input/output.


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


When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
=== SuppressDisablingSleepTemporarily ===
Takes an input u64 "nn::TimeSpanType", no output.


=== SetAlbumImageOrientation ===
=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===
Takes an input u32 "nn::album::ImageOrientation". No output.
No input/output.


The input value must not be >3.
=== IGpuErrorHandler ===
This is "nn::am::service::IGpuErrorHandler".


=== SetDesirableKeyboardLayout ===
This was added with [11.0.0+].
Takes an input u32, no output.


The input u32 is "nn::settings::KeyboardLayout".
This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.


=== CreateManagedDisplayLayer ===
{| class="wikitable" border="1"
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].
|-
! Cmd || Name
|-
| 100 || [[#GetManualGpuErrorInfoSize]]
|-
| 101 || [[#GetManualGpuErrorInfo]]
|-
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]
|-
| 103 || [[#FinishManualGpuErrorHandling]]
|}


=== IsSystemBufferSharingEnabled ===
==== GetManualGpuErrorInfoSize ====
No input/output.
No input, returns an output u64.


Not available when the current applet is an Application ([[#AppletId]] == 0x01).
==== GetManualGpuErrorInfo ====
Takes a type-0x6 output buffer, returns an output u64.


Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
The OutBuffer_size must be >= the output size from [[#GetManualGpuErrorInfoSize]].


=== GetSystemSharedLayerHandle ===
sdknso exposes the buffer as <code>void*</code>.
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".


Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
==== GetManualGpuErrorDetectionSystemEvent ====
No input, returns an output Event handle with EventClearMode=0.


=== GetSystemSharedBufferHandle ===
==== FinishManualGpuErrorHandling ====
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".
No input/output.


Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
== ISelfController ==
This is "nn::am::service::ISelfController".


Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
{| class="wikitable" border="1"
 
|-
=== SetHandlesRequestToDisplay ===
! Cmd || Name
Takes an input u8 bool, no output.
|-
 
| 0 || [[#Exit]]
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
|-
 
| 1 || [[#LockExit]]
See [[#AppletMessage]].
|-
 
| 2 || [[#UnlockExit]]
=== ApproveToDisplay ===
|-
No input/output.
| 3 || [2.0.0+] [[#EnterFatalSection]]
 
|-
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
| 4 || [2.0.0+] [[#LeaveFatalSection]]
 
|-
=== OverrideAutoSleepTimeAndDimmingTime ===
| 9 || [[#GetLibraryAppletLaunchableEvent]]
Takes 4 input s32s, no output.
|-
 
| 10 || [[#SetScreenShotPermission]]
=== SetMediaPlaybackState ===
|-
Takes an input u8 bool, no output.
| 11 || [[#SetOperationModeChangedNotification]]
 
|-
=== SetIdleTimeDetectionExtension ===
| 12 || [[#SetPerformanceModeChangedNotification]]
Takes an input u32, no output.
|-
 
| 13 || [[#SetFocusHandlingMode]]
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.
|-
 
| 14 || [[#SetRestartMessageEnabled]]
=== GetIdleTimeDetectionExtension ===
|-
No input, returns an output u32.
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
 
|-
Returns the value set by [[#SetIdleTimeDetectionExtension]].
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
 
|-
=== SetInputDetectionSourceSet ===
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
Takes an input u32, no output.
|-
 
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
=== ReportUserIsActive ===
|-
No input/output.
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
 
|-
Uses idle:sys ReportUserIsActive.
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
 
|-
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.
| 21 || [13.0.0+] GetScreenShotProgramId
 
|-
=== GetCurrentIlluminance ===
| 22 || [19.0.0+] GetScreenShotAcdIndex
No input, returns an output float.
|-
 
| 23 || [19.0.0+] GetScreenShotApparentPlatform
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
|-
 
| 24 || [19.0.0+] GetScreenShotApplicationProperty
=== IsIlluminanceAvailable ===
|-
No input, returns an output u8 bool.
| 40 || [[#CreateManagedDisplayLayer]]
 
|-
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
 
|-
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
 
|-
=== SetAutoSleepDisabled ===
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
Takes an input u8 bool, no output.
|-
 
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
=== IsAutoSleepDisabled ===
|-
No input, returns an output u8 bool.
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
 
|-
=== ReportMultimediaError ===
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]
Takes an input Result and a type-0x5 input buffer, no output.
|-
 
| 50 || [[#SetHandlesRequestToDisplay]]
The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.
|-
 
| 51 || [[#ApproveToDisplay]]
=== GetCurrentIlluminanceEx ===
|-
No input, returns an output u8 bool and float.
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
 
|-
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
| 61 || [[#SetMediaPlaybackState]]
 
|-
=== SetWirelessPriorityMode ===
| 62 || [[#SetIdleTimeDetectionExtension]]
Takes an input s32 enum '''WirelessPriorityMode''', no output.
|-
 
| 63 || [[#GetIdleTimeDetectionExtension]]
The input value must be 1 or 2.
|-
 
| 64 || [[#SetInputDetectionSourceSet]]
=== GetAccumulatedSuspendedTickValue ===
|-
No input, returns an output u64 tick value.
| 65 || [2.0.0+] [[#ReportUserIsActive]]
 
|-
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
 
|-
=== GetAccumulatedSuspendedTickChangedEvent ===
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
No input, returns an output Event handle with autoclear=true.
 
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
 
=== SetAlbumImageTakenNotificationEnabled ===
Takes an input u8 bool, no output.
 
See [[#AppletMessage]].
 
=== SetApplicationAlbumUserData ===
Takes a type-0x21 input buffer, no output.
 
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.
 
=== 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.
 
== IStorageChannel ==
Added with [[7.0.0]].
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
|-
|-
| 0 || Push || No input, returns an output [[#IStorage]].
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
|-
|-
| 1 || Unpop || No input, returns an output [[#IStorage]].
| 70 || [4.0.0+] [[#ReportMultimediaError]]
|-
|-
| 2 || Pop || No input, returns an output [[#IStorage]].
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
|-
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
|-
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
|-
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
|-
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
|-
|-
| 3 || GetPopEventHandle || No input, returns an output handle.
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
|-
|-
| 4 || Clear || No input/output.
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
|}
 
== IWindowController ==
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]
|-
|-
| 0 || [[#CreateWindow]] ||
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
|-
|-
| 1 || [[#GetAppletResourceUserId]] ||
| 200 || [20.0.0+]  
|-
|-
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
| 210 || [20.0.0+]  
|-
|-
| 10 || [[#AcquireForegroundRights]] ||
| 211 || [20.0.0+]  
|-
|-
| 11 || [[#ReleaseForegroundRights]] ||
| 220 || [20.0.0+]  
|-
|-
| 12 || [[#RejectToChangeIntoBackground]] ||
| 221 || [20.0.0+]  
|-
|-
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||
| 230 || [20.0.0+]  
|-
|-
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|}
|}


=== CreateWindow ===
=== Exit ===
Takes an input u32, returns an output [[#IWindow]].
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.


=== GetAppletResourceUserId ===
=== LockExit ===
No input, returns an output u64 [[#AppletResourceUserId]].
No input/output.


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


=== AcquireForegroundRights ===
=== UnlockExit ===
No input/output.
No input/output.


Just returns 0.
Unlocks exit process, if LockExit was previously used.


=== ReleaseForegroundRights ===
=== EnterFatalSection ===
No input/output.
No input/output.


Just returns 0.
=== LeaveFatalSection ===
 
=== RejectToChangeIntoBackground ===
No input/output.
No input/output.


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


=== SetAppletWindowVisibility ===
=== GetLibraryAppletLaunchableEvent ===
Takes an input u8 bool, no output.
No input, returns an output event handle with autoclear=false.


=== SetAppletGpuTimeSlice ===
=== SetScreenShotPermission ===
Takes an input s64, no output.
Takes an input s32. No output.


The input s64 must not be negative.
Controls whether screenshot-capture is allowed.


== IAudioController ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Value || Description
|-
|-
| 0 || [[#SetExpectedMasterVolume]]
| 0 || Inherit from parent applet
|-
|-
| 1 || [[#GetMainAppletExpectedMasterVolume]]
| 1 || Enable
|-
|-
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
| 2 || Disable
|-
|-
| 3 || [[#ChangeMainAppletMasterVolume]]
|}
|-
 
| 4 || [[#SetTransparentVolumeRate]]
=== SetOperationModeChangedNotification ===
|}
Takes an input u8 bool flag. No output.


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.
=== SetPerformanceModeChangedNotification ===
Takes an input u8 bool flag. No output.


=== SetExpectedMasterVolume ===
=== SetFocusHandlingMode ===
Takes two input floats, no output.
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.


Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
=== SetRestartMessageEnabled ===
Takes an input u8 bool flag, no output.


=== GetMainAppletExpectedMasterVolume ===
See [[#AppletMessage]].
No input, returns an output float.


=== GetLibraryAppletExpectedMasterVolume ===
=== SetScreenShotAppletIdentityInfo ===
No input, returns an output float.
Takes an input [[#AppletIdentityInfo]], no output.


=== ChangeMainAppletMasterVolume ===
=== SetOutOfFocusSuspendingEnabled ===
Takes an input float and an input u64, no output.
Takes an input u8 bool flag. No output.


=== SetTransparentVolumeRate ===
=== SetControllerFirmwareUpdateSection ===
Takes an input float, no output.
Takes an input u8 bool flag, no output.


== IDisplayController ==
This throws error 0x40280 when the internal state flag already matches the input value.
{| class="wikitable" border="1"
 
|-
=== SetRequiresCaptureButtonShortPressedMessage ===
! Cmd || Name
Takes an input u8 bool flag, no output.
|-
 
| 0 || [[#GetLastForegroundCaptureImage]]
See [[#AppletMessage]].
|-
 
| 1 || [[#UpdateLastForegroundCaptureImage]]
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
|-
 
| 2 || [[#GetLastApplicationCaptureImage]]
=== SetAlbumImageOrientation ===
|-
Takes an input u32 "nn::album::ImageOrientation". No output.
| 3 || [[#GetCallerAppletCaptureImage]]
 
|-
The input value must not be >3.
| 4 || [[#UpdateCallerAppletCaptureImage]]
 
|-
=== SetDesirableKeyboardLayout ===
| 5 || [[#GetLastForegroundCaptureImageEx]]
Takes an input u32, no output.
|-
 
| 6 || [[#GetLastApplicationCaptureImageEx]]
The input u32 is "nn::settings::KeyboardLayout".
|-
 
| 7 || [[#GetCallerAppletCaptureImageEx]]
=== CreateManagedDisplayLayer ===
|-
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
 
|-
=== IsSystemBufferSharingEnabled ===
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
No input/output.
|-
 
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
Not available when the current applet is an Application ([[#AppletId]] == 0x01).
|-
 
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
|-
 
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
=== GetSystemSharedLayerHandle ===
|-
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
 
|-
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
 
|-
=== GetSystemSharedBufferHandle ===
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".
|-
 
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
|-
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
|-
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
|-
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
|-
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
|-
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
|-
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
|-
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
|-
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
|-
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
|-
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
|-
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
|}


=== GetLastForegroundCaptureImage ===
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
Takes a type-0x6 output buffer.


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


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


=== GetLastApplicationCaptureImage ===
=== SetManagedDisplayLayerSeparationMode ===
Takes a type-0x6 output buffer.
Takes an input u32, no output.


Stubbed, just returns an error.
sdknso exposes this as <code>nn::vi::SetRecordingLayerEnabled(bool)</code>.


=== GetCallerAppletCaptureImage ===
The input u32 must be 0-1.
Takes a type-0x6 output buffer.


Stubbed, just returns an error.
=== SetRecordingLayerCompositionEnabled ===
Takes an input bool, no output.


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


Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].


=== GetLastForegroundCaptureImageEx ===
See [[#AppletMessage]].
Takes a type-0x6 output buffer, returns an output u8 bool.


The buffer size must match 0x384000.
=== ApproveToDisplay ===
No input/output.


=== GetLastApplicationCaptureImageEx ===
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
Takes a type-0x6 output buffer, returns an output u8 bool.


The buffer size must match 0x384000.
=== OverrideAutoSleepTimeAndDimmingTime ===
Takes 4 input s32s, no output.


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


=== GetCallerAppletCaptureImageEx ===
=== SetIdleTimeDetectionExtension ===
Takes a type-0x6 output buffer, returns an output u8 bool.
Takes an input u32, no output.


The buffer size must match 0x384000.
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.


Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.
=== GetIdleTimeDetectionExtension ===
No input, returns an output u32.


=== TakeScreenShotOfOwnLayer ===
Returns the value set by [[#SetIdleTimeDetectionExtension]].
Takes an input u8 bool and a s32, no output.


=== CopyBetweenCaptureBuffers ===
=== SetInputDetectionSourceSet ===
Takes two input s32s, no output.
Takes an input u32, no output.


=== AcquireLastApplicationCaptureBuffer ===
=== ReportUserIsActive ===
No input, returns an output handle.
No input/output.


Stubbed, just returns an error.
Uses idle:sys ReportUserIsActive.


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


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


=== AcquireLastForegroundCaptureBuffer ===
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
No input, returns an output handle.


Stubbed, just returns an error.
=== IsIlluminanceAvailable ===
No input, returns an output u8 bool.


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


Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).


=== AcquireCallerAppletCaptureBuffer ===
=== SetAutoSleepDisabled ===
No input, returns an output handle.
Takes an input u8 bool, no output.


Stubbed, just returns an error.
=== IsAutoSleepDisabled ===
No input, returns an output u8 bool.


=== ReleaseCallerAppletCaptureBuffer ===
=== ReportMultimediaError ===
No input/output.
Takes an input Result and a type-0x5 input buffer, no output.


Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.


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


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


On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.
=== SetInputDetectionPolicy ===
Takes an input [[#InputDetectionPolicy]], no output.


=== AcquireLastForegroundCaptureBufferEx ===
=== SetWirelessPriorityMode ===
No input, returns an output TransferMemory handle and an output u8 bool.
Takes an input s32 [[#WirelessPriorityMode]], no output.


Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.
=== GetAccumulatedSuspendedTickValue ===
No input, returns an output u64 tick value.


=== AcquireCallerAppletCaptureBufferEx ===
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
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.
=== GetAccumulatedSuspendedTickChangedEvent ===
No input, returns an output Event handle with autoclear=true.


=== ClearCaptureBuffer ===
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
Takes an input u8 bool, an s32, and an u32, returns no output.


=== ClearAppletTransitionBuffer ===
=== SetAlbumImageTakenNotificationEnabled ===
Takes an input u32, no output.
Takes an input u8 bool, no output.


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


This loads data from state.
=== SetApplicationAlbumUserData ===
Takes a type-0x21 input buffer, no output.


=== ReleaseLastApplicationCaptureSharedBuffer ===
The buffer contains arbitrary UserData.
No input/output.


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


=== AcquireLastForegroundCaptureSharedBuffer ===
=== SaveCurrentScreenshot ===
No input, returns an output u8 bool and an s32.
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.


Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
sdknso exposes this under "nn::album::".


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


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


=== AcquireCallerAppletCaptureSharedBuffer ===
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
No input, returns an output u8 bool and an s32.


Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
== IStorageChannel ==
 
This is "nn::am::service::IStorageChannel".
=== ReleaseCallerAppletCaptureSharedBuffer ===
No input/output.
 
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.


=== TakeScreenShotOfOwnLayerEx ===
This was added with [7.0.0+].
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"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 1 || RequestLaunchApplicationForDebug ||  
| 0 || Push || No input, returns an output [[#IStorage]].
|-
| 1 || Unpop || No input, returns an output [[#IStorage]].
|-
| 2 || Pop || No input, returns an output [[#IStorage]].
|-
|-
| 2 || [7.0.0+] GetDebugStorageChannel || No input, returns an output [[#IStorageChannel]].
| 3 || GetPopEventHandle || No input, returns an output handle.
|-
|-
| 3 || [7.0.0+] CreateStorageForDebug || Takes a total of 8-bytes of input, returns an [[#IStorage]].
| 4 || Clear || No input/output.
|}
|}


== IProcessWindingController ==
== IWindowController ==
This is "nn::am::service::IWindowController".
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 0 || [[#GetLaunchReason]] ||
| 0 || [[#CreateWindow]] ||  
|-
|-
| 11 || [[#OpenCallingLibraryApplet]] ||  
| 1 || [[#GetAppletResourceUserId]] ||
|-
|-
| 21 || [[#PushContext]] ||  
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
|-
|-
| 22 || [[#PopContext]] ||  
| 10 || [[#AcquireForegroundRights]] ||
|-
|-
| 23 || [[#CancelWindingReservation]] ||
| 11 || [[#ReleaseForegroundRights]] ||
|-
|-
| 30 || [[#WindAndDoReserved]] ||
| 12 || [[#RejectToChangeIntoBackground]] ||
|-
|-
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||  
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||  
|-
|-
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||  
|}
|}


=== GetLaunchReason ===
=== CreateWindow ===
No input, returns an output [[#AppletProcessLaunchReason]].
Takes an input u32, returns an output [[#IWindow]].


Used by LibraryApplets.
Stubbed, just returns an error.


=== OpenCallingLibraryApplet ===
=== GetAppletResourceUserId ===
No input, returns an output [[#ILibraryAppletAccessor]].
No input, returns an output u64 [[#AppletResourceUserId]].


The objptr from state is cleared during this, an error is thrown if it's already 0.
=== GetAppletResourceUserIdOfCallerApplet ===
No input, returns an output u64 [[#AppletResourceUserId]].


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


=== PopContext ===
Just returns 0.
No input, returns an output [[#IStorage]].


=== CancelWindingReservation ===
=== ReleaseForegroundRights ===
No input/output.
No input/output.


=== WindAndDoReserved ===
Just returns 0.
 
=== RejectToChangeIntoBackground ===
No input/output.
No input/output.


=== ReserveToStartAndWaitAndUnwindThis ===
Just returns 0.
Takes an input [[#ILibraryAppletAccessor]], no output.
 
=== SetAppletWindowVisibility ===
Takes an input u8 bool, no output.
 
=== SetAppletGpuTimeSlice ===
Takes an input s64, no output.
 
The input s64 must not be negative.


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


== IDebugFunctions ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || [[#NotifyMessageToHomeMenuForDebug]] ||
| 0 || [[#SetExpectedMasterVolume]]
|-
|-
| 1 || [[#OpenMainApplication]] ||
| 1 || [[#GetMainAppletExpectedMasterVolume]]
|-
|-
| 10 || [[#PerformSystemButtonPressing]] ||
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
|-
|-
| 20 || [[#InvalidateTransitionLayer]] ||
| 3 || [[#ChangeMainAppletMasterVolume]]
|-
|-
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]] ||
| 4 || [[#SetTransparentVolumeRate]]
|-
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]] ||
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
|-
| 110 || [9.0.0+] PushToAppletBoundChannelForDebug ||
|-
|-
| 111 || [9.0.0+] TryPopFromAppletBoundChannelForDebug ||
| 5 || [20.0.0+]
|-
| 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 ||
|}
|}


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


Stubbed, just returns an error.
=== SetExpectedMasterVolume ===
Takes two input floats, no output.


=== OpenMainApplication ===
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
No input, returns an output [[#IApplicationAccessor]].


Should not be used when no Application is running (svcBreak).
=== GetMainAppletExpectedMasterVolume ===
No input, returns an output float.


=== PerformSystemButtonPressing ===
=== GetLibraryAppletExpectedMasterVolume ===
Takes an input [[#SystemButtonType]], no output.
No input, returns an output float.


=== InvalidateTransitionLayer ===
=== ChangeMainAppletMasterVolume ===
No input/output.
Takes an input float and an input u64, no output.


=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
=== SetTransparentVolumeRate ===
Takes an input u8 bool flag, an u64 Application titleID, a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.
Takes an input float, 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]]).
== IDisplayController ==
 
This is "nn::am::service::IDisplayController".
=== GetAppletResourceUsageInfo ===
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.
== IStorage ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
| 0 || [[#GetLastForegroundCaptureImage]]
|-
|-
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
| 1 || [[#UpdateLastForegroundCaptureImage]]
|}
 
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 ==
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 2 || [[#GetLastApplicationCaptureImage]]
|-
|-
| 0 || GetSize || No input. Returns an s64.
| 3 || [[#GetCallerAppletCaptureImage]]
|-
|-
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
| 4 || [[#UpdateCallerAppletCaptureImage]]
|-
|-
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
| 5 || [[#GetLastForegroundCaptureImageEx]]
|}
 
== ITransferStorageAccessor ==
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 6 || [[#GetLastApplicationCaptureImageEx]]
|-
|-
| 0 || GetSize || No input. Returns an output s64.
| 7 || [[#GetCallerAppletCaptureImageEx]]
|-
|-
| 1 || GetHandle || No input. Returns an output s64 and handle.
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
|}
 
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
 
= appletOE =
This is "nn::am::service::IApplicationProxyService".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
|-
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
|-
|-
| 0 || [[#OpenApplicationProxy]] ||
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
|}
 
This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time.
 
== OpenApplicationProxy ==
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
 
Takes a [[IPC_Marshalling|reserved]] input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias).
 
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
 
= idle:sys =
This is "nn::idle::detail::IPolicyManagerSystem"
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
|-
|-
| 0 || GetAutoPowerDownEvent
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
|-
|-
|rowspan="2"| 1 || [1.0.0-3.0.2]
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
|-
|-
| [7.0.0+] IsAutoPowerDownRequested
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
|-
|-
| 2 || [1.0.0-3.0.2]
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
|-
|-
| 3 || [[#SetHandlingContext]]
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
|-
|-
| 4 || LoadAndApplySettings
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
|-
|-
| 5 || ReportUserIsActive
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
|}
 
== SetHandlingContext ==
[3.0.0+] Now takes an additional 0x10-bytes of input.
 
= 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]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
|-
|-
| 0 || GetOperationMode ||  
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
|-
|-
| 1 || GetOperationModeChangeEvent ||  
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
|-
|-
| 2 || EnableAudioVisual ||  
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
|-
|-
| 3 || DisableAudioVisual ||  
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
|-
|-
| 4 || EnterSleepAndWait ||  
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
|-
|-
| 5 || GetCradleStatus ||  
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
|-
|-
| 6 || FadeInDisplay ||
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
|-
|}
| 7 || FadeOutDisplay ||
 
|-
=== GetLastForegroundCaptureImage ===
| 8 || [2.0.0+] GetCradleFwVersion ||
Takes a type-0x6 output buffer.
|-
 
| 9 || [2.0.0+] NotifyCecSettingsChanged ||
Stubbed, just returns an error.
|-
 
| 10 || [3.0.0+] SetOperationModePolicy ||
=== UpdateLastForegroundCaptureImage ===
|-
No input/output.
| 11 || [3.0.0+] GetDefaultDisplayResolution ||
 
|-
=== GetLastApplicationCaptureImage ===
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent ||
Takes a type-0x6 output buffer.
|-
 
| 13 || [3.0.0+] UpdateDefaultDisplayResolution ||
Stubbed, just returns an error.
|-
 
| 14 || [3.0.0+] ShouldSleepOnBoot ||
=== GetCallerAppletCaptureImage ===
|-
Takes a type-0x6 output buffer.
| 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+] ||
|-
| 27 || [9.0.0+] ||
|}


== Cmd26 ==
Stubbed, just returns an error.
No input, returns an output u32.


This is used by [[#GetOperationModeSystemInfo]].
=== UpdateCallerAppletCaptureImage ===
No input/output.


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


{| class="wikitable" border="1"
=== GetLastForegroundCaptureImageEx ===
|-
Takes a type-0x6 output buffer, returns an output u8 bool.
! Cmd || Name
 
|-
The buffer size must match 0x384000.
| 0 || GetCurrentState
 
|-
=== GetLastApplicationCaptureImageEx ===
| 1 || EnterSleep
Takes a type-0x6 output buffer, returns an output u8 bool.
|-
| 2 || GetLastWakeReason
|-
| 3 || Shutdown
|-
| 4 || GetNotificationMessageEventHandle
|-
| 5 || ReceiveNotificationMessage
|-
| 6 || AnalyzeLogForLastSleepWakeSequence
|-
| 7 || ResetEventLog
|-
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
|-
| 9 || ChangeHomeButtonLongPressingTime
|-
| 10 || PutErrorState
|-
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
|}


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


= tcap =
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.
This is "nn::tcap::server::IManager".


{| class="wikitable" border="1"
=== GetCallerAppletCaptureImageEx ===
|-
Takes a type-0x6 output buffer, returns an output u8 bool.
! Cmd || Name
|-
| 0 || GetContinuousHighSkinTemperatureEvent
|-
| 1 || SetOperationMode
|-
| 2 || LoadAndApplySettings
|}


= caps:su =
The buffer size must match 0x384000.
This is "nn::capsrv::sf::IScreenShotApplicationService".


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


This can be used by applications to save screenshots.
=== TakeScreenShotOfOwnLayer ===
Takes an input u8 bool and a s32, no output.


{| class="wikitable" border="1"
=== CopyBetweenCaptureBuffers ===
|-
Takes two input s32s, no output.
! Cmd || Name || Notes
|-
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.
|-
| 201 || SaveScreenShot ||
|-
| 203 || SaveScreenShotEx0 ||
|-
| 205 || [8.0.0+] SaveScreenShotEx1 ||
|-
| 210 || SaveScreenShotEx2 || Takes a total of 0x50-bytes of input, a type-0x15 input buffer, and a type-0x45 input buffer.  Returns a total of 0x20-bytes of output.
|}


'''SetShimLibraryVersion''' is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
=== AcquireLastApplicationCaptureBuffer ===
No input, returns an output handle.


== SaveScreenShot ==
Stubbed, just returns an error.
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.
=== ReleaseLastApplicationCaptureBuffer ===
No input/output.


This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
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.


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


== SaveScreenShotEx1 ==
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a 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 ==
=== AcquireCallerAppletCaptureBuffer ===
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]].
No input, returns an output handle.


= Library Applets =
Stubbed, just returns an error.
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.
=== ReleaseCallerAppletCaptureBuffer ===
No input/output.


Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.


== CommonArguments ==
=== AcquireLastApplicationCaptureBufferEx ===
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.
No input, returns an output TransferMemory handle and an output u8 bool.


This struct is 0x20-bytes.
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.


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.
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.


{| class="wikitable" border="1"
=== AcquireLastForegroundCaptureBufferEx ===
|-
No input, returns an output TransferMemory handle and an output u8 bool.
! Offset || Size || Typical Value || Notes
 
|-
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.
| 0x0 || 4 || 1 || Common Arguments version
 
|-
=== AcquireCallerAppletCaptureBufferEx ===
| 0x4 || 4 || 0x20 || Common Arguments size
No input, returns an output TransferMemory handle and an output u8 bool.
|-
 
| 0x8 || 4 || || Library applet version (API version)
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.
|-
 
| 0xC || 4 || 0 || Theme color
=== ClearCaptureBuffer ===
|-
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.
| 0x10 || 1 || 0 || Play startup sound
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
|-
|}


= Enums =
Clear the input CaptureSharedBuffer with the specified RGBA8 color.
=== AppletId ===
See also [[:Category:Library Applets]].


{| class="wikitable" border="1"
=== ClearAppletTransitionBuffer ===
|-
Takes an input u32, no output.
!  ID
 
!  Title-id
Clear the AppletTransitionBuffer with the specified RGBA8 color.
!  Description
 
|-
=== AcquireLastApplicationCaptureSharedBuffer ===
| 0x01
No input, returns an output u8 bool and an s32.
|
 
| Application. Not valid for use with LibraryApplets.
This loads data from state.
|-
 
| 0x02
=== ReleaseLastApplicationCaptureSharedBuffer ===
| 010000000000100C
No input/output.
| "overlayDisp"
 
|-
Depending on whether a state field is 0, this just returns an error or returns 0.
| 0x03
 
| 0100000000001000
=== AcquireLastForegroundCaptureSharedBuffer ===
| "qlaunch"
No input, returns an output u8 bool and an s32.
|-
 
| 0x04
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
| 0100000000001012
 
| "starter" SystemApplication.
=== ReleaseLastForegroundCaptureSharedBuffer ===
|-
No input/output.
| 0x0A
 
| 0100000000001001
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
| [[Auth_Applet|"auth"]]
 
|-
=== AcquireCallerAppletCaptureSharedBuffer ===
| 0x0B
No input, returns an output u8 bool and an s32.
| 0100000000001002
 
| "cabinet"
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
|-
 
| 0x0C
=== ReleaseCallerAppletCaptureSharedBuffer ===
| 0100000000001003
No input/output.
| "controller"
 
|-
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
| 0x0D
 
| 0100000000001004
=== TakeScreenShotOfOwnLayerEx ===
| "dataErase"
Takes two input u8 bools and a s32, no output.
|-
 
| 0x0E
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.
| 0100000000001005
 
| [[Error_Applet|"error"]]
== ISystemAppletControllerForDebug ==
This is "nn::am::service::ISystemAppletControllerForDebug".
 
{| class="wikitable" border="1"
|-
|-
| 0x0F
! Cmd || Name
| 0100000000001006
| "netConnect"
|-
|-
| 0x10
| 1 || RequestLaunchApplicationForDebug
| 0100000000001007
| [[Profile_Selector|"playerSelect"]]
|-
|-
| 0x11
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]
| 0100000000001008
| [[Software_Keyboard|"swkbd"]]
|-
|-
| 0x12
| 3 || [7.0.0+] [[#CreateStorageForDebug]]
| 0100000000001009
| "miiEdit"
|-
|-
| 0x13
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]
| 010000000000100A
|}
| "LibAppletWeb" [[Internet_Browser#010000000000100A|WebApplet]] applet
 
=== 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".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#GetLaunchReason]] ||
|-
|-
| 0x14
| 11 || [[#OpenCallingLibraryApplet]] ||
| 010000000000100B
| "LibAppletShop" [[Internet_Browser#ShopN|ShopN]] applet
|-
|-
| 0x15
| 21 || [[#PushContext]] ||
| 010000000000100D
| [[Album_Applet|"photoViewer"]]
|-
|-
| 0x16
| 22 || [[#PopContext]] ||  
| 010000000000100E
| "set"
|-
|-
| 0x17
| 23 || [[#CancelWindingReservation]] ||
| 010000000000100F
| "LibAppletOff" [[Internet_Browser#Offline_Applet|Offline]] applet
|-
|-
| 0x18
| 30 || [[#WindAndDoReserved]] ||
| 0100000000001010
| "LibAppletLns" [[Internet_Browser#Whitelisted_Applets|Whitelisted]] applet
|-
|-
| 0x19
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||
| 0100000000001011
| "LibAppletAuth" [[Internet_Browser#WifiWebAuthApplet|WifiWebAuth]] applet
|-
|-
| 0x1A
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
| 0100000000001013
| [[MyPage_Applet|"myPage"]]
|}
|}


=== LibraryAppletMode ===
=== GetLaunchReason ===
{| class="wikitable" border="1"
No input, returns an output [[#AppletProcessLaunchReason]].
|-
!  ID
!  Description
|-
| 0x0
| AllForeground
|-
| 0x1
| Background
|-
| 0x2
| No UI
|-
| 0x3
| Background with indirect display, see also [[#GetIndirectLayerConsumerHandle]]. Only used by swkbd InlineKeyboard.
|-
| 0x4
| AllForegroundInitiallyHidden. Can be used by [7.0.0+] [[Internet_Browser|WebSession]].
|-
|}


=== AppletMessage ===
Used by LibraryApplets.
{| class="wikitable" border="1"
|-
!  ID
!  Description
|-
| 0x4 || Exit requested
|-
| 0xF || [[#GetCurrentFocusState|FocusState]] changed
|-
| 0x10 || Current applet execution was [[#SetRestartMessageEnabled|resumed]].
|-
| 0x1E || OperationMode changed
|-
| 0x1F || PerformanceMode changed
|-
| 0x33 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]. Indicates that [[#ApproveToDisplay]] should be used.
|-
| 0x5A || Capture button was [[#SetRequiresCaptureButtonShortPressedMessage|short-pressed]].
|-
| 0x5C || Screenshot was [[#SetAlbumImageTakenNotificationEnabled|taken]].
|}


This is "nn::am::AppletMessage".
=== OpenCallingLibraryApplet ===
No input, returns an output [[#ILibraryAppletAccessor]].


=== OperationMode ===
The objptr from state is cleared during this, an error is thrown if it's already 0.
{| class="wikitable" border="1"
 
|-
=== PushContext ===
!  Value
Takes an input [[#IStorage]], no output.
!  Description
 
|-
=== PopContext ===
| 0 || Handheld
No input, returns an output [[#IStorage]].
|-
 
| 1 || Docked
=== 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+].


=== TvPowerStateMatchingMode ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name
!  Description
|-
|-
| 0 || Unknown
| 0 ||  
|-
| 1 || Unknown
|}
|}


This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
=== Cmd0 ===
No input. Returns an [[#IApplicationObserver]].
 
=== IApplicationObserver ===
This is "nn::am::service::IApplicationObserver".
 
This was added with [19.0.0+].


=== SystemButtonType ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name
!  Description
|-
|-
| 1 || PerformHomeButtonShortPressing
| 1 ||  
|-
|-
| 2 || PerformHomeButtonLongPressing
| 2 ||  
|-
|-
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
| 10 ||  
|-
|-
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
| 20 ||  
|-
|-
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].
| 30 ||  
|-
| 6 || PerformCaptureButtonShortPressing
|-
| 7 || PerformCaptureButtonLongPressing
|}
|}


This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
== IDebugFunctions ==
This is "nn::am::service::IDebugFunctions".


=== LaunchParameterKind ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name
!  Description
|-
|-
| 1 || UserChannel. Application-specific LaunchParameter.
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
|-
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
|-
| 10 || [[#PerformSystemButtonPressing]]
|-
| 20 || [[#InvalidateTransitionLayer]]
|-
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
|-
|-
| 2 || account PreselectedUser
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
|-
|-
| 3 || Unknown if used by anything?
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
|}
 
=== LibraryAppletExitReason ===
{| class="wikitable" border="1"
|-
|-
!  Value
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
!  Description
|-
|-
| 0 || Normal
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
|-
|-
| 1 || Canceled
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
|-
|-
| 2 || Abnormal
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
|-
|-
| 10 || Unexpected
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
|}
 
=== ProgramSpecifyKind ===
{| class="wikitable" border="1"
|-
|-
!  Value
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
!  Description
|-
|-
| 0 || u8 ProgramIndex. "ExecuteProgram". [[NS_Services|NS]] handles ProgramIndex by launching titleID {application_titleID}+ProgramIndex. After using [[#ExecuteProgram]] with this successfully, official user-processes will enter an infinite loop with sleep-thread value 86400000000000.
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
|-
|-
| 1 || u64 titleID. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
|-
|-
| 2 || u64 = value 0. "RestartProgram"
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
|-
|-
|}
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
 
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
 
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.
 
= AppletResourceUserId =
This u64 is officially called "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
 
= AppletAttribute =
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
|-
|-
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
|-
|-
| 0x1 || 0x7F || Unused
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]
|}
 
This is "nn::am::AppletAttribute". This struct is 0x8-bytes.
 
This is used by [[#OpenLibraryAppletProxy]].
 
= AppletProcessLaunchReason =
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
|-
|-
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].
| 140 || [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug
|-
|-
| 0x1 || 0x2 || Always 0.
| 200 || [15.0.0+] CreateFloatingLibraryAppletAccepterForDebug
|-
|-
| 0x3 || 0x1 || Always 0.
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
|}
 
This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
 
= LibraryAppletInfo =
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 410 || [18.0.0+] CreateGeneralStorageForDebug
|-
|-
| 0x0 || 0x4 || [[#AppletId]]
| 411 || [18.0.0+] ReadGeneralStorageForDebug
|-
|-
| 0x4 || 0x4 || [[#LibraryAppletMode]]
| 412 || [18.0.0+] WriteGeneralStorageForDebug
|}
 
This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
 
= AppletKind =
This is "nn::am::service::AppletKind". This is 8-bytes.
 
= AppletIdentityInfo =
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 430 || [20.0.0+]
|-
|-
| 0x0 || 0x4 || [[#AppletId]]
| 431 || [20.0.0+]
|-
|-
| 0x4 || 0x4 || Padding
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
|-
|-
| 0x8 || 0x8 || titleID
| 910 || [20.0.0+]
|}
|}


This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
=== NotifyMessageToHomeMenuForDebug ===
Takes an input [[#AppletMessage]], no output.
 
Stubbed, just returns an error.


= ApplicationAttributeForQuest =
=== OpenMainApplication ===
{| class="wikitable" border="1"
No input, returns an output [[#IApplicationAccessor]].
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
|}


This struct is "nn::applet::ApplicationAttributeForQuest".
Should not be used when no Application is running (svcBreak).


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).
=== PerformSystemButtonPressing ===
Takes an input [[#SystemButtonType]], no output.


= ApplicationAttribute =
=== InvalidateTransitionLayer ===
{| 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.
=== 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.


Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
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]]).


= ApplicationLaunchProperty =
=== RequestLaunchApplicationByApplicationLaunchInfoForDebug ===
{| class="wikitable" border="1"
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.
|-
 
! Offset || Size || Description
[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.
|-
 
| 0x0 || 0x8 || Application titleID.
=== 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.
 
=== 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.
 
=== FriendInvitationClearApplicationParameter ===
No input/output.
 
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].
 
=== FriendInvitationPushApplicationParameter ===
Takes an input [[#IStorage]], no output.
 
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
 
== IStorage ==
This is "nn::am::service::IStorage".
 
{| class="wikitable" border="1"
|-
! 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"
|-
|-
| 0x8 || 0x4 || Application title-version.
! Cmd || Name || Notes
|-
| 0 || GetSize || No input. Returns an s64.
|-
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
|-
|-
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
| 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 || 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.
 
= (Switch 2) appletOE =
[S2] This is "nn::am::service::IApplicationProxyServiceForNxCompat".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#OpenApplicationProxy]] ||
|-
| 2000 || [[#OpenCompatApplicationFunctions]] ||  Returns an [[#(Switch 2) INxCompatApplicationFunctions]]
|}
 
== OpenApplicationProxy ==
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
 
Takes a [[IPC_Marshalling|reserved]] input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias).
 
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
 
= (Switch 2) INxCompatApplicationFunctions =
This is "nn::am::service::INxCompatApplicationFunctions".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 2000 || GetTipcCompatInterface? || Returns a TIPC handle to [[#TipcCompatInterface]].
|-
| 2001 || ||
|-
| 2002 || ||
|-
| 2003 || || Called directly after "nn::vi::WriteToCopyrightFramebuffer".
|-
| 2004 || ||
|-
| 2010 || ||
|-
| 2020 || Initialize? || Called during init. Takes no args.
|-
| 2030 || GetVsyncEvent? || Takes no args. Returns a event handle.
|-
| 2040 || GetVsyncTimestamp? || When above event triggers, this returns a timestamp.
|-
| 2050 || ||
|-
| 2060 ||  ||
|-
| 2070 || CreateMovieMaker || Same args as [[#CreateMovieMaker]]. Returns an [[#IMovieMaker]].
|}
 
== (Switch 2) TipcCompatInterface ==
{| class="wikitable" border="1"
|-
! Cmd (adjusted - 16) || Name || Notes
|-
| 4 || InitializeA || Sends current process handle, and struct { u64 aruid; u64 always_0x8000000000000005; u64 always_0; u64 always_0; u64 always_0; u64 svc_get_info_31_or_32_output; }.
|-
| 11 || InitializeB || Sends current process handle. No args. Sent directly after cmd4.
|-
| 101 || InitializeC || Sent directly after cmd11.
|-
| 111 || ||
|-
| 112 || ||
|-
| 114 || ||
|-
| 115 || ||
|-
| 187 || ||
|-
| 201 || ||
|-
| 301 || ||
|-
| 327 || ||
|-
| 303 || ||
|-
| 311 || ||
|-
| 312 || ||
|-
| 314 || ||
|-
| 315 || ||
|-
| 321 || ||
|-
| 391 || ||
|-
| 401 || ||
|-
| 402 || ||
|-
| 423 || ||
|-
| 434 || ||
|-
| 497 || ||
|-
| 901 || ||
|-
| 902 || ||
|-
| 903 || ||
|-
| 905 || ||
|-
| 911 || ||
|-
| 912 || ||
|-
| 922 || ||
|-
| 961 || ||
|-
| 991 || ||
|-
| 1001 || ||
|-
| 1002 || ||
|-
| 1003 || ||
|-
| 1101 || ||
|-
| 1102 || ||
|-
| 1401 || InitializeNvdrv2WithTransferMemory || Takes a TransferMemory handle, and u64 size. Returns an [[#INvDrv2User]].
|-
| 1402 || InitializeNvdrv2 || Returns an [[#INvDrv2User]].
|-
| 1501 || ||
|-
| 1502 || ||
|-
| 1601 || ||
|-
| 1602 || ||
|-
| 1603 || ||
|-
| 1611 || ||
|-
| 1612 || ||
|-
| 1691 || ||
|}
 
== (Switch 2) INvDrv2User ==
This is "nn::nvdrv::INvDrv2User".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || Open
|-
| 1 || Ioctl
|-
| 2 || Close
|-
| 4 || QueryEvent
|-
| 9 || DumpStatus
|-
| 10 || InitializeDevtools
|-
| 11 || Ioctl2
|-
| 12 || Ioctl3
|-
| 13 || SetGraphicsFirmwareMemoryMarginEnabled
|}
 
= 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+].
 
{| 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
|}
 
= 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
|-
| 0x00
|
| None
|-
| 0x01
|
| Application (not valid for use with LibraryApplets)
|-
| 0x02
| 010000000000100C
| OverlayApplet (overlayDisp)
|-
| 0x03
| 0100000000001000
| SystemAppletMenu (qlaunch)
|-
| 0x04
| 0100000000001012
| SystemApplication (starter)
|-
| 0x0A
| 0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
| 0x0B
| 0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
| 0x0C
| 0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
| 0x0D
| 0100000000001004
| LibraryAppletDataErase (dataErase)
|-
| 0x0E
| 0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
|-
| 0x0F
| 0100000000001006
| LibraryAppletNetConnect (netConnect)
|-
| 0x10
| 0100000000001007
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
|-
| 0x11
| 0100000000001008
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
|-
| 0x12
| 0100000000001009
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
|-
| 0x13
| 010000000000100A
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
| 0x14
| 010000000000100B
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
| 0x15
| 010000000000100D
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
| 0x16
| 010000000000100E
| LibraryAppletSet (set)
|-
| 0x17
| 010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
| 0x18
| 0100000000001010
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
|-
| 0x19
| 0100000000001011
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
|-
| 0x1A
| 0100000000001013
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
|-
| 0x1B
| 010000000000101A
| LibraryAppletGift (gift)
|-
| 0x1C
| 010000000000101C
| LibraryAppletUserMigration (userMigration)
|-
| 0x1D
| 010000000000101D
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
|-
| 0x1E
| 0100000000001020
| [9.0.0+] LibraryAppletStory (story)
|-
| 0x1F
| 010070000E3C0000
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
|-
| 0x20
| 010086000E49C000
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
|-
| 0x21
| 0100000000001038
| [10.0.0+] LibraryAppletSample (sample)
|-
| 0x22
| 0100000000001007
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
|-
| 0x32
| 010000000000100F
| [17.0.0+] LibraryAppletOfflineWebApp_3 ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
| 0x33
| 010000000000100F
| [17.0.0+] LibraryAppletOfflineWebSystem ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
| 0x35
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] LibraryAppletLhub ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
| 0x36
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] LibraryAppletLogin ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
| 0x37
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] LibraryAppletShare ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
| 0x38
| 0100000000001043
| [16.0.0-16.1.0]
|-
| 0x50
| 0100000000001007
| [18.0.0+]
|-
| 0x51
| 0100000000001007
| [18.0.0+]
|-
| 0x64
| 0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
|-
| 0x3E8
|
| [10.0.0-16.1.0] DevlopmentTool
|-
| 0x3F1
| 010000000000D619
| [10.0.0-16.1.0] CombinationLA
|-
| 0x3F2
| 010000000000D610
| [10.0.0-16.1.0] AeSystemApplet
|-
| 0x3F3
| 010000000000D611
| [10.0.0-16.1.0] AeOverlayApplet
|-
| 0x3F4
| 010000000000D612
| [10.0.0-16.1.0] AeStarter
|-
| 0x3F5
| 010000000000D613
| [10.0.0-16.1.0] AeLibraryAppletAlone
|-
| 0x3F6
| 010000000000D614
| [10.0.0-16.1.0] AeLibraryApplet1
|-
| 0x3F7
| 010000000000D615
| [10.0.0-16.1.0] AeLibraryApplet2
|-
| 0x3F8
| 010000000000D616
| [10.0.0-16.1.0] AeLibraryApplet3
|-
| 0x3F9
| 010000000000D617
| [10.0.0-16.1.0] AeLibraryApplet4
|-
| 0x3FA
| 010000000000D60A
| [10.0.0-16.1.0] AppletISA
|-
| 0x3FB
| 010000000000D60B
| [10.0.0-16.1.0] AppletIOA
|-
| 0x3FC
| 010000000000D60C
| [10.0.0-16.1.0] AppletISTA
|-
| 0x3FD
| 010000000000D60D
| [10.0.0-16.1.0] AppletILA1
|-
| 0x3FE
| 010000000000D60E
| [10.0.0-16.1.0] AppletILA2
|-
| 0x700000C8
| 010000000000D65B
| [18.0.0+]
|-
| 0x700000C9
| 010000000000D65C
| [18.0.0+]
|-
| 0x700000DC
| 010000000000D619
| [17.0.0+] CombinationLA
|-
| 0x700000E6
| 010000000000D610
| [17.0.0+] AeSystemApplet
|-
| 0x700000E7
| 010000000000D611
| [17.0.0+] AeOverlayApplet
|-
| 0x700000E8
| 010000000000D612
| [17.0.0+] AeStarter
|-
| 0x700000E9
| 010000000000D613
| [17.0.0+] AeLibraryAppletAlone
|-
| 0x700000EA
| 010000000000D614
| [17.0.0+] AeLibraryApplet1
|-
| 0x700000EB
| 010000000000D615
| [17.0.0+] AeLibraryApplet2
|-
| 0x700000EC
| 010000000000D616
| [17.0.0+] AeLibraryApplet3
|-
| 0x700000ED
| 010000000000D617
| [17.0.0+] AeLibraryApplet4
|-
| 0x700000F0
| 010000000000D60A
| [17.0.0+] AppletISA
|-
| 0x700000F1
| 010000000000D60B
| [17.0.0+] AppletIOA
|-
| 0x700000F2
| 010000000000D60C
| [17.0.0+] AppletISTA
|-
| 0x700000F3
| 010000000000D60D
| [17.0.0+] AppletILA1
|-
| 0x700000F4
| 010000000000D60E
| [17.0.0+] AppletILA2
|-
| 0x700000FA
| 010000000000D677
| [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.
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
|-
|-
| 0xE || 0x1 || Unknown.
| 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.
|}
|}
 
 
This struct is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
= 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
|}
 
= 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).


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