Changes

Jump to navigation Jump to search
4,742 bytes added ,  16:33, 7 December 2019
Line 146: Line 146:     
==== PopRequestLaunchApplicationForDebug ====
 
==== PopRequestLaunchApplicationForDebug ====
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u64 titleID (<code>nn::ncm::ApplicationId</code>) and an output s32 '''total_userIDs'''.
+
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output [[NCM_services#ApplicationId|ApplicationId]] and an output s32 '''total_userIDs'''.
    
The total entries in the userID buffer must be >= {total userIDs in state}.
 
The total entries in the userID buffer must be >= {total userIDs in state}.
Line 290: Line 290:     
==== CreateApplication ====
 
==== CreateApplication ====
Takes an input u64 titleID (<code>nn::ncm::ApplicationId</code>), returns an [[#IApplicationAccessor]].
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IApplicationAccessor]].
    
==== PopLaunchRequestedApplication ====
 
==== PopLaunchRequestedApplication ====
Line 296: Line 296:     
==== CreateSystemApplication ====
 
==== CreateSystemApplication ====
Takes an input u64 titleID (<code>nn::ncm::SystemApplicationId</code>), returns an [[#IApplicationAccessor]].
+
Takes an input [[NCM_services#ApplicationId|SystemApplicationId]], returns an [[#IApplicationAccessor]].
   −
[[qlaunch]] only uses this with a hard-coded titleID for the "starter" title.
+
[[qlaunch]] only uses this with a hard-coded id for the "starter" title.
    
==== PopFloatingApplicationForDevelopment ====
 
==== PopFloatingApplicationForDevelopment ====
Line 368: Line 368:     
===== GetApplicationId =====
 
===== GetApplicationId =====
No input, returns an output u64 titleID.
+
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
 
  −
Gets the Application titleID.
      
===== PushLaunchParameter =====
 
===== PushLaunchParameter =====
Line 421: Line 419:     
===== HasSaveDataAccessPermission =====
 
===== HasSaveDataAccessPermission =====
Takes an input u64 titleID, returns an output u8 bool flag.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool flag.
   −
Gets whether the savedata specified by the input titleID is accessible. The output flag indicates whether it's accessible.
+
Gets whether the savedata specified by the input ApplicationId is accessible. The output flag indicates whether it's accessible.
   −
If the titleID matches the current application titleID, this immediately returns success with flag=1.
+
If the ApplicationId matches the current application, this immediately returns success with flag=1.
    
===== PushToFriendInvitationStorageChannel =====
 
===== PushToFriendInvitationStorageChannel =====
Line 436: Line 434:     
Clears the Notification StorageChannel, then pushes the input storage there.
 
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 =====
 
===== IAppletAccessor =====
Line 509: Line 509:  
=== PushToAppletBoundChannel ===
 
=== PushToAppletBoundChannel ===
 
Takes an input [[#IStorage]], no output.
 
Takes an input [[#IStorage]], no output.
 +
 +
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
    
=== TryPopFromAppletBoundChannel ===
 
=== TryPopFromAppletBoundChannel ===
 
No input, returns an output [[#IStorage]].
 
No input, returns an output [[#IStorage]].
 +
 +
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
    
=== GetDisplayLogicalResolution ===
 
=== GetDisplayLogicalResolution ===
Line 710: Line 714:     
==== GetCurrentApplicationId ====
 
==== GetCurrentApplicationId ====
No input, returns an output u64.
+
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
   −
Gets the titleID for the currently running Application. titleID=0 when no Application is running.
+
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.
    
==== RequestExitToSelf ====
 
==== RequestExitToSelf ====
Line 720: Line 724:     
==== CreateApplicationAndPushAndRequestToLaunch ====
 
==== CreateApplicationAndPushAndRequestToLaunch ====
Takes an input u64 titleID and an input #IStorage, no output.
+
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.
    
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
 
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
Line 815: Line 819:     
==== GetApplicationIdForLogo ====
 
==== GetApplicationIdForLogo ====
No input, returns an output u64 titleID.
+
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
   −
Gets the application titleID for displaying the logo screen during application launch.
+
Gets the ApplicationId for displaying the logo screen during application launch.
   −
When no application is running, this returns success with titleID=0.
+
When no application is running, this returns success with ApplicationId=0.
    
==== SetGpuTimeSliceBoost ====
 
==== SetGpuTimeSliceBoost ====
Line 974: Line 978:  
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||  
 
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||  
 
|-
 
|-
| 140 || [9.0.0+] GetFriendInvitationStorageChannelEvent ||  
+
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]] ||  
 
|-
 
|-
 
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] ||  
 
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] ||  
 
|-
 
|-
| 150 || [9.0.0+] GetNotificationStorageChannelEvent ||  
+
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]] ||  
 
|-
 
|-
 
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]] ||  
 
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]] ||  
Line 1,006: 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]].
Line 1,147: 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 1,156: 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 1,186: 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.
 +
 
 +
This is exposed by sdknso under <code>nn::friends::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.
    
==== TryPopFromFriendInvitationStorageChannel ====
 
==== TryPopFromFriendInvitationStorageChannel ====
Line 1,192: Line 1,201:     
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].
 
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].
 +
 +
This is exposed by sdknso under <code>nn::friends::</code>. When the storage_size is <0x10, this returns false. <code>data_size = storage_size-0x10;</code> Then the first 0x10-bytes from storage are read to stack, which is later copied to the output Uid on success prior to returning. Then the storage is read into the specified output buffer with storage-offset 0x10, where the size is <code>size = data_size > buf_size ? buf_size : data_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned.
 +
 +
