Applet Manager services: Difference between revisions

No edit summary
 
(39 intermediate revisions by 3 users not shown)
Line 10: Line 10:
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 100 || OpenSystemAppletProxy || Returns an [[#ISystemAppletProxy]].
| 100 || OpenSystemAppletProxyOld ([1.0.0-19.0.1] OpenSystemAppletProxy) || Returns an [[#ISystemAppletProxy]].
|-
|-
| 110 || [20.0.0+] ||
| 110 || [20.0.0+] OpenSystemAppletProxy || Same as OpenSystemAppletProxyOld except this now takes a type-0x15 buffer containing an [[#AppletAttribute|AppletAttribute]].
|-
|-
| 200 || OpenLibraryAppletProxyOld ([1.0.0-2.3.0] OpenLibraryAppletProxy) || Returns an [[#ILibraryAppletProxy]].
| 200 || OpenLibraryAppletProxyOld ([1.0.0-2.3.0] OpenLibraryAppletProxy) || Returns an [[#ILibraryAppletProxy]].
Line 28: Line 28:
| 450 || [19.0.0+] [[#GetSystemProcessCommonFunctions]] ||  
| 450 || [19.0.0+] [[#GetSystemProcessCommonFunctions]] ||  
|-
|-
| 460 || [20.0.0+] ||
| 460 || [20.0.0+] || Returns an [[#IAppletAlternativeFunctions]].
|-
|-
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
Line 401: Line 401:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || [[#GetAppletStateChangedEvent]] ||
| 0 || [[#GetAppletStateChangedEvent]]
|-
|-
| 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]]  
|-
|-
| 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]] ||
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]]
|-
|-
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]]
|-
|-
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]] ||
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]]
|-
|-
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||
| 201 || [10.0.0+] [[#RestartApplicationTimer]]
|-
|-
| 300 || [20.0.0+] ||
| 300 || [20.0.0+]
|-
|-
| 301 || [20.0.0+] ||
| 301 || [20.0.0+]
|-
| 310 || [21.0.0+]
|}
|}


Line 631: Line 633:
| 100 || [15.0.0+] SetApplicationCoreUsageMode
| 100 || [15.0.0+] SetApplicationCoreUsageMode
|-
|-
| 160 || [18.0.0+] GetNotificationReceiverService
| 160 || [18.0.0+] [[#GetNotificationReceiverService|GetNotificationReceiverService]]
|-
|-
| 161 || [18.0.0+] GetNotificationSenderService
| 161 || [18.0.0+] [[#GetNotificationSenderService|GetNotificationSenderService]]
|-
|-
| 300 || [17.0.0+] GetCurrentApplicationId
| 300 || [17.0.0+] GetCurrentApplicationId
Line 658: Line 660:
|-
|-
| 360 || [20.0.0+]
| 360 || [20.0.0+]
|-
| 370 || [22.0.0+]
|}
|}


Line 703: Line 707:
Takes an input s32, no output.
Takes an input s32, no output.


== ILibraryAppletProxy ==
=== GetNotificationReceiverService ===
This is "nn::am::service::ILibraryAppletProxy".
No input, returns an [[#IReceiverService|IReceiverService]].
 
=== GetNotificationSenderService ===
No input, returns an [[#ISenderService|ISenderService]].
 
=== IReceiverService ===
This is "nn::am::service::IReceiverService".
 
This was added with [18.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
| 0 ||  
|}
 
==== Cmd0 ====
No input, returns an [[#INotificationReceiver|INotificationReceiver]].
 
==== INotificationReceiver ====
This is "nn::am::service::INotificationReceiver".
 
This was added with [18.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
! Cmd || Name
|-
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
| 0 ||  
|-
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
| 1 ||  
|-
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
| 2 ||  
|-
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
| 3 ||  
|-
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 4 ||  
|-
|}
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
 
=== ISenderService ===
This is "nn::am::service::ISenderService".
 
This was added with [18.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
| 0 ||  
|}
 
==== Cmd0 ====
Takes a total of 0x18-bytes of input, returns an [[#INotificationSender|INotificationSender]].
 
=== INotificationSender ===
This is "nn::am::service::INotificationSender".
 
This was added with [18.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
! Cmd || Name
|-
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
| 0 ||  
|-
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 1 ||  
|}
|}


=== ILibraryAppletSelfAccessor ===
== ILibraryAppletProxy ==
This is "nn::am::service::ILibraryAppletSelfAccessor".
This is "nn::am::service::ILibraryAppletProxy".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 742: Line 784:
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 0 || [[#PopInData]] ||
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
|-
| 1 || [[#PushOutData]] ||
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
|-
| 2 || [[#PopInteractiveInData]] ||
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
|-
| 3 || [[#PushInteractiveOutData]] ||
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
|-
| 5 || [[#GetPopInDataEvent]] ||
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
|-
| 6 || [[#GetPopInteractiveInDataEvent]] ||
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
|-
| 10 || [[#ExitProcessAndReturn]] ||
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 11 || [[#GetLibraryAppletInfo]] ||
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
|}
 
=== ILibraryAppletSelfAccessor ===
This is "nn::am::service::ILibraryAppletSelfAccessor".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#PopInData]] ||
|-
| 1 || [[#PushOutData]] ||
|-
| 2 || [[#PopInteractiveInData]] ||
|-
| 3 || [[#PushInteractiveOutData]] ||
|-
| 5 || [[#GetPopInDataEvent]] ||
|-
| 6 || [[#GetPopInteractiveInDataEvent]] ||
|-
| 10 || [[#ExitProcessAndReturn]] ||
|-
| 11 || [[#GetLibraryAppletInfo]] ||
|-
|-
| 12 || [[#GetMainAppletIdentityInfo]] ||
| 12 || [[#GetMainAppletIdentityInfo]] ||
Line 1,019: Line 1,093:
|-
|-
| 60 || [19.0.0+]  
| 60 || [19.0.0+]  
|-
| 70 || [21.0.0+]
|-
| 71 || [21.0.0+]
|-
| 75 || [21.0.0+]
|-
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
Line 1,240: Line 1,320:
| 210 || [20.0.0+]
| 210 || [20.0.0+]
|-
|-
| 220 || [20.0.0+]
| 220 || [20.0.0+] [[#SetAudioOutputPolicy|SetAudioOutputPolicy]]
|-
|-
| 300 || [19.0.0+] [[#CreateMovieWriter]]
| 300 || [19.0.0+] [[#CreateMovieWriter]]
|-
|-
| 310 || [20.0.0+]
| 310 || [20.0.0+] [[#RequestExitApplicationAndTryPopMessage|RequestExitApplicationAndTryPopMessage]]
|-
|-
| 320 || [20.0.0+]
| 320 || [20.0.0+]
|-
| 330 || [20.2.0+] IsLanguageSelectionLimited
|-
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
Line 1,285: Line 1,367:
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], 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.
[21.0.0+] Now returns an output [[#IStorage]].


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]].
Line 1,515: Line 1,599:
==== GetLastApplicationExitReason ====
==== GetLastApplicationExitReason ====
No input, returns an output s32.
No input, returns an output s32.
==== Cmd210 ====
No input, returns an output Event handle.
==== SetAudioOutputPolicy ====
Takes an input u8, no output.
The input must be <=1.


==== CreateMovieWriter ====
==== CreateMovieWriter ====
Line 1,521: Line 1,613:
This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.
This internally uses the GRC cmd to open an [[GRC_services|IMovieWriter]]. This is therefore not usable on NX since that cmd is stubbed.


==== StartContinuousRecordingFlushForDebug ====
==== RequestExitApplicationAndTryPopMessage ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
Takes an input [[#IStorage|IStorage]], no output.


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.
[21.0.0+] Now additionally takes a total of 0x18-bytes of input.
 
==== IsLanguageSelectionLimited ====
No input, returns 1-byte of output.
 
On NX this just writes 0 to output and returns 0.
 
==== StartContinuousRecordingFlushForDebug ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
 
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.


==== CreateMovieMaker ====
==== CreateMovieMaker ====
Line 1,546: Line 1,648:


AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.
[S2] This is no longer usable since this returns Result 0x408 (sysmodule doesn't exist).


=== IMovieWriter ===
=== IMovieWriter ===
Line 1,587: Line 1,691:
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 0 || [[#CreateLibraryApplet]] ||  
| 0 || [[#CreateLibraryAppletOld|CreateLibraryAppletOld]] ([1.0.0-19.0.1] CreateLibraryApplet) ||  
|-
|-
| 1 || [[#TerminateAllLibraryApplets]] ||
| 1 || [[#TerminateAllLibraryApplets]] ||
Line 1,593: Line 1,697:
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
|-
| 3 || [20.0.0+] ||
| 3 || [20.0.0+] [[#CreateLibraryApplet|CreateLibraryApplet]] ||
|-
|-
| 10 || [[#CreateStorage]] ||  
| 10 || [[#CreateStorage]] ||  
Line 1,602: Line 1,706:
|}
|}


=== CreateLibraryApplet ===
=== CreateLibraryAppletOld ===
Unofficial name.
 
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].


Line 1,618: Line 1,724:


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).
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).
=== CreateLibraryApplet ===
Unofficial name.
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], an u64 ThreadId, returns an [[#ILibraryAppletAccessor]].
The ThreadId is from the current-thread of the user-process which is using the cmd.


=== CreateStorage ===
=== CreateStorage ===
Line 1,686: Line 1,799:
|-
|-
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
|-
| 170 || [22.0.0+]
|}
|}


Line 1,828: Line 1,943:
|-
|-
| 120 || [13.0.0+] GetAppletLaunchedHistory
| 120 || [13.0.0+] GetAppletLaunchedHistory
|-
| 130 || [21.0.0+]
|-
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
Line 1,846: Line 1,963:
|-
|-
| 600 || [20.0.0+] ([17.0.0-18.1.0] OpenNamedChannelAsChild)
| 600 || [20.0.0+] ([17.0.0-18.1.0] OpenNamedChannelAsChild)
|-
| 610 || [21.0.0+]
|-
| 611 || [22.0.0+]
|-
|-
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
Line 1,856: Line 1,977:
|-
|-
| 1002 || [19.0.0+] IsVrModeEnabled3d
| 1002 || [19.0.0+] IsVrModeEnabled3d
|-
| 1003 || [21.0.0+]
|-
| 1004 || [21.0.0+]
|-
| 1005 || [21.0.0+]
|}
|}


Line 2,189: Line 2,316:
|-
|-
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]
|-
| 73 || [21.0.0+]
|-
|-
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]
Line 2,217: Line 2,346:
|-
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
| 2000 || [S2] [[#GetGraphicsSupervisor]]
|-
| 2100 || [S2] SetRecordingLayerEnabled
|-
| 2200 || [S2] SetSharingLayerEnabled
|}
|}


Line 2,447: Line 2,582:


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.
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.
=== GetGraphicsSupervisor ===
This is exclusive to S2.
No input. Returns an output TIPC handle to [[Switch_2:_GSV_services|GraphicsSupervisor]].


== IStorageChannel ==
== IStorageChannel ==
Line 2,796: Line 2,936:
== IProcessWindingController ==
== IProcessWindingController ==
This is "nn::am::service::IProcessWindingController".
This is "nn::am::service::IProcessWindingController".
GetProcessWindingController throws an error when used from non-LibraryApplet (at least with Application).


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,879: Line 3,021:
|-
|-
| 30 ||  
| 30 ||  
|}
== IAppletAlternativeFunctions ==
This is "nn::am::service::IAppletAlternativeFunctions".
This was added with [20.0.0+].
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|-
| 1 ||
|-
| 2 ||
|}
|}


Line 2,930: Line 3,088:
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
|-
|-
| 140 || [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug
| 140 || [14.0.0+] [[#RestrictPowerOperationForSecureLaunchModeForDebug|RestrictPowerOperationForSecureLaunchModeForDebug]]
|-
|-
| 200 || [15.0.0+] CreateFloatingLibraryAppletAccepterForDebug
| 150 || [21.0.0+]
|-
| 200 || [15.0.0+] [[#CreateFloatingLibraryAppletAccepterForDebug|CreateFloatingLibraryAppletAccepterForDebug]]
|-
|-
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
|-
|-
| 410 || [18.0.0+] CreateGeneralStorageForDebug
| 400 || [S2]
|-
|-
| 411 || [18.0.0+] ReadGeneralStorageForDebug
| 401 || [S2]
|-
|-
| 412 || [18.0.0+] WriteGeneralStorageForDebug
| 402 || [S2]
|-
| 403 || [S2]
|-
| 410 || [18.0.0+] [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]]
|-
| 411 || [18.0.0+] [[#ReadGeneralStorageForDebug|ReadGeneralStorageForDebug]]
|-
| 412 || [18.0.0+] [[#WriteGeneralStorageForDebug|WriteGeneralStorageForDebug]]
|-
|-
| 430 || [20.0.0+]
| 430 || [20.0.0+]
Line 2,949: Line 3,117:
|-
|-
| 910 || [20.0.0+]
| 910 || [20.0.0+]
|-
| 2000 || [S2]
|-
| 10000 || [S2]
|}
|}


Line 3,006: Line 3,178:


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToNotificationStorageChannel|NotificationStorageChannel]].


=== AlarmSettingNotificationDisableAppEventReserve ===
=== AlarmSettingNotificationDisableAppEventReserve ===
Line 3,021: Line 3,195:


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
When launching an Application with a matching ApplicationId, this storage is popped, then pushed to [[#PushToFriendInvitationStorageChannel|FriendInvitationStorageChannel]].


=== FriendInvitationClearApplicationParameter ===
=== FriendInvitationClearApplicationParameter ===
Line 3,031: Line 3,207:


Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
=== RestrictPowerOperationForSecureLaunchModeForDebug ===
No input/output.
This runs the same functionality as [[#DisableSleepTillShutdown|DisableSleepTillShutdown]].
=== CreateFloatingLibraryAppletAccepterForDebug ===
Takes a PID, an input u64 reserved_pid, a type-0x5 input buffer containing an array of u32s, returns an [[#appletAE|IAllSystemAppletProxiesService]].
If a state field is already set it must match the PID, otherwise when state==0 the PID is written into state etc.
=== CreateGeneralStorageForDebug ===
Takes two input u64s Id and size, no output.
The high-byte of Id must be 0.
Goes through a linked-list to check whether there's already an entry with a matching Id. If there's a matching Id, return 0 if the size matches, otherwise return error.
When no entry is found, a new entry is added with a buffer allocated using the input size.
=== ReadGeneralStorageForDebug ===
Takes a type-0x22 output buffer, two input u64s Id and offset, returns an output u64 out_size.
The high-byte of Id must be 0.
Reads data from the buffer previously allocated by [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]] with the specified Id.
The out_size is always the buffer-size (an error is thrown when bounds-check fails).
=== WriteGeneralStorageForDebug ===
Takes a type-0x21 input buffer, two input u64s Id and offset.
Same as [[#ReadGeneralStorageForDebug|ReadGeneralStorageForDebug]] except this writes into the buffer, and no out_size.


== IStorage ==
== IStorage ==
Line 3,081: Line 3,290:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || [[#OpenApplicationProxy]] ||
| 0 || [[#OpenApplicationProxy]]
|}
|}


This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time.
This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time.
= (Switch 2) appletOE =
[S2] This is "nn::am::service::IApplicationProxyServiceForNxCompat".
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || [[#OpenApplicationProxy]] ||
|-
| 2000 || [[#OpenCompatApplicationFunctions]] ||  Returns an [[#(Switch 2) INxCompatApplicationFunctions]]
|}


== OpenApplicationProxy ==
== OpenApplicationProxy ==
Returns an [[#IApplicationProxy]]. See [[#appletAE]].
Takes a reserved input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias). Returns an [[#IApplicationProxy]].


Takes a [[IPC_Marshalling|reserved]] input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias).
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.


On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.
= idle:sys =
This is "nn::idle::detail::IPolicyManagerSystem"


= (Switch 2) INxCompatApplicationFunctions =
This was moved to [[OMM_services|omm]] with [14.0.0+].
This is "nn::am::service::INxCompatApplicationFunctions".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 2000 || GetTipcCompatInterface? || Returns a TIPC handle to [[#TipcCompatInterface]].
| 0 || GetAutoPowerDownEvent
|-
|-
| 2001 || ||  
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
|-
|-
| 2002 || ||  
| 2 || [1.0.0-3.0.2]
|-
|-
| 2003 || || Called directly after "nn::vi::WriteToCopyrightFramebuffer".
| 3 || [[#SetHandlingContext]]
|-
|-
| 2004 || ||  
| 4 || LoadAndApplySettings
|-
|-
| 2010 || ||
| 5 || ReportUserIsActive
|-
| 2020 || Initialize? || Called during init. Takes no args.
|-
| 2030 || GetVsyncEvent? || Takes no args. Returns a event handle.
|-
| 2040 || GetVsyncTimestamp? || When above event triggers, this returns a timestamp.
|-
| 2050 || ||
|-
| 2060 ||  ||
|-
| 2070 || CreateMovieMaker || Same args as [[#CreateMovieMaker]]. Returns an [[#IMovieMaker]].
|}
|}


== (Switch 2) TipcCompatInterface ==
== SetHandlingContext ==
[3.0.0+] Now takes an additional 0x10-bytes of input.
 
[13.0.0+] Total input size is now 0x30 instead of 0x38.
 
= omm =
This is "nn::omm::detail::IOperationModeManager"
 
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
 
This was moved to [[OMM_services|omm]] with [14.0.0+].
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd (adjusted - 16) || Name || Notes
! Cmd || Name
|-
|-
| 4 || InitializeA || Sends current process handle, and struct { u64 aruid; u64 always_0x8000000000000005; u64 always_0; u64 always_0; u64 always_0; u64 svc_get_info_31_or_32_output; }.
| 0 || GetOperationMode
|-
|-
| 11 || InitializeB || Sends current process handle. No args. Sent directly after cmd4.
| 1 || GetOperationModeChangeEvent
|-
|-
| 101 || InitializeC || Sent directly after cmd11.
| 2 || EnableAudioVisual
|-
|-
| 111 || ||
| 3 || DisableAudioVisual
|-
|-
| 112 || ||
| 4 || EnterSleepAndWait
|-
|-
| 114 || ||
| 5 || GetCradleStatus
|-
|-
| 115 || ||
| 6 || FadeInDisplay
|-
|-
| 187 || ||
| 7 || FadeOutDisplay
|-
|-
| 201 || ||
| 8 || [2.0.0+] GetCradleFwVersion
|-
|-
| 301 || ||
| 9 || [2.0.0+] NotifyCecSettingsChanged
|-
|-
| 327 || ||
| 10 || [3.0.0+] SetOperationModePolicy
|-
|-
| 303 || ||
| 11 || [3.0.0+] GetDefaultDisplayResolution
|-
|-
| 311 || ||
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
|-
|-
| 312 || ||
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
|-
|-
| 314 || ||
| 14 || [3.0.0+] ShouldSleepOnBoot
|-
|-
| 315 || ||
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
|-
|-
| 321 || ||
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
|-
|-
| 391 || ||
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
|-
|-
| 401 || ||
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
|-
|-
| 402 || ||
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
|-
|-
| 423 || ||
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
|-
|-
| 434 || ||
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
|-
|-
| 497 || ||
| 22 || [4.0.0+] GetHdcpStateChangeEvent
|-
|-
| 901 || ||
| 23 || [4.0.0+] GetHdcpState
|-
|-
| 902 || ||
| 24 || [5.0.0+] ShowCardUpdateProcessing
|-
|-
| 903 || ||
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
|-
|-
| 905 || ||
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
|-
|-
| 911 || ||
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
|-
|-
| 912 || ||
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]
|}
 
== GetOperationModeSystemInfo ==
No input, returns an output u32.
 
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
 
== CreateCradleFirmwareUpdater ==
No input. Returns an [[#ICradleFirmwareUpdater]].
 
== ICradleFirmwareUpdater ==
This is "nn::am::service::ICradleFirmwareUpdater".
 
This was added with [12.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 922 || ||
! Cmd || Name
|-
|-
| 961 || ||
| 0 || Start
|-
|-
| 991 || ||
| 1 || Finish
|-
|-
| 1001 || ||
| 2 || GetUpdateDeviceStatus
|-
|-
| 1002 || ||
| 3 || GetUpdateProgress
|-
|-
| 1003 || ||
| 4 || GetUpdateDeviceStatusChangeEvent
|-
|-
| 1101 || ||
| 5 || GetUpdateProgress2
|-
|}
| 1102 || ||
 
|-
= spsm =
| 1401 || InitializeNvdrv2WithTransferMemory || Takes a TransferMemory handle, and u64 size. Returns an [[#INvDrv2User]].
This is "nn::spsm::detail::IPowerStateInterface".
|-
| 1402 || InitializeNvdrv2 || Returns an [[#INvDrv2User]].
|-
| 1501 || ||
|-
| 1502 || ||
|-
| 1601 || ||
|-
| 1602 || ||
|-
| 1603 || ||
|-
| 1611 || ||
|-
| 1612 || ||
|-
| 1691 || ||
|}


== (Switch 2) INvDrv2User ==
This was moved to [[OMM_services|omm]] with [14.0.0+].
This is "nn::nvdrv::INvDrv2User".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,246: Line 3,439:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || Open
| 0 || GetCurrentState
|-
|-
| 1 || Ioctl
| 1 || EnterSleep
|-
| 2 || GetLastWakeReason
|-
| 3 || Shutdown
|-
|-
| 2 || Close
| 4 || GetNotificationMessageEventHandle
|-
|-
| 4 || QueryEvent
| 5 || ReceiveNotificationMessage
|-
|-
| 9 || DumpStatus
| 6 || AnalyzeLogForLastSleepWakeSequence
|-
| 7 || ResetEventLog
|-
|-
| 10 || InitializeDevtools
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
|-
|-
| 11 || Ioctl2
| 9 || ChangeHomeButtonLongPressingTime
|-
|-
| 12 || Ioctl3
| 10 || PutErrorState
|-
|-
| 13 || SetGraphicsFirmwareMemoryMarginEnabled
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
|}
|}


= idle:sys =
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
This is "nn::idle::detail::IPolicyManagerSystem"
 
= tcap =
This is "nn::tcap::server::IManager".


This was moved to [[OMM_services|omm]] with [14.0.0+].
This was removed with [11.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,274: Line 3,475:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetAutoPowerDownEvent
| 0 || GetContinuousHighSkinTemperatureEvent
|-
|-
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
| 1 || SetOperationMode
|-
|-
| 2 || [1.0.0-3.0.2]
| 2 || LoadAndApplySettings
|-
|}
| 3 || [[#SetHandlingContext]]
 
|-
= caps:su =
| 4 || LoadAndApplySettings
This is "nn::capsrv::sf::IScreenShotApplicationService".
|-
| 5 || ReportUserIsActive
|}


== SetHandlingContext ==
This was added with [6.0.0+].
[3.0.0+] Now takes an additional 0x10-bytes of input.


[13.0.0+] Total input size is now 0x30 instead of 0x38.
This can be used by applications to save screenshots.
 
= omm =
This is "nn::omm::detail::IOperationModeManager"
 
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].
 
This was moved to [[OMM_services|omm]] with [14.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,304: Line 3,493:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetOperationMode
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
|-
|-
| 1 || GetOperationModeChangeEvent
| 201 || [[#SaveScreenShot]]
|-
|-
| 2 || EnableAudioVisual
| 203 || [[#SaveScreenShotEx0]]
|-
|-
| 3 || DisableAudioVisual
| 205 || [8.0.0+] [[#SaveScreenShotEx1]]
|-
|-
| 4 || EnterSleepAndWait
| 210 || [[#SaveScreenShotEx2]]
|-
|}
| 5 || GetCradleStatus
 
|-
== SetShimLibraryVersion ==
| 6 || FadeInDisplay
Takes a total of 0x10-bytes of input and a PID, no output.
|-
 
| 7 || FadeOutDisplay
This is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
 
== SaveScreenShot ==
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 
Official user-processes doesn't use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero, except +4 is set to an input u32 and u32 +0xC = 0x1.
 
This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
 
== SaveScreenShotEx0 ==
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 
== SaveScreenShotEx1 ==
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a PID, a type-0x15 input buffer containing an [[Capture_services|ApplicationData]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 
== SaveScreenShotEx2 ==
Takes an input 0x40-byte struct '''ScreenShotAttributeEx0''', an input u32, an input u64 AppletResourceUserId, a type-0x15 input buffer containing an [[Capture_services|UserIdList]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].
 
= apm =
This is "nn::am::service::IApmManager".
 
This was added with [8.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 8 || [2.0.0+] GetCradleFwVersion
! Cmd || Name
|-
|-
| 9 || [2.0.0+] NotifyCecSettingsChanged
| 0 || [[#OpenSession]]
|-
|-
| 10 || [3.0.0+] SetOperationModePolicy
| 1 || GetPerformanceMode
|-
|-
| 11 || [3.0.0+] GetDefaultDisplayResolution
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
|-
|}
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
 
|-
== OpenSession ==
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
Returns an [[#ISession]].
|-
 
| 14 || [3.0.0+] ShouldSleepOnBoot
== IsCpuOverclockEnabled ==
No input, returns an output u8 bool.
 
== ISession ==
This is "nn::am::service::IApmSession".
 
{| class="wikitable" border="1"
|-
|-
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
! Cmd || Name
|-
|-
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
| 0 || SetPerformanceConfiguration
|-
|-
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
| 1 || GetPerformanceConfiguration
|-
|-
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
| 2 || [8.0.0+] SetCpuOverclockEnabled
|}
 
= (S2) adraw:a =
This is "nn::appletdraw::sfif::IAppletRoot".
 
{| class="wikitable" border="1"
|-
|-
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
! Cmd || Name
|-
|-
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
| 1 || [[#OpenResourceSession]]
|-
|-
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
| 2 || [[#OpenAppletSession]]
|}
 
== OpenResourceSession ==
Unofficial name.  
 
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IResourceSession]].
 
== OpenAppletSession ==
Unofficial name.
 
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IAppletSession]].
 
== IResourceSession ==
This is "nn::appletdraw::sfif::IResourceSession".
 
{| class="wikitable" border="1"
|-
|-
| 22 || [4.0.0+] GetHdcpStateChangeEvent
! Cmd || Name
|-
|-
| 23 || [4.0.0+] GetHdcpState
| 1 || [[#Ping|Ping]]
|-
|-
| 24 || [5.0.0+] ShowCardUpdateProcessing
| 10 ||
|-
|-
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
| 11 ||
|-
|}
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
 
|-
=== Ping ===
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
Unofficial name.
|-
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]
|}


== GetOperationModeSystemInfo ==
Takes an input u64. Returns an output u64.
No input, returns an output u32.


This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
The output u64 should match the input u64. Official software sends the current system tick value.


== CreateCradleFirmwareUpdater ==
=== Cmd10 ===
No input. Returns an [[#ICradleFirmwareUpdater]].
Takes a handle, a u64 and an int. Returns a handle.


== ICradleFirmwareUpdater ==
=== Cmd11 ===
This is "nn::am::service::ICradleFirmwareUpdater".
No input/output.


This was added with [12.0.0+].
== IAppletSession ==
This is "nn::appletdraw::sfif::IAppletSession".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,380: Line 3,617:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || Start
| 1 || [[#Ping|Ping]]
|-
| 2 || [[#GetEvent|GetEvent]]
|-
|-
| 1 || Finish
| 3 || [20.1.1+]
|-
|-
| 2 || GetUpdateDeviceStatus
| 10 ||
|-
|-
| 3 || GetUpdateProgress
| 11 ||
|-
|-
| 4 || GetUpdateDeviceStatusChangeEvent
| 12 ||
|-
|-
| 5 || GetUpdateProgress2
| 13 ||
|}
 
= spsm =
This is "nn::spsm::detail::IPowerStateInterface".
 
This was moved to [[OMM_services|omm]] with [14.0.0+].
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 15 |
|-
|-
| 0 || GetCurrentState
| 16 || [20.1.1+]
|-
|-
| 1 || EnterSleep
| 17 || [20.1.1+]
|-
|-
| 2 || GetLastWakeReason
| 18 || [20.1.1+]
|-
|-
| 3 || Shutdown
| 19 || [20.1.1+]
|-
|-
| 4 || GetNotificationMessageEventHandle
| 21 ||
|-
|-
| 5 || ReceiveNotificationMessage
| 22 ||
|-
|-
| 6 || AnalyzeLogForLastSleepWakeSequence
| 23 || [20.1.1+]
|-
|-
| 7 || ResetEventLog
| 24 || [20.1.1+]
|-
|-
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
| 31 || [[#GetFrameBufferInfo|GetFrameBufferInfo]]
|-
|-
| 9 || ChangeHomeButtonLongPressingTime
| 8001 || [[#GetFrameBufferInfoForDebug|GetFrameBufferInfoForDebug]]
|-
|-
| 10 || PutErrorState
| 8003 || [19.0.0-19.1.0]
|-
|-
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
| 8004 ||
|}
|}


[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
=== GetEvent ===
Unofficial name.


= tcap =
No input. Returns an output Event handle.
This is "nn::tcap::server::IManager".
 
=== Cmd3 ===
Takes a handle. No output.
 
=== Cmd10 ===
Takes an input u32. No output.
 
=== Cmd11 ===
Takes an input u32. No output.
 
=== Cmd12 ===
Takes an input u64. Returns an output u32.
 
=== Cmd13 ===
Takes an input u32. Returns an output u32.
 
=== Cmd15 ===
Takes an input u32. Returns three output u32s.
 
=== Cmd16 ===
No input. Returns an output u32.
 
=== Cmd17 ===
Takes an input u32. Returns an output u32 and an output u16.
 
=== Cmd18 ===
Takes an input u32. Returns three output u32s and an output u16.
 
=== Cmd19 ===
Takes an input u32. Returns an output u32 and an output u16.
 
=== Cmd21 ===
Takes an input u32. Returns a struct of size 0x40.
 
=== Cmd22 ===
Takes a struct of size 0x20. Returns a struct of size 0x40.
 
=== Cmd23 ===
No input. Returns a struct of size 0xC8.
 
=== Cmd24 ===
Takes an ipc-buf with size 0xD8. No output.
 
=== GetFrameBufferInfo ===
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].
 
[[#(S2)_AdrawFrameBufferInfo|Id]] is "adrawfb".
 
=== GetFrameBufferInfoForDebug ===
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].
 
=== Cmd8003 ===
Takes an input u64. Returns a struct with size 0x18.
 
=== Cmd8004 ===
Takes an input u32. Returns an output u64.


This was removed with [11.0.0+].
= (S2) appletOE =
This is "nn::am::service::IApplicationProxyServiceForNxCompat".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,438: Line 3,730:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetContinuousHighSkinTemperatureEvent
| 0 || [[#OpenApplicationProxy]]
|-
|-
| 1 || SetOperationMode
| 2000 || [[#OpenCompatApplicationFunctions]]
|-
| 2 || LoadAndApplySettings
|}
|}


= caps:su =
== OpenCompatApplicationFunctions ==
This is "nn::capsrv::sf::IScreenShotApplicationService".
No input. Returns an [[#INxCompatApplicationFunctions]].


This was added with [6.0.0+].
== INxCompatApplicationFunctions ==
 
This is "nn::am::service::INxCompatApplicationFunctions".
This can be used by applications to save screenshots.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,456: Line 3,745:
! Cmd || Name
! Cmd || Name
|-
|-
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
| 2000 || [[#GetGraphicsSupervisorForNxCompat]]
|-
| 2001 ||
|-
| 2002 || 
|-
|-
| 201 || [[#SaveScreenShot]]
| 2003 || [[#SetCopyright]]
|-
|-
| 203 || [[#SaveScreenShotEx0]]
| 2004 ||
|-
|-
| 205 || [8.0.0+] [[#SaveScreenShotEx1]]
| 2010 ||
|-
|-
| 210 || [[#SaveScreenShotEx2]]
| 2020 || [[#Initialize]]
|}
|-
| 2030 || [[#GetVsyncEvent]]
|-
| 2040 || [[#GetVsyncTimestamp]]
|-
| 2050 ||
|-
| 2060 ||
|-
| 2070 || [[#CreateMovieMaker]]
|}


== SetShimLibraryVersion ==
=== GetGraphicsSupervisorForNxCompat ===
Takes a total of 0x10-bytes of input and a PID, no output.
Unofficial name.


This is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
No input. Returns an output TIPC handle to  [[Switch_2:_GSV_services|GraphicsSupervisor]]..


== SaveScreenShot ==
Same as [[#GetGraphicsSupervisor]] but for compat mode.
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.
=== SetCopyright ===
Unofficial name.


This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.
Takes an input bool. No output.


== SaveScreenShotEx0 ==
Called directly after "nn::vi::WriteToCopyrightFramebuffer".
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 ==
=== Initialize ===
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]].
Unofficial name.


== SaveScreenShotEx2 ==
No input/output.
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]].


= apm =
Called during init.
This is "nn::am::service::IApmManager".


This was added with [8.0.0+].
=== GetVsyncEvent ===
Unofficial name.


{| class="wikitable" border="1"
No input. Returns an Event handle.
|-
! Cmd || Name
|-
| 0 || [[#OpenSession]]
|-
| 1 || GetPerformanceMode
|-
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
|}


== OpenSession ==
=== GetVsyncTimestamp ===
Returns an [[#ISession]].
Unofficial name.


== IsCpuOverclockEnabled ==
No input. Returns an output u64.
No input, returns an output u8 bool.


== ISession ==
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp.
This is "nn::am::service::IApmSession".


{| class="wikitable" border="1"
= Library Applets =
|-
This section documents library applet launching.
! Cmd || Name
|-
| 0 || SetPerformanceConfiguration
|-
| 1 || GetPerformanceConfiguration
|-
| 2 || [8.0.0+] SetCpuOverclockEnabled
|}
 
= Library Applets =
This section documents library applet launching.


Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
Line 3,565: Line 3,844:
! Description
! Description
|-
|-
| 0x00
| 0x00000000
|  
|  
| None
| None
|-
|-
| 0x01
| 0x00000001
|  
|  
| Application (not valid for use with LibraryApplets)
| Application (not valid for use with LibraryApplets)
|-
|-
| 0x02
| 0x00000002
| 010000000000100C
| 0x010000000000100C
| OverlayApplet (overlayDisp)
| OverlayApplet (overlayDisp)
|-
|-
| 0x03
| 0x00000003
| 0100000000001000
| 0x0100000000001000
| SystemAppletMenu (qlaunch)
| SystemAppletMenu (qlaunch)
|-
|-
| 0x04
| 0x00000004
| 0100000000001012
| 0x0100000000001012
| SystemApplication (starter)
| SystemApplication (starter)
|-
|-
| 0x0A
| 0x0000000A
| 0100000000001001
| 0x0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
|-
| 0x0B
| 0x0000000B
| 0100000000001002
| 0x0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
|-
| 0x0C
| 0x0000000C
| 0100000000001003
| 0x0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
|-
| 0x0D
| 0x0000000D
| 0100000000001004
| 0x0100000000001004
| LibraryAppletDataErase (dataErase)
| LibraryAppletDataErase (dataErase)
|-
|-
| 0x0E
| 0x0000000E
| 0100000000001005
| 0x0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
| [[Error_Applet|LibraryAppletError (error)]]
|-
|-
| 0x0F
| 0x0000000F
| 0100000000001006
| 0x0100000000001006
| LibraryAppletNetConnect (netConnect)
| LibraryAppletNetConnect (netConnect)
|-
|-
| 0x10
| 0x00000010
| 0100000000001007
| 0x0100000000001007
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
|-
|-
| 0x11
| 0x00000011
| 0100000000001008
| 0x0100000000001008
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
|-
|-
| 0x12
| 0x00000012
| 0100000000001009
| 0x0100000000001009
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
|-
|-
| 0x13
| 0x00000013
| 010000000000100A
| 0x010000000000100A
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
|-
| 0x14
| 0x00000014
| 010000000000100B
| 0x010000000000100B
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
|-
| 0x15
| 0x00000015
| 010000000000100D
| 0x010000000000100D
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
|-
| 0x16
| 0x00000016
| 010000000000100E
| 0x010000000000100E
| LibraryAppletSet (set)
| LibraryAppletSet (set)
|-
|-
| 0x17
| 0x00000017
| 010000000000100F
| 0x010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
|-
| 0x18
| 0x00000018
| 0100000000001010
| 0x0100000000001010
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
|-
|-
| 0x19
| 0x00000019
| 0100000000001011
| 0x0100000000001011
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
|-
|-
| 0x1A
| 0x0000001A
| 0100000000001013
| 0x0100000000001013
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
|-
|-
| 0x1B
| 0x0000001B
| 010000000000101A
| 0x010000000000101A
| LibraryAppletGift (gift)
| LibraryAppletGift (gift)
|-
|-
| 0x1C
| 0x0000001C
| 010000000000101C
| 0x010000000000101C
| LibraryAppletUserMigration (userMigration)
| LibraryAppletUserMigration (userMigration)
|-
|-
| 0x1D
| 0x0000001D
| 010000000000101D
| 0x010000000000101D
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
|-
|-
| 0x1E
| 0x0000001E
| 0100000000001020
| 0x0100000000001020
| [9.0.0+] LibraryAppletStory (story)
| [9.0.0+] LibraryAppletStory (story)
|-
|-
| 0x1F
| 0x0000001F
| 010070000E3C0000
| 0x010070000E3C0000
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
|-
|-
| 0x20
| 0x00000020
| 010086000E49C000
| 0x010086000E49C000
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
|-
|-
| 0x21
| 0x00000021
| 0100000000001038
| 0x0100000000001038
| [10.0.0+] LibraryAppletSample (sample)
| [10.0.0+] LibraryAppletSample (sample)
|-
|-
| 0x22
| 0x00000022
| 0100000000001007
| 0x0100000000001007
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
|-
|-
| 0x32
| 0x00000032
| 010000000000100F
| 0x010000000000100F
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
| [17.0.0+] LibraryAppletOfflineWebApp_3 ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 0x33
| 0x00000033
| 010000000000100F
| 0x010000000000100F
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
| [17.0.0+] LibraryAppletOfflineWebSystem ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 0x35
| 0x00000035
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] 0x0100000000001010 ([16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )
| [17.0.0+] LibraryAppletLhub ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 0x36
| 0x00000036
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] 0x0100000000001010 ([16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )
| [17.0.0+] LibraryAppletLogin ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 0x37
| 0x00000037
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] 0x0100000000001010 ([16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )
| [17.0.0+] LibraryAppletShare ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 0x38
| 0x00000038
| 0100000000001043
| 0x0100000000001043
| [16.0.0-16.1.0]
| [16.0.0-16.1.0]
|-
|-
| 0x50
| 0x00000050
| 0100000000001007
| 0x0100000000001007
| [18.0.0+]
| [18.0.0+]
|-
|-
| 0x51
| 0x00000051
| 0100000000001007
| 0x0100000000001007
| [18.0.0+]
| [18.0.0+]
|-
|-
| 0x64
| 0x00000064
| 0100000000001048
| 0x0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
| [20.0.0+] [[Splay_Applet|splay]]
|-
|-
| 0x3E8
| 0x000003E8
|  
|  
| [10.0.0-16.1.0] DevlopmentTool
| [10.0.0-16.1.0] DevlopmentTool
|-
|-
| 0x3F1
| 0x000003F1
| 010000000000D619
| 0x010000000000D619
| [10.0.0-16.1.0] CombinationLA
| [10.0.0-16.1.0] CombinationLA
|-
|-
| 0x3F2
| 0x000003F2
| 010000000000D610
| 0x010000000000D610
| [10.0.0-16.1.0] AeSystemApplet
| [10.0.0-16.1.0] AeSystemApplet
|-
|-
| 0x3F3
| 0x000003F3
| 010000000000D611
| 0x010000000000D611
| [10.0.0-16.1.0] AeOverlayApplet
| [10.0.0-16.1.0] AeOverlayApplet
|-
|-
| 0x3F4
| 0x000003F4
| 010000000000D612
| 0x010000000000D612
| [10.0.0-16.1.0] AeStarter
| [10.0.0-16.1.0] AeStarter
|-
|-
| 0x3F5
| 0x000003F5
| 010000000000D613
| 0x010000000000D613
| [10.0.0-16.1.0] AeLibraryAppletAlone
| [10.0.0-16.1.0] AeLibraryAppletAlone
|-
|-
| 0x3F6
| 0x000003F6
| 010000000000D614
| 0x010000000000D614
| [10.0.0-16.1.0] AeLibraryApplet1
| [10.0.0-16.1.0] AeLibraryApplet1
|-
|-
| 0x3F7
| 0x000003F7
| 010000000000D615
| 0x010000000000D615
| [10.0.0-16.1.0] AeLibraryApplet2
| [10.0.0-16.1.0] AeLibraryApplet2
|-
|-
| 0x3F8
| 0x000003F8
| 010000000000D616
| 0x010000000000D616
| [10.0.0-16.1.0] AeLibraryApplet3
| [10.0.0-16.1.0] AeLibraryApplet3
|-
|-
| 0x3F9
| 0x000003F9
| 010000000000D617
| 0x010000000000D617
| [10.0.0-16.1.0] AeLibraryApplet4
| [10.0.0-16.1.0] AeLibraryApplet4
|-
|-
| 0x3FA
| 0x000003FA
| 010000000000D60A
| 0x010000000000D60A
| [10.0.0-16.1.0] AppletISA
| [10.0.0-16.1.0] AppletISA
|-
|-
| 0x3FB
| 0x000003FB
| 010000000000D60B
| 0x010000000000D60B
| [10.0.0-16.1.0] AppletIOA
| [10.0.0-16.1.0] AppletIOA
|-
|-
| 0x3FC
| 0x000003FC
| 010000000000D60C
| 0x010000000000D60C
| [10.0.0-16.1.0] AppletISTA
| [10.0.0-16.1.0] AppletISTA
|-
|-
| 0x3FD
| 0x000003FD
| 010000000000D60D
| 0x010000000000D60D
| [10.0.0-16.1.0] AppletILA1
| [10.0.0-16.1.0] AppletILA1
|-
|-
| 0x3FE
| 0x000003FE
| 010000000000D60E
| 0x010000000000D60E
| [10.0.0-16.1.0] AppletILA2
| [10.0.0-16.1.0] AppletILA2
|-
|-
| 0x700000C8
| 0x0100000E
| 010000000000D65B
|  
| [18.0.0+]  
| [S2] LibraryAppletError
|-
|-
| 0x700000C9
| 0x01000010
| 010000000000D65C
|  
| [18.0.0+]  
| [S2] LibraryAppletPlayerSelect
|-
|-
| 0x700000DC
| 0x01010011
| 010000000000D619
|  
| [17.0.0+] CombinationLA
| [S2] SwkbdModeless
|-
|-
| 0x700000E6
| 0x01020011
| 010000000000D610
|  
| [17.0.0+] AeSystemApplet
| [S2] Swkbd
|-
|-
| 0x700000E7
| 0x01000013
| 010000000000D611
|  
| [17.0.0+] AeOverlayApplet
| [S2] OpenWeb
|-
|-
| 0x700000E8
| 0x01000014
| 010000000000D612
|  
| [17.0.0+] AeStarter
| [S2] LibraryAppletShop
|-
|-
| 0x700000E9
| 0x01000022
| 010000000000D613
|  
| [17.0.0+] AeLibraryAppletAlone
| [S2] LibraryAppletPromoteQualification
|-
|-
| 0x700000EA
| 0x01010025
| 010000000000D614
|  
| [17.0.0+] AeLibraryApplet1
| [S2] SaveDataBackup
|-
|-
| 0x700000EB
| 0x01020025
| 010000000000D615
|  
| [17.0.0+] AeLibraryApplet2
| [S2] SaveDataBackup
|-
|-
| 0x700000EC
| 0x01000032
| 010000000000D616
|  
| [17.0.0+] AeLibraryApplet3
| [S2] LibraryAppletOfflineWebApp_3
|-
|-
| 0x700000ED
| 0x01000033
| 010000000000D617
|  
| [17.0.0+] AeLibraryApplet4
| [S2] LibraryAppletOfflineWebSystem
|-
|-
| 0x700000F0
| 0x01000035
| 010000000000D60A
|  
| [17.0.0+] AppletISA
| [S2] LibraryAppletLhub
|-
|-
| 0x700000F1
| 0x01000036
| 010000000000D60B
|  
| [17.0.0+] AppletIOA
| [S2] LibraryAppletLogin
|-
|-
| 0x700000F2
| 0x01000037
| 010000000000D60C
|  
| [17.0.0+] AppletISTA
| [S2] LibraryAppletShare
|-
|-
| 0x700000F3
| 0x01000050
| 010000000000D60D
|  
| [17.0.0+] AppletILA1
| [S2] PlayerSelect
|-
|-
| 0x700000F4
| 0x01000051
| 010000000000D60E
|  
| [17.0.0+] AppletILA2
| [S2] PlayerSelect
|-
|-
| 0x700000FA
| 0x01000052
| 010000000000D677
|  
| [20.1.0+]  
| [S2] PlayerSelect
|}
 
= LibraryAppletMode =
This is "nn::applet::LibraryAppletMode".
 
{| class="wikitable" border="1"
|-
|-
! Value
| 0x700000C8
! Description
| 0x010000000000D65B
| [18.0.0+]
|-
|-
| 0x0
| 0x700000C9
| AllForeground
| 0x010000000000D65C
| [18.0.0+]
|-
|-
| 0x1
| 0x700000DC
| PartialForeground
| 0x010000000000D619
| [17.0.0+] CombinationLA
|-
|-
| 0x2
| 0x700000E6
| NoUi
| 0x010000000000D610
| [17.0.0+] AeSystemApplet
|-
|-
| 0x3
| 0x700000E7
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])
| 0x010000000000D611
| [17.0.0+] AeOverlayApplet
|-
|-
| 0x4
| 0x700000E8
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])
| 0x010000000000D612
|}
| [17.0.0+] AeStarter
 
= AppletMessage =
This is "nn::am::AppletMessage".
 
{| class="wikitable" border="1"
|-
|-
! Value
| 0x700000E9
! Description
| 0x010000000000D613
| [17.0.0+] AeLibraryAppletAlone
|-
|-
| 0 || None
| 0x700000EA
| 0x010000000000D614
| [17.0.0+] AeLibraryApplet1
|-
|-
| 1 || ChangeIntoForeground
| 0x700000EB
| 0x010000000000D615
| [17.0.0+] AeLibraryApplet2
|-
|-
| 2 || ChangeIntoBackground
| 0x700000EC
| 0x010000000000D616
| [17.0.0+] AeLibraryApplet3
|-
|-
| 4 || Exit
| 0x700000ED
| 0x010000000000D617
| [17.0.0+] AeLibraryApplet4
|-
|-
| 6 || ApplicationExited
| 0x700000F0
| 0x010000000000D60A
| [17.0.0+] AppletISA
|-
|-
| 7 ||  
| 0x700000F1
| 0x010000000000D60B
| [17.0.0+] AppletIOA
|-
|-
| 15 || [[#FocusState|FocusStateChanged]]
| 0x700000F2
| 0x010000000000D60C
| [17.0.0+] AppletISTA
|-
|-
| 16 || [[#SetRestartMessageEnabled|Resume]]
| 0x700000F3
| 0x010000000000D60D
| [17.0.0+] AppletILA1
|-
|-
| 20 || DetectShortPressingHomeButton
| 0x700000F4
| 0x010000000000D60E
| [17.0.0+] AppletILA2
|-
|-
| 21 || DetectLongPressingHomeButton
| 0x700000FA
| 0x010000000000D677
| [20.1.0+]
|}
 
= LibraryAppletMode =
This is "nn::applet::LibraryAppletMode".
 
{| class="wikitable" border="1"
|-
|-
| 22 || DetectShortPressingPowerButton
! Value
! Description
|-
|-
| 23 || DetectMiddlePressingPowerButton
| 0x0
| AllForeground
|-
|-
| 24 || DetectLongPressingPowerButton
| 0x1
| PartialForeground
|-
|-
| 25 || RequestToPrepareSleep
| 0x2
| NoUi
|-
|-
| 26 || FinishedSleepSequence
| 0x3
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])
|-
|-
| 27 || SleepRequiredByHighTemperature
| 0x4
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])
|}
 
= AppletMessage =
This is "nn::am::AppletMessage".
 
{| class="wikitable" border="1"
|-
|-
| 28 || SleepRequiredByLowBattery
! Value
! Description
|-
|-
| 29 || AutoPowerDown
| 0 || None
|-
| 1 || ChangeIntoForeground
|-
| 2 || ChangeIntoBackground
|-
| 4 || Exit
|-
| 6 || ApplicationExited
|-
| 7 ||
|-
| 15 || [[#FocusState|FocusStateChanged]]
|-
| 16 || [[#SetRestartMessageEnabled|Resume]]
|-
| 20 || DetectShortPressingHomeButton
|-
| 21 || DetectLongPressingHomeButton
|-
| 22 || DetectShortPressingPowerButton
|-
| 23 || DetectMiddlePressingPowerButton
|-
| 24 || DetectLongPressingPowerButton
|-
| 25 || RequestToPrepareSleep
|-
| 26 || FinishedSleepSequence
|-
| 27 || SleepRequiredByHighTemperature
|-
| 28 || SleepRequiredByLowBattery
|-
| 29 || AutoPowerDown
|-
|-
| 30 || [[#OperationMode|OperationModeChanged]]
| 30 || [[#OperationMode|OperationModeChanged]]
Line 4,209: Line 4,556:
This is "nn::am::service::AppletKind". This is 8-bytes.
This is "nn::am::service::AppletKind". This is 8-bytes.


= AppletIdentityInfo =
= AppletIdentityInfo =
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
 
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x4 || [[#AppletId]]
| 0x0 || 0x4 || [[#AppletId]]
|-
|-
| 0x4 || 0x4 || Padding
| 0x4 || 0x4 || Padding
|-
|-
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|}
 
= ApplicationAttributeForQuest =
This struct is "nn::applet::ApplicationAttributeForQuest".
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
|}
 
User-processes copy the first 0x8-bytes (0xC-bytes with [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]/[[#CreateApplicationWithAttributeAndRequestToStartForQuest]]) to a [[#ApplicationAttribute]] with the rest of the struct being cleared, which is then passed to the actual cmd (CreateApplication*ToStartForQuest).
 
= ApplicationAttribute =
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
|-
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
|-
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
|-
| 0xC || 0x14 || Unused. Default is 0.
|}
 
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
 
= ApplicationLaunchProperty =
This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x8 || 0x4 || Application title-version.
|-
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
|-
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
|-
| 0xE || 0x1 || Unknown.
|-
| 0xF || 0x1 || Padding.
|}
 
= ApplicationLaunchRequestInfo =
This is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
|-
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
|-
| 0x8 || 0x8 || Unknown. The default is 0x0.
|}
 
= AppletResourceUsageInfo =
This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Unknown counter.
|-
| 0x4 || 0x4 || Unknown counter.
|-
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
|-
| 0xC || 0x14 || Always zero.
|}
 
= ApplicationLicenseType =
This is "nn::oe::ApplicationLicenseType". This is 1-byte.
 
= LaunchRequiredVersion =
This is "nn::oe::LaunchRequiredVersion". This is a 0x40-byte struct with 1-byte alignment.
 
= ServerEnvironmentType =
This is "nn::oe::ServerEnvironmentType".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || dd
|-
| 1 || lp
|-
| 2 || sd
|-
| 3 || sp
|-
| 4 || dp
|}
|}


= ApplicationAttributeForQuest =
= (S2) AdrawFrameBufferInfo =
This struct is "nn::applet::ApplicationAttributeForQuest".
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
| 0x0 || 0x8 || Id
|-
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
|-
|-
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
| 0x8 || 0x2 || Width
|}
 
User-processes copy the first 0x8-bytes (0xC-bytes with [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]/[[#CreateApplicationWithAttributeAndRequestToStartForQuest]]) to a [[#ApplicationAttribute]] with the rest of the struct being cleared, which is then passed to the actual cmd (CreateApplication*ToStartForQuest).
 
= ApplicationAttribute =
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 0xA || 0x2 || Height
|-
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
| 0xC || 0x4 || BlockCount
|-
|-
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
| 0x10 || 0x8 ||  
|-
|-
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
| 0x18 || 0x8 ||  
|-
|-
| 0xC || 0x14 || Unused. Default is 0.
| 0x20 || 0x8 ||  
|}
|}


Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
= (S2) ImageInfo =
 
= ApplicationLaunchProperty =
This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
| 0x0 || 0x8 ||  
|-
|-
| 0x8 || 0x4 || Application title-version.
| 0x8 || 0x8 || Address
|-
|-
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
| 0x10 || 0x8 ||  
|-
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
|-
|-
| 0xE || 0x1 || Unknown.
| 0x18 || 0x8 ||  
|-
|-
| 0xF || 0x1 || Padding.
| 0x20 || 0x8 ||  
|}
 
= ApplicationLaunchRequestInfo =
This is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 0x28 || 0x8 ||  
|-
|-
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
| 0x30 || 0x8 ||  
|-
|-
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
| 0x38 || 0x4 || Offset
|-
|-
| 0x8 || 0x8 || Unknown. The default is 0x0.
| 0x3C || 0x4 || Size
|}
 
= AppletResourceUsageInfo =
This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 0x40 || 0x8 ||  
|-
|-
| 0x0 || 0x4 || Unknown counter.
| 0x48 || 0x8 ||  
|-
|-
| 0x4 || 0x4 || Unknown counter.
| 0x50 || 0x8 ||  
|-
|-
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
| 0x58 || 0x8 ||  
|-
|-
| 0xC || 0x14 || Always zero.
| 0x60 || 0x8 ||  
|}
 
= ApplicationLicenseType =
This is "nn::oe::ApplicationLicenseType". This is 1-byte.
 
= LaunchRequiredVersion =
This is "nn::oe::LaunchRequiredVersion". This is a 0x40-byte struct with 1-byte alignment.
 
= ServerEnvironmentType =
This is "nn::oe::ServerEnvironmentType".
 
{| class="wikitable" border="1"
|-
|-
! Value
| 0x68 || 0x8 ||
! Description
|-
|-
| 0 || dd
| 0x70 || 0x8 ||  
|-
|-
| 1 || lp
| 0x78 || 0x8 ||  
|-
|-
| 2 || sd
| 0x80 || 0x8 ||  
|-
|-
| 3 || sp
| 0x88 || 0x8 ||  
|-
|-
| 4 || dp
| 0x90 || 0x4 || Flags
|}
|}