Difference between revisions of "Applet Manager services"

From Nintendo Switch Brew
Jump to navigation Jump to search
 
(237 intermediate revisions by 4 users not shown)
Line 23: Line 23:
 
|-
 
|-
 
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
 
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
 +
|-
 +
| 450 || [19.0.0+] [[#GetSystemProcessCommonFunctions]] ||
 
|-
 
|-
 
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
 
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
Line 28: Line 30:
  
 
All of these Open*Proxy commands except [[#OpenLibraryAppletProxy]] take the same input as [[#OpenApplicationProxy]], with the same user-process retry-loop as [[#OpenApplicationProxy]]. These Open*Proxy commands (including appletOE) doesn't seem to usable from processes which aren't actual applets (such as sysmodules), at least for applet-types which aren't already in use.
 
All of these Open*Proxy commands except [[#OpenLibraryAppletProxy]] take the same input as [[#OpenApplicationProxy]], with the same user-process retry-loop as [[#OpenApplicationProxy]]. These Open*Proxy commands (including appletOE) doesn't seem to usable from processes which aren't actual applets (such as sysmodules), at least for applet-types which aren't already in use.
 +
 +
OpenLibraryAppletProxyOld eventually calls the same func as [[#OpenLibraryAppletProxy]], except that the [[#AppletAttribute]] is all-zero.
  
 
This service is used by all system non-regular-applications.
 
This service is used by all system non-regular-applications.
Line 41: Line 45:
 
Returns an [[#ILibraryAppletProxy]].
 
Returns an [[#ILibraryAppletProxy]].
  
Takes a [[IPC_Marshalling|reserved]] input u64(official user-processes use hard-coded value 0), a PID,a process copy-handle(cur-proc handle alias), and an 0x80-byte type-0x15 input buffer '''AppletAttribute'''.
+
Takes a [[IPC_Marshalling|reserved]] input u64(official user-processes use hard-coded value 0), a PID,a process copy-handle(cur-proc handle alias), and a type-0x15 input buffer containing an [[#AppletAttribute]].
  
 
Official user-processes use the same retry loop with this as the other Open*Proxy commands.
 
Official user-processes use the same retry loop with this as the other Open*Proxy commands.
Line 56: Line 60:
  
 
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 63: Line 70:
  
 
== ISystemAppletProxy ==
 
== ISystemAppletProxy ==
 +
This is "nn::am::service::ISystemAppletProxy".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 93: Line 102:
  
 
=== 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]]
 +
|-
 +
| 40 || [11.0.0+] [[#IsSleepEnabled]]
 
|-
 
|-
| 10 || RequestToGetForeground ||  
+
| 41 || [12.0.0+] [[#IsRebootEnabled]]
 
|-
 
|-
| 11 || LockForeground ||
+
| 50 || [16.0.0+] [[#LaunchSystemApplet]]
 
|-
 
|-
| 12 || UnlockForeground ||  
+
| 51 || [16.0.0+] [[#LaunchStarter]]
 
|-
 
|-
| 20 || [[#PopFromGeneralChannel]] ||
+
| 60 || [19.0.0+]  
 
|-
 
|-
| 21 || [[#GetPopFromGeneralChannelEvent]] ||
+
| 61 || [19.0.0+]  
 
|-
 
|-
| 30 || [[#GetHomeButtonWriterLockAccessor]] ||
+
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]]
 
|-
 
|-
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]] ||
+
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]]
 
|-
 
|-
| 100 || [6.0.0+] PopRequestLaunchApplicationForDebug ||
+
| 200 || [8.0.0+] [[#LaunchDevMenu]]
 
|-
 
|-
| 200 || [8.0.0+] [[#LaunchDevMenu]] ||
+
| 1000 || [11.0.0+] [[#SetLastApplicationExitReason]]
 
|}
 
|}
 +
 +
==== RequestToGetForeground ====
 +
No input/output.
 +
 +
==== LockForeground ====
 +
No input/output.
 +
 +
==== UnlockForeground ====
 +
No input/output.
  
 
==== PopFromGeneralChannel ====
 
==== PopFromGeneralChannel ====
Line 120: Line 156:
  
 
==== GetPopFromGeneralChannelEvent ====
 
==== GetPopFromGeneralChannelEvent ====
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=false.
  
 
==== GetHomeButtonWriterLockAccessor ====
 
==== GetHomeButtonWriterLockAccessor ====
 
No input, returns an output [[#ILockAccessor]].
 
No input, returns an output [[#ILockAccessor]].
 +
 +
Similar to using [[#GetWriterLockAccessorEx]] with inval=0.
  
 
==== GetWriterLockAccessorEx ====
 
==== GetWriterLockAccessorEx ====
 
Takes an input u32, returns an output [[#ILockAccessor]].
 
Takes an input u32, returns an output [[#ILockAccessor]].
  
==== LaunchDevMenu ====
+
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.
 
No input/output.
  
Uses [[NS_Services#IApplicationManagerInterface]] cmd99.
+
This is similar to [[#LaunchSystemApplet]], except this uses [[NS_Services|ns]] LaunchLibraryApplet with a ProgramId from global state.
  
==== ILockAccessor ====
+
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.
{| class="wikitable" border="1"
+
 
 +
==== PopRequestLaunchApplicationForDebug ====
 +
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}.
 +
 
 +
==== IsForceTerminateApplicationDisabledForDebug ====
 +
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 ====
 +
No input/output.
 +
 
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 
 +
Uses [[NS_Services|ns]] LaunchDevMenu.
 +
 
 +
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 ====
 +
This is "nn::am::service::ILockAccessor".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 1 || TryLock
+
| 1 || [[#TryLock]]
 
|-
 
|-
| 2 || Unlock
+
| 2 || [[#Unlock]]
 
|-
 
|-
 
| 3 || [[#GetEvent]]
 
| 3 || [[#GetEvent]]
 +
|-
 +
| 4 || [10.0.0+] [[#IsLocked]]
 
|}
 
|}
 +
 +
===== TryLock =====
 +
Takes an input u8 bool flag, returns an output u8 bool flag and a handle.
 +
 +
Official sw waits on the previously loaded event from [[#GetEvent]]. The output flag indicates whether locking was successful, the user-process can try using this cmd again when flag=false.
 +
 +
Official sw only uses inflag=false. Official sw just closes the output handle. The input flag controls whether this returns the output handle.
 +
 +
===== Unlock =====
 +
No input/output.
  
 
===== GetEvent =====
 
===== GetEvent =====
No input, returns an output handle.
+
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]]
 
|}
 
|}
  
==== IsAutoPowerDownRequested ====
+
==== RequestToEnterSleep ====
No input, returns an output u8 bool.
+
No input/output.
 +
 
 +
Stubbed, just returns an error.
 +
 
 +
==== EnterSleep ====
 +
No input/output.
 +
 
 +
Stubbed, just returns an error.
 +
 
 +
==== StartSleepSequence ====
 +
Takes an input u8 bool, no output.
 +
 
 +
Official sw uses hard-coded input value = 1.
 +
 
 +
==== StartShutdownSequence ====
 +
No input/output.
 +
 
 +
==== StartRebootSequence ====
 +
No input/output.
  
==== ShouldSleepOnBoot ====
+
==== IsAutoPowerDownRequested ====
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
  
=== IApplicationCreator ===
+
Uses [[#idle:sys]] cmd1.
{| class="wikitable" border="1"
 
|-
 
! Cmd || Name || Notes
 
|-
 
| 0 || [[#CreateApplication]] ||
 
|-
 
| 1 || [[#PopLaunchRequestedApplication]] ||
 
|-
 
| 10 || [[#CreateSystemApplication]] ||
 
|-
 
| 100 || [[#PopFloatingApplicationForDevelopment]] ||
 
|}
 
  
==== CreateApplication ====
+
==== LoadAndApplyIdlePolicySettings ====
Takes an input u64 <code>nn::ncm::ApplicationId</code>(titleID), returns an [[#IApplicationAccessor]].
+
No input/output.
  
==== PopLaunchRequestedApplication ====
+
Uses [[#idle:sys]] cmd LoadAndApplySettings.
No input, returns an [[#IApplicationAccessor]].
 
  
==== CreateSystemApplication ====
+
==== NotifyCecSettingsChanged ====
Takes an input u64 <code>nn::ncm::SystemApplicationId</code>, returns an [[#IApplicationAccessor]].
+
No input/output.
  
==== PopFloatingApplicationForDevelopment ====
+
Uses [[#omm]] cmd NotifyCecSettingsChanged.
No input, returns an [[#IApplicationAccessor]].
+
 
 +
==== SetDefaultHomeButtonLongPressTime ====
 +
Takes an input s64, no output.
 +
 
 +
==== UpdateDefaultDisplayResolution ====
 +
No input/output.
 +
 
 +
Uses [[#omm]] cmd UpdateDefaultDisplayResolution.
 +
 
 +
==== ShouldSleepOnBoot ====
 +
No input, returns an output u8 bool.
 +
 
 +
Uses [[#omm]] cmd ShouldSleepOnBoot.
 +
 
 +
==== GetHdcpAuthenticationFailedEvent ====
 +
No input, returns an output Event handle with autoclear=false.
 +
 
 +
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.
 +
 
 +
==== OpenCradleFirmwareUpdater ====
 +
No input, returns an [[#ICradleFirmwareUpdater]].
 +
 
 +
=== ICradleFirmwareUpdater ===
 +
This is "nn::am::service::ICradleFirmwareUpdater".
 +
 
 +
This was added with [12.0.0+].
  
==== IApplicationAccessor ====
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || [[#GetAppletStateChangedEvent]] ||
+
| 0 || StartUpdate
 
|-
 
|-
| 1 || [[#IsCompleted]] ||
+
| 1 || FinishUpdate
 
|-
 
|-
| 10 || Start ||
+
| 2 || [[#GetCradleDeviceInfo]]
 
|-
 
|-
| 20 || RequestExit ||  
+
| 3 || GetCradleDeviceInfoChangeEvent
 
|-
 
|-
| 25 || Terminate ||  
+
| 4 || GetUpdateProgressInfo
 
|-
 
|-
| 30 || GetResult ||  
+
| 5 || GetLastInternalResult
 +
|}
 +
 
 +
==== GetCradleDeviceInfo ====
 +
No input, returns a 8-byte CradleDeviceInfo.
 +
 
 +
[13.0.0+] Now returns a total of 0xC-bytes.
 +
 
 +
=== IApplicationCreator ===
 +
This is "nn::am::service::IApplicationCreator".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 101 || RequestForApplicationToGetForeground ||
+
! Cmd || Name
|-
 
| 110 || TerminateAllLibraryApplets ||  
 
 
|-
 
|-
| 111 || AreAnyLibraryAppletsLeft ||  
+
| 0 || [[#CreateApplication]]
 
|-
 
|-
| 112 || [[#GetCurrentLibraryApplet]] ||
+
| 1 || [[#PopLaunchRequestedApplication]]
 
|-
 
|-
| 120 || GetApplicationId ||  
+
| 10 || [[#CreateSystemApplication]]
 
|-
 
|-
| 121 || [[#PushLaunchParameter]] ||  
+
| 100 || [[#PopFloatingApplicationForDevelopment]]
 +
|}
 +
 
 +
[[#CreateApplication]]/[[#CreateSystemApplication]] eventually call the same internal func. With [[#CreateApplication]], two ptrs passed to the internal func are NULL, while with [[#CreateSystemApplication]] these are loaded from state. The initial content of [[#ApplicationLaunchRequestInfo]] is all-zero with [[#CreateSystemApplication]], while with [[#CreateApplication]] the first two u32s are value 0x3 with the rest all-zero. The [[#AppletId]] is set to 0x01 with [[#CreateApplication]], while with [[#CreateSystemApplication]] it's 0x04.
 +
 
 +
==== CreateApplication ====
 +
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IApplicationAccessor]].
 +
 
 +
==== PopLaunchRequestedApplication ====
 +
No input, returns an [[#IApplicationAccessor]].
 +
 
 +
==== CreateSystemApplication ====
 +
Takes an input [[NCM_services#ApplicationId|SystemApplicationId]], returns an [[#IApplicationAccessor]].
 +
 
 +
[[qlaunch]] only uses this with a hard-coded id for the "starter" title.
 +
 
 +
==== PopFloatingApplicationForDevelopment ====
 +
No input, returns an [[#IApplicationAccessor]].
 +
 
 +
Should not be used if no FloatingApplication is available (svcBreak).
 +
 
 +
==== IApplicationAccessor ====
 +
This is "nn::am::service::IApplicationAccessor".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 122 || [[#GetApplicationControlProperty]] ||  
+
! Cmd || Name || Notes
 +
|-
 +
| 0 || [[#GetAppletStateChangedEvent]] ||
 +
|-
 +
| 1 || [[#IsCompleted]] ||
 +
|-
 +
| 10 || [[#Start]] ||
 +
|-
 +
| 20 || [[#RequestExit]] ||  
 
|-
 
|-
| 123 || [2.0.0+] GetApplicationLaunchProperty ||  
+
| 25 || [[#Terminate]] ||  
 
|-
 
|-
| 124 || [6.0.0+] GetApplicationLaunchRequestInfo ||  
+
| 30 || [[#GetResult]] ||  
 
|-
 
|-
| 130 || [6.0.0+] SetUsers ||  
+
| 101 || [[#RequestForApplicationToGetForeground]] ||  
 
|-
 
|-
| 131 || [6.0.0+] CheckRightsEnvironmentAvailable ||  
+
| 110 || [[#TerminateAllLibraryApplets]] ||  
 
|-
 
|-
| 132 || [6.0.0+] GetNsRightsEnvironmentHandle ||  
+
| 111 || [[#AreAnyLibraryAppletsLeft]] ||  
 
|-
 
|-
| 140 || [6.0.0+] GetDesirableUids ||  
+
| 112 || [[#GetCurrentLibraryApplet]] ||  
 
|-
 
|-
| 150 || [6.0.0+] ReportApplicationExitTimeout ||  
+
| 120 || [[#GetApplicationId]] ||  
 
|-
 
|-
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||
+
| 121 || [[#PushLaunchParameter]] ||  
 
|-
 
|-
| 170 || [8.0.0+] HasSaveDataAccessPermission ||
+
| 122 || [[#GetApplicationControlProperty]] ||
|}
+
|-
 
+
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]] ||
Commands <=30 are inherited from [[#IAppletAccessor]].
+
|-
 
+
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]] ||
===== GetCurrentLibraryApplet =====
+
|-
 +
| 130 || [6.0.0+] [[#SetUsers]] ||
 +
|-
 +
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]] ||
 +
|-
 +
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]] ||
 +
|-
 +
| 140 || [6.0.0+] [[#GetDesirableUids]] ||
 +
|-
 +
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]] ||
 +
|-
 +
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||
 +
|-
 +
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||
 +
|-
 +
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||
 +
|-
 +
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||
 +
|-
 +
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]] ||
 +
|-
 +
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||
 +
|}
 +
 
 +
Commands <=30 are inherited from [[#IAppletAccessor]].
 +
 
 +
===== RequestForApplicationToGetForeground =====
 +
No input/output.
 +
 
 +
===== GetCurrentLibraryApplet =====
 
No input, returns an output [[#IAppletAccessor]].
 
No input, returns an output [[#IAppletAccessor]].
 +
 +
===== GetApplicationId =====
 +
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
  
 
===== PushLaunchParameter =====
 
===== PushLaunchParameter =====
Line 270: Line 468:
 
===== GetApplicationControlProperty =====
 
===== GetApplicationControlProperty =====
 
No input, takes a type-0x6 output buffer.
 
No input, takes a type-0x6 output buffer.
 +
 +
The output buffer must be at least 0x4000-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication.
  
 
This gets the application [[NACP_Format|control.nacp]].
 
This gets the application [[NACP_Format|control.nacp]].
  
===== SetApplicationAttribute =====
+
===== GetApplicationLaunchProperty =====
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
+
Takes a type-0x6 output buffer.
 +
 
 +
The output buffer size must be at least 0x10-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication.
 +
 
 +
This gets the [[#ApplicationLaunchProperty]].
 +
 
 +
===== GetApplicationLaunchRequestInfo =====
 +
No input, returns an output 0x10-byte struct.
  
===== IAppletAccessor =====
+
This gets the [[#ApplicationLaunchRequestInfo]] from state. The output struct is "nn::applet::ApplicationLaunchRequestInfo".
{| class="wikitable" border="1"
+
 
|-
+
===== SetUsers =====
! Cmd || Name
+
Takes an input u8 bool flag and a type-0x5 input buffer containing an array of u128 userIDs.
|-
+
 
| 0 || [[#GetAppletStateChangedEvent]]
+
The total entries for the userIDs must be <=8.
|-
 
| 1 || [[#IsCompleted]]
 
|-
 
| 10 || [[#Start]]
 
|-
 
| 20 || [[#RequestExit]]
 
|-
 
| 25 || [[#Terminate]]
 
|-
 
| 30 || [[#GetResult]]
 
|}
 
  
==== GetAppletStateChangedEvent ====
+
When the input flag is true, this just clears the '''users_available''' state flag to 0 and returns.
No input, returns an output event handle with autoclear=false.
 
  
==== IsCompleted ====
+
===== CheckRightsEnvironmentAvailable =====
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
  
==== Start ====
+
===== GetNsRightsEnvironmentHandle =====
No input/output.
+
No input, returns an output u64.
 +
 
 +
===== GetDesirableUids =====
 +
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output s32 '''total_entries'''.
 +
 
 +
Gets a userID listing, this is unrelated to [[#SetUsers]]. [[qlaunch]] only uses 1 userID with this.
  
==== RequestExit ====
+
The stored entry-count in state must be <= <size of output buffer in entries>.
No input/output.
 
  
==== Terminate ====
+
===== ReportApplicationExitTimeout =====
 
No input/output.
 
No input/output.
  
==== GetResult====
+
===== SetApplicationAttribute =====
No input/output.
+
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
  
== IAppletCommonFunctions ==
+
===== HasSaveDataAccessPermission =====
Added with [[7.0.0]].
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool flag.
  
{| class="wikitable" border="1"
+
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.
 +
 
 +
Clears the FriendInvitation StorageChannel, then pushes the input storage there.
 +
 
 +
===== 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 =====
 +
This is "nn::am::service::IAppletAccessor".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 10 || ReadThemeStorage || Takes an input u64 '''offset''' and a type-0x22 output buffer, returns an output u64 '''actual_transfer_size'''.
+
| 0 || [[#GetAppletStateChangedEvent]]
 
|-
 
|-
| 11 || WriteThemeStorage || Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
+
| 1 || [[#IsCompleted]]
 
|-
 
|-
| 40 || [8.0.0+] GetDisplayLogicalResolution ||
+
| 10 || [[#Start]]
 
|-
 
|-
| 42 || [8.0.0+] SetDisplayMagnification ||
+
| 20 || [[#RequestExit]]
 
|-
 
|-
| 50 || [8.0.0+] SetHomeButtonDoubleClickEnabled ||
+
| 25 || [[#Terminate]]
 
|-
 
|-
| 51 || [8.0.0+] GetHomeButtonDoubleClickEnabled ||
+
| 30 || [[#GetResult]]
 
|}
 
|}
  
ReadThemeStorage/WriteThemeStorage: these commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes.
+
==== GetAppletStateChangedEvent ====
 +
No input, returns an output event handle with autoclear=false.
 +
 
 +
==== IsCompleted ====
 +
No input, returns an output u8 bool.
  
== ILibraryAppletProxy ==
+
==== Start ====
{| class="wikitable" border="1"
+
No input/output.
|-
+
 
! Cmd || Name || Notes
+
==== RequestExit ====
 +
No input/output.
 +
 
 +
==== Terminate ====
 +
No input/output.
 +
 
 +
==== GetResult====
 +
No input/output.
 +
 
 +
== IAppletCommonFunctions ==
 +
This is "nn::am::service::IAppletCommonFunctions".
 +
 
 +
This was added with [7.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
+
! Cmd || Name
 
|-
 
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
+
| 0 || [9.0.0+] [[#SetTerminateResult]]
 
|-
 
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
+
| 10 || [[#ReadThemeStorage]]
 
|-
 
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
+
| 11 || [[#WriteThemeStorage]]
 
|-
 
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
+
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]]
 
|-
 
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
+
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]]
 
|-
 
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
+
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]]
 
|-
 
|-
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
+
| 42 || [8.0.0+] [[#SetDisplayMagnification]]
 
|-
 
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
+
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]]
 
|-
 
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
+
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]]
|}
 
 
 
=== ILibraryAppletSelfAccessor ===
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Cmd || Name || Notes
+
| 52 || [10.0.0+] [[#IsHomeButtonShortPressedBlocked]]
 
|-
 
|-
| 0 || [[#PopInData]] ||
+
| 60 || [11.0.0+] [[#IsVrModeCurtainRequired]]
 
|-
 
|-
| 1 || [[#PushOutData]] ||
+
| 61 || [12.0.0+] IsSleepRequiredByHighTemperature
 
|-
 
|-
| 2 || [[#PopInteractiveInData]] ||
+
| 62 || [12.0.0+] IsSleepRequiredByLowBattery
 
|-
 
|-
| 3 || [[#PushInteractiveOutData]] ||
+
| 70 || [11.0.0+] [[#SetCpuBoostRequestPriority]]
 
|-
 
|-
| 5 || [[#GetPopInDataEvent]] ||
+
| 80 || [14.0.0+] SetHandlingCaptureButtonShortPressedMessageEnabledForApplet
 
|-
 
|-
| 6 || [[#GetPopInteractiveInDataEvent]] ||
+
| 81 || [14.0.0+] SetHandlingCaptureButtonLongPressedMessageEnabledForApplet
 
|-
 
|-
| 10 || [[#ExitProcessAndReturn]] ||
+
| 82 || [18.0.0+] SetBlockingCaptureButtonInEntireSystem
 
|-
 
|-
| 11 || [[#GetLibraryAppletInfo]] ||
+
| 90 || [15.0.0+] OpenNamedChannelAsParent
 
|-
 
|-
| 12 || [[#GetMainAppletIdentityInfo]] ||
+
| 91 || [15.0.0+] OpenNamedChannelAsChild
 
|-
 
|-
| 13 || [[#CanUseApplicationCore]] ||
+
| 100 || [15.0.0+] SetApplicationCoreUsageMode
 
|-
 
|-
| 14 || [[#GetCallerAppletIdentityInfo]] ||
+
| 160 || [18.0.0+] GetNotificationReceiverService
 
|-
 
|-
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
+
| 161 || [18.0.0+] GetNotificationSenderService
 
|-
 
|-
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
+
| 300 || [17.0.0+] GetCurrentApplicationId
 
|-
 
|-
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||
+
| 310 || [19.0.0+] IsSystemAppletHomeMenu
 
|-
 
|-
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||
+
| 320 || [19.0.0+] SetGpuTimeSliceBoost
 
|-
 
|-
| 19 || [4.0.0+] GetDesirableKeyboardLayout ||
+
| 321 || [19.0.0+] SetGpuTimeSliceBoostDueToApplication
 
|-
 
|-
| 20 || [[#PopExtraStorage]] ||
+
| 330 || [19.0.0+]
|-
+
|}
| 25 || [[#GetPopExtraStorageEvent]] ||
+
 
|-
+
ReadThemeStorage/WriteThemeStorage: these commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes. The default content of the ThemeStorage prior to using the WriteThemeStorage cmd, is: <code>memset(statebuf, 0xAA, 0x400);</code>
| 30 || [[#UnpopInData]] ||
+
 
|-
+
=== ReadThemeStorage ===
| 31 || [[#UnpopExtraStorage]] ||
+
Takes an input u64 '''offset''' and a type-0x22 output buffer, returns an output u64 '''actual_transfer_size'''.
|-
+
 
| 40 || [2.0.0+] GetIndirectLayerProducerHandle ||
+
=== WriteThemeStorage ===
|-
+
Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
| 50 || [3.0.0+] ReportVisibleError ||
+
 
 +
=== PushToAppletBoundChannel ===
 +
Takes an input [[#IStorage]], no output.
 +
 
 +
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
 +
 
 +
=== TryPopFromAppletBoundChannel ===
 +
No input, returns an output [[#IStorage]].
 +
 
 +
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
 +
 
 +
=== GetDisplayLogicalResolution ===
 +
No input, returns an output s32 '''width''' and s32 '''height'''.
 +
 
 +
=== SetDisplayMagnification ===
 +
Takes an input float '''x''', float '''y''', float '''width''', and float '''height''', no output.
 +
 
 +
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.
 +
 
 +
'''x''' and '''width''' are multiplied with the same width value returned by [[#GetDisplayLogicalResolution]], so these should be in the range 0.0f-1.0f. Likewise for y and height, except these are multipled with the height value.
 +
 
 +
=== SetHomeButtonDoubleClickEnabled ===
 +
Takes an input u8 bool, no output.
 +
 
 +
=== GetHomeButtonDoubleClickEnabled ===
 +
No input, returns an output u8 bool.
 +
 
 +
=== IsHomeButtonShortPressedBlocked ===
 +
No input, returns an output u8 bool.
 +
 
 +
=== IsVrModeCurtainRequired ===
 +
No input, returns an output bool.
 +
 
 +
=== SetCpuBoostRequestPriority ===
 +
Takes an input s32, no output.
 +
 
 +
== ILibraryAppletProxy ==
 +
This is "nn::am::service::ILibraryAppletProxy".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 51 || [4.0.0+] ReportVisibleErrorWithErrorContext ||
+
! Cmd || Name || Notes
 
|-
 
|-
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||
+
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
 +
|-
 +
| 1 || GetSelfController || Returns an [[#ISelfController]].
 +
|-
 +
| 2 || GetWindowController || Returns an [[#IWindowController]].
 +
|-
 +
| 3 || GetAudioController || Returns an [[#IAudioController]].
 +
|-
 +
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
 
|-
 
|-
| 70 || [8.0.0+] GetCurrentApplicationId ||
+
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
 
|-
 
|-
| 80 || [6.0.0+] RequestExitToSelf ||
+
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
 
|-
 
|-
| 90 || [5.0.0+] CreateApplicationAndPushAndRequestToLaunch ||
+
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
 
|-
 
|-
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||
+
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
 
|-
 
|-
| 101 || [5.0.0+] ReserveResourceForMovieOperation ||
+
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
 
|-
 
|-
| 102 || [5.0.0+] UnreserveResourceForMovieOperation ||
+
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
 
|-
 
|-
| 110 || [6.0.0+] GetMainAppletAvailableUsers ||
+
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
 
|}
 
|}
  
==== PopInData ====
+
=== ILibraryAppletSelfAccessor ===
No input, returns an output [[#IStorage]].
+
This is "nn::am::service::ILibraryAppletSelfAccessor".
  
==== PushOutData ====
+
{| class="wikitable" border="1"
Takes an input [[#IStorage]], no output.
+
|-
 
+
! Cmd || Name || Notes
==== PopInteractiveInData ====
+
|-
No input, returns an output [[#IStorage]].
+
| 0 || [[#PopInData]] ||
 
+
|-
==== PushInteractiveOutData ====
+
| 1 || [[#PushOutData]] ||
Takes an input [[#IStorage]], no output.
+
|-
 
+
| 2 || [[#PopInteractiveInData]] ||
==== GetPopInDataEvent ====
+
|-
No input, returns an output handle.
+
| 3 || [[#PushInteractiveOutData]] ||
 
+
|-
==== GetPopInteractiveInDataEvent ====
+
| 5 || [[#GetPopInDataEvent]] ||
No input, returns an output handle.
+
|-
 
+
| 6 || [[#GetPopInteractiveInDataEvent]] ||
==== ExitProcessAndReturn ====
+
|-
No input/output.
+
| 10 || [[#ExitProcessAndReturn]] ||
 
+
|-
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).
+
| 11 || [[#GetLibraryAppletInfo]] ||
 
+
|-
==== GetLibraryAppletInfo ====
+
| 12 || [[#GetMainAppletIdentityInfo]] ||
No input, returns an output [[#AppletIdentityInfo]].
+
|-
 
+
| 13 || [[#CanUseApplicationCore]] ||
==== GetMainAppletIdentityInfo ====
+
|-
No input, returns an output [[#AppletIdentityInfo]].
+
| 14 || [[#GetCallerAppletIdentityInfo]] ||
 
+
|-
==== CanUseApplicationCore ====
+
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
No input, returns an output u8 bool.
+
|-
 
+
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
==== GetCallerAppletIdentityInfo ====
+
|-
No input, returns an output [[#AppletIdentityInfo]].
+
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||
 +
|-
 +
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||
 +
|-
 +
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||
 +
|-
 +
| 20 || [[#PopExtraStorage]] ||
 +
|-
 +
| 25 || [[#GetPopExtraStorageEvent]] ||
 +
|-
 +
| 30 || [[#UnpopInData]] ||
 +
|-
 +
| 31 || [[#UnpopExtraStorage]] ||
 +
|-
 +
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||
 +
|-
 +
| 50 || [3.0.0+] [[#ReportVisibleError]] ||
 +
|-
 +
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||
 +
|-
 +
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||
 +
|-
 +
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||
 +
|-
 +
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||
 +
|-
 +
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||
 +
|-
 +
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||
 +
|-
 +
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||
 +
|-
 +
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||
 +
|-
 +
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
 +
|-
 +
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
 +
|-
 +
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
 +
|-
 +
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||
 +
|-
 +
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
 +
|-
 +
| 160 || [17.0.0+] [[#GetLibraryAppletInfoEx]] ||
 +
|}
  
==== GetMainAppletApplicationControlProperty ====
+
==== PopInData ====
No input, takes a type-0x16 output buffer.
+
No input, returns an output [[#IStorage]].
  
This gets the [[NACP_Format|control.nacp]].
+
==== PushOutData ====
 +
Takes an input [[#IStorage]], no output.
  
==== GetMainAppletStorageId ====
+
==== PopInteractiveInData ====
No input, returns an output u8 storageId.
+
No input, returns an output [[#IStorage]].
  
==== GetCallerAppletIdentityInfoStack ====
+
==== PushInteractiveOutData ====
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.
+
Takes an input [[#IStorage]], no output.
  
==== GetNextReturnDestinationAppletIdentityInfo ====
+
==== GetPopInDataEvent ====
No input, returns an output [[#AppletIdentityInfo]].
+
No input, returns an output Event handle with autoclear=false.
  
==== PopExtraStorage ====
+
==== GetPopInteractiveInDataEvent ====
No input, returns an output [[#IStorage]].
+
No input, returns an output Event handle with autoclear=false.
  
==== GetPopExtraStorageEvent ====
+
==== ExitProcessAndReturn ====
No input, returns an output handle.
+
No input/output.
  
==== UnpopInData ====
+
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).
Takes an input [[#IStorage]], no output.
 
  
==== UnpopExtraStorage ====
+
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
Takes an input [[#IStorage]], no output.
 
  
==== GetMainAppletApplicationDesiredLanguage ====
+
==== GetLibraryAppletInfo ====
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
+
No input, returns an output [[#LibraryAppletInfo]].
  
==== CreateGameMovieTrimmer ====
+
==== GetMainAppletIdentityInfo ====
Takes an input u64 and handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
+
No input, returns an output [[#AppletIdentityInfo]].
  
== IOverlayAppletProxy ==
+
==== CanUseApplicationCore ====
{| class="wikitable" border="1"
+
No input, returns an output u8 bool.
|-
+
 
! Cmd || Name || Notes
+
==== GetCallerAppletIdentityInfo ====
|-
+
No input, returns an output [[#AppletIdentityInfo]].
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
 
|-
 
| 1 || GetSelfController || Returns an [[#ISelfController]].
 
|-
 
| 2 || GetWindowController || Returns an [[#IWindowController]].
 
|-
 
| 3 || GetAudioController || Returns an [[#IAudioController]].
 
|-
 
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
 
|-
 
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
 
|-
 
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
 
|-
 
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
 
|-
 
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
 
|-
 
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
 
|}
 
  
=== IOverlayFunctions ===
+
==== GetMainAppletApplicationControlProperty ====
{| class="wikitable" border="1"
+
No input, takes a type-0x16 output buffer.
|-
+
 
! Cmd || Name
+
This gets the [[NACP_Format|control.nacp]].
|-
+
 
| 0 || BeginToWatchShortHomeButtonMessage
+
==== GetMainAppletStorageId ====
|-
+
No input, returns an output u8 storageId.
| 1 || EndToWatchShortHomeButtonMessage
 
|-
 
| 2 || GetApplicationIdForLogo
 
|-
 
| 3 || SetGpuTimeSliceBoost
 
|-
 
| 4 || [2.0.0+] SetAutoSleepTimeAndDimmingTimeEnabled
 
|-
 
| 5 || [2.0.0+] TerminateApplicationAndSetReason
 
|-
 
| 6 || [3.0.0+] SetScreenShotPermissionGlobally
 
|-
 
| 10 || [6.0.0+] StartShutdownSequenceForOverlay
 
|-
 
| 11 || [6.0.0+] StartRebootSequenceForOverlay
 
|-
 
| 20 || [8.0.0+] SetHandlingHomeButtonShortPressedEnabled
 
|-
 
| 90 || [7.0.0+] SetRequiresGpuResourceUse
 
|-
 
| 101 || [5.0.0+] BeginToObserveHidInputForDevelop
 
|}
 
  
==== SetRequiresGpuResourceUse ====
+
==== GetCallerAppletIdentityInfoStack ====
Takes an input u8, no output.
+
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.
  
== IApplicationProxy ==
+
==== GetNextReturnDestinationAppletIdentityInfo ====
{| class="wikitable" border="1"
+
No input, returns an output [[#AppletIdentityInfo]].
|-
+
 
! Cmd || Name || Notes
+
==== GetDesirableKeyboardLayout ====
|-
+
No input, returns an output u32.
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
+
 
|-
+
The output u32 is "nn::settings::KeyboardLayout".
| 1 || GetSelfController || Returns an [[#ISelfController]].
+
 
|-
+
This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it's not set.
| 2 || GetWindowController || Returns an [[#IWindowController]].
+
 
|-
+
==== PopExtraStorage ====
| 3 || GetAudioController || Returns an [[#IAudioController]].
+
No input, returns an output [[#IStorage]].
|-
 
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
 
|-
 
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
 
|-
 
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
 
|-
 
| 20 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].
 
|-
 
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
 
|}
 
  
=== IApplicationFunctions ===
+
==== GetPopExtraStorageEvent ====
{| class="wikitable" border="1"
+
No input, returns an output Event handle with autoclear=false.
|-
+
 
! Cmd || Name || Notes
+
==== UnpopInData ====
|-
+
Takes an input [[#IStorage]], no output.
| 1 || [[#PopLaunchParameter]] ||
+
 
|-
+
==== UnpopExtraStorage ====
| 10 || [[#CreateApplicationAndPushAndRequestToStart]] ||
+
Takes an input [[#IStorage]], no output.
|-
+
 
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]] ||
+
==== GetIndirectLayerProducerHandle ====
|-
+
No input, returns an output u64.
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]] ||
+
 
|-
+
==== ReportVisibleError ====
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]] ||
+
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.
|-
+
 
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]] ||
+
==== ReportVisibleErrorWithErrorContext ====
|-
+
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]] ||
+
 
|-
+
==== GetMainAppletApplicationDesiredLanguage ====
| 20 || EnsureSaveData ||
+
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
|-
+
 
| 21 || [[#GetDesiredLanguage]] ||
+
==== GetCurrentApplicationId ====
|-
+
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
| 22 || [[#SetTerminateResult]] ||
+
 
|-
+
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.
| 23 || [[#GetDisplayVersion]] ||
+
 
|-
+
==== RequestExitToSelf ====
| 24 || [2.0.0+] GetLaunchStorageInfoForDebug ||
+
No input/output.
|-
+
 
| 25 || [3.0.0+] ExtendSaveData ||
+
Same as [[#RequestExit]] except this is for the current applet.
|-
+
 
| 26 || [3.0.0+] GetSaveDataSize ||
+
==== CreateApplicationAndPushAndRequestToLaunch ====
|-
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.
| 27 || [5.0.0+] CreateCacheStorage ||
+
 
|-
+
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]] ||
+
 
|-
+
==== CreateGameMovieTrimmer ====
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]] ||
+
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
|-
+
 
| 32 || [[#BeginBlockingHomeButton]] ||
+
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].
|-
+
 
| 33 || [[#EndBlockingHomeButton]] ||
+
Official sw uses an user-buffer for the tmem, with permissions=0.
|-
+
 
| 40 || [[#NotifyRunning]] ||
+
==== ReserveResourceForMovieOperation ====
 +
No input/output.
 +
 
 +
Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].
 +
 
 +
==== UnreserveResourceForMovieOperation ====
 +
No input/output.
 +
 
 +
Updates state fields. This must be used once finished with [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
 +
 
 +
==== GetMainAppletAvailableUsers ====
 +
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 '''total_entries'''.
 +
 
 +
This gets the userIDs previously set by [[#SetUsers]].
 +
 
 +
The size of the output buffer in entries must be at least 8.
 +
 
 +
Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
 +
 
 +
==== SetApplicationMemoryReservation ====
 +
Takes an input u64, no output.
 +
 
 +
An Application must be currently running. The input u64 must be 0x1000-byte aligned.
 +
 
 +
==== ShouldSetGpuTimeSliceManually ====
 +
No input, returns an output u8 bool.
 +
 
 +
==== GetLibraryAppletInfoEx ====
 +
No input, returns an output u64. Currently always returns 0.
 +
 
 +
== IOverlayAppletProxy ==
 +
This is "nn::am::service::IOverlayAppletProxy".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 50 || [2.0.0+] [[#GetPseudoDeviceId]] ||
+
! Cmd || Name || Notes
 
|-
 
|-
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]] ||
+
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
 
|-
 
|-
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]] ||
+
| 1 || GetSelfController || Returns an [[#ISelfController]].
 
|-
 
|-
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]] ||
+
| 2 || GetWindowController || Returns an [[#IWindowController]].
 
|-
 
|-
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]] ||
+
| 3 || GetAudioController || Returns an [[#IAudioController]].
 
|-
 
|-
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]] ||
+
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
 
|-
 
|-
| 70 || [3.0.0+] [[#RequestToShutdown]] ||
+
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
 
|-
 
|-
| 71 || [3.0.0+] [[#RequestToReboot]] ||
+
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
 
|-
 
|-
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]] ||
+
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].
 
|-
 
|-
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]] ||
+
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
 
|-
 
|-
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]] ||
+
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
 
|-
 
|-
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]] ||  
+
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
 +
|}
 +
 
 +
=== IOverlayFunctions ===
 +
This is "nn::am::service::IOverlayFunctions".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || [[#BeginToWatchShortHomeButtonMessage]]
 +
|-
 +
| 1 || [[#EndToWatchShortHomeButtonMessage]]
 +
|-
 +
| 2 || [[#GetApplicationIdForLogo]]
 +
|-
 +
| 3 || [[#SetGpuTimeSliceBoost]]
 
|-
 
|-
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]] ||
+
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]
 
|-
 
|-
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]] ||
+
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]
 
|-
 
|-
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]] ||
+
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]
 
|-
 
|-
| 120 || [5.0.0+] [[#ExecuteProgram]] ||
+
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]
 
|-
 
|-
| 121 || [5.0.0+] [[#ClearUserChannel]] ||
+
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]
 
|-
 
|-
| 122 || [5.0.0+] [[#UnpopToUserChannel]] ||
+
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
 
|-
 
|-
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]] ||
+
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled
 
|-
 
|-
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]] ||
+
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
 
|-
 
|-
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
+
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
 
|-
 
|-
| 500 || [5.0.0+] StartContinuousRecordingFlushForDebug ||
+
| 40 || [18.0.0+] GetApplicationNintendoLogo
 
|-
 
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]] ||
+
| 41 || [18.0.0+] GetApplicationStartupMovie
 
|-
 
|-
| 1001 || [5.0.0+] [[#PrepareForJit]] ||
+
| 50 || [19.0.0+] SetGpuTimeSliceBoostForApplication
 +
|-
 +
| 60 || [19.0.0+]
 +
|-
 +
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
 +
|-
 +
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
 
|}
 
|}
  
The BOTW game uses this GamePlayRecording functionality from the main-nso "nninitStartup" function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):
+
==== BeginToWatchShortHomeButtonMessage ====
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
+
No input/output.
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.
 
* Closes the TransferMemory handle, + TransferMemory cleanup.
 
* Uses [[#SetGamePlayRecordingState]] with value 0x1.
 
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].
 
  
==== PopLaunchParameter ====
+
==== EndToWatchShortHomeButtonMessage ====
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].
+
No input/output.
  
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.
+
==== GetApplicationIdForLogo ====
 +
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
  
==== CreateApplicationAndPushAndRequestToStart ====
+
Gets the ApplicationId for displaying the logo screen during application launch.
Takes an input u64 titleID and an input [[#IStorage]], no output. titleID=0 can be used to relaunch the current application.
 
  
==== CreateApplicationAndPushAndRequestToStartForQuest ====
+
When no application is running, this returns success with ApplicationId=0.
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input u64 titleID, and an input [[#IStorage]], no output.
 
  
==== CreateApplicationAndRequestToStart ====
+
==== SetGpuTimeSliceBoost ====
Takes an input u64 titleID, no output.
+
Takes an input u64, no output.
  
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
+
==== SetAutoSleepTimeAndDimmingTimeEnabled ====
 +
Takes an input u8 bool, no output.
  
==== CreateApplicationAndRequestToStartForQuest ====
+
==== TerminateApplicationAndSetReason ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input u64 titleID, no output.
+
Takes an input u32 Result, no output.
  
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
+
==== SetScreenShotPermissionGlobally ====
 +
Takes an input u8 bool, no output.
  
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
+
==== StartShutdownSequenceForOverlay ====
Takes an input u64 titleID, a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
+
No input/output.
  
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndPushAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
+
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
  
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
+
==== StartRebootSequenceForOverlay ====
Takes an input u64 titleID and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
+
No input/output.
  
Same as [[#CreateApplicationAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
+
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
  
==== GetDesiredLanguage ====
+
==== SetHandlingHomeButtonShortPressedEnabled ====
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
+
Takes an input u8 bool, no output.
  
==== SetTerminateResult ====
+
==== SetHealthWarningShowingState ====
Takes an input u32 '''Result''', no output.
+
Takes an input u8 bool, no output.
  
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.
+
This writes the input bool into state, signals an Event, and returns 0.
  
==== GetDisplayVersion ====
+
==== IsHealthWarningRequired ====
No input, returns an output 0x10-byte struct.
+
No input, returns an output u8 bool.
  
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.
+
==== SetRequiresGpuResourceUse ====
 +
Takes an input u8 bool, no output.
  
==== BeginBlockingHomeButtonShortAndLongPressed ====
+
Just returns 0.
Takes an input s64, no output.
 
  
Official user-processes use hard-coded value 0 for the s64.
+
==== BeginToObserveHidInputForDevelop ====
 +
No input/output.
  
Starts blocking the Home button.
+
Sets various state fields and signals an userspace-event.
  
==== EndBlockingHomeButtonShortAndLongPressed ====
+
Enables HID input for the OverlayApplet, without disabling input for the foreground applet.
No input/output.
 
  
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].
+
== IApplicationProxy ==
 +
This is "nn::am::service::IApplicationProxy".
  
==== BeginBlockingHomeButton ====
+
{| class="wikitable" border="1"
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.
+
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
 +
|-
 +
| 1 || GetSelfController || Returns an [[#ISelfController]].
 +
|-
 +
| 2 || GetWindowController || Returns an [[#IWindowController]].
 +
|-
 +
| 3 || GetAudioController || Returns an [[#IAudioController]].
 +
|-
 +
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
 +
|-
 +
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
 +
|-
 +
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
 +
|-
 +
| 20 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].
 +
|-
 +
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
 +
|}
  
==== EndBlockingHomeButton ====
+
=== IApplicationFunctions ===
No input/output.
+
This is "nn::am::service::IApplicationFunctions".
  
==== NotifyRunning ====
+
{| class="wikitable" border="1"
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.
+
|-
 
+
! Cmd || Name
==== GetPseudoDeviceId ====
+
|-
No input, returns an output 0x10-byte "nn::util::Uuid" struct.
+
| 1 || [[#PopLaunchParameter]]
 
+
|-
The 0x20-byte output data from [[NS_Services|GetSystemSeedForPseudoDeviceId]] followed by the 8-byte [[NACP_Format|SeedForPseudoDeviceId]] from the current control.nacp, is hashed with SHA1. Then "nn::util::GenerateUuidVersion5" is called with the final hash, the output from this is then returned for the Uuid.
+
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
 
+
|-
==== SetMediaPlaybackStateForApplication ====
+
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
Takes an input u8 bool, no output.
+
|-
 
+
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
==== IsGamePlayRecordingSupported ====
+
|-
No input, returns an output u8 bool.
+
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
 
+
|-
==== InitializeGamePlayRecording ====
+
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.
+
|-
 
+
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
==== SetGamePlayRecordingState ====
+
|-
Takes an input u32. 0 = disable/pause, 1 = enable/restart.
+
| 20 || [[#EnsureSaveData]]
 
+
|-
==== RequestFlushGamePlayingMovieForDebug ====
+
| 21 || [[#GetDesiredLanguage]]
No input/output.
+
|-
 
+
| 22 || [[#SetTerminateResult]]
==== RequestToShutdown ====
+
|-
No input/output.
+
| 23 || [[#GetDisplayVersion]]
 
+
|-
==== RequestToReboot ====
+
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
No input/output.
+
|-
 
+
| 25 || [3.0.0+] ExtendSaveData
==== ExitAndRequestToShowThanksMessage ====
+
|-
No input/output.
+
| 26 || [3.0.0+] GetSaveDataSize
 
+
|-
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this.
+
| 27 || [5.0.0+] CreateCacheStorage
 
+
|-
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
+
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
 +
|-
 +
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
 +
|-
 +
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
 +
|-
 +
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
 +
|-
 +
| 32 || [[#BeginBlockingHomeButton]]
 +
|-
 +
| 33 || [[#EndBlockingHomeButton]]
 +
|-
 +
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
 +
|-
 +
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
 +
|-
 +
| 36 || [14.0.0+] GetLimitedApplicationLicense
 +
|-
 +
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
 +
|-
 +
| 40 || [[#NotifyRunning]]
 +
|-
 +
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
 +
|-
 +
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
 +
|-
 +
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
 +
|-
 +
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
 +
|-
 +
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
 +
|-
 +
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
 +
|-
 +
| 70 || [3.0.0+] [[#RequestToShutdown]]
 +
|-
 +
| 71 || [3.0.0+] [[#RequestToReboot]]
 +
|-
 +
| 72 || [10.0.0+] [[#RequestToSleep]]
 +
|-
 +
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
 +
|-
 +
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
 +
|-
 +
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]
 +
|-
 +
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
 +
|-
 +
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
 +
|-
 +
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
 +
|-
 +
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
 +
|-
 +
| 120 || [5.0.0+] [[#ExecuteProgram]]
 +
|-
 +
| 121 || [5.0.0+] [[#ClearUserChannel]]
 +
|-
 +
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
 +
|-
 +
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
 +
|-
 +
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
 +
|-
 +
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
 +
|-
 +
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
 +
|-
 +
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
 +
|-
 +
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]
 +
|-
 +
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
 +
|-
 +
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
 +
|-
 +
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
 +
|-
 +
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]
 +
|-
 +
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]
 +
|-
 +
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]
 +
|-
 +
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]
 +
|-
 +
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
 +
|-
 +
| 300 || [19.0.0+] [[#CreateMovieWriter]]
 +
|-
 +
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
 +
|-
 +
| 1000 || [5.0.0+] [[#CreateMovieMaker]]
 +
|-
 +
| 1001 || [5.0.0+] [[#PrepareForJit]]
 +
|}
  
==== EnableApplicationCrashReport ====
+
The BOTW game uses this GamePlayRecording functionality from the main-nso "nninitStartup" function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):
Takes an input u8 bool, no output.
+
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
 +
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.
 +
* Closes the TransferMemory handle, + TransferMemory cleanup.
 +
* Uses [[#SetGamePlayRecordingState]] with value 0x1.
 +
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].
  
==== InitializeApplicationCopyrightFrameBuffer ====
+
==== PopLaunchParameter ====
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.
+
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].
  
tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.
+
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.
  
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
+
==== CreateApplicationAndPushAndRequestToStart ====
 +
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.
  
This is used as an overlay for screenshots.
+
==== CreateApplicationAndPushAndRequestToStartForQuest ====
 +
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.
  
==== SetApplicationCopyrightImage ====
+
==== CreateApplicationAndRequestToStart ====
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 '''WindowOriginMode''', and no output.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
  
The last s32 is "nn::oe::WindowOriginMode". This should be at least 1.
+
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
  
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
+
==== CreateApplicationAndRequestToStartForQuest ====
 +
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.
  
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.
+
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
  
==== SetApplicationCopyrightVisibility ====
+
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Takes an input u8 bool, no output.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
  
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.
+
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]].
  
==== QueryApplicationPlayStatistics ====
+
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
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 an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
  
The number of entries in each array is the same.
+
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]].
  
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
+
==== EnsureSaveData ====
 +
Takes an input u128 userID, returns an output u64 size.
  
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.
+
Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.
  
==== QueryApplicationPlayStatisticsByUid ====
+
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
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.
 
  
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
+
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
  
==== ExecuteProgram ====
+
==== GetDesiredLanguage ====
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.
+
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
  
==== ClearUserChannel ====
+
==== SetTerminateResult ====
No input/output.
+
Takes an input u32 '''Result''', no output.
  
Clears the UserChannel used by [[#UnpopToUserChannel]].
+
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.
  
==== UnpopToUserChannel ====
+
==== GetDisplayVersion ====
Takes an input [[#IStorage]], no output.
+
No input, returns an output 0x10-byte struct.
  
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
+
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.
  
User-processes create a storage using data specified by the user (written to offset=0 size=inputsize), with max size 0x1000. This storage is then used with this cmd.
+
==== GetLaunchStorageInfoForDebug ====
 +
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
  
==== GetPreviousProgramIndex ====
+
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
No input, returns an output s32.
 
  
==== EnableApplicationAllThreadDumpOnCrash ====
+
==== GetSaveDataSizeMax ====
Takes an input u8 bool, no output.
+
No input, returns two ouput s64s.
  
==== GetGpuErrorDetectedSystemEvent ====
+
==== GetCacheStorageMax ====
No input, returns an output Event handle with autoclear=false.
+
No input, returns an output s32 and s64.
  
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.
+
==== BeginBlockingHomeButtonShortAndLongPressed ====
 +
Takes an input s64, no output.
  
==== CreateMovieMaker ====
+
Official user-processes use hard-coded value 0 for the s64.
Takes an input u64 and handle, returns an [[#IMovieMaker]].
 
  
==== PrepareForJit ====
+
Starts blocking the Home button.
Takes no input. Launches title 010000000000003B (currently not present on retail systems) if some context variable is set.
 
  
=== IMovieMaker ===
+
==== EndBlockingHomeButtonShortAndLongPressed ====
{| class="wikitable" border="1"
+
No input/output.
|-
+
 
! Cmd || Name
+
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].
|-
+
 
| 0 || [[#GetGrcMovieMaker]]
+
==== BeginBlockingHomeButton ====
|-
+
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.
| 1 || [[#GetLayerHandle]]
+
 
|}
+
==== EndBlockingHomeButton ====
 +
No input/output.
 +
 
 +
==== SelectApplicationLicense ====
 +
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].
  
==== GetGrcMovieMaker ====
+
==== GetDeviceSaveDataSizeMax ====
No input, returns a GRC [[GRC_services|IMovieMaker]].
+
No input, returns two output s64s.
  
==== GetLayerHandle ====
+
==== NotifyRunning ====
No input, returns an output u64.
+
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.
  
== ILibraryAppletCreator ==
+
==== GetPseudoDeviceId ====
{| class="wikitable" border="1"
+
No input, returns an output 0x10-byte "nn::util::Uuid" struct.
|-
 
! Cmd || Name || Notes
 
|-
 
| 0 || [[#CreateLibraryApplet]] ||
 
|-
 
| 1 || [[#TerminateAllLibraryApplets]] ||
 
|-
 
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
 
|-
 
| 10 || [[#CreateStorage]] ||
 
|-
 
| 11 || [[#CreateTransferMemoryStorage]] ||
 
|-
 
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
 
|}
 
  
=== CreateLibraryApplet ===
+
The 0x20-byte output data from [[NS_Services|GetSystemSeedForPseudoDeviceId]] followed by the 8-byte [[NACP_Format|SeedForPseudoDeviceId]] from the current control.nacp, is hashed with SHA1. Then "nn::util::GenerateUuidVersion5" is called with the final hash, the output from this is then returned for the Uuid.
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
 
  
=== TerminateAllLibraryApplets ===
+
==== SetMediaPlaybackStateForApplication ====
No input/output.
+
Takes an input u8 bool, no output.
  
=== AreAnyLibraryAppletsLeft ===
+
==== IsGamePlayRecordingSupported ====
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
  
=== CreateStorage ===
+
==== InitializeGamePlayRecording ====
Takes an input s64 for the storage size, returns an [[#IStorage]].
+
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.
  
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
+
==== SetGamePlayRecordingState ====
 +
Takes an input u32. 0 = disable/pause, 1 = enable/restart.
  
=== CreateTransferMemoryStorage ===
+
==== RequestFlushGamePlayingMovieForDebug ====
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].
+
No input/output.
  
The user-process creates the TransferMemory with permissions=0.
+
Requests to save the video recording, as if the Capture-button was held.
  
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.
+
==== RequestToShutdown ====
 +
No input/output.
  
=== CreateHandleStorage ===
+
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.
+
 
 +
==== RequestToReboot ====
 +
No input/output.
 +
 
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
 +
 
 +
==== RequestToSleep ====
 +
No input/output.
 +
 
 +
==== ExitAndRequestToShowThanksMessage ====
 +
No input/output.
 +
 
 +
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.
 +
 
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
 +
 
 +
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
  
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
+
==== EnableApplicationCrashReport ====
 +
Takes an input u8 bool, no output.
  
=== ILibraryAppletAccessor ===
+
==== InitializeApplicationCopyrightFrameBuffer ====
{| class="wikitable" border="1"
+
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.
|-
 
! Cmd || Name || Notes
 
|-
 
| 0 || [[#GetAppletStateChangedEvent]] ||
 
|-
 
| 1 || [[#IsCompleted]] ||
 
|-
 
| 10 || [[#Start]] ||
 
|-
 
| 20 || [[#RequestExit]] ||
 
|-
 
| 25 || [[#Terminate]] ||
 
|-
 
| 30 || [[#GetResult]] ||
 
|-
 
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
 
|-
 
| 100 || [[#PushInData]] ||
 
|-
 
| 101 || [[#PopOutData]] ||
 
|-
 
| 102 || [[#PushExtraStorage]] ||
 
|-
 
| 103 || [[#PushInteractiveInData]] ||
 
|-
 
| 104 || [[#PopInteractiveOutData]] ||
 
|-
 
| 105 || [[#GetPopOutDataEvent]] ||
 
|-
 
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
 
|-
 
| 110 || [[#NeedsToExitProcess]] ||
 
|-
 
| 120 || [[#GetLibraryAppletInfo]] ||
 
|-
 
| 150 || [[#RequestForAppletToGetForeground]] ||
 
|-
 
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
 
|}
 
  
Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.
+
tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.
  
==== SetOutOfFocusApplicationSuspendingEnabled ====
+
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
Takes an input u8 bool, no output.
 
  
==== PushInData ====
+
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.
Takes an input [[#IStorage]], no output.
 
  
==== PopOutData ====
+
This is used as an overlay for screenshots.
No input, returns an output [[#IStorage]].
 
  
==== PushExtraStorage ====
+
==== SetApplicationCopyrightImage ====
Takes an input [[#IStorage]], 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.
  
==== PushInteractiveInData ====
+
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
Takes an input [[#IStorage]], no output.
 
  
==== PopInteractiveOutData ====
+
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.
No input, returns an output [[#IStorage]].
 
  
==== GetPopOutDataEvent ====
+
==== SetApplicationCopyrightVisibility ====
No input, returns an output handle.
+
Takes an input u8 bool, no output.
  
==== GetPopInteractiveOutDataEvent ====
+
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.
No input, returns an output event handle with autoclear=false.
 
  
==== NeedsToExitProcess ====
+
==== QueryApplicationPlayStatistics ====
No input, returns an output u8 bool.
+
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.
  
==== RequestForAppletToGetForeground ====
+
The number of entries in each array is the same.
No input/output.
 
  
==== GetIndirectLayerConsumerHandle ====
+
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.
 
  
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
+
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.
  
== ICommonStateGetter ==
+
==== QueryApplicationPlayStatisticsByUid ====
{| class="wikitable" border="1"
+
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.
|-
+
 
! Cmd || Name || Notes
+
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
|-
+
 
| 0 || [[#GetEventHandle]] ||
+
==== ExecuteProgram ====
|-
+
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.
| 1 || [[#ReceiveMessage]] ||
+
 
|-
+
==== ClearUserChannel ====
| 2 || [[#GetThisAppletKind]] ||
+
No input/output.
|-
+
 
| 3 || [[#AllowToEnterSleep]] ||
+
Clears the UserChannel used by [[#UnpopToUserChannel]].
|-
+
 
| 4 || [[#DisallowToEnterSleep]] ||
+
==== UnpopToUserChannel ====
|-
+
Takes an input [[#IStorage]], no output.
| 5 || [[#GetOperationMode]] ||
+
 
|-
+
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
| 6 || [[#GetPerformanceMode]] ||
+
 
|-
+
User-processes create a storage using data specified by the user (written to offset=0 size=inputsize), with max size 0x1000. This storage is then used with this cmd.
| 7 || [[#GetCradleStatus]] ||
 
|-
 
| 8 || [[#GetBootMode]] ||
 
|-
 
| 9 || [[#GetCurrentFocusState]] ||
 
|-
 
| 10 || [[#RequestToAcquireSleepLock]] ||
 
|-
 
| 11 || [[#ReleaseSleepLock]] ||
 
|-
 
| 12 || [[#ReleaseSleepLockTransiently]] ||
 
|-
 
| 13 || [[#GetAcquiredSleepLockEvent]] ||
 
|-
 
| 20 || [[#PushToGeneralChannel]] ||
 
|-
 
| 30 || [[#GetHomeButtonReaderLockAccessor]] ||
 
|-
 
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]] ||
 
|-
 
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]] ||
 
|-
 
| 40 || [2.0.0+] [[#GetCradleFwVersion]] ||
 
|-
 
| 50 || [3.0.0+] [[#IsVrModeEnabled]] ||
 
|-
 
| 51 || [3.0.0+] [[#SetVrModeEnabled]] ||
 
|-
 
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]] ||
 
|-
 
| 53 || [7.0.0+] [[#BeginVrModeEx]] ||
 
|-
 
| 54 || [7.0.0+] [[#EndVrModeEx]] ||
 
|-
 
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]] ||
 
|-
 
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]] ||
 
|-
 
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]] ||
 
|-
 
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]] ||
 
|-
 
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]] ||
 
|-
 
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]] ||
 
|-
 
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]] ||
 
|-
 
| 66 || [6.0.0+] [[#SetCpuBoostMode]] ||
 
|-
 
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]] ||
 
|-
 
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]] ||
 
|-
 
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
 
|-
 
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
 
|}
 
  
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 [[#NotificationMessage]]).
+
==== GetPreviousProgramIndex ====
 +
No input, returns an output s32.
  
[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.
+
Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.
  
=== GetEventHandle ===
+
==== EnableApplicationAllThreadDumpOnCrash ====
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].
+
Takes an input u8 bool, no output.
  
=== ReceiveMessage ===
+
==== GetGpuErrorDetectedSystemEvent ====
No input. Returns an output u32. Error 0x680 indicates no message is available.
+
No input, returns an output Event handle with autoclear=false.
  
=== GetThisAppletKind ===
+
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.
No input, returns an output [[#AppletKind]].
 
  
Stubbed, just returns an error.
+
==== SetDelayTimeToAbortOnGpuError ====
 +
Takes an input s64 "nn::TimeSpan", no output.
  
=== AllowToEnterSleep ===
+
==== GetFriendInvitationStorageChannelEvent ====
No input/output.
+
No input, returns an output Event handle with EventClearMode=0.
  
Stubbed, just returns an error.
+
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.
  
=== DisallowToEnterSleep ===
+
==== TryPopFromFriendInvitationStorageChannel ====
No input/output.
+
No input, returns an output [[#IStorage]].
  
Stubbed, just returns an error.
+
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].
  
=== GetOperationMode ===
+
This is exposed by sdknso under <code>nn::friends::</code>. When the storage_size is <0x10, this returns false. <code>data_size = storage_size-0x10;</code> Then the first 0x10-bytes from storage are read to stack, which is later copied to the output Uid on success prior to returning. Then the storage is read into the specified output buffer with storage-offset 0x10, where the size is <code>size = data_size > buf_size ? buf_size : data_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned.
No input. Returns an output u8 for the current [[#OperationMode]].
 
  
=== GetPerformanceMode ===
+
==== GetNotificationStorageChannelEvent ====
No input. Returns an output u32 for the current PerformanceMode.
+
No input, returns an output Event handle with EventClearMode=0.
  
=== GetCradleStatus ===
+
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 an output u8.
 
  
This uses [[#omm]] GetCradleStatus.
+
==== TryPopFromNotificationStorageChannel ====
 +
No input, returns an output [[#IStorage]].
  
=== GetBootMode ===
+
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
No input, returns an output u8.
 
  
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
+
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.
  
=== GetCurrentFocusState ===
+
==== GetHealthWarningDisappearedSystemEvent ====
No input. Returns an output u8:
+
No input, returns an output Event with EventClearMode=0.
  
* 1: In focus.
+
==== SetHdcpAuthenticationActivated ====
* 2/3: Out of focus(running in "background").
+
Takes an input u8 bool, no output.
  
=== RequestToAcquireSleepLock ===
+
==== GetLaunchRequiredVersion ====
No input/output.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].
  
=== ReleaseSleepLock ===
+
sdknso passes hard-coded value 0 for the u64.
No input/output.
 
  
=== ReleaseSleepLockTransiently ===
+
==== UpgradeLaunchRequiredVersion ====
No input/output.
+
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.
  
=== GetAcquiredSleepLockEvent ===
+
sdknso passes hard-coded value 0 for the u64.
No input, returns an output handle.
 
  
=== PushToGeneralChannel ===
+
==== SendServerMaintenanceOverlayNotification ====
Takes an input [[#IStorage]], no output.
+
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.
  
This is not usable under an Application, however it is usable under a LibraryApplet.
+
The second input value can optionally be 0.
  
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:
+
==== GetLastApplicationExitReason ====
* <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.
+
No input, returns an output s32.
* <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 ===
+
==== CreateMovieWriter ====
No input, returns an output [[#ILockAccessor]].
+
Takes 8-bytes of input and a handle. Returns an [[#IMovieWriter]].
  
=== GetReaderLockAccessorEx ===
+
This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.
Takes an input u32, returns an output [[#ILockAccessor]].
 
  
=== GetWriterLockAccessorEx ===
+
==== StartContinuousRecordingFlushForDebug ====
Takes an input u32, returns an output [[#ILockAccessor]].
+
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
  
=== GetCradleFwVersion ===
+
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 4 output u32s.
 
  
This uses [[#omm]] GetCradleFwVersion.
+
==== CreateMovieMaker ====
 +
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].
  
=== IsVrModeEnabled ===
+
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
No input, returns an output u8 bool.
 
  
=== SetVrModeEnabled ===
+
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
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}.
+
==== PrepareForJit ====
 +
Takes no input. Launches the [[JIT_services|jit-sysmodule]] via [[NS_Services|ns]] LaunchLibraryApplet if it has not already been launched for the current application, storing a std::shared_ptr<> for jit-sysmodule process tracking object as an IApplicationFunctions member.
  
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.
+
~IApplicationFunctions() includes:
  
=== SetLcdBacklighOffEnabled ===
+
    if (this->jit_process) {
Takes an input u8 bool, no output.
+
        Terminate(this->jit_process);
 +
        this->jit_process = nullptr;
 +
    }
  
Sets whether the LCD screen blacklight is turned off.
+
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.
  
=== BeginVrModeEx ===
+
AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
No input/output.
 
  
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
+
=== IMovieWriter ===
 +
This is "nn::am::service::IMovieWriter".
  
=== EndVrModeEx ===
+
This was added with [19.0.0+].
No input/output.
 
  
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
+
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 ||
 +
|}
  
=== IsInControllerFirmwareUpdateSection ===
+
==== Cmd0 ====
No input, returns an output u8 bool.
+
No input. Returns a GRC [[GRC_services|IMovieWriter]].
  
=== GetDefaultDisplayResolution ===
+
=== IMovieMaker ===
No input, returns two output s32s '''width''' and '''height'''.
+
This is "nn::am::service::IMovieMaker".
  
=== GetDefaultDisplayResolutionChangeEvent ===
+
{| class="wikitable" border="1"
No input, returns an output Event handle with autoclear=true.
+
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || [[#GetGrcMovieMaker]]
 +
|-
 +
| 1 || [[#GetLayerHandle]]
 +
|}
  
=== GetHdcpAuthenticationState ===
+
==== GetGrcMovieMaker ====
No input, returns an output s32.
+
No input, returns a GRC [[GRC_services|IMovieMaker]].
  
=== GetHdcpAuthenticationStateChangeEvent ===
+
==== GetLayerHandle ====
No input, returns an output Event handle with autoclear=true.
+
No input, returns an output u64.
  
=== SetTvPowerStateMatchingMode ===
+
== ILibraryAppletCreator ==
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.
+
This is "nn::am::service::ILibraryAppletCreator".
  
=== GetApplicationIdByContentActionName ===
+
{| class="wikitable" border="1"
Takes a type-0x5 input buffer containing a string, returns an output u64 titleID.
+
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 0 || [[#CreateLibraryApplet]] ||
 +
|-
 +
| 1 || [[#TerminateAllLibraryApplets]] ||
 +
|-
 +
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
 +
|-
 +
| 10 || [[#CreateStorage]] ||
 +
|-
 +
| 11 || [[#CreateTransferMemoryStorage]] ||
 +
|-
 +
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
 +
|}
  
Gets the application titleID for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (starter).
+
=== CreateLibraryApplet ===
 +
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
  
=== SetCpuBoostMode ===
+
=== TerminateAllLibraryApplets ===
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 ===
+
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
Takes an input [[#SystemButtonType]], no output.
 
  
=== SetPerformanceConfigurationChangedNotification ===
+
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
Takes an input u8 bool, no output.
 
  
=== GetCurrentPerformanceConfiguration ===
+
=== AreAnyLibraryAppletsLeft ===
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
+
No input, returns an output u8 bool.
  
=== GetOperationModeSystemInfo ===
+
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
No input, returns an output u32.
 
  
This returns the output from omm [[#Cmd26]].
+
Gets whether any LibraryApplets ([[#ILibraryAppletAccessor]]) which were created by the current applet are still open (or by the Application when used from the [[#IApplicationAccessor]] cmd).
 +
 
 +
=== CreateStorage ===
 +
Takes an input s64 for the storage size, returns an [[#IStorage]].
 +
 
 +
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
 +
 
 +
=== CreateTransferMemoryStorage ===
 +
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].
 +
 
 +
The user-process creates the TransferMemory with permissions=0.
 +
 
 +
The TransferMemory is mapped, which can then be accessed via [[#IStorageAccessor]]. The input bool controls whether writing to the storage is allowed: [[#Write]] will throw an error if this flag is not set.
 +
 
 +
=== CreateHandleStorage ===
 +
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.
 +
 
 +
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
 +
 
 +
=== ILibraryAppletAccessor ===
 +
This is "nn::am::service::ILibraryAppletAccessor".
  
== ISelfController ==
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Cmd || Name || Notes
 
|-
 
|-
| 0 || [[#Exit]]
+
| 0 || [[#GetAppletStateChangedEvent]] ||
 
|-
 
|-
| 1 || [[#LockExit]]
+
| 1 || [[#IsCompleted]] ||
 
|-
 
|-
| 2 || [[#UnlockExit]]
+
| 10 || [[#Start]] ||
 
|-
 
|-
| 3 || [2.0.0+] [[#EnterFatalSection]]
+
| 20 || [[#RequestExit]] ||
 
|-
 
|-
| 4 || [2.0.0+] [[#LeaveFatalSection]]
+
| 25 || [[#Terminate]] ||
 
|-
 
|-
| 9 || [[#GetLibraryAppletLaunchableEvent]]
+
| 30 || [[#GetResult]] ||
 
|-
 
|-
| 10 || [[#SetScreenShotPermission]]
+
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
 
|-
 
|-
| 11 || [[#SetOperationModeChangedNotification]]
+
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
 
|-
 
|-
| 12 || [[#SetPerformanceModeChangedNotification]]
+
| 80 || [19.0.0+] RequestForLibraryAppletToGetForeground ||
 
|-
 
|-
| 13 || [[#SetFocusHandlingMode]]
+
| 81 || [19.0.0+] GetCurrentChildLibraryApplet ||
 
|-
 
|-
| 14 || [[#SetRestartMessageEnabled]]
+
| 100 || [[#PushInData]] ||
 
|-
 
|-
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
+
| 101 || [[#PopOutData]] ||
 
|-
 
|-
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
+
| 102 || [[#PushExtraStorage]] ||
 
|-
 
|-
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
+
| 103 || [[#PushInteractiveInData]] ||
 
|-
 
|-
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
+
| 104 || [[#PopInteractiveOutData]] ||
 
|-
 
|-
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
+
| 105 || [[#GetPopOutDataEvent]] ||
 
|-
 
|-
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
+
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
 
|-
 
|-
| 40 || [[#CreateManagedDisplayLayer]]
+
| 110 || [[#NeedsToExitProcess]] ||
 
|-
 
|-
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
+
| 120 || [[#GetLibraryAppletInfo]] ||
 
|-
 
|-
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
+
| 150 || [[#RequestForAppletToGetForeground]] ||
 
|-
 
|-
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
+
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
|-
+
|}
| 50 || [[#SetHandlesRequestToDisplay]]
+
 
|-
+
Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.
| 51 || [[#ApproveToDisplay]]
+
 
|-
+
==== SetOutOfFocusApplicationSuspendingEnabled ====
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
+
Takes an input u8 bool, no output.
|-
+
 
| 61 || [[#SetMediaPlaybackState]]
+
Official sw will assert prior to using this if applet-service was not initialized as *Application.
|-
+
 
| 62 || [[#SetIdleTimeDetectionExtension]]
+
==== PresetLibraryAppletGpuTimeSliceZero ====
|-
+
No input/output.
| 63 || [[#GetIdleTimeDetectionExtension]]
+
 
|-
+
sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.
| 64 || [[#SetInputDetectionSourceSet]]
+
 
|-
+
==== PushInData ====
| 65 || [2.0.0+] [[#ReportUserIsActive]]
+
Takes an input [[#IStorage]], no output.
|-
+
 
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
+
==== PopOutData ====
|-
+
No input, returns an output [[#IStorage]].
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
+
 
 +
==== PushExtraStorage ====
 +
Takes an input [[#IStorage]], no output.
 +
 
 +
==== PushInteractiveInData ====
 +
Takes an input [[#IStorage]], no output.
 +
 
 +
==== PopInteractiveOutData ====
 +
No input, returns an output [[#IStorage]].
 +
 
 +
==== GetPopOutDataEvent ====
 +
No input, returns an output handle with autoclear=false.
 +
 
 +
==== GetPopInteractiveOutDataEvent ====
 +
No input, returns an output event handle with autoclear=false.
 +
 
 +
==== NeedsToExitProcess ====
 +
No input, returns an output u8 bool.
 +
 
 +
Stubbed, just returns an error.
 +
 
 +
==== RequestForAppletToGetForeground ====
 +
No input/output.
 +
 
 +
Stubbed, just returns an error.
 +
 
 +
==== GetIndirectLayerConsumerHandle ====
 +
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.
 +
 
 +
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
 +
 
 +
== ICommonStateGetter ==
 +
This is "nn::am::service::ICommonStateGetter".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
+
! Cmd || Name
 
|-
 
|-
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
+
| 0 || [[#GetEventHandle]]
 
|-
 
|-
| 70 || [4.0.0+] [[#ReportMultimediaError]]
+
| 1 || [[#ReceiveMessage]]
 
|-
 
|-
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
+
| 2 || [[#GetThisAppletKind]]
 +
|-
 +
| 3 || [[#AllowToEnterSleep]]
 +
|-
 +
| 4 || [[#DisallowToEnterSleep]]
 +
|-
 +
| 5 || [[#GetOperationMode]]
 +
|-
 +
| 6 || [[#GetPerformanceMode]]
 +
|-
 +
| 7 || [[#GetCradleStatus]]
 +
|-
 +
| 8 || [[#GetBootMode]]
 +
|-
 +
| 9 || [[#GetCurrentFocusState]]
 +
|-
 +
| 10 || [[#RequestToAcquireSleepLock]]
 +
|-
 +
| 11 || [[#ReleaseSleepLock]]
 +
|-
 +
| 12 || [[#ReleaseSleepLockTransiently]]
 +
|-
 +
| 13 || [[#GetAcquiredSleepLockEvent]]
 +
|-
 +
| 14 || [11.0.0+] [[#GetWakeupCount]]
 +
|-
 +
| 15 || [19.0.0+]  
 +
|-
 +
| 20 || [[#PushToGeneralChannel]]
 
|-
 
|-
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
+
| 30 || [[#GetHomeButtonReaderLockAccessor]]
 
|-
 
|-
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
+
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
 
|-
 
|-
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
+
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
 
|-
 
|-
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
+
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
 
|-
 
|-
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
+
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
 
|-
 
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
+
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
|}
+
|-
 
+
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
=== Exit ===
+
|-
No input/output.
+
| 53 || [7.0.0+] [[#BeginVrModeEx]]
 
+
|-
=== LockExit ===
+
| 54 || [7.0.0+] [[#EndVrModeEx]]
No input/output.
+
|-
 
+
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
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).
+
|-
 
+
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
=== UnlockExit ===
 
No input/output.
 
 
 
Unlocks exit process, if LockExit was previously used.
 
 
 
=== EnterFatalSection ===
 
No input/output.
 
 
 
=== LeaveFatalSection ===
 
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.
 
 
 
=== GetLibraryAppletLaunchableEvent ===
 
No input, returns an output event handle with autoclear=false.
 
 
 
=== SetScreenShotPermission ===
 
Takes an input s32. No output.
 
 
 
Controls whether screenshot-capture is allowed.
 
 
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Value || Description
+
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
 
|-
 
|-
| 0 || Inherit from parent applet
+
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
 
|-
 
|-
| 1 || Enable
+
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
 
|-
 
|-
| 2 || Disable
+
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
 
|-
 
|-
|}
+
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
 
+
|-
=== SetOperationModeChangedNotification ===
+
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
Takes an input u8 bool flag. No output.
+
|-
 +
| 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 || [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
 +
|}
  
=== SetPerformanceModeChangedNotification ===
+
Officially notification messages are handled by the application itself, not sdk-nso in ExeFS. Official apps call code in sdk-nso which basically uses svcWaitSynchronization with the event from [[#GetEventHandle]] to check whether a message is available, then if so it uses [[#ReceiveMessage]]. The actual handling for message IDs is done in the app itself(see [[#AppletMessage]]).
Takes an input u8 bool flag. No output.
 
  
=== SetFocusHandlingMode ===
+
[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 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.
 
  
=== SetRestartMessageEnabled ===
+
=== GetEventHandle ===
Takes an input u8 bool flag, no output.
+
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].
  
See [[#NotificationMessage]].
+
=== ReceiveMessage ===
 +
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.
  
=== SetScreenShotAppletIdentityInfo ===
+
=== GetThisAppletKind ===
Takes an input [[#AppletIdentityInfo]], no output.
+
No input, returns an output [[#AppletKind]].
  
=== SetOutOfFocusSuspendingEnabled ===
+
Stubbed, just returns an error.
Takes an input u8 bool flag. No output.
 
  
=== SetControllerFirmwareUpdateSection ===
+
=== AllowToEnterSleep ===
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.
+
Stubbed, just returns an error.
  
=== SetRequiresCaptureButtonShortPressedMessage ===
+
=== DisallowToEnterSleep ===
Takes an input u8 bool flag, no output.
+
No input/output.
  
See [[#NotificationMessage]].
+
Stubbed, just returns an error.
  
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
+
=== GetOperationMode ===
 +
No input. Returns an output u8 for the current [[#OperationMode]].
  
=== SetAlbumImageOrientation ===
+
=== GetPerformanceMode ===
Takes an input u32 "nn::album::ImageOrientation". No output.
+
No input. Returns an output u32 for the current [[#PerformanceMode]].
  
The input value must not be >3.
+
=== GetCradleStatus ===
 +
No input, returns an output u8.
  
=== SetDesirableKeyboardLayout ===
+
This uses [[#omm]] GetCradleStatus.
Takes an input u32, no output.
 
  
=== CreateManagedDisplayLayer ===
+
=== GetBootMode ===
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].
+
No input, returns an output u8.
  
=== IsSystemBufferSharingEnabled ===
+
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
No input/output.
 
  
Not available when the current applet is an Application ([[#AppletId]] == 0x01).
+
=== GetCurrentFocusState ===
 +
No input. Returns an output u8 [[#FocusState]].
  
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
+
=== RequestToAcquireSleepLock ===
 +
No input/output.
  
=== GetSystemSharedLayerHandle ===
+
=== ReleaseSleepLock ===
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".
+
No input/output.
  
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
+
=== ReleaseSleepLockTransiently ===
 +
No input/output.
  
=== GetSystemSharedBufferHandle ===
+
=== GetAcquiredSleepLockEvent ===
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".
+
No input, returns an output Event handle with autoclear=false.
  
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
+
=== GetWakeupCount ===
 +
No input, returns an output u64.
  
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
+
=== PushToGeneralChannel ===
 +
Takes an input [[#IStorage]], no output.
  
=== SetHandlesRequestToDisplay ===
+
This is not usable under an Application, however it is usable under a LibraryApplet.
Takes an input u8 bool, no output.
 
  
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
+
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.
  
See [[#NotificationMessage]].
+
=== GetHomeButtonReaderLockAccessor ===
 +
No input, returns an output [[#ILockAccessor]].
  
=== ApproveToDisplay ===
+
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
No input/output.
 
  
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
+
=== GetReaderLockAccessorEx ===
 +
Takes an input u32, returns an output [[#ILockAccessor]].
  
=== OverrideAutoSleepTimeAndDimmingTime ===
+
The input value must be 0-3. 0 = HomeButton.
Takes 4 input s32s, no output.
 
  
=== SetMediaPlaybackState ===
+
=== GetWriterLockAccessorEx ===
Takes an input u8 bool, no output.
+
Takes an input u32, returns an output [[#ILockAccessor]].
  
=== SetIdleTimeDetectionExtension ===
+
The input value must be 0-3. 0 = HomeButton.
Takes an input u32, no output.
 
  
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.
+
=== GetCradleFwVersion ===
 +
No input, returns 4 output u32s.
  
=== GetIdleTimeDetectionExtension ===
+
This uses [[#omm]] GetCradleFwVersion.
No input, returns an output u32.
 
  
Returns the value set by [[#SetIdleTimeDetectionExtension]].
+
=== IsVrModeEnabled ===
 +
No input, returns an output u8 bool.
  
=== SetInputDetectionSourceSet ===
+
=== SetVrModeEnabled ===
Takes an input u32, no output.
+
Takes an input u8 bool flag. No output.
  
=== ReportUserIsActive ===
+
Updates internal AM state fields. If the new state doesn't match the previous state, this uses the [[Backlight_services]] {Disable/Enable}VrMode command depending on whether flag={disable/enable}.
No input/output.
 
  
Uses idle:sys ReportUserIsActive.
+
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.
  
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.
+
=== SetLcdBacklighOffEnabled ===
 +
Takes an input u8 bool, no output.
  
=== GetCurrentIlluminance ===
+
Sets whether the LCD screen blacklight is turned off.
No input, returns an output float.
 
  
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
+
=== BeginVrModeEx ===
 +
No input/output.
  
=== IsIlluminanceAvailable ===
+
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
No input, returns an output u8 bool.
 
  
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
+
=== EndVrModeEx ===
 +
No input/output.
  
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).
+
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
  
=== SetAutoSleepDisabled ===
+
=== IsInControllerFirmwareUpdateSection ===
Takes an input u8 bool, no output.
 
 
 
=== IsAutoSleepDisabled ===
 
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
  
=== ReportMultimediaError ===
+
=== SetVrPositionForDebug ===
Takes an input Result and a type-0x5 input buffer, no output.
+
Takes 4 input s32s, no output.
  
The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.
+
The s32s are: x, y, width, height.
  
=== GetCurrentIlluminanceEx ===
+
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
No input, returns an output u8 bool and float.
 
  
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
+
width must be 1-1280, height must be 1-720.
  
=== SetWirelessPriorityMode ===
+
x and y must not be negative. x+width must be <=1280. y+height must be <=720.
Takes an input s32 enum '''WirelessPriorityMode''', no output.
 
  
The input value must be 1 or 2.
+
=== GetDefaultDisplayResolution ===
 +
No input, returns two output s32s '''width''' and '''height'''.
  
=== GetAccumulatedSuspendedTickValue ===
+
=== GetDefaultDisplayResolutionChangeEvent ===
No input, returns an output u64 tick value.
+
No input, returns an output Event handle with autoclear=true.
  
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
+
=== GetHdcpAuthenticationState ===
 +
No input, returns an output s32.
  
=== GetAccumulatedSuspendedTickChangedEvent ===
+
=== GetHdcpAuthenticationStateChangeEvent ===
 
No input, returns an output Event handle with autoclear=true.
 
No input, returns an output Event handle with autoclear=true.
  
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
+
=== SetTvPowerStateMatchingMode ===
 +
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.
  
=== SetAlbumImageTakenNotificationEnabled ===
+
=== GetApplicationIdByContentActionName ===
Takes an input u8 bool, no output.
+
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].
  
See [[#NotificationMessage]].
+
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).
  
=== SetApplicationAlbumUserData ===
+
=== SetCpuBoostMode ===
Takes a type-0x21 input buffer, no output.
+
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
 +
 
 +
=== CancelCpuBoostMode ===
 +
No input/output.
  
The buffer contains arbitrary UserData.
+
=== GetBuiltInDisplayType ===
 +
No input, returns an output s32.
  
The size must be <=0x400. The input buffer is copied to a buffer loaded from a state ptr (throwing an error when the state ptr is not set), with the u32 size being written to statebuf+0x400 afterwards.
+
This is not exposed by sdknso.
  
=== GetDebugStorageChannel ===
+
This loads a s32 index from global state (originates from [[SPL_services#GetConfig|GetConfig]] [[SMC#HardwareType|HardwareType]]), Aborts if it's out-of-bounds, then the following is returned for the output s32: global_array[loaded_index].
No input, returns an output [[#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.
+
=== PerformSystemButtonPressingIfInFocus ===
 +
Takes an input [[#SystemButtonType]], no output.
  
== IStorageChannel ==
+
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.
Added with [[7.0.0]].
 
  
{| class="wikitable" border="1"
+
=== SetPerformanceConfigurationChangedNotification ===
|-
+
Takes an input u8 bool, no output.
! Cmd || Name || Notes
+
 
 +
=== GetCurrentPerformanceConfiguration ===
 +
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
 +
 
 +
=== OpenMyGpuErrorHandler ===
 +
No input, returns an [[#IGpuErrorHandler]].
 +
 
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 
 +
=== GetOperationModeSystemInfo ===
 +
No input, returns an output u32.
 +
 
 +
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].
 +
 
 +
=== GetSettingsPlatformRegion ===
 +
No input, returns an output u8.
 +
 
 +
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].
 +
 
 +
=== ActivateMigrationService ===
 +
No input/output.
 +
 
 +
Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].
 +
 
 +
=== DeactivateMigrationService ===
 +
No input/output.
 +
 
 +
=== DisableSleepTillShutdown ===
 +
No input/output.
 +
 
 +
=== SuppressDisablingSleepTemporarily ===
 +
Takes an input u64 "nn::TimeSpanType", no output.
 +
 
 +
=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===
 +
No input/output.
 +
 
 +
=== IGpuErrorHandler ===
 +
This is "nn::am::service::IGpuErrorHandler".
 +
 
 +
This was added with [11.0.0+].
 +
 
 +
This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0 || Push || No input, returns an output [[#IStorage]].
+
! Cmd || Name
 
|-
 
|-
| 1 || Unpop || No input, returns an output [[#IStorage]].
+
| 100 || [[#GetManualGpuErrorInfoSize]]
 
|-
 
|-
| 2 || Pop || No input, returns an output [[#IStorage]].
+
| 101 || [[#GetManualGpuErrorInfo]]
 
|-
 
|-
| 3 || GetPopEventHandle || No input, returns an output handle.
+
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]
 
|-
 
|-
| 4 || Clear || No input/output.
+
| 103 || [[#FinishManualGpuErrorHandling]]
 
|}
 
|}
  
== IWindowController ==
+
==== GetManualGpuErrorInfoSize ====
 +
No input, returns an output u64.
 +
 
 +
==== GetManualGpuErrorInfo ====
 +
Takes a type-0x6 output buffer, returns an output u64.
 +
 
 +
The OutBuffer_size must be >= the output size from [[#GetManualGpuErrorInfoSize]].
 +
 
 +
sdknso exposes the buffer as <code>void*</code>.
 +
 
 +
==== GetManualGpuErrorDetectionSystemEvent ====
 +
No input, returns an output Event handle with EventClearMode=0.
 +
 
 +
==== FinishManualGpuErrorHandling ====
 +
No input/output.
 +
 
 +
== ISelfController ==
 +
This is "nn::am::service::ISelfController".
 +
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 +
|-
 +
| 0 || [[#Exit]]
 
|-
 
|-
| 0 || [[#CreateWindow]] ||
+
| 1 || [[#LockExit]]
 
|-
 
|-
| 1 || [[#GetAppletResourceUserId]] ||
+
| 2 || [[#UnlockExit]]
 
|-
 
|-
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
+
| 3 || [2.0.0+] [[#EnterFatalSection]]
 
|-
 
|-
| 10 || [[#AcquireForegroundRights]] ||
+
| 4 || [2.0.0+] [[#LeaveFatalSection]]
 
|-
 
|-
| 11 || [[#ReleaseForegroundRights]] ||
+
| 9 || [[#GetLibraryAppletLaunchableEvent]]
 
|-
 
|-
| 12 || [[#RejectToChangeIntoBackground]] ||
+
| 10 || [[#SetScreenShotPermission]]
 
|-
 
|-
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||
+
| 11 || [[#SetOperationModeChangedNotification]]
 
|-
 
|-
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||  
+
| 12 || [[#SetPerformanceModeChangedNotification]]
|}
+
|-
 
+
| 13 || [[#SetFocusHandlingMode]]
=== CreateWindow ===
+
|-
Takes an input u32, returns an output [[#IWindow]].
+
| 14 || [[#SetRestartMessageEnabled]]
 
+
|-
Stubbed, just returns an error.
+
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
 
+
|-
=== GetAppletResourceUserId ===
+
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
No input, returns an output u64 [[#AppletResourceUserId]].
+
|-
 
+
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
=== GetAppletResourceUserIdOfCallerApplet ===
+
|-
No input, returns an output u64 [[#AppletResourceUserId]].
+
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
 
+
|-
=== AcquireForegroundRights ===
+
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
No input/output.
+
|-
 
+
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
Just returns 0.
+
|-
 
+
| 21 || [13.0.0+] GetScreenShotProgramId
=== ReleaseForegroundRights ===
 
No input/output.
 
 
 
Just returns 0.
 
 
 
=== RejectToChangeIntoBackground ===
 
No input/output.
 
 
 
Just returns 0.
 
 
 
=== SetAppletWindowVisibility ===
 
Takes an input u8 bool, no output.
 
 
 
=== SetAppletGpuTimeSlice ===
 
Takes an input s64, no output.
 
 
 
The input s64 must not be negative.
 
 
 
== IAudioController ==
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Cmd || Name
+
| 22 || [19.0.0+] GetScreenShotAcdIndex
 
|-
 
|-
| 0 || [[#SetExpectedMasterVolume]]
+
| 23 || [19.0.0+] GetScreenShotApparentPlatform
 
|-
 
|-
| 1 || [[#GetMainAppletExpectedMasterVolume]]
+
| 24 || [19.0.0+] GetScreenShotApplicationProperty
 
|-
 
|-
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
+
| 40 || [[#CreateManagedDisplayLayer]]
 
|-
 
|-
| 3 || [[#ChangeMainAppletMasterVolume]]
+
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
 
|-
 
|-
| 4 || [[#SetTransparentVolumeRate]]
+
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
|}
 
 
 
GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.
 
 
 
=== SetExpectedMasterVolume ===
 
Takes two input floats, no output.
 
 
 
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
 
 
 
=== GetMainAppletExpectedMasterVolume ===
 
No input, returns an output float.
 
 
 
=== GetLibraryAppletExpectedMasterVolume ===
 
No input, returns an output float.
 
 
 
=== ChangeMainAppletMasterVolume ===
 
Takes an input float and an input u64, no output.
 
 
 
=== SetTransparentVolumeRate ===
 
Takes an input float, no output.
 
 
 
== IDisplayController ==
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Cmd || Name
+
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
 
|-
 
|-
| 0 || GetLastForegroundCaptureImage
+
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
 
|-
 
|-
| 1 || UpdateLastForegroundCaptureImage
+
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
 
|-
 
|-
| 2 || GetLastApplicationCaptureImage
+
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]
 
|-
 
|-
| 3 || GetCallerAppletCaptureImage
+
| 50 || [[#SetHandlesRequestToDisplay]]
 
|-
 
|-
| 4 || UpdateCallerAppletCaptureImage
+
| 51 || [[#ApproveToDisplay]]
 
|-
 
|-
| 5 || GetLastForegroundCaptureImageEx
+
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
 
|-
 
|-
| 6 || GetLastApplicationCaptureImageEx
+
| 61 || [[#SetMediaPlaybackState]]
 
|-
 
|-
| 7 || GetCallerAppletCaptureImageEx
+
| 62 || [[#SetIdleTimeDetectionExtension]]
 
|-
 
|-
| 8 || [2.0.0+] TakeScreenShotOfOwnLayer
+
| 63 || [[#GetIdleTimeDetectionExtension]]
 
|-
 
|-
| 9 || [5.0.0+] CopyBetweenCaptureBuffers
+
| 64 || [[#SetInputDetectionSourceSet]]
 
|-
 
|-
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
+
| 65 || [2.0.0+] [[#ReportUserIsActive]]
 
|-
 
|-
| 11 || ReleaseLastApplicationCaptureBuffer
+
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
 
|-
 
|-
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
+
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
 
|-
 
|-
| 13 || ReleaseLastForegroundCaptureBuffer
+
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
 
|-
 
|-
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
+
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
 
|-
 
|-
| 15 || ReleaseCallerAppletCaptureBuffer
+
| 70 || [4.0.0+] [[#ReportMultimediaError]]
 
|-
 
|-
| 16 || AcquireLastApplicationCaptureBufferEx
+
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
 
|-
 
|-
| 17 || AcquireLastForegroundCaptureBufferEx
+
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
 
|-
 
|-
| 18 || AcquireCallerAppletCaptureBufferEx
+
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
 
|-
 
|-
| 20 || [3.0.0+] ClearCaptureBuffer
+
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
 
|-
 
|-
| 21 || [3.0.0+] ClearAppletTransitionBuffer
+
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
 
|-
 
|-
| 22 || [4.0.0+] AcquireLastApplicationCaptureSharedBuffer
+
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
 
|-
 
|-
| 23 || [4.0.0+] ReleaseLastApplicationCaptureSharedBuffer
+
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
 
|-
 
|-
| 24 || [4.0.0+] AcquireLastForegroundCaptureSharedBuffer
+
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]
 
|-
 
|-
| 25 || [4.0.0+] ReleaseLastForegroundCaptureSharedBuffer
+
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
 
|-
 
|-
| 26 || [4.0.0+] AcquireCallerAppletCaptureSharedBuffer
+
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
 
| 27 || [4.0.0+] ReleaseCallerAppletCaptureSharedBuffer
 
|-
 
| 28 || [6.0.0+] TakeScreenShotOfOwnLayerEx
 
 
|}
 
|}
  
=== AcquireLastApplicationCaptureBuffer ===
+
=== Exit ===
No input, returns an output handle.
+
No input/output.
 +
 
 +
Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
  
=== AcquireLastForegroundCaptureBuffer ===
+
=== LockExit ===
No input, returns an output handle.
+
No input/output.
  
=== AcquireCallerAppletCaptureBuffer ===
+
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 handle.
 
  
== ISystemAppletControllerForDebug ==
+
=== UnlockExit ===
{| class="wikitable" border="1"
+
No input/output.
|-
+
 
! Cmd || Name || Notes
+
Unlocks exit process, if LockExit was previously used.
|-
+
 
| 1 || RequestLaunchApplicationForDebug ||
+
=== EnterFatalSection ===
|-
+
No input/output.
| 2 || [7.0.0+] GetDebugStorageChannel || No input, returns an output [[#IStorageChannel]].
+
 
|-
+
=== LeaveFatalSection ===
| 3 || [7.0.0+] CreateStorageForDebug || Takes a total of 8-bytes of input, returns an [[#IStorage]].
+
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.
 +
 
 +
=== GetLibraryAppletLaunchableEvent ===
 +
No input, returns an output event handle with autoclear=false.
 +
 
 +
=== SetScreenShotPermission ===
 +
Takes an input s32. No output.
 +
 
 +
Controls whether screenshot-capture is allowed.
  
== IProcessWindingController ==
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Value || Description
 
|-
 
|-
| 0 || [[#GetLaunchReason]] ||
+
| 0 || Inherit from parent applet
 
|-
 
|-
| 11 || [[#OpenCallingLibraryApplet]] ||  
+
| 1 || Enable
 
|-
 
|-
| 21 || [[#PushContext]] ||  
+
| 2 || Disable
 
|-
 
|-
| 22 || [[#PopContext]] ||
+
|}
|-
+
 
| 23 || CancelWindingReservation ||
+
=== SetOperationModeChangedNotification ===
|-
+
Takes an input u8 bool flag. No output.
| 30 || WindAndDoReserved ||
 
|-
 
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||
 
|-
 
| 41 || [4.0.0+] ReserveToStartAndWait ||
 
|}
 
  
=== GetLaunchReason ===
+
=== SetPerformanceModeChangedNotification ===
No input. Returns an u32 AppletProcessLaunchReason.
+
Takes an input u8 bool flag. No output.
  
Used by LibraryApplets.
+
=== SetFocusHandlingMode ===
 +
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.
  
=== OpenCallingLibraryApplet ===
+
=== SetRestartMessageEnabled ===
No input, returns an output [[#ILibraryAppletAccessor]].
+
Takes an input u8 bool flag, no output.
  
=== PushContext ===
+
See [[#AppletMessage]].
Takes an input [[#IStorage]], no output.
 
  
=== PopContext ===
+
=== SetScreenShotAppletIdentityInfo ===
No input, returns an output [[#IStorage]].
+
Takes an input [[#AppletIdentityInfo]], no output.
  
=== ReserveToStartAndWaitAndUnwindThis ===
+
=== SetOutOfFocusSuspendingEnabled ===
Takes an input [[#ILibraryAppletAccessor]], no output.
+
Takes an input u8 bool flag. No output.
  
== IDebugFunctions ==
+
=== SetControllerFirmwareUpdateSection ===
{| class="wikitable" border="1"
+
Takes an input u8 bool flag, no output.
|-
 
! Cmd || Name || Notes
 
|-
 
| 0 || NotifyMessageToHomeMenuForDebug ||
 
|-
 
| 1 || [[#OpenMainApplication]] ||
 
|-
 
| 10 || EmulateButtonEvent ||
 
|-
 
| 20 || InvalidateTransitionLayer ||
 
|-
 
| 30 || [6.0.0+] RequestLaunchApplicationWithUserAndArgumentForDebug ||
 
|-
 
| 40 || [6.0.0+] GetAppletResourceUsageInfo ||
 
|-
 
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
 
|}
 
  
=== OpenMainApplication ===
+
This throws error 0x40280 when the internal state flag already matches the input value.
No input, returns an output [[#IApplicationAccessor]].
 
  
=== SetCpuBoostModeForApplet ===
+
=== SetRequiresCaptureButtonShortPressedMessage ===
Takes an input u32 '''CpuBoostMode''' (only modes 0 and 1 are valid) and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
+
Takes an input u8 bool flag, no output.
  
== IStorage ==
+
See [[#AppletMessage]].
{| 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]].
+
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
  
Only 1 *Accessor session can be open for each IStorage at a time.
+
=== SetAlbumImageOrientation ===
 +
Takes an input u32 "nn::album::ImageOrientation". No output.
  
== IStorageAccessor ==
+
The input value must not be >3.
{| class="wikitable" border="1"
+
 
|-
+
=== SetDesirableKeyboardLayout ===
! Cmd || Name || Notes
+
Takes an input u32, no output.
|-
 
| 0 || GetSize || No input. Returns an s64.
 
|-
 
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
 
|-
 
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
 
|}
 
  
== ITransferStorageAccessor ==
+
The input u32 is "nn::settings::KeyboardLayout".
{| 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.
+
=== CreateManagedDisplayLayer ===
 +
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].
  
= appletOE =
+
=== IsSystemBufferSharingEnabled ===
This is "nn::am::service::IApplicationProxyService".
+
No input/output.
  
{| class="wikitable" border="1"
+
Not available when the current applet is an Application ([[#AppletId]] == 0x01).
|-
 
! 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.
+
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
  
== OpenApplicationProxy ==
+
=== GetSystemSharedLayerHandle ===
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
+
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".
  
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).
+
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
  
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
+
=== GetSystemSharedBufferHandle ===
 +
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".
  
= idle:sys =
+
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
This is "nn::idle::detail::IPolicyManagerSystem"
 
  
{| class="wikitable" border="1"
+
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
|-
 
! Cmd || Name
 
|-
 
| 0 || GetAutoPowerDownEvent
 
|-
 
|rowspan="2"| 1 || [1.0.0-3.0.2]
 
|-
 
| [7.0.0+]
 
|-
 
| 2 || [1.0.0-3.0.2]
 
|-
 
| 3 || SetHandlingContext
 
|-
 
| 4 || LoadAndApplySettings
 
|-
 
| 5 || ReportUserIsActive
 
|}
 
  
[3.0.0+] SetHandlingContext now takes an additional 0x10-bytes of input.
+
=== CreateManagedDisplaySeparableLayer ===
 +
No input, returns two output u64 LayerIds.
  
= omm =
+
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.
This is "nn::omm::detail::IOperationModeManager"
+
 
 +
=== SetManagedDisplayLayerSeparationMode ===
 +
Takes an input u32, no output.
 +
 
 +
sdknso exposes this as <code>nn::vi::SetRecordingLayerEnabled(bool)</code>.
 +
 
 +
The input u32 must be 0-1.
 +
 
 +
=== SetRecordingLayerCompositionEnabled ===
 +
Takes an input bool, no output.
 +
 
 +
=== SetHandlesRequestToDisplay ===
 +
Takes an input u8 bool, no output.
 +
 
 +
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
 +
 
 +
See [[#AppletMessage]].
 +
 
 +
=== ApproveToDisplay ===
 +
No input/output.
  
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
+
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
Besides [[PTM_services]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
 
  
{| class="wikitable" border="1"
+
=== OverrideAutoSleepTimeAndDimmingTime ===
|-
+
Takes 4 input s32s, no output.
! Cmd || Name || Notes
+
 
|-
+
=== SetMediaPlaybackState ===
| 0 || GetOperationMode ||
+
Takes an input u8 bool, no output.
|-
+
 
| 1 || GetOperationModeChangeEvent ||
+
=== SetIdleTimeDetectionExtension ===
|-
+
Takes an input u32, no output.
| 2 || EnableAudioVisual ||
+
 
|-
+
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.
| 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+] ||
 
|}
 
  
== Cmd26 ==
+
=== GetIdleTimeDetectionExtension ===
 
No input, returns an output u32.
 
No input, returns an output u32.
  
This is used by [[#GetOperationModeSystemInfo]].
+
Returns the value set by [[#SetIdleTimeDetectionExtension]].
  
= spsm =
+
=== SetInputDetectionSourceSet ===
This is "nn::spsm::detail::IPowerStateInterface".
+
Takes an input u32, no output.
  
{| class="wikitable" border="1"
+
=== ReportUserIsActive ===
|-
+
No input/output.
! Cmd || Name
+
 
|-
+
Uses idle:sys ReportUserIsActive.
| 0 || GetState
 
|-
 
| 1 || SleepSystemAndWaitAwake
 
|-
 
| 2 ||
 
|-
 
| 3 ||
 
|-
 
| 4 || GetNotificationMessageEventHandle
 
|-
 
| 5 ||
 
|-
 
| 6 ||
 
|-
 
| 7 ||
 
|-
 
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
 
|-
 
| 9 || ChangeHomeButtonLongPressingTime
 
|-
 
| 10 ||
 
|-
 
| 11 || [1.0.0-3.0.2]
 
|}
 
  
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
+
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.
  
= tcap =
+
=== GetCurrentIlluminance ===
This is "nn::tcap::server::IManager".
+
No input, returns an output float.
  
{| class="wikitable" border="1"
+
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
|-
 
! Cmd || Name
 
|-
 
| 0 || GetContinuousHighSkinTemperatureEvent
 
|-
 
| 1 || SetOperationMode
 
|-
 
| 2 || LoadAndApplySettings
 
|}
 
  
= caps:su =
+
=== IsIlluminanceAvailable ===
This is "nn::capsrv::sf::IScreenShotApplicationService".
+
No input, returns an output u8 bool.
  
This was added with [[6.0.0]].
+
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
  
This can be used by applications to save screenshots.
+
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).
  
{| class="wikitable" border="1"
+
=== SetAutoSleepDisabled ===
|-
+
Takes an input u8 bool, 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.
+
=== IsAutoSleepDisabled ===
 +
No input, returns an output u8 bool.
  
== SaveScreenShot ==
+
=== ReportMultimediaError ===
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer. Returns a 0x20-byte struct '''ApplicationAlbumEntry'''.
+
Takes an input Result and a type-0x5 input buffer, no output.
  
Official user-processes doesn't use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero except +0 is set to an input u32.
+
The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.
  
== SaveScreenShotEx0 ==
+
=== GetCurrentIlluminanceEx ===
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, and a type-0x45 input buffer. Returns a 0x20-byte struct '''ApplicationAlbumEntry'''.
+
No input, returns an output u8 bool and float.
 +
 
 +
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
 +
 
 +
=== SetInputDetectionPolicy ===
 +
Takes an input [[#InputDetectionPolicy]], no output.
 +
 
 +
=== SetWirelessPriorityMode ===
 +
Takes an input s32 [[#WirelessPriorityMode]], no output.
  
= Library Applets =
+
=== GetAccumulatedSuspendedTickValue ===
This section documents library applet launching.
+
No input, returns an output u64 tick value.
  
Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
+
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
  
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
+
=== GetAccumulatedSuspendedTickChangedEvent ===
 +
No input, returns an output Event handle with autoclear=true.
  
== CommonArguments ==
+
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by <code>nn::la::CommonArgumentsWriter</code> and has the following format.
 
  
This struct is 0x20-bytes.
+
=== SetAlbumImageTakenNotificationEnabled ===
 +
Takes an input u8 bool, no output.
  
Official sw handles the first 8-bytes separately, which is a header. With CommonArguments version 0x0, the header is 4-bytes, while starting with version 0x1 it's 8-bytes.
+
See [[#AppletMessage]].
  
{| class="wikitable" border="1"
+
=== SetApplicationAlbumUserData ===
|-
+
Takes a type-0x21 input buffer, no output.
! Offset || Size || Typical Value || Notes
+
 
|-
+
The buffer contains arbitrary UserData.
| 0x0 || 4 || 1 || Common Arguments version
+
 
|-
+
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.
| 0x4 || 4 || 0x20 || Common Arguments size
+
 
 +
=== SaveCurrentScreenshot ===
 +
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.
 +
 
 +
sdknso exposes this under "nn::album::".
 +
 
 +
=== SetRecordVolumeMuted ===
 +
Takes an input bool, no output.
 +
 
 +
=== GetDebugStorageChannel ===
 +
No input, returns an output [[#IStorageChannel]].
 +
 
 +
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
 +
 
 +
== IStorageChannel ==
 +
This is "nn::am::service::IStorageChannel".
 +
 
 +
This was added with [7.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x8 || 4 || || Library applet version (API version)
+
! Cmd || Name || Notes
 +
|-
 +
| 0 || Push || No input, returns an output [[#IStorage]].
 
|-
 
|-
| 0xC || 4 || 0 || Theme color
+
| 1 || Unpop || No input, returns an output [[#IStorage]].
 
|-
 
|-
| 0x10 || 1 || 0 || Play startup sound
+
| 2 || Pop || No input, returns an output [[#IStorage]].
 
|-
 
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
+
| 3 || GetPopEventHandle || No input, returns an output handle.
 
|-
 
|-
 +
| 4 || Clear || No input/output.
 
|}
 
|}
  
= Enums =
+
== IWindowController ==
=== AppletId ===
+
This is "nn::am::service::IWindowController".
See also [[:Category:Library Applets]].
 
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! ID
+
! Cmd || Name || Notes
!  Title-id
 
!  Description
 
 
|-
 
|-
| 0x01
+
| 0 || [[#CreateWindow]] ||  
|  
 
| Application. Not valid for use with LibraryApplets.
 
 
|-
 
|-
| 0x02
+
| 1 || [[#GetAppletResourceUserId]] ||
| 010000000000100C
 
| "overlayDisp"
 
 
|-
 
|-
| 0x03
+
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
| 0100000000001000
 
| "qlaunch"
 
 
|-
 
|-
| 0x04
+
| 10 || [[#AcquireForegroundRights]] ||
| 0100000000001012
 
| "starter"
 
 
|-
 
|-
| 0x0A
+
| 11 || [[#ReleaseForegroundRights]] ||
| 0100000000001001
 
| [[Auth_Applet|"auth"]]
 
 
|-
 
|-
| 0x0B
+
| 12 || [[#RejectToChangeIntoBackground]] ||
| 0100000000001002
 
| "cabinet"
 
 
|-
 
|-
| 0x0C
+
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||  
| 0100000000001003
 
| "controller"
 
 
|-
 
|-
| 0x0D
+
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||  
| 0100000000001004
+
|}
| "dataErase"
+
 
|-
+
=== CreateWindow ===
| 0x0E
+
Takes an input u32, returns an output [[#IWindow]].
| 0100000000001005
+
 
| [[Error_Applet|"error"]]
+
Stubbed, just returns an error.
|-
+
 
| 0x0F
+
=== GetAppletResourceUserId ===
| 0100000000001006
+
No input, returns an output u64 [[#AppletResourceUserId]].
| "netConnect"
+
 
 +
=== GetAppletResourceUserIdOfCallerApplet ===
 +
No input, returns an output u64 [[#AppletResourceUserId]].
 +
 
 +
=== AcquireForegroundRights ===
 +
No input/output.
 +
 
 +
Just returns 0.
 +
 
 +
=== ReleaseForegroundRights ===
 +
No input/output.
 +
 
 +
Just returns 0.
 +
 
 +
=== RejectToChangeIntoBackground ===
 +
No input/output.
 +
 
 +
Just returns 0.
 +
 
 +
=== SetAppletWindowVisibility ===
 +
Takes an input u8 bool, no output.
 +
 
 +
=== SetAppletGpuTimeSlice ===
 +
Takes an input s64, no output.
 +
 
 +
The input s64 must not be negative.
 +
 
 +
== IAudioController ==
 +
This is "nn::am::service::IAudioController".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x10
+
! Cmd || Name
| 0100000000001007
 
| [[Profile_Selector|"playerSelect"]]
 
 
|-
 
|-
| 0x11
+
| 0 || [[#SetExpectedMasterVolume]]
| 0100000000001008
 
| [[Software_Keyboard|"swkbd"]]
 
 
|-
 
|-
| 0x12
+
| 1 || [[#GetMainAppletExpectedMasterVolume]]
| 0100000000001009
 
| "miiEdit"
 
 
|-
 
|-
| 0x13
+
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
| 010000000000100A
 
| "LibAppletWeb" [[Internet_Browser#010000000000100A|WebApplet]] applet
 
 
|-
 
|-
| 0x14
+
| 3 || [[#ChangeMainAppletMasterVolume]]
| 010000000000100B
 
| "LibAppletShop" [[Internet_Browser#ShopN|ShopN]] applet
 
 
|-
 
|-
| 0x15
+
| 4 || [[#SetTransparentVolumeRate]]
| 010000000000100D
 
| "photoViewer"
 
|-
 
| 0x16
 
| 010000000000100E
 
| "set"
 
|-
 
| 0x17
 
| 010000000000100F
 
| "LibAppletOff" [[Internet_Browser#Offline_Applet|Offline]] applet
 
|-
 
| 0x18
 
| 0100000000001010
 
| "LibAppletLns" [[Internet_Browser#Whitelisted_Applets|Whitelisted]] applet
 
|-
 
| 0x19
 
| 0100000000001011
 
| "LibAppletAuth" [[Internet_Browser#WifiWebAuthApplet|WifiWebAuth]] applet
 
|-
 
| 0x1A
 
| 0100000000001013
 
| "myPage"
 
 
|}
 
|}
  
=== LibraryAppletMode ===
+
GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.
 +
 
 +
=== SetExpectedMasterVolume ===
 +
Takes two input floats, no output.
 +
 
 +
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
 +
 
 +
=== GetMainAppletExpectedMasterVolume ===
 +
No input, returns an output float.
 +
 
 +
=== GetLibraryAppletExpectedMasterVolume ===
 +
No input, returns an output float.
 +
 
 +
=== ChangeMainAppletMasterVolume ===
 +
Takes an input float and an input u64, no output.
 +
 
 +
=== SetTransparentVolumeRate ===
 +
Takes an input float, no output.
 +
 
 +
== IDisplayController ==
 +
This is "nn::am::service::IDisplayController".
 +
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! ID
+
! Cmd || Name
!  Description
 
 
|-
 
|-
| 0x0
+
| 0 || [[#GetLastForegroundCaptureImage]]
| AllForeground
 
 
|-
 
|-
| 0x1
+
| 1 || [[#UpdateLastForegroundCaptureImage]]
| Background
 
 
|-
 
|-
| 0x2
+
| 2 || [[#GetLastApplicationCaptureImage]]
| No UI
 
 
|-
 
|-
| 0x3
+
| 3 || [[#GetCallerAppletCaptureImage]]
| Background with indirect display, see also [[#GetIndirectLayerConsumerHandle]]. Only used by swkbd InlineKeyboard.
 
 
|-
 
|-
| 0x4
+
| 4 || [[#UpdateCallerAppletCaptureImage]]
| AllForegroundInitiallyHidden. Can be used by [7.0.0+] [[Internet_Browser|WebSession]].
 
 
|-
 
|-
|}
+
| 5 || [[#GetLastForegroundCaptureImageEx]]
 
 
=== NotificationMessage ===
 
{| class="wikitable" border="1"
 
 
|-
 
|-
!  ID
+
| 6 || [[#GetLastApplicationCaptureImageEx]]
!  Description
 
 
|-
 
|-
| 0x4 || Exit requested
+
| 7 || [[#GetCallerAppletCaptureImageEx]]
 
|-
 
|-
| 0xF || [[#GetCurrentFocusState|FocusState]] changed
+
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
 
|-
 
|-
| 0x10 || Current applet execution was [[#SetRestartMessageEnabled|resumed]].
+
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
 
|-
 
|-
| 0x1E || OperationMode changed
+
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
 
|-
 
|-
| 0x1F || PerformanceMode changed
+
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
 
|-
 
|-
| 0x33 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]. Indicates that [[#ApproveToDisplay]] should be used.
+
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
 
|-
 
|-
| 0x5A || Capture button was [[#SetRequiresCaptureButtonShortPressedMessage|short-pressed]].
+
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
 
|-
 
|-
| 0x5C || Screenshot was [[#SetAlbumImageTakenNotificationEnabled|taken]].
+
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
|}
+
|-
 
+
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
=== OperationMode ===
+
|-
{| class="wikitable" border="1"
+
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
 
|-
 
|-
!  Value
+
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
!  Description
 
 
|-
 
|-
| 0 || Handheld
+
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
 
|-
 
|-
| 1 || Docked
+
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
|}
 
 
 
=== TvPowerStateMatchingMode ===
 
{| class="wikitable" border="1"
 
 
|-
 
|-
!  Value
+
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
!  Description
 
 
|-
 
|-
| 0 || Unknown
+
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
 
|-
 
|-
| 1 || Unknown
+
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
|}
 
 
 
This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
 
 
 
=== SystemButtonType ===
 
{| class="wikitable" border="1"
 
 
|-
 
|-
!  Value
+
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
!  Description
 
 
|-
 
|-
| 1 || PerformHomeButtonShortPressing
+
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
 
|-
 
|-
| 2 || PerformHomeButtonLongPressing
+
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
 
|-
 
|-
| 6 || PerformCaptureButtonShortPressing
+
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
 
|-
 
|-
| 7 || PerformCaptureButtonLongPressing
+
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
 
|}
 
|}
  
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]].
+
=== GetLastForegroundCaptureImage ===
 +
Takes a type-0x6 output buffer.
  
=== LaunchParameterKind ===
+
Stubbed, just returns an error.
{| class="wikitable" border="1"
 
|-
 
!  Value
 
!  Description
 
|-
 
| 1 || Application-specific LaunchParameter
 
|-
 
| 2 || account PreselectedUser
 
|-
 
| 3 || Unknown if used by anything?
 
|}
 
  
=== LibraryAppletExitReason ===
+
=== UpdateLastForegroundCaptureImage ===
{| class="wikitable" border="1"
+
No input/output.
|-
+
 
! Value
+
=== GetLastApplicationCaptureImage ===
! Description
+
Takes a type-0x6 output buffer.
|-
+
 
| 0 || Normal
+
Stubbed, just returns an error.
|-
+
 
| 1 || Canceled
+
=== GetCallerAppletCaptureImage ===
|-
+
Takes a type-0x6 output buffer.
| 2 || Abnormal
+
 
|-
+
Stubbed, just returns an error.
| 10 || Unexpected
+
 
|}
+
=== UpdateCallerAppletCaptureImage ===
 
+
No input/output.
=== ProgramSpecifyKind ===
+
 
{| class="wikitable" border="1"
+
Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.
 +
 
 +
=== GetLastForegroundCaptureImageEx ===
 +
Takes a type-0x6 output buffer, returns an output u8 bool.
 +
 
 +
The buffer size must match 0x384000.
 +
 
 +
=== GetLastApplicationCaptureImageEx ===
 +
Takes a type-0x6 output buffer, returns an output u8 bool.
 +
 
 +
The buffer size must match 0x384000.
 +
 
 +
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.
 +
 
 +
=== GetCallerAppletCaptureImageEx ===
 +
Takes a type-0x6 output buffer, returns an output u8 bool.
 +
 
 +
The buffer size must match 0x384000.
 +
 
 +
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.
 +
 
 +
=== TakeScreenShotOfOwnLayer ===
 +
Takes an input u8 bool and a s32, no output.
 +
 
 +
=== CopyBetweenCaptureBuffers ===
 +
Takes two input s32s, no output.
 +
 
 +
=== AcquireLastApplicationCaptureBuffer ===
 +
No input, returns an output handle.
 +
 
 +
Stubbed, just returns an error.
 +
 
 +
=== ReleaseLastApplicationCaptureBuffer ===
 +
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.
 +
 
 +
=== AcquireLastForegroundCaptureBuffer ===
 +
No input, returns an output handle.
 +
 
 +
Stubbed, just returns an error.
 +
 
 +
=== ReleaseLastForegroundCaptureBuffer ===
 +
No input/output.
 +
 
 +
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
 +
 
 +
=== AcquireCallerAppletCaptureBuffer ===
 +
No input, returns an output handle.
 +
 
 +
Stubbed, just returns an error.
 +
 
 +
=== ReleaseCallerAppletCaptureBuffer ===
 +
No input/output.
 +
 
 +
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
 +
 
 +
=== AcquireLastApplicationCaptureBufferEx ===
 +
No input, returns an output TransferMemory handle and an output u8 bool.
 +
 
 +
The state field used by [[#ReleaseLastApplicationCaptureBuffer]] must be 0. Calls a func which just returns an error (this is only the case on newer sysvers), hence this cmd will just return that error. If that func would have returned successfully, the state field would be set to 1 and the cmd would return 0.
 +
 
 +
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.
 +
 
 +
=== AcquireLastForegroundCaptureBufferEx ===
 +
No input, returns an output TransferMemory handle and an output u8 bool.
 +
 
 +
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.
 +
 
 +
=== AcquireCallerAppletCaptureBufferEx ===
 +
No input, returns an output TransferMemory handle and an output u8 bool.
 +
 
 +
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.
 +
 
 +
=== ClearCaptureBuffer ===
 +
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.
 +
 
 +
Clear the input CaptureSharedBuffer with the specified RGBA8 color.
 +
 
 +
=== ClearAppletTransitionBuffer ===
 +
Takes an input u32, no output.
 +
 
 +
Clear the AppletTransitionBuffer with the specified RGBA8 color.
 +
 
 +
=== AcquireLastApplicationCaptureSharedBuffer ===
 +
No input, returns an output u8 bool and an s32.
 +
 
 +
This loads data from state.
 +
 
 +
=== ReleaseLastApplicationCaptureSharedBuffer ===
 +
No input/output.
 +
 
 +
Depending on whether a state field is 0, this just returns an error or returns 0.
 +
 
 +
=== AcquireLastForegroundCaptureSharedBuffer ===
 +
No input, returns an output u8 bool and an s32.
 +
 
 +
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
 +
 
 +
=== ReleaseLastForegroundCaptureSharedBuffer ===
 +
No input/output.
 +
 
 +
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
 +
 
 +
=== AcquireCallerAppletCaptureSharedBuffer ===
 +
No input, returns an output u8 bool and an s32.
 +
 
 +
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
 +
 
 +
=== ReleaseCallerAppletCaptureSharedBuffer ===
 +
No input/output.
 +
 
 +
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
 +
 
 +
=== TakeScreenShotOfOwnLayerEx ===
 +
Takes two input u8 bools and a s32, no output.
 +
 
 +
Calls the same func internally as [[#TakeScreenShotOfOwnLayer]], except the last bool param is the last cmd param bool instead of hard-coded 0. This flag indicates whether the screenshot should be taken Immediately.
 +
 
 +
== ISystemAppletControllerForDebug ==
 +
This is "nn::am::service::ISystemAppletControllerForDebug".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 1 || RequestLaunchApplicationForDebug
 +
|-
 +
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]
 +
|-
 +
| 3 || [7.0.0+] [[#CreateStorageForDebug]]
 +
|-
 +
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]
 +
|}
 +
 
 +
=== GetDebugStorageChannel ===
 +
No input. Returns an output [[#IStorageChannel]].
 +
 
 +
=== CreateStorageForDebug ===
 +
Takes a total of 8-bytes of input. Returns an [[#IStorage]].
 +
 
 +
=== CreateCradleFirmwareUpdaterForDebug ===
 +
No input. Returns an [[#ICradleFirmwareUpdater]].
 +
 
 +
== IProcessWindingController ==
 +
This is "nn::am::service::IProcessWindingController".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 0 || [[#GetLaunchReason]] ||
 +
|-
 +
| 11 || [[#OpenCallingLibraryApplet]] ||
 +
|-
 +
| 21 || [[#PushContext]] ||
 +
|-
 +
| 22 || [[#PopContext]] ||
 +
|-
 +
| 23 || [[#CancelWindingReservation]] ||
 +
|-
 +
| 30 || [[#WindAndDoReserved]] ||
 +
|-
 +
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||
 +
|-
 +
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
 +
|}
 +
 
 +
=== GetLaunchReason ===
 +
No input, returns an output [[#AppletProcessLaunchReason]].
 +
 
 +
Used by LibraryApplets.
 +
 
 +
=== OpenCallingLibraryApplet ===
 +
No input, returns an output [[#ILibraryAppletAccessor]].
 +
 
 +
The objptr from state is cleared during this, an error is thrown if it's already 0.
 +
 
 +
=== PushContext ===
 +
Takes an input [[#IStorage]], no output.
 +
 
 +
=== PopContext ===
 +
No input, returns an output [[#IStorage]].
 +
 
 +
=== CancelWindingReservation ===
 +
No input/output.
 +
 
 +
=== WindAndDoReserved ===
 +
No input/output.
 +
 
 +
=== ReserveToStartAndWaitAndUnwindThis ===
 +
Takes an input [[#ILibraryAppletAccessor]], no output.
 +
 
 +
=== ReserveToStartAndWait ===
 +
Takes an input [[#ILibraryAppletAccessor]], no output.
 +
 
 +
== ISystemProcessCommonFunctions ==
 +
This is "nn::am::service::ISystemProcessCommonFunctions".
 +
 
 +
This was added with [19.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 ||
 +
|}
 +
 
 +
=== Cmd0 ===
 +
No input. Returns an [[#IApplicationObserver]].
 +
 
 +
=== IApplicationObserver ===
 +
This is "nn::am::service::IApplicationObserver".
 +
 
 +
This was added with [19.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 1 ||
 +
|-
 +
| 2 ||
 +
|-
 +
| 10 ||
 +
|-
 +
| 20 ||
 +
|-
 +
| 30 ||
 +
|}
 +
 
 +
== IDebugFunctions ==
 +
This is "nn::am::service::IDebugFunctions".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
 +
|-
 +
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
 +
|-
 +
| 10 || [[#PerformSystemButtonPressing]]
 +
|-
 +
| 20 || [[#InvalidateTransitionLayer]]
 +
|-
 +
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
 +
|-
 +
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
 +
|-
 +
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
 +
|-
 +
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
 +
|-
 +
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
 +
|-
 +
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
 +
|-
 +
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
 +
|-
 +
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
 +
|-
 +
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
 +
|-
 +
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
 +
|-
 +
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
 +
|-
 +
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
 +
|-
 +
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
 +
|-
 +
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
 +
|-
 +
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
 +
|-
 +
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]
 +
|-
 +
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
 +
|-
 +
| 140 || [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug
 +
|-
 +
| 200 || [15.0.0+] CreateFloatingLibraryAppletAccepterForDebug
 +
|-
 +
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
 +
|-
 +
| 410 || [18.0.0+] CreateGeneralStorageForDebug
 +
|-
 +
| 411 || [18.0.0+] ReadGeneralStorageForDebug
 +
|-
 +
| 412 || [18.0.0+] WriteGeneralStorageForDebug
 +
|-
 +
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
 +
|}
 +
 
 +
=== NotifyMessageToHomeMenuForDebug ===
 +
Takes an input [[#AppletMessage]], no output.
 +
 
 +
Stubbed, just returns an error.
 +
 
 +
=== OpenMainApplication ===
 +
No input, returns an output [[#IApplicationAccessor]].
 +
 
 +
Should not be used when no Application is running (svcBreak).
 +
 
 +
=== PerformSystemButtonPressing ===
 +
Takes an input [[#SystemButtonType]], no output.
 +
 
 +
=== InvalidateTransitionLayer ===
 +
No input/output.
 +
 
 +
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
 +
Takes an input u8 bool flag, an [[NCM_services#ApplicationId|ApplicationId]], a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.
 +
 
 +
Requests to launch the specified Application, with the specified users. When the bool flag is true, the content of the second input buffer is used to create a storage which is pushed to the UserChannel for this Application (see [[#LaunchParameterKind]]).
 +
 
 +
=== RequestLaunchApplicationByApplicationLaunchInfoForDebug ===
 +
Takes a total of 0x58-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.
 +
 
 +
[19.0.0+] Takes a total of 0x88-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.
 +
 
 +
=== GetAppletResourceUsageInfo ===
 +
No input, returns an output [[#AppletResourceUsageInfo]].
 +
 
 +
=== SetCpuBoostModeForApplet ===
 +
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
 +
 
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 
 +
=== CancelCpuBoostModeForApplet ===
 +
No input/output.
 +
 
 +
=== PushToAppletBoundChannelForDebug ===
 +
Takes an input [[#IStorage]] and a s32, no output.
 +
 
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 
 +
The s32 must match the value already stored in state when the state value is non-zero, otherwise an error is returned. When the state value is 0, the s32 is written into state. Then the input storage is pushed to the StorageChannel.
 +
 
 +
=== TryPopFromAppletBoundChannelForDebug ===
 +
Takes an input s32, returns an output [[#IStorage]].
 +
 
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 
 +
The s32 must not be 0 and must match the value previously saved by [[#PushToAppletBoundChannelForDebug]], otherwise errors are returned. Then the output storage is popped from the StorageChannel.
 +
 
 +
=== AlarmSettingNotificationEnableAppEventReserve ===
 +
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
 +
 
 +
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
 +
 
 +
=== 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"
 +
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 0 || GetSize || No input. Returns an s64.
 +
|-
 +
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
 +
|-
 +
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
 +
|}
 +
 
 +
== ITransferStorageAccessor ==
 +
This is "nn::am::service::ITransferStorageAccessor".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 0 || GetSize || No input. Returns an output s64.
 +
|-
 +
| 1 || GetHandle || No input. Returns an output s64 and handle.
 +
|}
 +
 
 +
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
 +
 
 +
= appletOE =
 +
This is "nn::am::service::IApplicationProxyService".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name || 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.
 +
 
 +
== OpenApplicationProxy ==
 +
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
 +
 
 +
Takes a [[IPC_Marshalling|reserved]] input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias).
 +
 
 +
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
 +
 
 +
= idle:sys =
 +
This is "nn::idle::detail::IPolicyManagerSystem"
 +
 
 +
This was moved to [[OMM_services|omm]] with [14.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 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)]]
 +
|-
 +
| 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+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
 +
|-
 +
| 0x33
 +
| 010000000000100F
 +
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
 +
|-
 +
| 0x35
 +
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
 +
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )
 +
|-
 +
| 0x36
 +
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
 +
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )
 +
|-
 +
| 0x37
 +
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
 +
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )
 +
|-
 +
| 0x38
 +
| 0100000000001043
 +
| [16.0.0-16.1.0]
 +
|-
 +
| 0x50
 +
| 0100000000001007
 +
| [18.0.0+]
 +
|-
 +
| 0x51
 +
| 0100000000001007
 +
| [18.0.0+]
 +
|-
 +
| 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
 +
|}
 +
 
 +
= LibraryAppletMode =
 +
This is "nn::applet::LibraryAppletMode".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0x0
 +
| AllForeground
 +
|-
 +
| 0x1
 +
| PartialForeground
 +
|-
 +
| 0x2
 +
| NoUi
 +
|-
 +
| 0x3
 +
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])
 +
|-
 +
| 0x4
 +
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])
 +
|}
 +
 
 +
= AppletMessage =
 +
This is "nn::am::AppletMessage".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0 || None
 +
|-
 +
| 1 || ChangeIntoForeground
 +
|-
 +
| 2 || ChangeIntoBackground
 +
|-
 +
| 4 || Exit
 +
|-
 +
| 6 || ApplicationExited
 +
|-
 +
| 7 ||
 +
|-
 +
| 15 || [[#FocusState|FocusStateChanged]]
 +
|-
 +
| 16 || [[#SetRestartMessageEnabled|Resume]]
 +
|-
 +
| 20 || DetectShortPressingHomeButton
 +
|-
 +
| 21 || DetectLongPressingHomeButton
 +
|-
 +
| 22 || DetectShortPressingPowerButton
 +
|-
 +
| 23 || DetectMiddlePressingPowerButton
 +
|-
 +
| 24 || DetectLongPressingPowerButton
 +
|-
 +
| 25 || RequestToPrepareSleep
 +
|-
 +
| 26 || FinishedSleepSequence
 +
|-
 +
| 27 || SleepRequiredByHighTemperature
 +
|-
 +
| 28 || SleepRequiredByLowBattery
 +
|-
 +
| 29 || AutoPowerDown
 +
|-
 +
| 30 || [[#OperationMode|OperationModeChanged]]
 +
|-
 +
| 31 || [[#PerformanceMode|PerformanceModeChanged]]
 +
|-
 +
| 32 || DetectReceivingCecSystemStandby
 +
|-
 +
| 33 || SdCardRemoved
 +
|-
 +
| 34 ||
 +
|-
 +
| 50 || LaunchApplicationRequested
 +
|-
 +
| 51 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]
 +
|-
 +
| 55 || ShowApplicationLogo
 +
|-
 +
| 56 || HideApplicationLogo
 +
|-
 +
| 57 || ForceHideApplicationLogo
 +
|-
 +
| 58 ||
 +
|-
 +
| 59 ||
 +
|-
 +
| 60 || FloatingApplicationDetected
 +
|-
 +
| 61 || [7.0.0+] PerformanceConfigurationChanged
 +
|-
 +
| 70 ||
 +
|-
 +
| 71 ||
 +
|-
 +
| 72 ||
 +
|-
 +
| 73 ||
 +
|-
 +
| 75 ||
 +
|-
 +
| 80 ||
 +
|-
 +
| 81 ||
 +
|-
 +
| 82 ||
 +
|-
 +
| 83 ||
 +
|-
 +
| 85 ||
 +
|-
 +
| 86 ||
 +
|-
 +
| 90 || [[#SetRequiresCaptureButtonShortPressedMessage|DetectShortPressingCaptureButton]]
 +
|-
 +
| 92 || [[#SetAlbumImageTakenNotificationEnabled|AlbumScreenShotTaken]]
 +
|-
 +
| 93 || AlbumRecordingSaved
 +
|-
 +
| 94 ||
 +
|-
 +
| 100 ||
 +
|-
 +
| 101 ||
 +
|-
 +
| 110 || [14.0.0+] DetectShortPressingCaptureButtonForApplet
 +
|-
 +
| 111 || [14.0.0+] DetectLongPressingCaptureButtonForApplet
 +
|-
 +
| 1000 ||
 +
|}
 +
 
 +
= OperationMode =
 +
This is "nn::oe::OperationMode".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0 || Handheld
 +
|-
 +
| 1 || Console
 +
|}
 +
 
 +
= PerformanceMode =
 +
This is "nn::oe::PerformanceMode".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| -1 || Invalid
 +
|-
 +
| 0 || Normal
 +
|-
 +
| 1 || Boost
 +
|}
 +
 
 +
= FocusState =
 +
This is "nn::oe::FocusState".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 1 || InFocus
 +
|-
 +
| 2 || OutOfFocus
 +
|-
 +
| 3 || Background
 +
|}
 +
 
 +
= CpuBoostMode =
 +
This is "nn::oe::CpuBoostMode".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0 || Normal
 +
|-
 +
| 1 || FastLoad
 +
|}
 +
 
 +
= WindowOriginMode =
 +
This is "nn::oe::WindowOriginMode".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0 || LowerLeft
 +
|-
 +
| 1 || UpperLeft
 +
|}
 +
 
 +
= WirelessPriorityMode =
 +
This is "nn::oe::WirelessPriorityMode".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0 || Default
 +
|-
 +
| 1 || OptimizedForWlan
 +
|}
 +
 
 +
= TvPowerStateMatchingMode =
 +
This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0 || Unknown
 +
|-
 +
| 1 || Unknown
 +
|}
 +
 
 +
= SystemButtonType =
 +
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 1 || PerformHomeButtonShortPressing
 +
|-
 +
| 2 || PerformHomeButtonLongPressing
 +
|-
 +
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
 +
|-
 +
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
 +
|-
 +
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].
 +
|-
 +
| 6 || PerformCaptureButtonShortPressing
 +
|-
 +
| 7 || PerformCaptureButtonLongPressing
 +
|}
 +
 
 +
= LaunchParameterKind =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 1 || UserChannel. Application-specific LaunchParameter.
 +
|-
 +
| 2 || account PreselectedUser
 +
|-
 +
| 3 || Unknown if used by anything?
 +
|}
 +
 
 +
= LibraryAppletExitReason =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0 || Normal
 +
|-
 +
| 1 || Canceled
 +
|-
 +
| 2 || Abnormal
 +
|-
 +
| 10 || Unexpected
 +
|}
 +
 
 +
= ProgramSpecifyKind =
 +
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0 || u8 ProgramIndex. "ExecuteProgram". [[NS_Services|NS]] handles ProgramIndex by launching ApplicationId+ProgramIndex. After using [[#ExecuteProgram]] with this successfully, official user-processes will enter an infinite loop with sleep-thread value 86400000000000.
 +
|-
 +
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
 +
|-
 +
| 2 || u64 = value 0. "RestartProgram"
 +
|}
 +
 
 +
ProgramIndex values where the title is not installed should not be used: [[qlaunch]] will display an error message and the current title will become "corrupted", however Home Menu will have an option to repair it.
 +
 
 +
= InputDetectionPolicy =
 +
This is u32 enum "nn::applet::InputDetectionPolicy".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 +
|-
 +
| 0 || Unknown
 +
|-
 +
| 1 || Unknown
 +
|}
 +
 
 +
= AppletResourceUserId =
 +
This is "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
 +
 
 +
= AppletAttribute =
 +
This is "nn::am::AppletAttribute". This struct is 0x80 bytes.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
 +
|-
 +
| 0x1 || 0x7F || Unused
 +
|}
 +
 
 +
This is used by [[#OpenLibraryAppletProxy]].
 +
 
 +
= AppletProcessLaunchReason =
 +
This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].
 +
|-
 +
| 0x1 || 0x2 || Always 0.
 +
|-
 +
| 0x3 || 0x1 || Always 0.
 +
|}
 +
 
 +
= LibraryAppletInfo =
 +
This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || [[#AppletId]]
 +
|-
 +
| 0x4 || 0x4 || [[#LibraryAppletMode]]
 +
|}
 +
 
 +
= AppletKind =
 +
This is "nn::am::service::AppletKind". This is 8-bytes.
 +
 
 +
= AppletIdentityInfo =
 +
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || [[#AppletId]]
 +
|-
 +
| 0x4 || 0x4 || Padding
 +
|-
 +
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
 +
|}
 +
 
 +
= ApplicationAttributeForQuest =
 +
This struct is "nn::applet::ApplicationAttributeForQuest".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
 +
|-
 +
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
 +
|-
 +
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
 +
|}
 +
 
 +
User-processes copy the first 0x8-bytes (0xC-bytes with [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]/[[#CreateApplicationWithAttributeAndRequestToStartForQuest]]) to a [[#ApplicationAttribute]] with the rest of the struct being cleared, which is then passed to the actual cmd (CreateApplication*ToStartForQuest).
 +
 
 +
= ApplicationAttribute =
 +
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
 +
|-
 +
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
 +
|-
 +
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
 +
|-
 +
| 0xC || 0x14 || Unused. Default is 0.
 +
|}
 +
 
 +
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
 +
 
 +
= ApplicationLaunchProperty =
 +
This struct is 0x10-bytes.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
 +
|-
 +
| 0x8 || 0x4 || Application title-version.
 +
|-
 +
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
 +
|-
 +
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
 +
|-
 +
| 0xE || 0x1 || Unknown.
 +
|-
 +
| 0xF || 0x1 || Padding.
 +
|}
 +
 
 +
= ApplicationLaunchRequestInfo =
 +
This is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
 +
|-
 +
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
 +
|-
 +
| 0x8 || 0x8 || Unknown. The default is 0x0.
 +
|}
 +
 
 +
= AppletResourceUsageInfo =
 +
This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || Unknown counter.
 +
|-
 +
| 0x4 || 0x4 || Unknown counter.
 +
|-
 +
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
 +
|-
 +
| 0xC || 0x14 || Always zero.
 +
|}
 +
 
 +
= ApplicationLicenseType =
 +
This is "nn::oe::ApplicationLicenseType". This is 1-byte.
 +
 
 +
= LaunchRequiredVersion =
 +
This is "nn::oe::LaunchRequiredVersion". This is a 0x40-byte struct with 1-byte alignment.
 +
 
 +
= ServerEnvironmentType =
 +
This is "nn::oe::ServerEnvironmentType".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value
 +
! Description
 
|-
 
|-
!  Value
+
| 0 || dd
!  Description
 
 
|-
 
|-
| 0 || u8 ProgramIndex. "ExecuteProgram". User-process enters an infinite svcSleepThread loop afterwards.
+
| 1 || lp
 
|-
 
|-
| 1 || u64 titleID. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
+
| 2 || sd
 
|-
 
|-
| 2 || u64 = value 0. "RestartProgram"
+
| 3 || sp
 
|-
 
|-
 +
| 4 || dp
 
|}
 
|}
  
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
+
= 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).
= AppletResourceUserId =
 
This u64 is officially called "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
 
 
 
= LibraryAppletInfo =
 
This struct is 8-bytes: +0 u32 is [[#AppletId]], +4 u32 is [[#LibraryAppletMode]].
 
 
 
= AppletKind =
 
This is "nn::am::service::AppletKind". This is 8-bytes.
 
 
 
= AppletIdentityInfo =
 
{| class="wikitable" border="1"
 
|-
 
! Offset || Size || Description
 
|-
 
| 0x0 || 0x4 || [[#AppletId]]
 
|-
 
| 0x4 || 0x4 || Padding
 
|-
 
| 0x8 || 0x8 || titleID
 
|}
 
 
 
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
 
 
 
= ApplicationAttributeForQuest =
 
{| class="wikitable" border="1"
 
|-
 
! Offset || Size || Description
 
|-
 
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
 
|-
 
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
 
|-
 
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
 
|}
 
 
 
This struct is "nn::applet::ApplicationAttributeForQuest".
 
 
 
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 =
+
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.
{| 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.
 
|}
 
 
 
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
 
 
 
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
 
 
 
= Notes =
 
AM-sysmodule will only initialize [[Shared_Database_services|pdm:ntfy]] / use pdm:ntfy service commands when the value from [[Process_Manager_services|pm:bm]] GetBootMode is not 0x1.
 
  
 
[[Category:Services]]
 
[[Category:Services]]

Latest revision as of 05:16, 26 October 2024

AM (Applet Manager) provides services for interacting with system applets while abstracting several aspects of power and operation management.

Contains multiple raw images, with at least the following: "NN_OMM_CHARGING_BIN_{begin|end}"(charging icon), low-battery icon, and the Nintendo Switch logo displayed during system boot.

appletAE

This is "nn::am::service::IAllSystemAppletProxiesService".

Cmd Name Notes
100 OpenSystemAppletProxy Returns an #ISystemAppletProxy.
200 OpenLibraryAppletProxyOld ([1.0.0-2.3.0] OpenLibraryAppletProxy) Returns an #ILibraryAppletProxy.
201 [3.0.0+] #OpenLibraryAppletProxy Returns an #ILibraryAppletProxy.
300 OpenOverlayAppletProxy Returns an #IOverlayAppletProxy.
350 OpenSystemApplicationProxy Returns an #IApplicationProxy.
400 #CreateSelfLibraryAppletCreatorForDevelop
410 [6.0.0+] #GetSystemAppletControllerForDebug
450 [19.0.0+] #GetSystemProcessCommonFunctions
1000 [6.0.0+] #GetDebugFunctions

All of these Open*Proxy commands except #OpenLibraryAppletProxy take the same input as #OpenApplicationProxy, with the same user-process retry-loop as #OpenApplicationProxy. These Open*Proxy commands (including appletOE) doesn't seem to usable from processes which aren't actual applets (such as sysmodules), at least for applet-types which aren't already in use.

OpenLibraryAppletProxyOld eventually calls the same func as #OpenLibraryAppletProxy, except that the #AppletAttribute is all-zero.

This service is used by all system non-regular-applications.

The 01000000000010XX system titles use the following applet types(above Open{type}Proxy commands):

  • "qlaunch": SystemApplet
  • "overlay": OverlayApplet
  • "starter": SystemApplication
  • "maintenance": SystemApplet
  • All others: LibraryApplet

OpenLibraryAppletProxy

Returns an #ILibraryAppletProxy.

Takes a reserved input u64(official user-processes use hard-coded value 0), a PID,a process copy-handle(cur-proc handle alias), and a type-0x15 input buffer containing an #AppletAttribute.

Official user-processes use the same retry loop with this as the other Open*Proxy commands.

CreateSelfLibraryAppletCreatorForDevelop

Takes a PID and an input u64 pid_placeholder, returns an #ILibraryAppletCreator.

The cached value loaded from Settings_services#GetDebugModeFlag must be 1, otherwise an error is returned.

The cached value loaded from system-setting am.debug!dev_function must be set to 0x1 with size 0x1, otherwise an error is returned.

GetSystemAppletControllerForDebug

No input, returns an #ISystemAppletControllerForDebug.

The cached value loaded from system-setting am.debug!dev_function 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

No input, returns an #IDebugFunctions.

The cached value loaded from system-setting am.debug!dev_function must be set to 0x1 with size 0x1, otherwise 0 is returned with no output interface.

ISystemAppletProxy

This is "nn::am::service::ISystemAppletProxy".

Cmd Name Notes
0 GetCommonStateGetter Returns an #ICommonStateGetter.
1 GetSelfController Returns an #ISelfController.
2 GetWindowController Returns an #IWindowController.
3 GetAudioController Returns an #IAudioController.
4 GetDisplayController Returns an #IDisplayController.
10 GetProcessWindingController Returns an #IProcessWindingController.
11 GetLibraryAppletCreator Returns an #ILibraryAppletCreator.
20 GetHomeMenuFunctions Returns an #IHomeMenuFunctions.
21 GetGlobalStateController Returns an #IGlobalStateController.
22 GetApplicationCreator Returns an #IApplicationCreator.
23 [7.0.0+] GetAppletCommonFunctions Returns an #IAppletCommonFunctions.
1000 GetDebugFunctions Returns an #IDebugFunctions.

IHomeMenuFunctions

This is "nn::am::service::IHomeMenuFunctions".

Cmd Name
10 #RequestToGetForeground
11 #LockForeground
12 #UnlockForeground
20 #PopFromGeneralChannel
21 #GetPopFromGeneralChannelEvent
30 #GetHomeButtonWriterLockAccessor
31 [2.0.0+] #GetWriterLockAccessorEx
40 [11.0.0+] #IsSleepEnabled
41 [12.0.0+] #IsRebootEnabled
50 [16.0.0+] #LaunchSystemApplet
51 [16.0.0+] #LaunchStarter
60 [19.0.0+]
61 [19.0.0+]
100 [6.0.0+] #PopRequestLaunchApplicationForDebug
110 [9.0.0+] #IsForceTerminateApplicationDisabledForDebug
200 [8.0.0+] #LaunchDevMenu
1000 [11.0.0+] #SetLastApplicationExitReason

RequestToGetForeground

No input/output.

LockForeground

No input/output.

UnlockForeground

No input/output.

PopFromGeneralChannel

No input, returns an output #IStorage.

GetPopFromGeneralChannelEvent

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

GetHomeButtonWriterLockAccessor

No input, returns an output #ILockAccessor.

Similar to using #GetWriterLockAccessorEx with inval=0.

GetWriterLockAccessorEx

Takes an input u32, returns an output #ILockAccessor.

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 LaunchSystemApplet, ignoring the u64 returned by that cmd (and other functionality).

LaunchStarter

No input/output.

This is similar to #LaunchSystemApplet, except this uses ns LaunchLibraryApplet with a ProgramId from global state.

The global state field is initialized elsewhere with the value of system-setting am.debug!starter_id, defaulting to ProgramId 0100000000001012 (starter) if not available.

PopRequestLaunchApplicationForDebug

Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output ApplicationId and an output s32 total_userIDs.

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

IsForceTerminateApplicationDisabledForDebug

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-setting am.debug!disable_force_terminate_application.

LaunchDevMenu

No input/output.

The cached value loaded from Settings_services#GetDebugModeFlag must be 1, otherwise an error is returned.

Uses ns LaunchDevMenu.

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

This is "nn::am::service::ILockAccessor".

Cmd Name
1 #TryLock
2 #Unlock
3 #GetEvent
4 [10.0.0+] #IsLocked
TryLock

Takes an input u8 bool flag, returns an output u8 bool flag and a handle.

Official sw waits on the previously loaded event from #GetEvent. The output flag indicates whether locking was successful, the user-process can try using this cmd again when flag=false.

Official sw only uses inflag=false. Official sw just closes the output handle. The input flag controls whether this returns the output handle.

Unlock

No input/output.

GetEvent

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

IsLocked

No input, returns an output u8 bool.

IGlobalStateController

This is "nn::am::service::IGlobalStateController".

Cmd Name
0 #RequestToEnterSleep
1 #EnterSleep
2 #StartSleepSequence
3 #StartShutdownSequence
4 #StartRebootSequence
9 [7.0.0+] #IsAutoPowerDownRequested
10 #LoadAndApplyIdlePolicySettings
11 [2.0.0+] #NotifyCecSettingsChanged
12 [3.0.0+] #SetDefaultHomeButtonLongPressTime
13 [3.0.0+] #UpdateDefaultDisplayResolution
14 [3.0.0+] #ShouldSleepOnBoot
15 [4.0.0+] #GetHdcpAuthenticationFailedEvent
30 [12.0.0+] #OpenCradleFirmwareUpdater

RequestToEnterSleep

No input/output.

Stubbed, just returns an error.

EnterSleep

No input/output.

Stubbed, just returns an error.

StartSleepSequence

Takes an input u8 bool, no output.

Official sw uses hard-coded input value = 1.

StartShutdownSequence

No input/output.

StartRebootSequence

No input/output.

IsAutoPowerDownRequested

No input, returns an output u8 bool.

Uses #idle:sys cmd1.

LoadAndApplyIdlePolicySettings

No input/output.

Uses #idle:sys cmd LoadAndApplySettings.

NotifyCecSettingsChanged

No input/output.

Uses #omm cmd NotifyCecSettingsChanged.

SetDefaultHomeButtonLongPressTime

Takes an input s64, no output.

UpdateDefaultDisplayResolution

No input/output.

Uses #omm cmd UpdateDefaultDisplayResolution.

ShouldSleepOnBoot

No input, returns an output u8 bool.

Uses #omm cmd ShouldSleepOnBoot.

GetHdcpAuthenticationFailedEvent

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

Uses #omm cmd GetHdcpAuthenticationFailedEvent.

OpenCradleFirmwareUpdater

No input, returns an #ICradleFirmwareUpdater.

ICradleFirmwareUpdater

This is "nn::am::service::ICradleFirmwareUpdater".

This was added with [12.0.0+].

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

This is "nn::am::service::IApplicationCreator".

Cmd Name
0 #CreateApplication
1 #PopLaunchRequestedApplication
10 #CreateSystemApplication
100 #PopFloatingApplicationForDevelopment

#CreateApplication/#CreateSystemApplication eventually call the same internal func. With #CreateApplication, two ptrs passed to the internal func are NULL, while with #CreateSystemApplication these are loaded from state. The initial content of #ApplicationLaunchRequestInfo is all-zero with #CreateSystemApplication, while with #CreateApplication the first two u32s are value 0x3 with the rest all-zero. The #AppletId is set to 0x01 with #CreateApplication, while with #CreateSystemApplication it's 0x04.

CreateApplication

Takes an input ApplicationId, returns an #IApplicationAccessor.

PopLaunchRequestedApplication

No input, returns an #IApplicationAccessor.

CreateSystemApplication

Takes an input SystemApplicationId, returns an #IApplicationAccessor.

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

PopFloatingApplicationForDevelopment

No input, returns an #IApplicationAccessor.

Should not be used if no FloatingApplication is available (svcBreak).

IApplicationAccessor

This is "nn::am::service::IApplicationAccessor".

Cmd Name Notes
0 #GetAppletStateChangedEvent
1 #IsCompleted
10 #Start
20 #RequestExit
25 #Terminate
30 #GetResult
101 #RequestForApplicationToGetForeground
110 #TerminateAllLibraryApplets
111 #AreAnyLibraryAppletsLeft
112 #GetCurrentLibraryApplet
120 #GetApplicationId
121 #PushLaunchParameter
122 #GetApplicationControlProperty
123 [2.0.0+] #GetApplicationLaunchProperty
124 [6.0.0+] #GetApplicationLaunchRequestInfo
130 [6.0.0+] #SetUsers
131 [6.0.0+] #CheckRightsEnvironmentAvailable
132 [6.0.0+] #GetNsRightsEnvironmentHandle
140 [6.0.0+] #GetDesirableUids
150 [6.0.0+] #ReportApplicationExitTimeout
160 [8.0.0+] #SetApplicationAttribute
170 [8.0.0+] #HasSaveDataAccessPermission
180 [9.0.0+] #PushToFriendInvitationStorageChannel
190 [9.0.0+] #PushToNotificationStorageChannel
200 [10.0.0+] #RequestApplicationSoftReset
201 [10.0.0+] #RestartApplicationTimer

Commands <=30 are inherited from #IAppletAccessor.

RequestForApplicationToGetForeground

No input/output.

GetCurrentLibraryApplet

No input, returns an output #IAppletAccessor.

GetApplicationId

No input, returns an output ApplicationId.

PushLaunchParameter

Takes an input u32 #LaunchParameterKind and an input #IStorage, no output.

GetApplicationControlProperty

No input, takes a type-0x6 output buffer.

The output buffer must be at least 0x4000-bytes. Returns an error when the #AppletId is 0x04, aka when the IApplicationAccessor is for a SystemApplication.

This gets the application control.nacp.

GetApplicationLaunchProperty

Takes a type-0x6 output buffer.

The output buffer size must be at least 0x10-bytes. Returns an error when the #AppletId is 0x04, aka when the IApplicationAccessor is for a SystemApplication.

This gets the #ApplicationLaunchProperty.

GetApplicationLaunchRequestInfo

No input, returns an output 0x10-byte struct.

This gets the #ApplicationLaunchRequestInfo from state. The output struct is "nn::applet::ApplicationLaunchRequestInfo".

SetUsers

Takes an input u8 bool flag and a type-0x5 input buffer containing an array of u128 userIDs.

The total entries for the userIDs must be <=8.

When the input flag is true, this just clears the users_available state flag to 0 and returns.

CheckRightsEnvironmentAvailable

No input, returns an output u8 bool.

GetNsRightsEnvironmentHandle

No input, returns an output u64.

GetDesirableUids

Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output s32 total_entries.

Gets a userID listing, this is unrelated to #SetUsers. qlaunch only uses 1 userID with this.

The stored entry-count in state must be <= <size of output buffer in entries>.

ReportApplicationExitTimeout

No input/output.

SetApplicationAttribute

Takes a type-0x15 input buffer containing an #ApplicationAttribute, no output.

HasSaveDataAccessPermission

Takes an input 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.

Clears the FriendInvitation StorageChannel, then pushes the input storage there.

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 Notification ApplicationParameter.

RequestApplicationSoftReset

No input/output.

RestartApplicationTimer

No input/output.

IAppletAccessor

This is "nn::am::service::IAppletAccessor".

Cmd Name
0 #GetAppletStateChangedEvent
1 #IsCompleted
10 #Start
20 #RequestExit
25 #Terminate
30 #GetResult

GetAppletStateChangedEvent

No input, returns an output event handle with autoclear=false.

IsCompleted

No input, returns an output u8 bool.

Start

No input/output.

RequestExit

No input/output.

Terminate

No input/output.

GetResult

No input/output.

IAppletCommonFunctions

This is "nn::am::service::IAppletCommonFunctions".

This was added with [7.0.0+].

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
320 [19.0.0+] SetGpuTimeSliceBoost
321 [19.0.0+] SetGpuTimeSliceBoostDueToApplication
330 [19.0.0+]

ReadThemeStorage/WriteThemeStorage: these commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes. The default content of the ThemeStorage prior to using the WriteThemeStorage cmd, is: memset(statebuf, 0xAA, 0x400);

ReadThemeStorage

Takes an input u64 offset and a type-0x22 output buffer, returns an output u64 actual_transfer_size.

WriteThemeStorage

Takes an input u64 offset and a type-0x21 input buffer, no output.

PushToAppletBoundChannel

Takes an input #IStorage, no output.

This is similar to #PushToAppletBoundChannelForDebug (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.

TryPopFromAppletBoundChannel

No input, returns an output #IStorage.

This is similar to #TryPopFromAppletBoundChannelForDebug (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.

GetDisplayLogicalResolution

No input, returns an output s32 width and s32 height.

SetDisplayMagnification

Takes an input float x, float y, float width, and float height, no output.

Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.

x and width are multiplied with the same width value returned by #GetDisplayLogicalResolution, so these should be in the range 0.0f-1.0f. Likewise for y and height, except these are multipled with the height value.

SetHomeButtonDoubleClickEnabled

Takes an input u8 bool, no output.

GetHomeButtonDoubleClickEnabled

No input, returns an output u8 bool.

IsHomeButtonShortPressedBlocked

No input, returns an output u8 bool.

IsVrModeCurtainRequired

No input, returns an output bool.

SetCpuBoostRequestPriority

Takes an input s32, no output.

ILibraryAppletProxy

This is "nn::am::service::ILibraryAppletProxy".

Cmd Name Notes
0 GetCommonStateGetter Returns an #ICommonStateGetter.
1 GetSelfController Returns an #ISelfController.
2 GetWindowController Returns an #IWindowController.
3 GetAudioController Returns an #IAudioController.
4 GetDisplayController Returns an #IDisplayController.
10 GetProcessWindingController Returns an #IProcessWindingController.
11 GetLibraryAppletCreator Returns an #ILibraryAppletCreator.
20 OpenLibraryAppletSelfAccessor Returns an #ILibraryAppletSelfAccessor.
21 [7.0.0+] GetAppletCommonFunctions No input, returns an #IAppletCommonFunctions.
22 [15.0.0+] GetHomeMenuFunctions No input, returns an #IHomeMenuFunctions.
23 [15.0.0+] GetGlobalStateController No input, returns an #IGlobalStateController.
1000 GetDebugFunctions Returns an #IDebugFunctions.

ILibraryAppletSelfAccessor

This is "nn::am::service::ILibraryAppletSelfAccessor".

Cmd Name Notes
0 #PopInData
1 #PushOutData
2 #PopInteractiveInData
3 #PushInteractiveOutData
5 #GetPopInDataEvent
6 #GetPopInteractiveInDataEvent
10 #ExitProcessAndReturn
11 #GetLibraryAppletInfo
12 #GetMainAppletIdentityInfo
13 #CanUseApplicationCore
14 #GetCallerAppletIdentityInfo
15 [2.0.0+] #GetMainAppletApplicationControlProperty
16 [2.0.0+] #GetMainAppletStorageId
17 [3.0.0+] #GetCallerAppletIdentityInfoStack
18 [4.0.0+] #GetNextReturnDestinationAppletIdentityInfo
19 [4.0.0+] #GetDesirableKeyboardLayout
20 #PopExtraStorage
25 #GetPopExtraStorageEvent
30 #UnpopInData
31 #UnpopExtraStorage
40 [2.0.0+] #GetIndirectLayerProducerHandle
50 [3.0.0+] #ReportVisibleError
51 [4.0.0+] #ReportVisibleErrorWithErrorContext
60 [4.0.0+] #GetMainAppletApplicationDesiredLanguage
70 [8.0.0+] #GetCurrentApplicationId
80 [6.0.0+] #RequestExitToSelf
90 [5.0.0+] #CreateApplicationAndPushAndRequestToLaunch
100 [4.0.0+] #CreateGameMovieTrimmer
101 [5.0.0+] #ReserveResourceForMovieOperation
102 [5.0.0+] #UnreserveResourceForMovieOperation
110 [6.0.0+] #GetMainAppletAvailableUsers
120 [9.0.0+] #GetLaunchStorageInfoForDebug
130 [9.0.0+] #GetGpuErrorDetectedSystemEvent
140 [10.0.0+] #SetApplicationMemoryReservation
150 [10.0.0+] #ShouldSetGpuTimeSliceManually
160 [17.0.0+] #GetLibraryAppletInfoEx

PopInData

No input, returns an output #IStorage.

PushOutData

Takes an input #IStorage, no output.

PopInteractiveInData

No input, returns an output #IStorage.

PushInteractiveOutData

Takes an input #IStorage, no output.

GetPopInDataEvent

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

GetPopInteractiveInDataEvent

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

ExitProcessAndReturn

No input/output.

Exits the LibraryApplet and returns to running the title which launched this LibraryApplet (qlaunch for example).

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

GetLibraryAppletInfo

No input, returns an output #LibraryAppletInfo.

GetMainAppletIdentityInfo

No input, returns an output #AppletIdentityInfo.

CanUseApplicationCore

No input, returns an output u8 bool.

GetCallerAppletIdentityInfo

No input, returns an output #AppletIdentityInfo.

GetMainAppletApplicationControlProperty

No input, takes a type-0x16 output buffer.

This gets the control.nacp.

GetMainAppletStorageId

No input, returns an output u8 storageId.

GetCallerAppletIdentityInfoStack

Takes a type-0x6 output buffer containing an array of #AppletIdentityInfo, and returns an output s32 total_entries.

GetNextReturnDestinationAppletIdentityInfo

No input, returns an output #AppletIdentityInfo.

GetDesirableKeyboardLayout

No input, returns an output u32.

The output u32 is "nn::settings::KeyboardLayout".

This gets the value previously set by #SetDesirableKeyboardLayout. An error is returned if it's not set.

PopExtraStorage

No input, returns an output #IStorage.

GetPopExtraStorageEvent

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

UnpopInData

Takes an input #IStorage, no output.

UnpopExtraStorage

Takes an input #IStorage, no output.

GetIndirectLayerProducerHandle

No input, returns an output u64.

ReportVisibleError

Takes an input ErrorCode, no output.

ReportVisibleErrorWithErrorContext

Takes an input ErrorCode and a type-0x15 input buffer containing an ErrorContext, no output.

GetMainAppletApplicationDesiredLanguage

No input, returns an output LanguageCode.

GetCurrentApplicationId

No input, returns an output ApplicationId.

Gets the ApplicationId for the currently running Application. ApplicationId=0 when no Application is running.

RequestExitToSelf

No input/output.

Same as #RequestExit except this is for the current applet.

CreateApplicationAndPushAndRequestToLaunch

Takes an input ApplicationId and an input #IStorage, no output.

This is is similar to #CreateApplicationAndPushAndRequestToStart.

CreateGameMovieTrimmer

Takes an input u64 size and a TransferMemory handle, returns a GRC IGameMovieTrimmer.

This is a wrapper for GRC OpenGameMovieTrimmer.

Official sw uses an user-buffer for the tmem, with permissions=0.

ReserveResourceForMovieOperation

No input/output.

Updates state fields. This must be used before #CreateGameMovieTrimmer.

UnreserveResourceForMovieOperation

No input/output.

Updates state fields. This must be used once finished with IGameMovieTrimmer.

GetMainAppletAvailableUsers

Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 total_entries.

This gets the userIDs previously set by #SetUsers.

The size of the output buffer in entries must be at least 8.

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

SetApplicationMemoryReservation

Takes an input u64, no output.

An Application must be currently running. The input u64 must be 0x1000-byte aligned.

ShouldSetGpuTimeSliceManually

No input, returns an output u8 bool.

GetLibraryAppletInfoEx

No input, returns an output u64. Currently always returns 0.

IOverlayAppletProxy

This is "nn::am::service::IOverlayAppletProxy".

Cmd Name Notes
0 GetCommonStateGetter Returns an #ICommonStateGetter.
1 GetSelfController Returns an #ISelfController.
2 GetWindowController Returns an #IWindowController.
3 GetAudioController Returns an #IAudioController.
4 GetDisplayController Returns an #IDisplayController.
10 GetProcessWindingController Returns an #IProcessWindingController.
11 GetLibraryAppletCreator Returns an #ILibraryAppletCreator.
20 GetOverlayFunctions Returns an #IOverlayFunctions.
21 [7.0.0+] GetAppletCommonFunctions No input, returns an #IAppletCommonFunctions.
23 [15.0.0+] GetGlobalStateController No input, returns an #IGlobalStateController.
1000 GetDebugFunctions Returns an #IDebugFunctions.

IOverlayFunctions

This is "nn::am::service::IOverlayFunctions".

Cmd Name
0 #BeginToWatchShortHomeButtonMessage
1 #EndToWatchShortHomeButtonMessage
2 #GetApplicationIdForLogo
3 #SetGpuTimeSliceBoost
4 [2.0.0+] #SetAutoSleepTimeAndDimmingTimeEnabled
5 [2.0.0+] #TerminateApplicationAndSetReason
6 [3.0.0+] #SetScreenShotPermissionGlobally
10 [6.0.0+] #StartShutdownSequenceForOverlay
11 [6.0.0+] #StartRebootSequenceForOverlay
20 [8.0.0+] #SetHandlingHomeButtonShortPressedEnabled
21 [14.0.0+] SetHandlingTouchScreenInputEnabled
30 [9.0.0+] #SetHealthWarningShowingState
31 [10.0.0+] #IsHealthWarningRequired
40 [18.0.0+] GetApplicationNintendoLogo
41 [18.0.0+] GetApplicationStartupMovie
50 [19.0.0+] SetGpuTimeSliceBoostForApplication
60 [19.0.0+]
90 [7.0.0+] #SetRequiresGpuResourceUse
101 [5.0.0+] #BeginToObserveHidInputForDevelop

BeginToWatchShortHomeButtonMessage

No input/output.

EndToWatchShortHomeButtonMessage

No input/output.

No input, returns an output ApplicationId.

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

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

SetGpuTimeSliceBoost

Takes an input u64, no output.

SetAutoSleepTimeAndDimmingTimeEnabled

Takes an input u8 bool, no output.

TerminateApplicationAndSetReason

Takes an input u32 Result, no output.

SetScreenShotPermissionGlobally

Takes an input u8 bool, no output.

StartShutdownSequenceForOverlay

No input/output.

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

StartRebootSequenceForOverlay

No input/output.

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

SetHandlingHomeButtonShortPressedEnabled

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

Takes an input u8 bool, no output.

Just returns 0.

BeginToObserveHidInputForDevelop

No input/output.

Sets various state fields and signals an userspace-event.

Enables HID input for the OverlayApplet, without disabling input for the foreground applet.

IApplicationProxy

This is "nn::am::service::IApplicationProxy".

Cmd Name Notes
0 GetCommonStateGetter Returns an #ICommonStateGetter.
1 GetSelfController Returns an #ISelfController.
2 GetWindowController Returns an #IWindowController.
3 GetAudioController Returns an #IAudioController.
4 GetDisplayController Returns an #IDisplayController.
10 GetProcessWindingController Returns an #IProcessWindingController.
11 GetLibraryAppletCreator Returns an #ILibraryAppletCreator.
20 GetApplicationFunctions Returns an #IApplicationFunctions.
1000 GetDebugFunctions Returns an #IDebugFunctions.

IApplicationFunctions

This is "nn::am::service::IApplicationFunctions".

Cmd Name
1 #PopLaunchParameter
10 #CreateApplicationAndPushAndRequestToStart
11 [3.0.0+] #CreateApplicationAndPushAndRequestToStartForQuest
12 [4.0.0+] #CreateApplicationAndRequestToStart
13 [4.0.0+] #CreateApplicationAndRequestToStartForQuest
14 [7.0.0+] #CreateApplicationWithAttributeAndPushAndRequestToStartForQuest
15 [7.0.0+] #CreateApplicationWithAttributeAndRequestToStartForQuest
20 #EnsureSaveData
21 #GetDesiredLanguage
22 #SetTerminateResult
23 #GetDisplayVersion
24 [2.0.0+] #GetLaunchStorageInfoForDebug
25 [3.0.0+] ExtendSaveData
26 [3.0.0+] GetSaveDataSize
27 [5.0.0+] CreateCacheStorage
28 [11.0.0+] #GetSaveDataSizeMax
29 [11.0.0+] #GetCacheStorageMax
30 #BeginBlockingHomeButtonShortAndLongPressed
31 #EndBlockingHomeButtonShortAndLongPressed
32 #BeginBlockingHomeButton
33 #EndBlockingHomeButton
34 [10.0.0-15.0.1] #SelectApplicationLicense
35 [11.0.0+] #GetDeviceSaveDataSizeMax
36 [14.0.0+] GetLimitedApplicationLicense
37 [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
40 #NotifyRunning
50 [2.0.0+] #GetPseudoDeviceId
60 [2.0.0+] #SetMediaPlaybackStateForApplication
65 [3.0.0+] #IsGamePlayRecordingSupported
66 [3.0.0+] #InitializeGamePlayRecording
67 [3.0.0+] #SetGamePlayRecordingState
68 [4.0.0+] #RequestFlushGamePlayingMovieForDebug
70 [3.0.0+] #RequestToShutdown
71 [3.0.0+] #RequestToReboot
72 [10.0.0+] #RequestToSleep
80 [4.0.0+] #ExitAndRequestToShowThanksMessage
90 [4.0.0+] #EnableApplicationCrashReport
100 [5.0.0+] #InitializeApplicationCopyrightFrameBuffer
101 [5.0.0+] #SetApplicationCopyrightImage
102 [5.0.0+] #SetApplicationCopyrightVisibility
110 [5.0.0+] #QueryApplicationPlayStatistics
111 [6.0.0+] #QueryApplicationPlayStatisticsByUid
120 [5.0.0+] #ExecuteProgram
121 [5.0.0+] #ClearUserChannel
122 [5.0.0+] #UnpopToUserChannel
123 [5.0.0+] #GetPreviousProgramIndex
124 [6.0.0+] #EnableApplicationAllThreadDumpOnCrash
130 [8.0.0+] #GetGpuErrorDetectedSystemEvent
131 [11.0.0+] #SetDelayTimeToAbortOnGpuError
140 [9.0.0+] #GetFriendInvitationStorageChannelEvent
141 [9.0.0+] #TryPopFromFriendInvitationStorageChannel
150 [9.0.0+] #GetNotificationStorageChannelEvent
151 [9.0.0+] #TryPopFromNotificationStorageChannel
160 [9.0.0+] #GetHealthWarningDisappearedSystemEvent
170 [9.0.0+] #SetHdcpAuthenticationActivated
180 [10.1.0+] #GetLaunchRequiredVersion
181 [10.1.0+] #UpgradeLaunchRequiredVersion
190 [11.0.0+] #SendServerMaintenanceOverlayNotification
200 [11.0.0+] #GetLastApplicationExitReason
300 [19.0.0+] #CreateMovieWriter
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):

This GamePlayRecording functionality presumably enables the video-recording usable starting with 4.0.0.

PopLaunchParameter

Takes an input u32 #LaunchParameterKind, returns an output #IStorage.

Pops a LaunchParameter #IStorage, the storage will be removed from sysmodule state during this.

CreateApplicationAndPushAndRequestToStart

Takes an input ApplicationId and an input #IStorage, no output. ApplicationId=0 can be used to relaunch the current application.

CreateApplicationAndPushAndRequestToStartForQuest

Takes 2 input u32s (loaded from struct #ApplicationAttributeForQuest), an input ApplicationId, and an input #IStorage, no output.

CreateApplicationAndRequestToStart

Takes an input ApplicationId, no output.

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

CreateApplicationAndRequestToStartForQuest

Takes 2 input u32s (loaded from struct #ApplicationAttributeForQuest) and an input ApplicationId, no output.

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

CreateApplicationWithAttributeAndPushAndRequestToStartForQuest

Takes an input 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.

CreateApplicationWithAttributeAndRequestToStartForQuest

Takes an input 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.

EnsureSaveData

Takes an input u128 userID, returns an output u64 size.

Calls sdk func nn::fs::EnsureApplicationSaveData. qlaunch also calls this same sdk func directly.

Creates the various savedata as specified by the application control.nacp when the savedata doesn't exist.

Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.

GetDesiredLanguage

No input, returns an output LanguageCode.

SetTerminateResult

Takes an input u32 Result, no output.

For example, in some cases official apps use this with error 0x2A2 then uses svcBreak.

GetDisplayVersion

No input, returns an output 0x10-byte struct.

The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application control.nacp, this is always NUL-terminated.

GetLaunchStorageInfoForDebug

No input, returns an output u8 StorageId and u8 StorageId.

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

Takes an input s64, no output.

Official user-processes use hard-coded value 0 for the s64.

Starts blocking the Home button.

EndBlockingHomeButtonShortAndLongPressed

No input/output.

Ends the blocking started by #BeginBlockingHomeButtonShortAndLongPressed.

BeginBlockingHomeButton

Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.

EndBlockingHomeButton

No input/output.

SelectApplicationLicense

Takes an input array of #ApplicationLicenseType, returns an output #ApplicationLicenseType.

GetDeviceSaveDataSizeMax

No input, returns two output s64s.

NotifyRunning

Takes no input. Returns an output u8 bool, which is ignored by official user-processes.

GetPseudoDeviceId

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

The 0x20-byte output data from GetSystemSeedForPseudoDeviceId followed by the 8-byte SeedForPseudoDeviceId from the current control.nacp, is hashed with SHA1. Then "nn::util::GenerateUuidVersion5" is called with the final hash, the output from this is then returned for the Uuid.

SetMediaPlaybackStateForApplication

Takes an input u8 bool, no output.

IsGamePlayRecordingSupported

No input, returns an output u8 bool.

InitializeGamePlayRecording

Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.

SetGamePlayRecordingState

Takes an input u32. 0 = disable/pause, 1 = enable/restart.

RequestFlushGamePlayingMovieForDebug

No input/output.

Requests to save the video recording, as if the Capture-button was held.

RequestToShutdown

No input/output.

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

RequestToReboot

No input/output.

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

RequestToSleep

No input/output.

ExitAndRequestToShowThanksMessage

No input/output.

Used to exit the application and return to the kiosk menu. Official sw uses #UnlockExit immediately before this if needed.

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

This throws an error when the cached Settings_services#GetQuestFlag value is 0.

EnableApplicationCrashReport

Takes an input u8 bool, no output.

InitializeApplicationCopyrightFrameBuffer

Takes an input TransferMemory handle, an s32 width, an s32 height, an u64 tmem_size, and no output.

tmem_size must be 0x40000-byte aligned. width must be 1-1280, and height must be 1-720.

User-processes create the tmem with an user-specified buffer with permissions=0. width = 1280 and height = 720.

After the validation checks pass the input is passed to ommdisp cmd500.

This is used as an overlay for screenshots.

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.

x and y must not have the negative bit set. width and height must not be <1.

Sets the RGBA8 image for use with #InitializeApplicationCopyrightFrameBuffer. Overrides the current image, if this was already used previously.

SetApplicationCopyrightVisibility

Takes an input u8 bool, no output.

Sets the visibility for the image set by #SetApplicationCopyrightImage, in screenshots. By default it's visible.

QueryApplicationPlayStatistics

Takes a type-0x6 output buffer containing an array of ApplicationPlayStatistics and a type-0x5 input buffer containing an array of ApplicationId. Returns an output s32 for actual total output entries.

The number of entries in each array is the same.

See also PlayLogQueryCapability.

This uses pdm:qry QueryApplicationPlayStatisticsForSystem.

QueryApplicationPlayStatisticsByUid

Takes a u128 userID, a type-0x6 output buffer containing an array of ApplicationPlayStatistics and a type-0x5 input buffer containing an array of ApplicationId. Returns an output s32 for actual total output entries.

Same as #QueryApplicationPlayStatistics except this uses pdm:qry cmd16, to get playstats specific to userIDs.

ExecuteProgram

Takes an input u32 #ProgramSpecifyKind and an input u64, no output.

ClearUserChannel

No input/output.

Clears the UserChannel used by #UnpopToUserChannel.

UnpopToUserChannel

Takes an input #IStorage, no output.

The input storage is pushed to the UserChannel. This is the same channel used by #LaunchParameterKind value 1.

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

GetPreviousProgramIndex

No input, returns an output s32.

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

EnableApplicationAllThreadDumpOnCrash

Takes an input u8 bool, no output.

GetGpuErrorDetectedSystemEvent

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

This is used by sdknso during applet-application initialization. A separate thread is setup where event-waiting is handled. When the Event is signaled, official sw will Abort.

SetDelayTimeToAbortOnGpuError

Takes an input s64 "nn::TimeSpan", no output.

GetFriendInvitationStorageChannelEvent

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

This is exposed by sdknso under nn::friends::. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.

TryPopFromFriendInvitationStorageChannel

No input, returns an output #IStorage.

This uses the same StorageChannel as #PushToFriendInvitationStorageChannel.

This is exposed by sdknso under nn::friends::. When the storage_size is <0x10, this returns false. data_size = storage_size-0x10; 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 size = data_size > buf_size ? buf_size : data_size. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned.

GetNotificationStorageChannelEvent

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

This is exposed by sdknso under nn::notification::. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.

TryPopFromNotificationStorageChannel

No input, returns an output #IStorage.

This uses the same StorageChannel as #PushToNotificationStorageChannel.

This is exposed by sdknso under nn::notification::. The storage is read into the specified output buffer, where the size is size = storage_size > buf_size ? buf_size : storage_size. Reading is skipped if size is zero. Afterwards the used size is written to an output param.

GetHealthWarningDisappearedSystemEvent

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

SetHdcpAuthenticationActivated

Takes an input u8 bool, no output.

GetLaunchRequiredVersion

Takes an input ApplicationId, an u64, returns an output #LaunchRequiredVersion.

sdknso passes hard-coded value 0 for the u64.

UpgradeLaunchRequiredVersion

Takes an input #LaunchRequiredVersion, an ApplicationId, an u64, no output.

sdknso passes hard-coded value 0 for the u64.

SendServerMaintenanceOverlayNotification

Takes two input 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 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.

The cached value loaded from system-setting am.debug!dev_function must be set to 0x1 with size 0x1, otherwise an error is returned.

CreateMovieMaker

Takes an input u64 size and a TransferMemory handle, returns an #IMovieMaker.

Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.

Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.

PrepareForJit

Takes no input. Launches the jit-sysmodule via ns LaunchLibraryApplet if it has not already been launched for the current application, storing a std::shared_ptr<> for jit-sysmodule process tracking object as an IApplicationFunctions member.

~IApplicationFunctions() includes:

   if (this->jit_process) {
       Terminate(this->jit_process);
       this->jit_process = nullptr;
   }

Thus the lifetime of the jit sysmodule is tied to the application which uses it, and each application gets its own fresh copy of the jit sysmodule.

AM can also optionally launch jit-sysmodule automatically if the NACP enables it.

IMovieWriter

This is "nn::am::service::IMovieWriter".

This was added with [19.0.0+].

Cmd Name
0

Cmd0

No input. Returns a GRC IMovieWriter.

IMovieMaker

This is "nn::am::service::IMovieMaker".

Cmd Name
0 #GetGrcMovieMaker
1 #GetLayerHandle

GetGrcMovieMaker

No input, returns a GRC IMovieMaker.

GetLayerHandle

No input, returns an output u64.

ILibraryAppletCreator

This is "nn::am::service::ILibraryAppletCreator".

Cmd Name Notes
0 #CreateLibraryApplet
1 #TerminateAllLibraryApplets
2 #AreAnyLibraryAppletsLeft
10 #CreateStorage
11 #CreateTransferMemoryStorage
12 [2.0.0+] #CreateHandleStorage

CreateLibraryApplet

Takes 2 input u32s #AppletId and #LibraryAppletMode, returns an #ILibraryAppletAccessor.

TerminateAllLibraryApplets

No input/output.

Stubbed with an ILibraryAppletCreator from #CreateSelfLibraryAppletCreatorForDevelop, just returns an error.

Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the #IApplicationAccessor cmd).

AreAnyLibraryAppletsLeft

No input, returns an output u8 bool.

Stubbed with an ILibraryAppletCreator from #CreateSelfLibraryAppletCreatorForDevelop, just returns an error.

Gets whether any LibraryApplets (#ILibraryAppletAccessor) which were created by the current applet are still open (or by the Application when used from the #IApplicationAccessor cmd).

CreateStorage

Takes an input s64 for the storage size, returns an #IStorage.

This allocates a buffer with the specified size which can then be accessed via #IStorageAccessor.

CreateTransferMemoryStorage

Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an #IStorage.

The user-process creates the TransferMemory with permissions=0.

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

CreateHandleStorage

Takes an input copy-handle and an input s64, returns an #IStorage. In some cases the s64 must not have the negative bit set.

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

ILibraryAppletAccessor

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

Cmd Name Notes
0 #GetAppletStateChangedEvent
1 #IsCompleted
10 #Start
20 #RequestExit
25 #Terminate
30 #GetResult
50 #SetOutOfFocusApplicationSuspendingEnabled
60 [10.0.0+] #PresetLibraryAppletGpuTimeSliceZero
80 [19.0.0+] RequestForLibraryAppletToGetForeground
81 [19.0.0+] GetCurrentChildLibraryApplet
100 #PushInData
101 #PopOutData
102 #PushExtraStorage
103 #PushInteractiveInData
104 #PopInteractiveOutData
105 #GetPopOutDataEvent
106 #GetPopInteractiveOutDataEvent
110 #NeedsToExitProcess
120 #GetLibraryAppletInfo
150 #RequestForAppletToGetForeground
160 [2.0.0+] #GetIndirectLayerConsumerHandle

Commands <=30 are inherited from #IAppletAccessor. GetLibraryAppletInfo is identical to the #ILibraryAppletSelfAccessor cmd.

SetOutOfFocusApplicationSuspendingEnabled

Takes an input u8 bool, no output.

Official sw will assert prior to using this if applet-service was not initialized as *Application.

PresetLibraryAppletGpuTimeSliceZero

No input/output.

sdknso only uses with with swkbd-inline, immediately after creating the LibraryApplet.

PushInData

Takes an input #IStorage, no output.

PopOutData

No input, returns an output #IStorage.

PushExtraStorage

Takes an input #IStorage, no output.

PushInteractiveInData

Takes an input #IStorage, no output.

PopInteractiveOutData

No input, returns an output #IStorage.

GetPopOutDataEvent

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

GetPopInteractiveOutDataEvent

No input, returns an output event handle with autoclear=false.

NeedsToExitProcess

No input, returns an output u8 bool.

Stubbed, just returns an error.

RequestForAppletToGetForeground

No input/output.

Stubbed, just returns an error.

GetIndirectLayerConsumerHandle

Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.

Official sw uses this during LibraryApplet creation when #LibraryAppletMode is 0x3.

ICommonStateGetter

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

Cmd Name
0 #GetEventHandle
1 #ReceiveMessage
2 #GetThisAppletKind
3 #AllowToEnterSleep
4 #DisallowToEnterSleep
5 #GetOperationMode
6 #GetPerformanceMode
7 #GetCradleStatus
8 #GetBootMode
9 #GetCurrentFocusState
10 #RequestToAcquireSleepLock
11 #ReleaseSleepLock
12 #ReleaseSleepLockTransiently
13 #GetAcquiredSleepLockEvent
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 [17.0.0-18.1.0] OpenNamedChannelAsChild
900 [11.0.0+] #SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled
910 [17.0.0+] GetLaunchRequiredTick
1000 [19.0.0+] BeginVrMode3d
1001 [19.0.0+] EndVrMode3d
1002 [19.0.0+] IsVrModeEnabled3d

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

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

GetEventHandle

No input. Returns an output event handle. This is signalled when a message is available with #ReceiveMessage.

ReceiveMessage

No input. Returns an output #AppletMessage. Error 0x680 indicates no message is available.

GetThisAppletKind

No input, returns an output #AppletKind.

Stubbed, just returns an error.

AllowToEnterSleep

No input/output.

Stubbed, just returns an error.

DisallowToEnterSleep

No input/output.

Stubbed, just returns an error.

GetOperationMode

No input. Returns an output u8 for the current #OperationMode.

GetPerformanceMode

No input. Returns an output u32 for the current #PerformanceMode.

GetCradleStatus

No input, returns an output u8.

This uses #omm GetCradleStatus.

GetBootMode

No input, returns an output u8.

Returns the value from pm:bm GetBootMode.

GetCurrentFocusState

No input. Returns an output u8 #FocusState.

RequestToAcquireSleepLock

No input/output.

ReleaseSleepLock

No input/output.

ReleaseSleepLockTransiently

No input/output.

GetAcquiredSleepLockEvent

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

GetWakeupCount

No input, returns an output u64.

PushToGeneralChannel

Takes an input #IStorage, no output.

This is not usable under an Application, however it is usable under a LibraryApplet.

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:

  • RequestHomeMenu 5341 4d53 0100 0000 0200 0000 0100 0000 Returns to the main Home Menu, equivalent to pressing the HOME button.
  • RequestJumpToSystemUpdate 5341 4d53 0100 0000 0b00 0000 0100 0000 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.

The input value must be 0-3. 0 = HomeButton.

GetWriterLockAccessorEx

Takes an input u32, returns an output #ILockAccessor.

The input value must be 0-3. 0 = HomeButton.

GetCradleFwVersion

No input, returns 4 output u32s.

This uses #omm GetCradleFwVersion.

IsVrModeEnabled

No input, returns an output u8 bool.

SetVrModeEnabled

Takes an input u8 bool flag. No output.

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

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

SetLcdBacklighOffEnabled

Takes an input u8 bool, no output.

Sets whether the LCD screen blacklight is turned off.

BeginVrModeEx

No input/output.

Identical to #SetVrModeEnabled except with hard-coded flag=1.

EndVrModeEx

No input/output.

Identical to #SetVrModeEnabled except with hard-coded flag=0.

IsInControllerFirmwareUpdateSection

No input, returns an output u8 bool.

SetVrPositionForDebug

Takes 4 input s32s, no output.

The s32s are: x, y, width, height.

The cached value loaded from Settings_services#GetDebugModeFlag must be 1, otherwise an error is returned.

width must be 1-1280, height must be 1-720.

x and y must not be negative. x+width must be <=1280. y+height must be <=720.

GetDefaultDisplayResolution

No input, returns two output s32s width and height.

GetDefaultDisplayResolutionChangeEvent

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

GetHdcpAuthenticationState

No input, returns an output s32.

GetHdcpAuthenticationStateChangeEvent

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

SetTvPowerStateMatchingMode

Takes an input s32 #TvPowerStateMatchingMode, no output.

GetApplicationIdByContentActionName

Takes a type-0x5 input buffer containing a string, returns an output ApplicationId.

Gets the ApplicationId for the specified ContentActionName string. Returns an error when the current #AppletId isn't 0x04 (when the current applet isn't a SystemApplication).

SetCpuBoostMode

Takes an input u32 #CpuBoostMode and passes it to SetCpuBoostMode.

CancelCpuBoostMode

No input/output.

GetBuiltInDisplayType

No input, returns an output s32.

This is not exposed by sdknso.

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

PerformSystemButtonPressingIfInFocus

Takes an input #SystemButtonType, no 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.

SetPerformanceConfigurationChangedNotification

Takes an input u8 bool, no output.

GetCurrentPerformanceConfiguration

No input, returns the result of calling GetCurrentPerformanceConfiguration.

OpenMyGpuErrorHandler

No input, returns an #IGpuErrorHandler.

The cached value loaded from Settings_services#GetDebugModeFlag must be 1, otherwise an error is returned.

GetOperationModeSystemInfo

No input, returns an output u32.

This returns the output from omm GetOperationModeSystemInfo.

GetSettingsPlatformRegion

No input, returns an output u8.

This just returns the output from setsys GetPlatformRegion.

ActivateMigrationService

No input/output.

Besides various other functionality, if required this eventually uses ns LaunchLibraryApplet to launch migration.

DeactivateMigrationService

No input/output.

DisableSleepTillShutdown

No input/output.

SuppressDisablingSleepTemporarily

Takes an input u64 "nn::TimeSpanType", no output.

SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled

No input/output.

IGpuErrorHandler

This is "nn::am::service::IGpuErrorHandler".

This was added with [11.0.0+].

This uses various nvgem:cd commands.

Cmd Name
100 #GetManualGpuErrorInfoSize
101 #GetManualGpuErrorInfo
102 #GetManualGpuErrorDetectionSystemEvent
103 #FinishManualGpuErrorHandling

GetManualGpuErrorInfoSize

No input, returns an output u64.

GetManualGpuErrorInfo

Takes a type-0x6 output buffer, returns an output u64.

The OutBuffer_size must be >= the output size from #GetManualGpuErrorInfoSize.

sdknso exposes the buffer as void*.

GetManualGpuErrorDetectionSystemEvent

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

FinishManualGpuErrorHandling

No input/output.

ISelfController

This is "nn::am::service::ISelfController".

Cmd Name
0 #Exit
1 #LockExit
2 #UnlockExit
3 [2.0.0+] #EnterFatalSection
4 [2.0.0+] #LeaveFatalSection
9 #GetLibraryAppletLaunchableEvent
10 #SetScreenShotPermission
11 #SetOperationModeChangedNotification
12 #SetPerformanceModeChangedNotification
13 #SetFocusHandlingMode
14 #SetRestartMessageEnabled
15 [2.0.0+] #SetScreenShotAppletIdentityInfo
16 [2.0.0+] #SetOutOfFocusSuspendingEnabled
17 [3.0.0+] #SetControllerFirmwareUpdateSection
18 [3.0.0+] #SetRequiresCaptureButtonShortPressedMessage
19 [3.0.0+] #SetAlbumImageOrientation
20 [4.0.0+] #SetDesirableKeyboardLayout
21 [13.0.0+] GetScreenShotProgramId
22 [19.0.0+] GetScreenShotAcdIndex
23 [19.0.0+] GetScreenShotApparentPlatform
24 [19.0.0+] GetScreenShotApplicationProperty
40 #CreateManagedDisplayLayer
41 [4.0.0+] #IsSystemBufferSharingEnabled
42 [4.0.0+] #GetSystemSharedLayerHandle
43 [5.0.0+] #GetSystemSharedBufferHandle
44 [10.0.0+] #CreateManagedDisplaySeparableLayer
45 [10.0.0+] #SetManagedDisplayLayerSeparationMode
46 [13.0.0+] #SetRecordingLayerCompositionEnabled
50 #SetHandlesRequestToDisplay
51 #ApproveToDisplay
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
120 [11.0.0+] #SaveCurrentScreenshot
130 [13.0.0+] #SetRecordVolumeMuted
1000 [7.0.0+] #GetDebugStorageChannel

Exit

No input/output.

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

LockExit

No input/output.

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

UnlockExit

No input/output.

Unlocks exit process, if LockExit was previously used.

EnterFatalSection

No input/output.

LeaveFatalSection

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.

GetLibraryAppletLaunchableEvent

No input, returns an output event handle with autoclear=false.

SetScreenShotPermission

Takes an input s32. No output.

Controls whether screenshot-capture is allowed.

Value Description
0 Inherit from parent applet
1 Enable
2 Disable

SetOperationModeChangedNotification

Takes an input u8 bool flag. No output.

SetPerformanceModeChangedNotification

Takes an input u8 bool flag. No output.

SetFocusHandlingMode

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

SetRestartMessageEnabled

Takes an input u8 bool flag, no output.

See #AppletMessage.

SetScreenShotAppletIdentityInfo

Takes an input #AppletIdentityInfo, no output.

SetOutOfFocusSuspendingEnabled

Takes an input u8 bool flag. No output.

SetControllerFirmwareUpdateSection

Takes an input u8 bool flag, no output.

This throws error 0x40280 when the internal state flag already matches the input value.

SetRequiresCaptureButtonShortPressedMessage

Takes an input u8 bool flag, no output.

See #AppletMessage.

When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.

SetAlbumImageOrientation

Takes an input u32 "nn::album::ImageOrientation". No output.

The input value must not be >3.

SetDesirableKeyboardLayout

Takes an input u32, no output.

The input u32 is "nn::settings::KeyboardLayout".

CreateManagedDisplayLayer

Returns an output u64 LayerId which is then used by the user-process with Display_services#OpenLayer.

IsSystemBufferSharingEnabled

No input/output.

Not available when the current applet is an Application (#AppletId == 0x01).

Checks whether SystemBufferSharing is enabled, throwing an error otherwise.

GetSystemSharedLayerHandle

No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".

Runs code similar to #IsSystemBufferSharingEnabled first.

GetSystemSharedBufferHandle

No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".

Runs code similar to #IsSystemBufferSharingEnabled first.

Same as #GetSystemSharedLayerHandle except this just gets the SharedBufferHandle.

CreateManagedDisplaySeparableLayer

No input, returns two output u64 LayerIds.

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. nn::vi::CreateRecordingLayer uses the second LayerId, the layer creation is identical besides which LayerId is used.

SetManagedDisplayLayerSeparationMode

Takes an input u32, no output.

sdknso exposes this as nn::vi::SetRecordingLayerEnabled(bool).

The input u32 must be 0-1.

SetRecordingLayerCompositionEnabled

Takes an input bool, no output.

SetHandlesRequestToDisplay

Takes an input u8 bool, no output.

Sets an internal state flag. When the input flag is 0, this will in additional run the same code as #ApproveToDisplay.

See #AppletMessage.

ApproveToDisplay

No input/output.

Used to handle the notification enabled by #SetHandlesRequestToDisplay.

OverrideAutoSleepTimeAndDimmingTime

Takes 4 input s32s, no output.

SetMediaPlaybackState

Takes an input u8 bool, no output.

SetIdleTimeDetectionExtension

Takes an input u32, no output.

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

GetIdleTimeDetectionExtension

No input, returns an output u32.

Returns the value set by #SetIdleTimeDetectionExtension.

SetInputDetectionSourceSet

Takes an input u32, no output.

ReportUserIsActive

No input/output.

Uses idle:sys ReportUserIsActive.

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

GetCurrentIlluminance

No input, returns an output float.

Uses lbl command GetAmbientLightSensorValue, where only the output float is used.

IsIlluminanceAvailable

No input, returns an output u8 bool.

Uses lbl command IsAmbientLightSensorAvailable.

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

SetAutoSleepDisabled

Takes an input u8 bool, no output.

IsAutoSleepDisabled

No input, returns an output u8 bool.

ReportMultimediaError

Takes an input Result and a type-0x5 input buffer, no output.

The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.

GetCurrentIlluminanceEx

No input, returns an output u8 bool and float.

Uses lbl command GetAmbientLightSensorValue.

SetInputDetectionPolicy

Takes an input #InputDetectionPolicy, no output.

SetWirelessPriorityMode

Takes an input s32 #WirelessPriorityMode, no output.

GetAccumulatedSuspendedTickValue

No input, returns an output u64 tick value.

Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.

GetAccumulatedSuspendedTickChangedEvent

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.

SaveCurrentScreenshot

Takes an input s32 AlbumReportOption, no output.

sdknso exposes this under "nn::album::".

SetRecordVolumeMuted

Takes an input bool, no output.

GetDebugStorageChannel

No input, returns an output #IStorageChannel.

The cached value loaded from system-setting am.debug!dev_function must be set to 0x1 with size 0x1, otherwise an error is returned.

IStorageChannel

This is "nn::am::service::IStorageChannel".

This was added with [7.0.0+].

Cmd Name Notes
0 Push No input, returns an output #IStorage.
1 Unpop No input, returns an output #IStorage.
2 Pop No input, returns an output #IStorage.
3 GetPopEventHandle No input, returns an output handle.
4 Clear No input/output.

IWindowController

This is "nn::am::service::IWindowController".

Cmd Name Notes
0 #CreateWindow
1 #GetAppletResourceUserId
2 [6.0.0+] #GetAppletResourceUserIdOfCallerApplet
10 #AcquireForegroundRights
11 #ReleaseForegroundRights
12 #RejectToChangeIntoBackground
20 [7.0.0+] #SetAppletWindowVisibility
21 [7.0.0+] #SetAppletGpuTimeSlice

CreateWindow

Takes an input u32, returns an output #IWindow.

Stubbed, just returns an error.

GetAppletResourceUserId

No input, returns an output u64 #AppletResourceUserId.

GetAppletResourceUserIdOfCallerApplet

No input, returns an output u64 #AppletResourceUserId.

AcquireForegroundRights

No input/output.

Just returns 0.

ReleaseForegroundRights

No input/output.

Just returns 0.

RejectToChangeIntoBackground

No input/output.

Just returns 0.

SetAppletWindowVisibility

Takes an input u8 bool, no output.

SetAppletGpuTimeSlice

Takes an input s64, no output.

The input s64 must not be negative.

IAudioController

This is "nn::am::service::IAudioController".

Cmd Name
0 #SetExpectedMasterVolume
1 #GetMainAppletExpectedMasterVolume
2 #GetLibraryAppletExpectedMasterVolume
3 #ChangeMainAppletMasterVolume
4 #SetTransparentVolumeRate

GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.

SetExpectedMasterVolume

Takes two input floats, no output.

Writes the input floats to state: first one is used by #GetMainAppletExpectedMasterVolume, second one is used by #GetLibraryAppletExpectedMasterVolume.

GetMainAppletExpectedMasterVolume

No input, returns an output float.

GetLibraryAppletExpectedMasterVolume

No input, returns an output float.

ChangeMainAppletMasterVolume

Takes an input float and an input u64, no output.

SetTransparentVolumeRate

Takes an input float, no output.

IDisplayController

This is "nn::am::service::IDisplayController".

Cmd Name
0 #GetLastForegroundCaptureImage
1 #UpdateLastForegroundCaptureImage
2 #GetLastApplicationCaptureImage
3 #GetCallerAppletCaptureImage
4 #UpdateCallerAppletCaptureImage
5 #GetLastForegroundCaptureImageEx
6 #GetLastApplicationCaptureImageEx
7 #GetCallerAppletCaptureImageEx
8 [2.0.0+] #TakeScreenShotOfOwnLayer
9 [5.0.0+] #CopyBetweenCaptureBuffers
10 #AcquireLastApplicationCaptureBuffer
11 #ReleaseLastApplicationCaptureBuffer
12 #AcquireLastForegroundCaptureBuffer
13 #ReleaseLastForegroundCaptureBuffer
14 #AcquireCallerAppletCaptureBuffer
15 #ReleaseCallerAppletCaptureBuffer
16 #AcquireLastApplicationCaptureBufferEx
17 #AcquireLastForegroundCaptureBufferEx
18 #AcquireCallerAppletCaptureBufferEx
20 [3.0.0+] #ClearCaptureBuffer
21 [3.0.0+] #ClearAppletTransitionBuffer
22 [4.0.0+] #AcquireLastApplicationCaptureSharedBuffer
23 [4.0.0+] #ReleaseLastApplicationCaptureSharedBuffer
24 [4.0.0+] #AcquireLastForegroundCaptureSharedBuffer
25 [4.0.0+] #ReleaseLastForegroundCaptureSharedBuffer
26 [4.0.0+] #AcquireCallerAppletCaptureSharedBuffer
27 [4.0.0+] #ReleaseCallerAppletCaptureSharedBuffer
28 [6.0.0+] #TakeScreenShotOfOwnLayerEx

GetLastForegroundCaptureImage

Takes a type-0x6 output buffer.

Stubbed, just returns an error.

UpdateLastForegroundCaptureImage

No input/output.

GetLastApplicationCaptureImage

Takes a type-0x6 output buffer.

Stubbed, just returns an error.

GetCallerAppletCaptureImage

Takes a type-0x6 output buffer.

Stubbed, just returns an error.

UpdateCallerAppletCaptureImage

No input/output.

Calls the same func internally as #UpdateLastForegroundCaptureImage, except this passes param value 2 instead of 1.

GetLastForegroundCaptureImageEx

Takes a type-0x6 output buffer, returns an output u8 bool.

The buffer size must match 0x384000.

GetLastApplicationCaptureImageEx

Takes a type-0x6 output buffer, returns an output u8 bool.

The buffer size must match 0x384000.

Calls the same internal func as #GetLastForegroundCaptureImageEx, except that the last param is set to value 0 instead of 1.

GetCallerAppletCaptureImageEx

Takes a type-0x6 output buffer, returns an output u8 bool.

The buffer size must match 0x384000.

Calls the same internal func as #GetLastForegroundCaptureImageEx, except that the last param is set to value 2 instead of 1.

TakeScreenShotOfOwnLayer

Takes an input u8 bool and a s32, no output.

CopyBetweenCaptureBuffers

Takes two input s32s, no output.

AcquireLastApplicationCaptureBuffer

No input, returns an output handle.

Stubbed, just returns an error.

ReleaseLastApplicationCaptureBuffer

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.

AcquireLastForegroundCaptureBuffer

No input, returns an output handle.

Stubbed, just returns an error.

ReleaseLastForegroundCaptureBuffer

No input/output.

Same as #ReleaseLastApplicationCaptureBuffer except with a different state field + different input param for the called func.

AcquireCallerAppletCaptureBuffer

No input, returns an output handle.

Stubbed, just returns an error.

ReleaseCallerAppletCaptureBuffer

No input/output.

Same as #ReleaseLastApplicationCaptureBuffer except with a different state field + different input param for the called func.

AcquireLastApplicationCaptureBufferEx

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

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

On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.

AcquireLastForegroundCaptureBufferEx

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

Same as #AcquireLastApplicationCaptureBufferEx except this uses the #ReleaseLastForegroundCaptureBuffer state field, and uses a different input param value for the called func.

AcquireCallerAppletCaptureBufferEx

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

Same as #AcquireLastApplicationCaptureBufferEx except this uses the #ReleaseCallerAppletCaptureBuffer state field, and uses a different input param value for the called func.

ClearCaptureBuffer

Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.

Clear the input CaptureSharedBuffer with the specified RGBA8 color.

ClearAppletTransitionBuffer

Takes an input u32, no output.

Clear the AppletTransitionBuffer with the specified RGBA8 color.

AcquireLastApplicationCaptureSharedBuffer

No input, returns an output u8 bool and an s32.

This loads data from state.

ReleaseLastApplicationCaptureSharedBuffer

No input/output.

Depending on whether a state field is 0, this just returns an error or returns 0.

AcquireLastForegroundCaptureSharedBuffer

No input, returns an output u8 bool and an s32.

Calls the same func internally as #AcquireLastApplicationCaptureSharedBuffer, except this passes value 1 for the last param instead of 0.

ReleaseLastForegroundCaptureSharedBuffer

No input/output.

Calls the same func internally as #ReleaseLastApplicationCaptureSharedBuffer, except this passes value 1 for the last param instead of 0.

AcquireCallerAppletCaptureSharedBuffer

No input, returns an output u8 bool and an s32.

Calls the same func internally as #AcquireLastApplicationCaptureSharedBuffer, except this passes value 2 for the last param instead of 0.

ReleaseCallerAppletCaptureSharedBuffer

No input/output.

Calls the same func internally as #ReleaseLastApplicationCaptureSharedBuffer, except this passes value 2 for the last param instead of 0.

TakeScreenShotOfOwnLayerEx

Takes two input u8 bools and a s32, no output.

Calls the same func internally as #TakeScreenShotOfOwnLayer, except the last bool param is the last cmd param bool instead of hard-coded 0. This flag indicates whether the screenshot should be taken Immediately.

ISystemAppletControllerForDebug

This is "nn::am::service::ISystemAppletControllerForDebug".

Cmd Name
1 RequestLaunchApplicationForDebug
2 [7.0.0+] #GetDebugStorageChannel
3 [7.0.0+] #CreateStorageForDebug
4 [12.0.0+] #CreateCradleFirmwareUpdaterForDebug

GetDebugStorageChannel

No input. Returns an output #IStorageChannel.

CreateStorageForDebug

Takes a total of 8-bytes of input. Returns an #IStorage.

CreateCradleFirmwareUpdaterForDebug

No input. Returns an #ICradleFirmwareUpdater.

IProcessWindingController

This is "nn::am::service::IProcessWindingController".

Cmd Name Notes
0 #GetLaunchReason
11 #OpenCallingLibraryApplet
21 #PushContext
22 #PopContext
23 #CancelWindingReservation
30 #WindAndDoReserved
40 #ReserveToStartAndWaitAndUnwindThis
41 [4.0.0+] #ReserveToStartAndWait

GetLaunchReason

No input, returns an output #AppletProcessLaunchReason.

Used by LibraryApplets.

OpenCallingLibraryApplet

No input, returns an output #ILibraryAppletAccessor.

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

PushContext

Takes an input #IStorage, no output.

PopContext

No input, returns an output #IStorage.

CancelWindingReservation

No input/output.

WindAndDoReserved

No input/output.

ReserveToStartAndWaitAndUnwindThis

Takes an input #ILibraryAppletAccessor, no output.

ReserveToStartAndWait

Takes an input #ILibraryAppletAccessor, no output.

ISystemProcessCommonFunctions

This is "nn::am::service::ISystemProcessCommonFunctions".

This was added with [19.0.0+].

Cmd Name
0

Cmd0

No input. Returns an #IApplicationObserver.

IApplicationObserver

This is "nn::am::service::IApplicationObserver".

This was added with [19.0.0+].

Cmd Name
1
2
10
20
30

IDebugFunctions

This is "nn::am::service::IDebugFunctions".

Cmd Name
0 #NotifyMessageToHomeMenuForDebug
1 [1.0.0-9.2.0] #OpenMainApplication
10 #PerformSystemButtonPressing
20 #InvalidateTransitionLayer
30 [6.0.0+] #RequestLaunchApplicationWithUserAndArgumentForDebug
31 [12.0.0+] #RequestLaunchApplicationByApplicationLaunchInfoForDebug
40 [6.0.0+] #GetAppletResourceUsageInfo
50 [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
51 [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
52 [17.0.0+] GetProgramIdFromAppletIdForDebug
53 [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
100 [7.0.0+] #SetCpuBoostModeForApplet
101 [10.0.0+] #CancelCpuBoostModeForApplet
110 [9.0.0+] #PushToAppletBoundChannelForDebug
111 [9.0.0+] #TryPopFromAppletBoundChannelForDebug
120 [9.0.0+] #AlarmSettingNotificationEnableAppEventReserve
121 [9.0.0+] #AlarmSettingNotificationDisableAppEventReserve
122 [9.0.0+] #AlarmSettingNotificationPushAppEventNotify
130 [9.0.0+] #FriendInvitationSetApplicationParameter
131 [9.0.0+] #FriendInvitationClearApplicationParameter
132 [9.0.0+] #FriendInvitationPushApplicationParameter
140 [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug
200 [15.0.0+] CreateFloatingLibraryAppletAccepterForDebug
300 [16.0.0+] TerminateAllRunningApplicationsForDebug
410 [18.0.0+] CreateGeneralStorageForDebug
411 [18.0.0+] ReadGeneralStorageForDebug
412 [18.0.0+] WriteGeneralStorageForDebug
900 [12.0.0+] GetGrcProcessLaunchedSystemEvent

NotifyMessageToHomeMenuForDebug

Takes an input #AppletMessage, no output.

Stubbed, just returns an error.

OpenMainApplication

No input, returns an output #IApplicationAccessor.

Should not be used when no Application is running (svcBreak).

PerformSystemButtonPressing

Takes an input #SystemButtonType, no output.

InvalidateTransitionLayer

No input/output.

RequestLaunchApplicationWithUserAndArgumentForDebug

Takes an input u8 bool flag, an ApplicationId, a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.

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

RequestLaunchApplicationByApplicationLaunchInfoForDebug

Takes a total of 0x58-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.

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

GetAppletResourceUsageInfo

No input, returns an output #AppletResourceUsageInfo.

SetCpuBoostModeForApplet

Takes an input u32 #CpuBoostMode and passes it to 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 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 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".

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

Cmd Name Notes
0 GetSize No input. Returns an s64.
10 Write Takes an input s64 and a type-0x21 input buffer.
11 Read Takes an input s64 and a type-0x22 output buffer.

ITransferStorageAccessor

This is "nn::am::service::ITransferStorageAccessor".

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

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.

OpenApplicationProxy

Returns an #IApplicationProxy. See #appletAE.

Takes a reserved input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias).

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

idle:sys

This is "nn::idle::detail::IPolicyManagerSystem"

This was moved to omm with [14.0.0+].

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, this is the only service that interacts with the Dock through usb:pd*.

This was moved to omm with [14.0.0+].

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 ICommonStateGetter GetOperationModeSystemInfo.

CreateCradleFirmwareUpdater

No input. Returns an #ICradleFirmwareUpdater.

ICradleFirmwareUpdater

This is "nn::am::service::ICradleFirmwareUpdater".

This was added with [12.0.0+].

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 with [14.0.0+].

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+].

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.

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 caps:c cmd33. Commands SaveScreenShot, SaveScreenShotEx0, SaveScreenShotEx1 and SaveScreenShotEx2 are wrappers for caps:sc cmd210.

SaveScreenShot

Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an 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 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 ApplicationData, and a type-0x45 input buffer containing image data. Returns an ApplicationAlbumEntry.

SaveScreenShotEx2

Takes an input 0x40-byte struct ScreenShotAttributeEx0, an input u32, an input u64 AppletResourceUserId, a type-0x15 input buffer containing an UserIdList, and a type-0x45 input buffer containing image data. Returns an ApplicationAlbumEntry.

apm

This is "nn::am::service::IApmManager".

This was added with [8.0.0+].

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

Cmd Name
0 SetPerformanceConfiguration
1 GetPerformanceConfiguration
2 [8.0.0+] SetCpuOverclockEnabled

Library Applets

This section documents library applet launching.

Before starting the applet, #IStorages are created and written, then passed to #ILibraryAppletAccessor PushInData. The #IStorage session is closed afterwards. The first #IStorage is #CommonArguments, followed by any applet-specific #IStorages.

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 IStorage passed to applets should contain the common library applet arguments. This is populated by nn::la::CommonArgumentsWriter 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.

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

AppletId

This is "nn::applet::AppletId". See also Category:Library Applets.

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 LibraryAppletAuth (auth)
0x0B 0100000000001002 LibraryAppletCabinet (cabinet)
0x0C 0100000000001003 LibraryAppletController (controller)
0x0D 0100000000001004 LibraryAppletDataErase (dataErase)
0x0E 0100000000001005 LibraryAppletError (error)
0x0F 0100000000001006 LibraryAppletNetConnect (netConnect)
0x10 0100000000001007 LibraryAppletPlayerSelect (playerSelect)
0x11 0100000000001008 LibraryAppletSwkbd (swkbd)
0x12 0100000000001009 LibraryAppletMiiEdit (miiEdit)
0x13 010000000000100A LibraryAppletWeb (web)
0x14 010000000000100B LibraryAppletShop (shop)
0x15 010000000000100D LibraryAppletPhotoViewer (photoViewer)
0x16 010000000000100E LibraryAppletSet (set)
0x17 010000000000100F LibraryAppletOfflineWeb (offlineWeb)
0x18 0100000000001010 LibraryAppletLoginShare (loginShare)
0x19 0100000000001011 LibraryAppletWifiWebAuth (wifiWebAuth)
0x1A 0100000000001013 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+] LibraryAppletOfflineWeb (offlineWeb)
0x33 010000000000100F [17.0.0+] LibraryAppletOfflineWeb (offlineWeb)
0x35 [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042) [17.0.0+] LibraryAppletLoginShare (loginShare) ([16.0.0-16.1.0] )
0x36 [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042) [17.0.0+] LibraryAppletLoginShare (loginShare) ([16.0.0-16.1.0] )
0x37 [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042) [17.0.0+] LibraryAppletLoginShare (loginShare) ([16.0.0-16.1.0] )
0x38 0100000000001043 [16.0.0-16.1.0]
0x50 0100000000001007 [18.0.0+]
0x51 0100000000001007 [18.0.0+]
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

LibraryAppletMode

This is "nn::applet::LibraryAppletMode".

Value Description
0x0 AllForeground
0x1 PartialForeground
0x2 NoUi
0x3 PartialForegroundWithIndirectDisplay (see also #GetIndirectLayerConsumerHandle, only used by swkbd InlineKeyboard)
0x4 AllForegroundInitiallyHidden (can be used by [7.0.0+] WebSession)

AppletMessage

This is "nn::am::AppletMessage".

Value Description
0 None
1 ChangeIntoForeground
2 ChangeIntoBackground
4 Exit
6 ApplicationExited
7
15 FocusStateChanged
16 Resume
20 DetectShortPressingHomeButton
21 DetectLongPressingHomeButton
22 DetectShortPressingPowerButton
23 DetectMiddlePressingPowerButton
24 DetectLongPressingPowerButton
25 RequestToPrepareSleep
26 FinishedSleepSequence
27 SleepRequiredByHighTemperature
28 SleepRequiredByLowBattery
29 AutoPowerDown
30 OperationModeChanged
31 PerformanceModeChanged
32 DetectReceivingCecSystemStandby
33 SdCardRemoved
34
50 LaunchApplicationRequested
51 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 DetectShortPressingCaptureButton
92 AlbumScreenShotTaken
93 AlbumRecordingSaved
94
100
101
110 [14.0.0+] DetectShortPressingCaptureButtonForApplet
111 [14.0.0+] DetectLongPressingCaptureButtonForApplet
1000

OperationMode

This is "nn::oe::OperationMode".

Value Description
0 Handheld
1 Console

PerformanceMode

This is "nn::oe::PerformanceMode".

Value Description
-1 Invalid
0 Normal
1 Boost

FocusState

This is "nn::oe::FocusState".

Value Description
1 InFocus
2 OutOfFocus
3 Background

CpuBoostMode

This is "nn::oe::CpuBoostMode".

Value Description
0 Normal
1 FastLoad

WindowOriginMode

This is "nn::oe::WindowOriginMode".

Value Description
0 LowerLeft
1 UpperLeft

WirelessPriorityMode

This is "nn::oe::WirelessPriorityMode".

Value Description
0 Default
1 OptimizedForWlan

TvPowerStateMatchingMode

This is "nn::oe::TvPowerStateMatchingMode". This is used with #SetTvPowerStateMatchingMode.

Value Description
0 Unknown
1 Unknown

SystemButtonType

This is "nn::am::service::SystemButtonType". This is used with #PerformSystemButtonPressingIfInFocus/#PerformSystemButtonPressing.

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

Value Description
1 UserChannel. Application-specific LaunchParameter.
2 account PreselectedUser
3 Unknown if used by anything?

LibraryAppletExitReason

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.

Value Description
0 u8 ProgramIndex. "ExecuteProgram". 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 ApplicationId. "JumpToSubApplicationProgramForDevelopment". Only available when 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".

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.

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.

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.

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.

Offset Size Description
0x0 0x4 #AppletId
0x4 0x4 Padding
0x8 0x8 ApplicationId

ApplicationAttributeForQuest

This struct is "nn::applet::ApplicationAttributeForQuest".

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.

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.

Offset Size Description
0x0 0x8 ApplicationId
0x8 0x4 Application title-version.
0xC 0x1 StorageId for the Application base title.
0xD 0x1 StorageId for the Application update title.
0xE 0x1 Unknown.
0xF 0x1 Padding.

ApplicationLaunchRequestInfo

This is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.

Offset Size Description
0x0 0x4 Unknown. The default is 0x0 with #CreateSystemApplication, 0x3 with #CreateApplication.
0x4 0x4 Unknown. The default is 0x0 with #CreateSystemApplication, 0x3 with #CreateApplication.
0x8 0x8 Unknown. The default is 0x0.

AppletResourceUsageInfo

This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.

Offset Size Description
0x0 0x4 Unknown counter.
0x4 0x4 Unknown counter.
0x8 0x4 Output from NS GetRightsEnvironmentCountForDebug.
0xC 0x14 Always zero.

ApplicationLicenseType

This is "nn::oe::ApplicationLicenseType". This is 1-byte.

LaunchRequiredVersion

This is "nn::oe::LaunchRequiredVersion". This is a 0x40-byte struct with 1-byte alignment.

ServerEnvironmentType

This is "nn::oe::ServerEnvironmentType".

Value Description
0 dd
1 lp
2 sd
3 sp
4 dp

Notes

AM-sysmodule will only initialize pdm:ntfy / use pdm:ntfy service commands when the value from pm:bm GetBootMode is not 0x1 (Maintenance).

An object constructor also writes the output from 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 ommdisp cmd600.