Applet Manager services: Difference between revisions

 
(132 intermediate revisions by 5 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+] 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 23: Line 25:
|-
|-
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] ||  
|-
| 450 || [19.0.0+] [[#GetSystemProcessCommonFunctions]] ||
|-
| 460 || [20.0.0+] || Returns an [[#IAppletAlternativeFunctions]].
|-
|-
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
| 1000 || [6.0.0+] [[#GetDebugFunctions]] ||  
Line 58: 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 65: Line 74:


== ISystemAppletProxy ==
== ISystemAppletProxy ==
This is "nn::am::service::ISystemAppletProxy".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 95: Line 106:


=== IHomeMenuFunctions ===
=== IHomeMenuFunctions ===
This is "nn::am::service::IHomeMenuFunctions".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 10 || [[#RequestToGetForeground]]
|-
| 11 || [[#LockForeground]]
|-
| 12 || [[#UnlockForeground]]
|-
| 20 || [[#PopFromGeneralChannel]]
|-
| 21 || [[#GetPopFromGeneralChannelEvent]]
|-
| 30 || [[#GetHomeButtonWriterLockAccessor]]
|-
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]]
|-
|-
| 10 || [[#RequestToGetForeground]] ||
| 40 || [11.0.0+] [[#IsSleepEnabled]]
|-
|-
| 11 || [[#LockForeground]] ||
| 41 || [12.0.0+] [[#IsRebootEnabled]]
|-
|-
| 12 || [[#UnlockForeground]] ||
| 50 || [16.0.0+] [[#LaunchSystemApplet]]
|-
|-
| 20 || [[#PopFromGeneralChannel]] ||
| 51 || [16.0.0+] [[#LaunchStarter]]
|-
|-
| 21 || [[#GetPopFromGeneralChannelEvent]] ||
| 60 || [19.0.0+]  
|-
|-
| 30 || [[#GetHomeButtonWriterLockAccessor]] ||
| 61 || [19.0.0+]  
|-
|-
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]] ||
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]]
|-
|-
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]] ||
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]]
|-
|-
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]] ||
| 200 || [8.0.0+] [[#LaunchDevMenu]]
|-
|-
| 200 || [8.0.0+] [[#LaunchDevMenu]] ||
| 1000 || [11.0.0+] [[#SetLastApplicationExitReason]]
|}
|}


Line 144: Line 171:


The input value must be 0-3. 0 = HomeButton.
The input value must be 0-3. 0 = HomeButton.
==== IsSleepEnabled ====
No input, returns an output bool.
==== IsRebootEnabled ====
No input, returns an output bool.
==== LaunchSystemApplet ====
No input/output.
This wraps [[NS_Services|ns]] LaunchSystemApplet, ignoring the u64 returned by that cmd (and other functionality).
==== LaunchStarter ====
No input/output.
This is similar to [[#LaunchSystemApplet]], except this uses [[NS_Services|ns]] LaunchLibraryApplet with a ProgramId from global state.
The global state field is initialized elsewhere with the value of [[System_Settings|system-setting]] <code>am.debug!starter_id</code>, defaulting to ProgramId 0100000000001012 ([[Title_list|starter]]) if not available.


==== PopRequestLaunchApplicationForDebug ====
==== PopRequestLaunchApplicationForDebug ====
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u64 titleID (<code>nn::ncm::ApplicationId</code>) and an output s32 '''total_userIDs'''.
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output [[NCM_services#ApplicationId|ApplicationId]] and an output s32 '''total_userIDs'''.


The total entries in the userID buffer must be >= {total userIDs in state}.
The total entries in the userID buffer must be >= {total userIDs in state}.
Line 160: Line 205:
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.


Uses [[NS_Services#IApplicationManagerInterface]] cmd99.
Uses [[NS_Services|ns]] LaunchDevMenu.


This is used by [[qlaunch]]. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
This is used by [[qlaunch]]. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
==== SetLastApplicationExitReason ====
Takes an input s32, no output.


==== ILockAccessor ====
==== ILockAccessor ====
This is "nn::am::service::ILockAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 174: Line 224:
|-
|-
| 3 || [[#GetEvent]]
| 3 || [[#GetEvent]]
|-
| 4 || [10.0.0+] [[#IsLocked]]
|}
|}


Line 188: Line 240:
===== GetEvent =====
===== GetEvent =====
No input, returns an output Event handle with autoclear=false.
No input, returns an output Event handle with autoclear=false.
==== IsLocked ====
No input, returns an output u8 bool.


=== IGlobalStateController ===
=== IGlobalStateController ===
This is "nn::am::service::IGlobalStateController".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [[#RequestToEnterSleep]]
|-
|-
| 0 || [[#RequestToEnterSleep]] ||
| 1 || [[#EnterSleep]]
|-
|-
| 1 || [[#EnterSleep]] ||
| 2 || [[#StartSleepSequence]]
|-
|-
| 2 || [[#StartSleepSequence]] ||
| 3 || [[#StartShutdownSequence]]
|-
|-
| 3 || [[#StartShutdownSequence]] ||
| 4 || [[#StartRebootSequence]]
|-
|-
| 4 || [[#StartRebootSequence]] ||
| 9 || [7.0.0+] [[#IsAutoPowerDownRequested]]
|-
|-
| 9 || [7.0.0+] [[#IsAutoPowerDownRequested]] ||
| 10 || [[#LoadAndApplyIdlePolicySettings]]
|-
|-
| 10 || [[#LoadAndApplyIdlePolicySettings]] ||
| 11 || [2.0.0+] [[#NotifyCecSettingsChanged]]
|-
|-
| 11 || [2.0.0+] [[#NotifyCecSettingsChanged]] ||
| 12 || [3.0.0+] [[#SetDefaultHomeButtonLongPressTime]]
|-
|-
| 12 || [3.0.0+] [[#SetDefaultHomeButtonLongPressTime]] ||
| 13 || [3.0.0+] [[#UpdateDefaultDisplayResolution]]
|-
|-
| 13 || [3.0.0+] [[#UpdateDefaultDisplayResolution]] ||
| 14 || [3.0.0+] [[#ShouldSleepOnBoot]]
|-
|-
| 14 || [3.0.0+] [[#ShouldSleepOnBoot]] ||
| 15 || [4.0.0+] [[#GetHdcpAuthenticationFailedEvent]]
|-
|-
| 15 || [4.0.0+] [[#GetHdcpAuthenticationFailedEvent]] ||
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]
|}
|}


Line 273: Line 332:
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.


=== IApplicationCreator ===
==== OpenCradleFirmwareUpdater ====
No input, returns an [[#ICradleFirmwareUpdater]].
 
=== ICradleFirmwareUpdater ===
This is "nn::am::service::ICradleFirmwareUpdater".
 
This was added with [12.0.0+].
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || StartUpdate
|-
| 1 || FinishUpdate
|-
| 2 || [[#GetCradleDeviceInfo]]
|-
| 3 || GetCradleDeviceInfoChangeEvent
|-
| 4 || GetUpdateProgressInfo
|-
| 5 || GetLastInternalResult
|}
 
==== GetCradleDeviceInfo ====
No input, returns a 8-byte CradleDeviceInfo.
 
[13.0.0+] Now returns a total of 0xC-bytes.
 
=== IApplicationCreator ===
This is "nn::am::service::IApplicationCreator".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
|-
| 0 || [[#CreateApplication]] ||
| 0 || [[#CreateApplication]]
|-
|-
| 1 || [[#PopLaunchRequestedApplication]] ||
| 1 || [[#PopLaunchRequestedApplication]]
|-
|-
| 10 || [[#CreateSystemApplication]] ||
| 10 || [[#CreateSystemApplication]]
|-
|-
| 100 || [[#PopFloatingApplicationForDevelopment]] ||
| 100 || [[#PopFloatingApplicationForDevelopment]]
|}
|}


Line 290: Line 381:


==== CreateApplication ====
==== CreateApplication ====
Takes an input u64 titleID (<code>nn::ncm::ApplicationId</code>), returns an [[#IApplicationAccessor]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IApplicationAccessor]].


==== PopLaunchRequestedApplication ====
==== PopLaunchRequestedApplication ====
Line 296: Line 387:


==== CreateSystemApplication ====
==== CreateSystemApplication ====
Takes an input u64 titleID (<code>nn::ncm::SystemApplicationId</code>), returns an [[#IApplicationAccessor]].
Takes an input [[NCM_services#ApplicationId|SystemApplicationId]], returns an [[#IApplicationAccessor]].


[[qlaunch]] only uses this with a hard-coded titleID for the "starter" title.
[[qlaunch]] only uses this with a hard-coded id for the "starter" title.


==== PopFloatingApplicationForDevelopment ====
==== PopFloatingApplicationForDevelopment ====
Line 306: Line 397:


==== IApplicationAccessor ====
==== IApplicationAccessor ====
This is "nn::am::service::IApplicationAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [[#GetAppletStateChangedEvent]]
|-
| 1 || [[#IsCompleted]]
|-
| 10 || [[#Start]]
|-
| 20 || [[#RequestExit]]
|-
| 25 || [[#Terminate]]
|-
|-
| 0 || [[#GetAppletStateChangedEvent]] ||
| 30 || [[#GetResult]]
|-
|-
| 1 || [[#IsCompleted]] ||
| 101 || [[#RequestForApplicationToGetForeground]]  
|-
|-
| 10 || [[#Start]] ||
| 110 || [[#TerminateAllLibraryApplets]]
|-
|-
| 20 || [[#RequestExit]] ||
| 111 || [[#AreAnyLibraryAppletsLeft]]  
|-
|-
| 25 || [[#Terminate]] ||
| 112 || [[#GetCurrentLibraryApplet]]  
|-
|-
| 30 || [[#GetResult]] ||
| 120 || [[#GetApplicationId]]
|-
|-
| 101 || [[#RequestForApplicationToGetForeground]] ||
| 121 || [[#PushLaunchParameter]]  
|-
|-
| 110 || [[#TerminateAllLibraryApplets]] ||
| 122 || [[#GetApplicationControlProperty]]  
|-
|-
| 111 || [[#AreAnyLibraryAppletsLeft]] ||
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]]  
|-
|-
| 112 || [[#GetCurrentLibraryApplet]] ||
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]]  
|-
|-
| 120 || [[#GetApplicationId]] ||
| 130 || [6.0.0+] [[#SetUsers]]
|-
|-
| 121 || [[#PushLaunchParameter]] ||
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]]
|-
|-
| 122 || [[#GetApplicationControlProperty]] ||
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]]  
|-
|-
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]] ||
| 140 || [6.0.0+] [[#GetDesirableUids]]
|-
|-
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]] ||
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]]  
|-
|-
| 130 || [6.0.0+] [[#SetUsers]] ||
| 160 || [8.0.0+] [[#SetApplicationAttribute]]
|-
|-
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]] ||
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]]
|-
|-
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]] ||
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]]
|-
|-
| 140 || [6.0.0+] [[#GetDesirableUids]] ||
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]]
|-
|-
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]] ||
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]]
|-
|-
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||
| 201 || [10.0.0+] [[#RestartApplicationTimer]]
|-
|-
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||
| 300 || [20.0.0+]
|-
|-
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||
| 301 || [20.0.0+]
|-
|-
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||
| 310 || [21.0.0+]
|}
|}


Line 368: Line 471:


===== GetApplicationId =====
===== GetApplicationId =====
No input, returns an output u64 titleID.
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].
 
Gets the Application titleID.


===== PushLaunchParameter =====
===== PushLaunchParameter =====
Line 421: Line 522:


===== HasSaveDataAccessPermission =====
===== HasSaveDataAccessPermission =====
Takes an input u64 titleID, returns an output u8 bool flag.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool flag.


Gets whether the savedata specified by the input titleID is accessible. The output flag indicates whether it's accessible.
Gets whether the savedata specified by the input ApplicationId is accessible. The output flag indicates whether it's accessible.


If the titleID matches the current application titleID, this immediately returns success with flag=1.
If the ApplicationId matches the current application, this immediately returns success with flag=1.


===== PushToFriendInvitationStorageChannel =====
===== PushToFriendInvitationStorageChannel =====
Line 437: Line 538:
Clears the Notification StorageChannel, then pushes the input storage there.
Clears the Notification StorageChannel, then pushes the input storage there.


===== IAppletAccessor =====
[[qlaunch]] will only push data for this when launching the Application when the Alarm was triggered, where the system was previously in sleep-mode. This data is the [[Glue_services|Notification]] ApplicationParameter.
 
===== RequestApplicationSoftReset =====
No input/output.
 
===== RestartApplicationTimer =====
No input/output.
 
===== IAppletAccessor =====
This is "nn::am::service::IAppletAccessor".
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 474: Line 585:


== IAppletCommonFunctions ==
== IAppletCommonFunctions ==
Added with [[7.0.0]].
This is "nn::am::service::IAppletCommonFunctions".
 
This was added with [7.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [9.0.0+] [[#SetTerminateResult]]
|-
| 10 || [[#ReadThemeStorage]]
|-
| 11 || [[#WriteThemeStorage]]
|-
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]]
|-
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]]
|-
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]]
|-
| 42 || [8.0.0+] [[#SetDisplayMagnification]]
|-
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]]
|-
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]]
|-
| 52 || [10.0.0+] [[#IsHomeButtonShortPressedBlocked]]
|-
| 60 || [11.0.0+] [[#IsVrModeCurtainRequired]]
|-
| 61 || [12.0.0+] IsSleepRequiredByHighTemperature
|-
| 62 || [12.0.0+] IsSleepRequiredByLowBattery
|-
| 70 || [11.0.0+] [[#SetCpuBoostRequestPriority]]
|-
| 80 || [14.0.0+] SetHandlingCaptureButtonShortPressedMessageEnabledForApplet
|-
| 81 || [14.0.0+] SetHandlingCaptureButtonLongPressedMessageEnabledForApplet
|-
| 82 || [18.0.0+] SetBlockingCaptureButtonInEntireSystem
|-
| 90 || [15.0.0+] OpenNamedChannelAsParent
|-
| 91 || [15.0.0+] OpenNamedChannelAsChild
|-
| 100 || [15.0.0+] SetApplicationCoreUsageMode
|-
| 160 || [18.0.0+] GetNotificationReceiverService
|-
| 161 || [18.0.0+] GetNotificationSenderService
|-
| 300 || [17.0.0+] GetCurrentApplicationId
|-
| 310 || [19.0.0+] IsSystemAppletHomeMenu
|-
| 311 || [20.0.0+]
|-
|-
| 0 || [9.0.0+] [[#SetTerminateResult]] ||
| 320 || [19.0.0+] SetGpuTimeSliceBoost
|-
|-
| 10 || [[#ReadThemeStorage]] ||
| 321 || [19.0.0+] SetGpuTimeSliceBoostDueToApplication
|-
|-
| 11 || [[#WriteThemeStorage]] ||
| 322 || [20.0.0+]
|-
|-
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]] ||
| 330 || [19.0.0+]  
|-
|-
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]] ||
| 340 || [20.0.0+]
|-
|-
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]] ||
| 341 || [20.0.0+]
|-
|-
| 42 || [8.0.0+] [[#SetDisplayMagnification]] ||
| 342 || [20.0.0+]
|-
|-
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]] ||
| 350 || [20.0.0+]
|-
|-
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]] ||
| 360 || [20.0.0+]
|}
|}


Line 533: Line 696:
No input, returns an output u8 bool.
No input, returns an output u8 bool.


== ILibraryAppletProxy ==
=== IsHomeButtonShortPressedBlocked ===
No input, returns an output u8 bool.
 
=== IsVrModeCurtainRequired ===
No input, returns an output bool.
 
=== SetCpuBoostRequestPriority ===
Takes an input s32, no output.
 
== ILibraryAppletProxy ==
This is "nn::am::service::ILibraryAppletProxy".
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 555: Line 729:
|-
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
Line 560: Line 738:


=== ILibraryAppletSelfAccessor ===
=== ILibraryAppletSelfAccessor ===
This is "nn::am::service::ILibraryAppletSelfAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 629: Line 809:
|-
|-
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
|-
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||
|-
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||
|-
| 160 || [17.0.0+] [[#GetLibraryAppletInfoEx]] ||
|}
|}


Line 714: Line 900:


==== GetCurrentApplicationId ====
==== GetCurrentApplicationId ====
No input, returns an output u64.
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].


Gets the titleID for the currently running Application. titleID=0 when no Application is running.
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.


==== RequestExitToSelf ====
==== RequestExitToSelf ====
Line 724: Line 910:


==== CreateApplicationAndPushAndRequestToLaunch ====
==== CreateApplicationAndPushAndRequestToLaunch ====
Takes an input u64 titleID and an input #IStorage, no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.


This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].
Line 753: Line 939:


Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
Normally the output bool is set to 0, however when no users are available it's set to 1 with '''total_entries''' = -1.
==== SetApplicationMemoryReservation ====
Takes an input u64, no output.
An Application must be currently running. The input u64 must be 0x1000-byte aligned.
==== ShouldSetGpuTimeSliceManually ====
No input, returns an output u8 bool.
==== GetLibraryAppletInfoEx ====
No input, returns an output u64. Currently always returns 0.


== IOverlayAppletProxy ==
== IOverlayAppletProxy ==
This is "nn::am::service::IOverlayAppletProxy".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 776: Line 975:
|-
|-
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].
|-
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].
|-
|-
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].
Line 781: Line 982:


=== IOverlayFunctions ===
=== IOverlayFunctions ===
This is "nn::am::service::IOverlayFunctions".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 804: Line 1,007:
|-
|-
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled
|-
|-
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]
|-
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]
|-
| 40 || [18.0.0+] GetApplicationNintendoLogo
|-
| 41 || [18.0.0+] GetApplicationStartupMovie
|-
| 50 || [19.0.0+] SetGpuTimeSliceBoostForApplication
|-
| 60 || [19.0.0+]
|-
| 70 || [21.0.0+]
|-
| 71 || [21.0.0+]
|-
| 75 || [21.0.0+]
|-
|-
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]
Line 819: Line 1,040:


==== GetApplicationIdForLogo ====
==== GetApplicationIdForLogo ====
No input, returns an output u64 titleID.
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].


Gets the application titleID for displaying the logo screen during application launch.
Gets the ApplicationId for displaying the logo screen during application launch.


When no application is running, this returns success with titleID=0.
When no application is running, this returns success with ApplicationId=0.


==== SetGpuTimeSliceBoost ====
==== SetGpuTimeSliceBoost ====
Line 854: Line 1,075:


This writes the input bool into state, signals an Event, and returns 0.
This writes the input bool into state, signals an Event, and returns 0.
==== IsHealthWarningRequired ====
No input, returns an output u8 bool.


==== SetRequiresGpuResourceUse ====
==== SetRequiresGpuResourceUse ====
Line 868: Line 1,092:


== IApplicationProxy ==
== IApplicationProxy ==
This is "nn::am::service::IApplicationProxy".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 892: Line 1,118:


=== IApplicationFunctions ===
=== IApplicationFunctions ===
This is "nn::am::service::IApplicationFunctions".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 1 || [[#PopLaunchParameter]]
|-
|-
| 1 || [[#PopLaunchParameter]] ||
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]
|-
|-
| 10 || [[#CreateApplicationAndPushAndRequestToStart]] ||
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]
|-
|-
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]] ||
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]
|-
|-
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]] ||
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]
|-
|-
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]] ||
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]
|-
|-
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]] ||
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]
|-
|-
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]] ||
| 20 || [[#EnsureSaveData]]
|-
|-
| 20 || [[#EnsureSaveData]] ||
| 21 || [[#GetDesiredLanguage]]
|-
|-
| 21 || [[#GetDesiredLanguage]] ||
| 22 || [[#SetTerminateResult]]
|-
|-
| 22 || [[#SetTerminateResult]] ||
| 23 || [[#GetDisplayVersion]]
|-
|-
| 23 || [[#GetDisplayVersion]] ||
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]
|-
|-
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]] ||
| 25 || [3.0.0+] ExtendSaveData
|-
|-
| 25 || [3.0.0+] ExtendSaveData ||
| 26 || [3.0.0+] GetSaveDataSize
|-
|-
| 26 || [3.0.0+] GetSaveDataSize ||
| 27 || [5.0.0+] CreateCacheStorage
|-
|-
| 27 || [5.0.0+] CreateCacheStorage ||
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]
|-
|-
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]] ||
| 29 || [11.0.0+] [[#GetCacheStorageMax]]
|-
|-
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]] ||
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]
|-
|-
| 32 || [[#BeginBlockingHomeButton]] ||
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]
|-
|-
| 33 || [[#EndBlockingHomeButton]] ||
| 32 || [[#BeginBlockingHomeButton]]
|-
|-
| 40 || [[#NotifyRunning]] ||
| 33 || [[#EndBlockingHomeButton]]
|-
|-
| 50 || [2.0.0+] [[#GetPseudoDeviceId]] ||
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]
|-
|-
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]] ||
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]
|-
|-
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]] ||
| 36 || [14.0.0+] GetLimitedApplicationLicense
|-
|-
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]] ||
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
|-
|-
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]] ||
| 40 || [[#NotifyRunning]]
|-
|-
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]] ||
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]
|-
|-
| 70 || [3.0.0+] [[#RequestToShutdown]] ||
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]
|-
|-
| 71 || [3.0.0+] [[#RequestToReboot]] ||
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]
|-
|-
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]] ||
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]
|-
|-
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]] ||
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]
|-
|-
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]] ||
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]
|-
|-
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]] ||
| 70 || [3.0.0+] [[#RequestToShutdown]]
|-
|-
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]] ||
| 71 || [3.0.0+] [[#RequestToReboot]]
|-
|-
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]] ||
| 72 || [10.0.0+] [[#RequestToSleep]]
|-
|-
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]] ||
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]
|-
|-
| 120 || [5.0.0+] [[#ExecuteProgram]] ||
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]
|-
|-
| 121 || [5.0.0+] [[#ClearUserChannel]] ||
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]]  
|-
|-
| 122 || [5.0.0+] [[#UnpopToUserChannel]] ||
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]
|-
|-
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]] ||
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]
|-
|-
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]] ||
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]
|-
|-
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]
|-
|-
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]] ||
| 112 || [20.0.0+]
|-
|-
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] ||
| 113 || [20.0.0+]
|-
|-
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]] ||
| 120 || [5.0.0+] [[#ExecuteProgram]]
|-
|-
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]] ||
| 121 || [5.0.0+] [[#ClearUserChannel]]
|-
|-
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]] ||
| 122 || [5.0.0+] [[#UnpopToUserChannel]]
|-
|-
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]] ||
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]
|-
|-
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]] ||
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]
|-
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]] ||
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]
|-
|-
| 1001 || [5.0.0+] [[#PrepareForJit]] ||
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]
|}
|-
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]
|-
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]]
|-
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]
|-
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]
|-
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]
|-
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]
|-
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]
|-
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]
|-
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]
|-
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]
|-
| 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]]
|-
| 1000 || [5.0.0+] [[#CreateMovieMaker]]
|-
| 1001 || [5.0.0+] [[#PrepareForJit]]
|}


The BOTW game uses this GamePlayRecording functionality from the main-nso "nninitStartup" function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):
The BOTW game uses this GamePlayRecording functionality from the main-nso "nninitStartup" function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):
Line 1,010: Line 1,278:


==== CreateApplicationAndPushAndRequestToStart ====
==== CreateApplicationAndPushAndRequestToStart ====
Takes an input u64 titleID and an input [[#IStorage]], no output. titleID=0 can be used to relaunch the current application.
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.


==== CreateApplicationAndPushAndRequestToStartForQuest ====
==== CreateApplicationAndPushAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input u64 titleID, and an input [[#IStorage]], no output.
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.


==== CreateApplicationAndRequestToStart ====
==== CreateApplicationAndRequestToStart ====
Takes an input u64 titleID, no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.


==== CreateApplicationAndRequestToStartForQuest ====
==== CreateApplicationAndRequestToStartForQuest ====
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input u64 titleID, no output.
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.


Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.


==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====
Takes an input u64 titleID, 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]].


==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====
Takes an input u64 titleID and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.


Same as [[#CreateApplicationAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
Same as [[#CreateApplicationAndRequestToStartForQuest]] except the entire attributes structure is directly specified via the input buffer. This command replaces [[#CreateApplicationAndRequestToStartForQuest]], official user-processes no longer use [[#CreateApplicationAndPushAndRequestToStartForQuest]].
Line 1,061: Line 1,331:


This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].
==== GetSaveDataSizeMax ====
No input, returns two ouput s64s.
==== GetCacheStorageMax ====
No input, returns an output s32 and s64.


==== BeginBlockingHomeButtonShortAndLongPressed ====
==== BeginBlockingHomeButtonShortAndLongPressed ====
Line 1,079: Line 1,355:
==== EndBlockingHomeButton ====
==== EndBlockingHomeButton ====
No input/output.
No input/output.
==== SelectApplicationLicense ====
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].
==== GetDeviceSaveDataSizeMax ====
No input, returns two output s64s.


==== NotifyRunning ====
==== NotifyRunning ====
Line 1,114: Line 1,396:


On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.
==== RequestToSleep ====
No input/output.


==== ExitAndRequestToShowThanksMessage ====
==== ExitAndRequestToShowThanksMessage ====
Line 1,133: Line 1,418:


User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
User-processes create the tmem with an user-specified buffer with permissions=0. '''width''' = 1280 and '''height''' = 720.
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.


This is used as an overlay for screenshots.
This is used as an overlay for screenshots.


==== SetApplicationCopyrightImage ====
==== SetApplicationCopyrightImage ====
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 '''WindowOriginMode''', and no output.
Takes a type-0x45 input buffer, an s32 '''x''', an s32 '''y''', an s32 '''width''', an s32 '''height''', an s32 [[#WindowOriginMode]], and no output.
 
The last s32 is "nn::oe::WindowOriginMode". This should be at least 1.


'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
'''x''' and '''y''' must not have the negative bit set. '''width''' and '''height''' must not be <1.
Line 1,151: Line 1,436:


==== QueryApplicationPlayStatistics ====
==== QueryApplicationPlayStatistics ====
Takes a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of u64 titleIDs. Returns an output s32 for actual total output entries.
Takes a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of [[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.


The number of entries in each array is the same.
The number of entries in each array is the same.
Line 1,160: Line 1,445:


==== QueryApplicationPlayStatisticsByUid ====
==== QueryApplicationPlayStatisticsByUid ====
Takes a u128 userID, a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of u64 titleIDs. Returns an output s32 for actual total output entries.
Takes a u128 userID, a type-0x6 output buffer containing an array of [[Shared_Database_services|ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of [[NCM_services#ApplicationId|ApplicationId]]. Returns an output s32 for actual total output entries.


Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs.  
Line 1,190: Line 1,475:
No input, returns an output Event handle with autoclear=false.
No input, returns an output Event handle with autoclear=false.


This is used by sdknso during applet-application initialization. A separate thread is setup where event-waiting is handled. When the Event is signaled, official sw will assert.
This is used by sdknso during applet-application initialization. A separate thread is setup where event-waiting is handled. When the Event is signaled, official sw will Abort.
 
==== SetDelayTimeToAbortOnGpuError ====
Takes an input s64 "nn::TimeSpan", no output.


==== GetFriendInvitationStorageChannelEvent ====
==== GetFriendInvitationStorageChannelEvent ====
Line 1,222: Line 1,510:
Takes an input u8 bool, no output.
Takes an input u8 bool, no output.


==== StartContinuousRecordingFlushForDebug ====
==== GetLaunchRequiredVersion ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].


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.
sdknso passes hard-coded value 0 for the u64.


==== CreateMovieMaker ====
==== UpgradeLaunchRequiredVersion ====
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.


Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
sdknso passes hard-coded value 0 for the u64.


Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.
==== SendServerMaintenanceOverlayNotification ====
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.
 
The second input value can optionally be 0.
 
==== GetLastApplicationExitReason ====
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.
 
==== Cmd310 ====
[21.0.0+] Now takes a total of 0x18-bytes of input.
 
==== Cmd330 ====
No input, returns 1-byte of output.
 
On NX this just writes 0 to output and returns 0.
 
==== StartContinuousRecordingFlushForDebug ====
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.
 
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned.
 
==== CreateMovieMaker ====
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].
 
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.
 
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.


==== PrepareForJit ====
==== PrepareForJit ====
Takes no input. Launches title 010000000000003B (currently not present on retail systems) if some context variable is not set, with that context variable being initialized afterwards.
Takes no input. Launches the [[JIT_services|jit-sysmodule]] via [[NS_Services|ns]] LaunchLibraryApplet if it has not already been launched for the current application, storing a std::shared_ptr<> for jit-sysmodule process tracking object as an IApplicationFunctions member.
 
~IApplicationFunctions() includes:
 
    if (this->jit_process) {
        Terminate(this->jit_process);
        this->jit_process = nullptr;
    }
 
Thus the lifetime of the jit sysmodule is tied to the application which uses it, and each application gets its own fresh copy of the jit sysmodule.
 
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 ===
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 ===
This is "nn::am::service::IMovieMaker".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,254: Line 1,608:


== ILibraryAppletCreator ==
== ILibraryAppletCreator ==
This is "nn::am::service::ILibraryAppletCreator".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 0 || [[#CreateLibraryApplet]] ||  
| 0 || [[#CreateLibraryAppletOld|CreateLibraryAppletOld]] ([1.0.0-19.0.1] CreateLibraryApplet) ||  
|-
|-
| 1 || [[#TerminateAllLibraryApplets]] ||
| 1 || [[#TerminateAllLibraryApplets]] ||
|-
|-
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
| 2 || [[#AreAnyLibraryAppletsLeft]] ||
|-
| 3 || [20.0.0+] [[#CreateLibraryApplet|CreateLibraryApplet]] ||
|-
|-
| 10 || [[#CreateStorage]] ||  
| 10 || [[#CreateStorage]] ||  
Line 1,271: Line 1,629:
|}
|}


=== 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,287: Line 1,647:


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,306: Line 1,673:


=== ILibraryAppletAccessor ===
=== ILibraryAppletAccessor ===
This is "nn::am::service::ILibraryAppletAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,323: Line 1,692:
|-
|-
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||
|-
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||
|-
| 80 || [19.0.0+] RequestForLibraryAppletToGetForeground ||
|-
| 81 || [19.0.0+] GetCurrentChildLibraryApplet ||
|-
| 90 || [20.0.0+] ||
|-
|-
| 100 || [[#PushInData]] ||  
| 100 || [[#PushInData]] ||  
Line 1,353: Line 1,730:


Official sw will assert prior to using this if applet-service was not initialized as *Application.
Official sw will assert prior to using this if applet-service was not initialized as *Application.
==== PresetLibraryAppletGpuTimeSliceZero ====
No input/output.
sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.


==== PushInData ====
==== PushInData ====
Line 1,391: Line 1,773:


== ICommonStateGetter ==
== ICommonStateGetter ==
This is "nn::am::service::ICommonStateGetter".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [[#GetEventHandle]]
|-
| 1 || [[#ReceiveMessage]]
|-
| 2 || [[#GetThisAppletKind]]
|-
| 3 || [[#AllowToEnterSleep]]
|-
| 4 || [[#DisallowToEnterSleep]]
|-
| 5 || [[#GetOperationMode]]
|-
| 6 || [[#GetPerformanceMode]]
|-
| 7 || [[#GetCradleStatus]]
|-
| 8 || [[#GetBootMode]]
|-
|-
| 0 || [[#GetEventHandle]] ||
| 9 || [[#GetCurrentFocusState]]
|-
|-
| 1 || [[#ReceiveMessage]] ||
| 10 || [[#RequestToAcquireSleepLock]]
|-
|-
| 2 || [[#GetThisAppletKind]] ||
| 11 || [[#ReleaseSleepLock]]
|-
|-
| 3 || [[#AllowToEnterSleep]] ||
| 12 || [[#ReleaseSleepLockTransiently]]
|-
|-
| 4 || [[#DisallowToEnterSleep]] ||
| 13 || [[#GetAcquiredSleepLockEvent]]
|-
|-
| 5 || [[#GetOperationMode]] ||
| 14 || [11.0.0+] [[#GetWakeupCount]]
|-
|-
| 6 || [[#GetPerformanceMode]] ||
| 15 || [19.0.0+]  
|-
|-
| 7 || [[#GetCradleStatus]] ||
| 20 || [[#PushToGeneralChannel]]
|-
|-
| 8 || [[#GetBootMode]] ||
| 30 || [[#GetHomeButtonReaderLockAccessor]]
|-
|-
| 9 || [[#GetCurrentFocusState]] ||
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]
|-
|-
| 10 || [[#RequestToAcquireSleepLock]] ||
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]
|-
|-
| 11 || [[#ReleaseSleepLock]] ||
| 40 || [2.0.0+] [[#GetCradleFwVersion]]
|-
|-
| 12 || [[#ReleaseSleepLockTransiently]] ||
| 50 || [3.0.0+] [[#IsVrModeEnabled]]
|-
|-
| 13 || [[#GetAcquiredSleepLockEvent]] ||
| 51 || [3.0.0+] [[#SetVrModeEnabled]]
|-
|-
| 20 || [[#PushToGeneralChannel]] ||
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]
|-
|-
| 30 || [[#GetHomeButtonReaderLockAccessor]] ||
| 53 || [7.0.0+] [[#BeginVrModeEx]]
|-
|-
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]] ||
| 54 || [7.0.0+] [[#EndVrModeEx]]
|-
|-
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]] ||
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]
|-
|-
| 40 || [2.0.0+] [[#GetCradleFwVersion]] ||
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]
|-
|-
| 50 || [3.0.0+] [[#IsVrModeEnabled]] ||
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]
|-
|-
| 51 || [3.0.0+] [[#SetVrModeEnabled]] ||
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]
|-
|-
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]] ||
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]
|-
|-
| 53 || [7.0.0+] [[#BeginVrModeEx]] ||
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]
|-
|-
| 54 || [7.0.0+] [[#EndVrModeEx]] ||
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]
|-
|-
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]] ||
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]
|-
|-
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]] ||
| 66 || [6.0.0+] [[#SetCpuBoostMode]]
|-
|-
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]] ||
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]
|-
|-
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]] ||
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]
|-
|-
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]] ||
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]
|-
|-
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]] ||
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]
|-
|-
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]] ||
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]
|-
|-
| 66 || [6.0.0+] [[#SetCpuBoostMode]] ||
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]
|-
|-
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]] ||
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]
|-
|-
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]] ||
| 120 || [13.0.0+] GetAppletLaunchedHistory
|-
|-
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]] ||
| 130 || [21.0.0+]
|-
|-
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]] ||
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]
|-
|-
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]] ||
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]
|}
|-
 
| 400 || [10.0.0+] [[#ActivateMigrationService]]
Officially notification messages are handled by the application itself, not sdk-nso in ExeFS. Official apps call code in sdk-nso which basically uses svcWaitSynchronization with the event from [[#GetEventHandle]] to check whether a message is available, then if so it uses [[#ReceiveMessage]]. The actual handling for message IDs is done in the app itself(see [[#AppletMessage]]).
|-
 
| 401 || [10.0.0+] [[#DeactivateMigrationService]]
[7.0.0+] User-processes now use BeginVrModeEx/EndVrModeEx instead of [[#SetVrModeEnabled]]. Prior to using using BeginVrModeEx, [[Parental_Control_services|pctl]] IsStereoVisionPermitted is used and error 0xD08E is thrown if not allowed by pctl.
|-
 
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]
=== GetEventHandle ===
|-
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]
 
|-
| 502 || [12.0.0+] IsSleepEnabled
|-
| 503 || [12.0.0+] IsDisablingSleepSuppressed
|-
| 600 || [20.0.0+] ([17.0.0-18.1.0] OpenNamedChannelAsChild)
|-
| 610 || [21.0.0+]
|-
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]
|-
| 910 || [17.0.0+] GetLaunchRequiredTick
|-
| 1000 || [19.0.0+] BeginVrMode3d
|-
| 1001 || [19.0.0+] EndVrMode3d
|-
| 1002 || [19.0.0+] IsVrModeEnabled3d
|-
| 1003 || [21.0.0+]
|-
| 1004 || [21.0.0+]
|-
| 1005 || [21.0.0+]
|}
 
Officially notification messages are handled by the application itself, not sdk-nso in ExeFS. Official apps call code in sdk-nso which basically uses svcWaitSynchronization with the event from [[#GetEventHandle]] to check whether a message is available, then if so it uses [[#ReceiveMessage]]. The actual handling for message IDs is done in the app itself(see [[#AppletMessage]]).
 
[7.0.0+] User-processes now use BeginVrModeEx/EndVrModeEx instead of [[#SetVrModeEnabled]]. Prior to using using BeginVrModeEx, [[Parental_Control_services|pctl]] IsStereoVisionPermitted is used and error 0xD08E is thrown if not allowed by pctl.
 
=== GetEventHandle ===
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].
 
=== ReceiveMessage ===
=== ReceiveMessage ===
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.
Line 1,499: Line 1,933:


=== GetPerformanceMode ===
=== GetPerformanceMode ===
No input. Returns an output u32 for the current PerformanceMode.
No input. Returns an output u32 for the current [[#PerformanceMode]].


=== GetCradleStatus ===
=== GetCradleStatus ===
Line 1,512: Line 1,946:


=== GetCurrentFocusState ===
=== GetCurrentFocusState ===
No input. Returns an output u8:
No input. Returns an output u8 [[#FocusState]].
 
* 1: In focus.
* 2/3: Out of focus(running in "background").


=== RequestToAcquireSleepLock ===
=== RequestToAcquireSleepLock ===
Line 1,528: Line 1,959:
=== GetAcquiredSleepLockEvent ===
=== GetAcquiredSleepLockEvent ===
No input, returns an output Event handle with autoclear=false.
No input, returns an output Event handle with autoclear=false.
=== GetWakeupCount ===
No input, returns an output u64.


=== PushToGeneralChannel ===
=== PushToGeneralChannel ===
Line 1,585: Line 2,019:
=== IsInControllerFirmwareUpdateSection ===
=== IsInControllerFirmwareUpdateSection ===
No input, returns an output u8 bool.
No input, returns an output u8 bool.
=== SetVrPositionForDebug ===
Takes 4 input s32s, no output.
The s32s are: x, y, width, height.
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
width must be 1-1280, height must be 1-720.
x and y must not be negative. x+width must be <=1280. y+height must be <=720.


=== GetDefaultDisplayResolution ===
=== GetDefaultDisplayResolution ===
Line 1,602: Line 2,047:


=== GetApplicationIdByContentActionName ===
=== GetApplicationIdByContentActionName ===
Takes a type-0x5 input buffer containing a string, returns an output u64 titleID.
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].


Gets the application titleID for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (when the current applet isn't a SystemApplication).
Gets the ApplicationId for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn't 0x04 (when the current applet isn't a SystemApplication).


=== SetCpuBoostMode ===
=== SetCpuBoostMode ===
Takes an input u32 '''CpuBoostMode''' (only modes 0 and 1 are valid) and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].


=== PerformSystemButtonPressingIfInFocus ===
=== CancelCpuBoostMode ===
No input/output.
 
=== GetBuiltInDisplayType ===
No input, returns an output s32.
 
This is not exposed by sdknso.
 
This loads a s32 index from global state (originates from [[SPL_services#GetConfig|GetConfig]] [[SMC#HardwareType|HardwareType]]), Aborts if it's out-of-bounds, then the following is returned for the output s32: global_array[loaded_index].
 
=== PerformSystemButtonPressingIfInFocus ===
Takes an input [[#SystemButtonType]], no output.
Takes an input [[#SystemButtonType]], no output.


Line 1,619: Line 2,074:
=== GetCurrentPerformanceConfiguration ===
=== GetCurrentPerformanceConfiguration ===
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].
=== OpenMyGpuErrorHandler ===
No input, returns an [[#IGpuErrorHandler]].
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.


=== GetOperationModeSystemInfo ===
=== GetOperationModeSystemInfo ===
Line 1,630: Line 2,090:
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].


== ISelfController ==
=== ActivateMigrationService ===
No input/output.
 
Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].
 
=== DeactivateMigrationService ===
No input/output.
 
=== DisableSleepTillShutdown ===
No input/output.
 
=== SuppressDisablingSleepTemporarily ===
Takes an input u64 "nn::TimeSpanType", no output.
 
=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===
No input/output.
 
=== IGpuErrorHandler ===
This is "nn::am::service::IGpuErrorHandler".
 
This was added with [11.0.0+].
 
This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#Exit]]
| 100 || [[#GetManualGpuErrorInfoSize]]
|-
|-
| 1 || [[#LockExit]]
| 101 || [[#GetManualGpuErrorInfo]]
|-
|-
| 2 || [[#UnlockExit]]
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]
|-
|-
| 3 || [2.0.0+] [[#EnterFatalSection]]
| 103 || [[#FinishManualGpuErrorHandling]]
|-
|}
| 4 || [2.0.0+] [[#LeaveFatalSection]]
 
|-
==== GetManualGpuErrorInfoSize ====
| 9 || [[#GetLibraryAppletLaunchableEvent]]
No input, returns an output u64.
 
==== GetManualGpuErrorInfo ====
Takes a type-0x6 output buffer, returns an output u64.
 
The OutBuffer_size must be >= the output size from [[#GetManualGpuErrorInfoSize]].
 
sdknso exposes the buffer as <code>void*</code>.
 
==== GetManualGpuErrorDetectionSystemEvent ====
No input, returns an output Event handle with EventClearMode=0.
 
==== FinishManualGpuErrorHandling ====
No input/output.
 
== ISelfController ==
This is "nn::am::service::ISelfController".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#Exit]]
|-
| 1 || [[#LockExit]]
|-
| 2 || [[#UnlockExit]]
|-
| 3 || [2.0.0+] [[#EnterFatalSection]]
|-
| 4 || [2.0.0+] [[#LeaveFatalSection]]
|-
| 9 || [[#GetLibraryAppletLaunchableEvent]]
|-
|-
| 10 || [[#SetScreenShotPermission]]
| 10 || [[#SetScreenShotPermission]]
Line 1,668: Line 2,183:
|-
|-
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]
|-
| 21 || [13.0.0+] GetScreenShotProgramId
|-
| 22 || [19.0.0+] GetScreenShotAcdIndex
|-
| 23 || [19.0.0+] GetScreenShotApparentPlatform
|-
| 24 || [19.0.0+] GetScreenShotApplicationProperty
|-
|-
| 40 || [[#CreateManagedDisplayLayer]]
| 40 || [[#CreateManagedDisplayLayer]]
Line 1,676: Line 2,199:
|-
|-
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]
|-
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]
|-
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]
|-
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]
|-
|-
| 50 || [[#SetHandlesRequestToDisplay]]
| 50 || [[#SetHandlesRequestToDisplay]]
Line 1,706: Line 2,235:
|-
|-
| 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 1,717: Line 2,248:
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]
|-
|-
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]
|}
|-
 
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]
|-
| 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]
|}
 
=== Exit ===
=== Exit ===
No input/output.
No input/output.
Line 1,826: Line 2,377:


Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.
=== CreateManagedDisplaySeparableLayer ===
No input, returns two output u64 LayerIds.
sdknso now uses this instead of [[#CreateManagedDisplayLayer]]. sdknso caches the output from the cmd so that it's only used once. The first u64 is used the same as the original LayerId from [[#CreateManagedDisplayLayer]]. <code>nn::vi::CreateRecordingLayer</code> uses the second LayerId, the layer creation is identical besides which LayerId is used.
=== SetManagedDisplayLayerSeparationMode ===
Takes an input u32, no output.
sdknso exposes this as <code>nn::vi::SetRecordingLayerEnabled(bool)</code>.
The input u32 must be 0-1.
=== SetRecordingLayerCompositionEnabled ===
Takes an input bool, no output.


=== SetHandlesRequestToDisplay ===
=== SetHandlesRequestToDisplay ===
Line 1,897: Line 2,463:


=== SetWirelessPriorityMode ===
=== SetWirelessPriorityMode ===
Takes an input s32 enum '''WirelessPriorityMode''', no output.
Takes an input s32 [[#WirelessPriorityMode]], no output.
 
The input value must be 1 or 2.


=== GetAccumulatedSuspendedTickValue ===
=== GetAccumulatedSuspendedTickValue ===
Line 1,922: Line 2,486:


The size must be <=0x400. The input buffer is copied to a buffer loaded from a state ptr (throwing an error when the state ptr is not set), with the u32 size being written to statebuf+0x400 afterwards.
The size must be <=0x400. The input buffer is copied to a buffer loaded from a state ptr (throwing an error when the state ptr is not set), with the u32 size being written to statebuf+0x400 afterwards.
=== SaveCurrentScreenshot ===
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.
sdknso exposes this under "nn::album::".
=== SetRecordVolumeMuted ===
Takes an input bool, no output.


=== GetDebugStorageChannel ===
=== GetDebugStorageChannel ===
Line 1,927: Line 2,499:


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 ==
Added with [[7.0.0]].
This is "nn::am::service::IStorageChannel".
 
This was added with [7.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,947: Line 2,526:


== IWindowController ==
== IWindowController ==
This is "nn::am::service::IWindowController".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 2,003: Line 2,584:


== IAudioController ==
== IAudioController ==
This is "nn::am::service::IAudioController".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 2,016: Line 2,599:
|-
|-
| 4 || [[#SetTransparentVolumeRate]]
| 4 || [[#SetTransparentVolumeRate]]
|-
| 5 || [20.0.0+]
|}
|}


Line 2,038: Line 2,623:


== IDisplayController ==
== IDisplayController ==
This is "nn::am::service::IDisplayController".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 2,195: Line 2,782:


=== ClearCaptureBuffer ===
=== ClearCaptureBuffer ===
Takes an input u8 bool, an s32, and an u32, returns no output.
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.
 
Clear the input CaptureSharedBuffer with the specified RGBA8 color.


=== ClearAppletTransitionBuffer ===
=== ClearAppletTransitionBuffer ===
Takes an input u32, no output.
Takes an input u32, no output.
Clear the AppletTransitionBuffer with the specified RGBA8 color.


=== AcquireLastApplicationCaptureSharedBuffer ===
=== AcquireLastApplicationCaptureSharedBuffer ===
Line 2,236: Line 2,827:


== ISystemAppletControllerForDebug ==
== ISystemAppletControllerForDebug ==
This is "nn::am::service::ISystemAppletControllerForDebug".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 1 || RequestLaunchApplicationForDebug
|-
|-
| 1 || RequestLaunchApplicationForDebug ||  
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]
|-
|-
| 2 || [7.0.0+] GetDebugStorageChannel || No input, returns an output [[#IStorageChannel]].
| 3 || [7.0.0+] [[#CreateStorageForDebug]]
|-
|-
| 3 || [7.0.0+] CreateStorageForDebug || Takes a total of 8-bytes of input, returns an [[#IStorage]].
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]
|}
|}
=== GetDebugStorageChannel ===
No input. Returns an output [[#IStorageChannel]].
=== CreateStorageForDebug ===
Takes a total of 8-bytes of input. Returns an [[#IStorage]].
=== CreateCradleFirmwareUpdaterForDebug ===
No input. Returns an [[#ICradleFirmwareUpdater]].


== IProcessWindingController ==
== IProcessWindingController ==
This is "nn::am::service::IProcessWindingController".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 2,296: Line 2,902:
=== 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 ||
|}
== IAppletAlternativeFunctions ==
This is "nn::am::service::IAppletAlternativeFunctions".
This was added with [20.0.0+].
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 ||
|-
| 1 ||
|-
| 2 ||
|}


== IDebugFunctions ==
== IDebugFunctions ==
This is "nn::am::service::IDebugFunctions".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [[#NotifyMessageToHomeMenuForDebug]]
|-
|-
| 0 || [[#NotifyMessageToHomeMenuForDebug]] ||
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]
|-
|-
| 1 || [[#OpenMainApplication]] ||
| 10 || [[#PerformSystemButtonPressing]]
|-
|-
| 10 || [[#PerformSystemButtonPressing]] ||
| 20 || [[#InvalidateTransitionLayer]]
|-
|-
| 20 || [[#InvalidateTransitionLayer]] ||
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]
|-
|-
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]] ||
| 31 || [12.0.0+] [[#RequestLaunchApplicationByApplicationLaunchInfoForDebug]]
|-
|-
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]] ||
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]
|-
|-
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]] ||
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug
|-
|-
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]] ||
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug
|-
|-
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]] ||
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug
|-
|-
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]] ||
| 53 || [18.0.0+] GetProgramIdFromAppletIdAndLibraryAppletModeForDebug
|-
|-
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]] ||
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]
|-
|-
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]] ||
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]
|-
|-
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]] ||
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]
|-
|-
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]] ||
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]
|-
|-
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]] ||
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]
|}
|-
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]
|-
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]
|-
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]
|-
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]
|-
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]
|-
| 140 || [14.0.0+] [[#RestrictPowerOperationForSecureLaunchModeForDebug|RestrictPowerOperationForSecureLaunchModeForDebug]]
|-
| 150 || [21.0.0+]
|-
| 200 || [15.0.0+] [[#CreateFloatingLibraryAppletAccepterForDebug|CreateFloatingLibraryAppletAccepterForDebug]]
|-
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug
|-
| 400 || [S2]
|-
| 401 || [S2]
|-
| 402 || [S2]
|-
| 403 || [S2]
|-
| 410 || [18.0.0+] [[#CreateGeneralStorageForDebug|CreateGeneralStorageForDebug]]
|-
| 411 || [18.0.0+] [[#ReadGeneralStorageForDebug|ReadGeneralStorageForDebug]]
|-
| 412 || [18.0.0+] [[#WriteGeneralStorageForDebug|WriteGeneralStorageForDebug]]
|-
| 430 || [20.0.0+]
|-
| 431 || [20.0.0+]
|-
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent
|-
| 910 || [20.0.0+]
|-
| 2000 || [S2]
|-
| 10000 || [S2]
|}


=== NotifyMessageToHomeMenuForDebug ===
=== NotifyMessageToHomeMenuForDebug ===
Line 2,350: Line 3,055:


=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===
Takes an input u8 bool flag, an u64 Application titleID, a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.
Takes an input u8 bool flag, an [[NCM_services#ApplicationId|ApplicationId]], a type-0x5 input buffer containing an array of u128 userIDs, and a type-0x5 input buffer, no output.


Requests to launch the specified Application, with the specified users. When the bool flag is true, the content of the second input buffer is used to create a storage which is pushed to the UserChannel for this Application (see [[#LaunchParameterKind]]).
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,358: Line 3,068:


=== SetCpuBoostModeForApplet ===
=== SetCpuBoostModeForApplet ===
Takes an input u32 '''CpuBoostMode''' (only modes 0 and 1 are valid) and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].


The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
=== CancelCpuBoostModeForApplet ===
No input/output.


=== PushToAppletBoundChannelForDebug ===
=== PushToAppletBoundChannelForDebug ===
Line 2,367: Line 3,080:
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.


The s32 must the value already stored in state when the state value is non-zero, otherwise an error is returned. When the state value is 0, the s32 is written into state. Then input storage is pushed to the StorageChannel.
The s32 must match the value already stored in state when the state value is non-zero, otherwise an error is returned. When the state value is 0, the s32 is written into state. Then the input storage is pushed to the StorageChannel.


=== TryPopFromAppletBoundChannelForDebug ===
=== TryPopFromAppletBoundChannelForDebug ===
Line 2,377: Line 3,090:


=== AlarmSettingNotificationEnableAppEventReserve ===
=== AlarmSettingNotificationEnableAppEventReserve ===
Takes an input [[#IStorage]] and an u64 <code>nn::ncm::ApplicationId</code>, no output.
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
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 2,392: Line 3,107:


=== FriendInvitationSetApplicationParameter ===
=== FriendInvitationSetApplicationParameter ===
Takes an input [[#IStorage]] and an u64 <code>nn::ncm::ApplicationId</code>, no output.
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.


Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.
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 2,406: Line 3,123:
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.


== IStorage ==
=== RestrictPowerOperationForSecureLaunchModeForDebug ===
{| class="wikitable" border="1"
No input/output.
|-
 
! Cmd || Name || Notes
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 ==
This is "nn::am::service::IStorage".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
|-
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
| 0 || Open || No input. Returns an [[#IStorageAccessor]].
Line 2,421: Line 3,173:


== IStorageAccessor ==
== IStorageAccessor ==
This is "nn::am::service::IStorageAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 2,433: Line 3,187:


== ITransferStorageAccessor ==
== ITransferStorageAccessor ==
This is "nn::am::service::ITransferStorageAccessor".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 2,449: Line 3,205:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || [[#OpenApplicationProxy]] ||
| 0 || [[#OpenApplicationProxy]]
|}
|}


Line 2,457: Line 3,213:


== 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 2,465: Line 3,219:
= idle:sys =
= idle:sys =
This is "nn::idle::detail::IPolicyManagerSystem"
This is "nn::idle::detail::IPolicyManagerSystem"
This was moved to [[OMM_services|omm]] with [14.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,472: Line 3,228:
| 0 || GetAutoPowerDownEvent
| 0 || GetAutoPowerDownEvent
|-
|-
|rowspan="2"| 1 || [1.0.0-3.0.2]
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )
|-
| [7.0.0+] IsAutoPowerDownRequested
|-
|-
| 2 || [1.0.0-3.0.2]
| 2 || [1.0.0-3.0.2]
Line 2,487: Line 3,241:
== SetHandlingContext ==
== SetHandlingContext ==
[3.0.0+] Now takes an additional 0x10-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.


= omm =
= omm =
Line 2,493: Line 3,249:
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.
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*]].
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 2,553: Line 3,311:
|-
|-
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent
|-
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]
|}
|}


Line 2,560: Line 3,320:
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].


= spsm =
== CreateCradleFirmwareUpdater ==
This is "nn::spsm::detail::IPowerStateInterface".
No input. Returns an [[#ICradleFirmwareUpdater]].
 
== ICradleFirmwareUpdater ==
This is "nn::am::service::ICradleFirmwareUpdater".
 
This was added with [12.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,567: Line 3,332:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetCurrentState
| 0 || Start
|-
|-
| 1 || EnterSleep
| 1 || Finish
|-
|-
| 2 || GetLastWakeReason
| 2 || GetUpdateDeviceStatus
|-
|-
| 3 || Shutdown
| 3 || GetUpdateProgress
|-
|-
| 4 || GetNotificationMessageEventHandle
| 4 || GetUpdateDeviceStatusChangeEvent
|-
|-
| 5 || ReceiveNotificationMessage
| 5 || GetUpdateProgress2
|}
 
= spsm =
This is "nn::spsm::detail::IPowerStateInterface".
 
This was moved to [[OMM_services|omm]] with [14.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || GetCurrentState
|-
| 1 || EnterSleep
|-
| 2 || GetLastWakeReason
|-
| 3 || Shutdown
|-
| 4 || GetNotificationMessageEventHandle
|-
| 5 || ReceiveNotificationMessage
|-
|-
| 6 || AnalyzeLogForLastSleepWakeSequence
| 6 || AnalyzeLogForLastSleepWakeSequence
Line 2,596: Line 3,383:
= tcap =
= tcap =
This is "nn::tcap::server::IManager".
This is "nn::tcap::server::IManager".
This was removed with [11.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,611: Line 3,400:
This is "nn::capsrv::sf::IScreenShotApplicationService".
This is "nn::capsrv::sf::IScreenShotApplicationService".


This was added with [[6.0.0]].
This was added with [6.0.0+].


This can be used by applications to save screenshots.
This can be used by applications to save screenshots.
Line 2,617: Line 3,406:
{| 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 2,648: Line 3,440:
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]].
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]].


= Library Applets =
= apm =
This section documents library applet launching.
This is "nn::am::service::IApmManager".
 
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 ==
This was added with [8.0.0+].
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"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Typical Value || Notes
! Cmd || Name
|-
|-
| 0x0 || 4 || 1 || Common Arguments version
| 0 || [[#OpenSession]]
|-
|-
| 0x4 || 4 || 0x20 || Common Arguments size
| 1 || GetPerformanceMode
|-
|-
| 0x8 || 4 || || Library applet version (API version)
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]
|}
 
== OpenSession ==
Returns an [[#ISession]].
 
== IsCpuOverclockEnabled ==
No input, returns an output u8 bool.
 
== ISession ==
This is "nn::am::service::IApmSession".
 
{| class="wikitable" border="1"
|-
|-
| 0xC || 4 || 0 || Theme color
! Cmd || Name
|-
|-
| 0x10 || 1 || 0 || Play startup sound
| 0 || SetPerformanceConfiguration
|-
|-
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])
| 1 || GetPerformanceConfiguration
|-
|-
| 2 || [8.0.0+] SetCpuOverclockEnabled
|}
|}


= Enums =
= (S2) adraw:a =
=== AppletId ===
This is "nn::appletdraw::sfif::IAppletRoot".
See also [[:Category:Library Applets]].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! ID
! Cmd || Name
!  Title-id
!  Description
|-
|-
| 0x01
| 1 || [[#OpenResourceSession]]
|  
| Application. Not valid for use with LibraryApplets.
|-
|-
| 0x02
| 2 || [[#OpenAppletSession]]
| 010000000000100C
|}
| "overlayDisp"
 
== OpenResourceSession ==
Unofficial name.
 
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IResourceSession]].
 
== OpenAppletSession ==
Unofficial name.
 
Takes a PID and an input [[#AppletResourceUserId|AppletResourceUserId]]. Returns a [[#IAppletSession]].
 
== IResourceSession ==
This is "nn::appletdraw::sfif::IResourceSession".
 
{| class="wikitable" border="1"
|-
|-
| 0x03
! Cmd || Name
| 0100000000001000
| "qlaunch"
|-
|-
| 0x04
| 1 || [[#Ping|Ping]]
| 0100000000001012
| "starter" SystemApplication.
|-
|-
| 0x0A
| 10 ||
| 0100000000001001
| [[Auth_Applet|"auth"]]
|-
|-
| 0x0B
| 11 || 
| 0100000000001002
|}
| "cabinet"
 
=== Ping ===
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 ===
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"
|-
|-
| 0x0C
! Cmd || Name
| 0100000000001003
| "controller"
|-
|-
| 0x0D
| 1 || [[#Ping|Ping]]
| 0100000000001004
| "dataErase"
|-
|-
| 0x0E
| 2 || [[#GetEvent|GetEvent]]
| 0100000000001005
| [[Error_Applet|"error"]]
|-
|-
| 0x0F
| 3 || [20.1.1+]
| 0100000000001006
| "netConnect"
|-
|-
| 0x10
| 10 ||
| 0100000000001007
| [[Profile_Selector|"playerSelect"]]
|-
|-
| 0x11
| 11 ||
| 0100000000001008
| [[Software_Keyboard|"swkbd"]]
|-
|-
| 0x12
| 12 ||
| 0100000000001009
| "miiEdit"
|-
|-
| 0x13
| 13 ||
| 010000000000100A
| "LibAppletWeb" [[Internet_Browser#010000000000100A|WebApplet]] applet
|-
|-
| 0x14
| 15 ||
| 010000000000100B
| "LibAppletShop" [[Internet_Browser#ShopN|ShopN]] applet
|-
|-
| 0x15
| 16 || [20.1.1+]
| 010000000000100D
| [[Album_Applet|"photoViewer"]]
|-
|-
| 0x16
| 17 || [20.1.1+]
| 010000000000100E
| "set"
|-
|-
| 0x17
| 18 || [20.1.1+]
| 010000000000100F
| "LibAppletOff" [[Internet_Browser#Offline_Applet|Offline]] applet
|-
|-
| 0x18
| 19 || [20.1.1+]
| 0100000000001010
| "LibAppletLns" [[Internet_Browser#Whitelisted_Applets|Whitelisted]] applet
|-
|-
| 0x19
| 21 ||
| 0100000000001011
| "LibAppletAuth" [[Internet_Browser#WifiWebAuthApplet|WifiWebAuth]] applet
|-
|-
| 0x1A
| 22 ||
| 0100000000001013
| [[MyPage_Applet|"myPage"]]
|}
 
=== LibraryAppletMode ===
{| class="wikitable" border="1"
|-
|-
!  ID
| 23 || [20.1.1+]
!  Description
|-
| 0x0
| AllForeground
|-
|-
| 0x1
| 24 || [20.1.1+]
| Background
|-
|-
| 0x2
| 31 || [[#GetFrameBufferInfo|GetFrameBufferInfo]]
| No UI
|-
|-
| 0x3
| 8001 || [[#GetFrameBufferInfoForDebug|GetFrameBufferInfoForDebug]]
| Background with indirect display, see also [[#GetIndirectLayerConsumerHandle]]. Only used by swkbd InlineKeyboard.
|-
|-
| 0x4
| 8003 || [19.0.0-19.1.0]
| AllForegroundInitiallyHidden. Can be used by [7.0.0+] [[Internet_Browser|WebSession]].
|-
|-
| 8004 || 
|}
|}


=== AppletMessage ===
=== GetEvent ===
{| class="wikitable" border="1"
Unofficial name.
|-
 
!  ID
No input. Returns an output Event handle.
!  Description
|-
| 0x4 || Exit requested
|-
| 0xF || [[#GetCurrentFocusState|FocusState]] changed
|-
| 0x10 || Current applet execution was [[#SetRestartMessageEnabled|resumed]].
|-
| 0x1E || OperationMode changed
|-
| 0x1F || PerformanceMode changed
|-
| 0x33 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]. Indicates that [[#ApproveToDisplay]] should be used.
|-
| 0x5A || Capture button was [[#SetRequiresCaptureButtonShortPressedMessage|short-pressed]].
|-
| 0x5C || Screenshot was [[#SetAlbumImageTakenNotificationEnabled|taken]].
|}


This is "nn::am::AppletMessage".
=== Cmd3 ===
Takes a handle. No output.


=== OperationMode ===
=== Cmd10 ===
{| class="wikitable" border="1"
Takes an input u32. No output.
|-
!  Value
!  Description
|-
| 0 || Handheld
|-
| 1 || Docked
|}


=== TvPowerStateMatchingMode ===
=== Cmd11 ===
{| class="wikitable" border="1"
Takes an input u32. No output.
|-
!  Value
!  Description
|-
| 0 || Unknown
|-
| 1 || Unknown
|}


This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
=== Cmd12 ===
Takes an input u64. Returns an output u32.
 
=== Cmd13 ===
Takes an input u32. Returns an output u32.
 
=== Cmd15 ===
Takes an input u32. Returns three output u32s.
 
=== Cmd16 ===
No input. Returns an output u32.
 
=== Cmd17 ===
Takes an input u32. Returns an output u32 and an output u16.
 
=== Cmd18 ===
Takes an input u32. Returns three output u32s and an output u16.
 
=== Cmd19 ===
Takes an input u32. Returns an output u32 and an output u16.
 
=== Cmd21 ===
Takes an input u32. Returns a struct of size 0x40.
 
=== Cmd22 ===
Takes a struct of size 0x20. Returns a struct of size 0x40.
 
=== Cmd23 ===
No input. Returns a struct of size 0xC8.
 
=== Cmd24 ===
Takes an ipc-buf with size 0xD8. No output.
 
=== GetFrameBufferInfo ===
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].
 
[[#(S2)_AdrawFrameBufferInfo|Id]] is "adrawfb".
 
=== GetFrameBufferInfoForDebug ===
Unofficial name.
 
No input. Returns an [[#(S2)_AdrawFrameBufferInfo|AdrawFrameBufferInfo]].
 
=== Cmd8003 ===
Takes an input u64. Returns a struct with size 0x18.
 
=== Cmd8004 ===
Takes an input u32. Returns an output u64.
 
= (S2) appletOE =
This is "nn::am::service::IApplicationProxyServiceForNxCompat".


=== SystemButtonType ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name
!  Description
|-
|-
| 1 || PerformHomeButtonShortPressing
| 0 || [[#OpenApplicationProxy]]
|-
| 2 || PerformHomeButtonLongPressing
|-
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
|-
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
|-
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].
|-
| 6 || PerformCaptureButtonShortPressing
|-
|-
| 7 || PerformCaptureButtonLongPressing
| 2000 || [[#OpenCompatApplicationFunctions]]
|}
|}


This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
== OpenCompatApplicationFunctions ==
No input. Returns an [[#INxCompatApplicationFunctions]].
 
== INxCompatApplicationFunctions ==
This is "nn::am::service::INxCompatApplicationFunctions".


=== LaunchParameterKind ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name
!  Description
|-
| 2000 || [[#GetGraphicsInterfaceForNxCompat]]
|-
|-
| 1 || UserChannel. Application-specific LaunchParameter.
| 2001 ||  
|-
|-
| 2 || account PreselectedUser
| 2002 ||
|-
|-
| 3 || Unknown if used by anything?
| 2003 || [[#SetCopyright]]
|}
 
=== LibraryAppletExitReason ===
{| class="wikitable" border="1"
|-
|-
! Value
| 2004 ||  
!  Description
|-
|-
| 0 || Normal
| 2010 ||
|-
|-
| 1 || Canceled
| 2020 || [[#Initialize]]
|-
|-
| 2 || Abnormal
| 2030 || [[#GetVsyncEvent]]
|-
|-
| 10 || Unexpected
| 2040 || [[#GetVsyncTimestamp]]
|}
 
=== ProgramSpecifyKind ===
{| class="wikitable" border="1"
|-
|-
!  Value
| 2050 ||
!  Description
|-
|-
| 0 || u8 ProgramIndex. "ExecuteProgram". [[NS_Services|NS]] handles ProgramIndex by launching titleID {application_titleID}+ProgramIndex. After using [[#ExecuteProgram]] with this successfully, official user-processes will enter an infinite loop with sleep-thread value 86400000000000.
| 2060 ||  
|-
| 1 || u64 titleID. "JumpToSubApplicationProgramForDevelopment". Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.
|-
| 2 || u64 = value 0. "RestartProgram"
|-
|-
| 2070 || [[#CreateMovieMaker]]
|}
|}


This is "nn::am::service::ProgramSpecifyKind". This controls the type of the u64 passed to [[#ExecuteProgram]].
=== GetGraphicsInterfaceForNxCompat ===
Unofficial name.
 
No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]].


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.
Same as [[#GetGraphicsInterface]] but for compat mode.


= InputDetectionPolicy =
=== SetCopyright ===
{| class="wikitable" border="1"
Unofficial name.
|-
!  Value
!  Description
|-
| 0 || Unknown.
|-
| 1 || Unknown.
|}


This is u32 enum "nn::applet::InputDetectionPolicy".
Takes an input bool. No output.


= AppletResourceUserId =
Called directly after "nn::vi::WriteToCopyrightFramebuffer".
This u64 is officially called "nn::applet::AppletResourceUserId". Used by a number of non-AM services.


= AppletAttribute =
=== Initialize ===
{| class="wikitable" border="1"
Unofficial name.
|-
! Offset || Size || Description
|-
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.
|-
| 0x1 || 0x7F || Unused
|}


This is "nn::am::AppletAttribute". This struct is 0x8-bytes.
No input/output.


This is used by [[#OpenLibraryAppletProxy]].
Called during init.


= AppletProcessLaunchReason =
=== GetVsyncEvent ===
{| class="wikitable" border="1"
Unofficial name.
|-
 
! Offset || Size || Description
No input. Returns an Event handle.
|-
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].
|-
| 0x1 || 0x2 || Always 0.
|-
| 0x3 || 0x1 || Always 0.
|}


This is "nn::am::service::AppletProcessLaunchReason". This struct is 0x4-bytes.
=== GetVsyncTimestamp ===
Unofficial name.


= LibraryAppletInfo =
No input. Returns an output u64.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#AppletId]]
|-
| 0x4 || 0x4 || [[#LibraryAppletMode]]
|}


This is "nn::am::service::LibraryAppletInfo". This struct is 0x8-bytes.
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp.


= AppletKind =
= (S2) GraphicsInterface =
This is "nn::am::service::AppletKind". This is 8-bytes.
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.


= AppletIdentityInfo =
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
! Cmd || Name
|-
|-
| 0x0 || 0x4 || [[#AppletId]]
| 1 || [[#InitializeGraphicsWithTransferMemory]]  
|-
|-
| 0x4 || 0x4 || Padding
| 4 || [[#InitializeGraphics]]
|-
|-
| 0x8 || 0x8 || titleID
| 11 || [[#SetCurrentProcessHandle]]
|}
 
This struct is "nn::am::service::AppletIdentityInfo". This struct is 0x10-bytes.
 
= ApplicationAttributeForQuest =
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 12 ||  
|-
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
| 101 || [[#StartGraphics]]
|-
|-
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
| 111 ||  
|-
|-
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
| 112 ||  
|}
 
This struct is "nn::applet::ApplicationAttributeForQuest".
 
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 =
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 114 ||  
|-
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
| 115 ||  
|-
|-
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
| 187 ||  
|-
|-
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
| 201 ||  
|-
|-
| 0xC || 0x14 || Unused. Default is 0.
| 301 ||  
|}
 
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
 
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
 
= ApplicationLaunchProperty =
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 303 ||  
|-
|-
| 0x0 || 0x8 || Application titleID.
| 311 ||  
|-
|-
| 0x8 || 0x4 || Application title-version.
| 312 ||  
|-
|-
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
| 314 ||  
|-
|-
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
| 315 ||  
|-
|-
| 0xE || 0x1 || Unknown.
| 321 ||  
|-
|-
| 0xF || 0x1 || Padding.
| 327 ||  
|}
 
This struct is 0x10-bytes.
 
= ApplicationLaunchRequestInfo =
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 391 ||  
|-
|-
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
| 401 || [[#PrepareGpuManagerSession]]
|-
|-
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
| 402 || [[#StartGpuManagerSession]]
|-
| 423 ||
|-
| 428 || [[#GetImageInfo]]
|-
| 434 ||
|-
| 494 ||
|-
| 496 || [[#CreateGpuManagerSessionWithTransferMemory]]
|-
| 497 || [[#CreateGpuManagerSession]]
|-
| 901 ||
|-
| 902 ||
|-
| 903 ||
|-
| 905 ||
|-
| 911 ||
|-
| 912 ||
|-
| 922 ||
|-
| 961 ||
|-
| 991 ||
|-
| 1001 ||
|-
| 1002 ||
|-
| 1003 ||
|-
| 1101 ||
|-
| 1102 ||
|-
| 1301 || [[#InitializeAdraw]]
|-
| 1302 || [[#StartAdraw]]
|-
| 1325 || [[#GetAdrawFrameBufferHandle]]
|-
| 1326 || [[#GetAdrawImageHandle]]
|-
|-
| 0x8 || 0x8 || Unknown. The default is 0x0.
| 1401 || [[#CreateNvDrv2UserSessionWithTransferMemory]]
|}
 
This struct is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
 
= AppletResourceUsageInfo =
{| class="wikitable" border="1"
|-
|-
! Offset || Size || Description
| 1402 || [[#CreateNvDrv2UserSession]]
|-
|-
| 0x0 || 0x4 || Unknown counter.
| 1411 || [[#GetNvDrv2UserTransferMemoryUsage]]
|-
|-
| 0x4 || 0x4 || Unknown counter.
| 1501 ||
|-
|-
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
| 1502 ||  
|-
|-
| 0xC || 0x14 || Always zero.
| 1601 ||  
|}
|-
| 1602 ||
|-
| 1603 ||
|-
| 1611 ||
|-
| 1612 ||
|-
| 1691 ||  
|}


This struct is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
== 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]].
 
== GetImageInfo ==
Unofficial name.
 
Takes an input u32 '''ImageHandle'''. Returns an [[#(S2)_ImageInfo|ImageInfo]].
 
== 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.
 
== InitializeAdraw ==
Unofficial name.
 
No input/output.
 
== StartAdraw ==
Unofficial name.
 
No input/output.
 
Called directly after [[#InitializeAdraw]].
 
== GetAdrawFrameBufferHandle ==
Unofficial name.
 
Takes an input u64. Returns an output u32 '''FrameBufferHandle'''.
 
Official software sends the [[#(S2)_AdrawFrameBufferInfo|Id]] obtained with [[#GetFrameBufferInfo|GetFrameBufferInfo]] from [[#(S2)_adraw:a|adraw]].
 
== GetAdrawImageHandle ==
Unofficial name.
 
Takes seven input u64s, two input u16s and two input u32s. Returns an output u32 '''ImageHandle'''.
 
Official software sends 0x100000000 in the first u64, 0 in all remaining u64s, [[#(S2)_AdrawFrameBufferInfo|Width]] and [[#(S2)_AdrawFrameBufferInfo|Height]] in the two u16s, [[#(S2)_AdrawFrameBufferInfo|BlockCount]] int the first u32 and the '''FrameBufferHandle''' from [[#GetAdrawFrameBufferHandle|GetAdrawFrameBufferHandle]] in the last u32.
 
== 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]].
 
Only one session can be open at a time, otherwise returns error 0x200f3.
 
== 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.
 
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
|-
| 101 || [[#CreateGpuMemory]]
|-
| 102 || [[#DestroyGpuMemory]]
|-
| 201 || [19.0.0-19.1.0] MapMemory
|-
| 202 || [19.0.0-19.1.0] UnmapMemory
|-
| 203 || [19.0.0-19.1.0] AllocateAddressSpace
|-
| 204 || [19.0.0-19.1.0] FreeAddressSpace
|-
| 205 || [19.0.0-19.1.0] RemapMemory
|-
| 207 || [19.0.0-19.1.0] ModifyMemoryMapping
|-
| 211 || [20.1.1+] MapMemoryV2
|-
| 212 || [20.1.1+] ModifyMemoryMappingV2
|-
| 213 || [20.1.1+] UnmapMemoryV2
|-
| 214 || [20.1.1+] AllocateAddressSpaceV2
|-
| 215 || [20.1.1+] FreeAddressSpaceV2
|-
| 216 || [20.1.1+] RemapMemoryV2
|}
 
==== 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
|-
| 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
|-
| 0x00000000
|
| None
|-
| 0x00000001
|
| Application (not valid for use with LibraryApplets)
|-
| 0x00000002
| 0x010000000000100C
| OverlayApplet (overlayDisp)
|-
| 0x00000003
| 0x0100000000001000
| SystemAppletMenu (qlaunch)
|-
| 0x00000004
| 0x0100000000001012
| SystemApplication (starter)
|-
| 0x0000000A
| 0x0100000000001001
| [[Auth_Applet|LibraryAppletAuth (auth)]]
|-
| 0x0000000B
| 0x0100000000001002
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]
|-
| 0x0000000C
| 0x0100000000001003
| [[Controller_Applet|LibraryAppletController (controller)]]
|-
| 0x0000000D
| 0x0100000000001004
| LibraryAppletDataErase (dataErase)
|-
| 0x0000000E
| 0x0100000000001005
| [[Error_Applet|LibraryAppletError (error)]]
|-
| 0x0000000F
| 0x0100000000001006
| LibraryAppletNetConnect (netConnect)
|-
| 0x00000010
| 0x0100000000001007
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]
|-
| 0x00000011
| 0x0100000000001008
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]
|-
| 0x00000012
| 0x0100000000001009
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]
|-
| 0x00000013
| 0x010000000000100A
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]
|-
| 0x00000014
| 0x010000000000100B
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]
|-
| 0x00000015
| 0x010000000000100D
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]
|-
| 0x00000016
| 0x010000000000100E
| LibraryAppletSet (set)
|-
| 0x00000017
| 0x010000000000100F
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] (LibraryAppletOfflineWebApp_0 in Ounce)
|-
| 0x00000018
| 0x0100000000001010
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]
|-
| 0x00000019
| 0x0100000000001011
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]
|-
| 0x0000001A
| 0x0100000000001013
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]
|-
| 0x0000001B
| 0x010000000000101A
| LibraryAppletGift (gift)
|-
| 0x0000001C
| 0x010000000000101C
| LibraryAppletUserMigration (userMigration)
|-
| 0x0000001D
| 0x010000000000101D
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)
|-
| 0x0000001E
| 0x0100000000001020
| [9.0.0+] LibraryAppletStory (story)
|-
| 0x0000001F
| 0x010070000E3C0000
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)
|-
| 0x00000020
| 0x010086000E49C000
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)
|-
| 0x00000021
| 0x0100000000001038
| [10.0.0+] LibraryAppletSample (sample)
|-
| 0x00000022
| 0x0100000000001007
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)
|-
| 0x00000032
| 0x010000000000100F
| [17.0.0+] LibraryAppletOfflineWebApp_3 ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
| 0x00000033
| 0x010000000000100F
| [17.0.0+] LibraryAppletOfflineWebSystem ([[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]] in NX)
|-
| 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)
|-
| 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)
|-
| 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)
|-
| 0x00000038
| 0x0100000000001043
| [16.0.0-16.1.0]
|-
| 0x00000050
| 0x0100000000001007
| [18.0.0+]
|-
| 0x00000051
| 0x0100000000001007
| [18.0.0+]
|-
| 0x00000064
| 0x0100000000001048
| [20.0.0+] [[Splay_Applet|splay]]
|-
| 0x000003E8
|
| [10.0.0-16.1.0] DevlopmentTool
|-
| 0x000003F1
| 0x010000000000D619
| [10.0.0-16.1.0] CombinationLA
|-
| 0x000003F2
| 0x010000000000D610
| [10.0.0-16.1.0] AeSystemApplet
|-
| 0x000003F3
| 0x010000000000D611
| [10.0.0-16.1.0] AeOverlayApplet
|-
| 0x000003F4
| 0x010000000000D612
| [10.0.0-16.1.0] AeStarter
|-
| 0x000003F5
| 0x010000000000D613
| [10.0.0-16.1.0] AeLibraryAppletAlone
|-
| 0x000003F6
| 0x010000000000D614
| [10.0.0-16.1.0] AeLibraryApplet1
|-
| 0x000003F7
| 0x010000000000D615
| [10.0.0-16.1.0] AeLibraryApplet2
|-
| 0x000003F8
| 0x010000000000D616
| [10.0.0-16.1.0] AeLibraryApplet3
|-
| 0x000003F9
| 0x010000000000D617
| [10.0.0-16.1.0] AeLibraryApplet4
|-
| 0x000003FA
| 0x010000000000D60A
| [10.0.0-16.1.0] AppletISA
|-
| 0x000003FB
| 0x010000000000D60B
| [10.0.0-16.1.0] AppletIOA
|-
| 0x000003FC
| 0x010000000000D60C
| [10.0.0-16.1.0] AppletISTA
|-
| 0x000003FD
| 0x010000000000D60D
| [10.0.0-16.1.0] AppletILA1
|-
| 0x000003FE
| 0x010000000000D60E
| [10.0.0-16.1.0] AppletILA2
|-
| 0x0100000E
|
| [S2] LibraryAppletError
|-
| 0x01000010
|
| [S2] LibraryAppletPlayerSelect
|-
| 0x01010011
|
| [S2] SwkbdModeless
|-
| 0x01020011
|
| [S2] Swkbd
|-
| 0x01000013
|
| [S2] OpenWeb
|-
| 0x01000014
|
| [S2] LibraryAppletShop
|-
| 0x01000022
|
| [S2] LibraryAppletPromoteQualification
|-
| 0x01010025
|
| [S2] SaveDataBackup
|-
| 0x01020025
|
| [S2] SaveDataBackup
|-
| 0x01000032
|
| [S2] LibraryAppletOfflineWebApp_3
|-
| 0x01000033
|
| [S2] LibraryAppletOfflineWebSystem
|-
| 0x01000035
|
| [S2] LibraryAppletLhub
|-
| 0x01000036
|
| [S2] LibraryAppletLogin
|-
| 0x01000037
|
| [S2] LibraryAppletShare
|-
| 0x01000050
|
| [S2] PlayerSelect
|-
| 0x01000051
|
| [S2] PlayerSelect
|-
| 0x01000052
|
| [S2] PlayerSelect
|-
| 0x700000C8
| 0x010000000000D65B
| [18.0.0+]
|-
| 0x700000C9
| 0x010000000000D65C
| [18.0.0+]
|-
| 0x700000DC
| 0x010000000000D619
| [17.0.0+] CombinationLA
|-
| 0x700000E6
| 0x010000000000D610
| [17.0.0+] AeSystemApplet
|-
| 0x700000E7
| 0x010000000000D611
| [17.0.0+] AeOverlayApplet
|-
| 0x700000E8
| 0x010000000000D612
| [17.0.0+] AeStarter
|-
| 0x700000E9
| 0x010000000000D613
| [17.0.0+] AeLibraryAppletAlone
|-
| 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
|-
| 0x700000F3
| 0x010000000000D60D
| [17.0.0+] AppletILA1
|-
| 0x700000F4
| 0x010000000000D60E
| [17.0.0+] AppletILA2
|-
| 0x700000FA
| 0x010000000000D677
| [20.1.0+]
|}
 
= LibraryAppletMode =
This is "nn::applet::LibraryAppletMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0x0
| AllForeground
|-
| 0x1
| 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 =
This is "nn::am::AppletMessage".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || None
|-
| 1 || ChangeIntoForeground
|-
| 2 || ChangeIntoBackground
|-
| 4 || Exit
|-
| 6 || ApplicationExited
|-
| 7 ||
|-
| 15 || [[#FocusState|FocusStateChanged]]
|-
| 16 || [[#SetRestartMessageEnabled|Resume]]
|-
| 20 || DetectShortPressingHomeButton
|-
| 21 || DetectLongPressingHomeButton
|-
| 22 || DetectShortPressingPowerButton
|-
| 23 || DetectMiddlePressingPowerButton
|-
| 24 || DetectLongPressingPowerButton
|-
| 25 || RequestToPrepareSleep
|-
| 26 || FinishedSleepSequence
|-
| 27 || SleepRequiredByHighTemperature
|-
| 28 || SleepRequiredByLowBattery
|-
| 29 || AutoPowerDown
|-
| 30 || [[#OperationMode|OperationModeChanged]]
|-
| 31 || [[#PerformanceMode|PerformanceModeChanged]]
|-
| 32 || DetectReceivingCecSystemStandby
|-
| 33 || SdCardRemoved
|-
| 34 ||
|-
| 50 || LaunchApplicationRequested
|-
| 51 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]
|-
| 55 || ShowApplicationLogo
|-
| 56 || HideApplicationLogo
|-
| 57 || ForceHideApplicationLogo
|-
| 58 ||
|-
| 59 ||
|-
| 60 || FloatingApplicationDetected
|-
| 61 || [7.0.0+] PerformanceConfigurationChanged
|-
| 70 ||
|-
| 71 ||
|-
| 72 ||
|-
| 73 ||
|-
| 75 ||
|-
| 80 ||
|-
| 81 ||
|-
| 82 ||
|-
| 83 ||
|-
| 85 ||
|-
| 86 ||
|-
| 90 || [[#SetRequiresCaptureButtonShortPressedMessage|DetectShortPressingCaptureButton]]
|-
| 92 || [[#SetAlbumImageTakenNotificationEnabled|AlbumScreenShotTaken]]
|-
| 93 || AlbumRecordingSaved
|-
| 94 ||
|-
| 100 ||
|-
| 101 ||
|-
| 110 || [14.0.0+] DetectShortPressingCaptureButtonForApplet
|-
| 111 || [14.0.0+] DetectLongPressingCaptureButtonForApplet
|-
| 1000 ||
|}
 
= OperationMode =
This is "nn::oe::OperationMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Handheld
|-
| 1 || Console
|}
 
= PerformanceMode =
This is "nn::oe::PerformanceMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| -1 || Invalid
|-
| 0 || Normal
|-
| 1 || Boost
|}
 
= FocusState =
This is "nn::oe::FocusState".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 1 || InFocus
|-
| 2 || OutOfFocus
|-
| 3 || Background
|}
 
= CpuBoostMode =
This is "nn::oe::CpuBoostMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Normal
|-
| 1 || FastLoad
|}
 
= WindowOriginMode =
This is "nn::oe::WindowOriginMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || LowerLeft
|-
| 1 || UpperLeft
|}
 
= WirelessPriorityMode =
This is "nn::oe::WirelessPriorityMode".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Default
|-
| 1 || OptimizedForWlan
|}
 
= TvPowerStateMatchingMode =
This is "nn::oe::TvPowerStateMatchingMode". This is used with [[#SetTvPowerStateMatchingMode]].
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Unknown
|-
| 1 || Unknown
|}
 
= SystemButtonType =
This is "nn::am::service::SystemButtonType". This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 1 || PerformHomeButtonShortPressing
|-
| 2 || PerformHomeButtonLongPressing
|-
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
|-
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].
|-
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].
|-
| 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 =
This struct is "nn::applet::ApplicationAttributeForQuest".
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x4 || 0x4 || See [[#ApplicationAttribute]].
|-
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].
|}
 
User-processes copy the first 0x8-bytes (0xC-bytes with [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]/[[#CreateApplicationWithAttributeAndRequestToStartForQuest]]) to a [[#ApplicationAttribute]] with the rest of the struct being cleared, which is then passed to the actual cmd (CreateApplication*ToStartForQuest).
 
= ApplicationAttribute =
This struct is "nn::am::ApplicationAttribute". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
|-
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.
|-
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.
|-
| 0xC || 0x14 || Unused. Default is 0.
|}
 
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.
 
= ApplicationLaunchProperty =
This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x8 || 0x4 || Application title-version.
|-
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.
|-
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.
|-
| 0xE || 0x1 || Unknown.
|-
| 0xF || 0x1 || Padding.
|}
 
= ApplicationLaunchRequestInfo =
This is "nn::applet::ApplicationLaunchRequestInfo". This struct is 0x10-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
|-
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].
|-
| 0x8 || 0x8 || Unknown. The default is 0x0.
|}
 
= AppletResourceUsageInfo =
This is "nn::am::service::AppletResourceUsageInfo". This struct is 0x20-bytes.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Unknown counter.
|-
| 0x4 || 0x4 || Unknown counter.
|-
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].
|-
| 0xC || 0x14 || Always zero.
|}
 
= ApplicationLicenseType =
This is "nn::oe::ApplicationLicenseType". This is 1-byte.
 
= LaunchRequiredVersion =
This is "nn::oe::LaunchRequiredVersion". This is a 0x40-byte struct with 1-byte alignment.
 
= ServerEnvironmentType =
This is "nn::oe::ServerEnvironmentType".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || dd
|-
| 1 || lp
|-
| 2 || sd
|-
| 3 || sp
|-
| 4 || dp
|}
 
= (S2) AdrawFrameBufferInfo =
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 || Id
|-
| 0x8 || 0x2 || Width
|-
| 0xA || 0x2 || Height
|-
| 0xC || 0x4 || BlockCount
|-
| 0x10 || 0x8 ||
|-
| 0x18 || 0x8 ||
|-
| 0x20 || 0x8 ||
|}
 
= (S2) ImageInfo =
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 ||
|-
| 0x8 || 0x8 || Address
|-
| 0x10 || 0x8 ||
|-
| 0x18 || 0x8 ||
|-
| 0x20 || 0x8 ||
|-
| 0x28 || 0x8 ||
|-
| 0x30 || 0x8 ||
|-
| 0x38 || 0x4 || Offset
|-
| 0x3C || 0x4 || Size
|-
| 0x40 || 0x8 ||
|-
| 0x48 || 0x8 ||
|-
| 0x50 || 0x8 ||
|-
| 0x58 || 0x8 ||
|-
| 0x60 || 0x8 ||
|-
| 0x68 || 0x8 ||
|-
| 0x70 || 0x8 ||
|-
| 0x78 || 0x8 ||
|-
| 0x80 || 0x8 ||
|-
| 0x88 || 0x8 ||
|-
| 0x90 || 0x4 || Flags
|}


= Notes =
= Notes =
AM-sysmodule will only initialize [[Shared_Database_services|pdm:ntfy]] / use pdm:ntfy service commands when the value from [[Process_Manager_services|pm:bm]] GetBootMode is not 0x1.
AM-sysmodule will only initialize [[Shared_Database_services|pdm:ntfy]] / use pdm:ntfy service commands when the value from [[Process_Manager_services|pm:bm]] GetBootMode is not 0x1 (Maintenance).
 
An object constructor also writes the output from [[Process_Manager_services|pm:bm]] GetBootMode into the created object. A vfunc for this object checks whether this field is Maintenance: if so, it calls a vfunc then a func and returns. Otherwise after calling various (v)funcs, if required this eventually uses [[OMM_services|ommdisp]] cmd600.


[[Category:Services]]
[[Category:Services]]