Changes

Jump to navigation Jump to search
42,531 bytes added ,  16:33, 7 December 2019
Line 20: Line 20:  
| 350 || OpenSystemApplicationProxy || Returns an [[#IApplicationProxy]].
 
| 350 || OpenSystemApplicationProxy || Returns an [[#IApplicationProxy]].
 
|-
 
|-
| 400 || CreateSelfLibraryAppletCreatorForDevelop || Returns an [[#ILibraryAppletCreator]].
+
| 400 || [[#CreateSelfLibraryAppletCreatorForDevelop]] ||
 
|-
 
|-
| 410 || [6.0.0+] GetSystemAppletControllerForDebug || Returns an [[#ISystemAppletControllerForDebug]].
+
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||
 
|-
 
|-
| 1000 || [6.0.0+] GetDebugFunctions || Returns an [[#IDebugFunctions]].
+
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||
 
|}
 
|}
   −
All of these commands except [[#OpenLibraryAppletProxy]] take the same input as [[#OpenApplicationProxy]], with the same user-process retry-loop as [[#OpenApplicationProxy]]. These Open*Proxy commands (including appletOE) doesn't seem to usable from processes which aren't actual applets (such as sysmodules), at least for applet-types which aren't already in use.
+
All of these Open*Proxy commands except [[#OpenLibraryAppletProxy]] take the same input as [[#OpenApplicationProxy]], with the same user-process retry-loop as [[#OpenApplicationProxy]]. These Open*Proxy commands (including appletOE) doesn't seem to usable from processes which aren't actual applets (such as sysmodules), at least for applet-types which aren't already in use.
 +
 
 +
OpenLibraryAppletProxyOld eventually calls the same func as [[#OpenLibraryAppletProxy]], except that the [[#AppletAttribute]] is all-zero.
    
This service is used by all system non-regular-applications.
 
This service is used by all system non-regular-applications.
Line 41: Line 43:  
Returns an [[#ILibraryAppletProxy]].
 
Returns an [[#ILibraryAppletProxy]].
   −
Takes a [[IPC_Marshalling|reserved]] input u64(official user-processes use hard-coded value 0), a PID,a process copy-handle(cur-proc handle alias), and an 0x80-byte type-0x15 input buffer '''AppletAttribute'''.
+
Takes a [[IPC_Marshalling|reserved]] input u64(official user-processes use hard-coded value 0), a PID,a process copy-handle(cur-proc handle alias), and a type-0x15 input buffer containing an [[#AppletAttribute]].
    
Official user-processes use the same retry loop with this as the other Open*Proxy commands.
 
Official user-processes use the same retry loop with this as the other Open*Proxy commands.
 +
 +
== CreateSelfLibraryAppletCreatorForDevelop ==
 +
Takes a PID and an input u64 pid_placeholder, returns an [[#ILibraryAppletCreator]].
 +
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 +
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
 +
 +
== GetSystemAppletControllerForDebug ==
 +
No input, returns an [[#ISystemAppletControllerForDebug]].
 +
 +
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, and various state checks must pass, otherwise 0 is returned with no output interface.
 +
 +
== GetDebugFunctions ==
 +
No input, returns an [[#IDebugFunctions]].
 +
 +
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise 0 is returned with no output interface.
    
== ISystemAppletProxy ==
 
== ISystemAppletProxy ==
Line 80: Line 99:  
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 
|-
 
|-
| 10 || RequestToGetForeground ||  
+
| 10 || [[#RequestToGetForeground]] ||  
 
|-
 
|-
| 11 || LockForeground ||
+
| 11 || [[#LockForeground]] ||
 
|-
 
|-
| 12 || UnlockForeground ||  
+
| 12 || [[#UnlockForeground]] ||  
 
|-
 
|-
 
| 20 || [[#PopFromGeneralChannel]] ||  
 
| 20 || [[#PopFromGeneralChannel]] ||  
Line 94: Line 113:  
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]] ||  
 
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]] ||  
 
|-
 
|-
| 100 || [6.0.0+] PopRequestLaunchApplicationForDebug ||
+
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]] ||
 
|-
 
|-
| 200 || [8.0.0+] LaunchDevMenu ||
+
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]] ||
 +
|-
 +
| 200 || [8.0.0+] [[#LaunchDevMenu]] ||
 
|}
 
|}
 +
 +
==== RequestToGetForeground ====
 +
No input/output.
 +
 +
==== LockForeground ====
 +
No input/output.
 +
 +
==== UnlockForeground ====
 +
No input/output.
    
==== PopFromGeneralChannel ====
 
==== PopFromGeneralChannel ====
Line 103: Line 133:     
==== GetPopFromGeneralChannelEvent ====
 
==== GetPopFromGeneralChannelEvent ====
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=false.
    
==== GetHomeButtonWriterLockAccessor ====
 
==== GetHomeButtonWriterLockAccessor ====
 
No input, returns an output [[#ILockAccessor]].
 
No input, returns an output [[#ILockAccessor]].
 +
 +
Similar to using [[#GetWriterLockAccessorEx]] with inval=0.
    
==== GetWriterLockAccessorEx ====
 
==== GetWriterLockAccessorEx ====
 
Takes an input u32, returns an output [[#ILockAccessor]].
 
Takes an input u32, returns an output [[#ILockAccessor]].
 +
 +
The input value must be 0-3. 0 = HomeButton.
 +
 +
==== PopRequestLaunchApplicationForDebug ====
 +
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output [[NCM_services#ApplicationId|ApplicationId]] and an output s32 '''total_userIDs'''.
 +
 +
The total entries in the userID buffer must be >= {total userIDs in state}.
 +
 +
==== IsForceTerminateApplicationDisabledForDebug ====
 +
No input, returns an output u8 bool.
 +
 +
When the cached value loaded from [[Settings_services#GetDebugModeFlag]] is 0 this will just set the bool to 0. Otherwise, the bool is loaded using data from [[System_Settings|system-setting]] <code>am.debug!disable_force_terminate_application</code>.
 +
 +
==== LaunchDevMenu ====
 +
No input/output.
 +
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 +
Uses [[NS_Services#IApplicationManagerInterface]] cmd99.
 +
 +
This is used by [[qlaunch]]. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
    
==== ILockAccessor ====
 
==== ILockAccessor ====
Line 116: Line 169:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 1 || TryLock
+
| 1 || [[#TryLock]]
 
|-
 
|-
| 2 || Unlock
+
| 2 || [[#Unlock]]
 
|-
 
|-
 
| 3 || [[#GetEvent]]
 
| 3 || [[#GetEvent]]
 
|}
 
|}
   −
===== GetEvent =====
+
===== TryLock =====
No input, returns an output handle.
+
Takes an input u8 bool flag, returns an output u8 bool flag and a handle.
 +
 
 +
Official sw waits on the previously loaded event from [[#GetEvent]]. The output flag indicates whether locking was successful, the user-process can try using this cmd again when flag=false.
 +
 
 +
Official sw only uses inflag=false. Official sw just closes the output handle. The input flag controls whether this returns the output handle.
 +
 
 +
===== Unlock =====
 +
No input/output.
 +
 
 +
===== GetEvent =====
 +
No input, returns an output Event handle with autoclear=false.
    
=== IGlobalStateController ===
 
=== IGlobalStateController ===
Line 131: Line 194:  
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 
|-
 
|-
| 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]] ||  
 
|}
 
|}
 +
 +
==== RequestToEnterSleep ====
 +
No input/output.
 +
 +
Stubbed, just returns an error.
 +
 +
==== EnterSleep ====
 +
No input/output.
 +
 +
Stubbed, just returns an error.
 +
 +
==== StartSleepSequence ====
 +
Takes an input u8 bool, no output.
 +
 +
Official sw uses hard-coded input value = 1.
 +
 +
==== StartShutdownSequence ====
 +
No input/output.
 +
 +
==== StartRebootSequence ====
 +
No input/output.
    
==== IsAutoPowerDownRequested ====
 
==== IsAutoPowerDownRequested ====
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
 +
 +
Uses [[#idle:sys]] cmd1.
 +
 +
==== LoadAndApplyIdlePolicySettings ====
 +
No input/output.
 +
 +
Uses [[#idle:sys]] cmd LoadAndApplySettings.
 +
 +
==== NotifyCecSettingsChanged ====
 +
No input/output.
 +
 +
Uses [[#omm]] cmd NotifyCecSettingsChanged.
 +
 +
==== SetDefaultHomeButtonLongPressTime ====
 +
Takes an input s64, no output.
 +
 +
==== UpdateDefaultDisplayResolution ====
 +
No input/output.
 +
 +
Uses [[#omm]] cmd UpdateDefaultDisplayResolution.
    
==== ShouldSleepOnBoot ====
 
==== ShouldSleepOnBoot ====
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
 +
 +
Uses [[#omm]] cmd ShouldSleepOnBoot.
 +
 +
==== GetHdcpAuthenticationFailedEvent ====
 +
No input, returns an output Event handle with autoclear=false.
 +
 +
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.
    
=== IApplicationCreator ===
 
=== IApplicationCreator ===
Line 175: Line 286:  
| 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 183: Line 296:     
==== 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 ====
Line 197: Line 314:  
| 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]] ||  
 
|-
 
|-
| 120 || GetApplicationId ||  
+
| 120 || [[#GetApplicationId]] ||  
 
|-
 
|-
 
| 121 || [[#PushLaunchParameter]] ||  
 
| 121 || [[#PushLaunchParameter]] ||  
Line 219: Line 336:  
| 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]] ||
 
|}
 
|}
    
Commands <=30 are inherited from [[#IAppletAccessor]].
 
Commands <=30 are inherited from [[#IAppletAccessor]].
 +
 +
===== RequestForApplicationToGetForeground =====
 +
No input/output.
    
===== GetCurrentLibraryApplet =====
 
===== GetCurrentLibraryApplet =====
 
No input, returns an output [[#IAppletAccessor]].
 
No input, returns an output [[#IAppletAccessor]].
 +
 +
===== GetApplicationId =====
 +
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
    
===== PushLaunchParameter =====
 
===== PushLaunchParameter =====
Takes an input u32 and an input [[#IStorage]], no output.
+
Takes an input u32 [[#LaunchParameterKind]] and an input [[#IStorage]], no output.
   −
==== SetApplicationAttribute ====
+
===== GetApplicationControlProperty =====
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
+
No input, takes a type-0x6 output buffer.
   −
==== GetApplicationControlProperty ====
+
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.  
No input, takes a type-0x6 output buffer.
      
This gets the application [[NACP_Format|control.nacp]].
 
This gets the application [[NACP_Format|control.nacp]].
   −
===== IAppletAccessor =====
+
===== GetApplicationLaunchProperty =====
{| class="wikitable" border="1"
+
Takes a type-0x6 output buffer.
|-
+
 
! Cmd || Name
+
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.
|-
+
 
| 0 || [[#GetAppletStateChangedEvent]]
+
This gets the [[#ApplicationLaunchProperty]].
|-
+
 
 +
===== GetApplicationLaunchRequestInfo =====
 +
No input, returns an output 0x10-byte struct.
 +
 
 +
This gets the [[#ApplicationLaunchRequestInfo]] from state. The output struct is "nn::applet::ApplicationLaunchRequestInfo".
 +
 
 +
===== SetUsers =====
 +
Takes an input u8 bool flag and a type-0x5 input buffer containing an array of u128 userIDs.
 +
 
 +
The total entries for the userIDs must be <=8.
 +
 
 +
When the input flag is true, this just clears the '''users_available''' state flag to 0 and returns.
 +
 
 +
===== CheckRightsEnvironmentAvailable =====
 +
No input, returns an output u8 bool.
 +
 
 +
===== GetNsRightsEnvironmentHandle =====
 +
No input, returns an output u64.
 +
 
 +
===== GetDesirableUids =====
 +
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output s32 '''total_entries'''.
 +
 
 +
Gets a userID listing, this is unrelated to [[#SetUsers]]. [[qlaunch]] only uses 1 userID with this.
 +
 
 +
The stored entry-count in state must be <= <size of output buffer in entries>.
 +
 
 +
===== ReportApplicationExitTimeout =====
 +
No input/output.
 +
 
 +
===== SetApplicationAttribute =====
 +
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
 +
 
 +
===== HasSaveDataAccessPermission =====
 +
Takes an input [[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.
 +
 
 +
===== IAppletAccessor =====
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || [[#GetAppletStateChangedEvent]]
 +
|-
 
| 1 || [[#IsCompleted]]
 
| 1 || [[#IsCompleted]]
 
|-
 
|-
Line 297: Line 480:  
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 
|-
 
|-
| 10 || ReadThemeStorage || Takes an input u64 '''offset''' and a type-0x22 output buffer, returns an output u64 '''actual_transfer_size'''.
+
| 0 || [9.0.0+] [[#SetTerminateResult]] ||  
 
|-
 
|-
| 11 || WriteThemeStorage || Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
+
| 10 || [[#ReadThemeStorage]] ||  
 
|-
 
|-
| 40 || [8.0.0+] GetDisplayLogicalResolution ||  
+
| 11 || [[#WriteThemeStorage]] ||  
 
|-
 
|-
| 42 || [8.0.0+] SetDisplayMagnification ||  
+
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]] ||  
 
|-
 
|-
| 50 || [8.0.0+] SetHomeButtonDoubleClickEnabled ||  
+
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]] ||  
 
|-
 
|-
| 51 || [8.0.0+] GetHomeButtonDoubleClickEnabled ||  
+
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]] ||
 +
|-
 +
| 42 || [8.0.0+] [[#SetDisplayMagnification]] ||
 +
|-
 +
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]] ||
 +
|-
 +
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]] ||  
 
|}
 
|}
   −
These commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes.
+
ReadThemeStorage/WriteThemeStorage: these commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes. The default content of the ThemeStorage prior to using the WriteThemeStorage cmd, is: <code>memset(statebuf, 0xAA, 0x400);</code>
 +
 
 +
=== ReadThemeStorage ===
 +
Takes an input u64 '''offset''' and a type-0x22 output buffer, returns an output u64 '''actual_transfer_size'''.
 +
 
 +
=== WriteThemeStorage ===
 +
Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
 +
 
 +
=== PushToAppletBoundChannel ===
 +
Takes an input [[#IStorage]], no output.
 +
 
 +
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
 +
 
 +
=== TryPopFromAppletBoundChannel ===
 +
No input, returns an output [[#IStorage]].
 +
 
 +
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
 +
 
 +
=== GetDisplayLogicalResolution ===
 +
No input, returns an output s32 '''width''' and s32 '''height'''.
 +
 
 +
=== SetDisplayMagnification ===
 +
Takes an input float '''x''', float '''y''', float '''width''', and float '''height''', no output.
 +
 
 +
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.
 +
 
 +
'''x''' and '''width''' are multiplied with the same width value returned by [[#GetDisplayLogicalResolution]], so these should be in the range 0.0f-1.0f. Likewise for y and height, except these are multipled with the height value.
 +
 
 +
=== SetHomeButtonDoubleClickEnabled ===
 +
Takes an input u8 bool, no output.
 +
 
 +
=== GetHomeButtonDoubleClickEnabled ===
 +
No input, returns an output u8 bool.
    
== ILibraryAppletProxy ==
 
== ILibraryAppletProxy ==
Line 359: Line 580:  
| 11 || [[#GetLibraryAppletInfo]] ||
 
| 11 || [[#GetLibraryAppletInfo]] ||
 
|-
 
|-
| 12 || GetMainAppletIdentityInfo ||
+
| 12 || [[#GetMainAppletIdentityInfo]] ||
 
|-
 
|-
 
| 13 || [[#CanUseApplicationCore]] ||
 
| 13 || [[#CanUseApplicationCore]] ||
 
|-
 
|-
| 14 || GetCallerAppletIdentityInfo ||
+
| 14 || [[#GetCallerAppletIdentityInfo]] ||
 
|-
 
|-
 
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
 
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||
Line 369: Line 590:  
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
 
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||
 
|-
 
|-
| 17 || [3.0.0+] GetCallerAppletIdentityInfoStack ||
+
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||
 
|-
 
|-
| 18 || [4.0.0+] GetNextReturnDestinationAppletIdentityInfo ||
+
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||
 
|-
 
|-
| 19 || [4.0.0+] GetDesirableKeyboardLayout ||
+
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||
 
|-
 
|-
 
| 20 || [[#PopExtraStorage]] ||  
 
| 20 || [[#PopExtraStorage]] ||  
Line 383: Line 604:  
| 31 || [[#UnpopExtraStorage]] ||  
 
| 31 || [[#UnpopExtraStorage]] ||  
 
|-
 
|-
| 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]] ||
 
|-
 
|-
| 70 || [8.0.0+] GetCurrentApplicationId ||
+
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||
 
|-
 
|-
| 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]] ||
 +
|-
 +
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
 
|-
 
|-
| 102 || [5.0.0+] UnreserveResourceForMovieOperation ||
+
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
 
|-
 
|-
| 110 || [6.0.0+] GetMainAppletAvailableUsers ||
+
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
 
|}
 
|}
   Line 419: Line 644:     
==== 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.
 
  −
==== GetMainAppletApplicationControlProperty ====
  −
No input, takes a type-0x16 output buffer.
  −
 
  −
This gets the [[NACP_Format|control.nacp]].
  −
 
  −
==== GetMainAppletStorageId ====
  −
No input, returns an output u8 storageId.
      
==== ExitProcessAndReturn ====
 
==== ExitProcessAndReturn ====
Line 436: Line 653:     
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).
 +
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
    
==== GetLibraryAppletInfo ====
 
==== GetLibraryAppletInfo ====
No input. Returns an output [[#LibraryAppletInfo]].
+
No input, returns an output [[#LibraryAppletInfo]].
 +
 
 +
==== GetMainAppletIdentityInfo ====
 +
No input, returns an output [[#AppletIdentityInfo]].
    
==== CanUseApplicationCore ====
 
==== CanUseApplicationCore ====
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
 +
 +
==== GetCallerAppletIdentityInfo ====
 +
No input, returns an output [[#AppletIdentityInfo]].
 +
 +
==== GetMainAppletApplicationControlProperty ====
 +
No input, takes a type-0x16 output buffer.
 +
 +
This gets the [[NACP_Format|control.nacp]].
 +
 +
==== GetMainAppletStorageId ====
 +
No input, returns an output u8 storageId.
 +
 +
==== GetCallerAppletIdentityInfoStack ====
 +
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.
 +
 +
==== GetNextReturnDestinationAppletIdentityInfo ====
 +
No input, returns an output [[#AppletIdentityInfo]].
 +
 +
==== GetDesirableKeyboardLayout ====
 +
No input, returns an output u32.
 +
 +
The output u32 is "nn::settings::KeyboardLayout".
 +
 +
This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it's not set.
    
==== PopExtraStorage ====
 
==== PopExtraStorage ====
Line 447: Line 693:     
==== GetPopExtraStorageEvent ====
 
==== GetPopExtraStorageEvent ====
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=false.
    
==== UnpopInData ====
 
==== UnpopInData ====
Line 454: Line 700:  
==== UnpopExtraStorage ====
 
==== UnpopExtraStorage ====
 
Takes an input [[#IStorage]], no output.
 
Takes an input [[#IStorage]], no output.
 +
 +
==== GetIndirectLayerProducerHandle ====
 +
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 ====
 
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
 
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].
 +
 +
==== GetCurrentApplicationId ====
 +
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
 +
 +
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.
 +
 +
==== RequestExitToSelf ====
 +
No input/output.
 +
 +
Same as [[#RequestExit]] except this is for the current applet.
 +
 +
==== CreateApplicationAndPushAndRequestToLaunch ====
 +
Takes an input [[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]].
   −
== IOverlayAppletProxy ==
+
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 ====
 +
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 '''total_entries'''.
 +
 
 +
This gets the userIDs previously set by [[#SetUsers]].
 +
 
 +
The size of the output buffer in entries must be at least 8.
 +
 
 +
Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
 +
 
 +
== IOverlayAppletProxy ==
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 492: Line 785:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || BeginToWatchShortHomeButtonMessage
+
| 0 || [[#BeginToWatchShortHomeButtonMessage]]
 
|-
 
|-
| 1 || EndToWatchShortHomeButtonMessage
+
| 1 || [[#EndToWatchShortHomeButtonMessage]]
 
|-
 
|-
| 2 || GetApplicationIdForLogo
+
| 2 || [[#GetApplicationIdForLogo]]
 
|-
 
|-
| 3 || SetGpuTimeSliceBoost
+
| 3 || [[#SetGpuTimeSliceBoost]]
 
|-
 
|-
| 4 || [2.0.0+] SetAutoSleepTimeAndDimmingTimeEnabled
+
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]
 
|-
 
|-
| 5 || [2.0.0+] TerminateApplicationAndSetReason
+
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]
 
|-
 
|-
| 6 || [3.0.0+] SetScreenShotPermissionGlobally
+
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]
 
|-
 
|-
| 10 || [6.0.0+] StartShutdownSequenceForOverlay
+
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]
 
|-
 
|-
| 11 || [6.0.0+] StartRebootSequenceForOverlay
+
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]
 
|-
 
|-
| 20 || [8.0.0+] SetHandlingHomeButtonShortPressedEnabled
+
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
 
|-
 
|-
| 90 || [7.0.0+] SetRequiresGpuResourceUse
+
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
 
|-
 
|-
| 101 || [5.0.0+] BeginToObserveHidInputForDevelop
+
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
 +
|-
 +
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
 
|}
 
|}
   −
==== SetRequiresGpuResourceUse ====
+
==== BeginToWatchShortHomeButtonMessage ====
Takes an input u8, no output.
+
No input/output.
 +
 
 +
==== EndToWatchShortHomeButtonMessage ====
 +
No input/output.
 +
 
 +
==== GetApplicationIdForLogo ====
 +
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
 +
 
 +
Gets the ApplicationId for displaying the logo screen during application launch.
 +
 
 +
When no application is running, this returns success with ApplicationId=0.
 +
 
 +
==== SetGpuTimeSliceBoost ====
 +
Takes an input u64, no output.
 +
 
 +
==== SetAutoSleepTimeAndDimmingTimeEnabled ====
 +
Takes an input u8 bool, no output.
   −
== IApplicationProxy ==
+
==== TerminateApplicationAndSetReason ====
{| class="wikitable" border="1"
+
Takes an input u32 Result, no output.
|-
+
 
! Cmd || Name || Notes
+
==== SetScreenShotPermissionGlobally ====
|-
+
Takes an input u8 bool, no output.
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
+
 
|-
+
==== StartShutdownSequenceForOverlay ====
 +
No input/output.
 +
 
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
 +
 
 +
==== StartRebootSequenceForOverlay ====
 +
No input/output.
 +
 
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
 +
 
 +
==== SetHandlingHomeButtonShortPressedEnabled ====
 +
Takes an input u8 bool, no output.
 +
 
 +
==== SetHealthWarningShowingState ====
 +
Takes an input u8 bool, no output.
 +
 
 +
This writes the input bool into state, signals an Event, and returns 0.
 +
 
 +
==== SetRequiresGpuResourceUse ====
 +
Takes an input u8 bool, no output.
 +
 
 +
Just returns 0.
 +
 
 +
==== BeginToObserveHidInputForDevelop ====
 +
No input/output.
 +
 
 +
Sets various state fields and signals an userspace-event.
 +
 
 +
Enables HID input for the OverlayApplet, without disabling input for the foreground applet.
 +
 
 +
== IApplicationProxy ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
 +
|-
 
| 1 || GetSelfController || Returns an [[#ISelfController]].
 
| 1 || GetSelfController || Returns an [[#ISelfController]].
 
|-
 
|-
Line 563: Line 910:  
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]] ||  
 
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]] ||  
 
|-
 
|-
| 20 || EnsureSaveData ||
+
| 20 || [[#EnsureSaveData]] ||
 
|-
 
|-
 
| 21 || [[#GetDesiredLanguage]] ||
 
| 21 || [[#GetDesiredLanguage]] ||
Line 571: Line 918:  
| 23 || [[#GetDisplayVersion]] ||
 
| 23 || [[#GetDisplayVersion]] ||
 
|-
 
|-
| 24 || [2.0.0+] GetLaunchStorageInfoForDebug ||
+
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
 
|-
 
|-
 
| 25 || [3.0.0+] ExtendSaveData ||
 
| 25 || [3.0.0+] ExtendSaveData ||
Line 579: Line 926:  
| 27 || [5.0.0+] CreateCacheStorage ||
 
| 27 || [5.0.0+] CreateCacheStorage ||
 
|-
 
|-
| 30 || BeginBlockingHomeButtonShortAndLongPressed ||
+
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]] ||
 
|-
 
|-
 
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]] ||
 
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]] ||
Line 589: Line 936:  
| 40 || [[#NotifyRunning]] ||
 
| 40 || [[#NotifyRunning]] ||
 
|-
 
|-
| 50 || [2.0.0+] GetPseudoDeviceId ||
+
| 50 || [2.0.0+] [[#GetPseudoDeviceId]] ||
 
|-
 
|-
 
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]] ||
 
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]] ||
Line 627: Line 974:  
| 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]] ||  
 
|-
 
|-
| 500 || [5.0.0+] StartContinuousRecordingFlushForDebug ||  
+
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]] ||  
 
|-
 
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]] ||  
+
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] ||
 +
|-
 +
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]] ||
 +
|-
 +
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]] ||
 +
|-
 +
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]] ||
 +
|-
 +
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]] ||
 +
|-
 +
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]] ||
 +
|-
 +
| 1000 || [5.0.0+] [[#CreateMovieMaker]] ||  
 
|-
 
|-
 
| 1001 || [5.0.0+] [[#PrepareForJit]] ||
 
| 1001 || [5.0.0+] [[#PrepareForJit]] ||
Line 651: Line 1,010:     
==== 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 [[#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 a [[#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 688: Line 1,056:     
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.
 
The output struct is "nn::oe::DisplayVersion". This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.
 +
 +
==== GetLaunchStorageInfoForDebug ====
 +
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
 +
 +
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
 +
 +
==== BeginBlockingHomeButtonShortAndLongPressed ====
 +
Takes an input s64, no output.
 +
 +
Official user-processes use hard-coded value 0 for the s64.
 +
 +
Starts blocking the Home button.
    
==== EndBlockingHomeButtonShortAndLongPressed ====
 
==== EndBlockingHomeButtonShortAndLongPressed ====
 
No input/output.
 
No input/output.
 +
 +
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].
    
==== BeginBlockingHomeButton ====
 
==== BeginBlockingHomeButton ====
Line 700: Line 1,082:  
==== NotifyRunning ====
 
==== NotifyRunning ====
 
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.
 
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.
 +
 +
==== GetPseudoDeviceId ====
 +
No input, returns an output 0x10-byte "nn::util::Uuid" struct.
 +
 +
The 0x20-byte output data from [[NS_Services|GetSystemSeedForPseudoDeviceId]] followed by the 8-byte [[NACP_Format|SeedForPseudoDeviceId]] from the current control.nacp, is hashed with SHA1. Then "nn::util::GenerateUuidVersion5" is called with the final hash, the output from this is then returned for the Uuid.
    
==== SetMediaPlaybackStateForApplication ====
 
==== SetMediaPlaybackStateForApplication ====
Line 715: Line 1,102:  
==== 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.
 
No input/output.
 +
 +
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
    
==== ExitAndRequestToShowThanksMessage ====
 
==== ExitAndRequestToShowThanksMessage ====
 
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.
    
==== EnableApplicationCrashReport ====
 
==== EnableApplicationCrashReport ====
Line 731: Line 1,128:     
==== InitializeApplicationCopyrightFrameBuffer ====
 
==== InitializeApplicationCopyrightFrameBuffer ====
Takes an input TransferMemory handle, an u32 '''width''', an u32 '''height''', an u64 tmem_size, and no output.
+
Takes an input TransferMemory handle, an s32 '''width''', an s32 '''height''', an u64 tmem_size, and no output.
 +
 
 +
tmem_size must be 0x40000-byte aligned. '''width''' must be 1-1280, and '''height''' must be 1-720.
    
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
 
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
 +
 +
This is used as an overlay for screenshots.
    
==== SetApplicationCopyrightImage ====
 
==== SetApplicationCopyrightImage ====
Takes a type-0x45 input buffer and 5 input s32s, 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".
+
The last s32 is "nn::oe::WindowOriginMode". This should be at least 1.
   −
The first two s32s must not have the negative bit set, and the following two s32s must not be <1.
+
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
 +
 
 +
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.
    
==== SetApplicationCopyrightVisibility ====
 
==== SetApplicationCopyrightVisibility ====
 
Takes an input u8 bool, no output.
 
Takes an input u8 bool, no output.
 +
 +
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it's visible.
    
==== 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 755: Line 1,160:     
==== 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 765: Line 1,170:  
No input/output.
 
No input/output.
   −
Clears the UserChannel.
+
Clears the UserChannel used by [[#UnpopToUserChannel]].
    
==== UnpopToUserChannel ====
 
==== UnpopToUserChannel ====
 
Takes an input [[#IStorage]], no output.
 
Takes an input [[#IStorage]], no output.
   −
The input storage is pushed to the UserChannel, which is also used by [[#ClearUserChannel]].
+
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.
    
User-processes create a storage using data specified by the user (written to offset=0 size=inputsize), with max size 0x1000. This storage is then used with this cmd.
 
User-processes create a storage using data specified by the user (written to offset=0 size=inputsize), with max size 0x1000. This storage is then used with this cmd.
Line 777: Line 1,182:  
No input, returns an output s32.
 
No input, returns an output s32.
   −
==== CreateMovieMaker ====
+
Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.
Takes an input u64 and handle, returns an [[#IMovieMaker]].
+
 
 +
==== EnableApplicationAllThreadDumpOnCrash ====
 +
Takes an input u8 bool, no output.
 +
 
 +
==== GetGpuErrorDetectedSystemEvent ====
 +
No input, returns an output Event handle with autoclear=false.
 +
 
 +
This is used by sdknso during applet-application initialization. A separate thread is setup where event-waiting is handled. When the Event is signaled, official sw will assert.
 +
 
 +
==== 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.
 +
 
 +
==== StartContinuousRecordingFlushForDebug ====
 +
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
 +
 
 +
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
 +
 
 +
==== CreateMovieMaker ====
 +
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].
 +
 
 +
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
 +
 
 +
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
    
==== PrepareForJit ====
 
==== PrepareForJit ====
Takes no input. Launches title 010000000000003B (currently not present on retail systems) if some context variable is set.
+
Takes no input. Launches title 010000000000003B (currently not present on retail systems) if some context variable is not set, with that context variable being initialized afterwards.
    
=== IMovieMaker ===
 
=== IMovieMaker ===
Line 822: Line 1,276:  
=== TerminateAllLibraryApplets ===
 
=== TerminateAllLibraryApplets ===
 
No input/output.
 
No input/output.
 +
 +
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
 +
 +
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
    
=== AreAnyLibraryAppletsLeft ===
 
=== AreAnyLibraryAppletsLeft ===
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
 +
 +
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
 +
 +
Gets whether any LibraryApplets ([[#ILibraryAppletAccessor]]) which were created by the current applet are still open (or by the Application when used from the [[#IApplicationAccessor]] cmd).
    
=== CreateStorage ===
 
=== CreateStorage ===
Line 889: Line 1,351:  
==== SetOutOfFocusApplicationSuspendingEnabled ====
 
==== SetOutOfFocusApplicationSuspendingEnabled ====
 
Takes an input u8 bool, no output.
 
Takes an input u8 bool, no output.
 +
 +
Official sw will assert prior to using this if applet-service was not initialized as *Application.
    
==== PushInData ====
 
==== PushInData ====
Line 906: Line 1,370:     
==== GetPopOutDataEvent ====
 
==== GetPopOutDataEvent ====
No input, returns an output handle.
+
No input, returns an output handle with autoclear=false.
    
==== GetPopInteractiveOutDataEvent ====
 
==== GetPopInteractiveOutDataEvent ====
Line 913: Line 1,377:  
==== NeedsToExitProcess ====
 
==== NeedsToExitProcess ====
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
 +
 +
Stubbed, just returns an error.
    
==== RequestForAppletToGetForeground ====
 
==== RequestForAppletToGetForeground ====
 
No input/output.
 
No input/output.
 +
 +
Stubbed, just returns an error.
    
==== GetIndirectLayerConsumerHandle ====
 
==== GetIndirectLayerConsumerHandle ====
Line 933: Line 1,401:  
| 2 || [[#GetThisAppletKind]] ||
 
| 2 || [[#GetThisAppletKind]] ||
 
|-
 
|-
| 3 || AllowToEnterSleep ||
+
| 3 || [[#AllowToEnterSleep]] ||
 
|-
 
|-
| 4 || DisallowToEnterSleep ||
+
| 4 || [[#DisallowToEnterSleep]] ||
 
|-
 
|-
 
| 5 || [[#GetOperationMode]] ||
 
| 5 || [[#GetOperationMode]] ||
Line 947: Line 1,415:  
| 9 || [[#GetCurrentFocusState]] ||
 
| 9 || [[#GetCurrentFocusState]] ||
 
|-
 
|-
| 10 || RequestToAcquireSleepLock ||
+
| 10 || [[#RequestToAcquireSleepLock]] ||
 
|-
 
|-
| 11 || ReleaseSleepLock ||
+
| 11 || [[#ReleaseSleepLock]] ||
 
|-
 
|-
| 12 || ReleaseSleepLockTransiently ||
+
| 12 || [[#ReleaseSleepLockTransiently]] ||
 
|-
 
|-
 
| 13 || [[#GetAcquiredSleepLockEvent]] ||
 
| 13 || [[#GetAcquiredSleepLockEvent]] ||
Line 963: Line 1,431:  
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]] ||
 
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]] ||
 
|-
 
|-
| 40 || [2.0.0+] GetCradleFwVersion ||
+
| 40 || [2.0.0+] [[#GetCradleFwVersion]] ||
 
|-
 
|-
 
| 50 || [3.0.0+] [[#IsVrModeEnabled]] ||
 
| 50 || [3.0.0+] [[#IsVrModeEnabled]] ||
Line 969: Line 1,437:  
| 51 || [3.0.0+] [[#SetVrModeEnabled]] ||
 
| 51 || [3.0.0+] [[#SetVrModeEnabled]] ||
 
|-
 
|-
| 52 || [4.0.0+] SetLcdBacklighOffEnabled ||
+
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]] ||
 
|-
 
|-
 
| 53 || [7.0.0+] [[#BeginVrModeEx]] ||  
 
| 53 || [7.0.0+] [[#BeginVrModeEx]] ||  
Line 977: Line 1,445:  
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]] ||
 
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]] ||
 
|-
 
|-
| 60 || [3.0.0+] GetDefaultDisplayResolution ||
+
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]] ||
 
|-
 
|-
 
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]] ||
 
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]] ||
 
|-
 
|-
| 62 || [4.0.0+] GetHdcpAuthenticationState ||  
+
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]] ||  
 
|-
 
|-
| 63 || [4.0.0+] GetHdcpAuthenticationStateChangeEvent ||
+
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]] ||
 
|-
 
|-
| 64 || [5.0.0+] SetTvPowerStateMatchingMode ||
+
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]] ||
 
|-
 
|-
| 65 || [5.1.0+] GetApplicationIdByContentActionName ||
+
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]] ||
 
|-
 
|-
 
| 66 || [6.0.0+] [[#SetCpuBoostMode]] ||
 
| 66 || [6.0.0+] [[#SetCpuBoostMode]] ||
 
|-
 
|-
| 80 || [6.0.0+] PerformSystemButtonPressingIfInFocus ||
+
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]] ||
 +
|-
 +
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]] ||
 +
|-
 +
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
 
|-
 
|-
| 90 || [7.0.0+] SetPerformanceConfigurationChangedNotification ||
+
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]] ||
 
|-
 
|-
| 91 || [7.0.0+] GetCurrentPerformanceConfiguration ||
+
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
 
|-
 
|-
| 200 || [7.0.0+] GetOperationModeSystemInfo ||
+
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]] ||
 
|}
 
|}
   −
Officially notification messages are handled by the application itself, not sdk-nso in ExeFS. Official apps call code in sdk-nso which basically uses svcWaitSynchronization with the event from [[#GetEventHandle]] to check whether a message is available, then if so it uses [[#ReceiveMessage]]. The actual handling for message IDs is done in the app itself(see [[#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,008: Line 1,480:     
=== 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 ===
 
No input, returns an output [[#AppletKind]].
 
No input, returns an output [[#AppletKind]].
 +
 +
Stubbed, just returns an error.
 +
 +
=== AllowToEnterSleep ===
 +
No input/output.
 +
 +
Stubbed, just returns an error.
 +
 +
=== DisallowToEnterSleep ===
 +
No input/output.
 +
 +
Stubbed, just returns an error.
    
=== GetOperationMode ===
 
=== GetOperationMode ===
Line 1,021: Line 1,505:  
=== GetCradleStatus ===
 
=== GetCradleStatus ===
 
No input, returns an output u8.
 
No input, returns an output u8.
 +
 +
This uses [[#omm]] GetCradleStatus.
    
=== GetBootMode ===
 
=== GetBootMode ===
Line 1,032: Line 1,518:  
* 1: In focus.
 
* 1: In focus.
 
* 2/3: Out of focus(running in "background").
 
* 2/3: Out of focus(running in "background").
 +
 +
=== RequestToAcquireSleepLock ===
 +
No input/output.
 +
 +
=== ReleaseSleepLock ===
 +
No input/output.
 +
 +
=== ReleaseSleepLockTransiently ===
 +
No input/output.
    
=== GetAcquiredSleepLockEvent ===
 
=== GetAcquiredSleepLockEvent ===
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=false.
    
=== PushToGeneralChannel ===
 
=== PushToGeneralChannel ===
Line 1,047: Line 1,542:  
=== GetHomeButtonReaderLockAccessor ===
 
=== GetHomeButtonReaderLockAccessor ===
 
No input, returns an output [[#ILockAccessor]].
 
No input, returns an output [[#ILockAccessor]].
 +
 +
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
    
=== GetReaderLockAccessorEx ===
 
=== GetReaderLockAccessorEx ===
 
Takes an input u32, returns an output [[#ILockAccessor]].
 
Takes an input u32, returns an output [[#ILockAccessor]].
 +
 +
The input value must be 0-3. 0 = HomeButton.
    
=== GetWriterLockAccessorEx ===
 
=== GetWriterLockAccessorEx ===
 
Takes an input u32, returns an output [[#ILockAccessor]].
 
Takes an input u32, returns an output [[#ILockAccessor]].
 +
 +
The input value must be 0-3. 0 = HomeButton.
 +
 +
=== GetCradleFwVersion ===
 +
No input, returns 4 output u32s.
 +
 +
This uses [[#omm]] GetCradleFwVersion.
    
=== IsVrModeEnabled ===
 
=== IsVrModeEnabled ===
Line 1,063: Line 1,569:     
When the VrMode is set to true, the console shows a screen rendered like vr asking the user to move his face away and hit the 'close' button. When this button is pressed, the console resets the vrMode to false.
 
When the VrMode is set to true, the console shows a screen rendered like vr asking the user to move his face away and hit the 'close' button. When this button is pressed, the console resets the vrMode to false.
 +
 +
=== SetLcdBacklighOffEnabled ===
 +
Takes an input u8 bool, no output.
 +
 +
Sets whether the LCD screen blacklight is turned off.
    
=== BeginVrModeEx ===
 
=== BeginVrModeEx ===
Line 1,076: Line 1,587:  
=== IsInControllerFirmwareUpdateSection ===
 
=== IsInControllerFirmwareUpdateSection ===
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
 +
 +
=== GetDefaultDisplayResolution ===
 +
No input, returns two output s32s '''width''' and '''height'''.
    
=== GetDefaultDisplayResolutionChangeEvent ===
 
=== GetDefaultDisplayResolutionChangeEvent ===
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=true.
 +
 
 +
=== GetHdcpAuthenticationState ===
 +
No input, returns an output s32.
 +
 
 +
=== GetHdcpAuthenticationStateChangeEvent ===
 +
No input, returns an output Event handle with autoclear=true.
 +
 
 +
=== SetTvPowerStateMatchingMode ===
 +
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.
 +
 
 +
=== GetApplicationIdByContentActionName ===
 +
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].
 +
 
 +
Gets the ApplicationId for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (when the current applet isn't a SystemApplication).
    
=== 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''' (only modes 0 and 1 are valid) and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
 +
 +
=== PerformSystemButtonPressingIfInFocus ===
 +
Takes an input [[#SystemButtonType]], no output.
 +
 +
Just returns 0 when a state field is not value 1. Verifies that the input button is allowed, then calls the same func as [[#PerformSystemButtonPressing]] internally.
    
=== SetPerformanceConfigurationChangedNotification ===
 
=== SetPerformanceConfigurationChangedNotification ===
Line 1,090: Line 1,623:     
=== GetOperationModeSystemInfo ===
 
=== GetOperationModeSystemInfo ===
No input, returns a total of 4-bytes of output.
+
No input, returns an output u32.
 +
 
 +
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].
 +
 
 +
=== GetSettingsPlatformRegion ===
 +
No input, returns an output u8.
 +
 
 +
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].
    
== ISelfController ==
 
== ISelfController ==
Line 1,117: Line 1,657:  
| 13 || [[#SetFocusHandlingMode]]
 
| 13 || [[#SetFocusHandlingMode]]
 
|-
 
|-
| 14 || SetRestartMessageEnabled
+
| 14 || [[#SetRestartMessageEnabled]]
 
|-
 
|-
 
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
 
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
Line 1,123: Line 1,663:  
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
 
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
 
|-
 
|-
| 17 || [3.0.0+] SetControllerFirmwareUpdateSection
+
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
 
|-
 
|-
| 18 || [3.0.0+] SetRequiresCaptureButtonShortPressedMessage
+
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
 
|-
 
|-
| 19 || [3.0.0+] [[#SetScreenShotImageOrientation]]
+
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
 
|-
 
|-
| 20 || [4.0.0+] SetDesirableKeyboardLayout
+
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
 
|-
 
|-
 
| 40 || [[#CreateManagedDisplayLayer]]
 
| 40 || [[#CreateManagedDisplayLayer]]
 
|-
 
|-
| 41 || [4.0.0+] IsSystemBufferSharingEnabled
+
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
 
|-
 
|-
| 42 || [4.0.0+] GetSystemSharedLayerHandle
+
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
 
|-
 
|-
| 43 || [5.0.0+] GetSystemSharedBufferHandle
+
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
 
|-
 
|-
| 50 || SetHandlesRequestToDisplay
+
| 50 || [[#SetHandlesRequestToDisplay]]
 
|-
 
|-
| 51 || ApproveToDisplay
+
| 51 || [[#ApproveToDisplay]]
 
|-
 
|-
| 60 || OverrideAutoSleepTimeAndDimmingTime
+
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
 
|-
 
|-
 
| 61 || [[#SetMediaPlaybackState]]
 
| 61 || [[#SetMediaPlaybackState]]
 
|-
 
|-
| 62 || SetIdleTimeDetectionExtension
+
| 62 || [[#SetIdleTimeDetectionExtension]]
 
|-
 
|-
| 63 || GetIdleTimeDetectionExtension
+
| 63 || [[#GetIdleTimeDetectionExtension]]
 
|-
 
|-
| 64 || SetInputDetectionSourceSet
+
| 64 || [[#SetInputDetectionSourceSet]]
 
|-
 
|-
| 65 || [2.0.0+] ReportUserIsActive
+
| 65 || [2.0.0+] [[#ReportUserIsActive]]
 
|-
 
|-
 
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
 
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
Line 1,159: Line 1,699:  
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
 
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
 
|-
 
|-
| 68 || [5.0.0+] SetAutoSleepDisabled
+
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
 
|-
 
|-
| 69 || [5.0.0+] IsAutoSleepDisabled
+
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
 
|-
 
|-
| 70 || [4.0.0+] ReportMultimediaError
+
| 70 || [4.0.0+] [[#ReportMultimediaError]]
 
|-
 
|-
 
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
 
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
 
|-
 
|-
| 80 || [4.0.0+] SetWirelessPriorityMode
+
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
 
|-
 
|-
| 90 || [6.0.0+] GetAccumulatedSuspendedTickValue
+
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
 
|-
 
|-
| 91 || [6.0.0+] GetAccumulatedSuspendedTickChangedEvent
+
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
 +
|-
 +
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
 
|-
 
|-
 
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
 
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
 
|-
 
|-
| 110 || [8.0.0+] SetApplicationAlbumUserData
+
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
 
|-
 
|-
 
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
 
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
Line 1,182: Line 1,724:  
=== 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,207: Line 1,751:  
Takes an input s32. No output.
 
Takes an input s32. No output.
   −
Controls whether screenshot-capture is allowed. 0 = disable, 1 = enable, 2 = unknown.
+
Controls whether screenshot-capture is allowed.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Description
 +
|-
 +
| 0 || Inherit from parent applet
 +
|-
 +
| 1 || Enable
 +
|-
 +
| 2 || Disable
 +
|-
 +
|}
    
=== SetOperationModeChangedNotification ===
 
=== SetOperationModeChangedNotification ===
Line 1,217: Line 1,773:  
=== SetFocusHandlingMode ===
 
=== SetFocusHandlingMode ===
 
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.
 
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.
 +
 +
=== SetRestartMessageEnabled ===
 +
Takes an input u8 bool flag, no output.
 +
 +
See [[#AppletMessage]].
    
=== SetScreenShotAppletIdentityInfo ===
 
=== SetScreenShotAppletIdentityInfo ===
Takes an input 0x10-byte struct AppletIdentityInfo. No output.
+
Takes an input [[#AppletIdentityInfo]], no output.
    
=== SetOutOfFocusSuspendingEnabled ===
 
=== SetOutOfFocusSuspendingEnabled ===
Takes an input u8(bool flag). No output.
+
Takes an input u8 bool flag. No output.
 +
 
 +
=== SetControllerFirmwareUpdateSection ===
 +
Takes an input u8 bool flag, no output.
   −
=== SetScreenShotImageOrientation ===
+
This throws error 0x40280 when the internal state flag already matches the input value.
Takes an input s32. No output.
     −
=== CreateManagedDisplayLayer ===
+
=== SetRequiresCaptureButtonShortPressedMessage ===
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].
+
Takes an input u8 bool flag, no output.
   −
=== SetMediaPlaybackState ===
+
See [[#AppletMessage]].
Takes an input u8 bool, no output.
     −
=== GetCurrentIlluminance ===
+
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
No input, returns an output float.
+
 
 +
=== SetAlbumImageOrientation ===
 +
Takes an input u32 "nn::album::ImageOrientation". No output.
 +
 
 +
The input value must not be >3.
 +
 
 +
=== SetDesirableKeyboardLayout ===
 +
Takes an input u32, no output.
 +
 
 +
The input u32 is "nn::settings::KeyboardLayout".
 +
 
 +
=== CreateManagedDisplayLayer ===
 +
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].
 +
 
 +
=== IsSystemBufferSharingEnabled ===
 +
No input/output.
   −
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
+
Not available when the current applet is an Application ([[#AppletId]] == 0x01).
   −
=== IsIlluminanceAvailable ===
+
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
No input, returns an output u8 bool.
     −
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
+
=== GetSystemSharedLayerHandle ===
 +
No input, returns two output u64s "nn::vi::fbshare::SharedBufferHandle" and "nn::vi::fbshare::SharedLayerHandle".
   −
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).
+
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
   −
=== GetCurrentIlluminanceEx ===
+
=== GetSystemSharedBufferHandle ===
No input, returns an output u8 bool and float.
+
No input, returns an output u64 "nn::vi::fbshare::SharedBufferHandle".
   −
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
+
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.
   −
=== SetAlbumImageTakenNotificationEnabled ===
+
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
Takes an input u8, no output.
     −
=== GetDebugStorageChannel ===
+
=== SetHandlesRequestToDisplay ===
Returns an output [[#IStorageChannel]].
+
Takes an input u8 bool, no output.
   −
== IStorageChannel ==
+
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
Added with [[7.0.0]].
     −
{| class="wikitable" border="1"
+
See [[#AppletMessage]].
|-
  −
! Cmd || Name || Notes
  −
|-
  −
| 0 || Push || No input, returns an output [[#IStorage]].
  −
|-
  −
| 1 || Unpop || No input, returns an output [[#IStorage]].
  −
|-
  −
| 2 || Pop || No input, returns an output [[#IStorage]].
  −
|-
  −
| 3 || GetPopEventHandle || No input, returns an output handle.
  −
|-
  −
| 4 || Clear || No input/output.
  −
|}
     −
== IWindowController ==
+
=== ApproveToDisplay ===
{| class="wikitable" border="1"
+
No input/output.
|-
  −
! Cmd || Name || Notes
  −
|-
  −
| 0 || [[#CreateWindow]] ||
  −
|-
  −
| 1 || [[#GetAppletResourceUserId]] ||
  −
|-
  −
| 2 || [6.0.0+] GetAppletResourceUserIdOfCallerApplet ||
  −
|-
  −
| 10 || [[#AcquireForegroundRights]] ||
  −
|-
  −
| 11 || ReleaseForegroundRights ||
  −
|-
  −
| 12 || RejectToChangeIntoBackground ||
  −
|-
  −
| 20 || [7.0.0+] SetAppletWindowVisibility || Takes an input u8, no output.
  −
|-
  −
| 21 || [7.0.0+] SetAppletGpuTimeSlice || Takes a total of 8-bytes of input, no output.
  −
|}
     −
=== CreateWindow ===
+
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].
Takes an input u32, returns an output [[#IWindow]].
     −
=== GetAppletResourceUserId ===
+
=== OverrideAutoSleepTimeAndDimmingTime ===
Returns an output u64: [[#AppletResourceUserId]].
+
Takes 4 input s32s, no output.
   −
=== AcquireForegroundRights ===
+
=== SetMediaPlaybackState ===
 +
Takes an input u8 bool, no output.
 +
 
 +
=== SetIdleTimeDetectionExtension ===
 +
Takes an input u32, no output.
 +
 
 +
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.
 +
 
 +
=== GetIdleTimeDetectionExtension ===
 +
No input, returns an output u32.
 +
 
 +
Returns the value set by [[#SetIdleTimeDetectionExtension]].
 +
 
 +
=== SetInputDetectionSourceSet ===
 +
Takes an input u32, no output.
 +
 
 +
=== ReportUserIsActive ===
 
No input/output.
 
No input/output.
   −
== IAudioController ==
+
Uses idle:sys ReportUserIsActive.
{| class="wikitable" border="1"
+
 
|-
+
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.
! Cmd || Name
+
 
|-
+
=== GetCurrentIlluminance ===
| 0 || SetExpectedMasterVolume
+
No input, returns an output float.
|-
  −
| 1 || GetMainAppletExpectedMasterVolume
  −
|-
  −
| 2 || GetLibraryAppletExpectedMasterVolume
  −
|-
  −
| 3 || ChangeMainAppletMasterVolume
  −
|-
  −
| 4 || SetTransparentVolumeRate
  −
|}
     −
GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.
+
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.
   −
== IDisplayController ==
+
=== IsIlluminanceAvailable ===
{| class="wikitable" border="1"
+
No input, returns an output u8 bool.
|-
+
 
! Cmd || Name
+
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.
|-
+
 
| 0 || GetLastForegroundCaptureImage
+
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).
|-
+
 
| 1 || UpdateLastForegroundCaptureImage
+
=== SetAutoSleepDisabled ===
|-
+
Takes an input u8 bool, no output.
| 2 || GetLastApplicationCaptureImage
+
 
|-
+
=== IsAutoSleepDisabled ===
| 3 || GetCallerAppletCaptureImage
+
No input, returns an output u8 bool.
|-
+
 
| 4 || UpdateCallerAppletCaptureImage
+
=== ReportMultimediaError ===
|-
+
Takes an input Result and a type-0x5 input buffer, no output.
| 5 || GetLastForegroundCaptureImageEx
+
 
|-
+
The buffer contains a 0x138-byte "movie::MultimediaTelemetryReport" struct.
| 6 || GetLastApplicationCaptureImageEx
+
 
|-
+
=== GetCurrentIlluminanceEx ===
| 7 || GetCallerAppletCaptureImageEx
+
No input, returns an output u8 bool and float.
|-
+
 
| 8 || [2.0.0+] TakeScreenShotOfOwnLayer
+
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
|-
+
 
| 9 || [5.0.0+] CopyBetweenCaptureBuffers
+
=== SetInputDetectionPolicy ===
|-
+
Takes an input [[#InputDetectionPolicy]], no output.
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
+
 
|-
+
=== SetWirelessPriorityMode ===
| 11 || ReleaseLastApplicationCaptureBuffer
+
Takes an input s32 enum '''WirelessPriorityMode''', no output.
|-
+
 
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
+
The input value must be 1 or 2.
|-
+
 
| 13 || ReleaseLastForegroundCaptureBuffer
+
=== GetAccumulatedSuspendedTickValue ===
|-
+
No input, returns an output u64 tick value.
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
+
 
 +
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.
 +
 
 +
=== GetAccumulatedSuspendedTickChangedEvent ===
 +
No input, returns an output Event handle with autoclear=true.
 +
 
 +
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.
 +
 
 +
=== SetAlbumImageTakenNotificationEnabled ===
 +
Takes an input u8 bool, no output.
 +
 
 +
See [[#AppletMessage]].
 +
 
 +
=== SetApplicationAlbumUserData ===
 +
Takes a type-0x21 input buffer, no output.
 +
 
 +
The buffer contains arbitrary UserData.
 +
 
 +
The size must be <=0x400. The input buffer is copied to a buffer loaded from a state ptr (throwing an error when the state ptr is not set), with the u32 size being written to statebuf+0x400 afterwards.
 +
 
 +
=== GetDebugStorageChannel ===
 +
No input, returns an output [[#IStorageChannel]].
 +
 
 +
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
 +
 
 +
== IStorageChannel ==
 +
Added with [[7.0.0]].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 15 || ReleaseCallerAppletCaptureBuffer
+
! Cmd || Name || Notes
 
|-
 
|-
| 16 || AcquireLastApplicationCaptureBufferEx
+
| 0 || Push || No input, returns an output [[#IStorage]].
 
|-
 
|-
| 17 || AcquireLastForegroundCaptureBufferEx
+
| 1 || Unpop || No input, returns an output [[#IStorage]].
 
|-
 
|-
| 18 || AcquireCallerAppletCaptureBufferEx
+
| 2 || Pop || No input, returns an output [[#IStorage]].
 
|-
 
|-
| 20 || [3.0.0+] ClearCaptureBuffer
+
| 3 || GetPopEventHandle || No input, returns an output handle.
 
|-
 
|-
| 21 || [3.0.0+] ClearAppletTransitionBuffer
+
| 4 || Clear || No input/output.
 +
|}
 +
 
 +
== IWindowController ==
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 22 || [4.0.0+] AcquireLastApplicationCaptureSharedBuffer
+
! Cmd || Name || Notes
 
|-
 
|-
| 23 || [4.0.0+] ReleaseLastApplicationCaptureSharedBuffer
+
| 0 || [[#CreateWindow]] ||
 
|-
 
|-
| 24 || [4.0.0+] AcquireLastForegroundCaptureSharedBuffer
+
| 1 || [[#GetAppletResourceUserId]] ||
 
|-
 
|-
| 25 || [4.0.0+] ReleaseLastForegroundCaptureSharedBuffer
+
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||
 
|-
 
|-
| 26 || [4.0.0+] AcquireCallerAppletCaptureSharedBuffer
+
| 10 || [[#AcquireForegroundRights]] ||
 
|-
 
|-
| 27 || [4.0.0+] ReleaseCallerAppletCaptureSharedBuffer
+
| 11 || [[#ReleaseForegroundRights]] ||
 
|-
 
|-
| 28 || [6.0.0+] TakeScreenShotOfOwnLayerEx
+
| 12 || [[#RejectToChangeIntoBackground]] ||
 +
|-
 +
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] ||
 +
|-
 +
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] ||
 
|}
 
|}
   −
=== AcquireLastApplicationCaptureBuffer ===
+
=== CreateWindow ===
No input, returns an output handle.
+
Takes an input u32, returns an output [[#IWindow]].
   −
=== AcquireLastForegroundCaptureBuffer ===
+
Stubbed, just returns an error.
No input, returns an output handle.
     −
=== AcquireCallerAppletCaptureBuffer ===
+
=== GetAppletResourceUserId ===
No input, returns an output handle.
+
No input, returns an output u64 [[#AppletResourceUserId]].
   −
== ISystemAppletControllerForDebug ==
+
=== GetAppletResourceUserIdOfCallerApplet ===
{| class="wikitable" border="1"
+
No input, returns an output u64 [[#AppletResourceUserId]].
|-
  −
! Cmd || Name || Notes
  −
|-
  −
| 1 || RequestLaunchApplicationForDebug ||
  −
|-
  −
| 2 || [7.0.0+] GetDebugStorageChannel || No input, returns an output [[#IStorageChannel]].
  −
|-
  −
| 3 || [7.0.0+] CreateStorageForDebug || Takes a total of 8-bytes of input, returns an [[#IStorage]].
  −
|}
     −
== IProcessWindingController ==
+
=== AcquireForegroundRights ===
 +
No input/output.
 +
 
 +
Just returns 0.
 +
 
 +
=== ReleaseForegroundRights ===
 +
No input/output.
 +
 
 +
Just returns 0.
 +
 
 +
=== RejectToChangeIntoBackground ===
 +
No input/output.
 +
 
 +
Just returns 0.
 +
 
 +
=== SetAppletWindowVisibility ===
 +
Takes an input u8 bool, no output.
 +
 
 +
=== SetAppletGpuTimeSlice ===
 +
Takes an input s64, no output.
 +
 
 +
The input s64 must not be negative.
 +
 
 +
== IAudioController ==
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
|-
  −
| 0 || [[#GetLaunchReason]] ||
   
|-
 
|-
| 11 || [[#OpenCallingLibraryApplet]] ||
+
| 0 || [[#SetExpectedMasterVolume]]
 
|-
 
|-
| 21 || [[#PushContext]] ||
+
| 1 || [[#GetMainAppletExpectedMasterVolume]]
 
|-
 
|-
| 22 || [[#PopContext]] ||
+
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]
 
|-
 
|-
| 23 || CancelWindingReservation ||
+
| 3 || [[#ChangeMainAppletMasterVolume]]
 
|-
 
|-
| 30 || WindAndDoReserved ||
+
| 4 || [[#SetTransparentVolumeRate]]
|-
  −
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||
  −
|-
  −
| 41 || [4.0.0+] ReserveToStartAndWait ||
   
|}
 
|}
   −
=== GetLaunchReason ===
+
GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.
No input. Returns an u32 AppletProcessLaunchReason.
+
 
 +
=== SetExpectedMasterVolume ===
 +
Takes two input floats, no output.
   −
Used by LibraryApplets.
+
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].
   −
=== OpenCallingLibraryApplet ===
+
=== GetMainAppletExpectedMasterVolume ===
No input, returns an output [[#ILibraryAppletAccessor]].
+
No input, returns an output float.
   −
=== PushContext ===
+
=== GetLibraryAppletExpectedMasterVolume ===
Takes an input [[#IStorage]], no output.
+
No input, returns an output float.
   −
=== PopContext ===
+
=== ChangeMainAppletMasterVolume ===
No input, returns an output [[#IStorage]].
+
Takes an input float and an input u64, no output.
   −
=== ReserveToStartAndWaitAndUnwindThis ===
+
=== SetTransparentVolumeRate ===
Takes an input [[#ILibraryAppletAccessor]], no output.
+
Takes an input float, no output.
   −
== IDebugFunctions ==
+
== IDisplayController ==
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 +
|-
 +
| 0 || [[#GetLastForegroundCaptureImage]]
 
|-
 
|-
| 0 || NotifyMessageToHomeMenuForDebug ||
+
| 1 || [[#UpdateLastForegroundCaptureImage]]
 
|-
 
|-
| 1 || [[#OpenMainApplication]] ||
+
| 2 || [[#GetLastApplicationCaptureImage]]
 
|-
 
|-
| 10 || EmulateButtonEvent ||
+
| 3 || [[#GetCallerAppletCaptureImage]]
 
|-
 
|-
| 20 || InvalidateTransitionLayer ||
+
| 4 || [[#UpdateCallerAppletCaptureImage]]
 
|-
 
|-
| 30 || [6.0.0+] RequestLaunchApplicationWithUserAndArgumentForDebug ||
+
| 5 || [[#GetLastForegroundCaptureImageEx]]
 
|-
 
|-
| 40 || [6.0.0+] GetAppletResourceUsageInfo ||
+
| 6 || [[#GetLastApplicationCaptureImageEx]]
 
|-
 
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
+
| 7 || [[#GetCallerAppletCaptureImageEx]]
|}
  −
 
  −
=== 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
+
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]
 
|-
 
|-
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
+
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]
 
|-
 
|-
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
+
| 10 || [[#AcquireLastApplicationCaptureBuffer]]
|}
  −
 
  −
Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].
  −
 
  −
Only 1 *Accessor session can be open for each IStorage at a time.
  −
 
  −
== IStorageAccessor ==
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name || Notes
+
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]
 
|-
 
|-
| 0 || GetSize || No input. Returns an s64.
+
| 12 || [[#AcquireLastForegroundCaptureBuffer]]
 
|-
 
|-
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
+
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]
 
|-
 
|-
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
+
| 14 || [[#AcquireCallerAppletCaptureBuffer]]
|}
  −
 
  −
== ITransferStorageAccessor ==
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name || Notes
+
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]
 
|-
 
|-
| 0 || GetSize || No input. Returns an output s64.
+
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]
 
|-
 
|-
| 1 || GetHandle || No input. Returns an output s64 and handle.
+
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]
|}
  −
 
  −
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
  −
 
  −
= appletOE =
  −
This is "nn::am::service::IApplicationProxyService".
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name || Notes
+
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]
 
|-
 
|-
| 0 || [[#OpenApplicationProxy]] ||
+
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]
|}
  −
 
  −
This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time.
  −
 
  −
== OpenApplicationProxy ==
  −
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
  −
 
  −
Takes a [[IPC_Marshalling|reserved]] input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias).
  −
 
  −
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
  −
 
  −
= idle:sys =
  −
This is "nn::idle::detail::IPolicyManagerSystem"
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name
+
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]
 
|-
 
|-
| 0 || GetAutoPowerDownEvent
+
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]
 
|-
 
|-
|rowspan="2"| 1 || [1.0.0-3.0.2]
+
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]
 
|-
 
|-
| [7.0.0+]
+
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]
 
|-
 
|-
| 2 || [1.0.0-3.0.2]
+
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]
 
|-
 
|-
| 3 || SetHandlingContext
+
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]
 
|-
 
|-
| 4 || LoadAndApplySettings
+
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]
 
|-
 
|-
| 5 || ReportUserIsActive
+
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]
 
|}
 
|}
   −
[3.0.0+] SetHandlingContext now takes an additional 0x10-bytes of input.
+
=== GetLastForegroundCaptureImage ===
 +
Takes a type-0x6 output buffer.
   −
= omm =
+
Stubbed, just returns an error.
This is "nn::omm::detail::IOperationModeManager"
+
 
 +
=== UpdateLastForegroundCaptureImage ===
 +
No input/output.
 +
 
 +
=== GetLastApplicationCaptureImage ===
 +
Takes a type-0x6 output buffer.
   −
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
+
Stubbed, just returns an error.
Besides [[PTM_services]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
     −
{| class="wikitable" border="1"
+
=== GetCallerAppletCaptureImage ===
|-
+
Takes a type-0x6 output buffer.
! Cmd || Name || Notes
  −
|-
  −
| 0 || GetOperationMode ||
  −
|-
  −
| 1 || GetOperationModeChangeEvent ||
  −
|-
  −
| 2 || EnableAudioVisual ||
  −
|-
  −
| 3 || DisableAudioVisual ||
  −
|-
  −
| 4 || EnterSleepAndWait ||
  −
|-
  −
| 5 || GetCradleStatus ||
  −
|-
  −
| 6 || FadeInDisplay ||
  −
|-
  −
| 7 || FadeOutDisplay ||
  −
|-
  −
| 8 || [2.0.0+] GetCradleFwVersion ||
  −
|-
  −
| 9 || [2.0.0+] NotifyCecSettingsChanged ||
  −
|-
  −
| 10 || [3.0.0+] SetOperationModePolicy ||
  −
|-
  −
| 11 || [3.0.0+] GetDefaultDisplayResolution ||
  −
|-
  −
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent ||
  −
|-
  −
| 13 || [3.0.0+] UpdateDefaultDisplayResolution ||
  −
|-
  −
| 14 || [3.0.0+] ShouldSleepOnBoot ||
  −
|-
  −
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted ||
  −
|-
  −
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished ||
  −
|-
  −
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted ||
  −
|-
  −
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished ||
  −
|-
  −
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent ||
  −
|-
  −
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled ||
  −
|-
  −
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation ||
  −
|-
  −
| 22 || [4.0.0+] GetHdcpStateChangeEvent ||
  −
|-
  −
| 23 || [4.0.0+] GetHdcpState ||
  −
|-
  −
| 24 || [5.0.0+] ShowCardUpdateProcessing ||
  −
|-
  −
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged ||
  −
|-
  −
| 26 || [7.0.0+] || No input, returns a total of 4-bytes of output.
  −
|}
     −
= spsm =
+
Stubbed, just returns an error.
This is "nn::spsm::detail::IPowerStateInterface".
+
 
 +
=== UpdateCallerAppletCaptureImage ===
 +
No input/output.
 +
 
 +
Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.
 +
 
 +
=== GetLastForegroundCaptureImageEx ===
 +
Takes a type-0x6 output buffer, returns an output u8 bool.
   −
{| class="wikitable" border="1"
+
The buffer size must match 0x384000.
|-
  −
! Cmd || Name
  −
|-
  −
| 0 || GetState
  −
|-
  −
| 1 || SleepSystemAndWaitAwake
  −
|-
  −
| 2 ||
  −
|-
  −
| 3 ||
  −
|-
  −
| 4 || GetNotificationMessageEventHandle
  −
|-
  −
| 5 ||
  −
|-
  −
| 6 ||
  −
|-
  −
| 7 ||
  −
|-
  −
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
  −
|-
  −
| 9 || ChangeHomeButtonLongPressingTime
  −
|-
  −
| 10 ||
  −
|-
  −
| 11 || [1.0.0-3.0.2]
  −
|}
     −
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
+
=== GetLastApplicationCaptureImageEx ===
 +
Takes a type-0x6 output buffer, returns an output u8 bool.
   −
= tcap =
+
The buffer size must match 0x384000.
This is "nn::tcap::server::IManager".
     −
{| class="wikitable" border="1"
+
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.
|-
  −
! Cmd || Name
  −
|-
  −
| 0 || GetContinuousHighSkinTemperatureEvent
  −
|-
  −
| 1 || SetOperationMode
  −
|-
  −
| 2 || LoadAndApplySettings
  −
|}
     −
= caps:su =
+
=== GetCallerAppletCaptureImageEx ===
This is "nn::capsrv::sf::IScreenShotApplicationService".
+
Takes a type-0x6 output buffer, returns an output u8 bool.
   −
This was added with [[6.0.0]].
+
The buffer size must match 0x384000.
   −
This can be used by applications to save screenshots.
+
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.
   −
{| class="wikitable" border="1"
+
=== TakeScreenShotOfOwnLayer ===
|-
+
Takes an input u8 bool and a s32, no output.
! Cmd || Name || Notes
  −
|-
  −
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.
  −
|-
  −
| 201 || SaveScreenShot ||
  −
|-
  −
| 203 || SaveScreenShotEx0 ||
  −
|-
  −
| 205 || [8.0.0+] SaveScreenShotEx1 ||
  −
|-
  −
| 210 || SaveScreenShotEx2 || Takes a total of 0x50-bytes of input, a type-0x15 input buffer, and a type-0x45 input buffer.  Returns a total of 0x20-bytes of output.
  −
|}
     −
'''SetShimLibraryVersion''' is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
+
=== CopyBetweenCaptureBuffers ===
 +
Takes two input s32s, no output.
   −
== SaveScreenShot ==
+
=== AcquireLastApplicationCaptureBuffer ===
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer. Returns a 0x20-byte struct '''ApplicationAlbumEntry'''.
+
No input, returns an output handle.
   −
Official user-processes doesn't use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero except +0 is set to an input u32.
+
Stubbed, just returns an error.
   −
== SaveScreenShotEx0 ==
+
=== ReleaseLastApplicationCaptureBuffer ===
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, and a type-0x45 input buffer. Returns a 0x20-byte struct '''ApplicationAlbumEntry'''.
+
No input/output.
 +
 
 +
Clears a state field if it's not already 0, returning an error otherwise. On newer sysvers: then a func is called which just returns 0, then this cmd returns 0.
 +
 
 +
=== AcquireLastForegroundCaptureBuffer ===
 +
No input, returns an output handle.
 +
 
 +
Stubbed, just returns an error.
 +
 
 +
=== ReleaseLastForegroundCaptureBuffer ===
 +
No input/output.
 +
 
 +
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
 +
 
 +
=== AcquireCallerAppletCaptureBuffer ===
 +
No input, returns an output handle.
 +
 
 +
Stubbed, just returns an error.
   −
= Library Applets =
+
=== ReleaseCallerAppletCaptureBuffer ===
This section documents library applet launching.
+
No input/output.
   −
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.
+
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.
   −
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
+
=== AcquireLastApplicationCaptureBufferEx ===
 +
No input, returns an output TransferMemory handle and an output u8 bool.
   −
== CommonArguments ==
+
The state field used by [[#ReleaseLastApplicationCaptureBuffer]] must be 0. Calls a func which just returns an error (this is only the case on newer sysvers), hence this cmd will just return that error. If that func would have returned successfully, the state field would be set to 1 and the cmd would return 0.
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.
+
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.
   −
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.
+
=== AcquireLastForegroundCaptureBufferEx ===
 +
No input, returns an output TransferMemory handle and an output u8 bool.
   −
{| class="wikitable" border="1"
+
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.
|-
+
 
! Offset || Size || Typical Value || Notes
+
=== AcquireCallerAppletCaptureBufferEx ===
|-
+
No input, returns an output TransferMemory handle and an output u8 bool.
| 0x0 || 4 || 1 || Common Arguments version
+
 
|-
+
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.
| 0x4 || 4 || 0x20 || Common Arguments size
+
 
 +
=== ClearCaptureBuffer ===
 +
Takes an input u8 bool, an s32, and an u32, returns no output.
 +
 
 +
=== ClearAppletTransitionBuffer ===
 +
Takes an input u32, no output.
 +
 
 +
=== AcquireLastApplicationCaptureSharedBuffer ===
 +
No input, returns an output u8 bool and an s32.
 +
 
 +
This loads data from state.
 +
 
 +
=== ReleaseLastApplicationCaptureSharedBuffer ===
 +
No input/output.
 +
 
 +
Depending on whether a state field is 0, this just returns an error or returns 0.
 +
 
 +
=== AcquireLastForegroundCaptureSharedBuffer ===
 +
No input, returns an output u8 bool and an s32.
 +
 
 +
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
 +
 
 +
=== ReleaseLastForegroundCaptureSharedBuffer ===
 +
No input/output.
 +
 
 +
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.
 +
 
 +
=== AcquireCallerAppletCaptureSharedBuffer ===
 +
No input, returns an output u8 bool and an s32.
 +
 
 +
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
 +
 
 +
=== ReleaseCallerAppletCaptureSharedBuffer ===
 +
No input/output.
 +
 
 +
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.
 +
 
 +
=== TakeScreenShotOfOwnLayerEx ===
 +
Takes two input u8 bools and a s32, no output.
 +
 
 +
Calls the same func internally as [[#TakeScreenShotOfOwnLayer]], except the last bool param is the last cmd param bool instead of hard-coded 0. This flag indicates whether the screenshot should be taken Immediately.
 +
 
 +
== ISystemAppletControllerForDebug ==
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x8 || 4 || || Library applet version (API version)
+
! Cmd || Name || Notes
 
|-
 
|-
| 0xC || 4 || 0 || Theme color
+
| 1 || RequestLaunchApplicationForDebug ||  
 
|-
 
|-
| 0x10 || 1 || 0 || Play startup sound
+
| 2 || [7.0.0+] GetDebugStorageChannel || No input, returns an output [[#IStorageChannel]].
|-
  −
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
   
|-
 
|-
 +
| 3 || [7.0.0+] CreateStorageForDebug || Takes a total of 8-bytes of input, returns an [[#IStorage]].
 
|}
 
|}
   −
= Enums =
+
== IProcessWindingController ==
=== AppletId ===
  −
See also [[:Category:Library Applets]].
  −
 
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! ID
+
! Cmd || Name || Notes
!  Title-id
  −
!  Description
   
|-
 
|-
| 0x01
+
| 0 || [[#GetLaunchReason]] ||
|  
  −
| Application. Not valid for use with LibraryApplets.
   
|-
 
|-
| 0x02
+
| 11 || [[#OpenCallingLibraryApplet]] ||  
| 010000000000100C
  −
| "overlayDisp"
   
|-
 
|-
| 0x03
+
| 21 || [[#PushContext]] ||  
| 0100000000001000
  −
| "qlaunch"
   
|-
 
|-
| 0x04
+
| 22 || [[#PopContext]] ||  
| 0100000000001012
  −
| "starter"
   
|-
 
|-
| 0x0A
+
| 23 || [[#CancelWindingReservation]] ||
| 0100000000001001
  −
| [[Auth_Applet|"auth"]]
   
|-
 
|-
| 0x0B
+
| 30 || [[#WindAndDoReserved]] ||
| 0100000000001002
  −
| "cabinet"
   
|-
 
|-
| 0x0C
+
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] ||  
| 0100000000001003
  −
| "controller"
   
|-
 
|-
| 0x0D
+
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||
| 0100000000001004
+
|}
| "dataErase"
+
 
|-
+
=== GetLaunchReason ===
| 0x0E
+
No input, returns an output [[#AppletProcessLaunchReason]].
| 0100000000001005
+
 
| [[Error_Applet|"error"]]
+
Used by LibraryApplets.
|-
+
 
| 0x0F
+
=== OpenCallingLibraryApplet ===
| 0100000000001006
+
No input, returns an output [[#ILibraryAppletAccessor]].
| "netConnect"
+
 
|-
+
The objptr from state is cleared during this, an error is thrown if it's already 0.
| 0x10
+
 
| 0100000000001007
+
=== PushContext ===
| [[Profile_Selector|"playerSelect"]]
+
Takes an input [[#IStorage]], no output.
 +
 
 +
=== PopContext ===
 +
No input, returns an output [[#IStorage]].
 +
 
 +
=== CancelWindingReservation ===
 +
No input/output.
 +
 
 +
=== WindAndDoReserved ===
 +
No input/output.
 +
 
 +
=== ReserveToStartAndWaitAndUnwindThis ===
 +
Takes an input [[#ILibraryAppletAccessor]], no output.
 +
 
 +
=== ReserveToStartAndWait ===
 +
Takes an input [[#ILibraryAppletAccessor]], no output.
 +
 
 +
== IDebugFunctions ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name || Notes
 
|-
 
|-
| 0x11
+
| 0 || [[#NotifyMessageToHomeMenuForDebug]] ||
| 0100000000001008
  −
| [[Software_Keyboard|"swkbd"]]
   
|-
 
|-
| 0x12
+
| 1 || [[#OpenMainApplication]] ||  
| 0100000000001009
  −
| "miiEdit"
   
|-
 
|-
| 0x13
+
| 10 || [[#PerformSystemButtonPressing]] ||
| 010000000000100A
  −
| "LibAppletWeb" [[Internet_Browser#010000000000100A|WebApplet]] applet
   
|-
 
|-
| 0x14
+
| 20 || [[#InvalidateTransitionLayer]] ||
| 010000000000100B
  −
| "LibAppletShop" [[Internet_Browser#ShopN|ShopN]] applet
   
|-
 
|-
| 0x15
+
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]] ||
| 010000000000100D
  −
| "photoViewer"
   
|-
 
|-
| 0x16
+
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]] ||
| 010000000000100E
  −
| "set"
   
|-
 
|-
| 0x17
+
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
| 010000000000100F
  −
| "LibAppletOff" [[Internet_Browser#Offline_Applet|Offline]] applet
   
|-
 
|-
| 0x18
+
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]] ||
| 0100000000001010
  −
| "LibAppletLns" [[Internet_Browser#Whitelisted_Applets|Whitelisted]] applet
   
|-
 
|-
| 0x19
+
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]] ||
| 0100000000001011
  −
| "LibAppletAuth" [[Internet_Browser#WifiWebAuthApplet|WifiWebAuth]] applet
   
|-
 
|-
| 0x1A
+
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]] ||
| 0100000000001013
  −
| "myPage"
  −
|}
  −
 
  −
=== LibraryAppletMode ===
  −
{| class="wikitable" border="1"
   
|-
 
|-
!  ID
+
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]] ||
!  Description
   
|-
 
|-
| 0x0
+
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]] ||
| AllForeground
   
|-
 
|-
| 0x1
+
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]] ||
| Background
   
|-
 
|-
| 0x2
+
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]] ||
| No UI
  −
|-
  −
| 0x3
  −
| Background with indirect display, see also [[#GetIndirectLayerConsumerHandle]]. Only used by swkbd InlineKeyboard.
  −
|-
  −
| 0x4
  −
| AllForegroundInitiallyHidden. Can be used by [7.0.0+] [[Internet_Browser|WebSession]].
   
|-
 
|-
 +
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]] ||
 
|}
 
|}
   −
=== NotificationMessage ===
+
=== NotifyMessageToHomeMenuForDebug ===
{| class="wikitable" border="1"
+
Takes an input [[#AppletMessage]], no output.
|-
+
 
!  ID
+
Stubbed, just returns an error.
!  Description
+
 
|-
+
=== OpenMainApplication ===
| 0x4 || Exit requested
+
No input, returns an output [[#IApplicationAccessor]].
|-
  −
| 0xF || [[#GetCurrentFocusState|FocusState]] changed
  −
|-
  −
| 0x10 || ?
  −
|-
  −
| 0x1E || OperationMode changed
  −
|-
  −
| 0x1F || PerformanceMode changed
  −
|}
     −
=== OperationMode ===
+
Should not be used when no Application is running (svcBreak).
{| class="wikitable" border="1"
+
 
|-
+
=== PerformSystemButtonPressing ===
!  Value
+
Takes an input [[#SystemButtonType]], no output.
!  Description
+
 
|-
+
=== InvalidateTransitionLayer ===
| 0 || Handheld
+
No input/output.
|-
+
 
| 1 || Docked
+
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
|}
+
Takes an input u8 bool flag, an [[NCM_services#ApplicationId|ApplicationId]], a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.
 +
 
 +
Requests to launch the specified Application, with the specified users. When the bool flag is true, the content of the second input buffer is used to create a storage which is pushed to the UserChannel for this Application (see [[#LaunchParameterKind]]).
 +
 
 +
=== GetAppletResourceUsageInfo ===
 +
No input, returns an output [[#AppletResourceUsageInfo]].
 +
 
 +
=== SetCpuBoostModeForApplet ===
 +
Takes an input u32 '''CpuBoostMode''' (only modes 0 and 1 are valid) and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
 +
 
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 
 +
=== PushToAppletBoundChannelForDebug ===
 +
Takes an input [[#IStorage]] and a s32, no output.
   −
=== LaunchParameterKind ===
+
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
{| class="wikitable" border="1"
  −
|-
  −
!  Value
  −
!  Description
  −
|-
  −
| 1 || Application-specific LaunchParameter
  −
|-
  −
| 2 || account PreselectedUser
  −
|-
  −
| 3 || Unknown if used by anything?
  −
|}
     −
=== LibraryAppletExitReason ===
+
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.
{| class="wikitable" border="1"
+
 
 +
=== TryPopFromAppletBoundChannelForDebug ===
 +
Takes an input s32, returns an output [[#IStorage]].
 +
 
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 
 +
The s32 must not be 0 and must match the value previously saved by [[#PushToAppletBoundChannelForDebug]], otherwise errors are returned. Then the output storage is popped from the StorageChannel.
 +
 
 +
=== AlarmSettingNotificationEnableAppEventReserve ===
 +
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
 +
 
 +
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
 +
 
 +
=== AlarmSettingNotificationDisableAppEventReserve ===
 +
No input/output.
 +
 
 +
Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].
 +
 
 +
=== AlarmSettingNotificationPushAppEventNotify ===
 +
Takes an input [[#IStorage]], no output.
 +
 
 +
Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.
 +
 
 +
=== FriendInvitationSetApplicationParameter ===
 +
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
 +
 
 +
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
 +
 
 +
=== FriendInvitationClearApplicationParameter ===
 +
No input/output.
 +
 
 +
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].
 +
 
 +
=== FriendInvitationPushApplicationParameter ===
 +
Takes an input [[#IStorage]], no output.
 +
 
 +
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
 +
 
 +
== IStorage ==
 +
{| class="wikitable" border="1"
 
|-
 
|-
!  Value
+
! Cmd || Name || Notes
 +
|-
 +
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
 +
|-
 +
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
 +
|}
 +
 
 +
Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].
 +
 
 +
Only 1 *Accessor session can be open for each IStorage at a time.
 +
 
 +
== IStorageAccessor ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 0 || GetSize || No input. Returns an s64.
 +
|-
 +
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
 +
|-
 +
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
 +
|}
 +
 
 +
== ITransferStorageAccessor ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 0 || GetSize || No input. Returns an output s64.
 +
|-
 +
| 1 || GetHandle || No input. Returns an output s64 and handle.
 +
|}
 +
 
 +
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.
 +
 
 +
= appletOE =
 +
This is "nn::am::service::IApplicationProxyService".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 0 || [[#OpenApplicationProxy]] ||
 +
|}
 +
 
 +
This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time.
 +
 
 +
== OpenApplicationProxy ==
 +
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
 +
 
 +
Takes a [[IPC_Marshalling|reserved]] input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias).
 +
 
 +
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
 +
 
 +
= idle:sys =
 +
This is "nn::idle::detail::IPolicyManagerSystem"
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || GetAutoPowerDownEvent
 +
|-
 +
|rowspan="2"| 1 || [1.0.0-3.0.2]
 +
|-
 +
| [7.0.0+] IsAutoPowerDownRequested
 +
|-
 +
| 2 || [1.0.0-3.0.2]
 +
|-
 +
| 3 || [[#SetHandlingContext]]
 +
|-
 +
| 4 || LoadAndApplySettings
 +
|-
 +
| 5 || ReportUserIsActive
 +
|}
 +
 
 +
== SetHandlingContext ==
 +
[3.0.0+] Now takes an additional 0x10-bytes of input.
 +
 
 +
= 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*]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || GetOperationMode
 +
|-
 +
| 1 || GetOperationModeChangeEvent
 +
|-
 +
| 2 || EnableAudioVisual
 +
|-
 +
| 3 || DisableAudioVisual
 +
|-
 +
| 4 || EnterSleepAndWait
 +
|-
 +
| 5 || GetCradleStatus
 +
|-
 +
| 6 || FadeInDisplay
 +
|-
 +
| 7 || FadeOutDisplay
 +
|-
 +
| 8 || [2.0.0+] GetCradleFwVersion
 +
|-
 +
| 9 || [2.0.0+] NotifyCecSettingsChanged
 +
|-
 +
| 10 || [3.0.0+] SetOperationModePolicy
 +
|-
 +
| 11 || [3.0.0+] GetDefaultDisplayResolution
 +
|-
 +
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
 +
|-
 +
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
 +
|-
 +
| 14 || [3.0.0+] ShouldSleepOnBoot
 +
|-
 +
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
 +
|-
 +
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
 +
|-
 +
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
 +
|-
 +
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
 +
|-
 +
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
 +
|-
 +
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
 +
|-
 +
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
 +
|-
 +
| 22 || [4.0.0+] GetHdcpStateChangeEvent
 +
|-
 +
| 23 || [4.0.0+] GetHdcpState
 +
|-
 +
| 24 || [5.0.0+] ShowCardUpdateProcessing
 +
|-
 +
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
 +
|-
 +
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
 +
|-
 +
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
 +
|}
 +
 
 +
== GetOperationModeSystemInfo ==
 +
No input, returns an output u32.
 +
 
 +
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
 +
 
 +
= spsm =
 +
This is "nn::spsm::detail::IPowerStateInterface".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || GetCurrentState
 +
|-
 +
| 1 || EnterSleep
 +
|-
 +
| 2 || GetLastWakeReason
 +
|-
 +
| 3 || Shutdown
 +
|-
 +
| 4 || GetNotificationMessageEventHandle
 +
|-
 +
| 5 || ReceiveNotificationMessage
 +
|-
 +
| 6 || AnalyzeLogForLastSleepWakeSequence
 +
|-
 +
| 7 || ResetEventLog
 +
|-
 +
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
 +
|-
 +
| 9 || ChangeHomeButtonLongPressingTime
 +
|-
 +
| 10 || PutErrorState
 +
|-
 +
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
 +
|}
 +
 
 +
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
 +
 
 +
= tcap =
 +
This is "nn::tcap::server::IManager".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 || GetContinuousHighSkinTemperatureEvent
 +
|-
 +
| 1 || SetOperationMode
 +
|-
 +
| 2 || LoadAndApplySettings
 +
|}
 +
 
 +
= caps:su =
 +
This is "nn::capsrv::sf::IScreenShotApplicationService".
 +
 
 +
This was added with [[6.0.0]].
 +
 
 +
This can be used by applications to save screenshots.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name || Notes
 +
|-
 +
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.
 +
|-
 +
| 201 || SaveScreenShot ||
 +
|-
 +
| 203 || SaveScreenShotEx0 ||
 +
|-
 +
| 205 || [8.0.0+] SaveScreenShotEx1 ||
 +
|-
 +
| 210 || SaveScreenShotEx2 || Takes a total of 0x50-bytes of input, a type-0x15 input buffer, and a type-0x45 input buffer. Returns a total of 0x20-bytes of output.
 +
|}
 +
 
 +
'''SetShimLibraryVersion''' is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
 +
 
 +
== SaveScreenShot ==
 +
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 +
 
 +
Official user-processes doesn't use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero, except +4 is set to an input u32 and u32 +0xC = 0x1.
 +
 
 +
This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
 +
 
 +
== SaveScreenShotEx0 ==
 +
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 +
 
 +
== SaveScreenShotEx1 ==
 +
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, a type-0x15 input buffer containing an [[Capture_services|ApplicationData]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 +
 
 +
== SaveScreenShotEx2 ==
 +
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a type-0x15 input buffer containing an [[Capture_services|UserIdList]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 +
 
 +
= Library Applets =
 +
This section documents library applet launching.
 +
 
 +
Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
 +
 
 +
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
 +
 
 +
== CommonArguments ==
 +
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by <code>nn::la::CommonArgumentsWriter</code> and has the following format.
 +
 
 +
This struct is 0x20-bytes.
 +
 
 +
Official sw handles the first 8-bytes separately, which is a header. With CommonArguments version 0x0, the header is 4-bytes, while starting with version 0x1 it's 8-bytes.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Typical Value || Notes
 +
|-
 +
| 0x0 || 4 || 1 || Common Arguments version
 +
|-
 +
| 0x4 || 4 || 0x20 || Common Arguments size
 +
|-
 +
| 0x8 || 4 || || Library applet version (API version)
 +
|-
 +
| 0xC || 4 || 0 || Theme color
 +
|-
 +
| 0x10 || 1 || 0 || Play startup sound
 +
|-
 +
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
 +
|-
 +
|}
 +
 
 +
= Enums =
 +
=== AppletId ===
 +
See also [[:Category:Library Applets]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
!  ID
 +
!  Title-id
 
!  Description
 
!  Description
 
|-
 
|-
| 0 || Normal
+
| 0x01
 +
|
 +
| Application. Not valid for use with LibraryApplets.
 +
|-
 +
| 0x02
 +
| 010000000000100C
 +
| "overlayDisp"
 +
|-
 +
| 0x03
 +
| 0100000000001000
 +
| "qlaunch"
 +
|-
 +
| 0x04
 +
| 0100000000001012
 +
| "starter" SystemApplication.
 +
|-
 +
| 0x0A
 +
| 0100000000001001
 +
| [[Auth_Applet|"auth"]]
 +
|-
 +
| 0x0B
 +
| 0100000000001002
 +
| "cabinet"
 +
|-
 +
| 0x0C
 +
| 0100000000001003
 +
| [[Controller_Applet|"controller"]]
 +
|-
 +
| 0x0D
 +
| 0100000000001004
 +
| "dataErase"
 +
|-
 +
| 0x0E
 +
| 0100000000001005
 +
| [[Error_Applet|"error"]]
 +
|-
 +
| 0x0F
 +
| 0100000000001006
 +
| "netConnect"
 +
|-
 +
| 0x10
 +
| 0100000000001007
 +
| [[Profile_Selector|"playerSelect"]]
 +
|-
 +
| 0x11
 +
| 0100000000001008
 +
| [[Software_Keyboard|"swkbd"]]
 +
|-
 +
| 0x12
 +
| 0100000000001009
 +
| "miiEdit"
 +
|-
 +
| 0x13
 +
| 010000000000100A
 +
| "LibAppletWeb" [[Internet_Browser#010000000000100A|WebApplet]] applet
 +
|-
 +
| 0x14
 +
| 010000000000100B
 +
| "LibAppletShop" [[Internet_Browser#ShopN|ShopN]] applet
 +
|-
 +
| 0x15
 +
| 010000000000100D
 +
| [[Album_Applet|"photoViewer"]]
 +
|-
 +
| 0x16
 +
| 010000000000100E
 +
| "set"
 +
|-
 +
| 0x17
 +
| 010000000000100F
 +
| "LibAppletOff" [[Internet_Browser#Offline_Applet|Offline]] applet
 +
|-
 +
| 0x18
 +
| 0100000000001010
 +
| "LibAppletLns" [[Internet_Browser#Whitelisted_Applets|Whitelisted]] applet
 +
|-
 +
| 0x19
 +
| 0100000000001011
 +
| "LibAppletAuth" [[Internet_Browser#WifiWebAuthApplet|WifiWebAuth]] applet
 +
|-
 +
| 0x1A
 +
| 0100000000001013
 +
| [[MyPage_Applet|"myPage"]]
 +
|}
 +
 
 +
=== LibraryAppletMode ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  ID
 +
!  Description
 +
|-
 +
| 0x0
 +
| AllForeground
 +
|-
 +
| 0x1
 +
| Background
 +
|-
 +
| 0x2
 +
| No UI
 +
|-
 +
| 0x3
 +
| Background with indirect display, see also [[#GetIndirectLayerConsumerHandle]]. Only used by swkbd InlineKeyboard.
 +
|-
 +
| 0x4
 +
| AllForegroundInitiallyHidden. Can be used by [7.0.0+] [[Internet_Browser|WebSession]].
 +
|-
 +
|}
 +
 
 +
=== AppletMessage ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  ID
 +
!  Description
 +
|-
 +
| 0x4 || Exit requested
 +
|-
 +
| 0xF || [[#GetCurrentFocusState|FocusState]] changed
 +
|-
 +
| 0x10 || Current applet execution was [[#SetRestartMessageEnabled|resumed]].
 +
|-
 +
| 0x1E || OperationMode changed
 +
|-
 +
| 0x1F || PerformanceMode changed
 +
|-
 +
| 0x33 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]. Indicates that [[#ApproveToDisplay]] should be used.
 +
|-
 +
| 0x5A || Capture button was [[#SetRequiresCaptureButtonShortPressedMessage|short-pressed]].
 +
|-
 +
| 0x5C || Screenshot was [[#SetAlbumImageTakenNotificationEnabled|taken]].
 +
|}
 +
 
 +
This is "nn::am::AppletMessage".
 +
 
 +
=== OperationMode ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Handheld
 +
|-
 +
| 1 || Docked
 +
|}
 +
 
 +
=== TvPowerStateMatchingMode ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Unknown
 +
|-
 +
| 1 || Unknown
 +
|}
 +
 
 +
This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
 +
 
 +
=== SystemButtonType ===
 +
{| 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
 +
|}
 +
 
 +
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
 +
 
 +
=== 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 ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || u8 ProgramIndex. "ExecuteProgram". [[NS_Services|NS]] handles ProgramIndex by launching ApplicationId+ProgramIndex. After using [[#ExecuteProgram]] with this successfully, official user-processes will enter an infinite loop with sleep-thread value 86400000000000.
 +
|-
 +
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
 +
|-
 +
| 2 || u64 = value 0. "RestartProgram"
 +
|-
 +
|}
 +
 
 +
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
 +
 
 +
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 =
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Unknown.
 +
|-
 +
| 1 || Unknown.
 +
|}
 +
 
 +
This is u32 enum "nn::applet::InputDetectionPolicy".
 +
 
 +
= AppletResourceUserId =
 +
This u64 is officially called "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
 +
 
 +
= AppletAttribute =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
 +
|-
 +
| 0x1 || 0x7F || Unused
 +
|}
 +
 
 +
This is "nn::am::AppletAttribute". This struct is 0x8-bytes.
 +
 
 +
This is used by [[#OpenLibraryAppletProxy]].
 +
 
 +
= AppletProcessLaunchReason =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].
 +
|-
 +
| 0x1 || 0x2 || Always 0.
 +
|-
 +
| 0x3 || 0x1 || Always 0.
 +
|}
 +
 
 +
This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
 +
 
 +
= LibraryAppletInfo =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || [[#AppletId]]
 +
|-
 +
| 0x4 || 0x4 || [[#LibraryAppletMode]]
 +
|}
 +
 
 +
This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
 +
 
 +
= AppletKind =
 +
This is "nn::am::service::AppletKind". This is 8-bytes.
 +
 
 +
= AppletIdentityInfo =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || [[#AppletId]]
 +
|-
 +
| 0x4 || 0x4 || Padding
 +
|-
 +
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
 +
|}
 +
 
 +
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
 +
 
 +
= ApplicationAttributeForQuest =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
 +
|-
 +
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
 +
|-
 +
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
 +
|}
 +
 
 +
This struct is "nn::applet::ApplicationAttributeForQuest".
 +
 
 +
User-processes copy the first 0x8-bytes (0xC-bytes with [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]/[[#CreateApplicationWithAttributeAndRequestToStartForQuest]]) to a [[#ApplicationAttribute]] with the rest of the struct being cleared, which is then passed to the actual cmd (CreateApplication*ToStartForQuest).
 +
 
 +
= ApplicationAttribute =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
 +
|-
 +
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
 +
|-
 +
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
 +
|-
 +
| 0xC || 0x14 || Unused. Default is 0.
 +
|}
 +
 
 +
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
 +
 
 +
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
 +
 
 +
= ApplicationLaunchProperty =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
 
|-
 
|-
| 1 || Canceled
+
| 0x8 || 0x4 || Application title-version.
 
|-
 
|-
| 2 || Abnormal
+
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
 
|-
 
|-
| 10 || Unexpected
+
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
|}
  −
 
  −
=== ProgramSpecifyKind ===
  −
{| class="wikitable" border="1"
   
|-
 
|-
!  Value
+
| 0xE || 0x1 || Unknown.
!  Description
  −
|-
  −
| 0 || u8 ProgramIndex. "ExecuteProgram". User-process enters an infinite svcSleepThread loop afterwards.
  −
|-
  −
| 1 || u64 titleID. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
  −
|-
  −
| 2 || u64 = value 0. "RestartProgram"
   
|-
 
|-
 +
| 0xF || 0x1 || Padding.
 
|}
 
|}
   −
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
+
This struct is 0x10-bytes.
 
  −
= AppletResourceUserId =
  −
This u64 is officially called "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
  −
 
  −
= LibraryAppletInfo =
  −
This struct is 8-bytes: +0 u32 is [[#AppletId]], +4 u32 is [[#LibraryAppletMode]].
  −
 
  −
= AppletKind =
  −
This is 8-bytes.
     −
= ApplicationAttributeForQuest =
+
= ApplicationLaunchRequestInfo =
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
+
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
 
|-
 
|-
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
+
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
 
|-
 
|-
| 0x8 || 0x4 || See [[#ApplicationAttribute]].
+
| 0x8 || 0x8 || Unknown. The default is 0x0.
 
|}
 
|}
   −
This struct is "nn::applet::ApplicationAttributeForQuest".
+
This struct is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
   −
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).
+
= AppletResourceUsageInfo =
 
  −
= ApplicationAttribute =
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || Unknown. Default is 0.
+
| 0x0 || 0x4 || Unknown counter.
 
|-
 
|-
| 0x4 || 0x4 || Unknown. Default is 0.
+
| 0x4 || 0x4 || Unknown counter.
 
|-
 
|-
| 0x8 || 0x4 || float. Must be in the range of 0.0f-1.0f. The default is 1.0f.
+
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
 
|-
 
|-
| 0xC || 0x14 || Unknown. Default is 0.
+
| 0xC || 0x14 || Always zero.
 
|}
 
|}
   −
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
+
This struct is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
    
= Notes =
 
= Notes =

Navigation menu