Changes

Jump to navigation Jump to search
Line 65: Line 65:     
== ISystemAppletProxy ==
 
== ISystemAppletProxy ==
 +
This is "nn::am::service::ISystemAppletProxy".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 95: Line 97:     
=== 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]]
 
|-
 
|-
| 10 || [[#RequestToGetForeground]] ||
+
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]]
 
|-
 
|-
| 11 || [[#LockForeground]] ||
+
| 40 || [11.0.0+] [[#IsSleepEnabled]]
 
|-
 
|-
| 12 || [[#UnlockForeground]] ||
+
| 41 || [12.0.0+] [[#IsRebootEnabled]]
 
|-
 
|-
| 20 || [[#PopFromGeneralChannel]] ||
+
| 50 || [16.0.0+] [[#LaunchSystemApplet]]
 
|-
 
|-
| 21 || [[#GetPopFromGeneralChannelEvent]] ||
+
| 51 || [16.0.0+] [[#LaunchStarter]]
 
|-
 
|-
| 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]]
 
|}
 
|}
   Line 142: Line 158:     
The input value must be 0-3. 0 = HomeButton.
 
The input value must be 0-3. 0 = HomeButton.
 +
 +
==== IsSleepEnabled ====
 +
No input, returns an output bool.
 +
 +
==== IsRebootEnabled ====
 +
No input, returns an output bool.
 +
 +
==== LaunchSystemApplet ====
 +
No input/output.
 +
 +
This wraps [[NS_Services|ns]] LaunchSystemApplet, ignoring the u64 returned by that cmd (and other functionality).
 +
 +
==== LaunchStarter ====
 +
No input/output.
 +
 +
This is similar to [[#LaunchSystemApplet]], except this uses [[NS_Services|ns]] LaunchLibraryApplet with a ProgramId from global state.
 +
 +
The global state field is initialized elsewhere with the value of [[System_Settings|system-setting]] <code>am.debug!starter_id</code>, defaulting to ProgramId 0100000000001012 ([[Title_list|starter]]) if not available.
 +
 +
==== PopRequestLaunchApplicationForDebug ====
 +
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 ====
 
==== LaunchDevMenu ====
Line 148: Line 192:  
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
   −
Uses [[NS_Services#IApplicationManagerInterface]] cmd99.
+
Uses [[NS_Services|ns]] LaunchDevMenu.
 +
 
 +
This is used by [[qlaunch]]. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
 +
 
 +
==== SetLastApplicationExitReason ====
 +
Takes an input s32, no output.
    
==== ILockAccessor ====
 
==== ILockAccessor ====
 +
This is "nn::am::service::ILockAccessor".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 160: Line 211:  
|-
 
|-
 
| 3 || [[#GetEvent]]
 
| 3 || [[#GetEvent]]
 +
|-
 +
| 4 || [10.0.0+] [[#IsLocked]]
 
|}
 
|}
   Line 174: Line 227:  
===== GetEvent =====
 
===== GetEvent =====
 
No input, returns an output Event handle with autoclear=false.
 
No input, returns an output Event handle with autoclear=false.
 +
 +
==== IsLocked ====
 +
No input, returns an output u8 bool.
    
=== IGlobalStateController ===
 
=== IGlobalStateController ===
 +
This is "nn::am::service::IGlobalStateController".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 +
|-
 +
| 0 || [[#RequestToEnterSleep]]
 
|-
 
|-
| 0 || [[#RequestToEnterSleep]] ||
+
| 1 || [[#EnterSleep]]
 
|-
 
|-
| 1 || [[#EnterSleep]] ||
+
| 2 || [[#StartSleepSequence]]
 
|-
 
|-
| 2 || [[#StartSleepSequence]] ||
+
| 3 || [[#StartShutdownSequence]]
 
|-
 
|-
| 3 || [[#StartShutdownSequence]] ||
+
| 4 || [[#StartRebootSequence]]
 
|-
 
|-
| 4 || [[#StartRebootSequence]] ||
+
| 9 || [7.0.0+] [[#IsAutoPowerDownRequested]]
 
|-
 
|-
| 9 || [7.0.0+] [[#IsAutoPowerDownRequested]] ||
+
| 10 || [[#LoadAndApplyIdlePolicySettings]]
 
|-
 
|-
| 10 || [[#LoadAndApplyIdlePolicySettings]] ||
+
| 11 || [2.0.0+] [[#NotifyCecSettingsChanged]]
 
|-
 
|-
| 11 || [2.0.0+] [[#NotifyCecSettingsChanged]] ||
+
| 12 || [3.0.0+] [[#SetDefaultHomeButtonLongPressTime]]
 
|-
 
|-
| 12 || [3.0.0+] [[#SetDefaultHomeButtonLongPressTime]] ||
+
| 13 || [3.0.0+] [[#UpdateDefaultDisplayResolution]]
 
|-
 
|-
| 13 || [3.0.0+] [[#UpdateDefaultDisplayResolution]] ||
+
| 14 || [3.0.0+] [[#ShouldSleepOnBoot]]
 
|-
 
|-
| 14 || [3.0.0+] [[#ShouldSleepOnBoot]] ||
+
| 15 || [4.0.0+] [[#GetHdcpAuthenticationFailedEvent]]
 
|-
 
|-
| 15 || [4.0.0+] [[#GetHdcpAuthenticationFailedEvent]] ||
+
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]
 
|}
 
|}
   Line 258: Line 318:     
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.
 
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.
 +
 +
==== OpenCradleFirmwareUpdater ====
 +
No input, returns an [[#ICradleFirmwareUpdater]].
 +
 +
=== ICradleFirmwareUpdater ===
 +
This is "nn::am::service::ICradleFirmwareUpdater".
 +
 +
This was added with [12.0.0+].
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || StartUpdate
 +
|-
 +
| 1 || FinishUpdate
 +
|-
 +
| 2 || [[#GetCradleDeviceInfo]]
 +
|-
 +
| 3 || GetCradleDeviceInfoChangeEvent
 +
|-
 +
| 4 || GetUpdateProgressInfo
 +
|-
 +
| 5 || GetLastInternalResult
 +
|}
 +
 +
==== GetCradleDeviceInfo ====
 +
No input, returns a 8-byte CradleDeviceInfo.
 +
 +
[13.0.0+] Now returns a total of 0xC-bytes.
    
=== IApplicationCreator ===
 
=== IApplicationCreator ===
 +
This is "nn::am::service::IApplicationCreator".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || [[#CreateApplication]] ||
+
| 0 || [[#CreateApplication]]
 
|-
 
|-
| 1 || [[#PopLaunchRequestedApplication]] ||
+
| 1 || [[#PopLaunchRequestedApplication]]
 
|-
 
|-
| 10 || [[#CreateSystemApplication]] ||
+
| 10 || [[#CreateSystemApplication]]
 
|-
 
|-
| 100 || [[#PopFloatingApplicationForDevelopment]] ||
+
| 100 || [[#PopFloatingApplicationForDevelopment]]
 
|}
 
|}
 +
 +
[[#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 ====
 
==== CreateApplication ====
Takes an input u64 <code>nn::ncm::ApplicationId</code>(titleID), returns an [[#IApplicationAccessor]].
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IApplicationAccessor]].
    
==== PopLaunchRequestedApplication ====
 
==== PopLaunchRequestedApplication ====
Line 280: Line 374:     
==== CreateSystemApplication ====
 
==== CreateSystemApplication ====
Takes an input u64 <code>nn::ncm::SystemApplicationId</code>, returns an [[#IApplicationAccessor]].
+
Takes an input [[NCM_services#ApplicationId|SystemApplicationId]], returns an [[#IApplicationAccessor]].
 +
 
 +
[[qlaunch]] only uses this with a hard-coded id for the "starter" title.
    
==== PopFloatingApplicationForDevelopment ====
 
==== PopFloatingApplicationForDevelopment ====
 
No input, returns an [[#IApplicationAccessor]].
 
No input, returns an [[#IApplicationAccessor]].
 +
 +
Should not be used if no FloatingApplication is available (svcBreak).
    
==== IApplicationAccessor ====
 
==== IApplicationAccessor ====
 +
This is "nn::am::service::IApplicationAccessor".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 294: Line 394:  
| 1 || [[#IsCompleted]] ||
 
| 1 || [[#IsCompleted]] ||
 
|-
 
|-
| 10 || Start ||
+
| 10 || [[#Start]] ||
 
|-
 
|-
| 20 || RequestExit ||  
+
| 20 || [[#RequestExit]] ||  
 
|-
 
|-
| 25 || Terminate ||  
+
| 25 || [[#Terminate]] ||  
 
|-
 
|-
| 30 || GetResult ||  
+
| 30 || [[#GetResult]] ||  
 
|-
 
|-
| 101 || RequestForApplicationToGetForeground ||  
+
| 101 || [[#RequestForApplicationToGetForeground]] ||  
 
|-
 
|-
| 110 || TerminateAllLibraryApplets ||  
+
| 110 || [[#TerminateAllLibraryApplets]] ||  
 
|-
 
|-
| 111 || AreAnyLibraryAppletsLeft ||  
+
| 111 || [[#AreAnyLibraryAppletsLeft]] ||  
 
|-
 
|-
 
| 112 || [[#GetCurrentLibraryApplet]] ||  
 
| 112 || [[#GetCurrentLibraryApplet]] ||  
Line 316: Line 416:  
| 122 || [[#GetApplicationControlProperty]] ||  
 
| 122 || [[#GetApplicationControlProperty]] ||  
 
|-
 
|-
| 123 || [2.0.0+] GetApplicationLaunchProperty ||  
+
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]] ||  
 
|-
 
|-
| 124 || [6.0.0+] GetApplicationLaunchRequestInfo ||  
+
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]] ||  
 
|-
 
|-
 
| 130 || [6.0.0+] [[#SetUsers]] ||  
 
| 130 || [6.0.0+] [[#SetUsers]] ||  
 
|-
 
|-
| 131 || [6.0.0+] CheckRightsEnvironmentAvailable ||  
+
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]] ||  
 
|-
 
|-
| 132 || [6.0.0+] GetNsRightsEnvironmentHandle ||  
+
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]] ||  
 
|-
 
|-
 
| 140 || [6.0.0+] [[#GetDesirableUids]] ||  
 
| 140 || [6.0.0+] [[#GetDesirableUids]] ||  
 
|-
 
|-
| 150 || [6.0.0+] ReportApplicationExitTimeout ||  
+
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]] ||  
 
|-
 
|-
 
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||
 
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||
 
|-
 
|-
| 170 || [8.0.0+] HasSaveDataAccessPermission ||
+
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||
 +
|-
 +
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||
 +
|-
 +
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||
 +
|-
 +
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]] ||
 +
|-
 +
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||
 
|}
 
|}
    
Commands <=30 are inherited from [[#IAppletAccessor]].
 
Commands <=30 are inherited from [[#IAppletAccessor]].
 +
 +
===== RequestForApplicationToGetForeground =====
 +
No input/output.
    
===== GetCurrentLibraryApplet =====
 
===== GetCurrentLibraryApplet =====
Line 341: Line 452:     
===== GetApplicationId =====
 
===== GetApplicationId =====
No input, returns an output u64 titleID.
+
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
 
  −
Gets the Application titleID.
      
===== PushLaunchParameter =====
 
===== PushLaunchParameter =====
Line 350: Line 459:  
===== 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]].
   −
===== SetUsers =====
+
===== 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.
 
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.
 
The total entries for the userIDs must be <=8.
   −
When the input flag is true, the '''users_available''' state flag is cleared to 0, however as long as total_entries is valid this state flag will be set to 1 afterwards regardless.
+
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 =====
 
===== GetDesirableUids =====
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u32 '''total_entries'''.
+
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]].
+
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>.
 
The stored entry-count in state must be <= <size of output buffer in entries>.
 +
 +
===== ReportApplicationExitTimeout =====
 +
No input/output.
    
===== SetApplicationAttribute =====
 
===== SetApplicationAttribute =====
 
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
 
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
 +
 +
===== HasSaveDataAccessPermission =====
 +
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool flag.
 +
 +
Gets whether the savedata specified by the input ApplicationId is accessible. The output flag indicates whether it's accessible.
 +
 +
If the ApplicationId matches the current application, this immediately returns success with flag=1.
 +
 +
===== PushToFriendInvitationStorageChannel =====
 +
Takes an input [[#IStorage]], no output.
 +
 +
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 =====
 
===== IAppletAccessor =====
 +
This is "nn::am::service::IAppletAccessor".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 407: Line 566:     
== IAppletCommonFunctions ==
 
== IAppletCommonFunctions ==
Added with [[7.0.0]].
+
This is "nn::am::service::IAppletCommonFunctions".
 +
 
 +
This was added with [7.0.0+].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 +
|-
 +
| 0 || [9.0.0+] [[#SetTerminateResult]]
 +
|-
 +
| 10 || [[#ReadThemeStorage]]
 
|-
 
|-
| 10 || [[#ReadThemeStorage]] ||
+
| 11 || [[#WriteThemeStorage]]
 
|-
 
|-
| 11 || [[#WriteThemeStorage]] ||
+
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]]
 
|-
 
|-
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]] ||
+
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]]
 
|-
 
|-
| 42 || [8.0.0+] [[#SetDisplayMagnification]] ||
+
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]]
 
|-
 
|-
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]] ||
+
| 42 || [8.0.0+] [[#SetDisplayMagnification]]
 
|-
 
|-
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]] ||  
+
| 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+]
 +
|-
 +
| 90 || [15.0.0+] OpenNamedChannelAsParent
 +
|-
 +
| 91 || [15.0.0+] OpenNamedChannelAsChild
 +
|-
 +
| 100 || [15.0.0+] SetApplicationCoreUsageMode
 +
|-
 +
| 160 || [18.0.0+]
 +
|-
 +
| 161 || [18.0.0+]
 +
|-
 +
| 300 || [17.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: <code>memset(statebuf, 0xAA, 0x400);</code>
 
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>
Line 433: Line 628:  
=== WriteThemeStorage ===
 
=== WriteThemeStorage ===
 
Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
 
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 ===
 
=== GetDisplayLogicalResolution ===
Line 449: Line 654:  
=== GetHomeButtonDoubleClickEnabled ===
 
=== GetHomeButtonDoubleClickEnabled ===
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
 +
 +
=== IsHomeButtonShortPressedBlocked ===
 +
No input, returns an output u8 bool.
 +
 +
=== IsVrModeCurtainRequired ===
 +
No input, returns an output bool.
 +
 +
=== SetCpuBoostRequestPriority ===
 +
Takes an input s32, no output.
    
== ILibraryAppletProxy ==
 
== ILibraryAppletProxy ==
 +
This is "nn::am::service::ILibraryAppletProxy".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 472: Line 688:  
|-
 
|-
 
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
 
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
 +
|-
 +
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
 +
|-
 +
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
 
|-
 
|-
 
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
 
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
Line 477: Line 697:     
=== ILibraryAppletSelfAccessor ===
 
=== ILibraryAppletSelfAccessor ===
 +
This is "nn::am::service::ILibraryAppletSelfAccessor".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 523: Line 745:  
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||
 
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||
 
|-
 
|-
| 50 || [3.0.0+] ReportVisibleError ||
+
| 50 || [3.0.0+] [[#ReportVisibleError]] ||
 
|-
 
|-
| 51 || [4.0.0+] ReportVisibleErrorWithErrorContext ||
+
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||
 
|-
 
|-
 
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||
 
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||
Line 533: Line 755:  
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||
 
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||
 
|-
 
|-
| 90 || [5.0.0+] CreateApplicationAndPushAndRequestToLaunch ||
+
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||
 
|-
 
|-
 
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||
 
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||
 
|-
 
|-
| 101 || [5.0.0+] ReserveResourceForMovieOperation ||
+
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||
 
|-
 
|-
| 102 || [5.0.0+] UnreserveResourceForMovieOperation ||
+
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||
 
|-
 
|-
 
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
 
| 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+] [[#Cmd160]] ||
 +
|}
 +
 
 
==== PopInData ====
 
==== PopInData ====
 
No input, returns an output [[#IStorage]].
 
No input, returns an output [[#IStorage]].
Line 557: Line 789:     
==== GetPopInDataEvent ====
 
==== GetPopInDataEvent ====
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=false.
    
==== GetPopInteractiveInDataEvent ====
 
==== GetPopInteractiveInDataEvent ====
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=false.
    
==== ExitProcessAndReturn ====
 
==== ExitProcessAndReturn ====
Line 567: Line 799:  
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).
 
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).
   −
Official sw enters an infinite sleep-thread loop after using this.
+
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
    
==== GetLibraryAppletInfo ====
 
==== GetLibraryAppletInfo ====
Line 606: Line 838:     
==== GetPopExtraStorageEvent ====
 
==== GetPopExtraStorageEvent ====
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=false.
    
==== UnpopInData ====
 
==== UnpopInData ====
Line 616: Line 848:  
==== GetIndirectLayerProducerHandle ====
 
==== GetIndirectLayerProducerHandle ====
 
No input, returns an output u64.
 
No input, returns an output u64.
 +
 +
==== ReportVisibleError ====
 +
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.
 +
 +
==== ReportVisibleErrorWithErrorContext ====
 +
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.
    
==== GetMainAppletApplicationDesiredLanguage ====
 
==== GetMainAppletApplicationDesiredLanguage ====
Line 621: Line 859:     
==== GetCurrentApplicationId ====
 
==== GetCurrentApplicationId ====
No input, returns an output u64.
+
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
   −
Gets the titleID for the currently running Application. titleID=0 when no Application is running.
+
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.
    
==== RequestExitToSelf ====
 
==== RequestExitToSelf ====
Line 629: Line 867:     
Same as [[#RequestExit]] except this is for the current applet.
 
Same as [[#RequestExit]] except this is for the current applet.
 +
 +
==== CreateApplicationAndPushAndRequestToLaunch ====
 +
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.
 +
 +
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
    
==== CreateGameMovieTrimmer ====
 
==== CreateGameMovieTrimmer ====
Takes an input u64 and handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
+
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
 +
 
 +
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|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 [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].
    
==== GetMainAppletAvailableUsers ====
 
==== GetMainAppletAvailableUsers ====
Line 641: Line 898:     
Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
 
Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
 +
 +
==== SetApplicationMemoryReservation ====
 +
Takes an input u64, no output.
 +
 +
An Application must be currently running. The input u64 must be 0x1000-byte aligned.
 +
 +
==== ShouldSetGpuTimeSliceManually ====
 +
No input, returns an output u8 bool.
 +
 +
==== Cmd160 ====
 +
No input, returns an output u64. Currently always returns 0.
    
== IOverlayAppletProxy ==
 
== IOverlayAppletProxy ==
 +
This is "nn::am::service::IOverlayAppletProxy".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 664: Line 934:  
|-
 
|-
 
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
 
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
 +
|-
 +
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
 
|-
 
|-
 
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
 
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
Line 669: Line 941:     
=== IOverlayFunctions ===
 
=== IOverlayFunctions ===
 +
This is "nn::am::service::IOverlayFunctions".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 693: Line 967:  
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
 
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
 
|-
 
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
+
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled
 +
|-
 +
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
 +
|-
 +
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
 +
|-
 +
| 40 || [18.0.0+]
 +
|-
 +
| 41 || [18.0.0+]
 +
|-
 +
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
 
|-
 
|-
 
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
 
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
Line 705: Line 989:     
==== GetApplicationIdForLogo ====
 
==== GetApplicationIdForLogo ====
No input, returns an output u64 titleID.
+
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
   −
Gets the application titleID for displaying the logo screen during application launch.
+
Gets the ApplicationId for displaying the logo screen during application launch.
   −
When no application is running, this returns success with titleID=0.
+
When no application is running, this returns success with ApplicationId=0.
    
==== SetGpuTimeSliceBoost ====
 
==== SetGpuTimeSliceBoost ====
Line 725: Line 1,009:  
==== StartShutdownSequenceForOverlay ====
 
==== StartShutdownSequenceForOverlay ====
 
No input/output.
 
No input/output.
 +
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
    
==== StartRebootSequenceForOverlay ====
 
==== StartRebootSequenceForOverlay ====
 
No input/output.
 
No input/output.
 +
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
    
==== SetHandlingHomeButtonShortPressedEnabled ====
 
==== SetHandlingHomeButtonShortPressedEnabled ====
 
Takes an input u8 bool, no output.
 
Takes an input u8 bool, no output.
 +
 +
==== SetHealthWarningShowingState ====
 +
Takes an input u8 bool, no output.
 +
 +
This writes the input bool into state, signals an Event, and returns 0.
 +
 +
==== IsHealthWarningRequired ====
 +
No input, returns an output u8 bool.
    
==== SetRequiresGpuResourceUse ====
 
==== SetRequiresGpuResourceUse ====
Line 739: Line 1,035:  
==== BeginToObserveHidInputForDevelop ====
 
==== BeginToObserveHidInputForDevelop ====
 
No input/output.
 
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 ==
 
== IApplicationProxy ==
 +
This is "nn::am::service::IApplicationProxy".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 765: Line 1,067:     
=== IApplicationFunctions ===
 
=== IApplicationFunctions ===
 +
This is "nn::am::service::IApplicationFunctions".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 +
|-
 +
| 1 || [[#PopLaunchParameter]]
 +
|-
 +
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
 +
|-
 +
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
 +
|-
 +
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
 +
|-
 +
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
 +
|-
 +
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
 +
|-
 +
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
 +
|-
 +
| 20 || [[#EnsureSaveData]]
 
|-
 
|-
| 1 || [[#PopLaunchParameter]] ||
+
| 21 || [[#GetDesiredLanguage]]
 
|-
 
|-
| 10 || [[#CreateApplicationAndPushAndRequestToStart]] ||
+
| 22 || [[#SetTerminateResult]]
 
|-
 
|-
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]] ||
+
| 23 || [[#GetDisplayVersion]]
 
|-
 
|-
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]] ||
+
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
 
|-
 
|-
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]] ||
+
| 25 || [3.0.0+] ExtendSaveData
 
|-
 
|-
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]] ||
+
| 26 || [3.0.0+] GetSaveDataSize
 
|-
 
|-
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]] ||
+
| 27 || [5.0.0+] CreateCacheStorage
 
|-
 
|-
| 20 || EnsureSaveData ||
+
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
 
|-
 
|-
| 21 || [[#GetDesiredLanguage]] ||
+
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
 
|-
 
|-
| 22 || [[#SetTerminateResult]] ||
+
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
 
|-
 
|-
| 23 || [[#GetDisplayVersion]] ||
+
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
 
|-
 
|-
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
+
| 32 || [[#BeginBlockingHomeButton]]
 
|-
 
|-
| 25 || [3.0.0+] ExtendSaveData ||
+
| 33 || [[#EndBlockingHomeButton]]
 
|-
 
|-
| 26 || [3.0.0+] GetSaveDataSize ||
+
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
 
|-
 
|-
| 27 || [5.0.0+] CreateCacheStorage ||
+
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
 
|-
 
|-
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]] ||
+
| 36 || [14.0.0+] GetLimitedApplicationLicense
 
|-
 
|-
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]] ||
+
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
 
|-
 
|-
| 32 || [[#BeginBlockingHomeButton]] ||
+
| 40 || [[#NotifyRunning]]
 
|-
 
|-
| 33 || [[#EndBlockingHomeButton]] ||
+
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
 
|-
 
|-
| 40 || [[#NotifyRunning]] ||
+
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
 
|-
 
|-
| 50 || [2.0.0+] [[#GetPseudoDeviceId]] ||
+
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
 
|-
 
|-
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]] ||
+
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
 
|-
 
|-
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]] ||
+
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
 
|-
 
|-
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]] ||
+
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
 
|-
 
|-
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]] ||
+
| 70 || [3.0.0+] [[#RequestToShutdown]]
 
|-
 
|-
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]] ||
+
| 71 || [3.0.0+] [[#RequestToReboot]]
 
|-
 
|-
| 70 || [3.0.0+] [[#RequestToShutdown]] ||
+
| 72 || [10.0.0+] [[#RequestToSleep]]
 
|-
 
|-
| 71 || [3.0.0+] [[#RequestToReboot]] ||
+
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
 
|-
 
|-
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]] ||
+
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
 
|-
 
|-
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]] ||
+
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]  
 
|-
 
|-
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]] ||
+
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
 
|-
 
|-
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]] ||
+
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
 
|-
 
|-
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]] ||
+
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
 
|-
 
|-
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]] ||
+
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
 
|-
 
|-
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]] ||
+
| 120 || [5.0.0+] [[#ExecuteProgram]]
 
|-
 
|-
| 120 || [5.0.0+] [[#ExecuteProgram]] ||
+
| 121 || [5.0.0+] [[#ClearUserChannel]]
 
|-
 
|-
| 121 || [5.0.0+] [[#ClearUserChannel]] ||
+
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
 
|-
 
|-
| 122 || [5.0.0+] [[#UnpopToUserChannel]] ||
+
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
 
|-
 
|-
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]] ||
+
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
 
|-
 
|-
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]] ||
+
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
 
|-
 
|-
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
+
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
 
|-
 
|-
| 500 || [5.0.0+] StartContinuousRecordingFlushForDebug ||
+
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
 
|-
 
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]] ||
+
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]  
 
|-
 
|-
| 1001 || [5.0.0+] [[#PrepareForJit]] ||
+
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
|}
+
|-
 
+
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
The BOTW game uses this GamePlayRecording functionality from the main-nso "nninitStartup" function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):
+
|-
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
+
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.
+
|-
* Closes the TransferMemory handle, + TransferMemory cleanup.
+
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]
* Uses [[#SetGamePlayRecordingState]] with value 0x1.
+
|-
 +
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]
 +
|-
 +
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]
 +
|-
 +
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]
 +
|-
 +
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
 +
|-
 +
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
 +
|-
 +
| 1000 || [5.0.0+] [[#CreateMovieMaker]]
 +
|-
 +
| 1001 || [5.0.0+] [[#PrepareForJit]]
 +
|}
 +
 
 +
The BOTW game uses this GamePlayRecording functionality from the main-nso "nninitStartup" function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):
 +
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.
 +
* 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]].
 
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].
   Line 871: Line 1,211:     
==== CreateApplicationAndPushAndRequestToStart ====
 
==== CreateApplicationAndPushAndRequestToStart ====
Takes an input u64 titleID and an input [[#IStorage]], no output. titleID=0 can be used to relaunch the current application.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.
    
==== CreateApplicationAndPushAndRequestToStartForQuest ====
 
==== CreateApplicationAndPushAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input u64 titleID, and an input [[#IStorage]], no output.
+
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.
    
==== CreateApplicationAndRequestToStart ====
 
==== CreateApplicationAndRequestToStart ====
Takes an input u64 titleID, no output.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
    
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
 
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
    
==== CreateApplicationAndRequestToStartForQuest ====
 
==== CreateApplicationAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input u64 titleID, no output.
+
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.
    
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
 
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
    
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
 
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Takes an input u64 titleID, a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
    
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndPushAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
 
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndPushAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
    
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
 
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
Takes an input u64 titleID and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
    
Same as [[#CreateApplicationAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
 
Same as [[#CreateApplicationAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
 +
 +
==== EnsureSaveData ====
 +
Takes an input u128 userID, returns an output u64 size.
 +
 +
Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.
 +
 +
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
 +
 +
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
    
==== GetDesiredLanguage ====
 
==== GetDesiredLanguage ====
Line 912: Line 1,261:  
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
 
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
   −
Just returns two u8s loaded from state.
+
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
 +
 
 +
==== GetSaveDataSizeMax ====
 +
No input, returns two ouput s64s.
 +
 
 +
==== GetCacheStorageMax ====
 +
No input, returns an output s32 and s64.
    
==== BeginBlockingHomeButtonShortAndLongPressed ====
 
==== BeginBlockingHomeButtonShortAndLongPressed ====
Line 931: Line 1,286:  
==== EndBlockingHomeButton ====
 
==== EndBlockingHomeButton ====
 
No input/output.
 
No input/output.
 +
 +
==== SelectApplicationLicense ====
 +
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].
 +
 +
==== GetDeviceSaveDataSizeMax ====
 +
No input, returns two output s64s.
    
==== NotifyRunning ====
 
==== NotifyRunning ====
Line 954: Line 1,315:  
==== RequestFlushGamePlayingMovieForDebug ====
 
==== RequestFlushGamePlayingMovieForDebug ====
 
No input/output.
 
No input/output.
 +
 +
Requests to save the video recording, as if the Capture-button was held.
    
==== RequestToShutdown ====
 
==== RequestToShutdown ====
 
No input/output.
 
No input/output.
 +
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
    
==== RequestToReboot ====
 
==== RequestToReboot ====
 +
No input/output.
 +
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
 +
 +
==== RequestToSleep ====
 
No input/output.
 
No input/output.
   Line 964: Line 1,334:  
No input/output.
 
No input/output.
   −
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this.
+
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.
 
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
Line 977: Line 1,349:     
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
 
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
 +
 +
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.
    
This is used as an overlay for screenshots.
 
This is used as an overlay for screenshots.
    
==== SetApplicationCopyrightImage ====
 
==== SetApplicationCopyrightImage ====
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 '''WindowOriginMode''', and no output.
+
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.
 
  −
The last s32 is "nn::oe::WindowOriginMode". This should be at least 1.
      
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
 
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
Line 995: Line 1,367:     
==== QueryApplicationPlayStatistics ====
 
==== QueryApplicationPlayStatistics ====
Takes a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of u64 titleIDs. Returns an output s32 for actual total output entries.
+
Takes a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of [[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.
    
The number of entries in each array is the same.
 
The number of entries in each array is the same.
Line 1,004: Line 1,376:     
==== QueryApplicationPlayStatisticsByUid ====
 
==== QueryApplicationPlayStatisticsByUid ====
Takes a u128 userID, a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of u64 titleIDs. Returns an output s32 for actual total output entries.
+
Takes a u128 userID, a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of [[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.
    
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
 
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
Line 1,025: Line 1,397:  
==== GetPreviousProgramIndex ====
 
==== GetPreviousProgramIndex ====
 
No input, returns an output s32.
 
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 ====
 
==== EnableApplicationAllThreadDumpOnCrash ====
Line 1,032: Line 1,406:  
No input, returns an output Event handle with autoclear=false.
 
No input, returns an output Event handle with autoclear=false.
   −
This is used by sdknso during applet-application initialization. A seperate thread is setup where event-waiting is handled. When the Event is signaled, official sw will assert.
+
This is used by sdknso during applet-application initialization. A separate thread is setup where event-waiting is handled. When the Event is signaled, official sw will Abort.
 +
 
 +
==== 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 <code>nn::friends::</code>. 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 <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.
 +
 
 +
==== GetNotificationStorageChannelEvent ====
 +
No input, returns an output Event handle with EventClearMode=0.
 +
 
 +
This is exposed by sdknso under <code>nn::notification::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.
 +
 
 +
==== TryPopFromNotificationStorageChannel ====
 +
No input, returns an output [[#IStorage]].
 +
 
 +
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
 +
 
 +
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.
 +
 
 +
==== GetHealthWarningDisappearedSystemEvent ====
 +
No input, returns an output Event with EventClearMode=0.
 +
 
 +
==== SetHdcpAuthenticationActivated ====
 +
Takes an input u8 bool, no output.
 +
 
 +
==== GetLaunchRequiredVersion ====
 +
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].
 +
 
 +
sdknso passes hard-coded value 0 for the u64.
 +
 
 +
==== UpgradeLaunchRequiredVersion ====
 +
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.
 +
 
 +
sdknso passes hard-coded value 0 for the u64.
 +
 
 +
==== SendServerMaintenanceOverlayNotification ====
 +
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.
 +
 
 +
The second input value can optionally be 0.
 +
 
 +
==== GetLastApplicationExitReason ====
 +
No input, returns an output s32.
 +
 
 +
==== StartContinuousRecordingFlushForDebug ====
 +
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
 +
 
 +
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
    
==== CreateMovieMaker ====
 
==== CreateMovieMaker ====
Takes an input u64 and handle, returns an [[#IMovieMaker]].
+
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 ====
 
==== PrepareForJit ====
Takes no input. Launches title 010000000000003B (currently not present on retail systems) if some context variable is not set, with that context variable being initialized afterwards.
+
Takes no input. Launches the [[JIT_services|jit-sysmodule]] via [[NS_Services|ns]] LaunchLibraryApplet if it has not already been launched for the current application, storing a std::shared_ptr<> for jit-sysmodule process tracking object as an IApplicationFunctions member.
 +
 
 +
~IApplicationFunctions() includes:
 +
 
 +
    if (this->jit_process) {
 +
        Terminate(this->jit_process);
 +
        this->jit_process = nullptr;
 +
    }
 +
 
 +
Thus the lifetime of the jit sysmodule is tied to the application which uses it, and each application gets its own fresh copy of the jit sysmodule.
 +
 
 +
AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
    
=== IMovieMaker ===
 
=== IMovieMaker ===
 +
This is "nn::am::service::IMovieMaker".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,057: Line 1,504:     
== ILibraryAppletCreator ==
 
== ILibraryAppletCreator ==
 +
This is "nn::am::service::ILibraryAppletCreator".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,081: Line 1,530:     
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
 
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 ===
 
=== AreAnyLibraryAppletsLeft ===
Line 1,086: Line 1,537:     
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
 
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 ===
 
=== CreateStorage ===
Line 1,105: Line 1,558:     
=== ILibraryAppletAccessor ===
 
=== ILibraryAppletAccessor ===
 +
This is "nn::am::service::ILibraryAppletAccessor".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,122: Line 1,577:  
|-
 
|-
 
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
 
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
 +
|-
 +
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
 
|-
 
|-
 
| 100 || [[#PushInData]] ||  
 
| 100 || [[#PushInData]] ||  
Line 1,152: Line 1,609:     
Official sw will assert prior to using this if applet-service was not initialized as *Application.
 
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 [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.
    
==== PushInData ====
 
==== PushInData ====
Line 1,169: Line 1,631:     
==== GetPopOutDataEvent ====
 
==== GetPopOutDataEvent ====
No input, returns an output handle.
+
No input, returns an output handle with autoclear=false.
    
==== GetPopInteractiveOutDataEvent ====
 
==== GetPopInteractiveOutDataEvent ====
Line 1,190: Line 1,652:     
== ICommonStateGetter ==
 
== ICommonStateGetter ==
 +
This is "nn::am::service::ICommonStateGetter".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! 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]]
 +
|-
 +
| 20 || [[#PushToGeneralChannel]]
 +
|-
 +
| 30 || [[#GetHomeButtonReaderLockAccessor]]
 
|-
 
|-
| 0 || [[#GetEventHandle]] ||
+
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
 
|-
 
|-
| 1 || [[#ReceiveMessage]] ||
+
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
 
|-
 
|-
| 2 || [[#GetThisAppletKind]] ||
+
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
 
|-
 
|-
| 3 || [[#AllowToEnterSleep]] ||
+
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
 
|-
 
|-
| 4 || [[#DisallowToEnterSleep]] ||
+
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
 
|-
 
|-
| 5 || [[#GetOperationMode]] ||
+
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
 
|-
 
|-
| 6 || [[#GetPerformanceMode]] ||
+
| 53 || [7.0.0+] [[#BeginVrModeEx]]
 
|-
 
|-
| 7 || [[#GetCradleStatus]] ||
+
| 54 || [7.0.0+] [[#EndVrModeEx]]
 
|-
 
|-
| 8 || [[#GetBootMode]] ||
+
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
 
|-
 
|-
| 9 || [[#GetCurrentFocusState]] ||
+
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
 
|-
 
|-
| 10 || [[#RequestToAcquireSleepLock]] ||
+
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
 
|-
 
|-
| 11 || [[#ReleaseSleepLock]] ||
+
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
 
|-
 
|-
| 12 || [[#ReleaseSleepLockTransiently]] ||
+
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
 
|-
 
|-
| 13 || [[#GetAcquiredSleepLockEvent]] ||
+
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
 
|-
 
|-
| 20 || [[#PushToGeneralChannel]] ||
+
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
 
|-
 
|-
| 30 || [[#GetHomeButtonReaderLockAccessor]] ||
+
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
 
|-
 
|-
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]] ||
+
| 66 || [6.0.0+] [[#SetCpuBoostMode]]
 
|-
 
|-
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]] ||
+
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]
 
|-
 
|-
| 40 || [2.0.0+] [[#GetCradleFwVersion]] ||
+
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]
 
|-
 
|-
| 50 || [3.0.0+] [[#IsVrModeEnabled]] ||
+
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]
 
|-
 
|-
| 51 || [3.0.0+] [[#SetVrModeEnabled]] ||
+
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]
 
|-
 
|-
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]] ||
+
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
 
|-
 
|-
| 53 || [7.0.0+] [[#BeginVrModeEx]] ||
+
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
 
|-
 
|-
| 54 || [7.0.0+] [[#EndVrModeEx]] ||
+
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]
 
|-
 
|-
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]] ||
+
| 120 || [13.0.0+] GetAppletLaunchedHistory
 
|-
 
|-
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]] ||
+
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
 
|-
 
|-
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]] ||
+
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]
 
|-
 
|-
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]] ||
+
| 400 || [10.0.0+] [[#ActivateMigrationService]]
 
|-
 
|-
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]] ||
+
| 401 || [10.0.0+] [[#DeactivateMigrationService]]
 
|-
 
|-
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]] ||
+
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]
 
|-
 
|-
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]] ||
+
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]
 
|-
 
|-
| 66 || [6.0.0+] [[#SetCpuBoostMode]] ||
+
| 502 || [12.0.0+] IsSleepEnabled
 
|-
 
|-
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]] ||
+
| 503 || [12.0.0+] IsDisablingSleepSuppressed
 
|-
 
|-
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]] ||
+
| 600 || [17.0.0+] OpenNamedChannelAsChild
 
|-
 
|-
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
+
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
 
|-
 
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
+
| 910 || [17.0.0+] GetLaunchRequiredTick
 
|}
 
|}
   −
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]]).
+
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, [[Parental_Control_services|pctl]] IsStereoVisionPermitted is used and error 0xD08E is thrown if not allowed by pctl.
 
[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.
Line 1,275: Line 1,773:     
=== ReceiveMessage ===
 
=== ReceiveMessage ===
No input. Returns an output u32. Error 0x680 indicates no message is available.
+
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.
    
=== GetThisAppletKind ===
 
=== GetThisAppletKind ===
Line 1,296: Line 1,794:     
=== GetPerformanceMode ===
 
=== GetPerformanceMode ===
No input. Returns an output u32 for the current PerformanceMode.
+
No input. Returns an output u32 for the current [[#PerformanceMode]].
    
=== GetCradleStatus ===
 
=== GetCradleStatus ===
Line 1,309: Line 1,807:     
=== GetCurrentFocusState ===
 
=== GetCurrentFocusState ===
No input. Returns an output u8:
+
No input. Returns an output u8 [[#FocusState]].
 
  −
* 1: In focus.
  −
* 2/3: Out of focus(running in "background").
      
=== RequestToAcquireSleepLock ===
 
=== RequestToAcquireSleepLock ===
Line 1,325: Line 1,820:  
=== GetAcquiredSleepLockEvent ===
 
=== GetAcquiredSleepLockEvent ===
 
No input, returns an output Event handle with autoclear=false.
 
No input, returns an output Event handle with autoclear=false.
 +
 +
=== GetWakeupCount ===
 +
No input, returns an output u64.
    
=== PushToGeneralChannel ===
 
=== PushToGeneralChannel ===
Line 1,383: Line 1,881:  
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
   −
=== GetDefaultDisplayResolution ===
+
=== 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'''.
 
No input, returns two output s32s '''width''' and '''height'''.
   Line 1,399: Line 1,908:     
=== GetApplicationIdByContentActionName ===
 
=== GetApplicationIdByContentActionName ===
Takes a type-0x5 input buffer containing a string, returns an output u64 titleID.
+
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].
   −
Gets the application titleID for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (starter).
+
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 ===
 
=== SetCpuBoostMode ===
Takes an input u32 '''CpuBoostMode''' (only modes 0 and 1 are valid) and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
+
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|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 [[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].
    
=== PerformSystemButtonPressingIfInFocus ===
 
=== PerformSystemButtonPressingIfInFocus ===
 
Takes an input [[#SystemButtonType]], no output.
 
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 ===
 
=== SetPerformanceConfigurationChangedNotification ===
Line 1,414: Line 1,935:  
=== GetCurrentPerformanceConfiguration ===
 
=== GetCurrentPerformanceConfiguration ===
 
No input, returns the result of calling [[PPC_services#apm:sys|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 ===
 
=== GetOperationModeSystemInfo ===
 
No input, returns an output u32.
 
No input, returns an output u32.
   −
This returns the output from omm [[#Cmd26]].
+
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"
 +
|-
 +
! 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 <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".
   −
== ISelfController ==
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,458: Line 2,044:  
|-
 
|-
 
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
 
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
 +
|-
 +
| 21 || [13.0.0+] GetScreenShotProgramId
 
|-
 
|-
 
| 40 || [[#CreateManagedDisplayLayer]]
 
| 40 || [[#CreateManagedDisplayLayer]]
Line 1,466: Line 2,054:  
|-
 
|-
 
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
 
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
 +
|-
 +
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
 +
|-
 +
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
 +
|-
 +
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]
 
|-
 
|-
 
| 50 || [[#SetHandlesRequestToDisplay]]
 
| 50 || [[#SetHandlesRequestToDisplay]]
Line 1,494: Line 2,088:  
|-
 
|-
 
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
 
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
 +
|-
 +
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
 
|-
 
|-
 
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
 
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
Line 1,504: Line 2,100:  
|-
 
|-
 
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
 
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
 +
|-
 +
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]
 +
|-
 +
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
 
|-
 
|-
 
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
 
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
Line 1,510: Line 2,110:  
=== Exit ===
 
=== Exit ===
 
No input/output.
 
No input/output.
 +
 +
Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
    
=== LockExit ===
 
=== LockExit ===
Line 1,561: Line 2,163:  
Takes an input u8 bool flag, no output.
 
Takes an input u8 bool flag, no output.
   −
See [[#NotificationMessage]].
+
See [[#AppletMessage]].
    
=== SetScreenShotAppletIdentityInfo ===
 
=== SetScreenShotAppletIdentityInfo ===
Line 1,577: Line 2,179:  
Takes an input u8 bool flag, no output.
 
Takes an input u8 bool flag, no output.
   −
See [[#NotificationMessage]].
+
See [[#AppletMessage]].
    
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
 
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
Line 1,612: Line 2,214:     
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
 
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]]. <code>nn::vi::CreateRecordingLayer</code> 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 <code>nn::vi::SetRecordingLayerEnabled(bool)</code>.
 +
 +
The input u32 must be 0-1.
 +
 +
=== SetRecordingLayerCompositionEnabled ===
 +
Takes an input bool, no output.
    
=== SetHandlesRequestToDisplay ===
 
=== SetHandlesRequestToDisplay ===
Line 1,618: Line 2,235:  
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
 
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
   −
See [[#NotificationMessage]].
+
See [[#AppletMessage]].
    
=== ApproveToDisplay ===
 
=== ApproveToDisplay ===
Line 1,678: Line 2,295:     
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
 
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
 +
 +
=== SetInputDetectionPolicy ===
 +
Takes an input [[#InputDetectionPolicy]], no output.
    
=== SetWirelessPriorityMode ===
 
=== SetWirelessPriorityMode ===
Takes an input s32 enum '''WirelessPriorityMode''', no output.
+
Takes an input s32 [[#WirelessPriorityMode]], no output.
 
  −
The input value must be 1 or 2.
      
=== GetAccumulatedSuspendedTickValue ===
 
=== GetAccumulatedSuspendedTickValue ===
Line 1,697: Line 2,315:  
Takes an input u8 bool, no output.
 
Takes an input u8 bool, no output.
   −
See [[#NotificationMessage]].
+
See [[#AppletMessage]].
    
=== SetApplicationAlbumUserData ===
 
=== SetApplicationAlbumUserData ===
Line 1,705: Line 2,323:     
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.
 
The size must be <=0x400. The input buffer is copied to a buffer loaded from a state ptr (throwing an error when the state ptr is not set), with the u32 size being written to statebuf+0x400 afterwards.
 +
 +
=== SaveCurrentScreenshot ===
 +
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.
 +
 +
sdknso exposes this under "nn::album::".
 +
 +
=== SetRecordVolumeMuted ===
 +
Takes an input bool, no output.
    
=== GetDebugStorageChannel ===
 
=== GetDebugStorageChannel ===
Line 1,712: Line 2,338:     
== IStorageChannel ==
 
== IStorageChannel ==
Added with [[7.0.0]].
+
This is "nn::am::service::IStorageChannel".
 +
 
 +
This was added with [7.0.0+].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,730: Line 2,358:     
== IWindowController ==
 
== IWindowController ==
 +
This is "nn::am::service::IWindowController".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,786: Line 2,416:     
== IAudioController ==
 
== IAudioController ==
 +
This is "nn::am::service::IAudioController".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,821: Line 2,453:     
== IDisplayController ==
 
== IDisplayController ==
 +
This is "nn::am::service::IDisplayController".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,978: Line 2,612:     
=== ClearCaptureBuffer ===
 
=== ClearCaptureBuffer ===
Takes an input u8 bool, an s32, and an u32, returns no output.
+
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 ===
 
=== ClearAppletTransitionBuffer ===
 
Takes an input u32, no output.
 
Takes an input u32, no output.
 +
 +
Clear the AppletTransitionBuffer with the specified RGBA8 color.
    
=== AcquireLastApplicationCaptureSharedBuffer ===
 
=== AcquireLastApplicationCaptureSharedBuffer ===
Line 2,019: Line 2,657:     
== ISystemAppletControllerForDebug ==
 
== ISystemAppletControllerForDebug ==
 +
This is "nn::am::service::ISystemAppletControllerForDebug".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 +
|-
 +
| 1 || RequestLaunchApplicationForDebug
 
|-
 
|-
| 1 || RequestLaunchApplicationForDebug ||  
+
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]
 
|-
 
|-
| 2 || [7.0.0+] GetDebugStorageChannel || No input, returns an output [[#IStorageChannel]].
+
| 3 || [7.0.0+] [[#CreateStorageForDebug]]
 
|-
 
|-
| 3 || [7.0.0+] CreateStorageForDebug || Takes a total of 8-bytes of input, returns an [[#IStorage]].
+
| 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 ==
 
== IProcessWindingController ==
 +
This is "nn::am::service::IProcessWindingController".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 2,081: Line 2,734:     
== IDebugFunctions ==
 
== IDebugFunctions ==
 +
This is "nn::am::service::IDebugFunctions".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || NotifyMessageToHomeMenuForDebug ||
+
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
 
|-
 
|-
| 1 || [[#OpenMainApplication]] ||
+
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
 
|-
 
|-
| 10 || EmulateButtonEvent ||
+
| 10 || [[#PerformSystemButtonPressing]]
 
|-
 
|-
| 20 || InvalidateTransitionLayer ||
+
| 20 || [[#InvalidateTransitionLayer]]
 
|-
 
|-
| 30 || [6.0.0+] RequestLaunchApplicationWithUserAndArgumentForDebug ||
+
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
 
|-
 
|-
| 40 || [6.0.0+] GetAppletResourceUsageInfo ||
+
| 31 || [12.0.0+] RequestLaunchApplicationByApplicationLaunchInfoForDebug
 
|-
 
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
+
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
|}
  −
 
  −
=== OpenMainApplication ===
  −
No input, returns an output [[#IApplicationAccessor]].
  −
 
  −
=== SetCpuBoostModeForApplet ===
  −
Takes an input u32 '''CpuBoostMode''' (only modes 0 and 1 are valid) and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
  −
 
  −
== IStorage ==
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name || Notes
+
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
 
|-
 
|-
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
+
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
 
|-
 
|-
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
+
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
|}
+
|-
 
+
| 53 || [18.0.0+]
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]].
+
|-
 
+
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
Only 1 *Accessor session can be open for each IStorage at a time.
+
|-
 
+
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
== IStorageAccessor ==
+
|-
{| class="wikitable" border="1"
+
| 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]]
 
|-
 
|-
! Cmd || Name || Notes
+
| 140 || [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug
 
|-
 
|-
| 0 || GetSize || No input. Returns an s64.
+
| 200 || [15.0.0+] CreateFloatingLibraryAppletAccepterForDebug
 
|-
 
|-
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
+
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
 
|-
 
|-
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
+
| 410 || [18.0.0+]
|}
  −
 
  −
== ITransferStorageAccessor ==
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name || Notes
+
| 411 || [18.0.0+]
 
|-
 
|-
| 0 || GetSize || No input. Returns an output s64.
+
| 412 || [18.0.0+]
 
|-
 
|-
| 1 || GetHandle || No input. Returns an output s64 and handle.
+
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
 
|}
 
|}
   −
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
+
=== NotifyMessageToHomeMenuForDebug ===
 +
Takes an input [[#AppletMessage]], no output.
   −
= appletOE =
+
Stubbed, just returns an error.
This is "nn::am::service::IApplicationProxyService".
     −
{| class="wikitable" border="1"
+
=== OpenMainApplication ===
|-
+
No input, returns an output [[#IApplicationAccessor]].
! 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.
+
Should not be used when no Application is running (svcBreak).
   −
== OpenApplicationProxy ==
+
=== PerformSystemButtonPressing ===
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
+
Takes an input [[#SystemButtonType]], no output.
   −
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).
+
=== InvalidateTransitionLayer ===
 +
No input/output.
   −
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
+
=== 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.
   −
= idle:sys =
+
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]]).
This is "nn::idle::detail::IPolicyManagerSystem"
     −
{| class="wikitable" border="1"
+
=== GetAppletResourceUsageInfo ===
|-
+
No input, returns an output [[#AppletResourceUsageInfo]].
! 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.
+
=== SetCpuBoostModeForApplet ===
 +
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
   −
= omm =
+
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
This is "nn::omm::detail::IOperationModeManager"
+
 
 +
=== 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.
   −
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
+
== IStorage ==
Besides [[PTM_services]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
+
This is "nn::am::service::IStorage".
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 2,197: Line 2,880:  
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 
|-
 
|-
| 0 || GetOperationMode ||  
+
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
 
|-
 
|-
| 1 || GetOperationModeChangeEvent ||
+
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
|-
  −
| 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+] ||
   
|}
 
|}
   −
== Cmd26 ==
+
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]].
No input, returns an output u32.
     −
This is used by [[#GetOperationModeSystemInfo]].
+
Only 1 *Accessor session can be open for each IStorage at a time.
   −
= spsm =
+
== IStorageAccessor ==
This is "nn::spsm::detail::IPowerStateInterface".
+
This is "nn::am::service::IStorageAccessor".
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Cmd || Name || Notes
 
|-
 
|-
| 0 || GetState
+
| 0 || GetSize || No input. Returns an s64.
 
|-
 
|-
| 1 || SleepSystemAndWaitAwake
+
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
 
|-
 
|-
| 2 ||
+
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
|-
  −
| 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.
+
== ITransferStorageAccessor ==
 
+
This is "nn::am::service::ITransferStorageAccessor".
= tcap =
  −
This is "nn::tcap::server::IManager".
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Cmd || Name || Notes
 
|-
 
|-
| 0 || GetContinuousHighSkinTemperatureEvent
+
| 0 || GetSize || No input. Returns an output s64.
 
|-
 
|-
| 1 || SetOperationMode
+
| 1 || GetHandle || No input. Returns an output s64 and handle.
|-
  −
| 2 || LoadAndApplySettings
   
|}
 
|}
   −
= caps:su =
+
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
This is "nn::capsrv::sf::IScreenShotApplicationService".
     −
This was added with [[6.0.0]].
+
= appletOE =
 
+
This is "nn::am::service::IApplicationProxyService".
This can be used by applications to save screenshots.
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 2,316: Line 2,924:  
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 
|-
 
|-
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.
+
| 0 || [[#OpenApplicationProxy]] ||  
|-
  −
| 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.
+
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.
   −
== SaveScreenShot ==
+
== OpenApplicationProxy ==
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer. Returns a 0x20-byte struct '''ApplicationAlbumEntry'''.
+
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
   −
Official user-processes doesn't use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero except +0 is set to an input u32.
+
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).
   −
== SaveScreenShotEx0 ==
+
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
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'''.
     −
= Library Applets =
+
= idle:sys =
This section documents library applet launching.
+
This is "nn::idle::detail::IPolicyManagerSystem"
   −
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.
+
This was moved to [[OMM_services|omm]] with [14.0.0+].
 
  −
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"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Typical Value || Notes
+
! Cmd || Name
 
|-
 
|-
| 0x0 || 4 || 1 || Common Arguments version
+
| 0 || GetAutoPowerDownEvent
 
|-
 
|-
| 0x4 || 4 || 0x20 || Common Arguments size
+
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
 
|-
 
|-
| 0x8 || 4 || || Library applet version (API version)
+
| 2 || [1.0.0-3.0.2]
 
|-
 
|-
| 0xC || 4 || 0 || Theme color
+
| 3 || [[#SetHandlingContext]]
 
|-
 
|-
| 0x10 || 1 || 0 || Play startup sound
+
| 4 || LoadAndApplySettings
|-
  −
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
   
|-
 
|-
 +
| 5 || ReportUserIsActive
 
|}
 
|}
   −
= Enums =
+
== SetHandlingContext ==
=== AppletId ===
+
[3.0.0+] Now takes an additional 0x10-bytes of input.
See also [[:Category:Library Applets]].
+
 
 +
[13.0.0+] Total input size is now 0x30 instead of 0x38.
 +
 
 +
= omm =
 +
This is "nn::omm::detail::IOperationModeManager"
 +
 
 +
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
 +
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
 +
 
 +
This was moved to [[OMM_services|omm]] with [14.0.0+].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! ID
+
! Cmd || Name
!  Title-id
  −
!  Description
   
|-
 
|-
| 0x01
+
| 0 || GetOperationMode
|  
+
|-
| Application. Not valid for use with LibraryApplets.
+
| 1 || GetOperationModeChangeEvent
 
|-
 
|-
| 0x02
+
| 2 || EnableAudioVisual
| 010000000000100C
  −
| "overlayDisp"
   
|-
 
|-
| 0x03
+
| 3 || DisableAudioVisual
| 0100000000001000
  −
| "qlaunch"
   
|-
 
|-
| 0x04
+
| 4 || EnterSleepAndWait
| 0100000000001012
  −
| "starter"
   
|-
 
|-
| 0x0A
+
| 5 || GetCradleStatus
| 0100000000001001
  −
| [[Auth_Applet|"auth"]]
   
|-
 
|-
| 0x0B
+
| 6 || FadeInDisplay
| 0100000000001002
  −
| "cabinet"
   
|-
 
|-
| 0x0C
+
| 7 || FadeOutDisplay
| 0100000000001003
  −
| "controller"
   
|-
 
|-
| 0x0D
+
| 8 || [2.0.0+] GetCradleFwVersion
| 0100000000001004
  −
| "dataErase"
   
|-
 
|-
| 0x0E
+
| 9 || [2.0.0+] NotifyCecSettingsChanged
| 0100000000001005
  −
| [[Error_Applet|"error"]]
   
|-
 
|-
| 0x0F
+
| 10 || [3.0.0+] SetOperationModePolicy
| 0100000000001006
  −
| "netConnect"
   
|-
 
|-
| 0x10
+
| 11 || [3.0.0+] GetDefaultDisplayResolution
| 0100000000001007
  −
| [[Profile_Selector|"playerSelect"]]
   
|-
 
|-
| 0x11
+
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
| 0100000000001008
  −
| [[Software_Keyboard|"swkbd"]]
   
|-
 
|-
| 0x12
+
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
| 0100000000001009
  −
| "miiEdit"
   
|-
 
|-
| 0x13
+
| 14 || [3.0.0+] ShouldSleepOnBoot
| 010000000000100A
  −
| "LibAppletWeb" [[Internet_Browser#010000000000100A|WebApplet]] applet
   
|-
 
|-
| 0x14
+
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
| 010000000000100B
  −
| "LibAppletShop" [[Internet_Browser#ShopN|ShopN]] applet
   
|-
 
|-
| 0x15
+
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
| 010000000000100D
  −
| "photoViewer"
   
|-
 
|-
| 0x16
+
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
| 010000000000100E
  −
| "set"
   
|-
 
|-
| 0x17
+
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
| 010000000000100F
  −
| "LibAppletOff" [[Internet_Browser#Offline_Applet|Offline]] applet
   
|-
 
|-
| 0x18
+
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
| 0100000000001010
  −
| "LibAppletLns" [[Internet_Browser#Whitelisted_Applets|Whitelisted]] applet
   
|-
 
|-
| 0x19
+
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
| 0100000000001011
  −
| "LibAppletAuth" [[Internet_Browser#WifiWebAuthApplet|WifiWebAuth]] applet
   
|-
 
|-
| 0x1A
+
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
| 0100000000001013
  −
| "myPage"
  −
|}
  −
 
  −
=== LibraryAppletMode ===
  −
{| class="wikitable" border="1"
   
|-
 
|-
!  ID
+
| 22 || [4.0.0+] GetHdcpStateChangeEvent
!  Description
   
|-
 
|-
| 0x0
+
| 23 || [4.0.0+] GetHdcpState
| AllForeground
   
|-
 
|-
| 0x1
+
| 24 || [5.0.0+] ShowCardUpdateProcessing
| Background
   
|-
 
|-
| 0x2
+
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
| No UI
   
|-
 
|-
| 0x3
+
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
| Background with indirect display, see also [[#GetIndirectLayerConsumerHandle]]. Only used by swkbd InlineKeyboard.
   
|-
 
|-
| 0x4
+
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
| AllForegroundInitiallyHidden. Can be used by [7.0.0+] [[Internet_Browser|WebSession]].
   
|-
 
|-
 +
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]
 
|}
 
|}
   −
=== NotificationMessage ===
+
== 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"
 
{| class="wikitable" border="1"
 
|-
 
|-
! ID
+
! Cmd || Name
!  Description
  −
|-
  −
| 0x4 || Exit requested
  −
|-
  −
| 0xF || [[#GetCurrentFocusState|FocusState]] changed
   
|-
 
|-
| 0x10 || Current applet execution was [[#SetRestartMessageEnabled|resumed]].
+
| 0 || Start
 
|-
 
|-
| 0x1E || OperationMode changed
+
| 1 || Finish
 
|-
 
|-
| 0x1F || PerformanceMode changed
+
| 2 || GetUpdateDeviceStatus
 
|-
 
|-
| 0x33 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]. Indicates that [[#ApproveToDisplay]] should be used.
+
| 3 || GetUpdateProgress
 
|-
 
|-
| 0x5A || Capture button was [[#SetRequiresCaptureButtonShortPressedMessage|short-pressed]].
+
| 4 || GetUpdateDeviceStatusChangeEvent
 
|-
 
|-
| 0x5C || Screenshot was [[#SetAlbumImageTakenNotificationEnabled|taken]].
+
| 5 || GetUpdateProgress2
 
|}
 
|}
   −
=== OperationMode ===
+
= spsm =
 +
This is "nn::spsm::detail::IPowerStateInterface".
 +
 
 +
This was moved to [[OMM_services|omm]] with [14.0.0+].
 +
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Value
+
! Cmd || Name
!  Description
   
|-
 
|-
| 0 || Handheld
+
| 0 || GetCurrentState
 
|-
 
|-
| 1 || Docked
+
| 1 || EnterSleep
|}
  −
 
  −
=== TvPowerStateMatchingMode ===
  −
{| class="wikitable" border="1"
   
|-
 
|-
!  Value
+
| 2 || GetLastWakeReason
!  Description
   
|-
 
|-
| 0 || Unknown
+
| 3 || Shutdown
 
|-
 
|-
| 1 || Unknown
+
| 4 || GetNotificationMessageEventHandle
|}
  −
 
  −
This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
  −
 
  −
=== SystemButtonType ===
  −
{| class="wikitable" border="1"
   
|-
 
|-
!  Value
+
| 5 || ReceiveNotificationMessage
!  Description
   
|-
 
|-
| 1 || PerformHomeButtonShortPressing
+
| 6 || AnalyzeLogForLastSleepWakeSequence
 
|-
 
|-
| 2 || PerformHomeButtonLongPressing
+
| 7 || ResetEventLog
 
|-
 
|-
| 6 || PerformCaptureButtonShortPressing
+
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
 
|-
 
|-
| 7 || PerformCaptureButtonLongPressing
+
| 9 || ChangeHomeButtonLongPressingTime
 +
|-
 +
| 10 || PutErrorState
 +
|-
 +
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
 
|}
 
|}
   −
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]].
+
[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+].
   −
=== LaunchParameterKind ===
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Value
+
! Cmd || Name
!  Description
   
|-
 
|-
| 1 || Application-specific LaunchParameter
+
| 0 || GetContinuousHighSkinTemperatureEvent
 
|-
 
|-
| 2 || account PreselectedUser
+
| 1 || SetOperationMode
 
|-
 
|-
| 3 || Unknown if used by anything?
+
| 2 || LoadAndApplySettings
 
|}
 
|}
   −
=== LibraryAppletExitReason ===
+
= 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"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Value
+
! Cmd || Name || Notes
!  Description
   
|-
 
|-
| 0 || Normal
+
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.
 +
|-
 +
| 201 || SaveScreenShot ||  
 
|-
 
|-
| 1 || Canceled
+
| 203 || SaveScreenShotEx0 ||  
 
|-
 
|-
| 2 || Abnormal
+
| 205 || [8.0.0+] SaveScreenShotEx1 ||  
 
|-
 
|-
| 10 || Unexpected
+
| 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.
 
|}
 
|}
   −
=== ProgramSpecifyKind ===
+
'''SetShimLibraryVersion''' is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
{| class="wikitable" border="1"
+
 
|-
+
== SaveScreenShot ==
!  Value
+
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
!  Description
+
 
|-
+
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.
| 0 || u8 ProgramIndex. "ExecuteProgram". User-process enters an infinite svcSleepThread loop afterwards.
+
 
|-
+
This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
| 1 || u64 titleID. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
+
 
|-
+
== SaveScreenShotEx0 ==
| 2 || u64 = value 0. "RestartProgram"
+
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]].
   −
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
+
= apm =
 +
This is "nn::am::service::IApmManager".
   −
= AppletResourceUserId =
+
This was added with [8.0.0+].
This u64 is officially called "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
     −
= AppletAttribute =
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 +
|-
 +
| 0 || [[#OpenSession]]
 
|-
 
|-
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
+
| 1 || GetPerformanceMode
 
|-
 
|-
| 0x1 || 0x7F || Unused
+
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
 
|}
 
|}
   −
This is "nn::am::AppletAttribute". This struct is 0x8-bytes.
+
== OpenSession ==
 +
Returns an [[#ISession]].
   −
This is used by [[#OpenLibraryAppletProxy]].
+
== IsCpuOverclockEnabled ==
 +
No input, returns an output u8 bool.
 +
 
 +
== ISession ==
 +
This is "nn::am::service::IApmSession".
   −
= AppletProcessLaunchReason =
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 
|-
 
|-
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].
+
| 0 || SetPerformanceConfiguration
 
|-
 
|-
| 0x1 || 0x2 || Always 0.
+
| 1 || GetPerformanceConfiguration
 
|-
 
|-
| 0x3 || 0x1 || Always 0.
+
| 2 || [8.0.0+] SetCpuOverclockEnabled
 
|}
 
|}
   −
This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
+
= Library Applets =
 +
This section documents library applet launching.
   −
= LibraryAppletInfo =
+
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.
{| class="wikitable" border="1"
+
 
 +
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
 
|-
 
|-
! Offset || Size || Description
+
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
 
|-
 
|-
| 0x0 || 0x4 || [[#AppletId]]
+
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
 
|-
 
|-
| 0x4 || 0x4 || [[#LibraryAppletMode]]
+
| 0x8 || 0x8 || Unknown. The default is 0x0.
 
|}
 
|}
   −
This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
+
= AppletResourceUsageInfo =
 +
This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
   −
= AppletKind =
  −
This is "nn::am::service::AppletKind". This is 8-bytes.
  −
  −
= AppletIdentityInfo =
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || [[#AppletId]]
+
| 0x0 || 0x4 || Unknown counter.
 +
|-
 +
| 0x4 || 0x4 || Unknown counter.
 
|-
 
|-
| 0x4 || 0x4 || Padding
+
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
 
|-
 
|-
| 0x8 || 0x8 || titleID
+
| 0xC || 0x14 || Always zero.
 
|}
 
|}
   −
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
+
= ApplicationLicenseType =
 
+
This is "nn::oe::ApplicationLicenseType". This is 1-byte.
= 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".
+
= LaunchRequiredVersion =
 +
This is "nn::oe::LaunchRequiredVersion". This is a 0x40-byte struct with 1-byte alignment.
   −
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).
+
= ServerEnvironmentType =
 +
This is "nn::oe::ServerEnvironmentType".
   −
= ApplicationAttribute =
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Value
 +
! Description
 +
|-
 +
| 0 || dd
 
|-
 
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
+
| 1 || lp
 
|-
 
|-
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
+
| 2 || sd
 
|-
 
|-
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
+
| 3 || sp
 
|-
 
|-
| 0xC || 0x14 || Unused. Default is 0.
+
| 4 || dp
 
|}
 
|}
   −
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
+
= 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).
   −
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
+
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.
 
  −
= 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]]

Navigation menu