Changes

Jump to navigation Jump to search
22,801 bytes added ,  16:33, 7 December 2019
Line 28: Line 28:     
All of these Open*Proxy commands except [[#OpenLibraryAppletProxy]] take the same input as [[#OpenApplicationProxy]], with the same user-process retry-loop as [[#OpenApplicationProxy]]. These Open*Proxy commands (including appletOE) doesn't seem to usable from processes which aren't actual applets (such as sysmodules), at least for applet-types which aren't already in use.
 
All of these Open*Proxy commands except [[#OpenLibraryAppletProxy]] take the same input as [[#OpenApplicationProxy]], with the same user-process retry-loop as [[#OpenApplicationProxy]]. These Open*Proxy commands (including appletOE) doesn't seem to usable from processes which aren't actual applets (such as sysmodules), at least for applet-types which aren't already in use.
 +
 +
OpenLibraryAppletProxyOld eventually calls the same func as [[#OpenLibraryAppletProxy]], except that the [[#AppletAttribute]] is all-zero.
    
This service is used by all system non-regular-applications.
 
This service is used by all system non-regular-applications.
Line 41: Line 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.
Line 111: Line 113:  
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]] ||  
 
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]] ||  
 
|-
 
|-
| 100 || [6.0.0+] PopRequestLaunchApplicationForDebug ||
+
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]] ||
 +
|-
 +
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]] ||
 
|-
 
|-
 
