Changes

Jump to navigation Jump to search
8,525 bytes added ,  16:33, 7 December 2019
|-
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]] ||
|-
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]] ||
|-
| 200 || [8.0.0+] [[#LaunchDevMenu]] ||
==== PopRequestLaunchApplicationForDebug ====
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u64 titleID (<code>nn::ncm::[[NCM_services#ApplicationId</code>) |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 ====
==== CreateApplication ====
Takes an input u64 titleID (<code>nn::ncm::[[NCM_services#ApplicationId</code>)|ApplicationId]], returns an [[#IApplicationAccessor]].
==== PopLaunchRequestedApplication ====
==== CreateSystemApplication ====
Takes an input u64 titleID (<code>nn::ncm::[[NCM_services#ApplicationId|SystemApplicationId</code>)]], returns an [[#IApplicationAccessor]].
[[qlaunch]] only uses this with a hard-coded titleID id for the "starter" title.
==== PopFloatingApplicationForDevelopment ====
|-
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||
|-
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||
|-
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||
|}
===== GetApplicationId =====
No input, returns an output u64 titleID. Gets the Application titleID[[NCM_services#ApplicationId|ApplicationId]].
===== PushLaunchParameter =====
===== HasSaveDataAccessPermission =====
Takes an input u64 titleID[[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.
Gets whether the savedata specified by the ===== PushToFriendInvitationStorageChannel =====Takes an input titleID is accessible. The [[#IStorage]], no output flag indicates whether it's accessible.
If Clears the titleID matches FriendInvitation StorageChannel, then pushes the input storage there. ===== PushToNotificationStorageChannel =====Takes an input [[#IStorage]], no output. Clears the current application titleIDNotification StorageChannel, then pushes the input storage there. [[qlaunch]] will only push data for this immediately returns success with flag=1when 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 =====
|-
! Cmd || Name || Notes
|-
| 0 || [9.0.0+] [[#SetTerminateResult]] ||
|-
| 10 || [[#ReadThemeStorage]] ||
|-
| 11 || [[#WriteThemeStorage]] ||
|-
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]] ||
|-
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]] ||
|-
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]] ||
=== WriteThemeStorage ===
Takes an input u64 '''offset''' and a type-0x21 input buffer, no output.
 
=== PushToAppletBoundChannel ===
Takes an input [[#IStorage]], no output.
 
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
 
=== TryPopFromAppletBoundChannel ===
No input, returns an output [[#IStorage]].
 
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.
=== GetDisplayLogicalResolution ===
|-
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||
|-
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
|-
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
|}
==== GetCurrentApplicationId ====
No input, returns an output u64[[NCM_services#ApplicationId|ApplicationId]].
Gets the titleID [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. titleIDApplicationId=0 when no Application is running.
==== RequestExitToSelf ====
==== CreateApplicationAndPushAndRequestToLaunch ====
Takes an input u64 titleID [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
|-
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
==== GetApplicationIdForLogo ====
No input, returns an output u64 titleID[[NCM_services#ApplicationId|ApplicationId]].
Gets the application titleID ApplicationId for displaying the logo screen during application launch.
When no application is running, this returns success with titleIDApplicationId=0.
==== SetGpuTimeSliceBoost ====
==== 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 ====
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
|-
| 500 140 || [59.0.0+] [[#StartContinuousRecordingFlushForDebugGetFriendInvitationStorageChannelEvent]] || |-| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] || |-| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]] ||
|-
| 1000 151 || [59.0.0+] [[#CreateMovieMakerTryPopFromNotificationStorageChannel]] ||
|-
| 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]] ||
|}
==== CreateApplicationAndPushAndRequestToStart ====
Takes an input u64 titleID [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. titleIDApplicationId=0 can be used to relaunch the current application.
==== CreateApplicationAndPushAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input u64 titleID[[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.
==== CreateApplicationAndRequestToStart ====
Takes an input u64 titleID[[NCM_services#ApplicationId|ApplicationId]], no output.
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
==== CreateApplicationAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input u64 titleID[[NCM_services#ApplicationId|ApplicationId]], no output.
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Takes an input u64 titleID[[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]].
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
Takes an input u64 titleID [[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]].
==== 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[[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.
The number of entries in each array is the same.
==== 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[[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.
No input, returns an output Event handle with autoclear=false.
This is used by sdknso during applet-application initialization. A seperate separate thread is setup where event-waiting is handled. When the Event is signaled, official sw will assert. ==== GetFriendInvitationStorageChannelEvent ====No input, returns an output Event handle with EventClearMode=0. This is exposed by sdknso under <code>nn::friends::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized. ==== TryPopFromFriendInvitationStorageChannel ====No input, returns an output [[#IStorage]]. This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]]. This is exposed by sdknso under <code>nn::friends::</code>. When the storage_size is <0x10, this returns false. <code>data_size = storage_size-0x10;</code> Then the first 0x10-bytes from storage are read to stack, which is later copied to the output Uid on success prior to returning. Then the storage is read into the specified output buffer with storage-offset 0x10, where the size is <code>size = data_size > buf_size ? buf_size : data_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned. ==== GetNotificationStorageChannelEvent ====No input, returns an output Event handle with EventClearMode=0. This is exposed by sdknso under <code>nn::notification::</code>. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized. ==== TryPopFromNotificationStorageChannel ====No input, returns an output [[#IStorage]]. This uses the same StorageChannel as [[#PushToNotificationStorageChannel]]. This is exposed by sdknso under <code>nn::notification::</code>. The storage is read into the specified output buffer, where the size is <code>size = storage_size > buf_size ? buf_size : storage_size</code>. Reading is skipped if size is zero. Afterwards the used size is written to an output param. ==== GetHealthWarningDisappearedSystemEvent ====No input, returns an output Event with EventClearMode=0. ==== SetHdcpAuthenticationActivated ====Takes an input u8 bool, no output.
==== StartContinuousRecordingFlushForDebug ====
|-
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
|-
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]] ||
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
|-
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]] ||
|}
=== GetApplicationIdByContentActionName ===
Takes a type-0x5 input buffer containing a string, returns an output u64 titleID[[NCM_services#ApplicationId|ApplicationId]].
Gets the application titleID 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 ===
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#Cmd26GetPlatformRegion|setsys GetPlatformRegion]].
== ISelfController ==
|-
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]
|-
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
|-
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.
 
=== SetInputDetectionPolicy ===
Takes an input [[#InputDetectionPolicy]], no output.
=== SetWirelessPriorityMode ===
|-
| 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.
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
Takes an input u8 bool flag, an u64 Application titleID[[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]]).
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 ==
|rowspan="2"| 1 || [1.0.0-3.0.2]
|-
| [7.0.0+]IsAutoPowerDownRequested
|-
| 2 || [1.0.0-3.0.2]
|-
| 3 || [[#SetHandlingContext]]
|-
| 4 || LoadAndApplySettings
|}
== SetHandlingContext ==[3.0.0+] SetHandlingContext now Now takes an additional 0x10-bytes of input.
= omm =
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
{| class="wikitable" border="1"
|-
! Cmd || Name |-| Notes0 || 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 9 || [2.0.0+] GetCradleFwVersion || NotifyCecSettingsChanged
|-
| 9 10 || [23.0.0+] NotifyCecSettingsChanged || SetOperationModePolicy
|-
| 10 11 || [3.0.0+] SetOperationModePolicy || GetDefaultDisplayResolution
|-
| 11 12 || [3.0.0+] GetDefaultDisplayResolution || GetDefaultDisplayResolutionChangeEvent
|-
| 12 13 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent || UpdateDefaultDisplayResolution
|-
| 13 14 || [3.0.0+] UpdateDefaultDisplayResolution || ShouldSleepOnBoot
|-
| 14 15 || [34.0.0+] ShouldSleepOnBoot || NotifyHdcpApplicationExecutionStarted
|-
| 15 16 || [4.0.0+] NotifyHdcpApplicationExecutionStarted || NotifyHdcpApplicationExecutionFinished
|-
| 16 17 || [4.0.0+] NotifyHdcpApplicationExecutionFinished || NotifyHdcpApplicationDrawingStarted
|-
| 17 18 || [4.0.0+] NotifyHdcpApplicationDrawingStarted || NotifyHdcpApplicationDrawingFinished
|-
| 18 19 || [4.0.0+] NotifyHdcpApplicationDrawingFinished || GetHdcpAuthenticationFailedEvent
|-
| 19 20 || [4.0.0+] GetHdcpAuthenticationFailedEvent || GetHdcpAuthenticationFailedEmulationEnabled
|-
| 20 21 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled || SetHdcpAuthenticationFailedEmulation
|-
| 21 22 || [4.0.0+] SetHdcpAuthenticationFailedEmulation || GetHdcpStateChangeEvent
|-
| 22 23 || [4.0.0+] GetHdcpStateChangeEvent || GetHdcpState
|-
| 23 24 || [45.0.0+] GetHdcpState || ShowCardUpdateProcessing
|-
| 24 25 || [5.0.0+] ShowCardUpdateProcessing || SetApplicationCecSettingsAndNotifyChanged
|-
| 25 26 || [57.0.0+] SetApplicationCecSettingsAndNotifyChanged || [[#GetOperationModeSystemInfo]]
|-
| 26 27 || [79.0.0+] || GetAppletFullAwakingSystemEvent
|}
== Cmd26 GetOperationModeSystemInfo ==
No input, returns an output u32.
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
= spsm =
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 +0 4 is set to an input u32and u32 +0xC = 0x1. This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
== SaveScreenShotEx0 ==
| 0x0C
| 0100000000001003
| [[Controller_Applet| "controller"]]
|-
| 0x0D
| 0x15
| 010000000000100D
| [[Album_Applet| "photoViewer"]]
|-
| 0x16
| 0x1A
| 0100000000001013
| [[MyPage_Applet| "myPage"]]
|}
! Description
|-
| 0 || u8 ProgramIndex. "ExecuteProgram". [[NS_Services|NS]] handles ProgramIndex by launching titleID {application_titleID}ApplicationId+ProgramIndex. After using [[#ExecuteProgram]] with this successfully, official user-processes will enter an infinite loop with sleep-thread value 86400000000000.
|-
| 1 || u64 titleID[[NCM_services#ApplicationId|ApplicationId]]. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
|-
| 2 || u64 = value 0. "RestartProgram"
ProgramIndex values where the title is not installed should not be used: [[qlaunch]] will display an error message and the current title will become "corrupted", however Home Menu will have an option to repair it.
 
= InputDetectionPolicy =
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Unknown.
|-
| 1 || Unknown.
|}
 
This is u32 enum "nn::applet::InputDetectionPolicy".
= AppletResourceUserId =
| 0x4 || 0x4 || Padding
|-
| 0x8 || 0x8 || titleID[[NCM_services#ApplicationId|ApplicationId]]
|}
! Offset || Size || Description
|-
| 0x0 || 0x8 || Application titleID.[[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x8 || 0x4 || Application title-version.

Navigation menu