==== GetNotificationStorageChannelEvent ====
 +
No input, returns an output Event handle with EventClearMode=0.
 +
 +
This is exposed by sdknso under <code>nn::notification::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.
    
==== TryPopFromNotificationStorageChannel ====
 
==== TryPopFromNotificationStorageChannel ====
Line 1,197: Line 1,213:     
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
 
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].
 +
 +
This is exposed by sdknso under <code>nn::notification::</code>. The storage is read into the specified output buffer, where the size is <code>size = storage_size > buf_size ? buf_size : storage_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param.
    
==== GetHealthWarningDisappearedSystemEvent ====
 
==== GetHealthWarningDisappearedSystemEvent ====
Line 1,446: Line 1,464:  
|-
 
|-
 
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
 
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
 +
|-
 +
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]] ||
 
|-
 
|-
 
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
 
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
Line 1,584: Line 1,604:     
=== GetApplicationIdByContentActionName ===
 
=== GetApplicationIdByContentActionName ===
Takes a type-0x5 input buffer containing a string, returns an output u64 titleID.
+
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].
   −
Gets the application titleID for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (when the current applet isn't a SystemApplication).
+
Gets the ApplicationId for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (when the current applet isn't a SystemApplication).
    
=== SetCpuBoostMode ===
 
=== SetCpuBoostMode ===
Line 2,298: Line 2,318:  
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
 
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
 
|-
 
|-
| 110 || [9.0.0+] PushToAppletBoundChannelForDebug ||
+
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]] ||
 
|-
 
|-
| 111 || [9.0.0+] TryPopFromAppletBoundChannelForDebug ||
+
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]] ||
 
|-
 
|-
| 120 || [9.0.0+] AlarmSettingNotificationEnableAppEventReserve ||
+
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]] ||
 
|-
 
|-
| 121 || [9.0.0+] AlarmSettingNotificationDisableAppEventReserve ||
+
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]] ||
 
|-
 
|-
| 122 || [9.0.0+] AlarmSettingNotificationPushAppEventNotify ||
+
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]] ||
 
|-
 
|-
| 130 || [9.0.0+] FriendInvitationSetApplicationParameter ||
+
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]] ||
 
|-
 
|-
| 131 || [9.0.0+] FriendInvitationClearApplicationParameter ||
+
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]] ||
 
|-
 
|-
| 132 || [9.0.0+] FriendInvitationPushApplicationParameter ||
+
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]] ||
 
|}
 
|}
   Line 2,332: Line 2,352:     
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
 
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
Takes an input u8 bool flag, an u64 Application titleID, a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.
+
Takes an input 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]]).
 
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]]).
Line 2,343: Line 2,363:     
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 +
=== PushToAppletBoundChannelForDebug ===
 +
Takes an input [[#IStorage]] and a s32, no output.
 +
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 +
The s32 must match the value already stored in state when the state value is non-zero, otherwise an error is returned. When the state value is 0, the s32 is written into state. Then the input storage is pushed to the StorageChannel.
 +
 +
=== TryPopFromAppletBoundChannelForDebug ===
 +
Takes an input s32, returns an output [[#IStorage]].
 +
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 +
The s32 must not be 0 and must match the value previously saved by [[#PushToAppletBoundChannelForDebug]], otherwise errors are returned. Then the output storage is popped from the StorageChannel.
 +
 +
=== AlarmSettingNotificationEnableAppEventReserve ===
 +
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
 +
 +
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
 +
 +
=== AlarmSettingNotificationDisableAppEventReserve ===
 +
No input/output.
 +
 +
Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].
 +
 +
=== AlarmSettingNotificationPushAppEventNotify ===
 +
Takes an input [[#IStorage]], no output.
 +
 +
Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.
 +
 +
=== FriendInvitationSetApplicationParameter ===
 +
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.
 +
 +
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
 +
 +
=== FriendInvitationClearApplicationParameter ===
 +
No input/output.
 +
 +
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].
 +
 +
=== FriendInvitationPushApplicationParameter ===
 +
Takes an input [[#IStorage]], no output.
 +
 +
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
    
== IStorage ==
 
== IStorage ==
Line 2,654: Line 2,718:  
| 0x0C
 
| 0x0C
 
| 0100000000001003
 
| 0100000000001003
| "controller"
+
| [[Controller_Applet|"controller"]]
 
|-
 
|-
 
| 0x0D
 
| 0x0D
Line 2,842: Line 2,906:  
!  Description
 
!  Description
 
|-
 
|-
| 0 || u8 ProgramIndex. "ExecuteProgram". [[NS_Services|NS]] handles ProgramIndex by launching titleID {application_titleID}+ProgramIndex. After using [[#ExecuteProgram]] with this successfully, official user-processes will enter an infinite loop with sleep-thread value 86400000000000.
+
| 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,922: Line 2,986:  
| 0x4 || 0x4 || Padding
 
| 0x4 || 0x4 || Padding
 
|-
 
|-
| 0x8 || 0x8 || titleID
+
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
 
|}
 
|}
   Line 2,966: Line 3,030:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x8 || Application titleID.
+
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
 
|-
 
|-
 
| 0x8 || 0x4 || Application title-version.
 
| 0x8 || 0x4 || Application title-version.

Navigation menu