Applet Manager services: Difference between revisions

No edit summary
 
(17 intermediate revisions by 3 users not shown)
Line 1,247: Line 1,247:
|-
|-
| 320 || [20.0.0+]
| 320 || [20.0.0+]
|-
| 330 || [20.2.0+]
|-
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]
Line 1,515: 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 ====
==== CreateMovieWriter ====
Line 1,520: Line 1,527:


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 ====
No input, returns 1-byte of output.
On NX this just writes 0 to output and returns 0.


==== StartContinuousRecordingFlushForDebug ====
==== StartContinuousRecordingFlushForDebug ====
Line 2,217: Line 2,229:
|-
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
| 2000 || [S2] [[#GetGraphicsInterface]]
|-
| 2100 || [S2]
|}
|}


Line 2,447: 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 3,081: Line 3,102:
{| 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 cmd14.
| 1 || GetOperationModeChangeEvent
|-
|-
| 111 || ||
| 2 || EnableAudioVisual
|-
|-
| 112 || ||
| 3 || DisableAudioVisual
|-
|-
| 114 || ||
| 4 || EnterSleepAndWait
|-
|-
| 115 || ||
| 5 || GetCradleStatus
|-
|-
| 187 || ||
| 6 || FadeInDisplay
|-
|-
| 201 || ||
| 7 || FadeOutDisplay
|-
|-
| 301 || ||
| 8 || [2.0.0+] GetCradleFwVersion
|-
|-
| 327 || ||
| 9 || [2.0.0+] NotifyCecSettingsChanged
|-
|-
| 303 || ||
| 10 || [3.0.0+] SetOperationModePolicy
|-
|-
| 311 || ||
| 11 || [3.0.0+] GetDefaultDisplayResolution
|-
|-
| 312 || ||
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
|-
|-
| 314 || ||
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
|-
|-
| 315 || ||
| 14 || [3.0.0+] ShouldSleepOnBoot
|-
|-
| 321 || ||
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
|-
|-
| 391 || ||
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
|-
|-
| 401 || ||
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
|-
|-
| 402 || ||
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
|-
|-
| 423 || ||
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
|-
|-
| 434 || ||
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
|-
|-
| 497 || ||
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
|-
|-
| 901 || ||
| 22 || [4.0.0+] GetHdcpStateChangeEvent
|-
|-
| 902 || ||
| 23 || [4.0.0+] GetHdcpState
|-
|-
| 903 || ||
| 24 || [5.0.0+] ShowCardUpdateProcessing
|-
|-
| 905 || ||
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
|-
|-
| 911 || ||
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
|-
|-
| 912 || ||
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
|-
|-
| 922 || ||
| 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"
|-
|-
| 961 || ||
! Cmd || Name
|-
|-
| 991 || ||
| 0 || Start
|-
|-
| 1001 || ||
| 1 || Finish
|-
|-
| 1002 || ||
| 2 || GetUpdateDeviceStatus
|-
|-
| 1003 || ||
| 3 || GetUpdateProgress
|-
|-
| 1101 || ||
| 4 || GetUpdateDeviceStatusChangeEvent
|-
|-
| 1102 || ||
| 5 || GetUpdateProgress2
|-
| 1401 || InitializeNvdrv2WithTransferMemory || Takes a TransferMemory handle, and u64 size. Returns an [[#INvDrv2User]].
|-
| 1402 || InitializeNvdrv2 || Returns an [[#INvDrv2User]].
|-
| 1501 || ||
|-
| 1502 || ||
|-
| 1601 || ||
|-
| 1602 || ||
|-
| 1603 || ||
|-
| 1611 || ||
|-
| 1612 || ||
|-
| 1691 || ||
|}
|}


== (Switch 2) INvDrv2User ==
= spsm =
This is "nn::nvdrv::INvDrv2User".
This is "nn::spsm::detail::IPowerStateInterface".
 
= idle:sys =
This is "nn::idle::detail::IPolicyManagerSystem"


This was moved to [[OMM_services|omm]] with [14.0.0+].
This was moved to [[OMM_services|omm]] with [14.0.0+].
Line 3,249: Line 3,251:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetAutoPowerDownEvent
| 0 || GetCurrentState
|-
|-
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
| 1 || EnterSleep
|-
|-
| 2 || [1.0.0-3.0.2]
| 2 || GetLastWakeReason
|-
|-
| 3 || [[#SetHandlingContext]]
| 3 || Shutdown
|-
|-
| 4 || LoadAndApplySettings
| 4 || GetNotificationMessageEventHandle
|-
|-
| 5 || ReportUserIsActive
| 5 || ReceiveNotificationMessage
|-
| 6 || AnalyzeLogForLastSleepWakeSequence
|-
| 7 || ResetEventLog
|-
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
|-
| 9 || ChangeHomeButtonLongPressingTime
|-
| 10 || PutErrorState
|-
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
|}
|}


== SetHandlingContext ==
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
[3.0.0+] Now takes an additional 0x10-bytes of input.


[13.0.0+] Total input size is now 0x30 instead of 0x38.
= tcap =
This is "nn::tcap::server::IManager".


= omm =
This was removed with [11.0.0+].
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,279: Line 3,287:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetOperationMode
| 0 || GetContinuousHighSkinTemperatureEvent
|-
|-
| 1 || GetOperationModeChangeEvent
| 1 || SetOperationMode
|-
|-
| 2 || EnableAudioVisual
| 2 || LoadAndApplySettings
|}
 
= caps:su =
This is "nn::capsrv::sf::IScreenShotApplicationService".
 
This was added with [6.0.0+].
 
This can be used by applications to save screenshots.
 
{| class="wikitable" border="1"
|-
|-
| 3 || DisableAudioVisual
! Cmd || Name
|-
|-
| 4 || EnterSleepAndWait
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
|-
|-
| 5 || GetCradleStatus
| 201 || [[#SaveScreenShot]]
|-
|-
| 6 || FadeInDisplay
| 203 || [[#SaveScreenShotEx0]]
|-
|-
| 7 || FadeOutDisplay
| 205 || [8.0.0+] [[#SaveScreenShotEx1]]
|-
|-
| 8 || [2.0.0+] GetCradleFwVersion
| 210 || [[#SaveScreenShotEx2]]
|-
|}
| 9 || [2.0.0+] NotifyCecSettingsChanged
 
|-
== SetShimLibraryVersion ==
| 10 || [3.0.0+] SetOperationModePolicy
Takes a total of 0x10-bytes of input and a PID, no output.
|-
 
| 11 || [3.0.0+] GetDefaultDisplayResolution
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"
|-
|-
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent
! Cmd || Name
|-
|-
| 13 || [3.0.0+] UpdateDefaultDisplayResolution
| 0 || [[#OpenSession]]
|-
|-
| 14 || [3.0.0+] ShouldSleepOnBoot
| 1 || GetPerformanceMode
|-
|-
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
|-
|}
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished
 
== OpenSession ==
Returns an [[#ISession]].
 
== IsCpuOverclockEnabled ==
No input, returns an output u8 bool.
 
== ISession ==
This is "nn::am::service::IApmSession".
 
{| class="wikitable" border="1"
|-
|-
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted
! Cmd || Name
|-
|-
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished
| 0 || SetPerformanceConfiguration
|-
|-
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent
| 1 || GetPerformanceConfiguration
|-
|-
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled
| 2 || [8.0.0+] SetCpuOverclockEnabled
|}
 
= (S2) adraw:a =
This is "nn::appletdraw::sfif::IAppletRoot". This is exclusive to S2.
 
{| class="wikitable" border="1"
|-
|-
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation
! Cmd || Name
|-
|-
| 22 || [4.0.0+] GetHdcpStateChangeEvent
| 1 || [[#OpenResourceSession]]
|-
|-
| 23 || [4.0.0+] GetHdcpState
| 2 || [[#OpenAppletSession]]
|-
|}
| 24 || [5.0.0+] ShowCardUpdateProcessing
 
== OpenResourceSession ==
Unofficial name.  
 
Takes a PID and an u64. Returns a [[#IResourceSession]].
 
== OpenAppletSession ==
Unofficial name. This is exclusive to S2.
 
Takes a PID and an u64. Returns a [[#IAppletSession]].
 
== IResourceSession ==
This is "nn::appletdraw::sfif::IResourceSession".
 
{| class="wikitable" border="1"
|-
|-
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged
! Cmd || Name
|-
| 1 ||
|-
| 10 || 
|-
| 11 || 
|}
 
=== Cmd1 ===
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"
|-
! Cmd || Name
|-
| 1 ||
|-
| 2 || 
|-
| 3 || 
|-
| 10 || 
|-
| 11 || 
|-
| 12 || 
|-
| 13 || 
|-
| 15 || 
|-
| 16 || 
|-
| 17 || 
|-
|-
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]
| 18 ||
|-
|-
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
| 19 || 
|-
|-
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]
| 21 || 
|}
|-
| 22 || 
|-
| 23 || 
|-
| 24 || 
|-
| 31 || 
|-
| 8001 || 
|-
| 8004 || 
|}
 
=== 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
|-
| 1 || [[#InitializeGraphicsWithTransferMemory]]
|-
| 4 || [[#InitializeGraphics]]  
|-
| 11 || [[#SetCurrentProcessHandle]]
|-
| 12 ||
|-
| 101 || [[#StartGraphics]]
|-
| 111 ||
|-
| 112 ||
|-
| 114 ||
|-
| 115 ||
|-
| 187 ||
|-
| 201 ||
|-
| 301 ||
|-
| 303 ||
|-
| 311 ||
|-
| 312 ||
|-
| 314 ||
|-
| 315 ||
|-
| 321 ||
|-
| 327 ||
|-
| 391 ||
|-
| 401 || [[#PrepareGpuManagerSession]]
|-
| 402 || [[#StartGpuManagerSession]]
|-
| 423 ||
|-
| 434 ||
|-
| 494 ||
|-
| 496 || [[#CreateGpuManagerSessionWithTransferMemory]]
|-
| 497 || [[#CreateGpuManagerSession]]
|-
| 901 ||
|-
| 902 ||
|-
| 903 ||
|-
| 905 ||
|-
| 911 ||
|-
| 912 ||
|-
| 922 ||
|-
| 961 ||
|-
| 991 ||
|-
| 1001 ||
|-
| 1002 ||
|-
| 1003 ||
|-
| 1101 ||
|-
| 1102 ||
|-
| 1401 || [[#CreateNvDrv2UserSessionWithTransferMemory]]
|-
| 1402 || [[#CreateNvDrv2UserSession]]
|-
| 1411 || [[#GetNvDrv2UserTransferMemoryUsage]]
|-
| 1501 || 
|-
| 1502 ||
|-
| 1601 ||
|-
| 1602 ||
|-
| 1603 ||
|-
| 1611 ||
|-
| 1612 ||
|-
| 1691 ||
|}
 
== InitializeGraphicsWithTransferMemory ==
Unofficial name.
 
Takes a TransferMemory handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and an input u64 '''TransferMemorySize'''. No output.
 
== InitializeGraphics ==
Unofficial name.
 
Takes a Process handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and five input u64s. No output.
 
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.
 
== 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
|-
| 11 || [[#GetEventIdRange]]
|-
| 12 || [[#CreateEvent]]
|-
| 21 || [[#RequestGpuSession]]
|-
| 22 || [[#GetGpuSession]]
|-
| 33 ||
|-
| 41 ||
|-
| 42 ||
|-
| 102 ||
|-
| 200 ||
|-
| 201 ||
|-
| 202 ||
|}
 
=== GetEventIdRange ===
Unofficial name.
 
No input. Returns two u32s '''EventIdMin''' and '''EventIdMax'''.
 
=== CreateEvent ===
Unofficial name.


== GetOperationModeSystemInfo ==
Takes an input u32 '''EventId'''. Returns an output Event handle.
No input, returns an output u32.


This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
=== RequestGpuSession ===
Unofficial name.


== CreateCradleFirmwareUpdater ==
Takes an input u32 '''EventId'''. No output.
No input. Returns an [[#ICradleFirmwareUpdater]].


== ICradleFirmwareUpdater ==
'''EventId''' must have been previously passed to [[#CreateEvent]] and the returned Event handle will be signalled when the session is ready.
This is "nn::am::service::ICradleFirmwareUpdater".


This was added with [12.0.0+].
=== GetGpuSession ===
Unofficial name.


{| class="wikitable" border="1"
No input. Returns a [[#GpuSession]].
|-
! Cmd || Name
|-
| 0 || Start
|-
| 1 || Finish
|-
| 2 || GetUpdateDeviceStatus
|-
| 3 || GetUpdateProgress
|-
| 4 || GetUpdateDeviceStatusChangeEvent
|-
| 5 || GetUpdateProgress2
|}


= spsm =
Called after [[#RequestGpuSession]] and the Event handle has been signalled.
This is "nn::spsm::detail::IPowerStateInterface".


This was moved to [[OMM_services|omm]] with [14.0.0+].
=== GpuSession ===
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,377: Line 3,843:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetCurrentState
| 101 || [[#CreateGpuMemory]]
|-
| 1 || EnterSleep
|-
|-
| 2 || GetLastWakeReason
| 102 || [[#DestroyGpuMemory]]
|-
|-
| 3 || Shutdown
| 201 || [19.0.0-19.1.0] MapMemory
|-
|-
| 4 || GetNotificationMessageEventHandle
| 202 || [19.0.0-19.1.0] UnmapMemory
|-
|-
| 5 || ReceiveNotificationMessage
| 203 || [19.0.0-19.1.0] AllocateAddressSpace
|-
|-
| 6 || AnalyzeLogForLastSleepWakeSequence
| 204 || [19.0.0-19.1.0] FreeAddressSpace
|-
| 7 || ResetEventLog
|-
|-
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence
| 205 || [19.0.0-19.1.0] RemapMemory
|-
|-
| 9 || ChangeHomeButtonLongPressingTime
| 207 || [19.0.0-19.1.0] ModifyMemoryMapping
|-
| 10 || PutErrorState
|-
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing
|}
 
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.
 
= tcap =
This is "nn::tcap::server::IManager".
 
This was removed with [11.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || GetContinuousHighSkinTemperatureEvent
|-
| 1 || SetOperationMode
|-
| 2 || LoadAndApplySettings
|}
 
= caps:su =
This is "nn::capsrv::sf::IScreenShotApplicationService".
 
This was added with [6.0.0+].
 
This can be used by applications to save screenshots.
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 211 || [20.1.1+] MapMemoryV2
|-
|-
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
| 212 || [20.1.1+] ModifyMemoryMappingV2
|-
|-
| 201 || [[#SaveScreenShot]]
| 213 || [20.1.1+] UnmapMemoryV2
|-
|-
| 203 || [[#SaveScreenShotEx0]]
| 214 || [20.1.1+] AllocateAddressSpaceV2
|-
|-
| 205 || [8.0.0+] [[#SaveScreenShotEx1]]
| 215 || [20.1.1+] FreeAddressSpaceV2
|-
|-
| 210 || [[#SaveScreenShotEx2]]
| 216 || [20.1.1+] RemapMemoryV2
|}
|}


== SetShimLibraryVersion ==
==== CreateGpuMemory ====
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.
 
== 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 =
Takes two input u64s '''MemoryAddressStart''' and '''MemoryAddressEnd''' and two u8s. Returns an output u32 '''GpuMemoryHandle'''.
This is "nn::am::service::IApmManager".


This was added with [8.0.0+].
The memory region between '''MemoryAddressStart''' and '''MemoryAddressEnd''' must have been passed to [[#SVC|SVC]] 0x80 with attribute 0x20.


{| class="wikitable" border="1"
==== DestroyGpuMemory ====
|-
Unofficial name.
! Cmd || Name
|-
| 0 || [[#OpenSession]]
|-
| 1 || GetPerformanceMode
|-
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
|}


== OpenSession ==
Takes two input u32s '''GpuMemoryHandle''' and '''EventId'''. No output.
Returns an [[#ISession]].


== IsCpuOverclockEnabled ==
The Event handle associated with '''EventId''' will be signalled when the memory is released.
No input, returns an output u8 bool.
 
== ISession ==
This is "nn::am::service::IApmSession".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || SetPerformanceConfiguration
|-
| 1 || GetPerformanceConfiguration
|-
| 2 || [8.0.0+] SetCpuOverclockEnabled
|}


= Library Applets =
= Library Applets =
Line 3,614: Line 4,001:
| 0x17
| 0x17
| 010000000000100F
| 010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
|-
| 0x18
| 0x18
Line 3,662: Line 4,049:
| 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