Applet Manager services: Difference between revisions

No edit summary
 
(29 intermediate revisions by 3 users not shown)
Line 11: Line 11:
|-
|-
| 100 || OpenSystemAppletProxy || Returns an [[#ISystemAppletProxy]].
| 100 || OpenSystemAppletProxy || Returns an [[#ISystemAppletProxy]].
|-
| 110 || [20.0.0+] ||
|-
|-
| 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 24: Line 26:
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
|-
|-
| 450 || [19.0.0+] ||  
| 450 || [19.0.0+] [[#GetSystemProcessCommonFunctions]] ||
|-
| 460 || [20.0.0+] ||
|-
|-
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
Line 60: Line 64:


The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, and various state checks must pass, otherwise 0 is returned with no output interface.
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, and various state checks must pass, otherwise 0 is returned with no output interface.
== GetSystemProcessCommonFunctions ==
No input. Returns an [[#ISystemProcessCommonFunctions]].


== GetDebugFunctions ==
== GetDebugFunctions ==
Line 447: Line 454:
|-
|-
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||
|-
| 300 || [20.0.0+] ||
|-
| 301 || [20.0.0+] ||
|}
|}


Line 612: Line 623:
| 81 || [14.0.0+] SetHandlingCaptureButtonLongPressedMessageEnabledForApplet
| 81 || [14.0.0+] SetHandlingCaptureButtonLongPressedMessageEnabledForApplet
|-
|-
| 82 || [18.0.0+]  
| 82 || [18.0.0+] SetBlockingCaptureButtonInEntireSystem
|-
|-
| 90 || [15.0.0+] OpenNamedChannelAsParent
| 90 || [15.0.0+] OpenNamedChannelAsParent
Line 620: Line 631:
| 100 || [15.0.0+] SetApplicationCoreUsageMode
| 100 || [15.0.0+] SetApplicationCoreUsageMode
|-
|-
| 160 || [18.0.0+]  
| 160 || [18.0.0+] GetNotificationReceiverService
|-
| 161 || [18.0.0+] GetNotificationSenderService
|-
|-
| 161 || [18.0.0+]  
| 300 || [17.0.0+] GetCurrentApplicationId
|-
|-
| 300 || [17.0.0+]  
| 310 || [19.0.0+] IsSystemAppletHomeMenu
|-
|-
| 310 || [19.0.0+]  
| 311 || [20.0.0+]
|-
|-
| 320 || [19.0.0+]  
| 320 || [19.0.0+] SetGpuTimeSliceBoost
|-
|-
| 321 || [19.0.0+]  
| 321 || [19.0.0+] SetGpuTimeSliceBoostDueToApplication
|-
| 322 || [20.0.0+]
|-
|-
| 330 || [19.0.0+]  
| 330 || [19.0.0+]  
|-
| 340 || [20.0.0+]
|-
| 341 || [20.0.0+]
|-
| 342 || [20.0.0+]
|-
| 350 || [20.0.0+]
|-
| 360 || [20.0.0+]
|}
|}


Line 787: Line 812:
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
|-
|-
| 160 || [17.0.0+] [[#Cmd160]] ||  
| 160 || [17.0.0+] [[#GetLibraryAppletInfoEx]] ||  
|}
|}


Line 921: Line 946:
No input, returns an output u8 bool.
No input, returns an output u8 bool.


==== Cmd160 ====
==== GetLibraryAppletInfoEx ====
No input, returns an output u64. Currently always returns 0.
No input, returns an output u64. Currently always returns 0.


Line 987: Line 1,012:
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
|-
|-
| 40 || [18.0.0+]  
| 40 || [18.0.0+] GetApplicationNintendoLogo
|-
|-
| 41 || [18.0.0+]  
| 41 || [18.0.0+] GetApplicationStartupMovie
|-
|-
| 50 || [19.0.0+]  
| 50 || [19.0.0+] SetGpuTimeSliceBoostForApplication
|-
|-
| 60 || [19.0.0+]  
| 60 || [19.0.0+]  
Line 1,174: Line 1,199:
|-
|-
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
|-
| 112 || [20.0.0+]
|-
| 113 || [20.0.0+]
|-
|-
| 120 || [5.0.0+] [[#ExecuteProgram]]
| 120 || [5.0.0+] [[#ExecuteProgram]]
Line 1,209: Line 1,238:
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
|-
|-
| 300 || [19.0.0+]  
| 210 || [20.0.0+]
|-
| 220 || [20.0.0+]
|-
| 300 || [19.0.0+] [[#CreateMovieWriter]]
|-
| 310 || [20.0.0+]
|-
| 320 || [20.0.0+]
|-
| 330 || [20.2.0+]
|-
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
Line 1,478: Line 1,517:
==== GetLastApplicationExitReason ====
==== GetLastApplicationExitReason ====
No input, returns an output s32.
No input, returns an output s32.
==== Cmd220 ====
Takes an input u8, no output.
The input must be <=1.
==== CreateMovieWriter ====
Takes 8-bytes of input and a handle. Returns an [[#IMovieWriter]].
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 ====
No input, returns 1-byte of output.
On NX this just writes 0 to output and returns 0.


==== StartContinuousRecordingFlushForDebug ====
==== StartContinuousRecordingFlushForDebug ====
Line 1,504: Line 1,558:


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.
=== IMovieWriter ===
This is "nn::am::service::IMovieWriter".
This was added with [19.0.0+].
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|}
==== Cmd0 ====
No input. Returns a GRC [[GRC_services|IMovieWriter]].


=== IMovieMaker ===
=== IMovieMaker ===
Line 1,535: Line 1,604:
|-
|-
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
| 3 || [20.0.0+] ||
|-
|-
| 10 || [[#CreateStorage]] ||  
| 10 || [[#CreateStorage]] ||  
Line 1,600: Line 1,671:
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
|-
|-
| 80 || [19.0.0+] ||
| 80 || [19.0.0+] RequestForLibraryAppletToGetForeground ||
|-
|-
| 81 || [19.0.0+] ||
| 81 || [19.0.0+] GetCurrentChildLibraryApplet ||
|-
| 90 || [20.0.0+] ||
|-
|-
| 100 || [[#PushInData]] ||  
| 100 || [[#PushInData]] ||  
Line 1,784: Line 1,857:
| 503 || [12.0.0+] IsDisablingSleepSuppressed
| 503 || [12.0.0+] IsDisablingSleepSuppressed
|-
|-
| 600 || [17.0.0-18.1.0] OpenNamedChannelAsChild
| 600 || [20.0.0+] ([17.0.0-18.1.0] OpenNamedChannelAsChild)
|-
|-
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
Line 1,790: Line 1,863:
| 910 || [17.0.0+] GetLaunchRequiredTick
| 910 || [17.0.0+] GetLaunchRequiredTick
|-
|-
| 1000 || [19.0.0+]  
| 1000 || [19.0.0+] BeginVrMode3d
|-
|-
| 1001 || [19.0.0+]  
| 1001 || [19.0.0+] EndVrMode3d
|-
|-
| 1002 || [19.0.0+]  
| 1002 || [19.0.0+] IsVrModeEnabled3d
|}
|}


Line 2,079: Line 2,152:
| 21 || [13.0.0+] GetScreenShotProgramId
| 21 || [13.0.0+] GetScreenShotProgramId
|-
|-
| 22 || [19.0.0+]  
| 22 || [19.0.0+] GetScreenShotAcdIndex
|-
|-
| 23 || [19.0.0+]  
| 23 || [19.0.0+] GetScreenShotApparentPlatform
|-
|-
| 24 || [19.0.0+]  
| 24 || [19.0.0+] GetScreenShotApplicationProperty
|-
|-
| 40 || [[#CreateManagedDisplayLayer]]
| 40 || [[#CreateManagedDisplayLayer]]
Line 2,143: Line 2,216:
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
|-
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
| 200 || [20.0.0+]
|-
| 210 || [20.0.0+]
|-
| 211 || [20.0.0+]
|-
| 220 || [20.0.0+]
|-
| 221 || [20.0.0+]
|-
| 230 || [20.0.0+]
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
| 2000 || [S2] [[#GetGraphicsInterface]]
|-
| 2100 || [S2]
|}
|}


Line 2,374: Line 2,463:


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 ===
Unofficial name. This is exclusive to S2.
No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]].


== IStorageChannel ==
== IStorageChannel ==
Line 2,469: Line 2,563:
|-
|-
| 4 || [[#SetTransparentVolumeRate]]
| 4 || [[#SetTransparentVolumeRate]]
|-
| 5 || [20.0.0+]
|}
|}


Line 2,770: Line 2,866:
=== ReserveToStartAndWait ===
=== ReserveToStartAndWait ===
Takes an input [[#ILibraryAppletAccessor]], no output.
Takes an input [[#ILibraryAppletAccessor]], no output.
== ISystemProcessCommonFunctions ==
This is "nn::am::service::ISystemProcessCommonFunctions".
This was added with [19.0.0+].
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|}
=== Cmd0 ===
No input. Returns an [[#IApplicationObserver]].
=== IApplicationObserver ===
This is "nn::am::service::IApplicationObserver".
This was added with [19.0.0+].
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 1 ||
|-
| 2 ||
|-
| 10 ||
|-
| 20 ||
|-
| 30 ||
|}


== IDebugFunctions ==
== IDebugFunctions ==
Line 2,788: Line 2,919:
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
|-
|-
| 31 || [12.0.0+] RequestLaunchApplicationByApplicationLaunchInfoForDebug
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
|-
|-
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
Line 2,798: Line 2,929:
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
|-
|-
| 53 || [18.0.0+]  
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
|-
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
Line 2,826: Line 2,957:
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
|-
|-
| 410 || [18.0.0+]  
| 410 || [18.0.0+] CreateGeneralStorageForDebug
|-
|-
| 411 || [18.0.0+]  
| 411 || [18.0.0+] ReadGeneralStorageForDebug
|-
|-
| 412 || [18.0.0+]  
| 412 || [18.0.0+] WriteGeneralStorageForDebug
|-
| 430 || [20.0.0+]
|-
| 431 || [20.0.0+]
|-
|-
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
|-
| 910 || [20.0.0+]
|}
|}


Line 2,855: Line 2,992:


Requests to launch the specified Application, with the specified users. When the bool flag is true, the content of the second input buffer is used to create a storage which is pushed to the UserChannel for this Application (see [[#LaunchParameterKind]]).
Requests to launch the specified Application, with the specified users. When the bool flag is true, the content of the second input buffer is used to create a storage which is pushed to the UserChannel for this Application (see [[#LaunchParameterKind]]).
=== RequestLaunchApplicationByApplicationLaunchInfoForDebug ===
Takes a total of 0x58-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.
[19.0.0+] Takes a total of 0x88-bytes of input, a type-0x5 input buffer containing an array of 0x10-byte entries, and a type-0x5 input buffer. No output.


=== GetAppletResourceUsageInfo ===
=== GetAppletResourceUsageInfo ===
Line 2,960: Line 3,102:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || [[#OpenApplicationProxy]] ||
| 0 || [[#OpenApplicationProxy]]
|}
|}


Line 2,968: Line 3,110:


== 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.
Line 3,163: Line 3,303:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
|-
|-
| 201 || SaveScreenShot ||
| 201 || [[#SaveScreenShot]]
|-
|-
| 203 || SaveScreenShotEx0 ||
| 203 || [[#SaveScreenShotEx0]]
|-
|-
| 205 || [8.0.0+] SaveScreenShotEx1 ||
| 205 || [8.0.0+] [[#SaveScreenShotEx1]]
|-
|-
| 210 || SaveScreenShotEx2 || Takes a total of 0x50-bytes of input, a type-0x15 input buffer, and a type-0x45 input buffer.  Returns a total of 0x20-bytes of output.
| 210 || [[#SaveScreenShotEx2]]
|}
|}


'''SetShimLibraryVersion''' is a wrapper for [[Capture_services|caps:c]] cmd33. Commands '''SaveScreenShot''', '''SaveScreenShotEx0''', '''SaveScreenShotEx1''' and '''SaveScreenShotEx2''' are wrappers for [[Display_services|caps:sc]] cmd210.
== SetShimLibraryVersion ==
Takes a total of 0x10-bytes of input and a PID, no output.
 
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 ==
== SaveScreenShot ==
Line 3,230: Line 3,373:
|}
|}


= Library Applets =
= (S2) adraw:a =
This section documents library applet launching.
This is "nn::appletdraw::sfif::IAppletRoot". This is exclusive to S2.
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 1 || [[#OpenResourceSession]]
|-
| 2 || [[#OpenAppletSession]]
|}


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.
== OpenResourceSession ==
Unofficial name.  


Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.
Takes a PID and an u64. Returns a [[#IResourceSession]].


== CommonArguments ==
== OpenAppletSession ==
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.
Unofficial name. This is exclusive to S2.


This struct is 0x20-bytes.
Takes a PID and an u64. Returns a [[#IAppletSession]].


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.
== IResourceSession ==
This is "nn::appletdraw::sfif::IResourceSession".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Typical Value || Notes
! Cmd || Name
|-
|-
| 0x0 || 4 || 1 || Common Arguments version
| 1 ||  
|-
| 0x4 || 4 || 0x20 || Common Arguments size
|-
| 0x8 || 4 || || Library applet version (API version)
|-
|-
| 0xC || 4 || 0 || Theme color
| 10 ||
|-
| 0x10 || 1 || 0 || Play startup sound
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
|-
|-
| 11 || 
|}
|}


= AppletId =
=== Cmd1 ===
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
Takes a u64. Returns a u64.
 
=== Cmd10 ===
Takes a handle, a u64 and an int. Returns a handle.
 
=== Cmd11 ===
No input/output.
 
== IAppletSession ==
This is "nn::appletdraw::sfif::IAppletSession".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name
! ProgramId
|-
! Description
| 1 ||
|-
|-
| 0x00
| 2 || 
|  
|-
| None
| 3 || 
|-
|-
| 0x01
| 10 || 
|  
|-
| Application (not valid for use with LibraryApplets)
| 11 || 
|-
|-
| 0x02
| 12 || 
| 010000000000100C
|-
| OverlayApplet (overlayDisp)
| 13 || 
|-
|-
| 0x03
| 15 || 
| 0100000000001000
|-
| SystemAppletMenu (qlaunch)
| 16 || 
|-
|-
| 0x04
| 17 || 
| 0100000000001012
|-
| SystemApplication (starter)
| 18 || 
|-
|-
| 0x0A
| 19 || 
| 0100000000001001
|-
| [[Auth_Applet|LibraryAppletAuth (auth)]]
| 21 || 
|-
|-
| 0x0B
| 22 || 
| 0100000000001002
|-
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
| 23 || 
|-
|-
| 0x0C
| 24 || 
| 0100000000001003
|-
| [[Controller_Applet|LibraryAppletController (controller)]]
| 31 || 
|-
|-
| 0x0D
| 8001 || 
| 0100000000001004
|-
| LibraryAppletDataErase (dataErase)
| 8004 || 
|-
|}
| 0x0E
 
| 0100000000001005
=== Cmd1 ===
Takes a u64. Returns a u64.
 
=== Cmd2 ===
Returns a handle.
 
=== Cmd3 ===
Takes a handle.
 
=== Cmd10 ===
Takes an int.
 
=== Cmd11 ===
Takes an int.
 
=== Cmd12 ===
Takes a u64. Returns an int.
 
=== Cmd13 ===
Takes an int. Returns an int.
 
=== Cmd15 ===
Takes an int. Returns an int, an int, an int.
 
=== Cmd16 ===
Returns an int.
 
=== Cmd17 ===
Takes an int. Returns an int, a u16.
 
=== Cmd18 ===
Takes an int. Returns 3x int, a u16.
 
=== Cmd19 ===
Takes an int. Returns an int, a u16.
 
=== Cmd21 ===
Takes an int. Returns a struct of size 0x40.
 
=== Cmd22 ===
Takes a struct of size 0x20. Returns a struct of size 0x40.
 
=== Cmd23 ===
Returns a struct of size 0xC8.
 
=== Cmd24 ===
Sends an ipc-buf with size 0xD8.
 
=== Cmd31 ===
Returns a struct with 0x28, a struct with size 0x10.
 
=== Cmd8001 ===
Returns a struct with 0x28, a struct with size 0x10.
 
=== Cmd8004 ===
Takes an int. Returns a u64.
 
= (S2) appletOE =
This is "nn::am::service::IApplicationProxyServiceForNxCompat".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#OpenApplicationProxy]]
|-
| 2000 || [[#OpenCompatApplicationFunctions]]
|}
 
== OpenCompatApplicationFunctions ==
No input. Returns an [[#INxCompatApplicationFunctions]].
 
== INxCompatApplicationFunctions ==
This is "nn::am::service::INxCompatApplicationFunctions".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 2000 || [[#GetGraphicsInterfaceForNxCompat]]
|-
| 2001 ||
|-
| 2002 || 
|-
| 2003 || [[#SetCopyright]]
|-
| 2004 || 
|-
| 2010 || 
|-
| 2020 || [[#Initialize]]
|-
| 2030 || [[#GetVsyncEvent]]
|-
| 2040 || [[#GetVsyncTimestamp]]
|-
| 2050 ||
|-
| 2060 ||
|-
| 2070 || [[#CreateMovieMaker]]
|}
 
=== GetGraphicsInterfaceForNxCompat ===
Unofficial name.
 
No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]].
 
Same as [[#GetGraphicsInterface]] but for compat mode.
 
=== SetCopyright ===
Unofficial name.
 
Takes an input bool. No output.
 
Called directly after "nn::vi::WriteToCopyrightFramebuffer".
 
=== Initialize ===
Unofficial name.
 
No input/output.
 
Called during init.
 
=== GetVsyncEvent ===
Unofficial name.
 
No input. Returns an Event handle.
 
=== GetVsyncTimestamp ===
Unofficial name.
 
No input. Returns an output u64.
 
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp.
 
= (S2) GraphicsInterface =
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 4 || [[#InitializeA]]
|-
| 11 || [[#InitializeB]]
|-
| 101 || [[#InitializeC]]
|-
| 111 ||
|-
| 112 ||
|-
| 114 ||
|-
| 115 ||
|-
| 187 ||
|-
| 201 ||
|-
| 301 ||
|-
| 327 ||
|-
| 303 ||
|-
| 311 ||
|-
| 312 ||
|-
| 314 ||
|-
| 315 ||
|-
| 321 ||
|-
| 391 ||
|-
| 401 ||
|-
| 402 ||
|-
| 423 ||
|-
| 434 ||
|-
| 497 ||
|-
| 901 ||
|-
| 902 ||
|-
| 903 ||
|-
| 905 ||
|-
| 911 ||
|-
| 912 ||
|-
| 922 ||
|-
| 961 ||
|-
| 991 ||
|-
| 1001 ||
|-
| 1002 ||
|-
| 1003 ||
|-
| 1101 ||
|-
| 1102 ||
|-
| 1401 || [[#InitializeNvDrv2UserWithTransferMemory]]
|-
| 1402 || [[#InitializeNvDrv2User]]
|-
| 1501 ||
|-
| 1502 ||
|-
| 1601 ||
|-
| 1602 ||
|-
| 1603 ||
|-
| 1611 ||
|-
| 1612 ||
|-
| 1691 ||
|}
 
== InitializeA ==
Unofficial name.
 
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; }.
 
== InitializeB ==
Unofficial name.
 
Sends current process handle. No args. Sent directly after cmd4.
 
== InitializeC ==
Unofficial name.
 
Sent directly after [[#InitializeB]].
 
== InitializeNvDrv2UserWithTransferMemory ==
Unofficial name.
 
Takes a TransferMemory handle, and an input u64 '''TransferMemorySize'''. Returns an [[#INvDrv2User]].
 
== InitializeNvDrv2User ==
Unofficial name.
 
No input. Returns an [[#INvDrv2User]].
 
== INvDrv2User ==
This is "nn::nvdrv::INvDrv2User".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || Open
|-
| 1 || Ioctl
|-
| 2 || Close
|-
| 4 || QueryEvent
|-
| 9 || DumpStatus
|-
| 10 || InitializeDevtools
|-
| 11 || Ioctl2
|-
| 12 || Ioctl3
|-
| 13 || SetGraphicsFirmwareMemoryMarginEnabled
|}
 
= 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
|-
| 0x0 || 4 || 1 || Common Arguments version
|-
| 0x4 || 4 || 0x20 || Common Arguments size
|-
| 0x8 || 4 || || Library applet version (API version)
|-
| 0xC || 4 || 0 || Theme color
|-
| 0x10 || 1 || 0 || Play startup sound
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
|-
|}
 
= AppletId =
This is "nn::applet::AppletId". See also [[:Category:Library Applets]].
 
{| class="wikitable" border="1"
|-
! Value
! ProgramId
! Description
|-
| 0x00
|  
| None
|-
| 0x01
|  
| Application (not valid for use with LibraryApplets)
|-
| 0x02
| 010000000000100C
| OverlayApplet (overlayDisp)
|-
| 0x03
| 0100000000001000
| SystemAppletMenu (qlaunch)
|-
| 0x04
| 0100000000001012
| SystemApplication (starter)
|-
| 0x0A
| 0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
| 0x0B
| 0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
| 0x0C
| 0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
| 0x0D
| 0100000000001004
| LibraryAppletDataErase (dataErase)
|-
| 0x0E
| 0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
| [[Error_Applet|LibraryAppletError (error)]]
|-
|-
Line 3,345: Line 3,869:
| 0x17
| 0x17
| 010000000000100F
| 010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
|-
| 0x18
| 0x18
Line 3,393: Line 3,917:
| 0x32
| 0x32
| 010000000000100F
| 010000000000100F
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
| [17.0.0+] LibraryAppletOfflineWebApp_3 ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 0x33
| 0x33
| 010000000000100F
| 010000000000100F
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
| [17.0.0+] LibraryAppletOfflineWebSystem ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
|-
| 0x35
| 0x35
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [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
| 0x36
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [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
| 0x37
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)
| [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
| 0x38
Line 3,422: Line 3,946:
| 0100000000001007
| 0100000000001007
| [18.0.0+]
| [18.0.0+]
|-
| 0x64
| 0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
|-
|-
| 0x3E8
| 0x3E8
Line 3,546: Line 4,074:
| 010000000000D60E
| 010000000000D60E
| [17.0.0+] AppletILA2
| [17.0.0+] AppletILA2
|-
| 0x700000FA
| 010000000000D677
| [20.1.0+]
|}
|}