Applet Manager services: Difference between revisions

No edit summary
No edit summary
 
(24 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]].
|-
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
| 3 ||
|-
| 4 ||
|}
 
=== ISenderService ===
This is "nn::am::service::ISenderService".
 
This was added with [18.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 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"
|-
! Cmd || Name
|-
| 0 ||
|-
| 1 ||
|}
 
== ILibraryAppletProxy ==
This is "nn::am::service::ILibraryAppletProxy".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].
|-
| 1 || GetSelfController || Returns an [[#ISelfController]].
|-
| 2 || GetWindowController || Returns an [[#IWindowController]].
|-
| 3 || GetAudioController || Returns an [[#IAudioController]].
|-
| 4 || GetDisplayController || Returns an [[#IDisplayController]].
|-
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].
|-
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].
|-
|-
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].
Line 1,020: Line 1,094:
| 60 || [19.0.0+]  
| 60 || [19.0.0+]  
|-
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
| 70 || [21.0.0+]
|-
| 71 || [21.0.0+]
|-
| 75 || [21.0.0+]
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
|-
|-
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]
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+]
| 330 || [20.2.0+] IsLanguageSelectionLimited
|-
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
Line 1,287: 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,518: Line 1,600:
No input, returns an output s32.
No input, returns an output s32.


==== Cmd220 ====
==== Cmd210 ====
No input, returns an output Event handle.
 
==== SetAudioOutputPolicy ====
Takes an input u8, no output.
Takes an input u8, no output.


Line 1,528: 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.


==== Cmd330 ====
==== RequestExitApplicationAndTryPopMessage ====
Takes an input [[#IStorage|IStorage]], no output.
 
[21.0.0+] Now additionally takes a total of 0x18-bytes of input.
 
==== IsLanguageSelectionLimited ====
No input, returns 1-byte of output.
No input, returns 1-byte of output.


Line 1,558: 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,599: 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,605: Line 1,697:
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
|-
| 3 || [20.0.0+] ||
| 3 || [20.0.0+] [[#CreateLibraryApplet|CreateLibraryApplet]] ||
|-
|-
| 10 || [[#CreateStorage]] ||  
| 10 || [[#CreateStorage]] ||  
Line 1,614: 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,630: 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,698: Line 1,799:
|-
|-
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||
|-
| 170 || [22.0.0+]
|}
|}


Line 1,840: 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,858: 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,868: 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,201: 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,230: Line 2,347:
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
|-
| 2000 || [S2] [[#GetGraphicsInterface]]
| 2000 || [S2] [[#GetGraphicsSupervisor]]
|-
| 2100 || [S2] SetRecordingLayerEnabled
|-
|-
| 2100 || [S2]
| 2200 || [S2] SetSharingLayerEnabled
|}
|}


Line 2,464: Line 2,583:
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.


=== GetGraphicsInterface ===
=== GetGraphicsSupervisor ===
Unofficial name. This is exclusive to S2.
This is exclusive to S2.


No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]].
No input. Returns an output TIPC handle to [[Switch_2:_GSV_services|GraphicsSupervisor]].


== IStorageChannel ==
== IStorageChannel ==
Line 2,817: 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,900: 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,951: 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]
|-
|-
| 430 || [20.0.0+]
| 403 || [S2]
|-
|-
| 431 || [20.0.0+]
| 410 || [18.0.0+] [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]]
|-
| 411 || [18.0.0+] [[#ReadGeneralStorageForDebug|ReadGeneralStorageForDebug]]
|-
| 412 || [18.0.0+] [[#WriteGeneralStorageForDebug|WriteGeneralStorageForDebug]]
|-
| 430 || [20.0.0+]
|-
| 431 || [20.0.0+]
|-
|-
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
|-
|-
| 910 || [20.0.0+]
| 910 || [20.0.0+]
|-
| 2000 || [S2]
|-
| 10000 || [S2]
|}
|}


Line 3,027: 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,042: 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,052: 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,374: Line 3,562:


= (S2) adraw:a =
= (S2) adraw:a =
This is "nn::appletdraw::sfif::IAppletRoot". This is exclusive to S2.
This is "nn::appletdraw::sfif::IAppletRoot".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,388: Line 3,576:
Unofficial name.  
Unofficial name.  


Takes a PID and an u64. Returns a [[#IResourceSession]].
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IResourceSession]].


== OpenAppletSession ==
== OpenAppletSession ==
Unofficial name. This is exclusive to S2.
Unofficial name.


Takes a PID and an u64. Returns a [[#IAppletSession]].
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IAppletSession]].


== IResourceSession ==
== IResourceSession ==
Line 3,402: Line 3,590:
! Cmd || Name
! Cmd || Name
|-
|-
| 1 ||  
| 1 || [[#Ping|Ping]]
|-
|-
| 10 ||   
| 10 ||   
Line 3,409: Line 3,597:
|}
|}


=== Cmd1 ===
=== Ping ===
Takes a u64. Returns a u64.
Unofficial name.
 
Takes an input u64. Returns an output u64.
 
The output u64 should match the input u64. Official software sends the current system tick value.


=== Cmd10 ===
=== Cmd10 ===
Line 3,425: Line 3,617:
! Cmd || Name
! Cmd || Name
|-
|-
| 1 ||  
| 1 || [[#Ping|Ping]]
|-
|-
| 2 ||
| 2 || [[#GetEvent|GetEvent]]
|-
|-
| 3 ||
| 3 || [20.1.1+]
|-
|-
| 10 ||   
| 10 ||   
Line 3,441: Line 3,633:
| 15 ||   
| 15 ||   
|-
|-
| 16 ||
| 16 || [20.1.1+]
|-
|-
| 17 ||
| 17 || [20.1.1+]
|-
|-
| 18 ||
| 18 || [20.1.1+]
|-
|-
| 19 ||
| 19 || [20.1.1+]
|-
|-
| 21 ||   
| 21 ||   
Line 3,453: Line 3,645:
| 22 ||   
| 22 ||   
|-
|-
| 23 ||
| 23 || [20.1.1+]
|-
|-
| 24 ||
| 24 || [20.1.1+]
|-
|-
| 31 ||
| 31 || [[#GetFrameBufferInfo|GetFrameBufferInfo]]
|-
|-
| 8001 ||
| 8001 || [[#GetFrameBufferInfoForDebug|GetFrameBufferInfoForDebug]]
|-
| 8003 || [19.0.0-19.1.0]
|-
|-
| 8004 ||   
| 8004 ||   
|}
|}


=== Cmd1 ===
=== GetEvent ===
Takes a u64. Returns a u64.
Unofficial name.


=== Cmd2 ===
No input. Returns an output Event handle.
Returns a handle.


=== Cmd3 ===
=== Cmd3 ===
Takes a handle.
Takes a handle. No output.


=== Cmd10 ===
=== Cmd10 ===
Takes an int.
Takes an input u32. No output.


=== Cmd11 ===
=== Cmd11 ===
Takes an int.
Takes an input u32. No output.


=== Cmd12 ===
=== Cmd12 ===
Takes a u64. Returns an int.
Takes an input u64. Returns an output u32.


=== Cmd13 ===
=== Cmd13 ===
Takes an int. Returns an int.
Takes an input u32. Returns an output u32.


=== Cmd15 ===
=== Cmd15 ===
Takes an int. Returns an int, an int, an int.
Takes an input u32. Returns three output u32s.


=== Cmd16 ===
=== Cmd16 ===
Returns an int.
No input. Returns an output u32.


=== Cmd17 ===
=== Cmd17 ===
Takes an int. Returns an int, a u16.
Takes an input u32. Returns an output u32 and an output u16.


=== Cmd18 ===
=== Cmd18 ===
Takes an int. Returns 3x int, a u16.
Takes an input u32. Returns three output u32s and an output u16.


=== Cmd19 ===
=== Cmd19 ===
Takes an int. Returns an int, a u16.
Takes an input u32. Returns an output u32 and an output u16.


=== Cmd21 ===
=== Cmd21 ===
Takes an int. Returns a struct of size 0x40.
Takes an input u32. Returns a struct of size 0x40.


=== Cmd22 ===
=== Cmd22 ===
Line 3,507: Line 3,700:


=== Cmd23 ===
=== Cmd23 ===
Returns a struct of size 0xC8.
No input. Returns a struct of size 0xC8.


=== Cmd24 ===
=== Cmd24 ===
Sends an ipc-buf with size 0xD8.
Takes an ipc-buf with size 0xD8. No output.


=== Cmd31 ===
=== GetFrameBufferInfo ===
Returns a struct with 0x28, a struct with size 0x10.
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].
 
[[#(S2)_AdrawFrameBufferInfo|Id]] is "adrawfb".
 
=== GetFrameBufferInfoForDebug ===
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].


=== Cmd8001 ===
=== Cmd8003 ===
Returns a struct with 0x28, a struct with size 0x10.
Takes an input u64. Returns a struct with size 0x18.


=== Cmd8004 ===
=== Cmd8004 ===
Takes an int. Returns a u64.
Takes an input u32. Returns an output u64.


= (S2) appletOE =
= (S2) appletOE =
Line 3,543: Line 3,745:
! Cmd || Name
! Cmd || Name
|-
|-
| 2000 || [[#GetGraphicsInterfaceForNxCompat]]
| 2000 || [[#GetGraphicsSupervisorForNxCompat]]
|-
|-
| 2001 ||  
| 2001 ||  
Line 3,568: Line 3,770:
|}
|}


=== GetGraphicsInterfaceForNxCompat ===
=== GetGraphicsSupervisorForNxCompat ===
Unofficial name.
Unofficial name.


No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]].
No input. Returns an output TIPC handle to [[Switch_2:_GSV_services|GraphicsSupervisor]]..


Same as [[#GetGraphicsInterface]] but for compat mode.
Same as [[#GetGraphicsSupervisor]] but for compat mode.


=== SetCopyright ===
=== SetCopyright ===
Line 3,601: Line 3,803:
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp.
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp.


= (S2) GraphicsInterface =
= Library Applets =
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.
This section documents library applet launching.


{| class="wikitable" border="1"
Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
 
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
 
== CommonArguments ==
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by <code>nn::la::CommonArgumentsWriter</code> and has the following format.
 
This struct is 0x20-bytes.
 
Official sw handles the first 8-bytes separately, which is a header. With CommonArguments version 0x0, the header is 4-bytes, while starting with version 0x1 it's 8-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Offset || Size || Typical Value || Notes
|-
|-
| 1 || [[#InitializeGraphicsWithTransferMemory]]
| 0x0 || 4 || 1 || Common Arguments version
|-
|-
| 4 || [[#InitializeGraphics]]
| 0x4 || 4 || 0x20 || Common Arguments size
|-
|-
| 11 || [[#SetCurrentProcessHandle]]
| 0x8 || 4 || || Library applet version (API version)
|-
|-
| 12 ||  
| 0xC || 4 || 0 || Theme color
|-
|-
| 101 || [[#StartGraphics]]
| 0x10 || 1 || 0 || Play startup sound
|-
|-
| 111 ||  
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
|-
|-
| 112 ||  
|}
 
= AppletId =
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
 
{| class="wikitable" border="1"
|-
|-
| 114 ||
! Value
! ProgramId
! Description
|-
|-
| 115 ||  
| 0x00000000
|  
| None
|-
|-
| 187 ||  
| 0x00000001
|  
| Application (not valid for use with LibraryApplets)
|-
|-
| 201 ||  
| 0x00000002
| 0x010000000000100C
| OverlayApplet (overlayDisp)
|-
|-
| 301 ||  
| 0x00000003
| 0x0100000000001000
| SystemAppletMenu (qlaunch)
|-
|-
| 303 ||  
| 0x00000004
| 0x0100000000001012
| SystemApplication (starter)
|-
|-
| 311 ||  
| 0x0000000A
| 0x0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
|-
| 312 ||  
| 0x0000000B
| 0x0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
|-
| 314 ||  
| 0x0000000C
| 0x0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
|-
| 315 ||  
| 0x0000000D
| 0x0100000000001004
| LibraryAppletDataErase (dataErase)
|-
|-
| 321 ||  
| 0x0000000E
| 0x0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
|-
|-
| 327 ||  
| 0x0000000F
| 0x0100000000001006
| LibraryAppletNetConnect (netConnect)
|-
|-
| 391 ||  
| 0x00000010
| 0x0100000000001007
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
|-
|-
| 401 || [[#PrepareGpuManagerSession]]
| 0x00000011
| 0x0100000000001008
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
|-
|-
| 402 || [[#StartGpuManagerSession]]
| 0x00000012
| 0x0100000000001009
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
|-
|-
| 423 ||  
| 0x00000013
| 0x010000000000100A
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
|-
| 434 ||  
| 0x00000014
| 0x010000000000100B
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
|-
| 494 ||  
| 0x00000015
| 0x010000000000100D
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
|-
| 496 || [[#CreateGpuManagerSessionWithTransferMemory]]
| 0x00000016
| 0x010000000000100E
| LibraryAppletSet (set)
|-
|-
| 497 || [[#CreateGpuManagerSession]]
| 0x00000017
| 0x010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
|-
| 901 ||  
| 0x00000018
| 0x0100000000001010
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
|-
|-
| 902 ||  
| 0x00000019
| 0x0100000000001011
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
|-
|-
| 903 ||  
| 0x0000001A
| 0x0100000000001013
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
|-
|-
| 905 ||  
| 0x0000001B
| 0x010000000000101A
| LibraryAppletGift (gift)
|-
|-
| 911 ||  
| 0x0000001C
| 0x010000000000101C
| LibraryAppletUserMigration (userMigration)
|-
|-
| 912 ||  
| 0x0000001D
| 0x010000000000101D
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
|-
|-
| 922 ||  
| 0x0000001E
| 0x0100000000001020
| [9.0.0+] LibraryAppletStory (story)
|-
|-
| 961 ||  
| 0x0000001F
| 0x010070000E3C0000
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
|-
|-
| 991 ||  
| 0x00000020
| 0x010086000E49C000
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
|-
|-
| 1001 ||  
| 0x00000021
| 0x0100000000001038
| [10.0.0+] LibraryAppletSample (sample)
|-
|-
| 1002 ||  
| 0x00000022
| 0x0100000000001007
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
|-
|-
| 1003 ||  
| 0x00000032
| 0x010000000000100F
| [17.0.0+] LibraryAppletOfflineWebApp_3 ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 1101 ||  
| 0x00000033
| 0x010000000000100F
| [17.0.0+] LibraryAppletOfflineWebSystem ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 1102 ||  
| 0x00000035
| [17.0.0+] 0x0100000000001010 ([16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] LibraryAppletLhub ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 1401 || [[#CreateNvDrv2UserSessionWithTransferMemory]]  
| 0x00000036
| [17.0.0+] 0x0100000000001010 ([16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] LibraryAppletLogin ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 1402 || [[#CreateNvDrv2UserSession]]  
| 0x00000037
| [17.0.0+] 0x0100000000001010 ([16.0.0-16.1.0] 0x0100000000001042)
| [17.0.0+] LibraryAppletShare ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 1411 || [[#GetNvDrv2UserTransferMemoryUsage]]
| 0x00000038
| 0x0100000000001043
| [16.0.0-16.1.0]
|-
|-
| 1501 ||
| 0x00000050
| 0x0100000000001007
| [18.0.0+]
|-
|-
| 1502 ||  
| 0x00000051
| 0x0100000000001007
| [18.0.0+]
|-
|-
| 1601 ||  
| 0x00000064
| 0x0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
|-
|-
| 1602 ||  
| 0x000003E8
|  
| [10.0.0-16.1.0] DevlopmentTool
|-
|-
| 1603 ||  
| 0x000003F1
| 0x010000000000D619
| [10.0.0-16.1.0] CombinationLA
|-
|-
| 1611 ||  
| 0x000003F2
| 0x010000000000D610
| [10.0.0-16.1.0] AeSystemApplet
|-
|-
| 1612 ||  
| 0x000003F3
| 0x010000000000D611
| [10.0.0-16.1.0] AeOverlayApplet
|-
|-
| 1691 ||
| 0x000003F4
|}
| 0x010000000000D612
 
| [10.0.0-16.1.0] AeStarter
== InitializeGraphicsWithTransferMemory ==
|-
Unofficial name.
| 0x000003F5
 
| 0x010000000000D613
Takes a TransferMemory handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and an input u64 '''TransferMemorySize'''. No output.
| [10.0.0-16.1.0] AeLibraryAppletAlone
 
|-
== InitializeGraphics ==
| 0x000003F6
Unofficial name.
| 0x010000000000D614
 
| [10.0.0-16.1.0] AeLibraryApplet1
Takes a Process handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and five input u64s. No output.
|-
 
| 0x000003F7
The first u64 appears to be a version ([19.0.0] 0x8000000000000001, [20.1.1] 0x8000000000000005), the last u64 is the output from new [[SVC#InfoType|InfoType]] 31 or 32 and the remaining u64s are all 0.
| 0x010000000000D615
 
| [10.0.0-16.1.0] AeLibraryApplet2
== SetCurrentProcessHandle ==
Unofficial name.
 
Takes a Process handle. No output.
 
Called directly after [[#InitializeGraphicsWithTransferMemory]] or [[#InitializeGraphics]].
 
== StartGraphics ==
Unofficial name.
 
No input/output.
 
Called directly after [[#SetCurrentProcessHandle]].
 
== PrepareGpuManagerSession ==
Unofficial name.
 
No input/output.
 
Called directly after [[#CreateGpuManagerSessionWithTransferMemory]] or [[#CreateGpuManagerSession]].
 
== StartGpuManagerSession ==
Unofficial name.
 
No input/output.
 
Called directly after [[#PrepareGpuManagerSession]].
 
== CreateGpuManagerSessionWithTransferMemory ==
Unofficial name.
 
Takes a TransferMemory handle and two input u64s '''Version''' and '''TransferMemorySize'''. Returns a [[#GpuManagerSession]].
 
[19.0.0] '''Version''' must be 2.
 
== CreateGpuManagerSession ==
Unofficial name.
 
Takes an input u64 '''Version'''. Returns a [[#GpuManagerSession]].
 
[19.0.0] '''Version''' must be 2.
 
== CreateNvDrv2UserSessionWithTransferMemory ==
Unofficial name.
 
Takes a TransferMemory handle, an input u64 '''TransferMemorySize''' and an input u8. Returns an [[NV_services#(S2)_INvDrv2User|INvDrv2User]].
 
== CreateNvDrv2UserSession ==
Unofficial name.
 
No input. Returns an [[NV_services#(S2)_INvDrv2User|INvDrv2User]].
 
== GetNvDrv2UserTransferMemoryUsage ==
Unofficial name.
 
No input. Returns three u64s '''TotalTransferMemorySize''', '''UsedTransferMemorySize''' and '''MaxTransferMemorySize'''.
 
== GpuManagerSession ==
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 0x000003F8
| 0x010000000000D616
| [10.0.0-16.1.0] AeLibraryApplet3
|-
|-
| 11 || [[#GetEventIdRange]]
| 0x000003F9
| 0x010000000000D617
| [10.0.0-16.1.0] AeLibraryApplet4
|-
|-
| 12 || [[#CreateEvent]]
| 0x000003FA
| 0x010000000000D60A
| [10.0.0-16.1.0] AppletISA
|-
|-
| 21 || [[#RequestGpuSession]]
| 0x000003FB
| 0x010000000000D60B
| [10.0.0-16.1.0] AppletIOA
|-
|-
| 22 || [[#GetGpuSession]]
| 0x000003FC
| 0x010000000000D60C
| [10.0.0-16.1.0] AppletISTA
|-
|-
| 33 ||  
| 0x000003FD
| 0x010000000000D60D
| [10.0.0-16.1.0] AppletILA1
|-
|-
| 41 ||  
| 0x000003FE
| 0x010000000000D60E
| [10.0.0-16.1.0] AppletILA2
|-
|-
| 42 ||  
| 0x0100000E
|  
| [S2] LibraryAppletError
|-
|-
| 102 ||  
| 0x01000010
|  
| [S2] LibraryAppletPlayerSelect
|-
|-
| 200 ||  
| 0x01010011
|  
| [S2] SwkbdModeless
|-
|-
| 201 ||  
| 0x01020011
|  
| [S2] Swkbd
|-
|-
| 202 ||  
| 0x01000013
|}
|  
 
| [S2] OpenWeb
=== GetEventIdRange ===
Unofficial name.
 
No input. Returns two u32s '''EventIdMin''' and '''EventIdMax'''.
 
=== CreateEvent ===
Unofficial name.
 
Takes an input u32 '''EventId'''. Returns an output Event handle.
 
=== RequestGpuSession ===
Unofficial name.
 
Takes an input u32 '''EventId'''. No output.
 
'''EventId''' must have been previously passed to [[#CreateEvent]] and the returned Event handle will be signalled when the session is ready.
 
=== GetGpuSession ===
Unofficial name.
 
No input. Returns a [[#GpuSession]].
 
Called after [[#RequestGpuSession]] and the Event handle has been signalled.
 
=== GpuSession ===
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 0x01000014
|  
| [S2] LibraryAppletShop
|-
|-
| 101 || [[#CreateGpuMemory]]
| 0x01000022
|  
| [S2] LibraryAppletPromoteQualification
|-
|-
| 102 || [[#DestroyGpuMemory]]
| 0x01010025
|  
| [S2] SaveDataBackup
|-
|-
| 201 || [19.0.0-19.1.0] MapMemory
| 0x01020025
|  
| [S2] SaveDataBackup
|-
|-
| 202 || [19.0.0-19.1.0] UnmapMemory
| 0x01000032
|  
| [S2] LibraryAppletOfflineWebApp_3
|-
|-
| 203 || [19.0.0-19.1.0] AllocateAddressSpace
| 0x01000033
|  
| [S2] LibraryAppletOfflineWebSystem
|-
|-
| 204 || [19.0.0-19.1.0] FreeAddressSpace
| 0x01000035
|  
| [S2] LibraryAppletLhub
|-
|-
| 205 || [19.0.0-19.1.0] RemapMemory
| 0x01000036
|  
| [S2] LibraryAppletLogin
|-
|-
| 207 || [19.0.0-19.1.0] ModifyMemoryMapping
| 0x01000037
|  
| [S2] LibraryAppletShare
|-
|-
| 211 || [20.1.1+] MapMemoryV2
| 0x01000050
|  
| [S2] PlayerSelect
|-
|-
| 212 || [20.1.1+] ModifyMemoryMappingV2
| 0x01000051
|  
| [S2] PlayerSelect
|-
|-
| 213 || [20.1.1+] UnmapMemoryV2
| 0x01000052
|  
| [S2] PlayerSelect
|-
|-
| 214 || [20.1.1+] AllocateAddressSpaceV2
| 0x700000C8
| 0x010000000000D65B
| [18.0.0+]  
|-
|-
| 215 || [20.1.1+] FreeAddressSpaceV2
| 0x700000C9
| 0x010000000000D65C
| [18.0.0+]  
|-
|-
| 216 || [20.1.1+] RemapMemoryV2
| 0x700000DC
|}
| 0x010000000000D619
 
| [17.0.0+] CombinationLA
==== CreateGpuMemory ====
Unofficial name.
 
Takes two input u64s '''MemoryAddressStart''' and '''MemoryAddressEnd''' and two u8s. Returns an output u32 '''GpuMemoryHandle'''.
 
The memory region between '''MemoryAddressStart''' and '''MemoryAddressEnd''' must have been passed to [[#SVC|SVC]] 0x80 with attribute 0x20.
 
==== DestroyGpuMemory ====
Unofficial name.
 
Takes two input u32s '''GpuMemoryHandle''' and '''EventId'''. No output.
 
The Event handle associated with '''EventId''' will be signalled when the memory is released.
 
= Library Applets =
This section documents library applet launching.
 
Before starting the applet, [[#IStorage]]s are [[#ILibraryAppletCreator|created]] and written, then passed to [[#ILibraryAppletAccessor]] PushInData. The [[#IStorage]] session is closed afterwards. The first [[#IStorage]] is [[#CommonArguments]], followed by any applet-specific [[#IStorage]]s.
 
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
 
== CommonArguments ==
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by <code>nn::la::CommonArgumentsWriter</code> and has the following format.
 
This struct is 0x20-bytes.
 
Official sw handles the first 8-bytes separately, which is a header. With CommonArguments version 0x0, the header is 4-bytes, while starting with version 0x1 it's 8-bytes.
 
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Typical Value || Notes
| 0x700000E6
| 0x010000000000D610
| [17.0.0+] AeSystemApplet
|-
|-
| 0x0 || 4 || 1 || Common Arguments version
| 0x700000E7
| 0x010000000000D611
| [17.0.0+] AeOverlayApplet
|-
|-
| 0x4 || 4 || 0x20 || Common Arguments size
| 0x700000E8
| 0x010000000000D612
| [17.0.0+] AeStarter
|-
|-
| 0x8 || 4 || || Library applet version (API version)
| 0x700000E9
| 0x010000000000D613
| [17.0.0+] AeLibraryAppletAlone
|-
|-
| 0xC || 4 || 0 || Theme color
| 0x700000EA
| 0x010000000000D614
| [17.0.0+] AeLibraryApplet1
|-
| 0x700000EB
| 0x010000000000D615
| [17.0.0+] AeLibraryApplet2
|-
| 0x700000EC
| 0x010000000000D616
| [17.0.0+] AeLibraryApplet3
|-
| 0x700000ED
| 0x010000000000D617
| [17.0.0+] AeLibraryApplet4
|-
| 0x700000F0
| 0x010000000000D60A
| [17.0.0+] AppletISA
|-
| 0x700000F1
| 0x010000000000D60B
| [17.0.0+] AppletIOA
|-
| 0x700000F2
| 0x010000000000D60C
| [17.0.0+] AppletISTA
|-
|-
| 0x10 || 1 || 0 || Play startup sound
| 0x700000F3
| 0x010000000000D60D
| [17.0.0+] AppletILA1
|-
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
| 0x700000F4
| 0x010000000000D60E
| [17.0.0+] AppletILA2
|-
|-
| 0x700000FA
| 0x010000000000D677
| [20.1.0+]
|}
|}


= AppletId =
= LibraryAppletMode =
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
This is "nn::applet::LibraryAppletMode".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Value
! ProgramId
! Description
! Description
|-
|-
| 0x00
| 0x0
|  
| AllForeground
| None
|-
|-
| 0x01
| 0x1
|  
| PartialForeground
| Application (not valid for use with LibraryApplets)
|-
|-
| 0x02
| 0x2
| 010000000000100C
| NoUi
| OverlayApplet (overlayDisp)
|-
|-
| 0x03
| 0x3
| 0100000000001000
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])
| SystemAppletMenu (qlaunch)
|-
|-
| 0x04
| 0x4
| 0100000000001012
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])
| SystemApplication (starter)
|}
 
= AppletMessage =
This is "nn::am::AppletMessage".
 
{| class="wikitable" border="1"
|-
|-
| 0x0A
! Value
| 0100000000001001
! Description
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
|-
| 0x0B
| 0 || None
| 0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
|-
| 0x0C
| 1 || ChangeIntoForeground
| 0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
|-
| 0x0D
| 2 || ChangeIntoBackground
| 0100000000001004
| LibraryAppletDataErase (dataErase)
|-
|-
| 0x0E
| 4 || Exit
| 0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
|-
|-
| 0x0F
| 6 || ApplicationExited
| 0100000000001006
| LibraryAppletNetConnect (netConnect)
|-
|-
| 0x10
| 7 ||  
| 0100000000001007
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
|-
|-
| 0x11
| 15 || [[#FocusState|FocusStateChanged]]
| 0100000000001008
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
|-
|-
| 0x12
| 16 || [[#SetRestartMessageEnabled|Resume]]
| 0100000000001009
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
|-
|-
| 0x13
| 20 || DetectShortPressingHomeButton
| 010000000000100A
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
|-
| 0x14
| 21 || DetectLongPressingHomeButton
| 010000000000100B
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
|-
| 0x15
| 22 || DetectShortPressingPowerButton
| 010000000000100D
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
|-
| 0x16
| 23 || DetectMiddlePressingPowerButton
| 010000000000100E
| LibraryAppletSet (set)
|-
|-
| 0x17
| 24 || DetectLongPressingPowerButton
| 010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
|-
| 0x18
| 25 || RequestToPrepareSleep
| 0100000000001010
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
|-
|-
| 0x19
| 26 || FinishedSleepSequence
| 0100000000001011
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
|-
|-
| 0x1A
| 27 || SleepRequiredByHighTemperature
| 0100000000001013
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
|-
|-
| 0x1B
| 28 || SleepRequiredByLowBattery
| 010000000000101A
| LibraryAppletGift (gift)
|-
|-
| 0x1C
| 29 || AutoPowerDown
| 010000000000101C
| LibraryAppletUserMigration (userMigration)
|-
|-
| 0x1D
| 30 || [[#OperationMode|OperationModeChanged]]
| 010000000000101D
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
|-
|-
| 0x1E
| 31 || [[#PerformanceMode|PerformanceModeChanged]]
| 0100000000001020
| [9.0.0+] LibraryAppletStory (story)
|-
|-
| 0x1F
| 32 || DetectReceivingCecSystemStandby
| 010070000E3C0000
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
|-
|-
| 0x20
| 33 || SdCardRemoved
| 010086000E49C000
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
|-
|-
| 0x21
| 34 ||  
| 0100000000001038
| [10.0.0+] LibraryAppletSample (sample)
|-
|-
| 0x22
| 50 || LaunchApplicationRequested
| 0100000000001007
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
|-
|-
| 0x32
| 51 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]
| 010000000000100F
| [17.0.0+] LibraryAppletOfflineWebApp_3 ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 0x33
| 55 || ShowApplicationLogo
| 010000000000100F
| [17.0.0+] LibraryAppletOfflineWebSystem ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 0x35
| 56 || HideApplicationLogo
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] LibraryAppletLhub ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 0x36
| 57 || ForceHideApplicationLogo
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] LibraryAppletLogin ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 0x37
| 58 ||  
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] LibraryAppletShare ([16.0.0-16.1.0] ) ([[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] in NX)
|-
|-
| 0x38
| 59 ||  
| 0100000000001043
| [16.0.0-16.1.0]
|-
|-
| 0x50
| 60 || FloatingApplicationDetected
| 0100000000001007
| [18.0.0+]
|-
|-
| 0x51
| 61 || [7.0.0+] PerformanceConfigurationChanged
| 0100000000001007
| [18.0.0+]
|-
|-
| 0x64
| 70 ||  
| 0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
|-
|-
| 0x3E8
| 71 ||  
|  
| [10.0.0-16.1.0] DevlopmentTool
|-
|-
| 0x3F1
| 72 ||  
| 010000000000D619
| [10.0.0-16.1.0] CombinationLA
|-
|-
| 0x3F2
| 73 ||  
| 010000000000D610
| [10.0.0-16.1.0] AeSystemApplet
|-
|-
| 0x3F3
| 75 ||  
| 010000000000D611
| [10.0.0-16.1.0] AeOverlayApplet
|-
|-
| 0x3F4
| 80 ||  
| 010000000000D612
| [10.0.0-16.1.0] AeStarter
|-
|-
| 0x3F5
| 81 ||  
| 010000000000D613
| [10.0.0-16.1.0] AeLibraryAppletAlone
|-
|-
| 0x3F6
| 82 ||  
| 010000000000D614
| [10.0.0-16.1.0] AeLibraryApplet1
|-
|-
| 0x3F7
| 83 ||  
| 010000000000D615
| [10.0.0-16.1.0] AeLibraryApplet2
|-
|-
| 0x3F8
| 85 ||  
| 010000000000D616
| [10.0.0-16.1.0] AeLibraryApplet3
|-
|-
| 0x3F9
| 86 ||  
| 010000000000D617
| [10.0.0-16.1.0] AeLibraryApplet4
|-
|-
| 0x3FA
| 90 || [[#SetRequiresCaptureButtonShortPressedMessage|DetectShortPressingCaptureButton]]
| 010000000000D60A
| [10.0.0-16.1.0] AppletISA
|-
|-
| 0x3FB
| 92 || [[#SetAlbumImageTakenNotificationEnabled|AlbumScreenShotTaken]]
| 010000000000D60B
| [10.0.0-16.1.0] AppletIOA
|-
|-
| 0x3FC
| 93 || AlbumRecordingSaved
| 010000000000D60C
| [10.0.0-16.1.0] AppletISTA
|-
|-
| 0x3FD
| 94 ||  
| 010000000000D60D
| [10.0.0-16.1.0] AppletILA1
|-
|-
| 0x3FE
| 100 ||  
| 010000000000D60E
| [10.0.0-16.1.0] AppletILA2
|-
|-
| 0x700000C8
| 101 ||  
| 010000000000D65B
| [18.0.0+]
|-
|-
| 0x700000C9
| 110 || [14.0.0+] DetectShortPressingCaptureButtonForApplet
| 010000000000D65C
| [18.0.0+]  
|-
|-
| 0x700000DC
| 111 || [14.0.0+] DetectLongPressingCaptureButtonForApplet
| 010000000000D619
| [17.0.0+] CombinationLA
|-
|-
| 0x700000E6
| 1000 ||
| 010000000000D610
|}
| [17.0.0+] AeSystemApplet
 
|-
= OperationMode =
| 0x700000E7
This is "nn::oe::OperationMode".
| 010000000000D611
 
| [17.0.0+] AeOverlayApplet
{| class="wikitable" border="1"
|-
|-
| 0x700000E8
! Value
| 010000000000D612
! Description
| [17.0.0+] AeStarter
|-
|-
| 0x700000E9
| 0 || Handheld
| 010000000000D613
| [17.0.0+] AeLibraryAppletAlone
|-
|-
| 0x700000EA
| 1 || Console
| 010000000000D614
|}
| [17.0.0+] AeLibraryApplet1
 
= PerformanceMode =
This is "nn::oe::PerformanceMode".
 
{| class="wikitable" border="1"
|-
|-
| 0x700000EB
! Value
| 010000000000D615
! Description
| [17.0.0+] AeLibraryApplet2
|-
|-
| 0x700000EC
| -1 || Invalid
| 010000000000D616
| [17.0.0+] AeLibraryApplet3
|-
|-
| 0x700000ED
| 0 || Normal
| 010000000000D617
| [17.0.0+] AeLibraryApplet4
|-
|-
| 0x700000F0
| 1 || Boost
| 010000000000D60A
|}
| [17.0.0+] AppletISA
 
= FocusState =
This is "nn::oe::FocusState".
 
{| class="wikitable" border="1"
|-
|-
| 0x700000F1
! Value
| 010000000000D60B
! Description
| [17.0.0+] AppletIOA
|-
|-
| 0x700000F2
| 1 || InFocus
| 010000000000D60C
| [17.0.0+] AppletISTA
|-
|-
| 0x700000F3
| 2 || OutOfFocus
| 010000000000D60D
| [17.0.0+] AppletILA1
|-
|-
| 0x700000F4
| 3 || Background
| 010000000000D60E
| [17.0.0+] AppletILA2
|-
| 0x700000FA
| 010000000000D677
| [20.1.0+]
|}
|}


= LibraryAppletMode =
= CpuBoostMode =
This is "nn::applet::LibraryAppletMode".
This is "nn::oe::CpuBoostMode".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 4,220: Line 4,385:
! Description
! Description
|-
|-
| 0x0
| 0 || Normal
| AllForeground
|-
|-
| 0x1
| 1 || FastLoad
| PartialForeground
|-
| 0x2
| NoUi
|-
| 0x3
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])
|-
| 0x4
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])
|}
|}


= AppletMessage =
= WindowOriginMode =
This is "nn::am::AppletMessage".
This is "nn::oe::WindowOriginMode".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 4,244: Line 4,398:
! Description
! Description
|-
|-
| 0 || None
| 0 || LowerLeft
|-
|-
| 1 || ChangeIntoForeground
| 1 || UpperLeft
|-
|}
| 2 || ChangeIntoBackground
 
= WirelessPriorityMode =
This is "nn::oe::WirelessPriorityMode".
 
{| class="wikitable" border="1"
|-
|-
| 4 || Exit
! Value
! Description
|-
|-
| 6 || ApplicationExited
| 0 || Default
|-
|-
| 7 ||  
| 1 || OptimizedForWlan
|}
 
= TvPowerStateMatchingMode =
This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
 
{| class="wikitable" border="1"
|-
|-
| 15 || [[#FocusState|FocusStateChanged]]
! Value
! Description
|-
|-
| 16 || [[#SetRestartMessageEnabled|Resume]]
| 0 || Unknown
|-
|-
| 20 || DetectShortPressingHomeButton
| 1 || Unknown
|}
 
= SystemButtonType =
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
 
{| class="wikitable" border="1"
|-
|-
| 21 || DetectLongPressingHomeButton
! Value
! Description
|-
|-
| 22 || DetectShortPressingPowerButton
| 1 || PerformHomeButtonShortPressing
|-
|-
| 23 || DetectMiddlePressingPowerButton
| 2 || PerformHomeButtonLongPressing
|-
|-
| 24 || DetectLongPressingPowerButton
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
|-
|-
| 25 || RequestToPrepareSleep
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
|-
|-
| 26 || FinishedSleepSequence
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].
|-
|-
| 27 || SleepRequiredByHighTemperature
| 6 || PerformCaptureButtonShortPressing
|-
|-
| 28 || SleepRequiredByLowBattery
| 7 || PerformCaptureButtonLongPressing
|}
 
= LaunchParameterKind =
{| class="wikitable" border="1"
|-
|-
| 29 || AutoPowerDown
! Value
! Description
|-
|-
| 30 || [[#OperationMode|OperationModeChanged]]
| 1 || UserChannel. Application-specific LaunchParameter.
|-
|-
| 31 || [[#PerformanceMode|PerformanceModeChanged]]
| 2 || account PreselectedUser
|-
|-
| 32 || DetectReceivingCecSystemStandby
| 3 || Unknown if used by anything?
|}
 
= LibraryAppletExitReason =
{| class="wikitable" border="1"
|-
|-
| 33 || SdCardRemoved
! Value
! Description
|-
|-
| 34 ||  
| 0 || Normal
|-
|-
| 50 || LaunchApplicationRequested
| 1 || Canceled
|-
|-
| 51 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]
| 2 || Abnormal
|-
|-
| 55 || ShowApplicationLogo
| 10 || Unexpected
|}
 
= ProgramSpecifyKind =
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
 
{| class="wikitable" border="1"
|-
|-
| 56 || HideApplicationLogo
! Value
! Description
|-
|-
| 57 || ForceHideApplicationLogo
| 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.
|-
|-
| 58 ||  
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
|-
|-
| 59 ||  
| 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 =
This is u32 enum "nn::applet::InputDetectionPolicy".
 
{| class="wikitable" border="1"
|-
|-
| 60 || FloatingApplicationDetected
! Value
! Description
|-
|-
| 61 || [7.0.0+] PerformanceConfigurationChanged
| 0 || Unknown
|-
|-
| 70 ||  
| 1 || Unknown
|}
 
= AppletResourceUserId =
This is "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
 
= AppletAttribute =
This is "nn::am::AppletAttribute". This struct is 0x80 bytes.
 
{| class="wikitable" border="1"
|-
|-
| 71 ||  
! Offset || Size || Description
|-
|-
| 72 ||  
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
|-
|-
| 73 ||  
| 0x1 || 0x7F || Unused
|-
|}
| 75 ||
 
|-
This is used by [[#OpenLibraryAppletProxy]].
| 80 ||
 
= AppletProcessLaunchReason =
This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
 
{| class="wikitable" border="1"
|-
|-
| 81 ||  
! Offset || Size || Description
|-
|-
| 82 ||  
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].
|-
|-
| 83 ||  
| 0x1 || 0x2 || Always 0.
|-
|-
| 85 ||  
| 0x3 || 0x1 || Always 0.
|}
 
= LibraryAppletInfo =
This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
 
{| class="wikitable" border="1"
|-
|-
| 86 ||  
! Offset || Size || Description
|-
|-
| 90 || [[#SetRequiresCaptureButtonShortPressedMessage|DetectShortPressingCaptureButton]]
| 0x0 || 0x4 || [[#AppletId]]
|-
|-
| 92 || [[#SetAlbumImageTakenNotificationEnabled|AlbumScreenShotTaken]]
| 0x4 || 0x4 || [[#LibraryAppletMode]]
|}
 
= AppletKind =
This is "nn::am::service::AppletKind". This is 8-bytes.
 
= AppletIdentityInfo =
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
|-
| 93 || AlbumRecordingSaved
! Offset || Size || Description
|-
|-
| 94 ||  
| 0x0 || 0x4 || [[#AppletId]]
|-
|-
| 100 ||  
| 0x4 || 0x4 || Padding
|-
|-
| 101 ||  
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 110 || [14.0.0+] DetectShortPressingCaptureButtonForApplet
|-
| 111 || [14.0.0+] DetectLongPressingCaptureButtonForApplet
|-
| 1000 ||
|}
|}


= OperationMode =
= ApplicationAttributeForQuest =
This is "nn::oe::OperationMode".
This struct is "nn::applet::ApplicationAttributeForQuest".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Offset || Size || Description
! Description
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
|-
|-
| 0 || Handheld
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
|-
|-
| 1 || Console
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
|}
|}


= PerformanceMode =
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).
This is "nn::oe::PerformanceMode".
 
= ApplicationAttribute =
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Offset || Size || Description
! Description
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
|-
|-
| -1 || Invalid
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
|-
|-
| 0 || Normal
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
|-
|-
| 1 || Boost
| 0xC || 0x14 || Unused. Default is 0.
|}
|}


= FocusState =
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
This is "nn::oe::FocusState".
 
= ApplicationLaunchProperty =
This struct is 0x10-bytes.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Offset || Size || Description
! Description
|-
|-
| 1 || InFocus
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
|-
| 2 || OutOfFocus
| 0x8 || 0x4 || Application title-version.
|-
|-
| 3 || Background
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
|}
 
= CpuBoostMode =
This is "nn::oe::CpuBoostMode".
 
{| class="wikitable" border="1"
|-
|-
! Value
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
! Description
|-
|-
| 0 || Normal
| 0xE || 0x1 || Unknown.
|-
|-
| 1 || FastLoad
| 0xF || 0x1 || Padding.
|}
|}


= WindowOriginMode =
= ApplicationLaunchRequestInfo =
This is "nn::oe::WindowOriginMode".
This is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Offset || Size || Description
! Description
|-
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
|-
|-
| 0 || LowerLeft
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
|-
|-
| 1 || UpperLeft
| 0x8 || 0x8 || Unknown. The default is 0x0.
|}
|}


= WirelessPriorityMode =
= AppletResourceUsageInfo =
This is "nn::oe::WirelessPriorityMode".
This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Offset || Size || Description
! Description
|-
|-
| 0 || Default
| 0x0 || 0x4 || Unknown counter.
|-
|-
| 1 || OptimizedForWlan
| 0x4 || 0x4 || Unknown counter.
|-
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
|-
| 0xC || 0x14 || Always zero.
|}
|}


= TvPowerStateMatchingMode =
= ApplicationLicenseType =
This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
This is "nn::oe::ApplicationLicenseType". This is 1-byte.


{| class="wikitable" border="1"
= LaunchRequiredVersion =
|-
This is "nn::oe::LaunchRequiredVersion". This is a 0x40-byte struct with 1-byte alignment.
! Value
! Description
|-
| 0 || Unknown
|-
| 1 || Unknown
|}


= SystemButtonType =
= ServerEnvironmentType =
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
This is "nn::oe::ServerEnvironmentType".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 4,452: Line 4,668:
! Description
! Description
|-
|-
| 1 || PerformHomeButtonShortPressing
| 0 || dd
|-
|-
| 2 || PerformHomeButtonLongPressing
| 1 || lp
|-
|-
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
| 2 || sd
|-
|-
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
| 3 || sp
|-
|-
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].
| 4 || dp
|-
| 6 || PerformCaptureButtonShortPressing
|-
| 7 || PerformCaptureButtonLongPressing
|}
 
= LaunchParameterKind =
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 1 || UserChannel. Application-specific LaunchParameter.
|-
| 2 || account PreselectedUser
|-
| 3 || Unknown if used by anything?
|}
 
= LibraryAppletExitReason =
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Normal
|-
| 1 || Canceled
|-
| 2 || Abnormal
|-
| 10 || Unexpected
|}
 
= ProgramSpecifyKind =
This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || u8 ProgramIndex. "ExecuteProgram". [[NS_Services|NS]] handles ProgramIndex by launching ApplicationId+ProgramIndex. After using [[#ExecuteProgram]] with this successfully, official user-processes will enter an infinite loop with sleep-thread value 86400000000000.
|-
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
|-
| 2 || u64 = value 0. "RestartProgram"
|}
 
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 =
This is u32 enum "nn::applet::InputDetectionPolicy".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Unknown
|-
| 1 || Unknown
|}
 
= AppletResourceUserId =
This is "nn::applet::AppletResourceUserId". Used by a number of non-AM services.
 
= AppletAttribute =
This is "nn::am::AppletAttribute". This struct is 0x80 bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
|-
| 0x1 || 0x7F || Unused
|}
 
This is used by [[#OpenLibraryAppletProxy]].
 
= AppletProcessLaunchReason =
This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].
|-
| 0x1 || 0x2 || Always 0.
|-
| 0x3 || 0x1 || Always 0.
|}
 
= LibraryAppletInfo =
This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#AppletId]]
|-
| 0x4 || 0x4 || [[#LibraryAppletMode]]
|}
 
= AppletKind =
This is "nn::am::service::AppletKind". This is 8-bytes.
 
= AppletIdentityInfo =
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#AppletId]]
|-
| 0x4 || 0x4 || Padding
|-
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|}
|}


= 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 || 0x2 || Width
|-
|-
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
| 0xA || 0x2 || Height
|}
 
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
| 0xC || 0x4 || BlockCount
|-
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
| 0x10 || 0x8 ||  
|-
|-
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
| 0x18 || 0x8 ||  
|-
|-
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
| 0x20 || 0x8 ||  
|-
| 0xC || 0x14 || Unused. Default is 0.
|}
|}


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.
|-
|-
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
| 0x10 || 0x8 ||  
|-
|-
| 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
|}
|}