| 200 || [8.0.0+] [[#LaunchDevMenu]] ||
 
| 200 || [8.0.0+] [[#LaunchDevMenu]] ||
Line 140: Line 144:     
The input value must be 0-3. 0 = HomeButton.
 
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 ====
 
==== LaunchDevMenu ====
Line 147: Line 161:     
Uses [[NS_Services#IApplicationManagerInterface]] cmd99.
 
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 205: Line 221:  
==== RequestToEnterSleep ====
 
==== RequestToEnterSleep ====
 
No input/output.
 
No input/output.
 +
 +
Stubbed, just returns an error.
    
==== EnterSleep ====
 
==== EnterSleep ====
 
No input/output.
 
No input/output.
 +
 +
Stubbed, just returns an error.
    
==== StartSleepSequence ====
 
==== StartSleepSequence ====
Line 222: Line 242:  
==== IsAutoPowerDownRequested ====
 
==== IsAutoPowerDownRequested ====
 
No input, returns an output u8 bool.
 
No input, returns an output u8 bool.
 +
 +
Uses [[#idle:sys]] cmd1.
    
==== LoadAndApplyIdlePolicySettings ====
 
==== LoadAndApplyIdlePolicySettings ====
Line 230: Line 252:  
==== NotifyCecSettingsChanged ====
 
==== NotifyCecSettingsChanged ====
 
No input/output.
 
No input/output.
 +
 +
Uses [[#omm]] cmd NotifyCecSettingsChanged.
    
==== SetDefaultHomeButtonLongPressTime ====
 
==== SetDefaultHomeButtonLongPressTime ====
Takes an input u64, no output.
+
Takes an input s64, no output.
    
==== UpdateDefaultDisplayResolution ====
 
==== UpdateDefaultDisplayResolution ====
 
No input/output.
 
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 ====
 
==== GetHdcpAuthenticationFailedEvent ====
 
No input, returns an output Event handle with autoclear=false.
 
No input, returns an output Event handle with autoclear=false.
 +
 +
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.
    
=== IApplicationCreator ===
 
=== IApplicationCreator ===
Line 256: 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 264: 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 278: 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 300: 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 =====
Line 329: Line 375:  
===== GetApplicationControlProperty =====
 
===== GetApplicationControlProperty =====
 
No input, takes a type-0x6 output buffer.
 
No input, takes a type-0x6 output buffer.
 +
 +
The output buffer must be at least 0x4000-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication.
    
This gets the application [[NACP_Format|control.nacp]].
 
This gets the application [[NACP_Format|control.nacp]].
   −
===== SetApplicationAttribute =====
+
===== GetApplicationLaunchProperty =====
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
+
Takes a type-0x6 output buffer.
 +
 
 +
The output buffer size must be at least 0x10-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication.
   −
===== IAppletAccessor =====
+
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"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 377: Line 479:  
|-
 
|-
 
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 +
|-
 +
| 0 || [9.0.0+] [[#SetTerminateResult]] ||
 
|-
 
|-
 
| 10 || [[#ReadThemeStorage]] ||  
 
| 10 || [[#ReadThemeStorage]] ||  
 
|-
 
|-
 
| 11 || [[#WriteThemeStorage]] ||  
 
| 11 || [[#WriteThemeStorage]] ||  
 +
|-
 +
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]] ||
 +
|-
 +
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]] ||
 
|-
 
|-
 
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]] ||  
 
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]] ||  
Line 398: Line 506:  
=== WriteThemeStorage ===
 
=== WriteThemeStorage ===
 
Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
 
Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
 +
 +
=== PushToAppletBoundChannel ===
 +
Takes an input [[#IStorage]], no output.
 +
 +
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
 +
 +
=== TryPopFromAppletBoundChannel ===
 +
No input, returns an output [[#IStorage]].
 +
 +
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
    
=== GetDisplayLogicalResolution ===
 
=== GetDisplayLogicalResolution ===
Line 476: Line 594:  
| 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 486: 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 ||
+
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||
 
|-
 
|-
| 110 || [6.0.0+] GetMainAppletAvailableUsers ||
+
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
 +
|-
 +
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
 +
|-
 +
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
 
|}
 
|}
   Line 522: 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.
    
==== ExitProcessAndReturn ====
 
==== ExitProcessAndReturn ====
Line 531: 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 ====
Line 557: Line 681:  
==== GetNextReturnDestinationAppletIdentityInfo ====
 
==== GetNextReturnDestinationAppletIdentityInfo ====
 
No input, returns an output [[#AppletIdentityInfo]].
 
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 562: Line 693:     
==== GetPopExtraStorageEvent ====
 
==== GetPopExtraStorageEvent ====
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=false.
    
==== UnpopInData ====
 
==== UnpopInData ====
Line 569: 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]].
 +
 
 +
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].
 +
 
 +
Official sw uses an user-buffer for the tmem, with permissions=0.
   −
== IOverlayAppletProxy ==
+
==== ReserveResourceForMovieOperation ====
{| class="wikitable" border="1"
+
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"
 
|-
 
|-
 
! Cmd || Name || Notes
 
! Cmd || Name || Notes
Line 607: 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
+
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
 
|-
 
|-
 
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
 
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
 
|-
 
|-
| 101 || [5.0.0+] BeginToObserveHidInputForDevelop
+
| 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.
 +
 
 +
==== TerminateApplicationAndSetReason ====
 +
Takes an input u32 Result, no output.
   −
== IApplicationProxy ==
+
==== SetScreenShotPermissionGlobally ====
{| class="wikitable" border="1"
+
Takes an input u8 bool, no output.
|-
+
 
! Cmd || Name || Notes
+
==== StartShutdownSequenceForOverlay ====
|-
+
No input/output.
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
+
 
|-
+
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
| 1 || GetSelfController || Returns an [[#ISelfController]].
+
 
|-
+
==== StartRebootSequenceForOverlay ====
| 2 || GetWindowController || Returns an [[#IWindowController]].
+
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]].
 +
|-
 +
| 2 || GetWindowController || Returns an [[#IWindowController]].
 
|-
 
|-
 
| 3 || GetAudioController || Returns an [[#IAudioController]].
 
| 3 || GetAudioController || Returns an [[#IAudioController]].
Line 678: Line 910:  
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]] ||  
 
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]] ||  
 
|-
 
|-
| 20 || EnsureSaveData ||
+
| 20 || [[#EnsureSaveData]] ||
 
|-
 
|-
 
| 21 || [[#GetDesiredLanguage]] ||
 
| 21 || [[#GetDesiredLanguage]] ||
Line 746: Line 978:  
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||  
 
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||  
 
|-
 
|-
| 500 || [5.0.0+] StartContinuousRecordingFlushForDebug ||  
+
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]] ||
 +
|-
 +
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] ||  
 
|-
 
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]] ||  
+
| 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 766: 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 containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.
    
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndPushAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
 
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndPushAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
    
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
 
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
Takes an input u64 titleID and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
    
Same as [[#CreateApplicationAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
 
Same as [[#CreateApplicationAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
 +
 +
==== EnsureSaveData ====
 +
Takes an input u128 userID, returns an output u64 size.
 +
 +
Calls sdk func <code>nn::fs::EnsureApplicationSaveData</code>. [[qlaunch]] also calls this same sdk func directly.
 +
 +
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn't exist.
 +
 +
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.
    
==== GetDesiredLanguage ====
 
==== GetDesiredLanguage ====
Line 807: Line 1,060:  
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
 
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].
   −
Just returns two u8s loaded from state.
+
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
    
==== BeginBlockingHomeButtonShortAndLongPressed ====
 
==== BeginBlockingHomeButtonShortAndLongPressed ====
Line 849: 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.
 
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.
Line 890: Line 1,151:     
==== 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 899: 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 920: Line 1,181:  
==== GetPreviousProgramIndex ====
 
==== GetPreviousProgramIndex ====
 
No input, returns an output s32.
 
No input, returns an output s32.
 +
 +
Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.
    
==== EnableApplicationAllThreadDumpOnCrash ====
 
==== EnableApplicationAllThreadDumpOnCrash ====
Line 927: Line 1,190:  
No input, returns an output Event handle with autoclear=false.
 
No input, returns an output Event handle with autoclear=false.
   −
This is used by sdknso during applet-application initialization. A seperate thread is setup where event-waiting is handled. When the Event is signaled, official sw will assert.
+
This is used by sdknso during applet-application initialization. A separate thread is setup where event-waiting is handled. When the Event is signaled, official sw will assert.
 +
 
 +
==== GetFriendInvitationStorageChannelEvent ====
 +
No input, returns an output Event handle with EventClearMode=0.
   −
==== CreateMovieMaker ====
+
This is exposed by sdknso under <code>nn::friends::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.
Takes an input u64 and handle, returns an [[#IMovieMaker]].
     −
==== PrepareForJit ====
+
==== TryPopFromFriendInvitationStorageChannel ====
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.
+
No input, returns an output [[#IStorage]].
   −
=== IMovieMaker ===
+
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].
{| class="wikitable" border="1"
  −
|-
  −
! Cmd || Name
  −
|-
  −
| 0 || [[#GetGrcMovieMaker]]
  −
|-
  −
| 1 || [[#GetLayerHandle]]
  −
|}
     −
==== GetGrcMovieMaker ====
+
This is exposed by sdknso under <code>nn::friends::</code>. When the storage_size is <0x10, this returns false. <code>data_size = storage_size-0x10;</code> Then the first 0x10-bytes from storage are read to stack, which is later copied to the output Uid on success prior to returning. Then the storage is read into the specified output buffer with storage-offset 0x10, where the size is <code>size = data_size > buf_size ? buf_size : data_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned.
No input, returns a GRC [[GRC_services|IMovieMaker]].
     −
==== GetLayerHandle ====
+
==== GetNotificationStorageChannelEvent ====
No input, returns an output u64.
+
No input, returns an output Event handle with EventClearMode=0.
   −
== ILibraryAppletCreator ==
+
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.
{| class="wikitable" border="1"
+
 
|-
+
==== TryPopFromNotificationStorageChannel ====
! Cmd || Name || Notes
+
No input, returns an output [[#IStorage]].
|-
  −
| 0 || [[#CreateLibraryApplet]] ||
  −
|-
  −
| 1 || [[#TerminateAllLibraryApplets]] ||
  −
|-
  −
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
  −
|-
  −
| 10 || [[#CreateStorage]] ||
  −
|-
  −
| 11 || [[#CreateTransferMemoryStorage]] ||
  −
|-
  −
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||
  −
|}
     −
=== CreateLibraryApplet ===
+
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
     −
=== TerminateAllLibraryApplets ===
+
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.
No input/output.
     −
=== AreAnyLibraryAppletsLeft ===
+
==== GetHealthWarningDisappearedSystemEvent ====
No input, returns an output u8 bool.
+
No input, returns an output Event with EventClearMode=0.
   −
=== CreateStorage ===
+
==== SetHdcpAuthenticationActivated ====
Takes an input s64 for the storage size, returns an [[#IStorage]].
+
Takes an input u8 bool, no output.
   −
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
+
==== StartContinuousRecordingFlushForDebug ====
 +
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
   −
=== CreateTransferMemoryStorage ===
+
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.
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].
     −
The user-process creates the TransferMemory with permissions=0.
+
==== CreateMovieMaker ====
 +
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].
   −
The TransferMemory is mapped, which can then be accessed via [[#IStorageAccessor]]. The input bool controls whether writing to the storage is allowed: [[#Write]] will throw an error if this flag is not set.
+
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
   −
=== CreateHandleStorage ===
+
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.
     −
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
+
==== PrepareForJit ====
 +
Takes no input. Launches title 010000000000003B (currently not present on retail systems) if some context variable is not set, with that context variable being initialized afterwards.
   −
=== ILibraryAppletAccessor ===
+
=== IMovieMaker ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || [[#GetAppletStateChangedEvent]] ||
+
| 0 || [[#GetGrcMovieMaker]]
 
|-
 
|-
| 1 || [[#IsCompleted]] ||
+
| 1 || [[#GetLayerHandle]]
 +
|}
 +
 
 +
==== GetGrcMovieMaker ====
 +
No input, returns a GRC [[GRC_services|IMovieMaker]].
 +
 
 +
==== GetLayerHandle ====
 +
No input, returns an output u64.
 +
 
 +
== ILibraryAppletCreator ==
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 10 || [[#Start]] ||
+
! Cmd || Name || Notes
 
|-
 
|-
| 20 || [[#RequestExit]] ||
+
| 0 || [[#CreateLibraryApplet]] ||  
 
|-
 
|-
| 25 || [[#Terminate]] ||
+
| 1 || [[#TerminateAllLibraryApplets]] ||
 
|-
 
|-
| 30 || [[#GetResult]] ||
+
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
 
|-
 
|-
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
+
| 10 || [[#CreateStorage]] ||  
 
|-
 
|-
| 100 || [[#PushInData]] ||  
+
| 11 || [[#CreateTransferMemoryStorage]] ||  
 
|-
 
|-
| 101 || [[#PopOutData]] ||
+
| 12 || [2.0.0+] [[#CreateHandleStorage]] ||  
|-
  −
| 102 || [[#PushExtraStorage]] ||
  −
|-
  −
| 103 || [[#PushInteractiveInData]] ||
  −
|-
  −
| 104 || [[#PopInteractiveOutData]] ||
  −
|-
  −
| 105 || [[#GetPopOutDataEvent]] ||
  −
|-
  −
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
  −
|-
  −
| 110 || [[#NeedsToExitProcess]] ||
  −
|-
  −
| 120 || [[#GetLibraryAppletInfo]] ||
  −
|-
  −
| 150 || [[#RequestForAppletToGetForeground]] ||
  −
|-
  −
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
   
|}
 
|}
   −
Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.
+
=== CreateLibraryApplet ===
 +
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
   −
==== SetOutOfFocusApplicationSuspendingEnabled ====
+
=== TerminateAllLibraryApplets ===
Takes an input u8 bool, no output.
+
No input/output.
   −
Official sw will assert prior to using this if applet-service was not initialized as *Application.
+
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
   −
==== PushInData ====
+
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).
Takes an input [[#IStorage]], no output.
     −
==== PopOutData ====
+
=== AreAnyLibraryAppletsLeft ===
No input, returns an output [[#IStorage]].
+
No input, returns an output u8 bool.
   −
==== PushExtraStorage ====
+
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.
Takes an input [[#IStorage]], no output.
     −
==== PushInteractiveInData ====
+
Gets whether any LibraryApplets ([[#ILibraryAppletAccessor]]) which were created by the current applet are still open (or by the Application when used from the [[#IApplicationAccessor]] cmd).
Takes an input [[#IStorage]], no output.
     −
==== PopInteractiveOutData ====
+
=== CreateStorage ===
No input, returns an output [[#IStorage]].
+
Takes an input s64 for the storage size, returns an [[#IStorage]].
   −
==== GetPopOutDataEvent ====
+
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].
No input, returns an output handle.
     −
==== GetPopInteractiveOutDataEvent ====
+
=== CreateTransferMemoryStorage ===
No input, returns an output event handle with autoclear=false.
+
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].
   −
==== NeedsToExitProcess ====
+
The user-process creates the TransferMemory with permissions=0.
No input, returns an output u8 bool.
     −
Stubbed, just returns an error.
+
The TransferMemory is mapped, which can then be accessed via [[#IStorageAccessor]]. The input bool controls whether writing to the storage is allowed: [[#Write]] will throw an error if this flag is not set.
   −
==== RequestForAppletToGetForeground ====
+
=== CreateHandleStorage ===
No input/output.
+
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.
   −
Stubbed, just returns an error.
+
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).
   −
==== GetIndirectLayerConsumerHandle ====
+
=== ILibraryAppletAccessor ===
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.
  −
 
  −
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
  −
 
  −
== ICommonStateGetter ==
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 
|-
 
|-
| 0 || [[#GetEventHandle]] ||
+
| 0 || [[#GetAppletStateChangedEvent]] ||
 
|-
 
|-
| 1 || [[#ReceiveMessage]] ||
+
| 1 || [[#IsCompleted]] ||
 
|-
 
|-
| 2 || [[#GetThisAppletKind]] ||
+
| 10 || [[#Start]] ||
 
|-
 
|-
| 3 || [[#AllowToEnterSleep]] ||
+
| 20 || [[#RequestExit]] ||
 
|-
 
|-
| 4 || [[#DisallowToEnterSleep]] ||
+
| 25 || [[#Terminate]] ||
 
|-
 
|-
| 5 || [[#GetOperationMode]] ||
+
| 30 || [[#GetResult]] ||
 
|-
 
|-
| 6 || [[#GetPerformanceMode]] ||
+
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
 
|-
 
|-
| 7 || [[#GetCradleStatus]] ||
+
| 100 || [[#PushInData]] ||  
 
|-
 
|-
| 8 || [[#GetBootMode]] ||
+
| 101 || [[#PopOutData]] ||  
 
|-
 
|-
| 9 || [[#GetCurrentFocusState]] ||
+
| 102 || [[#PushExtraStorage]] ||  
 
|-
 
|-
| 10 || [[#RequestToAcquireSleepLock]] ||
+
| 103 || [[#PushInteractiveInData]] ||  
 
|-
 
|-
| 11 || [[#ReleaseSleepLock]] ||
+
| 104 || [[#PopInteractiveOutData]] ||  
 
|-
 
|-
| 12 || [[#ReleaseSleepLockTransiently]] ||
+
| 105 || [[#GetPopOutDataEvent]] ||
 
|-
 
|-
| 13 || [[#GetAcquiredSleepLockEvent]] ||
+
| 106 || [[#GetPopInteractiveOutDataEvent]] ||
 
|-
 
|-
| 20 || [[#PushToGeneralChannel]] ||  
+
| 110 || [[#NeedsToExitProcess]] ||
 
|-
 
|-
| 30 || [[#GetHomeButtonReaderLockAccessor]] ||  
+
| 120 || [[#GetLibraryAppletInfo]] ||  
 
|-
 
|-
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]] ||  
+
| 150 || [[#RequestForAppletToGetForeground]] ||
 
|-
 
|-
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]] ||
+
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
|-
+
|}
| 40 || [2.0.0+] [[#GetCradleFwVersion]] ||
+
 
|-
+
Commands <=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.
| 50 || [3.0.0+] [[#IsVrModeEnabled]] ||
+
 
|-
+
==== SetOutOfFocusApplicationSuspendingEnabled ====
| 51 || [3.0.0+] [[#SetVrModeEnabled]] ||
+
Takes an input u8 bool, no output.
|-
+
 
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]] ||
+
Official sw will assert prior to using this if applet-service was not initialized as *Application.
|-
+
 
| 53 || [7.0.0+] [[#BeginVrModeEx]] ||
+
==== PushInData ====
|-
+
Takes an input [[#IStorage]], no output.
| 54 || [7.0.0+] [[#EndVrModeEx]] ||
+
 
|-
+
==== PopOutData ====
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]] ||
+
No input, returns an output [[#IStorage]].
|-
+
 
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]] ||
+
==== PushExtraStorage ====
|-
+
Takes an input [[#IStorage]], no output.
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]] ||
  −
|-
  −
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]] ||
  −
|-
  −
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]] ||
  −
|-
  −
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]] ||
  −
|-
  −
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]] ||
  −
|-
  −
| 66 || [6.0.0+] [[#SetCpuBoostMode]] ||
  −
|-
  −
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]] ||
  −
|-
  −
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]] ||
  −
|-
  −
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
  −
|-
  −
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
  −
|}
     −
Officially notification messages are handled by the application itself, not sdk-nso in ExeFS. Official apps call code in sdk-nso which basically uses svcWaitSynchronization with the event from [[#GetEventHandle]] to check whether a message is available, then if so it uses [[#ReceiveMessage]]. The actual handling for message IDs is done in the app itself(see [[#NotificationMessage]]).
+
==== PushInteractiveInData ====
 +
Takes an input [[#IStorage]], no output.
   −
[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.
+
==== PopInteractiveOutData ====
 +
No input, returns an output [[#IStorage]].
   −
=== GetEventHandle ===
+
==== GetPopOutDataEvent ====
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].
+
No input, returns an output handle with autoclear=false.
   −
=== ReceiveMessage ===
+
==== GetPopInteractiveOutDataEvent ====
No input. Returns an output u32. Error 0x680 indicates no message is available.
+
No input, returns an output event handle with autoclear=false.
   −
=== GetThisAppletKind ===
+
==== NeedsToExitProcess ====
No input, returns an output [[#AppletKind]].
+
No input, returns an output u8 bool.
    
Stubbed, just returns an error.
 
Stubbed, just returns an error.
   −
=== AllowToEnterSleep ===
+
==== RequestForAppletToGetForeground ====
 
No input/output.
 
No input/output.
    
Stubbed, just returns an error.
 
Stubbed, just returns an error.
   −
=== DisallowToEnterSleep ===
+
==== GetIndirectLayerConsumerHandle ====
No input/output.
+
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.
   −
Stubbed, just returns an error.
+
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.
   −
=== GetOperationMode ===
+
== ICommonStateGetter ==
No input. Returns an output u8 for the current [[#OperationMode]].
+
{| class="wikitable" border="1"
 
+
|-
=== GetPerformanceMode ===
+
! Cmd || Name || Notes
No input. Returns an output u32 for the current PerformanceMode.
+
|-
 
+
| 0 || [[#GetEventHandle]] ||
=== GetCradleStatus ===
+
|-
No input, returns an output u8.
+
| 1 || [[#ReceiveMessage]] ||
 
+
|-
This uses [[#omm]] GetCradleStatus.
+
| 2 || [[#GetThisAppletKind]] ||
 
+
|-
=== GetBootMode ===
+
| 3 || [[#AllowToEnterSleep]] ||
No input, returns an output u8.
+
|-
 
+
| 4 || [[#DisallowToEnterSleep]] ||
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
+
|-
 
+
| 5 || [[#GetOperationMode]] ||
=== GetCurrentFocusState ===
+
|-
No input. Returns an output u8:
+
| 6 || [[#GetPerformanceMode]] ||
 
+
|-
* 1: In focus.
+
| 7 || [[#GetCradleStatus]] ||
* 2/3: Out of focus(running in "background").
+
|-
 
+
| 8 || [[#GetBootMode]] ||
=== RequestToAcquireSleepLock ===
+
|-
No input/output.
+
| 9 || [[#GetCurrentFocusState]] ||
 
+
|-
=== ReleaseSleepLock ===
+
| 10 || [[#RequestToAcquireSleepLock]] ||
No input/output.
+
|-
 
+
| 11 || [[#ReleaseSleepLock]] ||
=== ReleaseSleepLockTransiently ===
+
|-
No input/output.
+
| 12 || [[#ReleaseSleepLockTransiently]] ||
 
+
|-
=== GetAcquiredSleepLockEvent ===
+
| 13 || [[#GetAcquiredSleepLockEvent]] ||
No input, returns an output Event handle with autoclear=false.
+
|-
 
+
| 20 || [[#PushToGeneralChannel]] ||
=== PushToGeneralChannel ===
+
|-
Takes an input [[#IStorage]], no output.
+
| 30 || [[#GetHomeButtonReaderLockAccessor]] ||
 
+
|-
This is not usable under an Application, however it is usable under a LibraryApplet.
+
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]] ||
 
+
|-
Used for sending requests to [[qlaunch]]. sdk-nso creates a 0x10-byte storage which is sent to this. The following are the functions which use this, with the data written to the storage:
+
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]] ||
* <code>RequestHomeMenu</code> <code>5341 4d53 0100 0000 0200 0000 0100 0000</code> Returns to the main Home Menu, equivalent to pressing the HOME button.
+
|-
* <code>RequestJumpToSystemUpdate</code> <code>5341 4d53 0100 0000 0b00 0000 0100 0000</code> Equivalent to entering "System Update" under System Settings. When leaving this, it returns to the main Home Menu.
+
| 40 || [2.0.0+] [[#GetCradleFwVersion]] ||
 
+
|-
=== GetHomeButtonReaderLockAccessor ===
+
| 50 || [3.0.0+] [[#IsVrModeEnabled]] ||
No input, returns an output [[#ILockAccessor]].
+
|-
 +
| 51 || [3.0.0+] [[#SetVrModeEnabled]] ||
 +
|-
 +
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]] ||
 +
|-
 +
| 53 || [7.0.0+] [[#BeginVrModeEx]] ||
 +
|-
 +
| 54 || [7.0.0+] [[#EndVrModeEx]] ||
 +
|-
 +
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]] ||
 +
|-
 +
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]] ||
 +
|-
 +
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]] ||
 +
|-
 +
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]] ||
 +
|-
 +
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]] ||
 +
|-
 +
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]] ||
 +
|-
 +
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]] ||
 +
|-
 +
| 66 || [6.0.0+] [[#SetCpuBoostMode]] ||
 +
|-
 +
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]] ||
 +
|-
 +
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]] ||
 +
|-
 +
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
 +
|-
 +
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]] ||
 +
|-
 +
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
 +
|-
 +
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]] ||
 +
|}
   −
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
+
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]]).
   −
=== GetReaderLockAccessorEx ===
+
[7.0.0+] User-processes now use BeginVrModeEx/EndVrModeEx instead of [[#SetVrModeEnabled]]. Prior to using using BeginVrModeEx, [[Parental_Control_services|pctl]] IsStereoVisionPermitted is used and error 0xD08E is thrown if not allowed by pctl.
Takes an input u32, returns an output [[#ILockAccessor]].
     −
The input value must be 0-3. 0 = HomeButton.
+
=== GetEventHandle ===
 +
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].
   −
=== GetWriterLockAccessorEx ===
+
=== ReceiveMessage ===
Takes an input u32, returns an output [[#ILockAccessor]].
+
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.
   −
The input value must be 0-3. 0 = HomeButton.
+
=== GetThisAppletKind ===
 +
No input, returns an output [[#AppletKind]].
   −
=== GetCradleFwVersion ===
+
Stubbed, just returns an error.
No input, returns 4 output u32s.
     −
This uses [[#omm]] GetCradleFwVersion.
+
=== AllowToEnterSleep ===
 +
No input/output.
   −
=== IsVrModeEnabled ===
+
Stubbed, just returns an error.
No input, returns an output u8 bool.
     −
=== SetVrModeEnabled ===
+
=== DisallowToEnterSleep ===
Takes an input u8 bool flag. No output.
+
No input/output.
   −
Updates internal AM state fields. If the new state doesn't match the previous state, this uses the [[Backlight_services]] {Disable/Enable}VrMode command depending on whether flag={disable/enable}.
+
Stubbed, just returns an error.
   −
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.
+
=== GetOperationMode ===
 +
No input. Returns an output u8 for the current [[#OperationMode]].
   −
=== SetLcdBacklighOffEnabled ===
+
=== GetPerformanceMode ===
Takes an input u8 bool, no output.
+
No input. Returns an output u32 for the current PerformanceMode.
   −
Sets whether the LCD screen blacklight is turned off.
+
=== GetCradleStatus ===
 +
No input, returns an output u8.
 +
 
 +
This uses [[#omm]] GetCradleStatus.
   −
=== BeginVrModeEx ===
+
=== GetBootMode ===
No input/output.
+
No input, returns an output u8.
   −
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
+
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.
   −
=== EndVrModeEx ===
+
=== GetCurrentFocusState ===
No input/output.
+
No input. Returns an output u8:
   −
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
+
* 1: In focus.
 +
* 2/3: Out of focus(running in "background").
   −
=== IsInControllerFirmwareUpdateSection ===
+
=== RequestToAcquireSleepLock ===
No input, returns an output u8 bool.
+
No input/output.
   −
=== GetDefaultDisplayResolution ===
+
=== ReleaseSleepLock ===
No input, returns two output s32s '''width''' and '''height'''.
+
No input/output.
   −
=== GetDefaultDisplayResolutionChangeEvent ===
+
=== ReleaseSleepLockTransiently ===
No input, returns an output Event handle with autoclear=true.
+
No input/output.
   −
=== GetHdcpAuthenticationState ===
+
=== GetAcquiredSleepLockEvent ===
No input, returns an output s32.
+
No input, returns an output Event handle with autoclear=false.
   −
=== GetHdcpAuthenticationStateChangeEvent ===
+
=== PushToGeneralChannel ===
No input, returns an output Event handle with autoclear=true.
+
Takes an input [[#IStorage]], no output.
   −
=== SetTvPowerStateMatchingMode ===
+
This is not usable under an Application, however it is usable under a LibraryApplet.
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.
     −
=== GetApplicationIdByContentActionName ===
+
Used for sending requests to [[qlaunch]]. sdk-nso creates a 0x10-byte storage which is sent to this. The following are the functions which use this, with the data written to the storage:
Takes a type-0x5 input buffer containing a string, returns an output u64 titleID.
+
* <code>RequestHomeMenu</code> <code>5341 4d53 0100 0000 0200 0000 0100 0000</code> Returns to the main Home Menu, equivalent to pressing the HOME button.
 +
* <code>RequestJumpToSystemUpdate</code> <code>5341 4d53 0100 0000 0b00 0000 0100 0000</code> Equivalent to entering "System Update" under System Settings. When leaving this, it returns to the main Home Menu.
   −
Gets the application titleID for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (starter).
+
=== GetHomeButtonReaderLockAccessor ===
 +
No input, returns an output [[#ILockAccessor]].
   −
=== SetCpuBoostMode ===
+
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.
Takes an input u32 '''CpuBoostMode''' (only modes 0 and 1 are valid) and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
     −
=== PerformSystemButtonPressingIfInFocus ===
+
=== GetReaderLockAccessorEx ===
Takes an input [[#SystemButtonType]], no output.
+
Takes an input u32, returns an output [[#ILockAccessor]].
   −
=== SetPerformanceConfigurationChangedNotification ===
+
The input value must be 0-3. 0 = HomeButton.
Takes an input u8 bool, no output.
     −
=== GetCurrentPerformanceConfiguration ===
+
=== GetWriterLockAccessorEx ===
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
+
Takes an input u32, returns an output [[#ILockAccessor]].
   −
=== GetOperationModeSystemInfo ===
+
The input value must be 0-3. 0 = HomeButton.
No input, returns an output u32.
     −
This returns the output from omm [[#Cmd26]].
+
=== GetCradleFwVersion ===
 +
No input, returns 4 output u32s.
   −
== ISelfController ==
+
This uses [[#omm]] GetCradleFwVersion.
{| class="wikitable" border="1"
+
 
|-
+
=== IsVrModeEnabled ===
! Cmd || Name
+
No input, returns an output u8 bool.
|-
+
 
| 0 || [[#Exit]]
+
=== SetVrModeEnabled ===
|-
+
Takes an input u8 bool flag. No output.
| 1 || [[#LockExit]]
+
 
|-
+
Updates internal AM state fields. If the new state doesn't match the previous state, this uses the [[Backlight_services]] {Disable/Enable}VrMode command depending on whether flag={disable/enable}.
| 2 || [[#UnlockExit]]
+
 
|-
+
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.
| 3 || [2.0.0+] [[#EnterFatalSection]]
+
 
|-
+
=== SetLcdBacklighOffEnabled ===
| 4 || [2.0.0+] [[#LeaveFatalSection]]
+
Takes an input u8 bool, no output.
|-
+
 
| 9 || [[#GetLibraryAppletLaunchableEvent]]
+
Sets whether the LCD screen blacklight is turned off.
|-
+
 
| 10 || [[#SetScreenShotPermission]]
+
=== BeginVrModeEx ===
|-
+
No input/output.
| 11 || [[#SetOperationModeChangedNotification]]
+
 
|-
+
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.
| 12 || [[#SetPerformanceModeChangedNotification]]
+
 
|-
+
=== EndVrModeEx ===
| 13 || [[#SetFocusHandlingMode]]
+
No input/output.
|-
+
 
| 14 || [[#SetRestartMessageEnabled]]
+
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.
|-
+
 
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
+
=== IsInControllerFirmwareUpdateSection ===
|-
+
No input, returns an output u8 bool.
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
+
 
|-
+
=== GetDefaultDisplayResolution ===
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
+
No input, returns two output s32s '''width''' and '''height'''.
|-
+
 
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
+
=== GetDefaultDisplayResolutionChangeEvent ===
|-
+
No input, returns an output Event handle with autoclear=true.
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
+
 
|-
+
=== GetHdcpAuthenticationState ===
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
+
No input, returns an output s32.
|-
+
 
| 40 || [[#CreateManagedDisplayLayer]]
+
=== GetHdcpAuthenticationStateChangeEvent ===
|-
+
No input, returns an output Event handle with autoclear=true.
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
+
 
|-
+
=== SetTvPowerStateMatchingMode ===
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
+
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.
|-
+
 
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
+
=== GetApplicationIdByContentActionName ===
|-
+
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].
| 50 || [[#SetHandlesRequestToDisplay]]
+
 
|-
+
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).
| 51 || [[#ApproveToDisplay]]
+
 
|-
+
=== SetCpuBoostMode ===
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
+
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 ===
 +
Takes an input u8 bool, no output.
 +
 
 +
=== GetCurrentPerformanceConfiguration ===
 +
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
 +
 
 +
=== GetOperationModeSystemInfo ===
 +
No input, returns an output u32.
 +
 
 +
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].
 +
 
 +
=== GetSettingsPlatformRegion ===
 +
No input, returns an output u8.
 +
 
 +
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].
 +
 
 +
== ISelfController ==
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 61 || [[#SetMediaPlaybackState]]
+
! Cmd || Name
 
|-
 
|-
| 62 || [[#SetIdleTimeDetectionExtension]]
+
| 0 || [[#Exit]]
 
|-
 
|-
| 63 || [[#GetIdleTimeDetectionExtension]]
+
| 1 || [[#LockExit]]
 
|-
 
|-
| 64 || [[#SetInputDetectionSourceSet]]
+
| 2 || [[#UnlockExit]]
 
|-
 
|-
| 65 || [2.0.0+] [[#ReportUserIsActive]]
+
| 3 || [2.0.0+] [[#EnterFatalSection]]
 
|-
 
|-
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
+
| 4 || [2.0.0+] [[#LeaveFatalSection]]
 
|-
 
|-
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
+
| 9 || [[#GetLibraryAppletLaunchableEvent]]
 
|-
 
|-
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
+
| 10 || [[#SetScreenShotPermission]]
 
|-
 
|-
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
+
| 11 || [[#SetOperationModeChangedNotification]]
 +
|-
 +
| 12 || [[#SetPerformanceModeChangedNotification]]
 +
|-
 +
| 13 || [[#SetFocusHandlingMode]]
 +
|-
 +
| 14 || [[#SetRestartMessageEnabled]]
 +
|-
 +
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]
 
|-
 
|-
| 70 || [4.0.0+] [[#ReportMultimediaError]]
+
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]
 
|-
 
|-
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
+
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]
 
|-
 
|-
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
+
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]
 
|-
 
|-
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
+
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]
 
|-
 
|-
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
+
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
 
|-
 
|-
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
+
| 40 || [[#CreateManagedDisplayLayer]]
 
|-
 
|-
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
+
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]
 
|-
 
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
+
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]
|}
  −
 
  −
=== Exit ===
  −
No input/output.
  −
 
  −
=== LockExit ===
  −
No input/output.
  −
 
  −
Locks exit process of pressing X to close in HOME Menu for an application or HOME button for an applet. When locked, it will show the "waiting for software to be closed dialog" until UnlockExit is called or a 15 seconds timeout (when the latter occurs, the process is force-terminated).
  −
 
  −
=== UnlockExit ===
  −
No input/output.
  −
 
  −
Unlocks exit process, if LockExit was previously used.
  −
 
  −
=== EnterFatalSection ===
  −
No input/output.
  −
 
  −
=== LeaveFatalSection ===
  −
No input/output.
  −
 
  −
[[#EnterFatalSection]] must be executed at least once before executing this command, otherwise error code 0x40080 will be returned. EnterFatalSection and LeaveFatalSection work in pairs, that is, N calls to EnterFatalSection must be performed first in order to perform N executions of LeaveFatalSection. Essentially, these two functions operate like how one would lock and unlock a recursive mutex.
  −
 
  −
=== GetLibraryAppletLaunchableEvent ===
  −
No input, returns an output event handle with autoclear=false.
  −
 
  −
=== SetScreenShotPermission ===
  −
Takes an input s32. No output.
  −
 
  −
Controls whether screenshot-capture is allowed.
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Value || Description
+
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
 
|-
 
|-
| 0 || Inherit from parent applet
+
| 50 || [[#SetHandlesRequestToDisplay]]
 
|-
 
|-
| 1 || Enable
+
| 51 || [[#ApproveToDisplay]]
 
|-
 
|-
| 2 || Disable
+
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]
 
|-
 
|-
|}
+
| 61 || [[#SetMediaPlaybackState]]
 +
|-
 +
| 62 || [[#SetIdleTimeDetectionExtension]]
 +
|-
 +
| 63 || [[#GetIdleTimeDetectionExtension]]
 +
|-
 +
| 64 || [[#SetInputDetectionSourceSet]]
 +
|-
 +
| 65 || [2.0.0+] [[#ReportUserIsActive]]
 +
|-
 +
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]
 +
|-
 +
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]
 +
|-
 +
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]
 +
|-
 +
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]
 +
|-
 +
| 70 || [4.0.0+] [[#ReportMultimediaError]]
 +
|-
 +
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
 +
|-
 +
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
 +
|-
 +
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
 +
|-
 +
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]
 +
|-
 +
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]
 +
|-
 +
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]
 +
|-
 +
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
 +
|-
 +
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
 +
|}
   −
=== SetOperationModeChangedNotification ===
+
=== Exit ===
Takes an input u8 bool flag. No output.
+
No input/output.
   −
=== SetPerformanceModeChangedNotification ===
+
Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
Takes an input u8 bool flag. No output.
     −
=== SetFocusHandlingMode ===
+
=== LockExit ===
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.
+
No input/output.
   −
=== SetRestartMessageEnabled ===
+
Locks exit process of pressing X to close in HOME Menu for an application or HOME button for an applet. When locked, it will show the "waiting for software to be closed dialog" until UnlockExit is called or a 15 seconds timeout (when the latter occurs, the process is force-terminated).
Takes an input u8 bool flag, no output.
     −
See [[#NotificationMessage]].
+
=== UnlockExit ===
 +
No input/output.
   −
=== SetScreenShotAppletIdentityInfo ===
+
Unlocks exit process, if LockExit was previously used.
Takes an input [[#AppletIdentityInfo]], no output.
     −
=== SetOutOfFocusSuspendingEnabled ===
+
=== EnterFatalSection ===
Takes an input u8 bool flag. No output.
+
No input/output.
   −
=== SetControllerFirmwareUpdateSection ===
+
=== LeaveFatalSection ===
Takes an input u8 bool flag, no output.
+
No input/output.
   −
This throws error 0x40280 when the internal state flag already matches the input value.
+
[[#EnterFatalSection]] must be executed at least once before executing this command, otherwise error code 0x40080 will be returned. EnterFatalSection and LeaveFatalSection work in pairs, that is, N calls to EnterFatalSection must be performed first in order to perform N executions of LeaveFatalSection. Essentially, these two functions operate like how one would lock and unlock a recursive mutex.
   −
=== SetRequiresCaptureButtonShortPressedMessage ===
+
=== GetLibraryAppletLaunchableEvent ===
Takes an input u8 bool flag, no output.
+
No input, returns an output event handle with autoclear=false.
   −
See [[#NotificationMessage]].
+
=== SetScreenShotPermission ===
 +
Takes an input s32. No output.
   −
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
+
Controls whether screenshot-capture is allowed.
   −
=== SetAlbumImageOrientation ===
+
{| class="wikitable" border="1"
Takes an input u32 "nn::album::ImageOrientation". No output.
+
|-
 +
! Value || Description
 +
|-
 +
| 0 || Inherit from parent applet
 +
|-
 +
| 1 || Enable
 +
|-
 +
| 2 || Disable
 +
|-
 +
|}
   −
The input value must not be >3.
+
=== SetOperationModeChangedNotification ===
 +
Takes an input u8 bool flag. No output.
   −
=== SetDesirableKeyboardLayout ===
+
=== SetPerformanceModeChangedNotification ===
Takes an input u32, no output.
+
Takes an input u8 bool flag. No output.
   −
The input u32 is "nn::settings::KeyboardLayout".
+
=== SetFocusHandlingMode ===
 +
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.
   −
=== CreateManagedDisplayLayer ===
+
=== SetRestartMessageEnabled ===
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.
   −
=== IsSystemBufferSharingEnabled ===
+
See [[#AppletMessage]].
No input/output.
     −
Not available when the current applet is an Application ([[#AppletId]] == 0x01).
+
=== SetScreenShotAppletIdentityInfo ===
 +
Takes an input [[#AppletIdentityInfo]], no output.
 +
 
 +
=== SetOutOfFocusSuspendingEnabled ===
 +
Takes an input u8 bool flag. No output.
 +
 
 +
=== SetControllerFirmwareUpdateSection ===
 +
Takes an input u8 bool flag, no output.
 +
 
 +
This throws error 0x40280 when the internal state flag already matches the input value.
 +
 
 +
=== SetRequiresCaptureButtonShortPressedMessage ===
 +
Takes an input u8 bool flag, no output.
 +
 
 +
See [[#AppletMessage]].
 +
 
 +
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.
 +
 
 +
=== SetAlbumImageOrientation ===
 +
Takes an input u32 "nn::album::ImageOrientation". No output.
 +
 
 +
The input value must not be >3.
 +
 
 +
=== SetDesirableKeyboardLayout ===
 +
Takes an input u32, no output.
 +
 
 +
The input u32 is "nn::settings::KeyboardLayout".
 +
 
 +
=== CreateManagedDisplayLayer ===
 +
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].
 +
 
 +
=== IsSystemBufferSharingEnabled ===
 +
No input/output.
 +
 
 +
Not available when the current applet is an Application ([[#AppletId]] == 0x01).
    
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
 
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
Line 1,509: Line 1,834:  
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
 
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].
   −
See [[#NotificationMessage]].
+
See [[#AppletMessage]].
    
=== ApproveToDisplay ===
 
=== ApproveToDisplay ===
Line 1,569: Line 1,894:     
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
 
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
 +
 +
=== SetInputDetectionPolicy ===
 +
Takes an input [[#InputDetectionPolicy]], no output.
    
=== SetWirelessPriorityMode ===
 
=== SetWirelessPriorityMode ===
Line 1,588: Line 1,916:  
Takes an input u8 bool, no output.
 
Takes an input u8 bool, no output.
   −
See [[#NotificationMessage]].
+
See [[#AppletMessage]].
    
=== SetApplicationAlbumUserData ===
 
=== SetApplicationAlbumUserData ===
Line 1,944: Line 2,272:     
=== GetLaunchReason ===
 
=== GetLaunchReason ===
No input, returns an output u32 "nn::am::service::AppletProcessLaunchReason".
+
No input, returns an output [[#AppletProcessLaunchReason]].
    
Used by LibraryApplets.
 
Used by LibraryApplets.
Line 1,950: Line 2,278:  
=== OpenCallingLibraryApplet ===
 
=== OpenCallingLibraryApplet ===
 
No input, returns an output [[#ILibraryAppletAccessor]].
 
No input, returns an output [[#ILibraryAppletAccessor]].
 +
 +
The objptr from state is cleared during this, an error is thrown if it's already 0.
    
=== PushContext ===
 
=== PushContext ===
Line 1,974: Line 2,304:  
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 
|-
 
|-
| 0 || NotifyMessageToHomeMenuForDebug ||
+
| 0 || [[#NotifyMessageToHomeMenuForDebug]] ||
 
|-
 
|-
 
| 1 || [[#OpenMainApplication]] ||  
 
| 1 || [[#OpenMainApplication]] ||  
 
|-
 
|-
| 10 || EmulateButtonEvent ||
+
| 10 || [[#PerformSystemButtonPressing]] ||
 
|-
 
|-
| 20 || InvalidateTransitionLayer ||
+
| 20 || [[#InvalidateTransitionLayer]] ||
 
|-
 
|-
| 30 || [6.0.0+] RequestLaunchApplicationWithUserAndArgumentForDebug ||
+
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]] ||
 
|-
 
|-
| 40 || [6.0.0+] GetAppletResourceUsageInfo ||
+
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]] ||
 
|-
 
|-
 
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
 
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
 +
|-
 +
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]] ||
 +
|-
 +
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]] ||
 +
|-
 +
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]] ||
 +
|-
 +
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]] ||
 +
|-
 +
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]] ||
 +
|-
 +
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]] ||
 +
|-
 +
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]] ||
 +
|-
 +
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]] ||
 
|}
 
|}
 +
 +
=== NotifyMessageToHomeMenuForDebug ===
 +
Takes an input [[#AppletMessage]], no output.
 +
 +
Stubbed, just returns an error.
    
=== OpenMainApplication ===
 
=== OpenMainApplication ===
 
No input, returns an output [[#IApplicationAccessor]].
 
No input, returns an output [[#IApplicationAccessor]].
 +
 +
Should not be used when no Application is running (svcBreak).
 +
 +
=== PerformSystemButtonPressing ===
 +
Takes an input [[#SystemButtonType]], no output.
 +
 +
=== InvalidateTransitionLayer ===
 +
No input/output.
 +
 +
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
 +
Takes an input u8 bool flag, an [[NCM_services#ApplicationId|ApplicationId]], a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.
 +
 +
Requests to launch the specified Application, with the specified users. When the bool flag is true, the content of the second input buffer is used to create a storage which is pushed to the UserChannel for this Application (see [[#LaunchParameterKind]]).
 +
 +
=== GetAppletResourceUsageInfo ===
 +
No input, returns an output [[#AppletResourceUsageInfo]].
    
=== SetCpuBoostModeForApplet ===
 
=== SetCpuBoostModeForApplet ===
 
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]].
   −
== IStorage ==
+
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
{| class="wikitable" border="1"
+
 
|-
+
=== PushToAppletBoundChannelForDebug ===
! Cmd || Name || Notes
+
Takes an input [[#IStorage]] and a s32, no output.
|-
  −
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
  −
|-
  −
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
  −
|}
     −
Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].
+
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
   −
Only 1 *Accessor session can be open for each IStorage at a time.
+
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.
   −
== IStorageAccessor ==
+
=== 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"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 
|-
 
|-
| 0 || GetSize || No input. Returns an s64.
+
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
 
|-
 
|-
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.
+
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].
|-
  −
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.
   
|}
 
|}
   −
== 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"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 2,063: Line 2,476:  
|rowspan="2"| 1 || [1.0.0-3.0.2]
 
|rowspan="2"| 1 || [1.0.0-3.0.2]
 
|-
 
|-
| [7.0.0+]
+
| [7.0.0+] IsAutoPowerDownRequested
 
|-
 
|-
 
| 2 || [1.0.0-3.0.2]
 
| 2 || [1.0.0-3.0.2]
 
|-
 
|-
| 3 || SetHandlingContext
+
| 3 || [[#SetHandlingContext]]
 
|-
 
|-
 
| 4 || LoadAndApplySettings
 
| 4 || LoadAndApplySettings
Line 2,074: Line 2,487:  
|}
 
|}
   −
[3.0.0+] SetHandlingContext now takes an additional 0x10-bytes of input.
+
== SetHandlingContext ==
 +
[3.0.0+] Now takes an additional 0x10-bytes of input.
    
= omm =
 
= omm =
Line 2,080: Line 2,494:     
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
 
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
Besides [[PTM_services]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
+
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 +
|-
 +
| 0 || GetOperationMode
 
|-
 
|-
| 0 || GetOperationMode ||  
+
| 1 || GetOperationModeChangeEvent
 
|-
 
|-
| 1 || GetOperationModeChangeEvent ||  
+
| 2 || EnableAudioVisual
 
|-
 
|-
| 2 || EnableAudioVisual ||  
+
| 3 || DisableAudioVisual
 
|-
 
|-
| 3 || DisableAudioVisual ||  
+
| 4 || EnterSleepAndWait
 
|-
 
|-
| 4 || EnterSleepAndWait ||  
+
| 5 || GetCradleStatus
 
|-
 
|-
| 5 || GetCradleStatus ||  
+
| 6 || FadeInDisplay
 
|-
 
|-
| 6 || FadeInDisplay ||  
+
| 7 || FadeOutDisplay
 
|-
 
|-
| 7 || FadeOutDisplay ||  
+
| 8 || [2.0.0+] GetCradleFwVersion
 
|-
 
|-
| 8 || [2.0.0+] GetCradleFwVersion ||
+
| 9 || [2.0.0+] NotifyCecSettingsChanged
 
|-
 
|-
| 9 || [2.0.0+] NotifyCecSettingsChanged ||
+
| 10 || [3.0.0+] SetOperationModePolicy
 
|-
 
|-
| 10 || [3.0.0+] SetOperationModePolicy ||
+
| 11 || [3.0.0+] GetDefaultDisplayResolution
 
|-
 
|-
| 11 || [3.0.0+] GetDefaultDisplayResolution ||
+
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
 
|-
 
|-
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent ||
+
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
 
|-
 
|-
| 13 || [3.0.0+] UpdateDefaultDisplayResolution ||
+
| 14 || [3.0.0+] ShouldSleepOnBoot
 
|-
 
|-
| 14 || [3.0.0+] ShouldSleepOnBoot ||
+
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
 
|-
 
|-
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted ||
+
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
 
|-
 
|-
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished ||
+
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
 
|-
 
|-
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted ||
+
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
 
|-
 
|-
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished ||
+
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
 
|-
 
|-
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent ||
+
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
 
|-
 
|-
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled ||
+
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
 
|-
 
|-
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation ||
+
| 22 || [4.0.0+] GetHdcpStateChangeEvent
 
|-
 
|-
| 22 || [4.0.0+] GetHdcpStateChangeEvent ||
+
| 23 || [4.0.0+] GetHdcpState
 
|-
 
|-
| 23 || [4.0.0+] GetHdcpState ||
+
| 24 || [5.0.0+] ShowCardUpdateProcessing
 
|-
 
|-
| 24 || [5.0.0+] ShowCardUpdateProcessing ||
+
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
 
|-
 
|-
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged ||
+
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
 
|-
 
|-
| 26 || [7.0.0+] ||
+
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
 
|}
 
|}
   −
== Cmd26 ==
+
== GetOperationModeSystemInfo ==
 
No input, returns an output u32.
 
No input, returns an output u32.
   −
This is used by [[#GetOperationModeSystemInfo]].
+
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
    
= spsm =
 
= spsm =
Line 2,153: Line 2,569:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || GetState
+
| 0 || GetCurrentState
 
|-
 
|-
| 1 || SleepSystemAndWaitAwake
+
| 1 || EnterSleep
 
|-
 
|-
| 2 ||  
+
| 2 || GetLastWakeReason
 
|-
 
|-
| 3 ||  
+
| 3 || Shutdown
 
|-
 
|-
 
| 4 || GetNotificationMessageEventHandle
 
| 4 || GetNotificationMessageEventHandle
 
|-
 
|-
| 5 ||  
+
| 5 || ReceiveNotificationMessage
 
|-
 
|-
| 6 ||  
+
| 6 || AnalyzeLogForLastSleepWakeSequence
 
|-
 
|-
| 7 ||  
+
| 7 || ResetEventLog
 
|-
 
|-
 
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
 
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
Line 2,173: Line 2,589:  
| 9 || ChangeHomeButtonLongPressingTime
 
| 9 || ChangeHomeButtonLongPressingTime
 
|-
 
|-
| 10 ||  
+
| 10 || PutErrorState
 
|-
 
|-
| 11 || [1.0.0-3.0.2]
+
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
 
|}
 
|}
   Line 2,219: Line 2,635:     
== SaveScreenShot ==
 
== SaveScreenShot ==
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer. Returns a 0x20-byte struct '''ApplicationAlbumEntry'''.
+
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.
   −
Official user-processes doesn't use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero except +0 is set to an input u32.
+
This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
    
== SaveScreenShotEx0 ==
 
== SaveScreenShotEx0 ==
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'''.
+
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 =
 
= Library Applets =
Line 2,282: Line 2,706:  
| 0x04
 
| 0x04
 
| 0100000000001012
 
| 0100000000001012
| "starter"
+
| "starter" SystemApplication.
 
|-
 
|-
 
| 0x0A
 
| 0x0A
Line 2,294: Line 2,718:  
| 0x0C
 
| 0x0C
 
| 0100000000001003
 
| 0100000000001003
| "controller"
+
| [[Controller_Applet|"controller"]]
 
|-
 
|-
 
| 0x0D
 
| 0x0D
Line 2,330: Line 2,754:  
| 0x15
 
| 0x15
 
| 010000000000100D
 
| 010000000000100D
| "photoViewer"
+
| [[Album_Applet|"photoViewer"]]
 
|-
 
|-
 
| 0x16
 
| 0x16
Line 2,350: Line 2,774:  
| 0x1A
 
| 0x1A
 
| 0100000000001013
 
| 0100000000001013
| "myPage"
+
| [[MyPage_Applet|"myPage"]]
 
|}
 
|}
   Line 2,376: Line 2,800:  
|}
 
|}
   −
=== NotificationMessage ===
+
=== AppletMessage ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 2,398: Line 2,822:  
| 0x5C || Screenshot was [[#SetAlbumImageTakenNotificationEnabled|taken]].
 
| 0x5C || Screenshot was [[#SetAlbumImageTakenNotificationEnabled|taken]].
 
|}
 
|}
 +
 +
This is "nn::am::AppletMessage".
    
=== OperationMode ===
 
=== OperationMode ===
Line 2,432: Line 2,858:  
|-
 
|-
 
| 2 || PerformHomeButtonLongPressing
 
| 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
 
| 6 || PerformCaptureButtonShortPressing
Line 2,438: Line 2,870:  
|}
 
|}
   −
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]].
+
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
    
=== LaunchParameterKind ===
 
=== LaunchParameterKind ===
Line 2,446: Line 2,878:  
!  Description
 
!  Description
 
|-
 
|-
| 1 || Application-specific LaunchParameter
+
| 1 || UserChannel. Application-specific LaunchParameter.
 
|-
 
|-
 
| 2 || account PreselectedUser
 
| 2 || account PreselectedUser
Line 2,474: Line 2,906:  
!  Description
 
!  Description
 
|-
 
|-
| 0 || u8 ProgramIndex. "ExecuteProgram". User-process enters an infinite svcSleepThread loop afterwards.
+
| 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 || u64 titleID. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
+
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
 
|-
 
|-
 
| 2 || u64 = value 0. "RestartProgram"
 
| 2 || u64 = value 0. "RestartProgram"
Line 2,484: Line 2,916:  
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
 
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
   −
= AppletResourceUserId =
+
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.
This u64 is officially called "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
+
 
 
+
= InputDetectionPolicy =
= LibraryAppletInfo =
+
{| 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"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || [[#AppletId]]
+
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
 
|-
 
|-
| 0x4 || 0x4 || [[#LibraryAppletMode]]
+
| 0x8 || 0x4 || Application title-version.
|}
  −
 
  −
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
+
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
 
|-
 
|-
| 0x0 || 0x4 || [[#AppletId]]
+
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
 
|-
 
|-
| 0x4 || 0x4 || Padding
+
| 0xE || 0x1 || Unknown.
 
|-
 
|-
| 0x8 || 0x8 || titleID
+
| 0xF || 0x1 || Padding.
 
|}
 
|}
   −
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
+
This struct is 0x10-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 || [7.0.0+] 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).
     −
= ApplicationAttribute =
+
= AppletResourceUsageInfo =
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
+
| 0x0 || 0x4 || Unknown counter.
 
|-
 
|-
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
+
| 0x4 || 0x4 || Unknown counter.
 
|-
 
|-
| 0x8 || 0x4 || float audio volume. 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 || Unused. 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.
 
  −
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
      
= Notes =
 
= Notes =

Navigation menu